@gofynd/fdk-client-javascript 1.4.6 → 1.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +1 -1
  2. package/package.json +2 -2
  3. package/sdk/application/ApplicationClient.d.ts +2 -0
  4. package/sdk/application/ApplicationClient.js +2 -0
  5. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +6 -0
  6. package/sdk/application/Catalog/CatalogApplicationModel.js +6 -0
  7. package/sdk/application/Content/ContentApplicationModel.d.ts +2 -0
  8. package/sdk/application/Content/ContentApplicationModel.js +2 -0
  9. package/sdk/application/Order/OrderApplicationModel.d.ts +70 -9
  10. package/sdk/application/Order/OrderApplicationModel.js +43 -7
  11. package/sdk/application/Payment/PaymentApplicationModel.d.ts +18 -18
  12. package/sdk/application/Payment/PaymentApplicationModel.js +18 -18
  13. package/sdk/application/Webhook/WebhookApplicationClient.d.ts +22 -0
  14. package/sdk/application/Webhook/WebhookApplicationClient.js +115 -0
  15. package/sdk/application/Webhook/WebhookApplicationModel.d.ts +37 -0
  16. package/sdk/application/Webhook/WebhookApplicationModel.js +46 -0
  17. package/sdk/application/Webhook/WebhookApplicationValidator.d.ts +16 -0
  18. package/sdk/application/Webhook/WebhookApplicationValidator.js +19 -0
  19. package/sdk/application/index.d.ts +1 -0
  20. package/sdk/application/index.js +2 -0
  21. package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +2 -2
  22. package/sdk/partner/Webhook/WebhookPartnerClient.js +2 -2
  23. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +23 -19
  24. package/sdk/partner/Webhook/WebhookPartnerModel.js +19 -22
  25. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +43 -0
  26. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +257 -0
  27. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +39 -0
  28. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +45 -0
  29. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +60 -0
  30. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +57 -0
  31. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +10 -0
  32. package/sdk/platform/Cart/CartPlatformApplicationClient.js +80 -0
  33. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +13 -1
  34. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +12 -0
  35. package/sdk/platform/Cart/CartPlatformModel.d.ts +2 -0
  36. package/sdk/platform/Cart/CartPlatformModel.js +2 -0
  37. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +9 -5
  38. package/sdk/platform/Catalog/CatalogPlatformClient.js +19 -12
  39. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +118 -17
  40. package/sdk/platform/Catalog/CatalogPlatformModel.js +137 -15
  41. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +12 -7
  42. package/sdk/platform/Catalog/CatalogPlatformValidator.js +7 -5
  43. package/sdk/platform/Content/ContentPlatformModel.d.ts +2 -0
  44. package/sdk/platform/Content/ContentPlatformModel.js +2 -0
  45. package/sdk/platform/Order/OrderPlatformClient.d.ts +11 -1
  46. package/sdk/platform/Order/OrderPlatformClient.js +82 -5
  47. package/sdk/platform/Order/OrderPlatformModel.d.ts +163 -15
  48. package/sdk/platform/Order/OrderPlatformModel.js +92 -14
  49. package/sdk/platform/Order/OrderPlatformValidator.d.ts +58 -17
  50. package/sdk/platform/Order/OrderPlatformValidator.js +28 -16
  51. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2 -2
  52. package/sdk/platform/Payment/PaymentPlatformModel.js +2 -2
  53. package/sdk/platform/PlatformApplicationClient.d.ts +2 -0
  54. package/sdk/platform/PlatformApplicationClient.js +4 -0
  55. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +24 -0
  56. package/sdk/platform/Webhook/WebhookPlatformClient.js +164 -0
  57. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +71 -18
  58. package/sdk/platform/Webhook/WebhookPlatformModel.js +75 -22
  59. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +19 -1
  60. package/sdk/platform/Webhook/WebhookPlatformValidator.js +24 -0
  61. package/sdk/platform/index.d.ts +1 -0
  62. package/sdk/platform/index.js +2 -0
  63. package/sdk/public/Webhook/WebhookPublicClient.d.ts +2 -2
  64. package/sdk/public/Webhook/WebhookPublicClient.js +2 -2
  65. package/sdk/public/Webhook/WebhookPublicModel.d.ts +2 -0
  66. package/sdk/public/Webhook/WebhookPublicModel.js +2 -0
