@gofynd/fdk-client-javascript 1.4.15 → 1.4.16-beta.1

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 (75) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.d.ts +11 -11
  4. package/sdk/application/Cart/CartApplicationClient.js +343 -48
  5. package/sdk/application/Catalog/CatalogApplicationClient.js +408 -0
  6. package/sdk/application/Common/CommonApplicationClient.js +21 -0
  7. package/sdk/application/Communication/CommunicationApplicationClient.js +29 -0
  8. package/sdk/application/Configuration/ConfigurationApplicationClient.js +147 -0
  9. package/sdk/application/Content/ContentApplicationClient.d.ts +20 -0
  10. package/sdk/application/Content/ContentApplicationClient.js +327 -0
  11. package/sdk/application/FileStorage/FileStorageApplicationClient.js +43 -0
  12. package/sdk/application/Finance/FinanceApplicationClient.js +21 -0
  13. package/sdk/application/Lead/LeadApplicationClient.js +73 -0
  14. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +1 -1
  15. package/sdk/application/Logistic/LogisticApplicationClient.js +182 -2
  16. package/sdk/application/Order/OrderApplicationClient.js +202 -0
  17. package/sdk/application/Payment/PaymentApplicationClient.d.ts +0 -10
  18. package/sdk/application/Payment/PaymentApplicationClient.js +445 -38
  19. package/sdk/application/Rewards/RewardsApplicationClient.js +68 -0
  20. package/sdk/application/Share/ShareApplicationClient.js +96 -0
  21. package/sdk/application/Theme/ThemeApplicationClient.js +64 -0
  22. package/sdk/application/User/UserApplicationClient.js +412 -0
  23. package/sdk/application/Webhook/WebhookApplicationClient.js +13 -0
  24. package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +12 -33
  25. package/sdk/partner/Logistics/LogisticsPartnerClient.js +38 -209
  26. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +19 -399
  27. package/sdk/partner/Logistics/LogisticsPartnerModel.js +11 -212
  28. package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +1 -3
  29. package/sdk/partner/Logistics/LogisticsPartnerValidator.js +7 -22
  30. package/sdk/partner/OAuthClient.js +1 -0
  31. package/sdk/partner/Theme/ThemePartnerModel.d.ts +3 -40
  32. package/sdk/partner/Theme/ThemePartnerModel.js +2 -24
  33. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +1 -1
  34. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +1 -1
  35. package/sdk/platform/Cart/CartPlatformApplicationClient.js +12 -3
  36. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +11 -1
  37. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +4 -1
  38. package/sdk/platform/Cart/CartPlatformModel.d.ts +14 -28
  39. package/sdk/platform/Cart/CartPlatformModel.js +7 -13
  40. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +0 -24
  41. package/sdk/platform/Catalog/CatalogPlatformClient.js +0 -176
  42. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +29 -80
  43. package/sdk/platform/Catalog/CatalogPlatformModel.js +32 -72
  44. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +1 -45
  45. package/sdk/platform/Catalog/CatalogPlatformValidator.js +0 -35
  46. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +7 -0
  47. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +3 -0
  48. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +52 -0
  49. package/sdk/platform/Content/ContentPlatformApplicationClient.js +411 -0
  50. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +85 -1
  51. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +73 -0
  52. package/sdk/platform/Content/ContentPlatformModel.d.ts +90 -1
  53. package/sdk/platform/Content/ContentPlatformModel.js +104 -0
  54. package/sdk/platform/Order/OrderPlatformClient.d.ts +2 -2
  55. package/sdk/platform/Order/OrderPlatformClient.js +0 -8
  56. package/sdk/platform/Order/OrderPlatformModel.d.ts +3 -75
  57. package/sdk/platform/Order/OrderPlatformModel.js +2 -43
  58. package/sdk/platform/Order/OrderPlatformValidator.d.ts +0 -22
  59. package/sdk/platform/Order/OrderPlatformValidator.js +0 -10
  60. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +10 -0
  61. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +118 -0
  62. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +53 -1
  63. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +29 -0
  64. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +0 -104
  65. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +74 -816
  66. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +23 -598
  67. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +20 -382
  68. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +1 -191
  69. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +0 -138
  70. package/sdk/platform/Theme/ThemePlatformModel.d.ts +3 -40
  71. package/sdk/platform/Theme/ThemePlatformModel.js +2 -24
  72. package/sdk/public/Configuration/ConfigurationPublicClient.js +16 -0
  73. package/sdk/public/Content/ContentPublicClient.js +116 -0
  74. package/sdk/public/Partner/PartnerPublicClient.js +15 -0
  75. package/sdk/public/Webhook/WebhookPublicClient.js +40 -0
