@gofynd/fdk-client-javascript 1.0.1 → 1.0.2
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/documentation/application/CART.md +251 -251
- package/documentation/application/CATALOG.md +414 -414
- package/documentation/application/CONTENT.md +15 -1
- package/documentation/application/ORDER.md +290 -290
- package/documentation/application/PAYMENT.md +255 -255
- package/documentation/application/POSCART.md +297 -297
- package/documentation/platform/CART.md +499 -499
- package/documentation/platform/CATALOG.md +3088 -2702
- package/documentation/platform/COMPANYPROFILE.md +201 -201
- package/documentation/platform/CONTENT.md +123 -1
- package/documentation/platform/ORDER.md +1233 -1158
- package/documentation/platform/PARTNER.md +7 -7
- package/documentation/platform/PAYMENT.md +83 -83
- package/package.json +1 -1
- package/sdk/application/ApplicationConfig.js +1 -1
- package/sdk/application/Cart/CartApplicationClient.js +619 -108
- package/sdk/application/Cart/CartApplicationModel.d.ts +7 -7
- package/sdk/application/Cart/CartApplicationModel.js +335 -335
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +1 -1
- package/sdk/application/Catalog/CatalogApplicationClient.js +730 -134
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +21 -21
- package/sdk/application/Catalog/CatalogApplicationModel.js +547 -547
- package/sdk/application/Common/CommonApplicationClient.js +48 -8
- package/sdk/application/Communication/CommunicationApplicationClient.js +75 -14
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +1 -1
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +392 -66
- package/sdk/application/Content/ContentApplicationClient.js +444 -76
- package/sdk/application/Content/ContentApplicationModel.d.ts +1 -0
- package/sdk/application/Content/ContentApplicationModel.js +11 -1
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +74 -12
- package/sdk/application/Lead/LeadApplicationClient.js +164 -30
- package/sdk/application/Logistic/LogisticApplicationClient.js +98 -16
- package/sdk/application/Order/OrderApplicationClient.d.ts +1 -1
- package/sdk/application/Order/OrderApplicationClient.js +287 -54
- package/sdk/application/Order/OrderApplicationModel.d.ts +19 -19
- package/sdk/application/Order/OrderApplicationModel.js +357 -357
- package/sdk/application/Payment/PaymentApplicationClient.js +961 -186
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +3 -3
- package/sdk/application/Payment/PaymentApplicationModel.js +352 -352
- package/sdk/application/PosCart/PosCartApplicationClient.js +645 -114
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +15 -15
- package/sdk/application/PosCart/PosCartApplicationModel.js +389 -389
- package/sdk/application/Rewards/RewardsApplicationClient.js +168 -28
- package/sdk/application/Share/ShareApplicationClient.js +157 -32
- package/sdk/application/Theme/ThemeApplicationClient.js +94 -16
- package/sdk/application/User/UserApplicationClient.js +806 -148
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +16 -8
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +191 -34
- package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
- package/sdk/platform/Analytics/AnalyticsPlatformClient.js +103 -16
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +103 -16
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +24 -12
- package/sdk/platform/Billing/BillingPlatformClient.js +299 -54
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +34 -17
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +409 -72
- package/sdk/platform/Cart/CartPlatformModel.d.ts +35 -35
- package/sdk/platform/Cart/CartPlatformModel.js +617 -617
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +167 -114
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1562 -453
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +8 -8
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +39 -39
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +314 -196
- package/sdk/platform/Catalog/CatalogPlatformClient.js +2459 -718
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +103 -94
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2063 -1797
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +17 -15
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +95 -76
- package/sdk/platform/Common/CommonPlatformClient.d.ts +4 -2
- package/sdk/platform/Common/CommonPlatformClient.js +51 -8
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +80 -40
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1000 -168
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +28 -4
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +27 -14
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +335 -54
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +10 -10
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +278 -278
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +56 -28
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +702 -118
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +457 -82
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +148 -67
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1724 -284
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -0
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +7 -0
- package/sdk/platform/Content/ContentPlatformModel.d.ts +4 -0
- package/sdk/platform/Content/ContentPlatformModel.js +43 -1
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +21 -10
- package/sdk/platform/Discount/DiscountPlatformClient.js +270 -44
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +8 -4
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +102 -16
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +12 -6
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +150 -24
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +27 -14
- package/sdk/platform/Inventory/InventoryPlatformClient.js +316 -52
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +26 -13
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +311 -52
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +22 -11
- package/sdk/platform/Lead/LeadPlatformClient.js +266 -44
- package/sdk/platform/OAuthClient.js +8 -8
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +6 -3
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +78 -14
- package/sdk/platform/Order/OrderPlatformClient.d.ts +95 -43
- package/sdk/platform/Order/OrderPlatformClient.js +1062 -180
- package/sdk/platform/Order/OrderPlatformModel.d.ts +64 -60
- package/sdk/platform/Order/OrderPlatformModel.js +1481 -1425
- package/sdk/platform/Order/OrderPlatformValidator.js +5 -0
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -8
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
- package/sdk/platform/Partner/PartnerPlatformModel.js +8 -8
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +22 -11
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +287 -56
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +21 -11
- package/sdk/platform/Payment/PaymentPlatformClient.js +263 -48
- package/sdk/platform/Payment/PaymentPlatformModel.js +122 -122
- package/sdk/platform/PlatformApplicationClient.d.ts +2959 -2787
- package/sdk/platform/PlatformApplicationClient.js +3420 -3212
- package/sdk/platform/PlatformClient.d.ts +2959 -2787
- package/sdk/platform/PlatformClient.js +3420 -3212
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +26 -13
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +308 -54
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +8 -4
- package/sdk/platform/Share/SharePlatformApplicationClient.js +94 -16
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +47 -23
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +571 -96
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +24 -12
- package/sdk/platform/User/UserPlatformApplicationClient.js +296 -48
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +12 -6
- package/sdk/platform/Webhook/WebhookPlatformClient.js +157 -30
- package/sdk/public/Configuration/ConfigurationPublicClient.js +51 -8
- package/sdk/public/Inventory/InventoryPublicClient.js +149 -26
- package/sdk/public/Webhook/WebhookPublicClient.js +51 -10
|
@@ -2,6 +2,9 @@ const Paginator = require("../../common/Paginator");
|
|
|
2
2
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
3
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
4
4
|
const ConfigurationValidator = require("./ConfigurationPlatformValidator");
|
|
5
|
+
const ConfigurationModel = require("./ConfigurationPlatformModel");
|
|
6
|
+
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
|
|
5
8
|
class Configuration {
|
|
6
9
|
constructor(config) {
|
|
7
10
|
this.config = config;
|
|
@@ -10,10 +13,11 @@ class Configuration {
|
|
|
10
13
|
/**
|
|
11
14
|
* @param {Object} arg - Arg object.
|
|
12
15
|
* @param {CreateApplicationRequest} arg.body
|
|
16
|
+
* @returns {Promise<CreateAppResponse>} - Success response
|
|
13
17
|
* @summary: Create application
|
|
14
18
|
* @description: Create new application
|
|
15
19
|
*/
|
|
16
|
-
createApplication({ body } = {}) {
|
|
20
|
+
async createApplication({ body } = {}) {
|
|
17
21
|
const { error } = ConfigurationValidator.createApplication().validate(
|
|
18
22
|
{
|
|
19
23
|
body,
|
|
@@ -34,15 +38,18 @@ class Configuration {
|
|
|
34
38
|
{ abortEarly: false, allowUnknown: false }
|
|
35
39
|
);
|
|
36
40
|
if (warrning) {
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
Logger({
|
|
42
|
+
level: "WARN",
|
|
43
|
+
message: "Parameter Validation warrnings for createApplication",
|
|
44
|
+
});
|
|
45
|
+
Logger({ level: "WARN", message: warrning });
|
|
39
46
|
}
|
|
40
47
|
|
|
41
48
|
const query_params = {};
|
|
42
49
|
|
|
43
50
|
const xHeaders = {};
|
|
44
51
|
|
|
45
|
-
|
|
52
|
+
const response = await PlatformAPIClient.execute(
|
|
46
53
|
this.config,
|
|
47
54
|
"post",
|
|
48
55
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application`,
|
|
@@ -50,6 +57,23 @@ class Configuration {
|
|
|
50
57
|
body,
|
|
51
58
|
xHeaders
|
|
52
59
|
);
|
|
60
|
+
|
|
61
|
+
const {
|
|
62
|
+
error: res_error,
|
|
63
|
+
} = ConfigurationModel.CreateAppResponse().validate(response, {
|
|
64
|
+
abortEarly: false,
|
|
65
|
+
allowUnknown: false,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
if (res_error) {
|
|
69
|
+
Logger({
|
|
70
|
+
level: "WARN",
|
|
71
|
+
message: "Response Validation Warnnings for createApplication",
|
|
72
|
+
});
|
|
73
|
+
Logger({ level: "WARN", message: res_error });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return response;
|
|
53
77
|
}
|
|
54
78
|
|
|
55
79
|
/**
|
|
@@ -57,10 +81,11 @@ class Configuration {
|
|
|
57
81
|
* @param {number} [arg.pageNo] -
|
|
58
82
|
* @param {number} [arg.pageSize] -
|
|
59
83
|
* @param {string} [arg.q] - Url encoded object used as mongodb query
|
|
84
|
+
* @returns {Promise<ApplicationsResponse>} - Success response
|
|
60
85
|
* @summary: Get list of application under company
|
|
61
86
|
* @description: Get list of application under company
|
|
62
87
|
*/
|
|
63
|
-
getApplications({ pageNo, pageSize, q } = {}) {
|
|
88
|
+
async getApplications({ pageNo, pageSize, q } = {}) {
|
|
64
89
|
const { error } = ConfigurationValidator.getApplications().validate(
|
|
65
90
|
{
|
|
66
91
|
pageNo,
|
|
@@ -85,8 +110,11 @@ class Configuration {
|
|
|
85
110
|
{ abortEarly: false, allowUnknown: false }
|
|
86
111
|
);
|
|
87
112
|
if (warrning) {
|
|
88
|
-
|
|
89
|
-
|
|
113
|
+
Logger({
|
|
114
|
+
level: "WARN",
|
|
115
|
+
message: "Parameter Validation warrnings for getApplications",
|
|
116
|
+
});
|
|
117
|
+
Logger({ level: "WARN", message: warrning });
|
|
90
118
|
}
|
|
91
119
|
|
|
92
120
|
const query_params = {};
|
|
@@ -96,7 +124,7 @@ class Configuration {
|
|
|
96
124
|
|
|
97
125
|
const xHeaders = {};
|
|
98
126
|
|
|
99
|
-
|
|
127
|
+
const response = await PlatformAPIClient.execute(
|
|
100
128
|
this.config,
|
|
101
129
|
"get",
|
|
102
130
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/application`,
|
|
@@ -104,6 +132,23 @@ class Configuration {
|
|
|
104
132
|
undefined,
|
|
105
133
|
xHeaders
|
|
106
134
|
);
|
|
135
|
+
|
|
136
|
+
const {
|
|
137
|
+
error: res_error,
|
|
138
|
+
} = ConfigurationModel.ApplicationsResponse().validate(response, {
|
|
139
|
+
abortEarly: false,
|
|
140
|
+
allowUnknown: false,
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
if (res_error) {
|
|
144
|
+
Logger({
|
|
145
|
+
level: "WARN",
|
|
146
|
+
message: "Response Validation Warnnings for getApplications",
|
|
147
|
+
});
|
|
148
|
+
Logger({ level: "WARN", message: res_error });
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return response;
|
|
107
152
|
}
|
|
108
153
|
|
|
109
154
|
/**
|
|
@@ -136,10 +181,11 @@ class Configuration {
|
|
|
136
181
|
|
|
137
182
|
/**
|
|
138
183
|
* @param {Object} arg - Arg object.
|
|
184
|
+
* @returns {Promise<CurrenciesResponse>} - Success response
|
|
139
185
|
* @summary: Get all currencies
|
|
140
186
|
* @description: Get all currencies
|
|
141
187
|
*/
|
|
142
|
-
getCurrencies({} = {}) {
|
|
188
|
+
async getCurrencies({} = {}) {
|
|
143
189
|
const { error } = ConfigurationValidator.getCurrencies().validate(
|
|
144
190
|
{},
|
|
145
191
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -154,15 +200,18 @@ class Configuration {
|
|
|
154
200
|
{ abortEarly: false, allowUnknown: false }
|
|
155
201
|
);
|
|
156
202
|
if (warrning) {
|
|
157
|
-
|
|
158
|
-
|
|
203
|
+
Logger({
|
|
204
|
+
level: "WARN",
|
|
205
|
+
message: "Parameter Validation warrnings for getCurrencies",
|
|
206
|
+
});
|
|
207
|
+
Logger({ level: "WARN", message: warrning });
|
|
159
208
|
}
|
|
160
209
|
|
|
161
210
|
const query_params = {};
|
|
162
211
|
|
|
163
212
|
const xHeaders = {};
|
|
164
213
|
|
|
165
|
-
|
|
214
|
+
const response = await PlatformAPIClient.execute(
|
|
166
215
|
this.config,
|
|
167
216
|
"get",
|
|
168
217
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/currencies`,
|
|
@@ -170,15 +219,33 @@ class Configuration {
|
|
|
170
219
|
undefined,
|
|
171
220
|
xHeaders
|
|
172
221
|
);
|
|
222
|
+
|
|
223
|
+
const {
|
|
224
|
+
error: res_error,
|
|
225
|
+
} = ConfigurationModel.CurrenciesResponse().validate(response, {
|
|
226
|
+
abortEarly: false,
|
|
227
|
+
allowUnknown: false,
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
if (res_error) {
|
|
231
|
+
Logger({
|
|
232
|
+
level: "WARN",
|
|
233
|
+
message: "Response Validation Warnnings for getCurrencies",
|
|
234
|
+
});
|
|
235
|
+
Logger({ level: "WARN", message: res_error });
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
return response;
|
|
173
239
|
}
|
|
174
240
|
|
|
175
241
|
/**
|
|
176
242
|
* @param {Object} arg - Arg object.
|
|
177
243
|
* @param {DomainSuggestionsRequest} arg.body
|
|
244
|
+
* @returns {Promise<DomainSuggestionsResponse>} - Success response
|
|
178
245
|
* @summary: Check domain availibility before linking to application
|
|
179
246
|
* @description: Check domain availibility before linking to application. Also sends domain suggestions with similar to queried domain. \ Custom domain search is currently powered by GoDaddy provider.
|
|
180
247
|
*/
|
|
181
|
-
getDomainAvailibility({ body } = {}) {
|
|
248
|
+
async getDomainAvailibility({ body } = {}) {
|
|
182
249
|
const { error } = ConfigurationValidator.getDomainAvailibility().validate(
|
|
183
250
|
{
|
|
184
251
|
body,
|
|
@@ -199,15 +266,18 @@ class Configuration {
|
|
|
199
266
|
{ abortEarly: false, allowUnknown: false }
|
|
200
267
|
);
|
|
201
268
|
if (warrning) {
|
|
202
|
-
|
|
203
|
-
|
|
269
|
+
Logger({
|
|
270
|
+
level: "WARN",
|
|
271
|
+
message: "Parameter Validation warrnings for getDomainAvailibility",
|
|
272
|
+
});
|
|
273
|
+
Logger({ level: "WARN", message: warrning });
|
|
204
274
|
}
|
|
205
275
|
|
|
206
276
|
const query_params = {};
|
|
207
277
|
|
|
208
278
|
const xHeaders = {};
|
|
209
279
|
|
|
210
|
-
|
|
280
|
+
const response = await PlatformAPIClient.execute(
|
|
211
281
|
this.config,
|
|
212
282
|
"post",
|
|
213
283
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/domain/suggestions`,
|
|
@@ -215,15 +285,33 @@ class Configuration {
|
|
|
215
285
|
body,
|
|
216
286
|
xHeaders
|
|
217
287
|
);
|
|
288
|
+
|
|
289
|
+
const {
|
|
290
|
+
error: res_error,
|
|
291
|
+
} = ConfigurationModel.DomainSuggestionsResponse().validate(response, {
|
|
292
|
+
abortEarly: false,
|
|
293
|
+
allowUnknown: false,
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
if (res_error) {
|
|
297
|
+
Logger({
|
|
298
|
+
level: "WARN",
|
|
299
|
+
message: "Response Validation Warnnings for getDomainAvailibility",
|
|
300
|
+
});
|
|
301
|
+
Logger({ level: "WARN", message: res_error });
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
return response;
|
|
218
305
|
}
|
|
219
306
|
|
|
220
307
|
/**
|
|
221
308
|
* @param {Object} arg - Arg object.
|
|
222
309
|
* @param {number} arg.id - Integration id
|
|
310
|
+
* @returns {Promise<Integration>} - Success response
|
|
223
311
|
* @summary: Get integration data
|
|
224
312
|
* @description: Get integration data
|
|
225
313
|
*/
|
|
226
|
-
getIntegrationById({ id } = {}) {
|
|
314
|
+
async getIntegrationById({ id } = {}) {
|
|
227
315
|
const { error } = ConfigurationValidator.getIntegrationById().validate(
|
|
228
316
|
{
|
|
229
317
|
id,
|
|
@@ -244,15 +332,18 @@ class Configuration {
|
|
|
244
332
|
{ abortEarly: false, allowUnknown: false }
|
|
245
333
|
);
|
|
246
334
|
if (warrning) {
|
|
247
|
-
|
|
248
|
-
|
|
335
|
+
Logger({
|
|
336
|
+
level: "WARN",
|
|
337
|
+
message: "Parameter Validation warrnings for getIntegrationById",
|
|
338
|
+
});
|
|
339
|
+
Logger({ level: "WARN", message: warrning });
|
|
249
340
|
}
|
|
250
341
|
|
|
251
342
|
const query_params = {};
|
|
252
343
|
|
|
253
344
|
const xHeaders = {};
|
|
254
345
|
|
|
255
|
-
|
|
346
|
+
const response = await PlatformAPIClient.execute(
|
|
256
347
|
this.config,
|
|
257
348
|
"get",
|
|
258
349
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/integration/${id}`,
|
|
@@ -260,16 +351,34 @@ class Configuration {
|
|
|
260
351
|
undefined,
|
|
261
352
|
xHeaders
|
|
262
353
|
);
|
|
354
|
+
|
|
355
|
+
const {
|
|
356
|
+
error: res_error,
|
|
357
|
+
} = ConfigurationModel.Integration().validate(response, {
|
|
358
|
+
abortEarly: false,
|
|
359
|
+
allowUnknown: false,
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
if (res_error) {
|
|
363
|
+
Logger({
|
|
364
|
+
level: "WARN",
|
|
365
|
+
message: "Response Validation Warnnings for getIntegrationById",
|
|
366
|
+
});
|
|
367
|
+
Logger({ level: "WARN", message: res_error });
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
return response;
|
|
263
371
|
}
|
|
264
372
|
|
|
265
373
|
/**
|
|
266
374
|
* @param {Object} arg - Arg object.
|
|
267
375
|
* @param {number} [arg.pageNo] - Current page no
|
|
268
376
|
* @param {number} [arg.pageSize] - Current request items count
|
|
377
|
+
* @returns {Promise<GetIntegrationsOptInsResponse>} - Success response
|
|
269
378
|
* @summary: Get all available integration opt-ins
|
|
270
379
|
* @description: Get all available integration opt-ins
|
|
271
380
|
*/
|
|
272
|
-
getAvailableOptIns({ pageNo, pageSize } = {}) {
|
|
381
|
+
async getAvailableOptIns({ pageNo, pageSize } = {}) {
|
|
273
382
|
const { error } = ConfigurationValidator.getAvailableOptIns().validate(
|
|
274
383
|
{
|
|
275
384
|
pageNo,
|
|
@@ -292,8 +401,11 @@ class Configuration {
|
|
|
292
401
|
{ abortEarly: false, allowUnknown: false }
|
|
293
402
|
);
|
|
294
403
|
if (warrning) {
|
|
295
|
-
|
|
296
|
-
|
|
404
|
+
Logger({
|
|
405
|
+
level: "WARN",
|
|
406
|
+
message: "Parameter Validation warrnings for getAvailableOptIns",
|
|
407
|
+
});
|
|
408
|
+
Logger({ level: "WARN", message: warrning });
|
|
297
409
|
}
|
|
298
410
|
|
|
299
411
|
const query_params = {};
|
|
@@ -302,7 +414,7 @@ class Configuration {
|
|
|
302
414
|
|
|
303
415
|
const xHeaders = {};
|
|
304
416
|
|
|
305
|
-
|
|
417
|
+
const response = await PlatformAPIClient.execute(
|
|
306
418
|
this.config,
|
|
307
419
|
"get",
|
|
308
420
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/integration-opt-in/available`,
|
|
@@ -310,6 +422,23 @@ class Configuration {
|
|
|
310
422
|
undefined,
|
|
311
423
|
xHeaders
|
|
312
424
|
);
|
|
425
|
+
|
|
426
|
+
const {
|
|
427
|
+
error: res_error,
|
|
428
|
+
} = ConfigurationModel.GetIntegrationsOptInsResponse().validate(response, {
|
|
429
|
+
abortEarly: false,
|
|
430
|
+
allowUnknown: false,
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
if (res_error) {
|
|
434
|
+
Logger({
|
|
435
|
+
level: "WARN",
|
|
436
|
+
message: "Response Validation Warnnings for getAvailableOptIns",
|
|
437
|
+
});
|
|
438
|
+
Logger({ level: "WARN", message: res_error });
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
return response;
|
|
313
442
|
}
|
|
314
443
|
|
|
315
444
|
/**
|
|
@@ -344,10 +473,11 @@ class Configuration {
|
|
|
344
473
|
* @param {number} arg.uid - Integration level uid
|
|
345
474
|
* @param {number} [arg.pageNo] - Current page no
|
|
346
475
|
* @param {number} [arg.pageSize] - Current request items count
|
|
476
|
+
* @returns {Promise<GetIntegrationsOptInsResponse>} - Success response
|
|
347
477
|
* @summary: Get company/store level integration opt-ins
|
|
348
478
|
* @description: Get company/store level integration opt-ins
|
|
349
479
|
*/
|
|
350
|
-
getSelectedOptIns({ level, uid, pageNo, pageSize } = {}) {
|
|
480
|
+
async getSelectedOptIns({ level, uid, pageNo, pageSize } = {}) {
|
|
351
481
|
const { error } = ConfigurationValidator.getSelectedOptIns().validate(
|
|
352
482
|
{
|
|
353
483
|
level,
|
|
@@ -374,8 +504,11 @@ class Configuration {
|
|
|
374
504
|
{ abortEarly: false, allowUnknown: false }
|
|
375
505
|
);
|
|
376
506
|
if (warrning) {
|
|
377
|
-
|
|
378
|
-
|
|
507
|
+
Logger({
|
|
508
|
+
level: "WARN",
|
|
509
|
+
message: "Parameter Validation warrnings for getSelectedOptIns",
|
|
510
|
+
});
|
|
511
|
+
Logger({ level: "WARN", message: warrning });
|
|
379
512
|
}
|
|
380
513
|
|
|
381
514
|
const query_params = {};
|
|
@@ -384,7 +517,7 @@ class Configuration {
|
|
|
384
517
|
|
|
385
518
|
const xHeaders = {};
|
|
386
519
|
|
|
387
|
-
|
|
520
|
+
const response = await PlatformAPIClient.execute(
|
|
388
521
|
this.config,
|
|
389
522
|
"get",
|
|
390
523
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/integration-opt-in/selected/${level}/${uid}`,
|
|
@@ -392,6 +525,23 @@ class Configuration {
|
|
|
392
525
|
undefined,
|
|
393
526
|
xHeaders
|
|
394
527
|
);
|
|
528
|
+
|
|
529
|
+
const {
|
|
530
|
+
error: res_error,
|
|
531
|
+
} = ConfigurationModel.GetIntegrationsOptInsResponse().validate(response, {
|
|
532
|
+
abortEarly: false,
|
|
533
|
+
allowUnknown: false,
|
|
534
|
+
});
|
|
535
|
+
|
|
536
|
+
if (res_error) {
|
|
537
|
+
Logger({
|
|
538
|
+
level: "WARN",
|
|
539
|
+
message: "Response Validation Warnnings for getSelectedOptIns",
|
|
540
|
+
});
|
|
541
|
+
Logger({ level: "WARN", message: res_error });
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
return response;
|
|
395
545
|
}
|
|
396
546
|
|
|
397
547
|
/**
|
|
@@ -430,10 +580,11 @@ class Configuration {
|
|
|
430
580
|
* @param {string} arg.level - Integration level
|
|
431
581
|
* @param {boolean} [arg.opted] - Filter on opted stores
|
|
432
582
|
* @param {boolean} [arg.checkPermission] - Filter on if permissions are present
|
|
583
|
+
* @returns {Promise<IntegrationConfigResponse>} - Success response
|
|
433
584
|
* @summary: Get integration level config
|
|
434
585
|
* @description: Get integration/integration-opt-in level config
|
|
435
586
|
*/
|
|
436
|
-
getIntegrationLevelConfig({ id, level, opted, checkPermission } = {}) {
|
|
587
|
+
async getIntegrationLevelConfig({ id, level, opted, checkPermission } = {}) {
|
|
437
588
|
const {
|
|
438
589
|
error,
|
|
439
590
|
} = ConfigurationValidator.getIntegrationLevelConfig().validate(
|
|
@@ -462,10 +613,11 @@ class Configuration {
|
|
|
462
613
|
{ abortEarly: false, allowUnknown: false }
|
|
463
614
|
);
|
|
464
615
|
if (warrning) {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
616
|
+
Logger({
|
|
617
|
+
level: "WARN",
|
|
618
|
+
message: "Parameter Validation warrnings for getIntegrationLevelConfig",
|
|
619
|
+
});
|
|
620
|
+
Logger({ level: "WARN", message: warrning });
|
|
469
621
|
}
|
|
470
622
|
|
|
471
623
|
const query_params = {};
|
|
@@ -474,7 +626,7 @@ class Configuration {
|
|
|
474
626
|
|
|
475
627
|
const xHeaders = {};
|
|
476
628
|
|
|
477
|
-
|
|
629
|
+
const response = await PlatformAPIClient.execute(
|
|
478
630
|
this.config,
|
|
479
631
|
"get",
|
|
480
632
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/integration-opt-in/configuration/${id}/${level}`,
|
|
@@ -482,6 +634,23 @@ class Configuration {
|
|
|
482
634
|
undefined,
|
|
483
635
|
xHeaders
|
|
484
636
|
);
|
|
637
|
+
|
|
638
|
+
const {
|
|
639
|
+
error: res_error,
|
|
640
|
+
} = ConfigurationModel.IntegrationConfigResponse().validate(response, {
|
|
641
|
+
abortEarly: false,
|
|
642
|
+
allowUnknown: false,
|
|
643
|
+
});
|
|
644
|
+
|
|
645
|
+
if (res_error) {
|
|
646
|
+
Logger({
|
|
647
|
+
level: "WARN",
|
|
648
|
+
message: "Response Validation Warnnings for getIntegrationLevelConfig",
|
|
649
|
+
});
|
|
650
|
+
Logger({ level: "WARN", message: res_error });
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
return response;
|
|
485
654
|
}
|
|
486
655
|
|
|
487
656
|
/**
|
|
@@ -489,10 +658,11 @@ class Configuration {
|
|
|
489
658
|
* @param {string} arg.id - Integration id
|
|
490
659
|
* @param {string} arg.level - Integration level
|
|
491
660
|
* @param {UpdateIntegrationLevelRequest} arg.body
|
|
661
|
+
* @returns {Promise<IntegrationLevel>} - Success response
|
|
492
662
|
* @summary: Update a store level opt-in for integration
|
|
493
663
|
* @description: Update a store level opt-in for integration
|
|
494
664
|
*/
|
|
495
|
-
updateLevelIntegration({ id, level, body } = {}) {
|
|
665
|
+
async updateLevelIntegration({ id, level, body } = {}) {
|
|
496
666
|
const { error } = ConfigurationValidator.updateLevelIntegration().validate(
|
|
497
667
|
{
|
|
498
668
|
id,
|
|
@@ -517,15 +687,18 @@ class Configuration {
|
|
|
517
687
|
{ abortEarly: false, allowUnknown: false }
|
|
518
688
|
);
|
|
519
689
|
if (warrning) {
|
|
520
|
-
|
|
521
|
-
|
|
690
|
+
Logger({
|
|
691
|
+
level: "WARN",
|
|
692
|
+
message: "Parameter Validation warrnings for updateLevelIntegration",
|
|
693
|
+
});
|
|
694
|
+
Logger({ level: "WARN", message: warrning });
|
|
522
695
|
}
|
|
523
696
|
|
|
524
697
|
const query_params = {};
|
|
525
698
|
|
|
526
699
|
const xHeaders = {};
|
|
527
700
|
|
|
528
|
-
|
|
701
|
+
const response = await PlatformAPIClient.execute(
|
|
529
702
|
this.config,
|
|
530
703
|
"put",
|
|
531
704
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/integration-opt-in/configuration/${id}/${level}`,
|
|
@@ -533,6 +706,23 @@ class Configuration {
|
|
|
533
706
|
body,
|
|
534
707
|
xHeaders
|
|
535
708
|
);
|
|
709
|
+
|
|
710
|
+
const {
|
|
711
|
+
error: res_error,
|
|
712
|
+
} = ConfigurationModel.IntegrationLevel().validate(response, {
|
|
713
|
+
abortEarly: false,
|
|
714
|
+
allowUnknown: false,
|
|
715
|
+
});
|
|
716
|
+
|
|
717
|
+
if (res_error) {
|
|
718
|
+
Logger({
|
|
719
|
+
level: "WARN",
|
|
720
|
+
message: "Response Validation Warnnings for updateLevelIntegration",
|
|
721
|
+
});
|
|
722
|
+
Logger({ level: "WARN", message: res_error });
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
return response;
|
|
536
726
|
}
|
|
537
727
|
|
|
538
728
|
/**
|
|
@@ -540,10 +730,11 @@ class Configuration {
|
|
|
540
730
|
* @param {string} arg.id - Integration id
|
|
541
731
|
* @param {string} arg.level - Integration level
|
|
542
732
|
* @param {number} arg.uid - Integration level uid
|
|
733
|
+
* @returns {Promise<IntegrationLevel>} - Success response
|
|
543
734
|
* @summary: Get level data for integration
|
|
544
735
|
* @description: Get level data for integration
|
|
545
736
|
*/
|
|
546
|
-
getIntegrationByLevelId({ id, level, uid } = {}) {
|
|
737
|
+
async getIntegrationByLevelId({ id, level, uid } = {}) {
|
|
547
738
|
const { error } = ConfigurationValidator.getIntegrationByLevelId().validate(
|
|
548
739
|
{
|
|
549
740
|
id,
|
|
@@ -568,15 +759,18 @@ class Configuration {
|
|
|
568
759
|
{ abortEarly: false, allowUnknown: false }
|
|
569
760
|
);
|
|
570
761
|
if (warrning) {
|
|
571
|
-
|
|
572
|
-
|
|
762
|
+
Logger({
|
|
763
|
+
level: "WARN",
|
|
764
|
+
message: "Parameter Validation warrnings for getIntegrationByLevelId",
|
|
765
|
+
});
|
|
766
|
+
Logger({ level: "WARN", message: warrning });
|
|
573
767
|
}
|
|
574
768
|
|
|
575
769
|
const query_params = {};
|
|
576
770
|
|
|
577
771
|
const xHeaders = {};
|
|
578
772
|
|
|
579
|
-
|
|
773
|
+
const response = await PlatformAPIClient.execute(
|
|
580
774
|
this.config,
|
|
581
775
|
"get",
|
|
582
776
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/integration-opt-in/configuration/${id}/${level}/${uid}`,
|
|
@@ -584,6 +778,23 @@ class Configuration {
|
|
|
584
778
|
undefined,
|
|
585
779
|
xHeaders
|
|
586
780
|
);
|
|
781
|
+
|
|
782
|
+
const {
|
|
783
|
+
error: res_error,
|
|
784
|
+
} = ConfigurationModel.IntegrationLevel().validate(response, {
|
|
785
|
+
abortEarly: false,
|
|
786
|
+
allowUnknown: false,
|
|
787
|
+
});
|
|
788
|
+
|
|
789
|
+
if (res_error) {
|
|
790
|
+
Logger({
|
|
791
|
+
level: "WARN",
|
|
792
|
+
message: "Response Validation Warnnings for getIntegrationByLevelId",
|
|
793
|
+
});
|
|
794
|
+
Logger({ level: "WARN", message: res_error });
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
return response;
|
|
587
798
|
}
|
|
588
799
|
|
|
589
800
|
/**
|
|
@@ -592,10 +803,11 @@ class Configuration {
|
|
|
592
803
|
* @param {string} arg.level - Integration level
|
|
593
804
|
* @param {number} arg.uid - Integration level uid
|
|
594
805
|
* @param {IntegrationLevel} arg.body
|
|
806
|
+
* @returns {Promise<IntegrationLevel>} - Success response
|
|
595
807
|
* @summary: Update a store level opt-in for integration
|
|
596
808
|
* @description: Update a store level opt-in for integration
|
|
597
809
|
*/
|
|
598
|
-
updateLevelUidIntegration({ id, level, uid, body } = {}) {
|
|
810
|
+
async updateLevelUidIntegration({ id, level, uid, body } = {}) {
|
|
599
811
|
const {
|
|
600
812
|
error,
|
|
601
813
|
} = ConfigurationValidator.updateLevelUidIntegration().validate(
|
|
@@ -624,17 +836,18 @@ class Configuration {
|
|
|
624
836
|
{ abortEarly: false, allowUnknown: false }
|
|
625
837
|
);
|
|
626
838
|
if (warrning) {
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
839
|
+
Logger({
|
|
840
|
+
level: "WARN",
|
|
841
|
+
message: "Parameter Validation warrnings for updateLevelUidIntegration",
|
|
842
|
+
});
|
|
843
|
+
Logger({ level: "WARN", message: warrning });
|
|
631
844
|
}
|
|
632
845
|
|
|
633
846
|
const query_params = {};
|
|
634
847
|
|
|
635
848
|
const xHeaders = {};
|
|
636
849
|
|
|
637
|
-
|
|
850
|
+
const response = await PlatformAPIClient.execute(
|
|
638
851
|
this.config,
|
|
639
852
|
"put",
|
|
640
853
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/integration-opt-in/configuration/${id}/${level}/${uid}`,
|
|
@@ -642,6 +855,23 @@ class Configuration {
|
|
|
642
855
|
body,
|
|
643
856
|
xHeaders
|
|
644
857
|
);
|
|
858
|
+
|
|
859
|
+
const {
|
|
860
|
+
error: res_error,
|
|
861
|
+
} = ConfigurationModel.IntegrationLevel().validate(response, {
|
|
862
|
+
abortEarly: false,
|
|
863
|
+
allowUnknown: false,
|
|
864
|
+
});
|
|
865
|
+
|
|
866
|
+
if (res_error) {
|
|
867
|
+
Logger({
|
|
868
|
+
level: "WARN",
|
|
869
|
+
message: "Response Validation Warnnings for updateLevelUidIntegration",
|
|
870
|
+
});
|
|
871
|
+
Logger({ level: "WARN", message: res_error });
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
return response;
|
|
645
875
|
}
|
|
646
876
|
|
|
647
877
|
/**
|
|
@@ -649,10 +879,11 @@ class Configuration {
|
|
|
649
879
|
* @param {string} arg.id - Integration id
|
|
650
880
|
* @param {string} arg.level - Integration level
|
|
651
881
|
* @param {number} arg.uid - Integration level uid
|
|
882
|
+
* @returns {Promise<OptedStoreIntegration>} - Success response
|
|
652
883
|
* @summary: Check store has active integration
|
|
653
884
|
* @description: API checks if a store is already opted in any other integrations
|
|
654
885
|
*/
|
|
655
|
-
getLevelActiveIntegrations({ id, level, uid } = {}) {
|
|
886
|
+
async getLevelActiveIntegrations({ id, level, uid } = {}) {
|
|
656
887
|
const {
|
|
657
888
|
error,
|
|
658
889
|
} = ConfigurationValidator.getLevelActiveIntegrations().validate(
|
|
@@ -679,17 +910,19 @@ class Configuration {
|
|
|
679
910
|
{ abortEarly: false, allowUnknown: false }
|
|
680
911
|
);
|
|
681
912
|
if (warrning) {
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
913
|
+
Logger({
|
|
914
|
+
level: "WARN",
|
|
915
|
+
message:
|
|
916
|
+
"Parameter Validation warrnings for getLevelActiveIntegrations",
|
|
917
|
+
});
|
|
918
|
+
Logger({ level: "WARN", message: warrning });
|
|
686
919
|
}
|
|
687
920
|
|
|
688
921
|
const query_params = {};
|
|
689
922
|
|
|
690
923
|
const xHeaders = {};
|
|
691
924
|
|
|
692
|
-
|
|
925
|
+
const response = await PlatformAPIClient.execute(
|
|
693
926
|
this.config,
|
|
694
927
|
"get",
|
|
695
928
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/integration-opt-in/check/configuration/${id}/${level}/${uid}`,
|
|
@@ -697,15 +930,33 @@ class Configuration {
|
|
|
697
930
|
undefined,
|
|
698
931
|
xHeaders
|
|
699
932
|
);
|
|
933
|
+
|
|
934
|
+
const {
|
|
935
|
+
error: res_error,
|
|
936
|
+
} = ConfigurationModel.OptedStoreIntegration().validate(response, {
|
|
937
|
+
abortEarly: false,
|
|
938
|
+
allowUnknown: false,
|
|
939
|
+
});
|
|
940
|
+
|
|
941
|
+
if (res_error) {
|
|
942
|
+
Logger({
|
|
943
|
+
level: "WARN",
|
|
944
|
+
message: "Response Validation Warnnings for getLevelActiveIntegrations",
|
|
945
|
+
});
|
|
946
|
+
Logger({ level: "WARN", message: res_error });
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
return response;
|
|
700
950
|
}
|
|
701
951
|
|
|
702
952
|
/**
|
|
703
953
|
* @param {Object} arg - Arg object.
|
|
704
954
|
* @param {string} [arg.q] - Search text for brand name
|
|
955
|
+
* @returns {Promise<BrandsByCompanyResponse>} - Success response
|
|
705
956
|
* @summary: Get brands by company
|
|
706
957
|
* @description: Get brands by company
|
|
707
958
|
*/
|
|
708
|
-
getBrandsByCompany({ q } = {}) {
|
|
959
|
+
async getBrandsByCompany({ q } = {}) {
|
|
709
960
|
const { error } = ConfigurationValidator.getBrandsByCompany().validate(
|
|
710
961
|
{
|
|
711
962
|
q,
|
|
@@ -726,8 +977,11 @@ class Configuration {
|
|
|
726
977
|
{ abortEarly: false, allowUnknown: false }
|
|
727
978
|
);
|
|
728
979
|
if (warrning) {
|
|
729
|
-
|
|
730
|
-
|
|
980
|
+
Logger({
|
|
981
|
+
level: "WARN",
|
|
982
|
+
message: "Parameter Validation warrnings for getBrandsByCompany",
|
|
983
|
+
});
|
|
984
|
+
Logger({ level: "WARN", message: warrning });
|
|
731
985
|
}
|
|
732
986
|
|
|
733
987
|
const query_params = {};
|
|
@@ -735,7 +989,7 @@ class Configuration {
|
|
|
735
989
|
|
|
736
990
|
const xHeaders = {};
|
|
737
991
|
|
|
738
|
-
|
|
992
|
+
const response = await PlatformAPIClient.execute(
|
|
739
993
|
this.config,
|
|
740
994
|
"get",
|
|
741
995
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/inventory/brands-by-companies`,
|
|
@@ -743,6 +997,23 @@ class Configuration {
|
|
|
743
997
|
undefined,
|
|
744
998
|
xHeaders
|
|
745
999
|
);
|
|
1000
|
+
|
|
1001
|
+
const {
|
|
1002
|
+
error: res_error,
|
|
1003
|
+
} = ConfigurationModel.BrandsByCompanyResponse().validate(response, {
|
|
1004
|
+
abortEarly: false,
|
|
1005
|
+
allowUnknown: false,
|
|
1006
|
+
});
|
|
1007
|
+
|
|
1008
|
+
if (res_error) {
|
|
1009
|
+
Logger({
|
|
1010
|
+
level: "WARN",
|
|
1011
|
+
message: "Response Validation Warnnings for getBrandsByCompany",
|
|
1012
|
+
});
|
|
1013
|
+
Logger({ level: "WARN", message: res_error });
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
return response;
|
|
746
1017
|
}
|
|
747
1018
|
|
|
748
1019
|
/**
|
|
@@ -750,10 +1021,11 @@ class Configuration {
|
|
|
750
1021
|
* @param {number} [arg.pageNo] - Current page no
|
|
751
1022
|
* @param {number} [arg.pageSize] - Current request items count
|
|
752
1023
|
* @param {CompanyByBrandsRequest} arg.body
|
|
1024
|
+
* @returns {Promise<CompanyByBrandsResponse>} - Success response
|
|
753
1025
|
* @summary: Get company by brand uids
|
|
754
1026
|
* @description: Get company by brand uids
|
|
755
1027
|
*/
|
|
756
|
-
getCompanyByBrands({ body, pageNo, pageSize } = {}) {
|
|
1028
|
+
async getCompanyByBrands({ body, pageNo, pageSize } = {}) {
|
|
757
1029
|
const { error } = ConfigurationValidator.getCompanyByBrands().validate(
|
|
758
1030
|
{
|
|
759
1031
|
body,
|
|
@@ -778,8 +1050,11 @@ class Configuration {
|
|
|
778
1050
|
{ abortEarly: false, allowUnknown: false }
|
|
779
1051
|
);
|
|
780
1052
|
if (warrning) {
|
|
781
|
-
|
|
782
|
-
|
|
1053
|
+
Logger({
|
|
1054
|
+
level: "WARN",
|
|
1055
|
+
message: "Parameter Validation warrnings for getCompanyByBrands",
|
|
1056
|
+
});
|
|
1057
|
+
Logger({ level: "WARN", message: warrning });
|
|
783
1058
|
}
|
|
784
1059
|
|
|
785
1060
|
const query_params = {};
|
|
@@ -788,7 +1063,7 @@ class Configuration {
|
|
|
788
1063
|
|
|
789
1064
|
const xHeaders = {};
|
|
790
1065
|
|
|
791
|
-
|
|
1066
|
+
const response = await PlatformAPIClient.execute(
|
|
792
1067
|
this.config,
|
|
793
1068
|
"post",
|
|
794
1069
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/inventory/companies-by-brands`,
|
|
@@ -796,6 +1071,23 @@ class Configuration {
|
|
|
796
1071
|
body,
|
|
797
1072
|
xHeaders
|
|
798
1073
|
);
|
|
1074
|
+
|
|
1075
|
+
const {
|
|
1076
|
+
error: res_error,
|
|
1077
|
+
} = ConfigurationModel.CompanyByBrandsResponse().validate(response, {
|
|
1078
|
+
abortEarly: false,
|
|
1079
|
+
allowUnknown: false,
|
|
1080
|
+
});
|
|
1081
|
+
|
|
1082
|
+
if (res_error) {
|
|
1083
|
+
Logger({
|
|
1084
|
+
level: "WARN",
|
|
1085
|
+
message: "Response Validation Warnnings for getCompanyByBrands",
|
|
1086
|
+
});
|
|
1087
|
+
Logger({ level: "WARN", message: res_error });
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
return response;
|
|
799
1091
|
}
|
|
800
1092
|
|
|
801
1093
|
/**
|
|
@@ -831,10 +1123,11 @@ class Configuration {
|
|
|
831
1123
|
* @param {number} [arg.pageNo] - Current page no
|
|
832
1124
|
* @param {number} [arg.pageSize] - Current request items count
|
|
833
1125
|
* @param {StoreByBrandsRequest} arg.body
|
|
1126
|
+
* @returns {Promise<StoreByBrandsResponse>} - Success response
|
|
834
1127
|
* @summary: Get stores by brand uids
|
|
835
1128
|
* @description: Get stores by brand uids
|
|
836
1129
|
*/
|
|
837
|
-
getStoreByBrands({ body, pageNo, pageSize } = {}) {
|
|
1130
|
+
async getStoreByBrands({ body, pageNo, pageSize } = {}) {
|
|
838
1131
|
const { error } = ConfigurationValidator.getStoreByBrands().validate(
|
|
839
1132
|
{
|
|
840
1133
|
body,
|
|
@@ -859,8 +1152,11 @@ class Configuration {
|
|
|
859
1152
|
{ abortEarly: false, allowUnknown: false }
|
|
860
1153
|
);
|
|
861
1154
|
if (warrning) {
|
|
862
|
-
|
|
863
|
-
|
|
1155
|
+
Logger({
|
|
1156
|
+
level: "WARN",
|
|
1157
|
+
message: "Parameter Validation warrnings for getStoreByBrands",
|
|
1158
|
+
});
|
|
1159
|
+
Logger({ level: "WARN", message: warrning });
|
|
864
1160
|
}
|
|
865
1161
|
|
|
866
1162
|
const query_params = {};
|
|
@@ -869,7 +1165,7 @@ class Configuration {
|
|
|
869
1165
|
|
|
870
1166
|
const xHeaders = {};
|
|
871
1167
|
|
|
872
|
-
|
|
1168
|
+
const response = await PlatformAPIClient.execute(
|
|
873
1169
|
this.config,
|
|
874
1170
|
"post",
|
|
875
1171
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/inventory/stores-by-brands`,
|
|
@@ -877,6 +1173,23 @@ class Configuration {
|
|
|
877
1173
|
body,
|
|
878
1174
|
xHeaders
|
|
879
1175
|
);
|
|
1176
|
+
|
|
1177
|
+
const {
|
|
1178
|
+
error: res_error,
|
|
1179
|
+
} = ConfigurationModel.StoreByBrandsResponse().validate(response, {
|
|
1180
|
+
abortEarly: false,
|
|
1181
|
+
allowUnknown: false,
|
|
1182
|
+
});
|
|
1183
|
+
|
|
1184
|
+
if (res_error) {
|
|
1185
|
+
Logger({
|
|
1186
|
+
level: "WARN",
|
|
1187
|
+
message: "Response Validation Warnnings for getStoreByBrands",
|
|
1188
|
+
});
|
|
1189
|
+
Logger({ level: "WARN", message: res_error });
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
return response;
|
|
880
1193
|
}
|
|
881
1194
|
|
|
882
1195
|
/**
|
|
@@ -911,10 +1224,11 @@ class Configuration {
|
|
|
911
1224
|
* @param {Object} arg - Arg object.
|
|
912
1225
|
* @param {number} [arg.pageNo] - Current page no
|
|
913
1226
|
* @param {number} [arg.pageSize] - Current request items count
|
|
1227
|
+
* @returns {Promise<OtherSellerApplications>} - Success response
|
|
914
1228
|
* @summary: Get other seller applications
|
|
915
1229
|
* @description: Get other seller applications who has opted current company as inventory
|
|
916
1230
|
*/
|
|
917
|
-
getOtherSellerApplications({ pageNo, pageSize } = {}) {
|
|
1231
|
+
async getOtherSellerApplications({ pageNo, pageSize } = {}) {
|
|
918
1232
|
const {
|
|
919
1233
|
error,
|
|
920
1234
|
} = ConfigurationValidator.getOtherSellerApplications().validate(
|
|
@@ -939,10 +1253,12 @@ class Configuration {
|
|
|
939
1253
|
{ abortEarly: false, allowUnknown: false }
|
|
940
1254
|
);
|
|
941
1255
|
if (warrning) {
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
1256
|
+
Logger({
|
|
1257
|
+
level: "WARN",
|
|
1258
|
+
message:
|
|
1259
|
+
"Parameter Validation warrnings for getOtherSellerApplications",
|
|
1260
|
+
});
|
|
1261
|
+
Logger({ level: "WARN", message: warrning });
|
|
946
1262
|
}
|
|
947
1263
|
|
|
948
1264
|
const query_params = {};
|
|
@@ -951,7 +1267,7 @@ class Configuration {
|
|
|
951
1267
|
|
|
952
1268
|
const xHeaders = {};
|
|
953
1269
|
|
|
954
|
-
|
|
1270
|
+
const response = await PlatformAPIClient.execute(
|
|
955
1271
|
this.config,
|
|
956
1272
|
"get",
|
|
957
1273
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/other-seller-applications/`,
|
|
@@ -959,6 +1275,23 @@ class Configuration {
|
|
|
959
1275
|
undefined,
|
|
960
1276
|
xHeaders
|
|
961
1277
|
);
|
|
1278
|
+
|
|
1279
|
+
const {
|
|
1280
|
+
error: res_error,
|
|
1281
|
+
} = ConfigurationModel.OtherSellerApplications().validate(response, {
|
|
1282
|
+
abortEarly: false,
|
|
1283
|
+
allowUnknown: false,
|
|
1284
|
+
});
|
|
1285
|
+
|
|
1286
|
+
if (res_error) {
|
|
1287
|
+
Logger({
|
|
1288
|
+
level: "WARN",
|
|
1289
|
+
message: "Response Validation Warnnings for getOtherSellerApplications",
|
|
1290
|
+
});
|
|
1291
|
+
Logger({ level: "WARN", message: res_error });
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
return response;
|
|
962
1295
|
}
|
|
963
1296
|
|
|
964
1297
|
/**
|
|
@@ -990,10 +1323,11 @@ class Configuration {
|
|
|
990
1323
|
/**
|
|
991
1324
|
* @param {Object} arg - Arg object.
|
|
992
1325
|
* @param {string} arg.id - Application Id
|
|
1326
|
+
* @returns {Promise<OptedApplicationResponse>} - Success response
|
|
993
1327
|
* @summary: Get other seller applications
|
|
994
1328
|
* @description: Get other seller application
|
|
995
1329
|
*/
|
|
996
|
-
getOtherSellerApplicationById({ id } = {}) {
|
|
1330
|
+
async getOtherSellerApplicationById({ id } = {}) {
|
|
997
1331
|
const {
|
|
998
1332
|
error,
|
|
999
1333
|
} = ConfigurationValidator.getOtherSellerApplicationById().validate(
|
|
@@ -1016,17 +1350,19 @@ class Configuration {
|
|
|
1016
1350
|
{ abortEarly: false, allowUnknown: false }
|
|
1017
1351
|
);
|
|
1018
1352
|
if (warrning) {
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1353
|
+
Logger({
|
|
1354
|
+
level: "WARN",
|
|
1355
|
+
message:
|
|
1356
|
+
"Parameter Validation warrnings for getOtherSellerApplicationById",
|
|
1357
|
+
});
|
|
1358
|
+
Logger({ level: "WARN", message: warrning });
|
|
1023
1359
|
}
|
|
1024
1360
|
|
|
1025
1361
|
const query_params = {};
|
|
1026
1362
|
|
|
1027
1363
|
const xHeaders = {};
|
|
1028
1364
|
|
|
1029
|
-
|
|
1365
|
+
const response = await PlatformAPIClient.execute(
|
|
1030
1366
|
this.config,
|
|
1031
1367
|
"get",
|
|
1032
1368
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/other-seller-applications/${id}`,
|
|
@@ -1034,16 +1370,35 @@ class Configuration {
|
|
|
1034
1370
|
undefined,
|
|
1035
1371
|
xHeaders
|
|
1036
1372
|
);
|
|
1373
|
+
|
|
1374
|
+
const {
|
|
1375
|
+
error: res_error,
|
|
1376
|
+
} = ConfigurationModel.OptedApplicationResponse().validate(response, {
|
|
1377
|
+
abortEarly: false,
|
|
1378
|
+
allowUnknown: false,
|
|
1379
|
+
});
|
|
1380
|
+
|
|
1381
|
+
if (res_error) {
|
|
1382
|
+
Logger({
|
|
1383
|
+
level: "WARN",
|
|
1384
|
+
message:
|
|
1385
|
+
"Response Validation Warnnings for getOtherSellerApplicationById",
|
|
1386
|
+
});
|
|
1387
|
+
Logger({ level: "WARN", message: res_error });
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
return response;
|
|
1037
1391
|
}
|
|
1038
1392
|
|
|
1039
1393
|
/**
|
|
1040
1394
|
* @param {Object} arg - Arg object.
|
|
1041
1395
|
* @param {string} arg.id - Application Id
|
|
1042
1396
|
* @param {OptOutInventory} arg.body
|
|
1397
|
+
* @returns {Promise<SuccessMessageResponse>} - Success response
|
|
1043
1398
|
* @summary: Opt out company or store from other seller application
|
|
1044
1399
|
* @description: Opt out company or store from other seller application
|
|
1045
1400
|
*/
|
|
1046
|
-
optOutFromApplication({ id, body } = {}) {
|
|
1401
|
+
async optOutFromApplication({ id, body } = {}) {
|
|
1047
1402
|
const { error } = ConfigurationValidator.optOutFromApplication().validate(
|
|
1048
1403
|
{
|
|
1049
1404
|
id,
|
|
@@ -1066,15 +1421,18 @@ class Configuration {
|
|
|
1066
1421
|
{ abortEarly: false, allowUnknown: false }
|
|
1067
1422
|
);
|
|
1068
1423
|
if (warrning) {
|
|
1069
|
-
|
|
1070
|
-
|
|
1424
|
+
Logger({
|
|
1425
|
+
level: "WARN",
|
|
1426
|
+
message: "Parameter Validation warrnings for optOutFromApplication",
|
|
1427
|
+
});
|
|
1428
|
+
Logger({ level: "WARN", message: warrning });
|
|
1071
1429
|
}
|
|
1072
1430
|
|
|
1073
1431
|
const query_params = {};
|
|
1074
1432
|
|
|
1075
1433
|
const xHeaders = {};
|
|
1076
1434
|
|
|
1077
|
-
|
|
1435
|
+
const response = await PlatformAPIClient.execute(
|
|
1078
1436
|
this.config,
|
|
1079
1437
|
"put",
|
|
1080
1438
|
`/service/platform/configuration/v1.0/company/${this.config.companyId}/other-seller-applications/${id}/opt_out`,
|
|
@@ -1082,6 +1440,23 @@ class Configuration {
|
|
|
1082
1440
|
body,
|
|
1083
1441
|
xHeaders
|
|
1084
1442
|
);
|
|
1443
|
+
|
|
1444
|
+
const {
|
|
1445
|
+
error: res_error,
|
|
1446
|
+
} = ConfigurationModel.SuccessMessageResponse().validate(response, {
|
|
1447
|
+
abortEarly: false,
|
|
1448
|
+
allowUnknown: false,
|
|
1449
|
+
});
|
|
1450
|
+
|
|
1451
|
+
if (res_error) {
|
|
1452
|
+
Logger({
|
|
1453
|
+
level: "WARN",
|
|
1454
|
+
message: "Response Validation Warnnings for optOutFromApplication",
|
|
1455
|
+
});
|
|
1456
|
+
Logger({ level: "WARN", message: res_error });
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
return response;
|
|
1085
1460
|
}
|
|
1086
1461
|
}
|
|
1087
1462
|
|