@@ -0,0 +1,115 @@
1
+ const ApplicationAPIClient = require("../ApplicationAPIClient");
2
+ const {
3
+ FDKClientValidationError,
4
+ FDKResponseValidationError,
5
+ } = require("../../common/FDKError");
6
+ const constructUrl = require("../constructUrl");
7
+ const Paginator = require("../../common/Paginator");
8
+ const WebhookApplicationValidator = require("./WebhookApplicationValidator");
9
+ const WebhookApplicationModel = require("./WebhookApplicationModel");
10
+ const { Logger } = require("./../../common/Logger");
11
+ const Joi = require("joi");
12
+
13
+ class Webhook {
14
+ constructor(_conf) {
15
+ this._conf = _conf;
16
+ this._relativeUrls = {
17
+ saveClickEvent:
18
+ "/service/application/webhook/v1.0/click-analytics/events",
19
+ };
20
+ this._urls = Object.entries(this._relativeUrls).reduce(
21
+ (urls, [method, relativeUrl]) => {
22
+ urls[method] = `${_conf.domain}${relativeUrl}`;
23
+ return urls;
24
+ },
25
+ {}
26
+ );
27
+ }
28
+
29
+ updateUrls(urls) {
30
+ this._urls = {
31
+ ...this._urls,
32
+ ...urls,
33
+ };
34
+ }
35
+
36
+ /**
37
+ * @param {WebhookApplicationValidator.SaveClickEventParam} arg - Arg object.
38
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
39
+ * @param {import("../ApplicationAPIClient").Options} - Options
40
+ * @returns {Promise<WebhookApplicationModel.ClickEventResponse>} - Success response
41
+ * @name saveClickEvent
42
+ * @summary: Endpoint to capture click events from sales channels and persist them in database.
43
+ * @description: Endpoint to capture click events from sales channels. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/webhook/saveClickEvent/).
44
+ */
45
+ async saveClickEvent(
46
+ { body, requestHeaders } = { requestHeaders: {} },
47
+ { responseHeaders } = { responseHeaders: false }
48
+ ) {
49
+ const { error } = WebhookApplicationValidator.saveClickEvent().validate(
50
+ { body },
51
+ { abortEarly: false, allowUnknown: true }
52
+ );
53
+ if (error) {
54
+ return Promise.reject(new FDKClientValidationError(error));
55
+ }
56
+
57
+ // Showing warrnings if extra unknown parameters are found
58
+ const {
59
+ error: warrning,
60
+ } = WebhookApplicationValidator.saveClickEvent().validate(
61
+ { body },
62
+ { abortEarly: false, allowUnknown: false }
63
+ );
64
+ if (warrning) {
65
+ Logger({
66
+ level: "WARN",
67
+ message: `Parameter Validation warrnings for application > Webhook > saveClickEvent \n ${warrning}`,
68
+ });
69
+ }
70
+
71
+ const query_params = {};
72
+
73
+ const xHeaders = {};
74
+
75
+ const response = await ApplicationAPIClient.execute(
76
+ this._conf,
77
+ "post",
78
+ constructUrl({
79
+ url: this._urls["saveClickEvent"],
80
+ params: {},
81
+ }),
82
+ query_params,
83
+ body,
84
+ { ...xHeaders, ...requestHeaders },
85
+ { responseHeaders }
86
+ );
87
+
88
+ let responseData = response;
89
+ if (responseHeaders) {
90
+ responseData = response[0];
91
+ }
92
+
93
+ const {
94
+ error: res_error,
95
+ } = WebhookApplicationModel.ClickEventResponse().validate(responseData, {
96
+ abortEarly: false,
97
+ allowUnknown: true,
98
+ });
99
+
100
+ if (res_error) {
101
+ if (this._conf.options.strictResponseCheck === true) {
102
+ return Promise.reject(new FDKResponseValidationError(res_error));
103
+ } else {
104
+ Logger({
105
+ level: "WARN",
106
+ message: `Response Validation Warnings for application > Webhook > saveClickEvent \n ${res_error}`,
107
+ });
108
+ }
109
+ }
110
+
111
+ return response;
112
+ }
113
+ }
114
+
115
+ module.exports = Webhook;
@@ -0,0 +1,37 @@
1
+ export = WebhookApplicationModel;
2
+ /**
3
+ * @typedef ClickEventBatch
4
+ * @property {string} [event_name]
5
+ */
6
+ /**
7
+ * @typedef ClickEventRequest
8
+ * @property {ClickEventBatch[]} [batch]
9
+ */
10
+ /**
11
+ * @typedef ClickEventResponse
12
+ * @property {number} [success_count]
13
+ * @property {number} [failed_count]
14
+ * @property {ClickEventBatch[]} [failed_events]
15
+ */
16
+ declare class WebhookApplicationModel {
17
+ }
18
+ declare namespace WebhookApplicationModel {
19
+ export { ClickEventBatch, ClickEventRequest, ClickEventResponse };
20
+ }
21
+ /** @returns {ClickEventBatch} */
22
+ declare function ClickEventBatch(): ClickEventBatch;
23
+ type ClickEventBatch = {
24
+ event_name?: string;
25
+ };
26
+ /** @returns {ClickEventRequest} */
27
+ declare function ClickEventRequest(): ClickEventRequest;
28
+ type ClickEventRequest = {
29
+ batch?: ClickEventBatch[];
30
+ };
31
+ /** @returns {ClickEventResponse} */
32
+ declare function ClickEventResponse(): ClickEventResponse;
33
+ type ClickEventResponse = {
34
+ success_count?: number;
35
+ failed_count?: number;
36
+ failed_events?: ClickEventBatch[];
37
+ };
@@ -0,0 +1,46 @@
1
+ const Joi = require("joi");
2
+
3
+ /**
4
+ * @typedef ClickEventBatch
5
+ * @property {string} [event_name]
6
+ */
7
+
8
+ /**
9
+ * @typedef ClickEventRequest
10
+ * @property {ClickEventBatch[]} [batch]
11
+ */
12
+
13
+ /**
14
+ * @typedef ClickEventResponse
15
+ * @property {number} [success_count]
16
+ * @property {number} [failed_count]
17
+ * @property {ClickEventBatch[]} [failed_events]
18
+ */
19
+
20
+ class WebhookApplicationModel {
21
+ /** @returns {ClickEventBatch} */
22
+ static ClickEventBatch() {
23
+ return Joi.object({
24
+ event_name: Joi.string().allow(""),
25
+ });
26
+ }
27
+
28
+ /** @returns {ClickEventRequest} */
29
+ static ClickEventRequest() {
30
+ return Joi.object({
31
+ batch: Joi.array().items(WebhookApplicationModel.ClickEventBatch()),
32
+ });
33
+ }
34
+
35
+ /** @returns {ClickEventResponse} */
36
+ static ClickEventResponse() {
37
+ return Joi.object({
38
+ success_count: Joi.number(),
39
+ failed_count: Joi.number(),
40
+ failed_events: Joi.array().items(
41
+ WebhookApplicationModel.ClickEventBatch()
42
+ ),
43
+ });
44
+ }
45
+ }
46
+ module.exports = WebhookApplicationModel;
@@ -0,0 +1,16 @@
1
+ export = WebhookApplicationValidator;
2
+ /**
3
+ * @typedef SaveClickEventParam
4
+ * @property {WebhookApplicationModel.ClickEventRequest} body
5
+ */
6
+ declare class WebhookApplicationValidator {
7
+ /** @returns {SaveClickEventParam} */
8
+ static saveClickEvent(): SaveClickEventParam;
9
+ }
10
+ declare namespace WebhookApplicationValidator {
11
+ export { SaveClickEventParam };
12
+ }
13
+ type SaveClickEventParam = {
14
+ body: WebhookApplicationModel.ClickEventRequest;
15
+ };
16
+ import WebhookApplicationModel = require("./WebhookApplicationModel");
@@ -0,0 +1,19 @@
1
+ const Joi = require("joi");
2
+
3
+ const WebhookApplicationModel = require("./WebhookApplicationModel");
4
+
5
+ /**
6
+ * @typedef SaveClickEventParam
7
+ * @property {WebhookApplicationModel.ClickEventRequest} body
8
+ */
9
+
10
+ class WebhookApplicationValidator {
11
+ /** @returns {SaveClickEventParam} */
12
+ static saveClickEvent() {
13
+ return Joi.object({
14
+ body: WebhookApplicationModel.ClickEventRequest().required(),
15
+ }).required();
16
+ }
17
+ }
18
+
19
+ module.exports = WebhookApplicationValidator;
@@ -16,4 +16,5 @@ export namespace ApplicationModel {
16
16
  const ShareApplicationModel: typeof import("./Share/ShareApplicationModel");
17
17
  const ThemeApplicationModel: typeof import("./Theme/ThemeApplicationModel");
18
18
  const UserApplicationModel: typeof import("./User/UserApplicationModel");
19
+ const WebhookApplicationModel: typeof import("./Webhook/WebhookApplicationModel");
19
20
  }
