@gofynd/fdk-client-javascript 1.6.4 → 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 +5 -0
  48. package/sdk/partner/Webhook/WebhookPartnerModel.js +2 -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 +41 -9
  102. package/sdk/platform/Order/OrderPlatformModel.js +20 -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 +10 -0
  124. package/sdk/platform/User/UserPlatformApplicationClient.js +79 -0
  125. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +13 -1
  126. package/sdk/platform/User/UserPlatformApplicationValidator.js +12 -0
  127. package/sdk/platform/User/UserPlatformModel.d.ts +52 -1
  128. package/sdk/platform/User/UserPlatformModel.js +36 -0
  129. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +5 -0
  130. package/sdk/platform/Webhook/WebhookPlatformModel.js +2 -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 Catalog {
11
12
  constructor(_conf) {
@@ -33,9 +34,9 @@ class Catalog {
33
34
  "/service/application/catalog/v1.0/follow/{collection_type}/{collection_id}/count/",
34
35
  getHomeProducts: "/service/application/catalog/v1.0/home/listing/",
35
36
  getInStockLocations:
36
- "/service/application/catalog/v1.0/in-stock/locations/",
37
+ "/service/application/catalog/v2.0/in-stock/locations/",
37
38
  getLocationDetailsById:
38
- "/service/application/catalog/v1.0/locations/{location_id}/",
39
+ "/service/application/catalog/v2.0/locations/{location_id}/",
39
40
  getProductBundlesBySlug:
40
41
  "/service/application/catalog/v1.0/product-grouping/",
41
42
  getProductComparisonBySlugs:
@@ -43,9 +44,9 @@ class Catalog {
43
44
  getProductDetailBySlug:
44
45
  "/service/application/catalog/v1.0/products/{slug}/",
45
46
  getProductPriceBySlug:
46
- "/service/application/catalog/v3.0/products/{slug}/sizes/{size}/price/",
47
+ "/service/application/catalog/v4.0/products/{slug}/sizes/{size}/price/",
47
48
  getProductSellersBySlug:
48
- "/service/application/catalog/v3.0/products/{slug}/sizes/{size}/sellers/",
49
+ "/service/application/catalog/v4.0/products/{slug}/sizes/{size}/sellers/",
49
50
  getProductSizesBySlug:
50
51
  "/service/application/catalog/v1.0/products/{slug}/sizes/",
51
52
  getProductStockByIds:
@@ -58,7 +59,7 @@ class Catalog {
58
59
  getSearchResults: "/service/application/catalog/v1.0/auto-complete/",
59
60
  getSimilarComparisonProductBySlug:
60
61
  "/service/application/catalog/v1.0/products/{slug}/similar/compare/",
61
- getStores: "/service/application/catalog/v1.0/locations/",
62
+ getStores: "/service/application/catalog/v2.0/locations/",
62
63
  unfollowById:
63
64
  "/service/application/catalog/v1.0/follow/{collection_type}/{collection_id}/",
64
65
  };
@@ -90,24 +91,15 @@ class Catalog {
90
91
  { collectionType, collectionId, requestHeaders } = { requestHeaders: {} },
91
92
  { responseHeaders } = { responseHeaders: false }
92
93
  ) {
93
- let invalidInput = [];
94
-
95
- if (!collectionType) {
96
- invalidInput.push({
97
- message: `The 'collectionType' field is required.`,
98
- path: ["collectionType"],
99
- });
100
- }
101
- if (!collectionId) {
102
- invalidInput.push({
103
- message: `The 'collectionId' field is required.`,
104
- path: ["collectionId"],
94
+ const errors = validateRequiredParams(arguments[0], [
95
+ "collectionType",
96
+ "collectionId",
97
+ ]);
98
+ if (errors.length > 0) {
99
+ const error = new FDKClientValidationError({
100
+ message: "Missing required field",
101
+ details: errors,
105
102
  });
106
- }
107
- if (invalidInput.length) {
108
- const error = new Error();
109
- error.message = "Missing required field";
110
- error.details = invalidInput;
111
103
  return Promise.reject(new FDKClientValidationError(error));
112
104
  }
113
105
 
@@ -148,18 +140,12 @@ class Catalog {
148
140
  { slug, requestHeaders } = { requestHeaders: {} },
149
141
  { responseHeaders } = { responseHeaders: false }
150
142
  ) {
151
- let invalidInput = [];
152
-
153
- if (!slug) {
154
- invalidInput.push({
155
- message: `The 'slug' field is required.`,
156
- path: ["slug"],
143
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
144
+ if (errors.length > 0) {
145
+ const error = new FDKClientValidationError({
146
+ message: "Missing required field",
147
+ details: errors,
157
148
  });
158
- }
159
- if (invalidInput.length) {
160
- const error = new Error();
161
- error.message = "Missing required field";
162
- error.details = invalidInput;
163
149
  return Promise.reject(new FDKClientValidationError(error));
164
150
  }
165
151
 
@@ -200,14 +186,6 @@ class Catalog {
200
186
  { department, pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
201
187
  { responseHeaders } = { responseHeaders: false }
202
188
  ) {
203
- let invalidInput = [];
204
- if (invalidInput.length) {
205
- const error = new Error();
206
- error.message = "Missing required field";
207
- error.details = invalidInput;
208
- return Promise.reject(new FDKClientValidationError(error));
209
- }
210
-
211
189
  const query_params = {};
212
190
  query_params["department"] = department;
213
191
  query_params["page_no"] = pageNo;
@@ -280,14 +258,6 @@ class Catalog {
280
258
  { department, requestHeaders } = { requestHeaders: {} },
281
259
  { responseHeaders } = { responseHeaders: false }
282
260
  ) {
283
- let invalidInput = [];
284
- if (invalidInput.length) {
285
- const error = new Error();
286
- error.message = "Missing required field";
287
- error.details = invalidInput;
288
- return Promise.reject(new FDKClientValidationError(error));
289
- }
290
-
291
261
  const query_params = {};
292
262
  query_params["department"] = department;
293
263
 
@@ -326,18 +296,12 @@ class Catalog {
326
296
  { slug, requestHeaders } = { requestHeaders: {} },
327
297
  { responseHeaders } = { responseHeaders: false }
328
298
  ) {
329
- let invalidInput = [];
330
-
331
- if (!slug) {
332
- invalidInput.push({
333
- message: `The 'slug' field is required.`,
334
- path: ["slug"],
299
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
300
+ if (errors.length > 0) {
301
+ const error = new FDKClientValidationError({
302
+ message: "Missing required field",
303
+ details: errors,
335
304
  });
336
- }
337
- if (invalidInput.length) {
338
- const error = new Error();
339
- error.message = "Missing required field";
340
- error.details = invalidInput;
341
305
  return Promise.reject(new FDKClientValidationError(error));
342
306
  }
343
307
 
@@ -378,18 +342,12 @@ class Catalog {
378
342
  { slug, requestHeaders } = { requestHeaders: {} },
379
343
  { responseHeaders } = { responseHeaders: false }
380
344
  ) {
381
- let invalidInput = [];
382
-
383
- if (!slug) {
384
- invalidInput.push({
385
- message: `The 'slug' field is required.`,
386
- path: ["slug"],
345
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
346
+ if (errors.length > 0) {
347
+ const error = new FDKClientValidationError({
348
+ message: "Missing required field",
349
+ details: errors,
387
350
  });
388
- }
389
- if (invalidInput.length) {
390
- const error = new Error();
391
- error.message = "Missing required field";
392
- error.details = invalidInput;
393
351
  return Promise.reject(new FDKClientValidationError(error));
394
352
  }
395
353
 
@@ -441,18 +399,12 @@ class Catalog {
441
399
  } = { requestHeaders: {} },
442
400
  { responseHeaders } = { responseHeaders: false }
443
401
  ) {
444
- let invalidInput = [];
445
-
446
- if (!slug) {
447
- invalidInput.push({
448
- message: `The 'slug' field is required.`,
449
- path: ["slug"],
402
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
403
+ if (errors.length > 0) {
404
+ const error = new FDKClientValidationError({
405
+ message: "Missing required field",
406
+ details: errors,
450
407
  });
451
- }
452
- if (invalidInput.length) {
453
- const error = new Error();
454
- error.message = "Missing required field";
455
- error.details = invalidInput;
456
408
  return Promise.reject(new FDKClientValidationError(error));
457
409
  }
458
410
 
@@ -556,14 +508,6 @@ class Catalog {
556
508
  { pageNo, pageSize, tag, q, requestHeaders } = { requestHeaders: {} },
557
509
  { responseHeaders } = { responseHeaders: false }
558
510
  ) {
559
- let invalidInput = [];
560
- if (invalidInput.length) {
561
- const error = new Error();
562
- error.message = "Missing required field";
563
- error.details = invalidInput;
564
- return Promise.reject(new FDKClientValidationError(error));
565
- }
566
-
567
511
  const query_params = {};
568
512
  query_params["page_no"] = pageNo;
569
513
  query_params["page_size"] = pageSize;
@@ -637,18 +581,12 @@ class Catalog {
637
581
  { slug, requestHeaders } = { requestHeaders: {} },
638
582
  { responseHeaders } = { responseHeaders: false }
639
583
  ) {
640
- let invalidInput = [];
641
-
642
- if (!slug) {
643
- invalidInput.push({
644
- message: `The 'slug' field is required.`,
645
- path: ["slug"],
584
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
585
+ if (errors.length > 0) {
586
+ const error = new FDKClientValidationError({
587
+ message: "Missing required field",
588
+ details: errors,
646
589
  });
647
- }
648
- if (invalidInput.length) {
649
- const error = new Error();
650
- error.message = "Missing required field";
651
- error.details = invalidInput;
652
590
  return Promise.reject(new FDKClientValidationError(error));
653
591
  }
654
592
 
@@ -689,14 +627,6 @@ class Catalog {
689
627
  { requestHeaders } = { requestHeaders: {} },
690
628
  { responseHeaders } = { responseHeaders: false }
691
629
  ) {
692
- let invalidInput = [];
693
- if (invalidInput.length) {
694
- const error = new Error();
695
- error.message = "Missing required field";
696
- error.details = invalidInput;
697
- return Promise.reject(new FDKClientValidationError(error));
698
- }
699
-
700
630
  const query_params = {};
701
631
 
702
632
  const xHeaders = {};
@@ -734,14 +664,6 @@ class Catalog {
734
664
  { collectionType, requestHeaders } = { requestHeaders: {} },
735
665
  { responseHeaders } = { responseHeaders: false }
736
666
  ) {
737
- let invalidInput = [];
738
- if (invalidInput.length) {
739
- const error = new Error();
740
- error.message = "Missing required field";
741
- error.details = invalidInput;
742
- return Promise.reject(new FDKClientValidationError(error));
743
- }
744
-
745
667
  const query_params = {};
746
668
  query_params["collection_type"] = collectionType;
747
669
 
@@ -782,18 +704,12 @@ class Catalog {
782
704
  },
783
705
  { responseHeaders } = { responseHeaders: false }
784
706
  ) {
785
- let invalidInput = [];
786
-
787
- if (!collectionType) {
788
- invalidInput.push({
789
- message: `The 'collectionType' field is required.`,
790
- path: ["collectionType"],
707
+ const errors = validateRequiredParams(arguments[0], ["collectionType"]);
708
+ if (errors.length > 0) {
709
+ const error = new FDKClientValidationError({
710
+ message: "Missing required field",
711
+ details: errors,
791
712
  });
792
- }
793
- if (invalidInput.length) {
794
- const error = new Error();
795
- error.message = "Missing required field";
796
- error.details = invalidInput;
797
713
  return Promise.reject(new FDKClientValidationError(error));
798
714
  }
799
715
 
@@ -866,24 +782,15 @@ class Catalog {
866
782
  { collectionType, collectionId, requestHeaders } = { requestHeaders: {} },
867
783
  { responseHeaders } = { responseHeaders: false }
868
784
  ) {
869
- let invalidInput = [];
870
-
871
- if (!collectionType) {
872
- invalidInput.push({
873
- message: `The 'collectionType' field is required.`,
874
- path: ["collectionType"],
875
- });
876
- }
877
- if (!collectionId) {
878
- invalidInput.push({
879
- message: `The 'collectionId' field is required.`,
880
- path: ["collectionId"],
785
+ const errors = validateRequiredParams(arguments[0], [
786
+ "collectionType",
787
+ "collectionId",
788
+ ]);
789
+ if (errors.length > 0) {
790
+ const error = new FDKClientValidationError({
791
+ message: "Missing required field",
792
+ details: errors,
881
793
  });
882
- }
883
- if (invalidInput.length) {
884
- const error = new Error();
885
- error.message = "Missing required field";
886
- error.details = invalidInput;
887
794
  return Promise.reject(new FDKClientValidationError(error));
888
795
  }
889
796
 
@@ -924,14 +831,6 @@ class Catalog {
924
831
  { sortOn, pageId, pageSize, requestHeaders } = { requestHeaders: {} },
925
832
  { responseHeaders } = { responseHeaders: false }
926
833
  ) {
927
- let invalidInput = [];
928
- if (invalidInput.length) {
929
- const error = new Error();
930
- error.message = "Missing required field";
931
- error.details = invalidInput;
932
- return Promise.reject(new FDKClientValidationError(error));
933
- }
934
-
935
834
  const query_params = {};
936
835
  query_params["sort_on"] = sortOn;
937
836
  query_params["page_id"] = pageId;
@@ -1012,14 +911,6 @@ class Catalog {
1012
911
  } = { requestHeaders: {} },
1013
912
  { responseHeaders } = { responseHeaders: false }
1014
913
  ) {
1015
- let invalidInput = [];
1016
- if (invalidInput.length) {
1017
- const error = new Error();
1018
- error.message = "Missing required field";
1019
- error.details = invalidInput;
1020
- return Promise.reject(new FDKClientValidationError(error));
1021
- }
1022
-
1023
914
  const query_params = {};
1024
915
  query_params["page_no"] = pageNo;
1025
916
  query_params["page_size"] = pageSize;
@@ -1111,18 +1002,12 @@ class Catalog {
1111
1002
  { locationId, requestHeaders } = { requestHeaders: {} },
1112
1003
  { responseHeaders } = { responseHeaders: false }
1113
1004
  ) {
1114
- let invalidInput = [];
1115
-
1116
- if (!locationId) {
1117
- invalidInput.push({
1118
- message: `The 'locationId' field is required.`,
1119
- path: ["locationId"],
1005
+ const errors = validateRequiredParams(arguments[0], ["locationId"]);
1006
+ if (errors.length > 0) {
1007
+ const error = new FDKClientValidationError({
1008
+ message: "Missing required field",
1009
+ details: errors,
1120
1010
  });
1121
- }
1122
- if (invalidInput.length) {
1123
- const error = new Error();
1124
- error.message = "Missing required field";
1125
- error.details = invalidInput;
1126
1011
  return Promise.reject(new FDKClientValidationError(error));
1127
1012
  }
1128
1013
 
@@ -1163,14 +1048,6 @@ class Catalog {
1163
1048
  { slug, id, requestHeaders } = { requestHeaders: {} },
1164
1049
  { responseHeaders } = { responseHeaders: false }
1165
1050
  ) {
1166
- let invalidInput = [];
1167
- if (invalidInput.length) {
1168
- const error = new Error();
1169
- error.message = "Missing required field";
1170
- error.details = invalidInput;
1171
- return Promise.reject(new FDKClientValidationError(error));
1172
- }
1173
-
1174
1051
  const query_params = {};
1175
1052
  query_params["slug"] = slug;
1176
1053
  query_params["id"] = id;
@@ -1210,21 +1087,6 @@ class Catalog {
1210
1087
  { slug, requestHeaders } = { requestHeaders: {} },
1211
1088
  { responseHeaders } = { responseHeaders: false }
1212
1089
  ) {
1213
- let invalidInput = [];
1214
-
1215
- if (!slug) {
1216
- invalidInput.push({
1217
- message: `The 'slug' field is required.`,
1218
- path: ["slug"],
1219
- });
1220
- }
1221
- if (invalidInput.length) {
1222
- const error = new Error();
1223
- error.message = "Missing required field";
1224
- error.details = invalidInput;
1225
- return Promise.reject(new FDKClientValidationError(error));
1226
- }
1227
-
1228
1090
  const query_params = {};
1229
1091
  query_params["slug"] = slug;
1230
1092
 
@@ -1263,18 +1125,12 @@ class Catalog {
1263
1125
  { slug, requestHeaders } = { requestHeaders: {} },
1264
1126
  { responseHeaders } = { responseHeaders: false }
1265
1127
  ) {
1266
- let invalidInput = [];
1267
-
1268
- if (!slug) {
1269
- invalidInput.push({
1270
- message: `The 'slug' field is required.`,
1271
- path: ["slug"],
1128
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
1129
+ if (errors.length > 0) {
1130
+ const error = new FDKClientValidationError({
1131
+ message: "Missing required field",
1132
+ details: errors,
1272
1133
  });
1273
- }
1274
- if (invalidInput.length) {
1275
- const error = new Error();
1276
- error.message = "Missing required field";
1277
- error.details = invalidInput;
1278
1134
  return Promise.reject(new FDKClientValidationError(error));
1279
1135
  }
1280
1136
 
@@ -1306,7 +1162,7 @@ class Catalog {
1306
1162
  /**
1307
1163
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1308
1164
  * @param {import("../ApplicationAPIClient").Options} - Options
1309
- * @returns {Promise<ProductSizePriceResponseV3>} - Success response
1165
+ * @returns {Promise<ProductSizePriceResponseV4>} - Success response
1310
1166
  * @name getProductPriceBySlug
1311
1167
  * @summary: Get product price
1312
1168
  * @description: Get the price of a product size at all the selling locations near to a PIN Code. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/catalog/getProductPriceBySlug/).
@@ -1315,24 +1171,12 @@ class Catalog {
1315
1171
  { slug, size, storeId, moq, requestHeaders } = { requestHeaders: {} },
1316
1172
  { responseHeaders } = { responseHeaders: false }
1317
1173
  ) {
1318
- let invalidInput = [];
1319
-
1320
- if (!slug) {
1321
- invalidInput.push({
1322
- message: `The 'slug' field is required.`,
1323
- path: ["slug"],
1324
- });
1325
- }
1326
- if (!size) {
1327
- invalidInput.push({
1328
- message: `The 'size' field is required.`,
1329
- path: ["size"],
1174
+ const errors = validateRequiredParams(arguments[0], ["slug", "size"]);
1175
+ if (errors.length > 0) {
1176
+ const error = new FDKClientValidationError({
1177
+ message: "Missing required field",
1178
+ details: errors,
1330
1179
  });
1331
- }
1332
- if (invalidInput.length) {
1333
- const error = new Error();
1334
- error.message = "Missing required field";
1335
- error.details = invalidInput;
1336
1180
  return Promise.reject(new FDKClientValidationError(error));
1337
1181
  }
1338
1182
 
@@ -1366,7 +1210,7 @@ class Catalog {
1366
1210
  /**
1367
1211
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1368
1212
  * @param {import("../ApplicationAPIClient").Options} - Options
1369
- * @returns {Promise<ProductSizeSellersResponseV3>} - Success response
1213
+ * @returns {Promise<ProductSizeSellersResponseV4>} - Success response
1370
1214
  * @name getProductSellersBySlug
1371
1215
  * @summary: List sellers
1372
1216
  * @description: List all sellers offering a specific product identified by its slug and size. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/catalog/getProductSellersBySlug/).
@@ -1377,24 +1221,12 @@ class Catalog {
1377
1221
  },
1378
1222
  { responseHeaders } = { responseHeaders: false }
1379
1223
  ) {
1380
- let invalidInput = [];
1381
-
1382
- if (!slug) {
1383
- invalidInput.push({
1384
- message: `The 'slug' field is required.`,
1385
- path: ["slug"],
1224
+ const errors = validateRequiredParams(arguments[0], ["slug", "size"]);
1225
+ if (errors.length > 0) {
1226
+ const error = new FDKClientValidationError({
1227
+ message: "Missing required field",
1228
+ details: errors,
1386
1229
  });
1387
- }
1388
- if (!size) {
1389
- invalidInput.push({
1390
- message: `The 'size' field is required.`,
1391
- path: ["size"],
1392
- });
1393
- }
1394
- if (invalidInput.length) {
1395
- const error = new Error();
1396
- error.message = "Missing required field";
1397
- error.details = invalidInput;
1398
1230
  return Promise.reject(new FDKClientValidationError(error));
1399
1231
  }
1400
1232
 
@@ -1437,7 +1269,7 @@ class Catalog {
1437
1269
  * @param {string} [arg.strategy] - Sort stores on the basis of strategy.
1438
1270
  * eg, fast-delivery, low-price, optimal.
1439
1271
  * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
1440
- * @returns {Paginator<ProductSizeSellersResponseV3>}
1272
+ * @returns {Paginator<ProductSizeSellersResponseV4>}
1441
1273
  * @summary: List sellers
1442
1274
  * @description: List all sellers offering a specific product identified by its slug and size.
1443
1275
  */
@@ -1476,18 +1308,12 @@ class Catalog {
1476
1308
  { slug, storeId, requestHeaders } = { requestHeaders: {} },
1477
1309
  { responseHeaders } = { responseHeaders: false }
1478
1310
  ) {
1479
- let invalidInput = [];
1480
-
1481
- if (!slug) {
1482
- invalidInput.push({
1483
- message: `The 'slug' field is required.`,
1484
- path: ["slug"],
1311
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
1312
+ if (errors.length > 0) {
1313
+ const error = new FDKClientValidationError({
1314
+ message: "Missing required field",
1315
+ details: errors,
1485
1316
  });
1486
- }
1487
- if (invalidInput.length) {
1488
- const error = new Error();
1489
- error.message = "Missing required field";
1490
- error.details = invalidInput;
1491
1317
  return Promise.reject(new FDKClientValidationError(error));
1492
1318
  }
1493
1319
 
@@ -1529,14 +1355,6 @@ class Catalog {
1529
1355
  { itemId, alu, skuCode, ean, upc, requestHeaders } = { requestHeaders: {} },
1530
1356
  { responseHeaders } = { responseHeaders: false }
1531
1357
  ) {
1532
- let invalidInput = [];
1533
- if (invalidInput.length) {
1534
- const error = new Error();
1535
- error.message = "Missing required field";
1536
- error.details = invalidInput;
1537
- return Promise.reject(new FDKClientValidationError(error));
1538
- }
1539
-
1540
1358
  const query_params = {};
1541
1359
  query_params["item_id"] = itemId;
1542
1360
  query_params["alu"] = alu;
@@ -1579,21 +1397,6 @@ class Catalog {
1579
1397
  { timestamp, pageSize, pageId, requestHeaders } = { requestHeaders: {} },
1580
1398
  { responseHeaders } = { responseHeaders: false }
1581
1399
  ) {
1582
- let invalidInput = [];
1583
-
1584
- if (!timestamp) {
1585
- invalidInput.push({
1586
- message: `The 'timestamp' field is required.`,
1587
- path: ["timestamp"],
1588
- });
1589
- }
1590
- if (invalidInput.length) {
1591
- const error = new Error();
1592
- error.message = "Missing required field";
1593
- error.details = invalidInput;
1594
- return Promise.reject(new FDKClientValidationError(error));
1595
- }
1596
-
1597
1400
  const query_params = {};
1598
1401
  query_params["timestamp"] = timestamp;
1599
1402
  query_params["page_size"] = pageSize;
@@ -1663,18 +1466,12 @@ class Catalog {
1663
1466
  { slug, requestHeaders } = { requestHeaders: {} },
1664
1467
  { responseHeaders } = { responseHeaders: false }
1665
1468
  ) {
1666
- let invalidInput = [];
1667
-
1668
- if (!slug) {
1669
- invalidInput.push({
1670
- message: `The 'slug' field is required.`,
1671
- path: ["slug"],
1469
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
1470
+ if (errors.length > 0) {
1471
+ const error = new FDKClientValidationError({
1472
+ message: "Missing required field",
1473
+ details: errors,
1672
1474
  });
1673
- }
1674
- if (invalidInput.length) {
1675
- const error = new Error();
1676
- error.message = "Missing required field";
1677
- error.details = invalidInput;
1678
1475
  return Promise.reject(new FDKClientValidationError(error));
1679
1476
  }
1680
1477
 
@@ -1725,14 +1522,6 @@ class Catalog {
1725
1522
  } = { requestHeaders: {} },
1726
1523
  { responseHeaders } = { responseHeaders: false }
1727
1524
  ) {
1728
- let invalidInput = [];
1729
- if (invalidInput.length) {
1730
- const error = new Error();
1731
- error.message = "Missing required field";
1732
- error.details = invalidInput;
1733
- return Promise.reject(new FDKClientValidationError(error));
1734
- }
1735
-
1736
1525
  const query_params = {};
1737
1526
  query_params["q"] = q;
1738
1527
  query_params["f"] = f;
@@ -1822,21 +1611,6 @@ class Catalog {
1822
1611
  { q, requestHeaders } = { requestHeaders: {} },
1823
1612
  { responseHeaders } = { responseHeaders: false }
1824
1613
  ) {
1825
- let invalidInput = [];
1826
-
1827
- if (!q) {
1828
- invalidInput.push({
1829
- message: `The 'q' field is required.`,
1830
- path: ["q"],
1831
- });
1832
- }
1833
- if (invalidInput.length) {
1834
- const error = new Error();
1835
- error.message = "Missing required field";
1836
- error.details = invalidInput;
1837
- return Promise.reject(new FDKClientValidationError(error));
1838
- }
1839
-
1840
1614
  const query_params = {};
1841
1615
  query_params["q"] = q;
1842
1616
 
@@ -1875,18 +1649,12 @@ class Catalog {
1875
1649
  { slug, requestHeaders } = { requestHeaders: {} },
1876
1650
  { responseHeaders } = { responseHeaders: false }
1877
1651
  ) {
1878
- let invalidInput = [];
1879
-
1880
- if (!slug) {
1881
- invalidInput.push({
1882
- message: `The 'slug' field is required.`,
1883
- path: ["slug"],
1652
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
1653
+ if (errors.length > 0) {
1654
+ const error = new FDKClientValidationError({
1655
+ message: "Missing required field",
1656
+ details: errors,
1884
1657
  });
1885
- }
1886
- if (invalidInput.length) {
1887
- const error = new Error();
1888
- error.message = "Missing required field";
1889
- error.details = invalidInput;
1890
1658
  return Promise.reject(new FDKClientValidationError(error));
1891
1659
  }
1892
1660
 
@@ -1937,14 +1705,6 @@ class Catalog {
1937
1705
  } = { requestHeaders: {} },
1938
1706
  { responseHeaders } = { responseHeaders: false }
1939
1707
  ) {
1940
- let invalidInput = [];
1941
- if (invalidInput.length) {
1942
- const error = new Error();
1943
- error.message = "Missing required field";
1944
- error.details = invalidInput;
1945
- return Promise.reject(new FDKClientValidationError(error));
1946
- }
1947
-
1948
1708
  const query_params = {};
1949
1709
  query_params["page_no"] = pageNo;
1950
1710
  query_params["page_size"] = pageSize;
@@ -2040,24 +1800,15 @@ class Catalog {
2040
1800
  { collectionType, collectionId, requestHeaders } = { requestHeaders: {} },
2041
1801
  { responseHeaders } = { responseHeaders: false }
2042
1802
  ) {
2043
- let invalidInput = [];
2044
-
2045
- if (!collectionType) {
2046
- invalidInput.push({
2047
- message: `The 'collectionType' field is required.`,
2048
- path: ["collectionType"],
1803
+ const errors = validateRequiredParams(arguments[0], [
1804
+ "collectionType",
1805
+ "collectionId",
1806
+ ]);
1807
+ if (errors.length > 0) {
1808
+ const error = new FDKClientValidationError({
1809
+ message: "Missing required field",
1810
+ details: errors,
2049
1811
  });
2050
- }
2051
- if (!collectionId) {
2052
- invalidInput.push({
2053
- message: `The 'collectionId' field is required.`,
2054
- path: ["collectionId"],
2055
- });
2056
- }
2057
- if (invalidInput.length) {
2058
- const error = new Error();
2059
- error.message = "Missing required field";
2060
- error.details = invalidInput;
2061
1812
  return Promise.reject(new FDKClientValidationError(error));
2062
1813
  }
2063
1814