@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.
Files changed (134) hide show
  1. package/documentation/application/CART.md +251 -251
  2. package/documentation/application/CATALOG.md +414 -414
  3. package/documentation/application/CONTENT.md +15 -1
  4. package/documentation/application/ORDER.md +290 -290
  5. package/documentation/application/PAYMENT.md +255 -255
  6. package/documentation/application/POSCART.md +297 -297
  7. package/documentation/platform/CART.md +499 -499
  8. package/documentation/platform/CATALOG.md +3088 -2702
  9. package/documentation/platform/COMPANYPROFILE.md +201 -201
  10. package/documentation/platform/CONTENT.md +123 -1
  11. package/documentation/platform/ORDER.md +1233 -1158
  12. package/documentation/platform/PARTNER.md +7 -7
  13. package/documentation/platform/PAYMENT.md +83 -83
  14. package/package.json +1 -1
  15. package/sdk/application/ApplicationConfig.js +1 -1
  16. package/sdk/application/Cart/CartApplicationClient.js +619 -108
  17. package/sdk/application/Cart/CartApplicationModel.d.ts +7 -7
  18. package/sdk/application/Cart/CartApplicationModel.js +335 -335
  19. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +1 -1
  20. package/sdk/application/Catalog/CatalogApplicationClient.js +730 -134
  21. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +21 -21
  22. package/sdk/application/Catalog/CatalogApplicationModel.js +547 -547
  23. package/sdk/application/Common/CommonApplicationClient.js +48 -8
  24. package/sdk/application/Communication/CommunicationApplicationClient.js +75 -14
  25. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +1 -1
  26. package/sdk/application/Configuration/ConfigurationApplicationClient.js +392 -66
  27. package/sdk/application/Content/ContentApplicationClient.js +444 -76
  28. package/sdk/application/Content/ContentApplicationModel.d.ts +1 -0
  29. package/sdk/application/Content/ContentApplicationModel.js +11 -1
  30. package/sdk/application/FileStorage/FileStorageApplicationClient.js +74 -12
  31. package/sdk/application/Lead/LeadApplicationClient.js +164 -30
  32. package/sdk/application/Logistic/LogisticApplicationClient.js +98 -16
  33. package/sdk/application/Order/OrderApplicationClient.d.ts +1 -1
  34. package/sdk/application/Order/OrderApplicationClient.js +287 -54
  35. package/sdk/application/Order/OrderApplicationModel.d.ts +19 -19
  36. package/sdk/application/Order/OrderApplicationModel.js +357 -357
  37. package/sdk/application/Payment/PaymentApplicationClient.js +961 -186
  38. package/sdk/application/Payment/PaymentApplicationModel.d.ts +3 -3
  39. package/sdk/application/Payment/PaymentApplicationModel.js +352 -352
  40. package/sdk/application/PosCart/PosCartApplicationClient.js +645 -114
  41. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +15 -15
  42. package/sdk/application/PosCart/PosCartApplicationModel.js +389 -389
  43. package/sdk/application/Rewards/RewardsApplicationClient.js +168 -28
  44. package/sdk/application/Share/ShareApplicationClient.js +157 -32
  45. package/sdk/application/Theme/ThemeApplicationClient.js +94 -16
  46. package/sdk/application/User/UserApplicationClient.js +806 -148
  47. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +16 -8
  48. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +191 -34
  49. package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
  50. package/sdk/platform/Analytics/AnalyticsPlatformClient.js +103 -16
  51. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
  52. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +103 -16
  53. package/sdk/platform/Billing/BillingPlatformClient.d.ts +24 -12
  54. package/sdk/platform/Billing/BillingPlatformClient.js +299 -54
  55. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +34 -17
  56. package/sdk/platform/Cart/CartPlatformApplicationClient.js +409 -72
  57. package/sdk/platform/Cart/CartPlatformModel.d.ts +35 -35
  58. package/sdk/platform/Cart/CartPlatformModel.js +617 -617
  59. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +167 -114
  60. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1562 -453
  61. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +8 -8
  62. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +39 -39
  63. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +314 -196
  64. package/sdk/platform/Catalog/CatalogPlatformClient.js +2459 -718
  65. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +103 -94
  66. package/sdk/platform/Catalog/CatalogPlatformModel.js +2063 -1797
  67. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +17 -15
  68. package/sdk/platform/Catalog/CatalogPlatformValidator.js +95 -76
  69. package/sdk/platform/Common/CommonPlatformClient.d.ts +4 -2
  70. package/sdk/platform/Common/CommonPlatformClient.js +51 -8
  71. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +80 -40
  72. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1000 -168
  73. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
  74. package/sdk/platform/Communication/CommunicationPlatformClient.js +28 -4
  75. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +27 -14
  76. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +335 -54
  77. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +10 -10
  78. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +278 -278
  79. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +56 -28
  80. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +702 -118
  81. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
  82. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +457 -82
  83. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +148 -67
  84. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1724 -284
  85. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -0
  86. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +7 -0
  87. package/sdk/platform/Content/ContentPlatformModel.d.ts +4 -0
  88. package/sdk/platform/Content/ContentPlatformModel.js +43 -1
  89. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +21 -10
  90. package/sdk/platform/Discount/DiscountPlatformClient.js +270 -44
  91. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +8 -4
  92. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +102 -16
  93. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +12 -6
  94. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +150 -24
  95. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +27 -14
  96. package/sdk/platform/Inventory/InventoryPlatformClient.js +316 -52
  97. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +26 -13
  98. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +311 -52
  99. package/sdk/platform/Lead/LeadPlatformClient.d.ts +22 -11
  100. package/sdk/platform/Lead/LeadPlatformClient.js +266 -44
  101. package/sdk/platform/OAuthClient.js +8 -8
  102. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +6 -3
  103. package/sdk/platform/Order/OrderPlatformApplicationClient.js +78 -14
  104. package/sdk/platform/Order/OrderPlatformClient.d.ts +95 -43
  105. package/sdk/platform/Order/OrderPlatformClient.js +1062 -180
  106. package/sdk/platform/Order/OrderPlatformModel.d.ts +64 -60
  107. package/sdk/platform/Order/OrderPlatformModel.js +1481 -1425
  108. package/sdk/platform/Order/OrderPlatformValidator.js +5 -0
  109. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
  110. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -8
  111. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
  112. package/sdk/platform/Partner/PartnerPlatformModel.js +8 -8
  113. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +22 -11
  114. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +287 -56
  115. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +21 -11
  116. package/sdk/platform/Payment/PaymentPlatformClient.js +263 -48
  117. package/sdk/platform/Payment/PaymentPlatformModel.js +122 -122
  118. package/sdk/platform/PlatformApplicationClient.d.ts +2959 -2787
  119. package/sdk/platform/PlatformApplicationClient.js +3420 -3212
  120. package/sdk/platform/PlatformClient.d.ts +2959 -2787
  121. package/sdk/platform/PlatformClient.js +3420 -3212
  122. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +26 -13
  123. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +308 -54
  124. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +8 -4
  125. package/sdk/platform/Share/SharePlatformApplicationClient.js +94 -16
  126. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +47 -23
  127. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +571 -96
  128. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +24 -12
  129. package/sdk/platform/User/UserPlatformApplicationClient.js +296 -48
  130. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +12 -6
  131. package/sdk/platform/Webhook/WebhookPlatformClient.js +157 -30
  132. package/sdk/public/Configuration/ConfigurationPublicClient.js +51 -8
  133. package/sdk/public/Inventory/InventoryPublicClient.js +149 -26
  134. package/sdk/public/Webhook/WebhookPublicClient.js +51 -10