@@ -31,5 +31,7 @@ module.exports = {
31
31
  ThemeApplicationModel: require("./Theme/ThemeApplicationModel"),
32
32
 
33
33
  UserApplicationModel: require("./User/UserApplicationModel"),
34
+
35
+ WebhookApplicationModel: require("./Webhook/WebhookApplicationModel"),
34
36
  },
35
37
  };
@@ -58,7 +58,7 @@ declare class Webhook {
58
58
  * @param {import("../PartnerAPIClient").Options} - Options
59
59
  * @returns {Promise<WebhookPartnerModel.HistoryResponse>} - Success response
60
60
  * @name getHistoricalReports
61
- * @summary: Get report download history
61
+ * @summary: Get report download history.
62
62
  * @description: Retrieve history reports for a specific company based on the provided filters.
63
63
  * - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/webhook/getHistoricalReports/).
64
64
  */
@@ -90,7 +90,7 @@ declare class Webhook {
90
90
  * @param {import("../PartnerAPIClient").Options} - Options
91
91
  * @returns {Promise<WebhookPartnerModel.UpdateSubscriberResponse>} - Success response
92
92
  * @name updateSubscriber
93
- * @summary: Update subscriber status by id
93
+ * @summary: Update subscriber status by id.
94
94
  * @description: Update subscriber status by id.
95
95
  * - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/webhook/updateSubscriber/).
