From fae6d1bc2d93cb682456e3cabac5ed499ba49b65 Mon Sep 17 00:00:00 2001 From: Jules Faivre Date: Wed, 18 Jan 2023 13:42:48 +0100 Subject: [PATCH 1/2] feat/add-audience-feed-error-method-response-interface --- package.json | 2 +- .../AudienceFeedConnectorPluginResponseInterface.ts | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 3ac6e34e..aa567b23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mediarithmics/plugins-nodejs-sdk", - "version": "0.10.0", + "version": "0.10.1", "description": "This is the mediarithmics nodejs to help plugin developers bootstrapping their plugin without having to deal with most of the plugin boilerplate", "repository": "github:MEDIARITHMICS/plugins-nodejs-sdk", "main": "./lib/index.js", diff --git a/src/mediarithmics/api/plugin/audiencefeedconnector/AudienceFeedConnectorPluginResponseInterface.ts b/src/mediarithmics/api/plugin/audiencefeedconnector/AudienceFeedConnectorPluginResponseInterface.ts index 388ef5c2..46eaf3c6 100644 --- a/src/mediarithmics/api/plugin/audiencefeedconnector/AudienceFeedConnectorPluginResponseInterface.ts +++ b/src/mediarithmics/api/plugin/audiencefeedconnector/AudienceFeedConnectorPluginResponseInterface.ts @@ -2,7 +2,7 @@ export type AudienceFeedConnectorStatus = 'ok' | 'error'; export declare type AudienceFeedConnectorConnectionStatus = 'ok' | 'error' | 'external_segment_not_ready_yet'; export type AudienceFeedConnectorContentType = 'text/csv' | 'application/json' | 'text/plain'; -export interface UserSegmentUpdatePluginResponse { +export interface UserSegmentUpdatePluginResponse extends AudienceFeedMethodErrorResponse { status: UserSegmentUpdatePluginResponseStatus; data?: DeliveryType[]; stats?: UserSegmentUpdatePluginResponseStats[]; @@ -37,13 +37,13 @@ export interface UserSegmentUpdatePluginResponseStats { tags?: AudienceFeedStatTag[]; } -export interface ExternalSegmentCreationPluginResponse { +export interface ExternalSegmentCreationPluginResponse extends AudienceFeedMethodErrorResponse { status: AudienceFeedConnectorStatus; message?: string; visibility?: 'PRIVATE' | 'PUBLIC'; } -export interface ExternalSegmentConnectionPluginResponse { +export interface ExternalSegmentConnectionPluginResponse extends AudienceFeedMethodErrorResponse { status: AudienceFeedConnectorConnectionStatus; message?: string; } @@ -54,3 +54,8 @@ export interface AudienceFeedStatTag { key: string; value: string; } + +export interface AudienceFeedMethodErrorResponse { + error_code?: string; + error_origin?: string; +} From a320caddfc11a5dd5cc88f610a8ce63a94cace1e Mon Sep 17 00:00:00 2001 From: Jules Faivre Date: Wed, 18 Jan 2023 13:44:53 +0100 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9481bce..78fb9612 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,21 @@ # Changelog +# 0.10.1 + +- add new AudienceFeedMethodErrorResponse interface in prevision of the error handling: + +``` +export interface AudienceFeedMethodErrorResponse { + error_code?: string; + error_origin?: string; +} + +``` + # 0.10.0 - 2022-10-28 Breaking changes in UserSegmentUpdatePluginResponse. + - update the Audience feed onUserSegmentUpdate method return type. Interface UserSegmentUpdatePluginResponse data optional element is now of type DeliveryType. - status can be 'no_eligible_identifier' now (status code 400); - stats field is changed (UserSegmentUpdatePluginResponseStats);