@@ -3,6 +3,8 @@ const constructUrl = require("../constructUrl");
3
3
  const Paginator = require("../../common/Paginator");
4
4
  const { FDKClientValidationError } = require("../../common/FDKError");
5
5
  const ConfigurationValidator = require("./ConfigurationApplicationValidator");
6
+ const ConfigurationModel = require("./ConfigurationApplicationModel");
7
+ const { Logger } = require("./../../common/Logger");
6
8
 
7
9
  class Configuration {
8
10
  constructor(_conf) {
@@ -51,7 +53,7 @@ class Configuration {
51
53
  * @summary: Get current application details
52
54
  * @description: Use this API to get the current application details which includes configurations that indicate the status of the website, domain, ID, tokens, images, etc.
53
55
  */
54
- getApplication({} = {}) {
56
+ async getApplication({} = {}) {
55
57
  const { error } = ConfigurationValidator.getApplication().validate(
56
58
  {},
57
59
  { abortEarly: false, allowUnknown: true }
@@ -68,15 +70,18 @@ class Configuration {
68
70
  { abortEarly: false, allowUnknown: false }
69
71
  );
70
72
  if (warrning) {
71
- console.log("Parameter Validation warrnings for getApplication");
72
- console.log(warrning);
73
+ Logger({
74
+ level: "WARN",
75
+ message: "Parameter Validation warrnings for getApplication",
76
+ });
77
+ Logger({ level: "WARN", message: warrning });
73
78
  }
74
79
 
75
80
  const query_params = {};
76
81
 
77
82
  const xHeaders = {};
78
83
 
79
- return APIClient.execute(
84
+ const response = await APIClient.execute(
80
85
  this._conf,
81
86
  "get",
82
87
  constructUrl({
@@ -87,6 +92,23 @@ class Configuration {
87
92
  undefined,
88
93
  xHeaders
89
94
  );
95
+
96
+ const {
97
+ error: res_error,
98
+ } = ConfigurationModel.Application().validate(response, {
99
+ abortEarly: false,
100
+ allowUnknown: false,
101
+ });
102
+
103
+ if (res_error) {
104
+ Logger({
105
+ level: "WARN",
106
+ message: "Response Validation Warnnings for getApplication",
107
+ });
108
+ Logger({ level: "WARN", message: res_error });
109
+ }
110
+
111
+ return response;
90
112
  }
91
113
 
92
114
  /**
@@ -95,7 +117,7 @@ class Configuration {
95
117
  * @summary: Get application, owner and seller information
96
118
  * @description: Use this API to get the current application details which includes channel name, description, banner, logo, favicon, domain details, etc. This API also retrieves the seller and owner information such as address, email address, and phone number.
97
119
  */
98
- getOwnerInfo({} = {}) {
120
+ async getOwnerInfo({} = {}) {
99
121
  const { error } = ConfigurationValidator.getOwnerInfo().validate(
100
122
  {},
101
123
  { abortEarly: false, allowUnknown: true }
@@ -110,15 +132,18 @@ class Configuration {
110
132
  { abortEarly: false, allowUnknown: false }
111
133
  );
112
134
  if (warrning) {
113
- console.log("Parameter Validation warrnings for getOwnerInfo");
114
- console.log(warrning);
135
+ Logger({
136
+ level: "WARN",
137
+ message: "Parameter Validation warrnings for getOwnerInfo",
138
+ });
139
+ Logger({ level: "WARN", message: warrning });
115
140
  }
116
141
 
117
142
  const query_params = {};
118
143
 
119
144
  const xHeaders = {};
120
145
 
121
- return APIClient.execute(
146
+ const response = await APIClient.execute(
122
147
  this._conf,
123
148
  "get",
124
149
  constructUrl({
@@ -129,6 +154,23 @@ class Configuration {
129
154
  undefined,
130
155
  xHeaders
131
156
  );
157
+
158
+ const {
159
+ error: res_error,
160
+ } = ConfigurationModel.ApplicationAboutResponse().validate(response, {
161
+ abortEarly: false,
162
+ allowUnknown: false,
163
+ });
164
+
165
+ if (res_error) {
166
+ Logger({
167
+ level: "WARN",
168
+ message: "Response Validation Warnnings for getOwnerInfo",
169
+ });
170
+ Logger({ level: "WARN", message: res_error });
171
+ }
172
+
173
+ return response;
132
174
  }
133
175
 
134
176
  /**
@@ -137,7 +179,7 @@ class Configuration {
137
179
  * @summary: Get basic application details
138
180
  * @description: Use this API to retrieve only the basic details of the application which includes channel name, description, banner, logo, favicon, domain details, etc.
139
181
  */
140
- getBasicDetails({} = {}) {
182
+ async getBasicDetails({} = {}) {
141
183
  const { error } = ConfigurationValidator.getBasicDetails().validate(
142
184
  {},
143
185
  { abortEarly: false, allowUnknown: true }
@@ -154,15 +196,18 @@ class Configuration {
154
196
  { abortEarly: false, allowUnknown: false }
155
197
  );
156
198
  if (warrning) {
157
- console.log("Parameter Validation warrnings for getBasicDetails");
158
- console.log(warrning);
199
+ Logger({
200
+ level: "WARN",
201
+ message: "Parameter Validation warrnings for getBasicDetails",
202
+ });
203
+ Logger({ level: "WARN", message: warrning });
159
204
  }
160
205
 
161
206
  const query_params = {};
162
207
 
163
208
  const xHeaders = {};
164
209
 
165
- return APIClient.execute(
210
+ const response = await APIClient.execute(
166
211
  this._conf,
167
212
  "get",
168
213
  constructUrl({
@@ -173,6 +218,23 @@ class Configuration {
173
218
  undefined,
174
219
  xHeaders
175
220
  );
221
+
222
+ const {
223
+ error: res_error,
224
+ } = ConfigurationModel.ApplicationDetail().validate(response, {
225
+ abortEarly: false,
226
+ allowUnknown: false,
227
+ });
228
+
229
+ if (res_error) {
230
+ Logger({
231
+ level: "WARN",
232
+ message: "Response Validation Warnnings for getBasicDetails",
233
+ });
234
+ Logger({ level: "WARN", message: res_error });
235
+ }
236
+
237
+ return response;
176
238
  }
177
239
 
178
240
  /**
@@ -181,7 +243,7 @@ class Configuration {
181
243
  * @summary: Get integration tokens
182
244
  * @description: Use this API to retrieve the tokens used while integrating Firebase, MoEngage, Segment, GTM, Freshchat, Safetynet, Google Map and Facebook. **Note** - Token values are encrypted with AES encryption using a secret key. Kindly reach out to the developers for obtaining the secret key.
183
245
  */
184
- getIntegrationTokens({} = {}) {
246
+ async getIntegrationTokens({} = {}) {
185
247
  const { error } = ConfigurationValidator.getIntegrationTokens().validate(
186
248
  {},
187
249
  { abortEarly: false, allowUnknown: true }
@@ -198,15 +260,18 @@ class Configuration {
198
260
  { abortEarly: false, allowUnknown: false }
199
261
  );
200
262
  if (warrning) {
201
- console.log("Parameter Validation warrnings for getIntegrationTokens");
202
- console.log(warrning);
263
+ Logger({
264
+ level: "WARN",
265
+ message: "Parameter Validation warrnings for getIntegrationTokens",
266
+ });
267
+ Logger({ level: "WARN", message: warrning });
203
268
  }
204
269
 
205
270
  const query_params = {};
206
271
 
207
272
  const xHeaders = {};
208
273
 
209
- return APIClient.execute(
274
+ const response = await APIClient.execute(
210
275
  this._conf,
211
276
  "get",
212
277
  constructUrl({
@@ -217,6 +282,23 @@ class Configuration {
217
282
  undefined,
218
283
  xHeaders
219
284
  );
285
+
286
+ const {
287
+ error: res_error,
288
+ } = ConfigurationModel.AppTokenResponse().validate(response, {
289
+ abortEarly: false,
290
+ allowUnknown: false,
291
+ });
292
+
293
+ if (res_error) {
294
+ Logger({
295
+ level: "WARN",
296
+ message: "Response Validation Warnnings for getIntegrationTokens",
297
+ });
298
+ Logger({ level: "WARN", message: res_error });
299
+ }
300
+
301
+ return response;
220
302
  }
221
303
 
222
304
  /**
@@ -230,7 +312,7 @@ class Configuration {
230
312
  * @summary: Get deployment stores
231
313
  * @description: Use this API to retrieve the details of all the deployment stores (the selling locations where the application will be utilized for placing orders).
232
314
  */
233
- getOrderingStores({ pageNo, pageSize, q } = {}) {
315
+ async getOrderingStores({ pageNo, pageSize, q } = {}) {
234
316
  const { error } = ConfigurationValidator.getOrderingStores().validate(
235
317
  { pageNo, pageSize, q },
236
318
  { abortEarly: false, allowUnknown: true }
@@ -247,8 +329,11 @@ class Configuration {
247
329
  { abortEarly: false, allowUnknown: false }
248
330
  );
249
331
  if (warrning) {
250
- console.log("Parameter Validation warrnings for getOrderingStores");
251
- console.log(warrning);
332
+ Logger({
333
+ level: "WARN",
334
+ message: "Parameter Validation warrnings for getOrderingStores",
335
+ });
336
+ Logger({ level: "WARN", message: warrning });
252
337
  }
253
338
 
254
339
  const query_params = {};
@@ -258,7 +343,7 @@ class Configuration {
258
343
 
259
344
  const xHeaders = {};
260
345
 
261
- return APIClient.execute(
346
+ const response = await APIClient.execute(
262
347
  this._conf,
263
348
  "get",
264
349
  constructUrl({
@@ -269,6 +354,23 @@ class Configuration {
269
354
  undefined,
270
355
  xHeaders
271
356
  );
357
+
358
+ const {
359
+ error: res_error,
360
+ } = ConfigurationModel.OrderingStores().validate(response, {
361
+ abortEarly: false,
362
+ allowUnknown: false,
363
+ });
364
+
365
+ if (res_error) {
366
+ Logger({
367
+ level: "WARN",
368
+ message: "Response Validation Warnnings for getOrderingStores",
369
+ });
370
+ Logger({ level: "WARN", message: res_error });
371
+ }
372
+
373
+ return response;
272
374
  }
273
375
 
274
376
  /**
@@ -307,7 +409,7 @@ class Configuration {
307
409
  * @summary: Get ordering store details
308
410
  * @description: Use this API to retrieve the details of given stores uid (the selling locations where the application will be utilized for placing orders).
309
411
  */
310
- getStoreDetailById({ storeId } = {}) {
412
+ async getStoreDetailById({ storeId } = {}) {
311
413
  const { error } = ConfigurationValidator.getStoreDetailById().validate(
312
414
  { storeId },
313
415
  { abortEarly: false, allowUnknown: true }
@@ -324,15 +426,18 @@ class Configuration {
324
426
  { abortEarly: false, allowUnknown: false }
325
427
  );
326
428
  if (warrning) {
327
- console.log("Parameter Validation warrnings for getStoreDetailById");
328
- console.log(warrning);
429
+ Logger({
430
+ level: "WARN",
431
+ message: "Parameter Validation warrnings for getStoreDetailById",
432
+ });
433
+ Logger({ level: "WARN", message: warrning });
329
434
  }
330
435
 
331
436
  const query_params = {};
332
437
 
333
438
  const xHeaders = {};
334
439
 
335
- return APIClient.execute(
440
+ const response = await APIClient.execute(
336
441
  this._conf,
337
442
  "get",
338
443
  constructUrl({
@@ -343,6 +448,23 @@ class Configuration {
343
448
  undefined,
344
449
  xHeaders
345
450
  );
451
+
452
+ const {
453
+ error: res_error,
454
+ } = ConfigurationModel.OrderingStore().validate(response, {
455
+ abortEarly: false,
456
+ allowUnknown: false,
457
+ });
458
+
459
+ if (res_error) {
460
+ Logger({
461
+ level: "WARN",
462
+ message: "Response Validation Warnnings for getStoreDetailById",
463
+ });
464
+ Logger({ level: "WARN", message: res_error });
465
+ }
466
+
467
+ return response;
346
468
  }
347
469
 
348
470
  /**
@@ -351,7 +473,7 @@ class Configuration {
351
473
  * @summary: Get features of application
352
474
  * @description: Use this API to retrieve the configuration of features such as product detail, landing page, options in the login/registration screen, communication opt-in, cart options and many more.
353
475
  */
354
- getFeatures({} = {}) {
476
+ async getFeatures({} = {}) {
355
477
  const { error } = ConfigurationValidator.getFeatures().validate(
356
478
  {},
357
479
  { abortEarly: false, allowUnknown: true }
@@ -366,15 +488,18 @@ class Configuration {
366
488
  { abortEarly: false, allowUnknown: false }
367
489
  );
368
490
  if (warrning) {
369
- console.log("Parameter Validation warrnings for getFeatures");
370
- console.log(warrning);
491
+ Logger({
492
+ level: "WARN",
493
+ message: "Parameter Validation warrnings for getFeatures",
494
+ });
495
+ Logger({ level: "WARN", message: warrning });
371
496
  }
372
497
 
373
498
  const query_params = {};
374
499
 
375
500
  const xHeaders = {};
376
501
 
377
- return APIClient.execute(
502
+ const response = await APIClient.execute(
378
503
  this._conf,
379
504
  "get",
380
505
  constructUrl({
@@ -385,6 +510,23 @@ class Configuration {
385
510
  undefined,
386
511
  xHeaders
387
512
  );
513
+
514
+ const {
515
+ error: res_error,
516
+ } = ConfigurationModel.AppFeatureResponse().validate(response, {
517
+ abortEarly: false,
518
+ allowUnknown: false,
519
+ });
520
+
521
+ if (res_error) {
522
+ Logger({
523
+ level: "WARN",
524
+ message: "Response Validation Warnnings for getFeatures",
525
+ });
526
+ Logger({ level: "WARN", message: res_error });
527
+ }
528
+
529
+ return response;
388
530
  }
389
531
 
390
532
  /**
@@ -393,7 +535,7 @@ class Configuration {
393
535
  * @summary: Get application information
394
536
  * @description: Use this API to retrieve information about the social links, address and contact information of the company/seller/brand operating the application.
395
537
  */
396
- getContactInfo({} = {}) {
538
+ async getContactInfo({} = {}) {
397
539
  const { error } = ConfigurationValidator.getContactInfo().validate(
398
540
  {},
399
541
  { abortEarly: false, allowUnknown: true }
@@ -410,15 +552,18 @@ class Configuration {
410
552
  { abortEarly: false, allowUnknown: false }
411
553
  );
412
554
  if (warrning) {
413
- console.log("Parameter Validation warrnings for getContactInfo");
414
- console.log(warrning);
555
+ Logger({
556
+ level: "WARN",
557
+ message: "Parameter Validation warrnings for getContactInfo",
558
+ });
559
+ Logger({ level: "WARN", message: warrning });
415
560
  }
416
561
 
417
562
  const query_params = {};
418
563
 
419
564
  const xHeaders = {};
420
565
 
421
- return APIClient.execute(
566
+ const response = await APIClient.execute(
422
567
  this._conf,
423
568
  "get",
424
569
  constructUrl({
@@ -429,6 +574,23 @@ class Configuration {
429
574
  undefined,
430
575
  xHeaders
431
576
  );
577
+
578
+ const {
579
+ error: res_error,
580
+ } = ConfigurationModel.ApplicationInformation().validate(response, {
581
+ abortEarly: false,
582
+ allowUnknown: false,
583
+ });
584
+
585
+ if (res_error) {
586
+ Logger({
587
+ level: "WARN",
588
+ message: "Response Validation Warnnings for getContactInfo",
589
+ });
590
+ Logger({ level: "WARN", message: res_error });
591
+ }
592
+
593
+ return response;
432
594
  }
433
595
 
434
596
  /**
@@ -437,7 +599,7 @@ class Configuration {
437
599
  * @summary: Get all currencies list
438
600
  * @description: Use this API to get a list of currencies available. Moreover, get the name, code, symbol, and the decimal digits of the currencies.
439
601
  */
440
- getCurrencies({} = {}) {
602
+ async getCurrencies({} = {}) {
441
603
  const { error } = ConfigurationValidator.getCurrencies().validate(
442
604
  {},
443
605
  { abortEarly: false, allowUnknown: true }
@@ -452,15 +614,18 @@ class Configuration {
452
614
  { abortEarly: false, allowUnknown: false }
453
615
  );
454
616
  if (warrning) {
455
- console.log("Parameter Validation warrnings for getCurrencies");
456
- console.log(warrning);
617
+ Logger({
618
+ level: "WARN",
619
+ message: "Parameter Validation warrnings for getCurrencies",
620
+ });
621
+ Logger({ level: "WARN", message: warrning });
457
622
  }
458
623
 
459
624
  const query_params = {};
460
625
 
461
626
  const xHeaders = {};
462
627
 
463
- return APIClient.execute(
628
+ const response = await APIClient.execute(
464
629
  this._conf,
465
630
  "get",
466
631
  constructUrl({
@@ -471,6 +636,23 @@ class Configuration {
471
636
  undefined,
472
637
  xHeaders
473
638
  );
639
+
640
+ const {
641
+ error: res_error,
642
+ } = ConfigurationModel.CurrenciesResponse().validate(response, {
643
+ abortEarly: false,
644
+ allowUnknown: false,
645
+ });
646
+
647
+ if (res_error) {
648
+ Logger({
649
+ level: "WARN",
650
+ message: "Response Validation Warnnings for getCurrencies",
651
+ });
652
+ Logger({ level: "WARN", message: res_error });
653
+ }
654
+
655
+ return response;
474
656
  }
475
657
 
476
658
  /**
@@ -480,7 +662,7 @@ class Configuration {
480
662
  * @summary: Get currency by its ID
481
663
  * @description: Use this API to retrieve a currency using its ID.
482
664
  */
483
- getCurrencyById({ id } = {}) {
665
+ async getCurrencyById({ id } = {}) {
484
666
  const { error } = ConfigurationValidator.getCurrencyById().validate(
485
667
  { id },
486
668
  { abortEarly: false, allowUnknown: true }
@@ -497,15 +679,18 @@ class Configuration {
497
679
  { abortEarly: false, allowUnknown: false }
498
680
  );
499
681
  if (warrning) {
500
- console.log("Parameter Validation warrnings for getCurrencyById");
501
- console.log(warrning);
682
+ Logger({
683
+ level: "WARN",
684
+ message: "Parameter Validation warrnings for getCurrencyById",
685
+ });
686
+ Logger({ level: "WARN", message: warrning });
502
687
  }
503
688
 
504
689
  const query_params = {};
505
690
 
506
691
  const xHeaders = {};
507
692
 
508
- return APIClient.execute(
693
+ const response = await APIClient.execute(
509
694
  this._conf,
510
695
  "get",
511
696
  constructUrl({
@@ -516,6 +701,23 @@ class Configuration {
516
701
  undefined,
517
702
  xHeaders
518
703
  );
704
+
705
+ const {
706
+ error: res_error,
707
+ } = ConfigurationModel.Currency().validate(response, {
708
+ abortEarly: false,
709
+ allowUnknown: false,
710
+ });
711
+
712
+ if (res_error) {
713
+ Logger({
714
+ level: "WARN",
715
+ message: "Response Validation Warnnings for getCurrencyById",
716
+ });
717
+ Logger({ level: "WARN", message: res_error });
718
+ }
719
+
720
+ return response;
519
721
  }
520
722
 
521
723
  /**
@@ -524,7 +726,7 @@ class Configuration {
524
726
  * @summary: Get currencies enabled in the application
525
727
  * @description: Use this API to get a list of currencies allowed in the current application. Moreover, get the name, code, symbol, and the decimal digits of the currencies.
526
728
  */
527
- getAppCurrencies({} = {}) {
729
+ async getAppCurrencies({} = {}) {
528
730
  const { error } = ConfigurationValidator.getAppCurrencies().validate(
529
731
  {},
530
732
  { abortEarly: false, allowUnknown: true }
@@ -541,15 +743,18 @@ class Configuration {
541
743
  { abortEarly: false, allowUnknown: false }
542
744
  );
543
745
  if (warrning) {
544
- console.log("Parameter Validation warrnings for getAppCurrencies");
545
- console.log(warrning);
746
+ Logger({
747
+ level: "WARN",
748
+ message: "Parameter Validation warrnings for getAppCurrencies",
749
+ });
750
+ Logger({ level: "WARN", message: warrning });
546
751
  }
547
752
 
548
753
  const query_params = {};
549
754
 
550
755
  const xHeaders = {};
551
756
 
552
- return APIClient.execute(
757
+ const response = await APIClient.execute(
553
758
  this._conf,
554
759
  "get",
555
760
  constructUrl({
@@ -560,6 +765,23 @@ class Configuration {
560
765
  undefined,
561
766
  xHeaders
562
767
  );
768
+
769
+ const {
770
+ error: res_error,
771
+ } = ConfigurationModel.AppCurrencyResponse().validate(response, {
772
+ abortEarly: false,
773
+ allowUnknown: false,
774
+ });
775
+
776
+ if (res_error) {
777
+ Logger({
778
+ level: "WARN",
779
+ message: "Response Validation Warnnings for getAppCurrencies",
780
+ });
781
+ Logger({ level: "WARN", message: res_error });
782
+ }
783
+
784
+ return response;
563
785
  }
564
786
 
565
787
  /**
@@ -568,7 +790,7 @@ class Configuration {
568
790
  * @summary: Get list of languages
569
791
  * @description: Use this API to get a list of languages supported in the application.
570
792
  */
571
- getLanguages({} = {}) {
793
+ async getLanguages({} = {}) {
572
794
  const { error } = ConfigurationValidator.getLanguages().validate(
573
795
  {},
574
796
  { abortEarly: false, allowUnknown: true }
@@ -583,15 +805,18 @@ class Configuration {
583
805
  { abortEarly: false, allowUnknown: false }
584
806
  );
585
807
  if (warrning) {
586
- console.log("Parameter Validation warrnings for getLanguages");
587
- console.log(warrning);
808
+ Logger({
809
+ level: "WARN",
810
+ message: "Parameter Validation warrnings for getLanguages",
811
+ });
812
+ Logger({ level: "WARN", message: warrning });
588
813
  }
589
814
 
590
815
  const query_params = {};
591
816
 
592
817
  const xHeaders = {};
593
818
 
594
- return APIClient.execute(
819
+ const response = await APIClient.execute(
595
820
  this._conf,
596
821
  "get",
597
822
  constructUrl({
@@ -602,6 +827,23 @@ class Configuration {
602
827
  undefined,
603
828
  xHeaders
604
829
  );
830
+
831
+ const {
832
+ error: res_error,
833
+ } = ConfigurationModel.LanguageResponse().validate(response, {
834
+ abortEarly: false,
835
+ allowUnknown: false,
836
+ });
837
+
838
+ if (res_error) {
839
+ Logger({
840
+ level: "WARN",
841
+ message: "Response Validation Warnnings for getLanguages",
842
+ });
843
+ Logger({ level: "WARN", message: res_error });
844
+ }
845
+
846
+ return response;
605
847
  }
606
848
 
607
849
  /**
@@ -611,7 +853,7 @@ class Configuration {
611
853
  * @summary: Get an Ordering Store signed cookie on selection of ordering store.
612
854
  * @description: Use this API to get an Ordering Store signed cookie upon selecting an ordering store. This will be used by the cart service to verify a coupon against the selected ordering store in cart.
613
855
  */
614
- getOrderingStoreCookie({ body } = {}) {
856
+ async getOrderingStoreCookie({ body } = {}) {
615
857
  const { error } = ConfigurationValidator.getOrderingStoreCookie().validate(
616
858
  { body },
617
859
  { abortEarly: false, allowUnknown: true }
@@ -628,15 +870,18 @@ class Configuration {
628
870
  { abortEarly: false, allowUnknown: false }
629
871
  );
630
872
  if (warrning) {
631
- console.log("Parameter Validation warrnings for getOrderingStoreCookie");
632
- console.log(warrning);
873
+ Logger({
874
+ level: "WARN",
875
+ message: "Parameter Validation warrnings for getOrderingStoreCookie",
876
+ });
877
+ Logger({ level: "WARN", message: warrning });
633
878
  }
634
879
 
635
880
  const query_params = {};
636
881
 
637
882
  const xHeaders = {};
638
883
 
639
- return APIClient.execute(
884
+ const response = await APIClient.execute(
640
885
  this._conf,
641
886
  "post",
642
887
  constructUrl({
@@ -647,6 +892,23 @@ class Configuration {
647
892
  body,
648
893
  xHeaders
649
894
  );
895
+
896
+ const {
897
+ error: res_error,
898
+ } = ConfigurationModel.SuccessMessageResponse().validate(response, {
899
+ abortEarly: false,
900
+ allowUnknown: false,
901
+ });
902
+
903
+ if (res_error) {
904
+ Logger({
905
+ level: "WARN",
906
+ message: "Response Validation Warnnings for getOrderingStoreCookie",
907
+ });
908
+ Logger({ level: "WARN", message: res_error });
909
+ }
910
+
911
+ return response;
650
912
  }
651
913
 
652
914
  /**
@@ -655,7 +917,7 @@ class Configuration {
655
917
  * @summary: Unset the Ordering Store signed cookie.
656
918
  * @description: Use this API to unset the Ordering Store cookie upon changing the sales channel, by its domain URL, in the Universal Fynd Store app.
657
919
  */
658
- removeOrderingStoreCookie({} = {}) {
920
+ async removeOrderingStoreCookie({} = {}) {
659
921
  const {
660
922
  error,
661
923
  } = ConfigurationValidator.removeOrderingStoreCookie().validate(
@@ -674,17 +936,18 @@ class Configuration {
674
936
  { abortEarly: false, allowUnknown: false }
675
937
  );
676
938
  if (warrning) {
677
- console.log(
678
- "Parameter Validation warrnings for removeOrderingStoreCookie"
679
- );
680
- console.log(warrning);
939
+ Logger({
940
+ level: "WARN",
941
+ message: "Parameter Validation warrnings for removeOrderingStoreCookie",
942
+ });
943
+ Logger({ level: "WARN", message: warrning });
681
944
  }
682
945
 
683
946
  const query_params = {};
684
947
 
685
948
  const xHeaders = {};
686
949
 
687
- return APIClient.execute(
950
+ const response = await APIClient.execute(
688
951
  this._conf,
689
952
  "delete",
690
953
  constructUrl({
@@ -695,6 +958,23 @@ class Configuration {
695
958
  undefined,
696
959
  xHeaders
697
960
  );
961
+
962
+ const {
963
+ error: res_error,
964
+ } = ConfigurationModel.SuccessMessageResponse().validate(response, {
965
+ abortEarly: false,
966
+ allowUnknown: false,
967
+ });
968
+
969
+ if (res_error) {
970
+ Logger({
971
+ level: "WARN",
972
+ message: "Response Validation Warnnings for removeOrderingStoreCookie",
973
+ });
974
+ Logger({ level: "WARN", message: res_error });
975
+ }
976
+
977
+ return response;
698
978
  }
699
979
 
700
980
  /**
@@ -711,7 +991,13 @@ class Configuration {
711
991
  * @summary: Get a list of staff.
712
992
  * @description: Use this API to get a list of staff including the names, employee code, incentive status, assigned ordering stores, and title of each staff added to the application.
713
993
  */
714
- getAppStaffList({ pageNo, pageSize, orderIncent, orderingStore, user } = {}) {
994
+ async getAppStaffList({
995
+ pageNo,
996
+ pageSize,
997
+ orderIncent,
998
+ orderingStore,
999
+ user,
1000
+ } = {}) {
715
1001
  const { error } = ConfigurationValidator.getAppStaffList().validate(
716
1002
  { pageNo, pageSize, orderIncent, orderingStore, user },
717
1003
  { abortEarly: false, allowUnknown: true }
@@ -728,8 +1014,11 @@ class Configuration {
728
1014
  { abortEarly: false, allowUnknown: false }
729
1015
  );
730
1016
  if (warrning) {
731
- console.log("Parameter Validation warrnings for getAppStaffList");
732
- console.log(warrning);
1017
+ Logger({
1018
+ level: "WARN",
1019
+ message: "Parameter Validation warrnings for getAppStaffList",
1020
+ });
1021
+ Logger({ level: "WARN", message: warrning });
733
1022
  }
734
1023
 
735
1024
  const query_params = {};
@@ -741,7 +1030,7 @@ class Configuration {
741
1030
 
742
1031
  const xHeaders = {};
743
1032
 
744
- return APIClient.execute(
1033
+ const response = await APIClient.execute(
745
1034
  this._conf,
746
1035
  "get",
747
1036
  constructUrl({
@@ -752,6 +1041,23 @@ class Configuration {
752
1041
  undefined,
753
1042
  xHeaders
754
1043
  );
1044
+
1045
+ const {
1046
+ error: res_error,
1047
+ } = ConfigurationModel.AppStaffListResponse().validate(response, {
1048
+ abortEarly: false,
1049
+ allowUnknown: false,
1050
+ });
1051
+
1052
+ if (res_error) {
1053
+ Logger({
1054
+ level: "WARN",
1055
+ message: "Response Validation Warnnings for getAppStaffList",
1056
+ });
1057
+ Logger({ level: "WARN", message: res_error });
1058
+ }
1059
+
1060
+ return response;
755
1061
  }
756
1062
 
757
1063
  /**
@@ -806,7 +1112,7 @@ class Configuration {
806
1112
  * @summary: Get a list of staff.
807
1113
  * @description: Use this API to get a list of staff including the names, employee code, incentive status, assigned ordering stores, and title of each staff added to the application.
808
1114
  */
809
- getAppStaffs({ orderIncent, orderingStore, user } = {}) {
1115
+ async getAppStaffs({ orderIncent, orderingStore, user } = {}) {
810
1116
  const { error } = ConfigurationValidator.getAppStaffs().validate(
811
1117
  { orderIncent, orderingStore, user },
812
1118
  { abortEarly: false, allowUnknown: true }
@@ -821,8 +1127,11 @@ class Configuration {
821
1127
  { abortEarly: false, allowUnknown: false }
822
1128
  );
823
1129
  if (warrning) {
824
- console.log("Parameter Validation warrnings for getAppStaffs");
825
- console.log(warrning);
1130
+ Logger({
1131
+ level: "WARN",
1132
+ message: "Parameter Validation warrnings for getAppStaffs",
1133
+ });
1134
+ Logger({ level: "WARN", message: warrning });
826
1135
  }
827
1136
 
828
1137
  const query_params = {};
@@ -832,7 +1141,7 @@ class Configuration {
832
1141
 
833
1142
  const xHeaders = {};
834
1143
 
835
- return APIClient.execute(
1144
+ const response = await APIClient.execute(
836
1145
  this._conf,
837
1146
  "get",
838
1147
  constructUrl({
@@ -843,6 +1152,23 @@ class Configuration {
843
1152
  undefined,
844
1153
  xHeaders
845
1154
  );
1155
+
1156
+ const {
1157
+ error: res_error,
1158
+ } = ConfigurationModel.AppStaffResponse().validate(response, {
1159
+ abortEarly: false,
1160
+ allowUnknown: false,
1161
+ });
1162
+
1163
+ if (res_error) {
1164
+ Logger({
1165
+ level: "WARN",
1166
+ message: "Response Validation Warnnings for getAppStaffs",
1167
+ });
1168
+ Logger({ level: "WARN", message: res_error });
1169
+ }
1170
+
1171
+ return response;
846
1172
  }
847
1173
  }
848
1174