96
96
  */
@@ -438,7 +438,7 @@ class Webhook {
438
438
  * @param {import("../PartnerAPIClient").Options} - Options
439
439
  * @returns {Promise<WebhookPartnerModel.HistoryResponse>} - Success response
440
440
  * @name getHistoricalReports
441
- * @summary: Get report download history
441
+ * @summary: Get report download history.
442
442
  * @description: Retrieve history reports for a specific company based on the provided filters.
443
443
  * - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/webhook/getHistoricalReports/).
444
444
  */
@@ -672,7 +672,7 @@ class Webhook {
672
672
  * @param {import("../PartnerAPIClient").Options} - Options
673
673
  * @returns {Promise<WebhookPartnerModel.UpdateSubscriberResponse>} - Success response
674
674
  * @name updateSubscriber
675
- * @summary: Update subscriber status by id
675
+ * @summary: Update subscriber status by id.
676
676
  * @description: Update subscriber status by id.
677
677
  * - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/webhook/updateSubscriber/).
678
678
  */
@@ -1,12 +1,12 @@
1
1
  export = WebhookPartnerModel;
2
- /**
3
- * @typedef UpdateSubscriberResponse
4
- * @property {string} [message]
5
- */
6
2
  /**
7
3
  * @typedef UpdateSubscriberRequest
8
4
  * @property {string} [status]
9
5
  */
6
+ /**
7
+ * @typedef UpdateSubscriberResponse
8
+ * @property {string} [message]
9
+ */
10
10
  /**
11
11
  * @typedef Association
12
12
  * @property {number} [company_id]
@@ -24,6 +24,7 @@ export = WebhookPartnerModel;
24
24
  * @property {number} [id]
25
25
  * @property {number} [event_id]
26
26
  * @property {number} [subscriber_id]
27
+ * @property {string} [topic]
27
28
  * @property {string} [created_on]
28
29
  */
29
30
  /**
@@ -38,6 +39,7 @@ export = WebhookPartnerModel;
38
39
  * @property {string} [description]
39
40
  * @property {string} [created_on]
40
41
  * @property {string} [updated_on]
42
+ * @property {string} [group]
41
43
  * @property {SubscriberEventMapping} [subscriber_event_mapping]
42
44
  */
43
45
  /**
@@ -61,10 +63,6 @@ export = WebhookPartnerModel;
61
63
  * @property {string} [category]
62
64
  * @property {number} [count]
63
65
  */