package/README.md CHANGED
@@ -237,7 +237,7 @@ console.log("Active Theme: ", response.information.name);
237
237
  The above code will log the curl command in the console
238
238
 
239
239
  ```bash
240
- curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 1.4.15' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
240
+ curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 1.4.16-beta.1' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
241
241
  Active Theme: Emerge
242
242
  ```
243
243
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gofynd/fdk-client-javascript",
3
- "version": "1.4.15",
3
+ "version": "1.4.16-beta.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -22,6 +22,7 @@ declare class Cart {
22
22
  getLadderOffers: string;
23
23
  getPromotionOffers: string;
24
24
  getPromotionPaymentOffers: string;
25
+ getPromotions: string;
25
26
  getShipments: string;
26
27
  removeAddress: string;
27
28
  removeCoupon: string;
@@ -29,7 +30,6 @@ declare class Cart {
29
30
  selectPaymentMode: string;
30
31
  updateAddress: string;
31
32
  updateCart: string;
32
- updateCartBreakup: string;
33
33
  updateCartMeta: string;
34
34
  updateCartWithSharedItems: string;
35
35
  validateCouponForPayment: string;
@@ -197,7 +197,7 @@ declare class Cart {
197
197
  * @summary: List available promotion offers
198
198
  * @description: List all promotional offers available for the items in the cart, including details such as offer text, unique promotion ID, and validity period. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getPromotionOffers/).
199
199
  */
200
- getPromotionOffers({ slug, pageSize, promotionGroup, storeId, cartType, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<PromotionOffersResult>;
200
+ getPromotionOffers({ slug, pageSize, promotionGroup, storeId, cartType, sortBy, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<PromotionOffersResult>;
201
201
  /**
202
202
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
203
203
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -207,6 +207,15 @@ declare class Cart {
207
207
  * @description: Use this API to get top 5 payment offers available for current product. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getPromotionPaymentOffers/).
208
208
  */
209
209
  getPromotionPaymentOffers({ id, uid, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<PromotionPaymentOffersResult>;
210
+ /**
211
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
212
+ * @param {import("../ApplicationAPIClient").Options} - Options
213
+ * @returns {Promise<Promotions>} - Success response
214
+ * @name getPromotions
215
+ * @summary: List all available promotions of the sales channel
216
+ * @description: List all promotional offers available for the sales channel, including details such as offer text, unique promotion ID, and validity period. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getPromotions/).
217
+ */
218
+ getPromotions({ pageSize, pageNo, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<Promotions>;
210
219
  /**
211
220
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
212
221
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -270,15 +279,6 @@ declare class Cart {
270
279
  * @description: Update cart. Customers can modify added product attributes such as quantity and size, as well as remove items from the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateCart/).
271
280
  */
272
281
  updateCart({ body, id, i, b, areaCode, buyNow, cartType, orderType, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<UpdateCartDetailResult>;
273
- /**
274
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
275
- * @param {import("../ApplicationAPIClient").Options} - Options
276
- * @returns {Promise<UpdateCartDetailResult>} - Success response
277
- * @name updateCartBreakup
278
- * @summary: Update store credits into cart and their items
279
- * @description: Update cart. Customers can adjust the cart breakup by applying or removing store credits as needed. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateCartBreakup/).
280
- */
281
- updateCartBreakup({ body, id, i, b, buyNow, cartType, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<UpdateCartDetailResult>;
282
282
  /**
283
283
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
284
284
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -1,3 +1,8 @@
1
+ const {
2
+ FDKClientValidationError,
3
+ FDKResponseValidationError,
4
+ } = require("../../common/FDKError");
5
+
1
6
  const ApplicationAPIClient = require("../ApplicationAPIClient");
2
7
  const constructUrl = require("../constructUrl");
3
8
  const Paginator = require("../../common/Paginator");
@@ -26,6 +31,7 @@ class Cart {
26
31
  getPromotionOffers: "/service/application/cart/v1.0/available-promotions",
27
32
  getPromotionPaymentOffers:
28
33
  "/service/application/cart/v1.0/available-payment-offers",
34
+ getPromotions: "/service/application/cart/v1.0/promotion",
29
35
  getShipments: "/service/application/cart/v1.0/shipment",
30
36
  removeAddress: "/service/application/cart/v1.0/address/{id}",
31
37
  removeCoupon: "/service/application/cart/v1.0/coupon",
@@ -33,7 +39,6 @@ class Cart {
33
39
  selectPaymentMode: "/service/application/cart/v1.0/payment",
34
40
  updateAddress: "/service/application/cart/v1.0/address/{id}",
35
41
  updateCart: "/service/application/cart/v1.0/detail",
36
- updateCartBreakup: "/service/application/cart/v1.0/detail",
37
42
  updateCartMeta: "/service/application/cart/v1.0/meta",
38
43
  updateCartWithSharedItems:
39
44
  "/service/application/cart/v1.0/share-cart/{token}/{action}",
@@ -68,6 +73,14 @@ class Cart {
68
73
  { body, requestHeaders } = { requestHeaders: {} },
69
74
  { responseHeaders } = { responseHeaders: false }
70
75
  ) {
76
+ let invalidInput = [];
77
+ if (invalidInput.length) {
78
+ const error = new Error();
79
+ error.message = "Missing required field";
80
+ error.details = invalidInput;
81
+ return Promise.reject(new FDKClientValidationError(error));
82
+ }
83
+
71
84
  const query_params = {};
72
85
 
73
86
  const xHeaders = {};
@@ -107,6 +120,14 @@ class Cart {
107
120
  },
108
121
  { responseHeaders } = { responseHeaders: false }
109
122
  ) {
123
+ let invalidInput = [];
124
+ if (invalidInput.length) {
125
+ const error = new Error();
126
+ error.message = "Missing required field";
127
+ error.details = invalidInput;
128
+ return Promise.reject(new FDKClientValidationError(error));
129
+ }
130
+
110
131
  const query_params = {};
111
132
  query_params["i"] = i;
112
133
  query_params["b"] = b;
@@ -152,6 +173,14 @@ class Cart {
152
173
  },
153
174
  { responseHeaders } = { responseHeaders: false }
154
175
  ) {
176
+ let invalidInput = [];
177
+ if (invalidInput.length) {
178
+ const error = new Error();
179
+ error.message = "Missing required field";
180
+ error.details = invalidInput;
181
+ return Promise.reject(new FDKClientValidationError(error));
182
+ }
183
+
155
184
  const query_params = {};
156
185
  query_params["i"] = i;
157
186
  query_params["b"] = b;
@@ -195,6 +224,14 @@ class Cart {
195
224
  { body, id, i, b, buyNow, requestHeaders } = { requestHeaders: {} },
196
225
  { responseHeaders } = { responseHeaders: false }
197
226
  ) {
227
+ let invalidInput = [];
228
+ if (invalidInput.length) {
229
+ const error = new Error();
230
+ error.message = "Missing required field";
231
+ error.details = invalidInput;
232
+ return Promise.reject(new FDKClientValidationError(error));
233
+ }
234
+
198
235
  const query_params = {};
199
236
  query_params["id"] = id;
200
237
  query_params["i"] = i;
@@ -236,6 +273,14 @@ class Cart {
236
273
  { body, buyNow, cartType, requestHeaders } = { requestHeaders: {} },
237
274
  { responseHeaders } = { responseHeaders: false }
238
275
  ) {
276
+ let invalidInput = [];
277
+ if (invalidInput.length) {
278
+ const error = new Error();
279
+ error.message = "Missing required field";
280
+ error.details = invalidInput;
281
+ return Promise.reject(new FDKClientValidationError(error));
282
+ }
283
+
239
284
  const query_params = {};
240
285
  query_params["buy_now"] = buyNow;
241
286
  query_params["cart_type"] = cartType;
@@ -275,6 +320,14 @@ class Cart {
275
320
  { body, buyNow, cartType, requestHeaders } = { requestHeaders: {} },
276
321
  { responseHeaders } = { responseHeaders: false }
277
322
  ) {
323
+ let invalidInput = [];
324
+ if (invalidInput.length) {
325
+ const error = new Error();
326
+ error.message = "Missing required field";
327
+ error.details = invalidInput;
328
+ return Promise.reject(new FDKClientValidationError(error));
329
+ }
330
+
278
331
  const query_params = {};
279
332
  query_params["buy_now"] = buyNow;
280
333
  query_params["cart_type"] = cartType;
@@ -314,6 +367,14 @@ class Cart {
314
367
  { id, requestHeaders } = { requestHeaders: {} },
315
368
  { responseHeaders } = { responseHeaders: false }
316
369
  ) {
370
+ let invalidInput = [];
371
+ if (invalidInput.length) {
372
+ const error = new Error();
373
+ error.message = "Missing required field";
374
+ error.details = invalidInput;
375
+ return Promise.reject(new FDKClientValidationError(error));
376
+ }
377
+
317
378
  const query_params = {};
318
379
  query_params["id"] = id;
319
380
 
@@ -361,6 +422,21 @@ class Cart {
361
422
  } = { requestHeaders: {} },
362
423
  { responseHeaders } = { responseHeaders: false }
363
424
  ) {
425
+ let invalidInput = [];
426
+
427
+ if (!id) {
428
+ invalidInput.push({
429
+ message: `The 'id' field is required.`,
430
+ path: ["id"],
431
+ });
432
+ }
433
+ if (invalidInput.length) {
434
+ const error = new Error();
435
+ error.message = "Missing required field";
436
+ error.details = invalidInput;
437
+ return Promise.reject(new FDKClientValidationError(error));
438
+ }
439
+
364
440
  const query_params = {};
365
441
  query_params["cart_id"] = cartId;
366
442
  query_params["buy_now"] = buyNow;
@@ -412,6 +488,14 @@ class Cart {
412
488
  } = { requestHeaders: {} },
413
489
  { responseHeaders } = { responseHeaders: false }
414
490
  ) {
491
+ let invalidInput = [];
492
+ if (invalidInput.length) {
493
+ const error = new Error();
494
+ error.message = "Missing required field";
495
+ error.details = invalidInput;
496
+ return Promise.reject(new FDKClientValidationError(error));
497
+ }
498
+
415
499
  const query_params = {};
416
500
  query_params["cart_id"] = cartId;
417
501
  query_params["buy_now"] = buyNow;
@@ -455,6 +539,14 @@ class Cart {
455
539
  { itemId, articleId, uid, slug, requestHeaders } = { requestHeaders: {} },
456
540
  { responseHeaders } = { responseHeaders: false }
457
541
  ) {
542
+ let invalidInput = [];
543
+ if (invalidInput.length) {
544
+ const error = new Error();
545
+ error.message = "Missing required field";
546
+ error.details = invalidInput;
547
+ return Promise.reject(new FDKClientValidationError(error));
548
+ }
549
+
458
550
  const query_params = {};
459
551
  query_params["item_id"] = itemId;
460
552
  query_params["article_id"] = articleId;
@@ -506,6 +598,14 @@ class Cart {
506
598
  } = { requestHeaders: {} },
507
599
  { responseHeaders } = { responseHeaders: false }
508
600
  ) {
601
+ let invalidInput = [];
602
+ if (invalidInput.length) {
603
+ const error = new Error();
604
+ error.message = "Missing required field";
605
+ error.details = invalidInput;
606
+ return Promise.reject(new FDKClientValidationError(error));
607
+ }
608
+
509
609
  const query_params = {};
510
610
  query_params["id"] = id;
511
611
  query_params["i"] = i;
@@ -551,6 +651,14 @@ class Cart {
551
651
  { id, requestHeaders } = { requestHeaders: {} },
552
652
  { responseHeaders } = { responseHeaders: false }
553
653
  ) {
654
+ let invalidInput = [];
655
+ if (invalidInput.length) {
656
+ const error = new Error();
657
+ error.message = "Missing required field";
658
+ error.details = invalidInput;
659
+ return Promise.reject(new FDKClientValidationError(error));
660
+ }
661
+
554
662
  const query_params = {};
555
663
  query_params["id"] = id;
556
664
 
@@ -589,6 +697,14 @@ class Cart {
589
697
  { body, requestHeaders } = { requestHeaders: {} },
590
698
  { responseHeaders } = { responseHeaders: false }
591
699
  ) {
700
+ let invalidInput = [];
701
+ if (invalidInput.length) {
702
+ const error = new Error();
703
+ error.message = "Missing required field";
704
+ error.details = invalidInput;
705
+ return Promise.reject(new FDKClientValidationError(error));
706
+ }
707
+
592
708
  const query_params = {};
593
709
 
594
710
  const xHeaders = {};
@@ -626,6 +742,21 @@ class Cart {
626
742
  { token, requestHeaders } = { requestHeaders: {} },
627
743
  { responseHeaders } = { responseHeaders: false }
628
744
  ) {
745
+ let invalidInput = [];
746
+
747
+ if (!token) {
748
+ invalidInput.push({
749
+ message: `The 'token' field is required.`,
750
+ path: ["token"],
751
+ });
752
+ }
753
+ if (invalidInput.length) {
754
+ const error = new Error();
755
+ error.message = "Missing required field";
756
+ error.details = invalidInput;
757
+ return Promise.reject(new FDKClientValidationError(error));
758
+ }
759
+
629
760
  const query_params = {};
630
761
 
631
762
  const xHeaders = {};
@@ -663,6 +794,14 @@ class Cart {
663
794
  { id, buyNow, slug, storeId, requestHeaders } = { requestHeaders: {} },
664
795
  { responseHeaders } = { responseHeaders: false }
665
796
  ) {
797
+ let invalidInput = [];
798
+ if (invalidInput.length) {
799
+ const error = new Error();
800
+ error.message = "Missing required field";
801
+ error.details = invalidInput;
802
+ return Promise.reject(new FDKClientValidationError(error));
803
+ }
804
+
666
805
  const query_params = {};
667
806
  query_params["id"] = id;
668
807
  query_params["buy_now"] = buyNow;
@@ -704,6 +843,14 @@ class Cart {
704
843
  { id, buyNow, requestHeaders } = { requestHeaders: {} },
705
844
  { responseHeaders } = { responseHeaders: false }
706
845
  ) {
846
+ let invalidInput = [];
847
+ if (invalidInput.length) {
848
+ const error = new Error();
849
+ error.message = "Missing required field";
850
+ error.details = invalidInput;
851
+ return Promise.reject(new FDKClientValidationError(error));
852
+ }
853
+
707
854
  const query_params = {};
708
855
  query_params["id"] = id;
709
856
  query_params["buy_now"] = buyNow;
@@ -745,6 +892,21 @@ class Cart {
745
892
  },
746
893
  { responseHeaders } = { responseHeaders: false }
747
894
  ) {
895
+ let invalidInput = [];
896
+
897
+ if (!slug) {
898
+ invalidInput.push({
899
+ message: `The 'slug' field is required.`,
900
+ path: ["slug"],
901
+ });
902
+ }
903
+ if (invalidInput.length) {
904
+ const error = new Error();
905
+ error.message = "Missing required field";
906
+ error.details = invalidInput;
907
+ return Promise.reject(new FDKClientValidationError(error));
908
+ }
909
+
748
910
  const query_params = {};
749
911
  query_params["slug"] = slug;
750
912
  query_params["store_id"] = storeId;
@@ -783,17 +945,32 @@ class Cart {
783
945
  * @description: List all promotional offers available for the items in the cart, including details such as offer text, unique promotion ID, and validity period. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getPromotionOffers/).
784
946
  */
785
947
  async getPromotionOffers(
786
- { slug, pageSize, promotionGroup, storeId, cartType, requestHeaders } = {
787
- requestHeaders: {},
788
- },
948
+ {
949
+ slug,
950
+ pageSize,
951
+ promotionGroup,
952
+ storeId,
953
+ cartType,
954
+ sortBy,
955
+ requestHeaders,
956
+ } = { requestHeaders: {} },
789
957
  { responseHeaders } = { responseHeaders: false }
790
958
  ) {
959
+ let invalidInput = [];
960
+ if (invalidInput.length) {
961
+ const error = new Error();
962
+ error.message = "Missing required field";
963
+ error.details = invalidInput;
964
+ return Promise.reject(new FDKClientValidationError(error));
965
+ }
966
+
791
967
  const query_params = {};
792
968
  query_params["slug"] = slug;
793
969
  query_params["page_size"] = pageSize;
794
970
  query_params["promotion_group"] = promotionGroup;
795
971
  query_params["store_id"] = storeId;
796
972
  query_params["cart_type"] = cartType;
973
+ query_params["sort_by"] = sortBy;
797
974
 
798
975
  const xHeaders = {};
799
976
 
@@ -830,6 +1007,14 @@ class Cart {
830
1007
  { id, uid, requestHeaders } = { requestHeaders: {} },
831
1008
  { responseHeaders } = { responseHeaders: false }
832
1009
  ) {
1010
+ let invalidInput = [];
1011
+ if (invalidInput.length) {
1012
+ const error = new Error();
1013
+ error.message = "Missing required field";
1014
+ error.details = invalidInput;
1015
+ return Promise.reject(new FDKClientValidationError(error));
1016
+ }
1017
+
833
1018
  const query_params = {};
834
1019
  query_params["id"] = id;
835
1020
  query_params["uid"] = uid;
@@ -857,6 +1042,53 @@ class Cart {
857
1042
  return response;
858
1043
  }
859
1044
 
1045
+ /**
1046
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1047
+ * @param {import("../ApplicationAPIClient").Options} - Options
1048
+ * @returns {Promise<Promotions>} - Success response
1049
+ * @name getPromotions
1050
+ * @summary: List all available promotions of the sales channel
1051
+ * @description: List all promotional offers available for the sales channel, including details such as offer text, unique promotion ID, and validity period. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getPromotions/).
1052
+ */
1053
+ async getPromotions(
1054
+ { pageSize, pageNo, requestHeaders } = { requestHeaders: {} },
1055
+ { responseHeaders } = { responseHeaders: false }
1056
+ ) {
1057
+ let invalidInput = [];
1058
+ if (invalidInput.length) {
1059
+ const error = new Error();
1060
+ error.message = "Missing required field";
1061
+ error.details = invalidInput;
1062
+ return Promise.reject(new FDKClientValidationError(error));
1063
+ }
1064
+
1065
+ const query_params = {};
1066
+ query_params["page_size"] = pageSize;
1067
+ query_params["page_no"] = pageNo;
1068
+
1069
+ const xHeaders = {};
1070
+
1071
+ const response = await ApplicationAPIClient.execute(
1072
+ this._conf,
1073
+ "get",
1074
+ constructUrl({
1075
+ url: this._urls["getPromotions"],
1076
+ params: {},
1077
+ }),
1078
+ query_params,
1079
+ undefined,
1080
+ { ...xHeaders, ...requestHeaders },
1081
+ { responseHeaders }
1082
+ );
1083
+
1084
+ let responseData = response;
1085
+ if (responseHeaders) {
1086
+ responseData = response[0];
1087
+ }
1088
+
1089
+ return response;
1090
+ }
1091
+
860
1092
  /**
861
1093
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
862
1094
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -871,6 +1103,14 @@ class Cart {
871
1103
  },
872
1104
  { responseHeaders } = { responseHeaders: false }
873
1105
  ) {
1106
+ let invalidInput = [];
1107
+ if (invalidInput.length) {
1108
+ const error = new Error();
1109
+ error.message = "Missing required field";
1110
+ error.details = invalidInput;
1111
+ return Promise.reject(new FDKClientValidationError(error));
1112
+ }
1113
+
874
1114
  const query_params = {};
875
1115
  query_params["p"] = p;
876
1116
  query_params["id"] = id;
@@ -914,6 +1154,21 @@ class Cart {
914
1154
  { id, requestHeaders } = { requestHeaders: {} },
915
1155
  { responseHeaders } = { responseHeaders: false }
916
1156
  ) {
1157
+ let invalidInput = [];
1158
+
1159
+ if (!id) {
1160
+ invalidInput.push({
1161
+ message: `The 'id' field is required.`,
1162
+ path: ["id"],
1163
+ });
1164
+ }
1165
+ if (invalidInput.length) {
1166
+ const error = new Error();
1167
+ error.message = "Missing required field";
1168
+ error.details = invalidInput;
1169
+ return Promise.reject(new FDKClientValidationError(error));
1170
+ }
1171
+
917
1172
  const query_params = {};
918
1173
 
919
1174
  const xHeaders = {};
@@ -951,6 +1206,14 @@ class Cart {
951
1206
  { id, buyNow, requestHeaders } = { requestHeaders: {} },
952
1207
  { responseHeaders } = { responseHeaders: false }
953
1208
  ) {
1209
+ let invalidInput = [];
1210
+ if (invalidInput.length) {
1211
+ const error = new Error();
1212
+ error.message = "Missing required field";
1213
+ error.details = invalidInput;
1214
+ return Promise.reject(new FDKClientValidationError(error));
1215
+ }
1216
+
954
1217
  const query_params = {};
955
1218
  query_params["id"] = id;
956
1219
  query_params["buy_now"] = buyNow;
@@ -990,6 +1253,14 @@ class Cart {
990
1253
  { body, cartId, buyNow, i, b, requestHeaders } = { requestHeaders: {} },
991
1254
  { responseHeaders } = { responseHeaders: false }
992
1255
  ) {
1256
+ let invalidInput = [];
1257
+ if (invalidInput.length) {
1258
+ const error = new Error();
1259
+ error.message = "Missing required field";
1260
+ error.details = invalidInput;
1261
+ return Promise.reject(new FDKClientValidationError(error));
1262
+ }
1263
+
993
1264
  const query_params = {};
994
1265
  query_params["cart_id"] = cartId;
995
1266
  query_params["buy_now"] = buyNow;
@@ -1031,6 +1302,14 @@ class Cart {
1031
1302
  { body, id, buyNow, requestHeaders } = { requestHeaders: {} },
1032
1303
  { responseHeaders } = { responseHeaders: false }
1033
1304
  ) {
1305
+ let invalidInput = [];
1306
+ if (invalidInput.length) {
1307
+ const error = new Error();
1308
+ error.message = "Missing required field";
1309
+ error.details = invalidInput;
1310
+ return Promise.reject(new FDKClientValidationError(error));
1311
+ }
1312
+
1034
1313
  const query_params = {};
1035
1314
  query_params["id"] = id;
1036
1315
  query_params["buy_now"] = buyNow;
@@ -1070,6 +1349,21 @@ class Cart {
1070
1349
  { id, body, requestHeaders } = { requestHeaders: {} },
1071
1350
  { responseHeaders } = { responseHeaders: false }
1072
1351
  ) {
1352
+ let invalidInput = [];
1353
+
1354
+ if (!id) {
1355
+ invalidInput.push({
1356
+ message: `The 'id' field is required.`,
1357
+ path: ["id"],
1358
+ });
1359
+ }
1360
+ if (invalidInput.length) {
1361
+ const error = new Error();
1362
+ error.message = "Missing required field";
1363
+ error.details = invalidInput;
1364
+ return Promise.reject(new FDKClientValidationError(error));
1365
+ }
1366
+
1073
1367
  const query_params = {};
1074
1368
 
1075
1369
  const xHeaders = {};
@@ -1117,6 +1411,14 @@ class Cart {
1117
1411
  } = { requestHeaders: {} },
1118
1412
  { responseHeaders } = { responseHeaders: false }
1119
1413
  ) {
1414
+ let invalidInput = [];
1415
+ if (invalidInput.length) {
1416
+ const error = new Error();
1417
+ error.message = "Missing required field";
1418
+ error.details = invalidInput;
1419
+ return Promise.reject(new FDKClientValidationError(error));
1420
+ }
1421
+
1120
1422
  const query_params = {};
1121
1423
  query_params["id"] = id;
1122
1424
  query_params["i"] = i;
@@ -1149,50 +1451,6 @@ class Cart {
1149
1451
  return response;
1150
1452
  }
1151
1453
 
1152
- /**
1153
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1154
- * @param {import("../ApplicationAPIClient").Options} - Options
1155
- * @returns {Promise<UpdateCartDetailResult>} - Success response
1156
- * @name updateCartBreakup
1157
- * @summary: Update store credits into cart and their items
1158
- * @description: Update cart. Customers can adjust the cart breakup by applying or removing store credits as needed. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateCartBreakup/).
1159
- */
1160
- async updateCartBreakup(
1161
- { body, id, i, b, buyNow, cartType, requestHeaders } = {
1162
- requestHeaders: {},
1163
- },
1164
- { responseHeaders } = { responseHeaders: false }
1165
- ) {
1166
- const query_params = {};
1167
- query_params["id"] = id;
1168
- query_params["i"] = i;
1169
- query_params["b"] = b;
1170
- query_params["buy_now"] = buyNow;
1171
- query_params["cart_type"] = cartType;
1172
-
1173
- const xHeaders = {};
1174
-
1175
- const response = await ApplicationAPIClient.execute(
1176
- this._conf,
1177
- "patch",
1178
- constructUrl({
1179
- url: this._urls["updateCartBreakup"],
1180
- params: {},
1181
- }),
1182
- query_params,
1183
- body,
1184
- { ...xHeaders, ...requestHeaders },
1185
- { responseHeaders }
1186
- );
1187
-
1188
- let responseData = response;
1189
- if (responseHeaders) {
1190
- responseData = response[0];
1191
- }
1192
-
1193
- return response;
1194
- }
1195
-
1196
1454
  /**
1197
1455
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1198
1456
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -1205,6 +1463,14 @@ class Cart {
1205
1463
  { body, id, buyNow, requestHeaders } = { requestHeaders: {} },
1206
1464
  { responseHeaders } = { responseHeaders: false }
1207
1465
  ) {
1466
+ let invalidInput = [];
1467
+ if (invalidInput.length) {
1468
+ const error = new Error();
1469
+ error.message = "Missing required field";
1470
+ error.details = invalidInput;
1471
+ return Promise.reject(new FDKClientValidationError(error));
1472
+ }
1473
+
1208
1474
  const query_params = {};
1209
1475
  query_params["id"] = id;
1210
1476
  query_params["buy_now"] = buyNow;
@@ -1244,6 +1510,27 @@ class Cart {
1244
1510
  { token, action, requestHeaders } = { requestHeaders: {} },
1245
1511
  { responseHeaders } = { responseHeaders: false }
1246
1512
  ) {
1513
+ let invalidInput = [];
1514
+
1515
+ if (!token) {
1516
+ invalidInput.push({
1517
+ message: `The 'token' field is required.`,
1518
+ path: ["token"],
1519
+ });
1520
+ }
1521
+ if (!action) {
1522
+ invalidInput.push({
1523
+ message: `The 'action' field is required.`,
1524
+ path: ["action"],
1525
+ });
1526
+ }
1527
+ if (invalidInput.length) {
1528
+ const error = new Error();
1529
+ error.message = "Missing required field";
1530
+ error.details = invalidInput;
1531
+ return Promise.reject(new FDKClientValidationError(error));
1532
+ }
1533
+
1247
1534
  const query_params = {};
1248
1535
 
1249
1536
  const xHeaders = {};
@@ -1295,6 +1582,14 @@ class Cart {
1295
1582
  } = { requestHeaders: {} },
1296
1583
  { responseHeaders } = { responseHeaders: false }
1297
1584
  ) {
1585
+ let invalidInput = [];
1586
+ if (invalidInput.length) {
1587
+ const error = new Error();
1588
+ error.message = "Missing required field";
1589
+ error.details = invalidInput;
1590
+ return Promise.reject(new FDKClientValidationError(error));
1591
+ }
1592
+
1298
1593
  const query_params = {};
1299
1594
  query_params["id"] = id;
1300
1595
  query_params["buy_now"] = buyNow;