@gofynd/fdk-client-javascript 1.6.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.d.ts +5 -5
  4. package/sdk/application/Cart/CartApplicationClient.js +26 -268
  5. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +20 -20
  6. package/sdk/application/Catalog/CatalogApplicationClient.js +98 -347
  7. package/sdk/application/Common/CommonApplicationClient.js +1 -16
  8. package/sdk/application/Communication/CommunicationApplicationClient.js +1 -24
  9. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +24 -2
  10. package/sdk/application/Configuration/ConfigurationApplicationClient.js +58 -137
  11. package/sdk/application/Content/ContentApplicationClient.d.ts +47 -7
  12. package/sdk/application/Content/ContentApplicationClient.js +222 -191
  13. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +2 -2
  14. package/sdk/application/FileStorage/FileStorageApplicationClient.js +11 -30
  15. package/sdk/application/Finance/FinanceApplicationClient.js +1 -16
  16. package/sdk/application/Lead/LeadApplicationClient.d.ts +4 -4
  17. package/sdk/application/Lead/LeadApplicationClient.js +21 -52
  18. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +16 -56
  19. package/sdk/application/Logistic/LogisticApplicationClient.js +57 -332
  20. package/sdk/application/Order/OrderApplicationClient.d.ts +11 -11
  21. package/sdk/application/Order/OrderApplicationClient.js +68 -153
  22. package/sdk/application/Payment/PaymentApplicationClient.d.ts +2 -12
  23. package/sdk/application/Payment/PaymentApplicationClient.js +7 -487
  24. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +1 -1
  25. package/sdk/application/Rewards/RewardsApplicationClient.js +6 -59
  26. package/sdk/application/Share/ShareApplicationClient.d.ts +4 -4
  27. package/sdk/application/Share/ShareApplicationClient.js +21 -75
  28. package/sdk/application/Theme/ThemeApplicationClient.d.ts +3 -3
  29. package/sdk/application/Theme/ThemeApplicationClient.js +19 -47
  30. package/sdk/application/User/UserApplicationClient.js +1 -407
  31. package/sdk/application/Webhook/WebhookApplicationClient.js +1 -8
  32. package/sdk/common/Utility.d.ts +1 -1
  33. package/sdk/common/Utility.js +4 -4
  34. package/sdk/common/Validator.d.ts +1 -0
  35. package/sdk/common/Validator.js +20 -0
  36. package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +1 -55
  37. package/sdk/partner/FileStorage/FileStoragePartnerClient.js +1 -408
  38. package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +0 -5
  39. package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +0 -37
  40. package/sdk/partner/Lead/LeadPartnerModel.d.ts +5 -0
  41. package/sdk/partner/Lead/LeadPartnerModel.js +2 -0
  42. package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +29 -25
  43. package/sdk/partner/Logistics/LogisticsPartnerClient.js +65 -42
  44. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +1008 -794
  45. package/sdk/partner/Logistics/LogisticsPartnerModel.js +573 -460
  46. package/sdk/partner/Logistics/LogisticsPartnerValidator.js +10 -5
  47. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +64 -1
  48. package/sdk/partner/Webhook/WebhookPartnerModel.js +36 -0
  49. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +5 -0
  50. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +2 -0
  51. package/sdk/platform/Cart/CartPlatformModel.d.ts +67 -9
  52. package/sdk/platform/Cart/CartPlatformModel.js +38 -5
  53. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1 -1
  54. package/sdk/platform/Catalog/CatalogPlatformClient.js +4 -4
  55. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +47 -13
  56. package/sdk/platform/Catalog/CatalogPlatformModel.js +29 -7
  57. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +2 -2
  58. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +7 -4
  59. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +71 -7
  60. package/sdk/platform/Communication/CommunicationPlatformModel.js +70 -6
  61. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +0 -27
  62. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +8 -60
  63. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +31 -20
  64. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +18 -18
  65. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +1 -1
  66. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +3 -3
  67. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +13 -0
  68. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +30 -1
  69. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +68 -11
  70. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +49 -7
  71. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +169 -0
  72. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1279 -132
  73. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +156 -1
  74. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +180 -0
  75. package/sdk/platform/Content/ContentPlatformClient.d.ts +162 -0
  76. package/sdk/platform/Content/ContentPlatformClient.js +1697 -497
  77. package/sdk/platform/Content/ContentPlatformModel.d.ts +1053 -35
  78. package/sdk/platform/Content/ContentPlatformModel.js +717 -34
  79. package/sdk/platform/Content/ContentPlatformValidator.d.ts +127 -1
  80. package/sdk/platform/Content/ContentPlatformValidator.js +171 -0
  81. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +34 -0
  82. package/sdk/platform/Discount/DiscountPlatformClient.js +59 -0
  83. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +365 -93
  84. package/sdk/platform/Discount/DiscountPlatformModel.js +98 -93
  85. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +54 -34
  86. package/sdk/platform/Discount/DiscountPlatformValidator.js +27 -17
  87. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +0 -156
  88. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +0 -1072
  89. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -137
  90. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +0 -173
  91. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +1 -1105
  92. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +0 -1125
  93. package/sdk/platform/Lead/LeadPlatformModel.d.ts +5 -0
  94. package/sdk/platform/Lead/LeadPlatformModel.js +2 -0
  95. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
  96. package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
  97. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
  98. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
  99. package/sdk/platform/Order/OrderPlatformClient.d.ts +212 -0
  100. package/sdk/platform/Order/OrderPlatformClient.js +397 -0
  101. package/sdk/platform/Order/OrderPlatformModel.d.ts +66 -10
  102. package/sdk/platform/Order/OrderPlatformModel.js +39 -7
  103. package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
  104. package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
  105. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +58 -10
  106. package/sdk/platform/Partner/PartnerPlatformModel.js +19 -10
  107. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +12 -2
  108. package/sdk/platform/Payment/PaymentPlatformModel.js +8 -2
  109. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +5 -0
  110. package/sdk/platform/Rewards/RewardsPlatformModel.js +2 -0
  111. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +240 -24
  112. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +1753 -277
  113. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +320 -22
  114. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +269 -19
  115. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +53 -104
  116. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +201 -629
  117. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +5720 -2891
  118. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +3414 -2181
  119. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +138 -216
  120. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +81 -148
  121. package/sdk/platform/Share/SharePlatformModel.d.ts +5 -0
  122. package/sdk/platform/Share/SharePlatformModel.js +2 -0
  123. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +73 -0
  124. package/sdk/platform/User/UserPlatformApplicationClient.js +543 -0
  125. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +129 -1
  126. package/sdk/platform/User/UserPlatformApplicationValidator.js +97 -0
  127. package/sdk/platform/User/UserPlatformModel.d.ts +269 -6
  128. package/sdk/platform/User/UserPlatformModel.js +187 -5
  129. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +64 -1
  130. package/sdk/platform/Webhook/WebhookPlatformModel.js +36 -0
  131. package/sdk/public/Catalog/CatalogPublicClient.d.ts +1 -1
  132. package/sdk/public/Catalog/CatalogPublicClient.js +6 -11
  133. package/sdk/public/Configuration/ConfigurationPublicClient.js +1 -16
  134. package/sdk/public/Content/ContentPublicClient.d.ts +36 -3
  135. package/sdk/public/Content/ContentPublicClient.js +261 -104
  136. package/sdk/public/Content/ContentPublicModel.d.ts +155 -1
  137. package/sdk/public/Content/ContentPublicModel.js +102 -0
  138. package/sdk/public/Content/ContentPublicValidator.d.ts +18 -1
  139. package/sdk/public/Content/ContentPublicValidator.js +26 -0
  140. package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
  141. package/sdk/public/Partner/PartnerPublicClient.js +6 -11
  142. package/sdk/public/Partner/PartnerPublicModel.d.ts +248 -72
  143. package/sdk/public/Partner/PartnerPublicModel.js +81 -71
  144. package/sdk/public/Partner/PartnerPublicValidator.d.ts +2 -2
  145. package/sdk/public/Partner/PartnerPublicValidator.js +1 -1
  146. package/sdk/public/Webhook/WebhookPublicClient.js +1 -40