64
- /**
65
- * @typedef DownloadReponse
66
- * @property {string} [file_name]
67
- */
68
66
  /**
69
67
  * @typedef HistoryFilters
70
68
  * @property {string[]} [events]
@@ -74,6 +72,8 @@ export = WebhookPartnerModel;
74
72
  * @property {string} [start_date] - The start date and time of the history report.
75
73
  * @property {number[]} [subscribers] - An array of subscriber IDs associated
76
74
  * with the history report.
75
+ * @property {string[]} [webhook_type] - An array of webhook type to identify
76
+ * thetype of subscriber i.e (KAFKA or REST).
77
77
  */
78
78
  /**
79
79
  * @typedef Url
@@ -215,6 +215,7 @@ export = WebhookPartnerModel;
215
215
  * @property {string} [modified_by]
216
216
  * @property {string} [name]
217
217
  * @property {string} [webhook_url]
218
+ * @property {string} [provider]
218
219
  * @property {Association} [association]
219
220
  * @property {Object} [custom_headers]
220
221
  * @property {string} [status]
@@ -229,18 +230,18 @@ export = WebhookPartnerModel;
229
230
  declare class WebhookPartnerModel {
230
231
  }
231
232
  declare namespace WebhookPartnerModel {
232
- export { UpdateSubscriberResponse, UpdateSubscriberRequest, Association, AuthMeta, SubscriberEventMapping, EventConfigResponse, SubscriberConfigResponse, InvalidEventsRequest, InvalidEventsResponse, DownloadReponse, HistoryFilters, Url, CdnObject, UploadServiceObject, HistoryAssociation, HistoryItems, HistoryResponse, HistoryPayload, CancelDownloadResponse, FilterReportResponse, DeliveryTsResponse, DeliveryTsSchema, DeliveryDetailsRequest, EventDeliveryDetailSchema, DeliveryDetailsResponse, EventProcessReportObject, Page, DeliveryEventLevelSchema, DeliverySummaryResponse, DeliverySummarySchema, ItemSchema };
233
+ export { UpdateSubscriberRequest, UpdateSubscriberResponse, Association, AuthMeta, SubscriberEventMapping, EventConfigResponse, SubscriberConfigResponse, InvalidEventsRequest, InvalidEventsResponse, HistoryFilters, Url, CdnObject, UploadServiceObject, HistoryAssociation, HistoryItems, HistoryResponse, HistoryPayload, CancelDownloadResponse, FilterReportResponse, DeliveryTsResponse, DeliveryTsSchema, DeliveryDetailsRequest, EventDeliveryDetailSchema, DeliveryDetailsResponse, EventProcessReportObject, Page, DeliveryEventLevelSchema, DeliverySummaryResponse, DeliverySummarySchema, ItemSchema };
233
234
  }
234
- /** @returns {UpdateSubscriberResponse} */
235
- declare function UpdateSubscriberResponse(): UpdateSubscriberResponse;
236
- type UpdateSubscriberResponse = {
237
- message?: string;
238
- };
239
235
  /** @returns {UpdateSubscriberRequest} */
240
236
  declare function UpdateSubscriberRequest(): UpdateSubscriberRequest;
241
237
  type UpdateSubscriberRequest = {
242
238
  status?: string;
243
239
  };
240
+ /** @returns {UpdateSubscriberResponse} */
241
+ declare function UpdateSubscriberResponse(): UpdateSubscriberResponse;
242
+ type UpdateSubscriberResponse = {
243
+ message?: string;
244
+ };
244
245
  /** @returns {Association} */
245
246
  declare function Association(): Association;
