@gofynd/fdk-client-javascript 3.16.3 → 3.17.0
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.
- package/README.md +1 -1
- package/package.json +1 -1
- package/sdk/application/ApplicationClient.d.ts +0 -2
- package/sdk/application/ApplicationClient.js +0 -2
- package/sdk/application/Content/ContentApplicationClient.d.ts +10 -0
- package/sdk/application/Content/ContentApplicationClient.js +53 -0
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +11 -21
- package/sdk/application/Logistic/LogisticApplicationClient.js +34 -83
- package/sdk/application/Order/OrderApplicationClient.d.ts +11 -0
- package/sdk/application/Order/OrderApplicationClient.js +50 -0
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +4 -4
- package/sdk/application/Payment/PaymentApplicationClient.js +3 -4
- package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +84 -0
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +712 -0
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +237 -1
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +157 -0
- package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +8 -0
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +70 -0
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +3 -3
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +3 -3
- package/sdk/platform/Cart/CartPlatformModel.d.ts +1 -4
- package/sdk/platform/Cart/CartPlatformModel.js +1 -1
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +2 -2
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2 -2
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +0 -11
- package/sdk/platform/Catalog/CatalogPlatformClient.js +0 -80
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +6 -131
- package/sdk/platform/Catalog/CatalogPlatformModel.js +4 -141
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +1 -10
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +0 -12
- package/sdk/platform/Common/CommonPlatformModel.d.ts +18 -1
- package/sdk/platform/Common/CommonPlatformModel.js +14 -0
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +1 -73
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +4 -462
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +7 -45
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +4 -55
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +10 -2
- package/sdk/platform/Communication/CommunicationPlatformModel.js +3 -2
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +14 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +6 -0
- package/sdk/platform/Order/OrderPlatformClient.d.ts +26 -18
- package/sdk/platform/Order/OrderPlatformClient.js +175 -107
- package/sdk/platform/Order/OrderPlatformModel.d.ts +339 -43
- package/sdk/platform/Order/OrderPlatformModel.js +209 -43
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +40 -43
- package/sdk/platform/Order/OrderPlatformValidator.js +35 -30
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +20 -10
- package/sdk/platform/Payment/PaymentPlatformModel.js +14 -10
- package/sdk/platform/PlatformApplicationClient.d.ts +0 -2
- package/sdk/platform/PlatformApplicationClient.js +0 -4
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +0 -13
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +0 -82
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +1 -10
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +0 -12
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +212 -28
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +133 -13
- package/sdk/platform/User/UserPlatformModel.d.ts +2 -2
- package/sdk/platform/User/UserPlatformModel.js +4 -4
- package/sdk/platform/index.d.ts +0 -1
- package/sdk/platform/index.js +0 -2
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +27 -1
- package/sdk/public/Configuration/ConfigurationPublicModel.js +19 -0
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +0 -79
- package/sdk/application/Rewards/RewardsApplicationClient.js +0 -315
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +0 -136
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +0 -976
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +0 -152
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +0 -157
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +0 -387
- package/sdk/platform/Rewards/RewardsPlatformModel.js +0 -410
|
@@ -51,6 +51,11 @@ export = CommonPlatformModel;
|
|
|
51
51
|
* redirection is for long time period redirection, and temporary redirection
|
|
52
52
|
* for a short time period.
|
|
53
53
|
*/
|
|
54
|
+
/**
|
|
55
|
+
* @typedef RegionDetails
|
|
56
|
+
* @property {string} [slug] - Region slug identifier.
|
|
57
|
+
* @property {string} [zone] - Zone identifier within the region.
|
|
58
|
+
*/
|
|
54
59
|
/**
|
|
55
60
|
* @typedef ApplicationMeta
|
|
56
61
|
* @property {string} [name] - Indicates the name of application meta
|
|
@@ -142,7 +147,7 @@ export = CommonPlatformModel;
|
|
|
142
147
|
declare class CommonPlatformModel {
|
|
143
148
|
}
|
|
144
149
|
declare namespace CommonPlatformModel {
|
|
145
|
-
export { ApplicationResponseSchema, Domain, ApplicationWebsite, ApplicationCors, ApplicationAuth, ApplicationRedirections, ApplicationMeta, SecureUrl, Application, NotFound, BadRequestSchema, LocationDefaultLanguage, LocationDefaultCurrency, LocationCountry, Locations };
|
|
150
|
+
export { ApplicationResponseSchema, Domain, ApplicationWebsite, ApplicationCors, ApplicationAuth, ApplicationRedirections, RegionDetails, ApplicationMeta, SecureUrl, Application, NotFound, BadRequestSchema, LocationDefaultLanguage, LocationDefaultCurrency, LocationCountry, Locations };
|
|
146
151
|
}
|
|
147
152
|
/** @returns {ApplicationResponseSchema} */
|
|
148
153
|
declare function ApplicationResponseSchema(): ApplicationResponseSchema;
|
|
@@ -259,6 +264,18 @@ type ApplicationRedirections = {
|
|
|
259
264
|
*/
|
|
260
265
|
type?: string;
|
|
261
266
|
};
|
|
267
|
+
/** @returns {RegionDetails} */
|
|
268
|
+
declare function RegionDetails(): RegionDetails;
|
|
269
|
+
type RegionDetails = {
|
|
270
|
+
/**
|
|
271
|
+
* - Region slug identifier.
|
|
272
|
+
*/
|
|
273
|
+
slug?: string;
|
|
274
|
+
/**
|
|
275
|
+
* - Zone identifier within the region.
|
|
276
|
+
*/
|
|
277
|
+
zone?: string;
|
|
278
|
+
};
|
|
262
279
|
/** @returns {ApplicationMeta} */
|
|
263
280
|
declare function ApplicationMeta(): ApplicationMeta;
|
|
264
281
|
type ApplicationMeta = {
|
|
@@ -58,6 +58,12 @@ const Joi = require("joi");
|
|
|
58
58
|
* for a short time period.
|
|
59
59
|
*/
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* @typedef RegionDetails
|
|
63
|
+
* @property {string} [slug] - Region slug identifier.
|
|
64
|
+
* @property {string} [zone] - Zone identifier within the region.
|
|
65
|
+
*/
|
|
66
|
+
|
|
61
67
|
/**
|
|
62
68
|
* @typedef ApplicationMeta
|
|
63
69
|
* @property {string} [name] - Indicates the name of application meta
|
|
@@ -214,6 +220,14 @@ class CommonPlatformModel {
|
|
|
214
220
|
});
|
|
215
221
|
}
|
|
216
222
|
|
|
223
|
+
/** @returns {RegionDetails} */
|
|
224
|
+
static RegionDetails() {
|
|
225
|
+
return Joi.object({
|
|
226
|
+
slug: Joi.string().allow(""),
|
|
227
|
+
zone: Joi.string().allow(""),
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
|
|
217
231
|
/** @returns {ApplicationMeta} */
|
|
218
232
|
static ApplicationMeta() {
|
|
219
233
|
return Joi.object({
|
|
@@ -15,42 +15,6 @@ declare class Communication {
|
|
|
15
15
|
* @description: Creates a new email audience. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/communication/createAudience/).
|
|
16
16
|
*/
|
|
17
17
|
createAudience({ body, requestHeaders }?: CommunicationPlatformApplicationValidator.CreateAudienceParam, { responseHeaders }?: object): Promise<CommunicationPlatformModel.Audience>;
|
|
18
|
-
/**
|
|
19
|
-
* @param {CommunicationPlatformApplicationValidator.CreateBigQueryHeadersParam} 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 createBigQueryHeaders
|
|
26
|
-
* @summary: Create BigQuery headers
|
|
27
|
-
* @description: Create BigQuery headers - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/communication/createBigQueryHeaders/).
|
|
28
|
-
*/
|
|
29
|
-
createBigQueryHeaders({ requestHeaders }?: any, { responseHeaders }?: object): Promise<any>;
|
|
30
|
-
/**
|
|
31
|
-
* @param {CommunicationPlatformApplicationValidator.CreateBigQueryNCountParam} 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 createBigQueryNCount
|
|
38
|
-
* @summary: Create BigQuery N-count
|
|
39
|
-
* @description: Creates big query n count - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/communication/createBigQueryNCount/).
|
|
40
|
-
*/
|
|
41
|
-
createBigQueryNCount({ requestHeaders }?: any, { responseHeaders }?: object): Promise<any>;
|
|
42
|
-
/**
|
|
43
|
-
* @param {CommunicationPlatformApplicationValidator.CreateBigQueryRowCountParam} arg
|
|
44
|
-
* - Arg object
|
|
45
|
-
*
|
|
46
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
47
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
48
|
-
* @returns {Promise<Object>} - Success response
|
|
49
|
-
* @name createBigQueryRowCount
|
|
50
|
-
* @summary: Create a BigQuery row count
|
|
51
|
-
* @description: Creates big query row count - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/communication/createBigQueryRowCount/).
|
|
52
|
-
*/
|
|
53
|
-
createBigQueryRowCount({ requestHeaders }?: any, { responseHeaders }?: object): Promise<any>;
|
|
54
18
|
/**
|
|
55
19
|
* @param {CommunicationPlatformApplicationValidator.CreateCampaignParam} arg
|
|
56
20
|
* - Arg object
|
|
@@ -273,30 +237,6 @@ declare class Communication {
|
|
|
273
237
|
* @description: Retrieves a list of all the audiences. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/communication/getAudiences/).
|
|
274
238
|
*/
|
|
275
239
|
getAudiences({ pageNo, pageSize, sort, query, requestHeaders }?: CommunicationPlatformApplicationValidator.GetAudiencesParam, { responseHeaders }?: object): Promise<CommunicationPlatformModel.Audiences>;
|
|
276
|
-
/**
|
|
277
|
-
* @param {CommunicationPlatformApplicationValidator.GetBigQueryHeadersByIdParam} arg
|
|
278
|
-
* - Arg object
|
|
279
|
-
*
|
|
280
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
281
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
282
|
-
* @returns {Promise<Object>} - Success response
|
|
283
|
-
* @name getBigQueryHeadersById
|
|
284
|
-
* @summary: Get BigQuery headers
|
|
285
|
-
* @description: Retrieves header information from BigQuery. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/communication/getBigQueryHeadersById/).
|
|
286
|
-
*/
|
|
287
|
-
getBigQueryHeadersById({ id, requestHeaders }?: CommunicationPlatformApplicationValidator.GetBigQueryHeadersByIdParam, { responseHeaders }?: object): Promise<any>;
|
|
288
|
-
/**
|
|
289
|
-
* @param {CommunicationPlatformApplicationValidator.GetBigQueryRowCountByIdParam} arg
|
|
290
|
-
* - Arg object
|
|
291
|
-
*
|
|
292
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
293
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
294
|
-
* @returns {Promise<Object>} - Success response
|
|
295
|
-
* @name getBigQueryRowCountById
|
|
296
|
-
* @summary: Get BigQuery row count
|
|
297
|
-
* @description: Retrieves big query row count by id - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/communication/getBigQueryRowCountById/).
|
|
298
|
-
*/
|
|
299
|
-
getBigQueryRowCountById({ id, requestHeaders }?: CommunicationPlatformApplicationValidator.GetBigQueryRowCountByIdParam, { responseHeaders }?: object): Promise<any>;
|
|
300
240
|
/**
|
|
301
241
|
* @param {CommunicationPlatformApplicationValidator.GetCampaignByIdParam} arg
|
|
302
242
|
* - Arg object
|
|
@@ -432,7 +372,7 @@ declare class Communication {
|
|
|
432
372
|
* @summary: Get all event subscriptions
|
|
433
373
|
* @description: Retrieves a list of all event subscriptions. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/communication/getEventSubscriptions/).
|
|
434
374
|
*/
|
|
435
|
-
getEventSubscriptions({ pageNo, pageSize, populate, group, subGroup,
|
|
375
|
+
getEventSubscriptions({ pageNo, pageSize, populate, group, subGroup, fulfillmentOptionSlug, requestHeaders, }?: CommunicationPlatformApplicationValidator.GetEventSubscriptionsParam, { responseHeaders }?: object): Promise<CommunicationPlatformModel.EventSubscriptions>;
|
|
436
376
|
/**
|
|
437
377
|
* @param {CommunicationPlatformApplicationValidator.GetEventSubscriptionsByIdParam} arg
|
|
438
378
|
* - Arg object
|
|
@@ -611,18 +551,6 @@ declare class Communication {
|
|
|
611
551
|
* @description: Retrieve a list of SMS communication templates that are subscribed to an event. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/communication/getSubscribedSmsTemplates/).
|
|
612
552
|
*/
|
|
613
553
|
getSubscribedSmsTemplates({ pageNo, pageSize, query, requestHeaders }?: CommunicationPlatformApplicationValidator.GetSubscribedSmsTemplatesParam, { responseHeaders }?: object): Promise<CommunicationPlatformModel.SmsTemplates>;
|
|
614
|
-
/**
|
|
615
|
-
* @param {CommunicationPlatformApplicationValidator.GetSystemAudiencesParam} arg
|
|
616
|
-
* - Arg object
|
|
617
|
-
*
|
|
618
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
619
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
620
|
-
* @returns {Promise<Object>} - Success response
|
|
621
|
-
* @name getSystemAudiences
|
|
622
|
-
* @summary: Get system audiences
|
|
623
|
-
* @description: Retrieves a list of system-defined audiences for communication. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/communication/getSystemAudiences/).
|
|
624
|
-
*/
|
|
625
|
-
getSystemAudiences({ requestHeaders }?: any, { responseHeaders }?: object): Promise<any>;
|
|
626
554
|
/**
|
|
627
555
|
* @param {CommunicationPlatformApplicationValidator.GetSystemEmailTemplatesParam} arg
|
|
628
556
|
* - Arg object
|
|
@@ -96,231 +96,6 @@ class Communication {
|
|
|
96
96
|
return response;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
/**
|
|
100
|
-
* @param {CommunicationPlatformApplicationValidator.CreateBigQueryHeadersParam} arg
|
|
101
|
-
* - Arg object
|
|
102
|
-
*
|
|
103
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
104
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
105
|
-
* @returns {Promise<Object>} - Success response
|
|
106
|
-
* @name createBigQueryHeaders
|
|
107
|
-
* @summary: Create BigQuery headers
|
|
108
|
-
* @description: Create BigQuery headers - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/communication/createBigQueryHeaders/).
|
|
109
|
-
*/
|
|
110
|
-
async createBigQueryHeaders(
|
|
111
|
-
{ requestHeaders } = { requestHeaders: {} },
|
|
112
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
113
|
-
) {
|
|
114
|
-
const {
|
|
115
|
-
error,
|
|
116
|
-
} = CommunicationPlatformApplicationValidator.createBigQueryHeaders().validate(
|
|
117
|
-
{},
|
|
118
|
-
{ abortEarly: false, allowUnknown: true }
|
|
119
|
-
);
|
|
120
|
-
if (error) {
|
|
121
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// Showing warrnings if extra unknown parameters are found
|
|
125
|
-
const {
|
|
126
|
-
error: warrning,
|
|
127
|
-
} = CommunicationPlatformApplicationValidator.createBigQueryHeaders().validate(
|
|
128
|
-
{},
|
|
129
|
-
{ abortEarly: false, allowUnknown: false }
|
|
130
|
-
);
|
|
131
|
-
if (warrning) {
|
|
132
|
-
Logger({
|
|
133
|
-
level: "WARN",
|
|
134
|
-
message: `Parameter Validation warrnings for platform > Communication > createBigQueryHeaders \n ${warrning}`,
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const query_params = {};
|
|
139
|
-
|
|
140
|
-
const response = await PlatformAPIClient.execute(
|
|
141
|
-
this.config,
|
|
142
|
-
"post",
|
|
143
|
-
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sources/bigquery-headers`,
|
|
144
|
-
query_params,
|
|
145
|
-
undefined,
|
|
146
|
-
requestHeaders,
|
|
147
|
-
{ responseHeaders }
|
|
148
|
-
);
|
|
149
|
-
|
|
150
|
-
let responseData = response;
|
|
151
|
-
if (responseHeaders) {
|
|
152
|
-
responseData = response[0];
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
const { error: res_error } = Joi.any().validate(responseData, {
|
|
156
|
-
abortEarly: false,
|
|
157
|
-
allowUnknown: true,
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
if (res_error) {
|
|
161
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
162
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
163
|
-
} else {
|
|
164
|
-
Logger({
|
|
165
|
-
level: "WARN",
|
|
166
|
-
message: `Response Validation Warnings for platform > Communication > createBigQueryHeaders \n ${res_error}`,
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
return response;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* @param {CommunicationPlatformApplicationValidator.CreateBigQueryNCountParam} arg
|
|
176
|
-
* - Arg object
|
|
177
|
-
*
|
|
178
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
179
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
180
|
-
* @returns {Promise<Object>} - Success response
|
|
181
|
-
* @name createBigQueryNCount
|
|
182
|
-
* @summary: Create BigQuery N-count
|
|
183
|
-
* @description: Creates big query n count - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/communication/createBigQueryNCount/).
|
|
184
|
-
*/
|
|
185
|
-
async createBigQueryNCount(
|
|
186
|
-
{ requestHeaders } = { requestHeaders: {} },
|
|
187
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
188
|
-
) {
|
|
189
|
-
const {
|
|
190
|
-
error,
|
|
191
|
-
} = CommunicationPlatformApplicationValidator.createBigQueryNCount().validate(
|
|
192
|
-
{},
|
|
193
|
-
{ abortEarly: false, allowUnknown: true }
|
|
194
|
-
);
|
|
195
|
-
if (error) {
|
|
196
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// Showing warrnings if extra unknown parameters are found
|
|
200
|
-
const {
|
|
201
|
-
error: warrning,
|
|
202
|
-
} = CommunicationPlatformApplicationValidator.createBigQueryNCount().validate(
|
|
203
|
-
{},
|
|
204
|
-
{ abortEarly: false, allowUnknown: false }
|
|
205
|
-
);
|
|
206
|
-
if (warrning) {
|
|
207
|
-
Logger({
|
|
208
|
-
level: "WARN",
|
|
209
|
-
message: `Parameter Validation warrnings for platform > Communication > createBigQueryNCount \n ${warrning}`,
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
const query_params = {};
|
|
214
|
-
|
|
215
|
-
const response = await PlatformAPIClient.execute(
|
|
216
|
-
this.config,
|
|
217
|
-
"post",
|
|
218
|
-
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sources/bigquery-n-records`,
|
|
219
|
-
query_params,
|
|
220
|
-
undefined,
|
|
221
|
-
requestHeaders,
|
|
222
|
-
{ responseHeaders }
|
|
223
|
-
);
|
|
224
|
-
|
|
225
|
-
let responseData = response;
|
|
226
|
-
if (responseHeaders) {
|
|
227
|
-
responseData = response[0];
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
const { error: res_error } = Joi.any().validate(responseData, {
|
|
231
|
-
abortEarly: false,
|
|
232
|
-
allowUnknown: true,
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
if (res_error) {
|
|
236
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
237
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
238
|
-
} else {
|
|
239
|
-
Logger({
|
|
240
|
-
level: "WARN",
|
|
241
|
-
message: `Response Validation Warnings for platform > Communication > createBigQueryNCount \n ${res_error}`,
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
return response;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* @param {CommunicationPlatformApplicationValidator.CreateBigQueryRowCountParam} arg
|
|
251
|
-
* - Arg object
|
|
252
|
-
*
|
|
253
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
254
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
255
|
-
* @returns {Promise<Object>} - Success response
|
|
256
|
-
* @name createBigQueryRowCount
|
|
257
|
-
* @summary: Create a BigQuery row count
|
|
258
|
-
* @description: Creates big query row count - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/communication/createBigQueryRowCount/).
|
|
259
|
-
*/
|
|
260
|
-
async createBigQueryRowCount(
|
|
261
|
-
{ requestHeaders } = { requestHeaders: {} },
|
|
262
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
263
|
-
) {
|
|
264
|
-
const {
|
|
265
|
-
error,
|
|
266
|
-
} = CommunicationPlatformApplicationValidator.createBigQueryRowCount().validate(
|
|
267
|
-
{},
|
|
268
|
-
{ abortEarly: false, allowUnknown: true }
|
|
269
|
-
);
|
|
270
|
-
if (error) {
|
|
271
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
// Showing warrnings if extra unknown parameters are found
|
|
275
|
-
const {
|
|
276
|
-
error: warrning,
|
|
277
|
-
} = CommunicationPlatformApplicationValidator.createBigQueryRowCount().validate(
|
|
278
|
-
{},
|
|
279
|
-
{ abortEarly: false, allowUnknown: false }
|
|
280
|
-
);
|
|
281
|
-
if (warrning) {
|
|
282
|
-
Logger({
|
|
283
|
-
level: "WARN",
|
|
284
|
-
message: `Parameter Validation warrnings for platform > Communication > createBigQueryRowCount \n ${warrning}`,
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
const query_params = {};
|
|
289
|
-
|
|
290
|
-
const response = await PlatformAPIClient.execute(
|
|
291
|
-
this.config,
|
|
292
|
-
"post",
|
|
293
|
-
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sources/bigquery-row-count`,
|
|
294
|
-
query_params,
|
|
295
|
-
undefined,
|
|
296
|
-
requestHeaders,
|
|
297
|
-
{ responseHeaders }
|
|
298
|
-
);
|
|
299
|
-
|
|
300
|
-
let responseData = response;
|
|
301
|
-
if (responseHeaders) {
|
|
302
|
-
responseData = response[0];
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
const { error: res_error } = Joi.any().validate(responseData, {
|
|
306
|
-
abortEarly: false,
|
|
307
|
-
allowUnknown: true,
|
|
308
|
-
});
|
|
309
|
-
|
|
310
|
-
if (res_error) {
|
|
311
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
312
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
313
|
-
} else {
|
|
314
|
-
Logger({
|
|
315
|
-
level: "WARN",
|
|
316
|
-
message: `Response Validation Warnings for platform > Communication > createBigQueryRowCount \n ${res_error}`,
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
return response;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
99
|
/**
|
|
325
100
|
* @param {CommunicationPlatformApplicationValidator.CreateCampaignParam} arg
|
|
326
101
|
* - Arg object
|
|
@@ -1790,164 +1565,6 @@ class Communication {
|
|
|
1790
1565
|
return response;
|
|
1791
1566
|
}
|
|
1792
1567
|
|
|
1793
|
-
/**
|
|
1794
|
-
* @param {CommunicationPlatformApplicationValidator.GetBigQueryHeadersByIdParam} arg
|
|
1795
|
-
* - Arg object
|
|
1796
|
-
*
|
|
1797
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1798
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1799
|
-
* @returns {Promise<Object>} - Success response
|
|
1800
|
-
* @name getBigQueryHeadersById
|
|
1801
|
-
* @summary: Get BigQuery headers
|
|
1802
|
-
* @description: Retrieves header information from BigQuery. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/communication/getBigQueryHeadersById/).
|
|
1803
|
-
*/
|
|
1804
|
-
async getBigQueryHeadersById(
|
|
1805
|
-
{ id, requestHeaders } = { requestHeaders: {} },
|
|
1806
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
1807
|
-
) {
|
|
1808
|
-
const {
|
|
1809
|
-
error,
|
|
1810
|
-
} = CommunicationPlatformApplicationValidator.getBigQueryHeadersById().validate(
|
|
1811
|
-
{
|
|
1812
|
-
id,
|
|
1813
|
-
},
|
|
1814
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1815
|
-
);
|
|
1816
|
-
if (error) {
|
|
1817
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1818
|
-
}
|
|
1819
|
-
|
|
1820
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1821
|
-
const {
|
|
1822
|
-
error: warrning,
|
|
1823
|
-
} = CommunicationPlatformApplicationValidator.getBigQueryHeadersById().validate(
|
|
1824
|
-
{
|
|
1825
|
-
id,
|
|
1826
|
-
},
|
|
1827
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1828
|
-
);
|
|
1829
|
-
if (warrning) {
|
|
1830
|
-
Logger({
|
|
1831
|
-
level: "WARN",
|
|
1832
|
-
message: `Parameter Validation warrnings for platform > Communication > getBigQueryHeadersById \n ${warrning}`,
|
|
1833
|
-
});
|
|
1834
|
-
}
|
|
1835
|
-
|
|
1836
|
-
const query_params = {};
|
|
1837
|
-
|
|
1838
|
-
const response = await PlatformAPIClient.execute(
|
|
1839
|
-
this.config,
|
|
1840
|
-
"get",
|
|
1841
|
-
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sources/bigquery-headers/${id}`,
|
|
1842
|
-
query_params,
|
|
1843
|
-
undefined,
|
|
1844
|
-
requestHeaders,
|
|
1845
|
-
{ responseHeaders }
|
|
1846
|
-
);
|
|
1847
|
-
|
|
1848
|
-
let responseData = response;
|
|
1849
|
-
if (responseHeaders) {
|
|
1850
|
-
responseData = response[0];
|
|
1851
|
-
}
|
|
1852
|
-
|
|
1853
|
-
const { error: res_error } = Joi.any().validate(responseData, {
|
|
1854
|
-
abortEarly: false,
|
|
1855
|
-
allowUnknown: true,
|
|
1856
|
-
});
|
|
1857
|
-
|
|
1858
|
-
if (res_error) {
|
|
1859
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
1860
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1861
|
-
} else {
|
|
1862
|
-
Logger({
|
|
1863
|
-
level: "WARN",
|
|
1864
|
-
message: `Response Validation Warnings for platform > Communication > getBigQueryHeadersById \n ${res_error}`,
|
|
1865
|
-
});
|
|
1866
|
-
}
|
|
1867
|
-
}
|
|
1868
|
-
|
|
1869
|
-
return response;
|
|
1870
|
-
}
|
|
1871
|
-
|
|
1872
|
-
/**
|
|
1873
|
-
* @param {CommunicationPlatformApplicationValidator.GetBigQueryRowCountByIdParam} arg
|
|
1874
|
-
* - Arg object
|
|
1875
|
-
*
|
|
1876
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1877
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1878
|
-
* @returns {Promise<Object>} - Success response
|
|
1879
|
-
* @name getBigQueryRowCountById
|
|
1880
|
-
* @summary: Get BigQuery row count
|
|
1881
|
-
* @description: Retrieves big query row count by id - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/communication/getBigQueryRowCountById/).
|
|
1882
|
-
*/
|
|
1883
|
-
async getBigQueryRowCountById(
|
|
1884
|
-
{ id, requestHeaders } = { requestHeaders: {} },
|
|
1885
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
1886
|
-
) {
|
|
1887
|
-
const {
|
|
1888
|
-
error,
|
|
1889
|
-
} = CommunicationPlatformApplicationValidator.getBigQueryRowCountById().validate(
|
|
1890
|
-
{
|
|
1891
|
-
id,
|
|
1892
|
-
},
|
|
1893
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1894
|
-
);
|
|
1895
|
-
if (error) {
|
|
1896
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1897
|
-
}
|
|
1898
|
-
|
|
1899
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1900
|
-
const {
|
|
1901
|
-
error: warrning,
|
|
1902
|
-
} = CommunicationPlatformApplicationValidator.getBigQueryRowCountById().validate(
|
|
1903
|
-
{
|
|
1904
|
-
id,
|
|
1905
|
-
},
|
|
1906
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1907
|
-
);
|
|
1908
|
-
if (warrning) {
|
|
1909
|
-
Logger({
|
|
1910
|
-
level: "WARN",
|
|
1911
|
-
message: `Parameter Validation warrnings for platform > Communication > getBigQueryRowCountById \n ${warrning}`,
|
|
1912
|
-
});
|
|
1913
|
-
}
|
|
1914
|
-
|
|
1915
|
-
const query_params = {};
|
|
1916
|
-
|
|
1917
|
-
const response = await PlatformAPIClient.execute(
|
|
1918
|
-
this.config,
|
|
1919
|
-
"get",
|
|
1920
|
-
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sources/bigquery-row-count/${id}`,
|
|
1921
|
-
query_params,
|
|
1922
|
-
undefined,
|
|
1923
|
-
requestHeaders,
|
|
1924
|
-
{ responseHeaders }
|
|
1925
|
-
);
|
|
1926
|
-
|
|
1927
|
-
let responseData = response;
|
|
1928
|
-
if (responseHeaders) {
|
|
1929
|
-
responseData = response[0];
|
|
1930
|
-
}
|
|
1931
|
-
|
|
1932
|
-
const { error: res_error } = Joi.any().validate(responseData, {
|
|
1933
|
-
abortEarly: false,
|
|
1934
|
-
allowUnknown: true,
|
|
1935
|
-
});
|
|
1936
|
-
|
|
1937
|
-
if (res_error) {
|
|
1938
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
1939
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1940
|
-
} else {
|
|
1941
|
-
Logger({
|
|
1942
|
-
level: "WARN",
|
|
1943
|
-
message: `Response Validation Warnings for platform > Communication > getBigQueryRowCountById \n ${res_error}`,
|
|
1944
|
-
});
|
|
1945
|
-
}
|
|
1946
|
-
}
|
|
1947
|
-
|
|
1948
|
-
return response;
|
|
1949
|
-
}
|
|
1950
|
-
|
|
1951
1568
|
/**
|
|
1952
1569
|
* @param {CommunicationPlatformApplicationValidator.GetCampaignByIdParam} arg
|
|
1953
1570
|
* - Arg object
|
|
@@ -2806,7 +2423,7 @@ class Communication {
|
|
|
2806
2423
|
populate,
|
|
2807
2424
|
group,
|
|
2808
2425
|
subGroup,
|
|
2809
|
-
|
|
2426
|
+
fulfillmentOptionSlug,
|
|
2810
2427
|
requestHeaders,
|
|
2811
2428
|
} = { requestHeaders: {} },
|
|
2812
2429
|
{ responseHeaders } = { responseHeaders: false }
|
|
@@ -2820,7 +2437,7 @@ class Communication {
|
|
|
2820
2437
|
populate,
|
|
2821
2438
|
group,
|
|
2822
2439
|
subGroup,
|
|
2823
|
-
|
|
2440
|
+
fulfillmentOptionSlug,
|
|
2824
2441
|
},
|
|
2825
2442
|
{ abortEarly: false, allowUnknown: true }
|
|
2826
2443
|
);
|
|
@@ -2838,7 +2455,7 @@ class Communication {
|
|
|
2838
2455
|
populate,
|
|
2839
2456
|
group,
|
|
2840
2457
|
subGroup,
|
|
2841
|
-
|
|
2458
|
+
fulfillmentOptionSlug,
|
|
2842
2459
|
},
|
|
2843
2460
|
{ abortEarly: false, allowUnknown: false }
|
|
2844
2461
|
);
|
|
@@ -2855,7 +2472,7 @@ class Communication {
|
|
|
2855
2472
|
query_params["populate"] = populate;
|
|
2856
2473
|
query_params["group"] = group;
|
|
2857
2474
|
query_params["sub_group"] = subGroup;
|
|
2858
|
-
query_params["
|
|
2475
|
+
query_params["fulfillment_option_slug"] = fulfillmentOptionSlug;
|
|
2859
2476
|
|
|
2860
2477
|
const response = await PlatformAPIClient.execute(
|
|
2861
2478
|
this.config,
|
|
@@ -4143,81 +3760,6 @@ class Communication {
|
|
|
4143
3760
|
return response;
|
|
4144
3761
|
}
|
|
4145
3762
|
|
|
4146
|
-
/**
|
|
4147
|
-
* @param {CommunicationPlatformApplicationValidator.GetSystemAudiencesParam} arg
|
|
4148
|
-
* - Arg object
|
|
4149
|
-
*
|
|
4150
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
4151
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
4152
|
-
* @returns {Promise<Object>} - Success response
|
|
4153
|
-
* @name getSystemAudiences
|
|
4154
|
-
* @summary: Get system audiences
|
|
4155
|
-
* @description: Retrieves a list of system-defined audiences for communication. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/communication/getSystemAudiences/).
|
|
4156
|
-
*/
|
|
4157
|
-
async getSystemAudiences(
|
|
4158
|
-
{ requestHeaders } = { requestHeaders: {} },
|
|
4159
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
4160
|
-
) {
|
|
4161
|
-
const {
|
|
4162
|
-
error,
|
|
4163
|
-
} = CommunicationPlatformApplicationValidator.getSystemAudiences().validate(
|
|
4164
|
-
{},
|
|
4165
|
-
{ abortEarly: false, allowUnknown: true }
|
|
4166
|
-
);
|
|
4167
|
-
if (error) {
|
|
4168
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
4169
|
-
}
|
|
4170
|
-
|
|
4171
|
-
// Showing warrnings if extra unknown parameters are found
|
|
4172
|
-
const {
|
|
4173
|
-
error: warrning,
|
|
4174
|
-
} = CommunicationPlatformApplicationValidator.getSystemAudiences().validate(
|
|
4175
|
-
{},
|
|
4176
|
-
{ abortEarly: false, allowUnknown: false }
|
|
4177
|
-
);
|
|
4178
|
-
if (warrning) {
|
|
4179
|
-
Logger({
|
|
4180
|
-
level: "WARN",
|
|
4181
|
-
message: `Parameter Validation warrnings for platform > Communication > getSystemAudiences \n ${warrning}`,
|
|
4182
|
-
});
|
|
4183
|
-
}
|
|
4184
|
-
|
|
4185
|
-
const query_params = {};
|
|
4186
|
-
|
|
4187
|
-
const response = await PlatformAPIClient.execute(
|
|
4188
|
-
this.config,
|
|
4189
|
-
"get",
|
|
4190
|
-
`/service/platform/communication/v1.0/company/${this.config.companyId}/application/${this.applicationId}/sources/system-datasources`,
|
|
4191
|
-
query_params,
|
|
4192
|
-
undefined,
|
|
4193
|
-
requestHeaders,
|
|
4194
|
-
{ responseHeaders }
|
|
4195
|
-
);
|
|
4196
|
-
|
|
4197
|
-
let responseData = response;
|
|
4198
|
-
if (responseHeaders) {
|
|
4199
|
-
responseData = response[0];
|
|
4200
|
-
}
|
|
4201
|
-
|
|
4202
|
-
const { error: res_error } = Joi.any().validate(responseData, {
|
|
4203
|
-
abortEarly: false,
|
|
4204
|
-
allowUnknown: true,
|
|
4205
|
-
});
|
|
4206
|
-
|
|
4207
|
-
if (res_error) {
|
|
4208
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
4209
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
4210
|
-
} else {
|
|
4211
|
-
Logger({
|
|
4212
|
-
level: "WARN",
|
|
4213
|
-
message: `Response Validation Warnings for platform > Communication > getSystemAudiences \n ${res_error}`,
|
|
4214
|
-
});
|
|
4215
|
-
}
|
|
4216
|
-
}
|
|
4217
|
-
|
|
4218
|
-
return response;
|
|
4219
|
-
}
|
|
4220
|
-
|
|
4221
3763
|
/**
|
|
4222
3764
|
* @param {CommunicationPlatformApplicationValidator.GetSystemEmailTemplatesParam} arg
|
|
4223
3765
|
* - Arg object
|