@@ -6,6 +6,7 @@ const {
6
6
  const ApplicationAPIClient = require("../ApplicationAPIClient");
7
7
  const constructUrl = require("../constructUrl");
8
8
  const Paginator = require("../../common/Paginator");
9
+ const { validateRequiredParams } = require("../../common/Validator");
9
10
 
10
11
  class Logistic {
11
12
  constructor(_conf) {
@@ -23,12 +24,7 @@ class Logistic {
23
24
  "/service/application/logistics/v1.0/localities/{locality_type}",
24
25
  getLocality:
25
26
  "/service/application/logistics/v1.0/localities/{locality_type}/{locality_value}",
26
- getLocations: "/service/application/logistics/v1.0/locations",
27
- getOptimalLocations:
28
- "/service/application/logistics/v1.0/reassign_stores",
29
27
  getPincodeCity: "/service/application/logistics/v1.0/pincode/{pincode}",
30
- getPincodeZones: "/service/application/logistics/v1.0/pincode/zones",
31
- getTatProduct: "/service/application/logistics/v1.0/",
32
28
  validateAddress:
33
29
  "/service/application/logistics/v1.0/country/{country_iso_code}/address/templates/{template_name}/validate",
34
30
  };
@@ -51,7 +47,7 @@ class Logistic {
51
47
  /**
52
48
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
53
49
  * @param {import("../ApplicationAPIClient").Options} - Options
54
- * @returns {Promise<CountryListResult>} - Success response
50
+ * @returns {Promise<CountryResult>} - Success response
55
51
  * @name getAllCountries
56
52
  * @summary: Get deliverable countries
57
53
  * @description: Get a list of countries within the specified delivery zones for that application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getAllCountries/).
@@ -60,14 +56,6 @@ class Logistic {
60
56
  { requestHeaders } = { requestHeaders: {} },
61
57
  { responseHeaders } = { responseHeaders: false }
62
58
  ) {
63
- let invalidInput = [];
64
- if (invalidInput.length) {
65
- const error = new Error();
66
- error.message = "Missing required field";
67
- error.details = invalidInput;
68
- return Promise.reject(new FDKClientValidationError(error));
69
- }
70
-
71
59
  const query_params = {};
72
60
 
73
61
  const xHeaders = {};
@@ -113,14 +101,6 @@ class Logistic {
113
101
  } = { requestHeaders: {} },
114
102
  { responseHeaders } = { responseHeaders: false }
115
103
  ) {
116
- let invalidInput = [];
117
- if (invalidInput.length) {
118
- const error = new Error();
119
- error.message = "Missing required field";
120
- error.details = invalidInput;
121
- return Promise.reject(new FDKClientValidationError(error));
122
- }
123
-
124
104
  const query_params = {};
125
105
  query_params["onboarding"] = onboarding;
126
106
  query_params["page_no"] = pageNo;
@@ -164,18 +144,12 @@ class Logistic {
164
144
  { countryIsoCode, requestHeaders } = { requestHeaders: {} },
165
145
  { responseHeaders } = { responseHeaders: false }
166
146
  ) {
167
- let invalidInput = [];
168
-
169
- if (!countryIsoCode) {
170
- invalidInput.push({
171
- message: `The 'countryIsoCode' field is required.`,
172
- path: ["countryIsoCode"],
147
+ const errors = validateRequiredParams(arguments[0], ["countryIsoCode"]);
148
+ if (errors.length > 0) {
149
+ const error = new FDKClientValidationError({
150
+ message: "Missing required field",
151
+ details: errors,
173
152
  });
174
- }
175
- if (invalidInput.length) {
176
- const error = new Error();
177
- error.message = "Missing required field";
178
- error.details = invalidInput;
179
153
  return Promise.reject(new FDKClientValidationError(error));
180
154
  }
181
155
 
@@ -209,31 +183,22 @@ class Logistic {
209
183
  * @param {import("../ApplicationAPIClient").Options} - Options
210
184
  * @returns {Promise<ShipmentCourierPartnerResult>} - Success response
211
185
  * @name getCourierPartners
212
- * @summary: Serviceable Courier Partners.
186
+ * @summary: Serviceable Courier Partners
213
187
  * @description: Get all the serviceable courier partners of a destination and the shipments. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getCourierPartners/).
214
188
  */
215
189
  async getCourierPartners(
216
190
  { companyId, applicationId, body, requestHeaders } = { requestHeaders: {} },
217
191
  { responseHeaders } = { responseHeaders: false }
218
192
  ) {
219
- let invalidInput = [];
220
-
221
- if (!companyId) {
222
- invalidInput.push({
223
- message: `The 'companyId' field is required.`,
224
- path: ["companyId"],
193
+ const errors = validateRequiredParams(arguments[0], [
194
+ "companyId",
195
+ "applicationId",
196
+ ]);
197
+ if (errors.length > 0) {
198
+ const error = new FDKClientValidationError({
199
+ message: "Missing required field",
200
+ details: errors,
225
201
  });
226
- }
227
- if (!applicationId) {
228
- invalidInput.push({
229
- message: `The 'applicationId' field is required.`,
230
- path: ["applicationId"],
231
- });
232
- }
233
- if (invalidInput.length) {
234
- const error = new Error();
235
- error.message = "Missing required field";
236
- error.details = invalidInput;
237
202
  return Promise.reject(new FDKClientValidationError(error));
238
203
  }
239
204
 
@@ -271,22 +236,18 @@ class Logistic {
271
236
  * @description: Get delivery promises for both global and store levels based on a specific locality type. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getDeliveryPromise/).
272
237
  */
273
238
  async getDeliveryPromise(
274
- { pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
239
+ { xLocationDetail, xApplicationData, pageNo, pageSize, requestHeaders } = {
240
+ requestHeaders: {},
241
+ },
275
242
  { responseHeaders } = { responseHeaders: false }
276
243
  ) {
277
- let invalidInput = [];
278
- if (invalidInput.length) {
279
- const error = new Error();
280
- error.message = "Missing required field";
281
- error.details = invalidInput;
282
- return Promise.reject(new FDKClientValidationError(error));
283
- }
284
-
285
244
  const query_params = {};
286
245
  query_params["page_no"] = pageNo;
287
246
  query_params["page_size"] = pageSize;
288
247
 
289
248
  const xHeaders = {};
249
+ xHeaders["x-location-detail"] = xLocationDetail;
250
+ xHeaders["x-application-data"] = xApplicationData;
290
251
 
291
252
  const response = await ApplicationAPIClient.execute(
292
253
  this._conf,
@@ -312,10 +273,10 @@ class Logistic {
312
273
  /**
313
274
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
314
275
  * @param {import("../ApplicationAPIClient").Options} - Options
315
- * @returns {Promise<GetLocalities>} - Success response
276
+ * @returns {Promise<GetLocalitiesApp>} - Success response
316
277
  * @name getLocalities
317
- * @summary: Get localities
318
- * @description: Get geographical data for a specific type of locality based on the provided filters. For instance, obtain a list of cities for a given country and state. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getLocalities/).
278
+ * @summary: Get Localities
279
+ * @description: Get Localities data. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getLocalities/).
319
280
  */
320
281
  async getLocalities(
321
282
  {
@@ -331,18 +292,12 @@ class Logistic {
331
292
  } = { requestHeaders: {} },
332
293
  { responseHeaders } = { responseHeaders: false }
333
294
  ) {
334
- let invalidInput = [];
335
-
336
- if (!localityType) {
337
- invalidInput.push({
338
- message: `The 'localityType' field is required.`,
339
- path: ["localityType"],
295
+ const errors = validateRequiredParams(arguments[0], ["localityType"]);
296
+ if (errors.length > 0) {
297
+ const error = new FDKClientValidationError({
298
+ message: "Missing required field",
299
+ details: errors,
340
300
  });
341
- }
342
- if (invalidInput.length) {
343
- const error = new Error();
344
- error.message = "Missing required field";
345
- error.details = invalidInput;
346
301
  return Promise.reject(new FDKClientValidationError(error));
347
302
  }
348
303
 
@@ -381,120 +336,40 @@ class Logistic {
381
336
  /**
382
337
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
383
338
  * @param {import("../ApplicationAPIClient").Options} - Options
384
- * @returns {Promise<GetLocality>} - Success response
339
+ * @returns {Promise<GetLocalityApp>} - Success response
385
340
  * @name getLocality
386
- * @summary: Get locality detail
341
+ * @summary: Get Locality API
387
342
  * @description: Get detailed geographical data for a specific locality, such as a pincode. For example, for a pincode value of 400603, the service returns its parent locations, including city, state, and country details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getLocality/).
388
343
  */
389
344
  async getLocality(
390
- { localityType, localityValue, country, state, city, requestHeaders } = {
391
- requestHeaders: {},
392
- },
393
- { responseHeaders } = { responseHeaders: false }
394
- ) {
395
- let invalidInput = [];
396
-
397
- if (!localityType) {
398
- invalidInput.push({
399
- message: `The 'localityType' field is required.`,
400
- path: ["localityType"],
401
- });
402
- }
403
- if (!localityValue) {
404
- invalidInput.push({
405
- message: `The 'localityValue' field is required.`,
406
- path: ["localityValue"],
407
- });
408
- }
409
- if (invalidInput.length) {
410
- const error = new Error();
411
- error.message = "Missing required field";
412
- error.details = invalidInput;
413
- return Promise.reject(new FDKClientValidationError(error));
414
- }
415
-
416
- const query_params = {};
417
- query_params["country"] = country;
418
- query_params["state"] = state;
419
- query_params["city"] = city;
420
-
421
- const xHeaders = {};
422
-
423
- const response = await ApplicationAPIClient.execute(
424
- this._conf,
425
- "get",
426
- constructUrl({
427
- url: this._urls["getLocality"],
428
- params: { localityType, localityValue },
429
- }),
430
- query_params,
431
- undefined,
432
- { ...xHeaders, ...requestHeaders },
433
- { responseHeaders }
434
- );
435
-
436
- let responseData = response;
437
- if (responseHeaders) {
438
- responseData = response[0];
439
- }
440
-
441
- return response;
442
- }
443
-
444
- /**
445
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
446
- * @param {import("../ApplicationAPIClient").Options} - Options
447
- * @returns {Promise<GetStoreResult>} - Success response
448
- * @name getLocations
449
- * @summary: Get available selling locations
450
- * @description: Get stores available for the application based on Delivery Zones and Order Orchestration rules. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getLocations/).
451
- */
452
- async getLocations(
453
345
  {
454
- xApplicationId,
455
- xApplicationData,
346
+ localityType,
347
+ localityValue,
456
348
  country,
457
349
  state,
458
350
  city,
459
- pincode,
460
351
  sector,
461
- pageNo,
462
- pageSize,
463
352
  requestHeaders,
464
353
  } = { requestHeaders: {} },
465
354
  { responseHeaders } = { responseHeaders: false }
466
355
  ) {
467
- let invalidInput = [];
468
-
469
- if (!xApplicationId) {
470
- invalidInput.push({
471
- message: `The 'xApplicationId' field is required.`,
472
- path: ["xApplicationId"],
356
+ const errors = validateRequiredParams(arguments[0], [
357
+ "localityType",
358
+ "localityValue",
359
+ ]);
360
+ if (errors.length > 0) {
361
+ const error = new FDKClientValidationError({
362
+ message: "Missing required field",
363
+ details: errors,
473
364
  });
474
- }
475
- if (!xApplicationData) {
476
- invalidInput.push({
477
- message: `The 'xApplicationData' field is required.`,
478
- path: ["xApplicationData"],
479
- });
480
- }
481
- if (invalidInput.length) {
482
- const error = new Error();
483
- error.message = "Missing required field";
484
- error.details = invalidInput;
485
365
  return Promise.reject(new FDKClientValidationError(error));
486
366
  }
487
367
 
488
368
  const query_params = {};
489
- query_params["x-application-id"] = xApplicationId;
490
- query_params["x-application-data"] = xApplicationData;
491
369
  query_params["country"] = country;
492
370
  query_params["state"] = state;
493
371
  query_params["city"] = city;
494
- query_params["pincode"] = pincode;
495
372
  query_params["sector"] = sector;
496
- query_params["page_no"] = pageNo;
497
- query_params["page_size"] = pageSize;
498
373
 
499
374
  const xHeaders = {};
500
375
 
@@ -502,8 +377,8 @@ class Logistic {
502
377
  this._conf,
503
378
  "get",
504
379
  constructUrl({
505
- url: this._urls["getLocations"],
506
- params: {},
380
+ url: this._urls["getLocality"],
381
+ params: { localityType, localityValue },
507
382
  }),
508
383
  query_params,
509
384
  undefined,
@@ -522,52 +397,7 @@ class Logistic {
522
397
  /**
523
398
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
524
399
  * @param {import("../ApplicationAPIClient").Options} - Options
525
- * @returns {Promise<ReAssignStoreResult>} - Success response
526
- * @name getOptimalLocations
527
- * @summary: Get selling locations
528
- * @description: Get optimal fulfillment centre for customers by analyzing their location, product availability, and inventory levels. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getOptimalLocations/).
529
- */
530
- async getOptimalLocations(
531
- { body, requestHeaders } = { requestHeaders: {} },
532
- { responseHeaders } = { responseHeaders: false }
533
- ) {
534
- let invalidInput = [];
535
- if (invalidInput.length) {
536
- const error = new Error();
537
- error.message = "Missing required field";
538
- error.details = invalidInput;
539
- return Promise.reject(new FDKClientValidationError(error));
540
- }
541
-
542
- const query_params = {};
543
-
544
- const xHeaders = {};
545
-
546
- const response = await ApplicationAPIClient.execute(
547
- this._conf,
548
- "post",
549
- constructUrl({
550
- url: this._urls["getOptimalLocations"],
551
- params: {},
552
- }),
553
- query_params,
554
- body,
555
- { ...xHeaders, ...requestHeaders },
556
- { responseHeaders }
557
- );
558
-
559
- let responseData = response;
560
- if (responseHeaders) {
561
- responseData = response[0];
562
- }
563
-
564
- return response;
565
- }
566
-
567
- /**
568
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
569
- * @param {import("../ApplicationAPIClient").Options} - Options
570
- * @returns {Promise<PincodeDetails>} - Success response
400
+ * @returns {Promise<PincodeDetailsResult>} - Success response
571
401
  * @name getPincodeCity
572
402
  * @summary: Get pincode details
573
403
  * @description: Get details of a specific pincode, such as obtaining its city and state information. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getPincodeCity/).
@@ -576,18 +406,12 @@ class Logistic {
576
406
  { pincode, requestHeaders } = { requestHeaders: {} },
577
407
  { responseHeaders } = { responseHeaders: false }
578
408
  ) {
579
- let invalidInput = [];
580
-
581
- if (!pincode) {
582
- invalidInput.push({
583
- message: `The 'pincode' field is required.`,
584
- path: ["pincode"],
409
+ const errors = validateRequiredParams(arguments[0], ["pincode"]);
410
+ if (errors.length > 0) {
411
+ const error = new FDKClientValidationError({
412
+ message: "Missing required field",
413
+ details: errors,
585
414
  });
586
- }
587
- if (invalidInput.length) {
588
- const error = new Error();
589
- error.message = "Missing required field";
590
- error.details = invalidInput;
591
415
  return Promise.reject(new FDKClientValidationError(error));
592
416
  }
593
417
 
@@ -616,96 +440,6 @@ class Logistic {
616
440
  return response;
617
441
  }
618
442
 
619
- /**
620
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
621
- * @param {import("../ApplicationAPIClient").Options} - Options
622
- * @returns {Promise<GetZoneFromPincodeViewResult>} - Success response
623
- * @name getPincodeZones
624
- * @summary: Get zones
625
- * @description: Get the delivery zone associated with a given pincode. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getPincodeZones/).
626
- */
627
- async getPincodeZones(
628
- { body, requestHeaders } = { requestHeaders: {} },
629
- { responseHeaders } = { responseHeaders: false }
630
- ) {
631
- let invalidInput = [];
632
- if (invalidInput.length) {
633
- const error = new Error();
634
- error.message = "Missing required field";
635
- error.details = invalidInput;
636
- return Promise.reject(new FDKClientValidationError(error));
637
- }
638
-
639
- const query_params = {};
640
-
641
- const xHeaders = {};
642
-
643
- const response = await ApplicationAPIClient.execute(
644
- this._conf,
645
- "post",
646
- constructUrl({
647
- url: this._urls["getPincodeZones"],
648
- params: {},
649
- }),
650
- query_params,
651
- body,
652
- { ...xHeaders, ...requestHeaders },
653
- { responseHeaders }
654
- );
655
-
656
- let responseData = response;
657
- if (responseHeaders) {
658
- responseData = response[0];
659
- }
660
-
661
- return response;
662
- }
663
-
664
- /**
665
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
666
- * @param {import("../ApplicationAPIClient").Options} - Options
667
- * @returns {Promise<TATViewResult>} - Success response
668
- * @name getTatProduct
669
- * @summary: Get product's turnaround time
670
- * @description: Get the estimated delivery time frame for a specific product from a designated store. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/logistic/getTatProduct/).
671
- */
672
- async getTatProduct(
673
- { body, requestHeaders } = { requestHeaders: {} },
674
- { responseHeaders } = { responseHeaders: false }
675
- ) {
676
- let invalidInput = [];
677
- if (invalidInput.length) {
678
- const error = new Error();
679
- error.message = "Missing required field";
680
- error.details = invalidInput;
681
- return Promise.reject(new FDKClientValidationError(error));
682
- }
683
-
684
- const query_params = {};
685
-
686
- const xHeaders = {};
687
-
688
- const response = await ApplicationAPIClient.execute(
689
- this._conf,
690
- "post",
691
- constructUrl({
692
- url: this._urls["getTatProduct"],
693
- params: {},
694
- }),
695
- query_params,
696
- body,
697
- { ...xHeaders, ...requestHeaders },
698
- { responseHeaders }
699
- );
700
-
701
- let responseData = response;
702
- if (responseHeaders) {
703
- responseData = response[0];
704
- }
705
-
706
- return response;
707
- }
708
-
709
443
  /**
710
444
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
711
445
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -720,24 +454,15 @@ class Logistic {
720
454
  },
721
455
  { responseHeaders } = { responseHeaders: false }
722
456
  ) {
723
- let invalidInput = [];
724
-
725
- if (!countryIsoCode) {
726
- invalidInput.push({
727
- message: `The 'countryIsoCode' field is required.`,
728
- path: ["countryIsoCode"],
457
+ const errors = validateRequiredParams(arguments[0], [
458
+ "countryIsoCode",
459
+ "templateName",
460
+ ]);
461
+ if (errors.length > 0) {
462
+ const error = new FDKClientValidationError({
463
+ message: "Missing required field",
464
+ details: errors,
729
465
  });
730
- }
731
- if (!templateName) {
732
- invalidInput.push({
733
- message: `The 'templateName' field is required.`,
734
- path: ["templateName"],
735
- });
736
- }
737
- if (invalidInput.length) {
738
- const error = new Error();
739
- error.message = "Missing required field";
740
- error.details = invalidInput;
741
466
  return Promise.reject(new FDKClientValidationError(error));
742
467
  }
743
468
 
@@ -26,7 +26,7 @@ declare class Order {
26
26
  * @summary: Get shipment's customer
27
27
  * @description: Get customer details such as mobile number using Shipment ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/getCustomerDetailsByShipmentId/).
28
28
  */
29
- getCustomerDetailsByShipmentId({ orderId, shipmentId, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CustomerDetailsResponseSchema>;
29
+ getCustomerDetailsByShipmentId({ orderId, shipmentId, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<CustomerDetailsResponseSchema>;
30
30
  /**
31
31
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
32
32
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -35,7 +35,7 @@ declare class Order {
35
35
  * @summary: Retrieves invoice for shipment
36
36
  * @description: Get invoice corresponding to a specific shipment ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/getInvoiceByShipmentId/).
37
37
  */
38
- getInvoiceByShipmentId({ shipmentId, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<ResponseGetInvoiceShipment>;
38
+ getInvoiceByShipmentId({ shipmentId, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<ResponseGetInvoiceShipment>;
39
39
  /**
40
40
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
41
41
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -44,7 +44,7 @@ declare class Order {
44
44
  * @summary: Get an order
45
45
  * @description: Get order details such as tracking details, shipment, store information using Fynd Order ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/getOrderById/).
46
46
  */
47
- getOrderById({ orderId, allowInactive, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<OrderById>;
47
+ getOrderById({ orderId, allowInactive, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<OrderById>;
48
48
  /**
49
49
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
50
50
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -62,7 +62,7 @@ declare class Order {
62
62
  * @summary: Retrieves POS order details
63
63
  * @description: Retrieve a POS order and all its details such as tracking details, shipment, store information using Fynd Order ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/getPosOrderById/).
64
64
  */
65
- getPosOrderById({ orderId, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<OrderById>;
65
+ getPosOrderById({ orderId, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<OrderById>;
66
66
  /**
67
67
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
68
68
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -71,7 +71,7 @@ declare class Order {
71
71
  * @summary: Retrieve Reasons for Cancellation and Return journey
72
72
  * @description: Allows users to retrieve a comprehensive list of reasons for cancellation or returning a shipment. It provides both cancellation and return reasons, with an emphasis on Quality Control (QC) evaluations. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/getShipmentBagReasons/).
73
73
  */
74
- getShipmentBagReasons({ shipmentId, bagId, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<ShipmentBagReasons>;
74
+ getShipmentBagReasons({ shipmentId, bagId, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<ShipmentBagReasons>;
75
75
  /**
76
76
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
77
77
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -80,7 +80,7 @@ declare class Order {
80
80
  * @summary: Get a Shipment
81
81
  * @description: Get shipment details such as price breakup, tracking details, store information, etc. using Shipment ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/getShipmentById/).
82
82
  */
83
- getShipmentById({ shipmentId, allowInactive, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<ShipmentById>;
83
+ getShipmentById({ shipmentId, allowInactive, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<ShipmentById>;
84
84
  /**
85
85
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
86
86
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -89,7 +89,7 @@ declare class Order {
89
89
  * @summary: List shipment cancellation reasons
90
90
  * @description: Get reasons to perform full or partial cancellation of a shipment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/getShipmentReasons/).
91
91
  */
92
- getShipmentReasons({ shipmentId, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<ShipmentReasons>;
92
+ getShipmentReasons({ shipmentId, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<ShipmentReasons>;
93
93
  /**
94
94
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
95
95
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -98,7 +98,7 @@ declare class Order {
98
98
  * @summary: Send OTP to customer
99
99
  * @description: Send OTP to the customer for shipment verification. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/sendOtpToShipmentCustomer/).
100
100
  */
101
- sendOtpToShipmentCustomer({ orderId, shipmentId, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<SendOtpToCustomerResponseSchema>;
101
+ sendOtpToShipmentCustomer({ orderId, shipmentId, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<SendOtpToCustomerResponseSchema>;
102
102
  /**
103
103
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
104
104
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -107,7 +107,7 @@ declare class Order {
107
107
  * @summary: Track shipment status
108
108
  * @description: Track Shipment by shipment id, for application based on application Id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/trackShipment/).
109
109
  */
110
- trackShipment({ shipmentId, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<ShipmentTrack>;
110
+ trackShipment({ shipmentId, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<ShipmentTrack>;
111
111
  /**
112
112
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
113
113
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -116,7 +116,7 @@ declare class Order {
116
116
  * @summary: Updates shipment status
117
117
  * @description: This operation allows for updating the status and properties of a shipment. For example, it allows users to initiate a return by providing reasons and uploading quality check images. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/updateShipmentStatus/).
118
118
  */
119
- updateShipmentStatus({ shipmentId, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<ShipmentApplicationStatusResponseSchema>;
119
+ updateShipmentStatus({ shipmentId, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<ShipmentApplicationStatusResponseSchema>;
120
120
  /**
121
121
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
122
122
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -125,5 +125,5 @@ declare class Order {
125
125
  * @summary: Verifies OTP
126
126
  * @description: Verify OTP for getting shipment details - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/order/verifyOtpShipmentCustomer/).
127
127
  */
128
- verifyOtpShipmentCustomer({ orderId, shipmentId, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<VerifyOtpResponseSchema>;
128
+ verifyOtpShipmentCustomer({ orderId, shipmentId, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<VerifyOtpResponseSchema>;
129
129
  }