246
247
  type Association = {
@@ -261,6 +262,7 @@ type SubscriberEventMapping = {
261
262
  id?: number;
262
263
  event_id?: number;
263
264
  subscriber_id?: number;
265
+ topic?: string;
264
266
  created_on?: string;
265
267
  };
266
268
  /** @returns {EventConfigResponse} */
@@ -276,6 +278,7 @@ type EventConfigResponse = {
276
278
  description?: string;
277
279
  created_on?: string;
278
280
  updated_on?: string;
281
+ group?: string;
279
282
  subscriber_event_mapping?: SubscriberEventMapping;
280
283
  };
281
284
  /** @returns {SubscriberConfigResponse} */
@@ -302,11 +305,6 @@ type InvalidEventsResponse = {
302
305
  category?: string;
303
306
  count?: number;
304
307
  };
305
- /** @returns {DownloadReponse} */
306
- declare function DownloadReponse(): DownloadReponse;
307
- type DownloadReponse = {
308
- file_name?: string;
309
- };
310
308
  /** @returns {HistoryFilters} */
311
309
  declare function HistoryFilters(): HistoryFilters;
312
310
  type HistoryFilters = {
@@ -329,6 +327,11 @@ type HistoryFilters = {
329
327
  * with the history report.
330
328
  */
331
329
  subscribers?: number[];
330
+ /**
331
+ * - An array of webhook type to identify
332
+ * thetype of subscriber i.e (KAFKA or REST).
333
+ */
334
+ webhook_type?: string[];
332
335
  };
333
336
  /** @returns {Url} */
334
337
  declare function Url(): Url;
@@ -553,6 +556,7 @@ type ItemSchema = {
553
556
  modified_by?: string;
554
557
  name?: string;
555
558
  webhook_url?: string;
559
+ provider?: string;
556
560
  association?: Association;
557
561
  custom_headers?: any;
558
562
  status?: string;
@@ -1,13 +1,13 @@
1
1
  const Joi = require("joi");
2
2
 
3
3
  /**
4
- * @typedef UpdateSubscriberResponse
5
- * @property {string} [message]
4
+ * @typedef UpdateSubscriberRequest
5
+ * @property {string} [status]
6
6
  */
7
7
 
8
8
  /**
9
- * @typedef UpdateSubscriberRequest
10
- * @property {string} [status]
9
+ * @typedef UpdateSubscriberResponse
10
+ * @property {string} [message]
11
11
  */
12
12
 
13
13
  /**
@@ -29,6 +29,7 @@ const Joi = require("joi");
29
29
  * @property {number} [id]
30
30
  * @property {number} [event_id]
31
31
  * @property {number} [subscriber_id]
32
+ * @property {string} [topic]
32
33
  * @property {string} [created_on]
33
34
  */
34
35
 
@@ -44,6 +45,7 @@ const Joi = require("joi");
44
45
  * @property {string} [description]
45
46
  * @property {string} [created_on]
46
47
  * @property {string} [updated_on]
48
+ * @property {string} [group]
47
49
  * @property {SubscriberEventMapping} [subscriber_event_mapping]
48
50
  */
49
51
 
@@ -71,11 +73,6 @@ const Joi = require("joi");
71
73
  * @property {number} [count]
72
74
  */
73
75
 
74
- /**
75
- * @typedef DownloadReponse
76
- * @property {string} [file_name]
77
- */
78
-
79
76
  /**
80
77
  * @typedef HistoryFilters
81
78
  * @property {string[]} [events]
@@ -85,6 +82,8 @@ const Joi = require("joi");
85
82
  * @property {string} [start_date] - The start date and time of the history report.
86
83
  * @property {number[]} [subscribers] - An array of subscriber IDs associated
87
84
  * with the history report.
85
+ * @property {string[]} [webhook_type] - An array of webhook type to identify
86
+ * thetype of subscriber i.e (KAFKA or REST).
88
87
  */
89
88
 
90
89
  /**
@@ -246,6 +245,7 @@ const Joi = require("joi");
246
245
  * @property {string} [modified_by]
247
246
  * @property {string} [name]
248
247
  * @property {string} [webhook_url]
248
+ * @property {string} [provider]
249
249
  * @property {Association} [association]
250
250
  * @property {Object} [custom_headers]
251
251
  * @property {string} [status]
@@ -259,17 +259,17 @@ const Joi = require("joi");
259
259
  */
260
260
 
261
261
  class WebhookPartnerModel {
262
- /** @returns {UpdateSubscriberResponse} */
263
- static UpdateSubscriberResponse() {
262
+ /** @returns {UpdateSubscriberRequest} */
263
+ static UpdateSubscriberRequest() {
264
264
  return Joi.object({
265
- message: Joi.string().allow(""),
265
+ status: Joi.string().allow(""),
266
266
  });
267
267
  }
268
268
 
269
- /** @returns {UpdateSubscriberRequest} */
270
- static UpdateSubscriberRequest() {
269
+ /** @returns {UpdateSubscriberResponse} */
270
+ static UpdateSubscriberResponse() {
271
271
  return Joi.object({
272
- status: Joi.string().allow(""),
272
+ message: Joi.string().allow(""),
273
273
  });
274
274
  }
275
275
 
@@ -297,6 +297,7 @@ class WebhookPartnerModel {
297
297
  id: Joi.number(),
298
298
  event_id: Joi.number(),
299
299
  subscriber_id: Joi.number(),
300
+ topic: Joi.string().allow("").allow(null),
300
301
  created_on: Joi.string().allow(""),
301
302
  });
302
303
  }
@@ -314,6 +315,7 @@ class WebhookPartnerModel {
314
315
  description: Joi.string().allow("").allow(null),
315
316
  created_on: Joi.string().allow(""),
316
317
  updated_on: Joi.string().allow(""),
318
+ group: Joi.string().allow("").allow(null),
317
319
  subscriber_event_mapping: WebhookPartnerModel.SubscriberEventMapping(),
318
320
  });
319
321
  }
@@ -348,13 +350,6 @@ class WebhookPartnerModel {
348
350
  });
349
351
  }
