@gofynd/fdk-client-javascript 1.0.0 → 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 (156) hide show
  1. package/documentation/application/CART.md +251 -251
  2. package/documentation/application/CATALOG.md +393 -393
  3. package/documentation/application/CONTENT.md +15 -1
  4. package/documentation/application/ORDER.md +268 -268
  5. package/documentation/application/PAYMENT.md +249 -249
  6. package/documentation/application/POSCART.md +297 -297
  7. package/documentation/platform/CART.md +499 -499
  8. package/documentation/platform/CATALOG.md +3497 -3097
  9. package/documentation/platform/COMPANYPROFILE.md +207 -207
  10. package/documentation/platform/CONTENT.md +123 -1
  11. package/documentation/platform/ORDER.md +1518 -1324
  12. package/documentation/platform/PARTNER.md +7 -7
  13. package/documentation/platform/PAYMENT.md +96 -96
  14. package/index.js +7 -1
  15. package/package.json +1 -1
  16. package/sdk/application/ApplicationConfig.js +1 -1
  17. package/sdk/application/Cart/CartApplicationClient.js +865 -52
  18. package/sdk/application/Cart/CartApplicationModel.d.ts +7 -7
  19. package/sdk/application/Cart/CartApplicationModel.js +335 -335
  20. package/sdk/application/Cart/CartApplicationValidator.js +1 -0
  21. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +1 -1
  22. package/sdk/application/Catalog/CatalogApplicationClient.js +1034 -60
  23. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +19 -19
  24. package/sdk/application/Catalog/CatalogApplicationModel.js +532 -532
  25. package/sdk/application/Catalog/CatalogApplicationValidator.js +1 -0
  26. package/sdk/application/Common/CommonApplicationClient.js +66 -4
  27. package/sdk/application/Common/CommonApplicationValidator.js +1 -0
  28. package/sdk/application/Communication/CommunicationApplicationClient.js +108 -6
  29. package/sdk/application/Communication/CommunicationApplicationValidator.js +1 -0
  30. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +1 -1
  31. package/sdk/application/Configuration/ConfigurationApplicationClient.js +558 -32
  32. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +1 -0
  33. package/sdk/application/Content/ContentApplicationClient.js +621 -38
  34. package/sdk/application/Content/ContentApplicationModel.d.ts +1 -0
  35. package/sdk/application/Content/ContentApplicationModel.js +11 -1
  36. package/sdk/application/Content/ContentApplicationValidator.js +1 -0
  37. package/sdk/application/FileStorage/FileStorageApplicationClient.js +101 -6
  38. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +1 -0
  39. package/sdk/application/Lead/LeadApplicationClient.js +229 -14
  40. package/sdk/application/Lead/LeadApplicationValidator.js +1 -0
  41. package/sdk/application/Logistic/LogisticApplicationClient.js +134 -8
  42. package/sdk/application/Logistic/LogisticApplicationValidator.js +1 -0
  43. package/sdk/application/Order/OrderApplicationClient.d.ts +1 -1
  44. package/sdk/application/Order/OrderApplicationClient.js +403 -24
  45. package/sdk/application/Order/OrderApplicationModel.d.ts +20 -20
  46. package/sdk/application/Order/OrderApplicationModel.js +334 -334
  47. package/sdk/application/Order/OrderApplicationValidator.js +1 -0
  48. package/sdk/application/Payment/PaymentApplicationClient.js +1381 -78
  49. package/sdk/application/Payment/PaymentApplicationModel.d.ts +2 -2
  50. package/sdk/application/Payment/PaymentApplicationModel.js +350 -350
  51. package/sdk/application/Payment/PaymentApplicationValidator.js +1 -0
  52. package/sdk/application/PosCart/PosCartApplicationClient.js +914 -54
  53. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +15 -15
  54. package/sdk/application/PosCart/PosCartApplicationModel.js +389 -389
  55. package/sdk/application/PosCart/PosCartApplicationValidator.js +1 -0
  56. package/sdk/application/Rewards/RewardsApplicationClient.js +235 -14
  57. package/sdk/application/Rewards/RewardsApplicationValidator.js +1 -0
  58. package/sdk/application/Share/ShareApplicationClient.js +226 -14
  59. package/sdk/application/Share/ShareApplicationValidator.js +1 -0
  60. package/sdk/application/Theme/ThemeApplicationClient.js +130 -8
  61. package/sdk/application/Theme/ThemeApplicationValidator.js +1 -0
  62. package/sdk/application/User/UserApplicationClient.js +1133 -70
  63. package/sdk/application/User/UserApplicationValidator.js +1 -0
  64. package/sdk/common/AxiosHelper.js +1 -1
  65. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +16 -8
  66. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +287 -16
  67. package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
  68. package/sdk/platform/Analytics/AnalyticsPlatformClient.js +153 -8
  69. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
  70. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +141 -8
  71. package/sdk/platform/Billing/BillingPlatformClient.d.ts +24 -12
  72. package/sdk/platform/Billing/BillingPlatformClient.js +429 -24
  73. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +34 -17
  74. package/sdk/platform/Cart/CartPlatformApplicationClient.js +617 -34
  75. package/sdk/platform/Cart/CartPlatformModel.d.ts +35 -35
  76. package/sdk/platform/Cart/CartPlatformModel.js +617 -617
  77. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +191 -138
  78. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2202 -302
  79. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +11 -11
  80. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +45 -45
  81. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +344 -226
  82. package/sdk/platform/Catalog/CatalogPlatformClient.js +3282 -488
  83. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +110 -100
  84. package/sdk/platform/Catalog/CatalogPlatformModel.js +2073 -1795
  85. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +23 -21
  86. package/sdk/platform/Catalog/CatalogPlatformValidator.js +103 -84
  87. package/sdk/platform/Common/CommonPlatformClient.d.ts +4 -2
  88. package/sdk/platform/Common/CommonPlatformClient.js +73 -4
  89. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +80 -40
  90. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1499 -80
  91. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
  92. package/sdk/platform/Communication/CommunicationPlatformClient.js +41 -2
  93. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +27 -14
  94. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +486 -26
  95. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +9 -9
  96. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +274 -274
  97. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +56 -28
  98. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +1022 -56
  99. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
  100. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +693 -36
  101. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +148 -67
  102. package/sdk/platform/Content/ContentPlatformApplicationClient.js +2446 -140
  103. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -0
  104. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +7 -0
  105. package/sdk/platform/Content/ContentPlatformModel.d.ts +4 -0
  106. package/sdk/platform/Content/ContentPlatformModel.js +43 -1
  107. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +21 -10
  108. package/sdk/platform/Discount/DiscountPlatformClient.js +400 -22
  109. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +8 -4
  110. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +148 -8
  111. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +12 -6
  112. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +214 -12
  113. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +27 -14
  114. package/sdk/platform/Inventory/InventoryPlatformClient.js +449 -24
  115. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +26 -13
  116. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +447 -26
  117. package/sdk/platform/Lead/LeadPlatformClient.d.ts +22 -11
  118. package/sdk/platform/Lead/LeadPlatformClient.js +384 -22
  119. package/sdk/platform/OAuthClient.js +8 -8
  120. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +6 -3
  121. package/sdk/platform/Order/OrderPlatformApplicationClient.js +125 -6
  122. package/sdk/platform/Order/OrderPlatformClient.d.ts +108 -47
  123. package/sdk/platform/Order/OrderPlatformClient.js +1641 -100
  124. package/sdk/platform/Order/OrderPlatformModel.d.ts +69 -58
  125. package/sdk/platform/Order/OrderPlatformModel.js +1485 -1493
  126. package/sdk/platform/Order/OrderPlatformValidator.d.ts +2 -1
  127. package/sdk/platform/Order/OrderPlatformValidator.js +15 -4
  128. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
  129. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +74 -4
  130. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
  131. package/sdk/platform/Partner/PartnerPlatformModel.js +8 -8
  132. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +22 -11
  133. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +418 -22
  134. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +21 -11
  135. package/sdk/platform/Payment/PaymentPlatformClient.js +374 -20
  136. package/sdk/platform/Payment/PaymentPlatformModel.js +139 -139
  137. package/sdk/platform/PlatformApplicationClient.d.ts +2973 -2827
  138. package/sdk/platform/PlatformApplicationClient.js +3461 -3263
  139. package/sdk/platform/PlatformClient.d.ts +2973 -2827
  140. package/sdk/platform/PlatformClient.js +3461 -3263
  141. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +26 -13
  142. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +449 -26
  143. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +8 -4
  144. package/sdk/platform/Share/SharePlatformApplicationClient.js +139 -8
  145. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +47 -23
  146. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +816 -48
  147. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +24 -12
  148. package/sdk/platform/User/UserPlatformApplicationClient.js +417 -24
  149. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +12 -6
  150. package/sdk/platform/Webhook/WebhookPlatformClient.js +229 -12
  151. package/sdk/public/Configuration/ConfigurationPublicClient.js +72 -4
  152. package/sdk/public/Configuration/ConfigurationPublicValidator.js +3 -1
  153. package/sdk/public/Inventory/InventoryPublicClient.js +210 -12
  154. package/sdk/public/Inventory/InventoryPublicValidator.js +3 -1
  155. package/sdk/public/Webhook/WebhookPublicClient.js +74 -4
  156. package/sdk/public/Webhook/WebhookPublicValidator.js +3 -1