350
352
 
351
- /** @returns {DownloadReponse} */
352
- static DownloadReponse() {
353
- return Joi.object({
354
- file_name: Joi.string().allow(""),
355
- });
356
- }
357
-
358
353
  /** @returns {HistoryFilters} */
359
354
  static HistoryFilters() {
360
355
  return Joi.object({
@@ -364,6 +359,7 @@ class WebhookPartnerModel {
364
359
  end_date: Joi.string().allow(""),
365
360
  start_date: Joi.string().allow(""),
366
361
  subscribers: Joi.array().items(Joi.number()),
362
+ webhook_type: Joi.array().items(Joi.string().allow("")),
367
363
  });
368
364
  }
369
365
 
@@ -565,6 +561,7 @@ class WebhookPartnerModel {
565
561
  modified_by: Joi.string().allow(""),
566
562
  name: Joi.string().allow(""),
567
563
  webhook_url: Joi.string().allow(""),
564
+ provider: Joi.string().allow(""),
568
565
  association: WebhookPartnerModel.Association(),
569
566
  custom_headers: Joi.any(),
570
567
  status: Joi.string().allow(""),
@@ -0,0 +1,43 @@
1
+ export = Analytics;
2
+ declare class Analytics {
3
+ constructor(config: any, applicationId: any);
4
+ config: any;
5
+ applicationId: any;
6
+ /**
7
+ * @param {AnalyticsPlatformApplicationValidator.CheckJobStatusByNameV2Param} arg
8
+ * - Arg object
9
+ *
10
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
11
+ * @param {import("../PlatformAPIClient").Options} - Options
12
+ * @returns {Promise<Object>} - Success response
13
+ * @name checkJobStatusByNameV2
14
+ * @summary: Checks download job status
15
+ * @description: Takes job name in path param to check the status of job Returns file URL if downloading is done else returns status of job - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/analytics/checkJobStatusByNameV2/).
16
+ */
17
+ checkJobStatusByNameV2({ fileName, requestHeaders }?: AnalyticsPlatformApplicationValidator.CheckJobStatusByNameV2Param, { responseHeaders }?: object): Promise<any>;
18
+ /**
19
+ * @param {AnalyticsPlatformApplicationValidator.ExecuteJobForProvidedParametersV2Param} arg
20
+ * - Arg object
21
+ *
22
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
23
+ * @param {import("../PlatformAPIClient").Options} - Options
24
+ * @returns {Promise<Object>} - Success response
25
+ * @name executeJobForProvidedParametersV2
26
+ * @summary: Executes given sql(Base64 Encoded) query
27
+ * @description: Query click events data - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/analytics/executeJobForProvidedParametersV2/).
28
+ */
29
+ executeJobForProvidedParametersV2({ body, requestHeaders }?: AnalyticsPlatformApplicationValidator.ExecuteJobForProvidedParametersV2Param, { responseHeaders }?: object): Promise<any>;
30
+ /**
31
+ * @param {AnalyticsPlatformApplicationValidator.StartDownloadForQueryV2Param} arg
32
+ * - Arg object
33
+ *
34
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
35
+ * @param {import("../PlatformAPIClient").Options} - Options
36
+ * @returns {Promise<Object>} - Success response
37
+ * @name startDownloadForQueryV2
38
+ * @summary: Initiates download job
39
+ * @description: Initiates download job and returns job name - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/analytics/startDownloadForQueryV2/).
40
+ */
41
+ startDownloadForQueryV2({ exportType, body, requestHeaders }?: AnalyticsPlatformApplicationValidator.StartDownloadForQueryV2Param, { responseHeaders }?: object): Promise<any>;
42
+ }
43
+ import AnalyticsPlatformApplicationValidator = require("./AnalyticsPlatformApplicationValidator");