@@ -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 }
@@ -59,11 +61,27 @@ class Configuration {
59
61
  if (error) {
60
62
  return Promise.reject(new FDKClientValidationError(error));
61
63
  }
64
+
65
+ // Showing warrnings if extra unknown parameters are found
66
+ const {
67
+ error: warrning,
68
+ } = ConfigurationValidator.getApplication().validate(
69
+ {},
70
+ { abortEarly: false, allowUnknown: false }
71
+ );
72
+ if (warrning) {
73
+ Logger({
74
+ level: "WARN",
75
+ message: "Parameter Validation warrnings for getApplication",
76
+ });
77
+ Logger({ level: "WARN", message: warrning });
78
+ }
79
+
62
80
  const query_params = {};
63
81
 
64
82
  const xHeaders = {};
65
83
 
66
- return APIClient.execute(
84
+ const response = await APIClient.execute(
67
85
  this._conf,
68
86
  "get",
69
87
  constructUrl({
@@ -74,6 +92,23 @@ class Configuration {
74
92
  undefined,
75
93
  xHeaders
76
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;
77
112
  }
78
113
 
79
114
  /**
@@ -82,7 +117,7 @@ class Configuration {
82
117
  * @summary: Get application, owner and seller information
83
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.
84
119
  */
85
- getOwnerInfo({} = {}) {
120
+ async getOwnerInfo({} = {}) {
86
121
  const { error } = ConfigurationValidator.getOwnerInfo().validate(
87
122
  {},
88
123
  { abortEarly: false, allowUnknown: true }
@@ -90,11 +125,25 @@ class Configuration {
90
125
  if (error) {
91
126
  return Promise.reject(new FDKClientValidationError(error));
92
127
  }
128
+
129
+ // Showing warrnings if extra unknown parameters are found
130
+ const { error: warrning } = ConfigurationValidator.getOwnerInfo().validate(
131
+ {},
132
+ { abortEarly: false, allowUnknown: false }
133
+ );
134
+ if (warrning) {
135
+ Logger({
136
+ level: "WARN",
137
+ message: "Parameter Validation warrnings for getOwnerInfo",
138
+ });
139
+ Logger({ level: "WARN", message: warrning });
140
+ }
141
+
93
142
  const query_params = {};
94
143
 
95
144
  const xHeaders = {};
96
145
 
97
- return APIClient.execute(
146
+ const response = await APIClient.execute(
98
147
  this._conf,
99
148
  "get",
100
149
  constructUrl({
@@ -105,6 +154,23 @@ class Configuration {
105
154
  undefined,
106
155
  xHeaders
107
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;
108
174
  }
109
175
 
110
176
  /**
@@ -113,7 +179,7 @@ class Configuration {
113
179
  * @summary: Get basic application details
114
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.
115
181
  */
116
- getBasicDetails({} = {}) {
182
+ async getBasicDetails({} = {}) {
117
183
  const { error } = ConfigurationValidator.getBasicDetails().validate(
118
184
  {},
119
185
  { abortEarly: false, allowUnknown: true }
@@ -121,11 +187,27 @@ class Configuration {
121
187
  if (error) {
122
188
  return Promise.reject(new FDKClientValidationError(error));
123
189
  }
190
+
191
+ // Showing warrnings if extra unknown parameters are found
192
+ const {
193
+ error: warrning,
194
+ } = ConfigurationValidator.getBasicDetails().validate(
195
+ {},
196
+ { abortEarly: false, allowUnknown: false }
197
+ );
198
+ if (warrning) {
199
+ Logger({
200
+ level: "WARN",
201
+ message: "Parameter Validation warrnings for getBasicDetails",
202
+ });
203
+ Logger({ level: "WARN", message: warrning });
204
+ }
205
+
124
206
  const query_params = {};
125
207
 
126
208
  const xHeaders = {};
127
209
 
128
- return APIClient.execute(
210
+ const response = await APIClient.execute(
129
211
  this._conf,
130
212
  "get",
131
213
  constructUrl({
@@ -136,6 +218,23 @@ class Configuration {
136
218
  undefined,
137
219
  xHeaders
138
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;
139
238
  }
140
239
 
141
240
  /**
@@ -144,7 +243,7 @@ class Configuration {
144
243
  * @summary: Get integration tokens
145
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.
146
245
  */
147
- getIntegrationTokens({} = {}) {
246
+ async getIntegrationTokens({} = {}) {
148
247
  const { error } = ConfigurationValidator.getIntegrationTokens().validate(
149
248
  {},
150
249
  { abortEarly: false, allowUnknown: true }
@@ -152,11 +251,27 @@ class Configuration {
152
251
  if (error) {
153
252
  return Promise.reject(new FDKClientValidationError(error));
154
253
  }
254
+
255
+ // Showing warrnings if extra unknown parameters are found
256
+ const {
257
+ error: warrning,
258
+ } = ConfigurationValidator.getIntegrationTokens().validate(
259
+ {},
260
+ { abortEarly: false, allowUnknown: false }
261
+ );
262
+ if (warrning) {
263
+ Logger({
264
+ level: "WARN",
265
+ message: "Parameter Validation warrnings for getIntegrationTokens",
266
+ });
267
+ Logger({ level: "WARN", message: warrning });
268
+ }
269
+
155
270
  const query_params = {};
156
271
 
157
272
  const xHeaders = {};
158
273
 
159
- return APIClient.execute(
274
+ const response = await APIClient.execute(
160
275
  this._conf,
161
276
  "get",
162
277
  constructUrl({
@@ -167,6 +282,23 @@ class Configuration {
167
282
  undefined,
168
283
  xHeaders
169
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;
170
302
  }
171
303
 
172
304
  /**
@@ -180,7 +312,7 @@ class Configuration {
180
312
  * @summary: Get deployment stores
181
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).
182
314
  */
183
- getOrderingStores({ pageNo, pageSize, q } = {}) {
315
+ async getOrderingStores({ pageNo, pageSize, q } = {}) {
184
316
  const { error } = ConfigurationValidator.getOrderingStores().validate(
185
317
  { pageNo, pageSize, q },
186
318
  { abortEarly: false, allowUnknown: true }
@@ -188,6 +320,22 @@ class Configuration {
188
320
  if (error) {
189
321
  return Promise.reject(new FDKClientValidationError(error));
190
322
  }
323
+
324
+ // Showing warrnings if extra unknown parameters are found
325
+ const {
326
+ error: warrning,
327
+ } = ConfigurationValidator.getOrderingStores().validate(
328
+ { pageNo, pageSize, q },
329
+ { abortEarly: false, allowUnknown: false }
330
+ );
331
+ if (warrning) {
332
+ Logger({
333
+ level: "WARN",
334
+ message: "Parameter Validation warrnings for getOrderingStores",
335
+ });
336
+ Logger({ level: "WARN", message: warrning });
337
+ }
338
+
191
339
  const query_params = {};
192
340
  query_params["page_no"] = pageNo;
193
341
  query_params["page_size"] = pageSize;
@@ -195,7 +343,7 @@ class Configuration {
195
343
 
196
344
  const xHeaders = {};
197
345
 
198
- return APIClient.execute(
346
+ const response = await APIClient.execute(
199
347
  this._conf,
200
348
  "get",
201
349
  constructUrl({
@@ -206,6 +354,23 @@ class Configuration {
206
354
  undefined,
207
355
  xHeaders
208
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;
209
374
  }
210
375
 
211
376
  /**
@@ -244,7 +409,7 @@ class Configuration {
244
409
  * @summary: Get ordering store details
245
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).
246
411
  */
247
- getStoreDetailById({ storeId } = {}) {
412
+ async getStoreDetailById({ storeId } = {}) {
248
413
  const { error } = ConfigurationValidator.getStoreDetailById().validate(
249
414
  { storeId },
250
415
  { abortEarly: false, allowUnknown: true }
@@ -252,11 +417,27 @@ class Configuration {
252
417
  if (error) {
253
418
  return Promise.reject(new FDKClientValidationError(error));
254
419
  }
420
+
421
+ // Showing warrnings if extra unknown parameters are found
422
+ const {
423
+ error: warrning,
424
+ } = ConfigurationValidator.getStoreDetailById().validate(
425
+ { storeId },
426
+ { abortEarly: false, allowUnknown: false }
427
+ );
428
+ if (warrning) {
429
+ Logger({
430
+ level: "WARN",
431
+ message: "Parameter Validation warrnings for getStoreDetailById",
432
+ });
433
+ Logger({ level: "WARN", message: warrning });
434
+ }
435
+
255
436
  const query_params = {};
256
437
 
257
438
  const xHeaders = {};
258
439
 
259
- return APIClient.execute(
440
+ const response = await APIClient.execute(
260
441
  this._conf,
261
442
  "get",
262
443
  constructUrl({
@@ -267,6 +448,23 @@ class Configuration {
267
448
  undefined,
268
449
  xHeaders
269
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;
270
468
  }
271
469
 
272
470
  /**
@@ -275,7 +473,7 @@ class Configuration {
275
473
  * @summary: Get features of application
276
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.
277
475
  */
278
- getFeatures({} = {}) {
476
+ async getFeatures({} = {}) {
279
477
  const { error } = ConfigurationValidator.getFeatures().validate(
280
478
  {},
281
479
  { abortEarly: false, allowUnknown: true }
@@ -283,11 +481,25 @@ class Configuration {
283
481
  if (error) {
284
482
  return Promise.reject(new FDKClientValidationError(error));
285
483
  }
484
+
485
+ // Showing warrnings if extra unknown parameters are found
486
+ const { error: warrning } = ConfigurationValidator.getFeatures().validate(
487
+ {},
488
+ { abortEarly: false, allowUnknown: false }
489
+ );
490
+ if (warrning) {
491
+ Logger({
492
+ level: "WARN",
493
+ message: "Parameter Validation warrnings for getFeatures",
494
+ });
495
+ Logger({ level: "WARN", message: warrning });
496
+ }
497
+
286
498
  const query_params = {};
287
499
 
288
500
  const xHeaders = {};
289
501
 
290
- return APIClient.execute(
502
+ const response = await APIClient.execute(
291
503
  this._conf,
292
504
  "get",
293
505
  constructUrl({
@@ -298,6 +510,23 @@ class Configuration {
298
510
  undefined,
299
511
  xHeaders
300
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;
301
530
  }
302
531
 
303
532
  /**
@@ -306,7 +535,7 @@ class Configuration {
306
535
  * @summary: Get application information
307
536
  * @description: Use this API to retrieve information about the social links, address and contact information of the company/seller/brand operating the application.
308
537
  */
309
- getContactInfo({} = {}) {
538
+ async getContactInfo({} = {}) {
310
539
  const { error } = ConfigurationValidator.getContactInfo().validate(
311
540
  {},
312
541
  { abortEarly: false, allowUnknown: true }
@@ -314,11 +543,27 @@ class Configuration {
314
543
  if (error) {
315
544
  return Promise.reject(new FDKClientValidationError(error));
316
545
  }
546
+
547
+ // Showing warrnings if extra unknown parameters are found
548
+ const {
549
+ error: warrning,
550
+ } = ConfigurationValidator.getContactInfo().validate(
551
+ {},
552
+ { abortEarly: false, allowUnknown: false }
553
+ );
554
+ if (warrning) {
555
+ Logger({
556
+ level: "WARN",
557
+ message: "Parameter Validation warrnings for getContactInfo",
558
+ });
559
+ Logger({ level: "WARN", message: warrning });
560
+ }
561
+
317
562
  const query_params = {};
318
563
 
319
564
  const xHeaders = {};
320
565
 
321
- return APIClient.execute(
566
+ const response = await APIClient.execute(
322
567
  this._conf,
323
568
  "get",
324
569
  constructUrl({
@@ -329,6 +574,23 @@ class Configuration {
329
574
  undefined,
330
575
  xHeaders
331
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;
332
594
  }
333
595
 
334
596
  /**
@@ -337,7 +599,7 @@ class Configuration {
337
599
  * @summary: Get all currencies list
338
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.
339
601
  */
340
- getCurrencies({} = {}) {
602
+ async getCurrencies({} = {}) {
341
603
  const { error } = ConfigurationValidator.getCurrencies().validate(
342
604
  {},
343
605
  { abortEarly: false, allowUnknown: true }
@@ -345,11 +607,25 @@ class Configuration {
345
607
  if (error) {
346
608
  return Promise.reject(new FDKClientValidationError(error));
347
609
  }
610
+
611
+ // Showing warrnings if extra unknown parameters are found
612
+ const { error: warrning } = ConfigurationValidator.getCurrencies().validate(
613
+ {},
614
+ { abortEarly: false, allowUnknown: false }
615
+ );
616
+ if (warrning) {
617
+ Logger({
618
+ level: "WARN",
619
+ message: "Parameter Validation warrnings for getCurrencies",
620
+ });
621
+ Logger({ level: "WARN", message: warrning });
622
+ }
623
+
348
624
  const query_params = {};
349
625
 
350
626
  const xHeaders = {};
351
627
 
352
- return APIClient.execute(
628
+ const response = await APIClient.execute(
353
629
  this._conf,
354
630
  "get",
355
631
  constructUrl({
@@ -360,6 +636,23 @@ class Configuration {
360
636
  undefined,
361
637
  xHeaders
362
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;
363
656
  }
364
657
 
365
658
  /**
@@ -369,7 +662,7 @@ class Configuration {
369
662
  * @summary: Get currency by its ID
370
663
  * @description: Use this API to retrieve a currency using its ID.
371
664
  */
372
- getCurrencyById({ id } = {}) {
665
+ async getCurrencyById({ id } = {}) {
373
666
  const { error } = ConfigurationValidator.getCurrencyById().validate(
374
667
  { id },
375
668
  { abortEarly: false, allowUnknown: true }
@@ -377,11 +670,27 @@ class Configuration {
377
670
  if (error) {
378
671
  return Promise.reject(new FDKClientValidationError(error));
379
672
  }
673
+
674
+ // Showing warrnings if extra unknown parameters are found
675
+ const {
676
+ error: warrning,
677
+ } = ConfigurationValidator.getCurrencyById().validate(
678
+ { id },
679
+ { abortEarly: false, allowUnknown: false }
680
+ );
681
+ if (warrning) {
682
+ Logger({
683
+ level: "WARN",
684
+ message: "Parameter Validation warrnings for getCurrencyById",
685
+ });
686
+ Logger({ level: "WARN", message: warrning });
687
+ }
688
+
380
689
  const query_params = {};
381
690
 
382
691
  const xHeaders = {};
383
692
 
384
- return APIClient.execute(
693
+ const response = await APIClient.execute(
385
694
  this._conf,
386
695
  "get",
387
696
  constructUrl({
@@ -392,6 +701,23 @@ class Configuration {
392
701
  undefined,
393
702
  xHeaders
394
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;
395
721
  }
396
722
 
397
723
  /**
@@ -400,7 +726,7 @@ class Configuration {
400
726
  * @summary: Get currencies enabled in the application
401
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.
402
728
  */
403
- getAppCurrencies({} = {}) {
729
+ async getAppCurrencies({} = {}) {
404
730
  const { error } = ConfigurationValidator.getAppCurrencies().validate(
405
731
  {},
406
732
  { abortEarly: false, allowUnknown: true }
@@ -408,11 +734,27 @@ class Configuration {
408
734
  if (error) {
409
735
  return Promise.reject(new FDKClientValidationError(error));
410
736
  }
737
+
738
+ // Showing warrnings if extra unknown parameters are found
739
+ const {
740
+ error: warrning,
741
+ } = ConfigurationValidator.getAppCurrencies().validate(
742
+ {},
743
+ { abortEarly: false, allowUnknown: false }
744
+ );
745
+ if (warrning) {
746
+ Logger({
747
+ level: "WARN",
748
+ message: "Parameter Validation warrnings for getAppCurrencies",
749
+ });
750
+ Logger({ level: "WARN", message: warrning });
751
+ }
752
+
411
753
  const query_params = {};
412
754
 
413
755
  const xHeaders = {};
414
756
 
415
- return APIClient.execute(
757
+ const response = await APIClient.execute(
416
758
  this._conf,
417
759
  "get",
418
760
  constructUrl({
@@ -423,6 +765,23 @@ class Configuration {
423
765
  undefined,
424
766
  xHeaders
425
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;
426
785
  }
427
786
 
428
787
  /**
@@ -431,7 +790,7 @@ class Configuration {
431
790
  * @summary: Get list of languages
432
791
  * @description: Use this API to get a list of languages supported in the application.
433
792
  */
434
- getLanguages({} = {}) {
793
+ async getLanguages({} = {}) {
435
794
  const { error } = ConfigurationValidator.getLanguages().validate(
436
795
  {},
437
796
  { abortEarly: false, allowUnknown: true }
@@ -439,11 +798,25 @@ class Configuration {
439
798
  if (error) {
440
799
  return Promise.reject(new FDKClientValidationError(error));
441
800
  }
801
+
802
+ // Showing warrnings if extra unknown parameters are found
803
+ const { error: warrning } = ConfigurationValidator.getLanguages().validate(
804
+ {},
805
+ { abortEarly: false, allowUnknown: false }
806
+ );
807
+ if (warrning) {
808
+ Logger({
809
+ level: "WARN",
810
+ message: "Parameter Validation warrnings for getLanguages",
811
+ });
812
+ Logger({ level: "WARN", message: warrning });
813
+ }
814
+
442
815
  const query_params = {};
443
816
 
444
817
  const xHeaders = {};
445
818
 
446
- return APIClient.execute(
819
+ const response = await APIClient.execute(
447
820
  this._conf,
448
821
  "get",
449
822
  constructUrl({
@@ -454,6 +827,23 @@ class Configuration {
454
827
  undefined,
455
828
  xHeaders
456
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;
457
847
  }
458
848
 
459
849
  /**
@@ -463,7 +853,7 @@ class Configuration {
463
853
  * @summary: Get an Ordering Store signed cookie on selection of ordering store.
464
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.
465
855
  */
466
- getOrderingStoreCookie({ body } = {}) {
856
+ async getOrderingStoreCookie({ body } = {}) {
467
857
  const { error } = ConfigurationValidator.getOrderingStoreCookie().validate(
468
858
  { body },
469
859
  { abortEarly: false, allowUnknown: true }
@@ -471,11 +861,27 @@ class Configuration {
471
861
  if (error) {
472
862
  return Promise.reject(new FDKClientValidationError(error));
473
863
  }
864
+
865
+ // Showing warrnings if extra unknown parameters are found
866
+ const {
867
+ error: warrning,
868
+ } = ConfigurationValidator.getOrderingStoreCookie().validate(
869
+ { body },
870
+ { abortEarly: false, allowUnknown: false }
871
+ );
872
+ if (warrning) {
873
+ Logger({
874
+ level: "WARN",
875
+ message: "Parameter Validation warrnings for getOrderingStoreCookie",
876
+ });
877
+ Logger({ level: "WARN", message: warrning });
878
+ }
879
+
474
880
  const query_params = {};
475
881
 
476
882
  const xHeaders = {};
477
883
 
478
- return APIClient.execute(
884
+ const response = await APIClient.execute(
479
885
  this._conf,
480
886
  "post",
481
887
  constructUrl({
@@ -486,6 +892,23 @@ class Configuration {
486
892
  body,
487
893
  xHeaders
488
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;
489
912
  }
490
913
 
491
914
  /**
@@ -494,7 +917,7 @@ class Configuration {
494
917
  * @summary: Unset the Ordering Store signed cookie.
495
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.
496
919
  */
497
- removeOrderingStoreCookie({} = {}) {
920
+ async removeOrderingStoreCookie({} = {}) {
498
921
  const {
499
922
  error,
500
923
  } = ConfigurationValidator.removeOrderingStoreCookie().validate(
@@ -504,11 +927,27 @@ class Configuration {
504
927
  if (error) {
505
928
  return Promise.reject(new FDKClientValidationError(error));
506
929
  }
930
+
931
+ // Showing warrnings if extra unknown parameters are found
932
+ const {
933
+ error: warrning,
934
+ } = ConfigurationValidator.removeOrderingStoreCookie().validate(
935
+ {},
936
+ { abortEarly: false, allowUnknown: false }
937
+ );
938
+ if (warrning) {
939
+ Logger({
940
+ level: "WARN",
941
+ message: "Parameter Validation warrnings for removeOrderingStoreCookie",
942
+ });
943
+ Logger({ level: "WARN", message: warrning });
944
+ }
945
+
507
946
  const query_params = {};
508
947
 
509
948
  const xHeaders = {};
510
949
 
511
- return APIClient.execute(
950
+ const response = await APIClient.execute(
512
951
  this._conf,
513
952
  "delete",
514
953
  constructUrl({
@@ -519,6 +958,23 @@ class Configuration {
519
958
  undefined,
520
959
  xHeaders
521
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;
522
978
  }
523
979
 
524
980
  /**
@@ -535,7 +991,13 @@ class Configuration {
535
991
  * @summary: Get a list of staff.
536
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.
537
993
  */
538
- getAppStaffList({ pageNo, pageSize, orderIncent, orderingStore, user } = {}) {
994
+ async getAppStaffList({
995
+ pageNo,
996
+ pageSize,
997
+ orderIncent,
998
+ orderingStore,
999
+ user,
1000
+ } = {}) {
539
1001
  const { error } = ConfigurationValidator.getAppStaffList().validate(
540
1002
  { pageNo, pageSize, orderIncent, orderingStore, user },
541
1003
  { abortEarly: false, allowUnknown: true }
@@ -543,6 +1005,22 @@ class Configuration {
543
1005
  if (error) {
544
1006
  return Promise.reject(new FDKClientValidationError(error));
545
1007
  }
1008
+
1009
+ // Showing warrnings if extra unknown parameters are found
1010
+ const {
1011
+ error: warrning,
1012
+ } = ConfigurationValidator.getAppStaffList().validate(
1013
+ { pageNo, pageSize, orderIncent, orderingStore, user },
1014
+ { abortEarly: false, allowUnknown: false }
1015
+ );
1016
+ if (warrning) {
1017
+ Logger({
1018
+ level: "WARN",
1019
+ message: "Parameter Validation warrnings for getAppStaffList",
1020
+ });
1021
+ Logger({ level: "WARN", message: warrning });
1022
+ }
1023
+
546
1024
  const query_params = {};
547
1025
  query_params["page_no"] = pageNo;
548
1026
  query_params["page_size"] = pageSize;
@@ -552,7 +1030,7 @@ class Configuration {
552
1030
 
553
1031
  const xHeaders = {};
554
1032
 
555
- return APIClient.execute(
1033
+ const response = await APIClient.execute(
556
1034
  this._conf,
557
1035
  "get",
558
1036
  constructUrl({
@@ -563,6 +1041,23 @@ class Configuration {
563
1041
  undefined,
564
1042
  xHeaders
565
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;
566
1061
  }
567
1062
 
568
1063
  /**
@@ -617,7 +1112,7 @@ class Configuration {
617
1112
  * @summary: Get a list of staff.
618
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.
619
1114
  */
620
- getAppStaffs({ orderIncent, orderingStore, user } = {}) {
1115
+ async getAppStaffs({ orderIncent, orderingStore, user } = {}) {
621
1116
  const { error } = ConfigurationValidator.getAppStaffs().validate(
622
1117
  { orderIncent, orderingStore, user },
623
1118
  { abortEarly: false, allowUnknown: true }
@@ -625,6 +1120,20 @@ class Configuration {
625
1120
  if (error) {
626
1121
  return Promise.reject(new FDKClientValidationError(error));
627
1122
  }
1123
+
1124
+ // Showing warrnings if extra unknown parameters are found
1125
+ const { error: warrning } = ConfigurationValidator.getAppStaffs().validate(
1126
+ { orderIncent, orderingStore, user },
1127
+ { abortEarly: false, allowUnknown: false }
1128
+ );
1129
+ if (warrning) {
1130
+ Logger({
1131
+ level: "WARN",
1132
+ message: "Parameter Validation warrnings for getAppStaffs",
1133
+ });
1134
+ Logger({ level: "WARN", message: warrning });
1135
+ }
1136
+
628
1137
  const query_params = {};
629
1138
  query_params["order_incent"] = orderIncent;
630
1139
  query_params["ordering_store"] = orderingStore;
@@ -632,7 +1141,7 @@ class Configuration {
632
1141
 
633
1142
  const xHeaders = {};
634
1143
 
635
- return APIClient.execute(
1144
+ const response = await APIClient.execute(
636
1145
  this._conf,
637
1146
  "get",
638
1147
  constructUrl({
@@ -643,6 +1152,23 @@ class Configuration {
643
1152
  undefined,
644
1153
  xHeaders
645
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;
646
1172
  }
647
1173
  }
648
1174