@gofynd/fdk-client-javascript 1.4.15-beta.3 → 1.4.15-beta.5

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 (241) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/ApplicationClient.d.ts +0 -2
  4. package/sdk/application/ApplicationClient.js +0 -2
  5. package/sdk/application/Cart/CartApplicationClient.d.ts +48 -68
  6. package/sdk/application/Cart/CartApplicationClient.js +304 -114
  7. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +58 -59
  8. package/sdk/application/Catalog/CatalogApplicationClient.js +437 -30
  9. package/sdk/application/Common/CommonApplicationClient.d.ts +2 -2
  10. package/sdk/application/Common/CommonApplicationClient.js +22 -1
  11. package/sdk/application/Communication/CommunicationApplicationClient.js +29 -0
  12. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +20 -20
  13. package/sdk/application/Configuration/ConfigurationApplicationClient.js +157 -10
  14. package/sdk/application/Content/ContentApplicationClient.d.ts +30 -19
  15. package/sdk/application/Content/ContentApplicationClient.js +297 -28
  16. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +8 -8
  17. package/sdk/application/FileStorage/FileStorageApplicationClient.js +50 -7
  18. package/sdk/application/Lead/LeadApplicationClient.d.ts +2 -2
  19. package/sdk/application/Lead/LeadApplicationClient.js +74 -1
  20. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +15 -35
  21. package/sdk/application/Logistic/LogisticApplicationClient.js +159 -87
  22. package/sdk/application/Order/OrderApplicationClient.d.ts +12 -22
  23. package/sdk/application/Order/OrderApplicationClient.js +195 -47
  24. package/sdk/application/Payment/PaymentApplicationClient.d.ts +87 -87
  25. package/sdk/application/Payment/PaymentApplicationClient.js +473 -46
  26. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +13 -13
  27. package/sdk/application/Rewards/RewardsApplicationClient.js +75 -7
  28. package/sdk/application/Share/ShareApplicationClient.js +96 -0
  29. package/sdk/application/Theme/ThemeApplicationClient.d.ts +2 -2
  30. package/sdk/application/Theme/ThemeApplicationClient.js +66 -4
  31. package/sdk/application/User/UserApplicationClient.d.ts +10 -10
  32. package/sdk/application/User/UserApplicationClient.js +418 -6
  33. package/sdk/application/Webhook/WebhookApplicationClient.d.ts +4 -4
  34. package/sdk/application/Webhook/WebhookApplicationClient.js +16 -3
  35. package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +12 -86
  36. package/sdk/partner/FileStorage/FileStoragePartnerClient.js +24 -582
  37. package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +19 -116
  38. package/sdk/partner/FileStorage/FileStoragePartnerModel.js +14 -121
  39. package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +1 -8
  40. package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +4 -51
  41. package/sdk/partner/Lead/LeadPartnerClient.d.ts +2 -2
  42. package/sdk/partner/Lead/LeadPartnerClient.js +2 -2
  43. package/sdk/partner/Lead/LeadPartnerModel.d.ts +5 -5
  44. package/sdk/partner/Lead/LeadPartnerModel.js +15 -15
  45. package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +20 -126
  46. package/sdk/partner/Logistics/LogisticsPartnerClient.js +20 -970
  47. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +167 -1200
  48. package/sdk/partner/Logistics/LogisticsPartnerModel.js +160 -571
  49. package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +0 -10
  50. package/sdk/partner/Logistics/LogisticsPartnerValidator.js +7 -121
  51. package/sdk/partner/OAuthClient.js +1 -0
  52. package/sdk/partner/Theme/ThemePartnerClient.d.ts +10 -8
  53. package/sdk/partner/Theme/ThemePartnerClient.js +16 -14
  54. package/sdk/partner/Theme/ThemePartnerModel.d.ts +39 -135
  55. package/sdk/partner/Theme/ThemePartnerModel.js +38 -114
  56. package/sdk/partner/Theme/ThemePartnerValidator.js +4 -4
  57. package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +18 -28
  58. package/sdk/partner/Webhook/WebhookPartnerClient.js +18 -103
  59. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +179 -612
  60. package/sdk/partner/Webhook/WebhookPartnerModel.js +150 -253
  61. package/sdk/partner/Webhook/WebhookPartnerValidator.d.ts +0 -1
  62. package/sdk/partner/Webhook/WebhookPartnerValidator.js +3 -11
  63. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +4 -5
  64. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +8 -14
  65. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +9 -59
  66. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +4 -40
  67. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +32 -2
  68. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +243 -3
  69. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +130 -11
  70. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +152 -12
  71. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +39 -1
  72. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +35 -0
  73. package/sdk/platform/Billing/BillingPlatformClient.d.ts +12 -12
  74. package/sdk/platform/Billing/BillingPlatformClient.js +15 -15
  75. package/sdk/platform/Billing/BillingPlatformModel.d.ts +388 -443
  76. package/sdk/platform/Billing/BillingPlatformModel.js +263 -280
  77. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +18 -16
  78. package/sdk/platform/Billing/BillingPlatformValidator.js +9 -8
  79. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +103 -134
  80. package/sdk/platform/Cart/CartPlatformApplicationClient.js +115 -419
  81. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +65 -118
  82. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +44 -109
  83. package/sdk/platform/Cart/CartPlatformModel.d.ts +1298 -5037
  84. package/sdk/platform/Cart/CartPlatformModel.js +1217 -1976
  85. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +183 -209
  86. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +400 -457
  87. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +142 -185
  88. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +78 -96
  89. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +117 -154
  90. package/sdk/platform/Catalog/CatalogPlatformClient.js +172 -292
  91. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1647 -6385
  92. package/sdk/platform/Catalog/CatalogPlatformModel.js +1680 -3217
  93. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +31 -72
  94. package/sdk/platform/Catalog/CatalogPlatformValidator.js +24 -50
  95. package/sdk/platform/Common/CommonPlatformClient.d.ts +2 -3
  96. package/sdk/platform/Common/CommonPlatformClient.js +2 -3
  97. package/sdk/platform/Common/CommonPlatformModel.d.ts +9 -9
  98. package/sdk/platform/Common/CommonPlatformModel.js +6 -6
  99. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +17 -16
  100. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +17 -16
  101. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +8 -8
  102. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +8 -8
  103. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +33 -43
  104. package/sdk/platform/Communication/CommunicationPlatformModel.js +34 -38
  105. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +42 -46
  106. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +43 -47
  107. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +223 -223
  108. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +212 -210
  109. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +12 -12
  110. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +12 -12
  111. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +33 -46
  112. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +54 -67
  113. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +18 -18
  114. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +18 -18
  115. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +24 -45
  116. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +30 -134
  117. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +131 -283
  118. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +97 -219
  119. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -37
  120. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +8 -27
  121. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +141 -124
  122. package/sdk/platform/Content/ContentPlatformApplicationClient.js +422 -449
  123. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +141 -179
  124. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +130 -168
  125. package/sdk/platform/Content/ContentPlatformClient.d.ts +106 -142
  126. package/sdk/platform/Content/ContentPlatformClient.js +336 -523
  127. package/sdk/platform/Content/ContentPlatformModel.d.ts +395 -1241
  128. package/sdk/platform/Content/ContentPlatformModel.js +390 -521
  129. package/sdk/platform/Content/ContentPlatformValidator.d.ts +117 -168
  130. package/sdk/platform/Content/ContentPlatformValidator.js +108 -162
  131. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +12 -14
  132. package/sdk/platform/Discount/DiscountPlatformClient.js +12 -14
  133. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +13 -13
  134. package/sdk/platform/Discount/DiscountPlatformModel.js +12 -12
  135. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +2 -2
  136. package/sdk/platform/Discount/DiscountPlatformValidator.js +2 -2
  137. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +36 -94
  138. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +60 -462
  139. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +15 -62
  140. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +13 -75
  141. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +19 -19
  142. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +21 -21
  143. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +101 -370
  144. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +84 -313
  145. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +6 -6
  146. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +6 -6
  147. package/sdk/platform/Finance/FinancePlatformClient.d.ts +320 -0
  148. package/sdk/platform/Finance/FinancePlatformClient.js +2333 -0
  149. package/sdk/platform/Finance/FinancePlatformModel.d.ts +2890 -0
  150. package/sdk/platform/Finance/FinancePlatformModel.js +2148 -0
  151. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +284 -0
  152. package/sdk/platform/Finance/FinancePlatformValidator.js +354 -0
  153. package/sdk/platform/Lead/LeadPlatformClient.d.ts +2 -2
  154. package/sdk/platform/Lead/LeadPlatformClient.js +2 -2
  155. package/sdk/platform/Lead/LeadPlatformModel.d.ts +5 -5
  156. package/sdk/platform/Lead/LeadPlatformModel.js +16 -16
  157. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +6 -17
  158. package/sdk/platform/Order/OrderPlatformApplicationClient.js +7 -85
  159. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +24 -95
  160. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +19 -39
  161. package/sdk/platform/Order/OrderPlatformClient.d.ts +96 -153
  162. package/sdk/platform/Order/OrderPlatformClient.js +198 -416
  163. package/sdk/platform/Order/OrderPlatformModel.d.ts +1286 -7619
  164. package/sdk/platform/Order/OrderPlatformModel.js +1265 -3922
  165. package/sdk/platform/Order/OrderPlatformValidator.d.ts +109 -270
  166. package/sdk/platform/Order/OrderPlatformValidator.js +77 -135
  167. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -6
  168. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +7 -9
  169. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +9 -9
  170. package/sdk/platform/Partner/PartnerPlatformModel.js +8 -8
  171. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +105 -93
  172. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +141 -129
  173. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +48 -48
  174. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +48 -48
  175. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +20 -20
  176. package/sdk/platform/Payment/PaymentPlatformClient.js +20 -20
  177. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +319 -333
  178. package/sdk/platform/Payment/PaymentPlatformModel.js +278 -288
  179. package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +8 -8
  180. package/sdk/platform/Payment/PaymentPlatformValidator.js +8 -8
  181. package/sdk/platform/PlatformClient.d.ts +2 -0
  182. package/sdk/platform/PlatformClient.js +4 -0
  183. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +2 -2
  184. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +2 -2
  185. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +2 -2
  186. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +2 -2
  187. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +9 -9
  188. package/sdk/platform/Rewards/RewardsPlatformModel.js +8 -8
  189. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +36 -46
  190. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +41 -132
  191. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +17 -46
  192. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +14 -34
  193. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +46 -40
  194. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +64 -58
  195. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +612 -1845
  196. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +554 -886
  197. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +46 -42
  198. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +28 -26
  199. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +2 -2
  200. package/sdk/platform/Share/SharePlatformApplicationClient.js +2 -2
  201. package/sdk/platform/Share/SharePlatformModel.d.ts +5 -36
  202. package/sdk/platform/Share/SharePlatformModel.js +4 -27
  203. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +3 -3
  204. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +4 -8
  205. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +0 -5
  206. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +0 -2
  207. package/sdk/platform/Theme/ThemePlatformModel.d.ts +13 -76
  208. package/sdk/platform/Theme/ThemePlatformModel.js +17 -57
  209. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +12 -12
  210. package/sdk/platform/User/UserPlatformApplicationClient.js +12 -12
  211. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +2 -2
  212. package/sdk/platform/User/UserPlatformApplicationValidator.js +2 -2
  213. package/sdk/platform/User/UserPlatformModel.d.ts +21 -21
  214. package/sdk/platform/User/UserPlatformModel.js +23 -23
  215. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +78 -25
  216. package/sdk/platform/Webhook/WebhookPlatformClient.js +470 -75
  217. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +427 -720
  218. package/sdk/platform/Webhook/WebhookPlatformModel.js +386 -410
  219. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +55 -10
  220. package/sdk/platform/Webhook/WebhookPlatformValidator.js +72 -12
  221. package/sdk/platform/index.d.ts +1 -0
  222. package/sdk/platform/index.js +2 -0
  223. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +2 -3
  224. package/sdk/public/Configuration/ConfigurationPublicClient.js +21 -6
  225. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +9 -9
  226. package/sdk/public/Configuration/ConfigurationPublicModel.js +6 -6
  227. package/sdk/public/Content/ContentPublicClient.d.ts +2 -112
  228. package/sdk/public/Content/ContentPublicClient.js +20 -791
  229. package/sdk/public/Content/ContentPublicModel.d.ts +3 -549
  230. package/sdk/public/Content/ContentPublicModel.js +3 -649
  231. package/sdk/public/Content/ContentPublicValidator.d.ts +3 -69
  232. package/sdk/public/Content/ContentPublicValidator.js +2 -88
  233. package/sdk/public/Partner/PartnerPublicClient.js +15 -0
  234. package/sdk/public/Webhook/WebhookPublicClient.d.ts +8 -8
  235. package/sdk/public/Webhook/WebhookPublicClient.js +48 -8
  236. package/sdk/public/Webhook/WebhookPublicModel.d.ts +21 -21
  237. package/sdk/public/Webhook/WebhookPublicModel.js +15 -15
  238. package/sdk/public/Webhook/WebhookPublicValidator.d.ts +4 -4
  239. package/sdk/public/Webhook/WebhookPublicValidator.js +4 -4
  240. package/sdk/application/Finance/FinanceApplicationClient.d.ts +0 -29
  241. package/sdk/application/Finance/FinanceApplicationClient.js +0 -105
@@ -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");
@@ -10,7 +15,6 @@ class Cart {
10
15
  addItems: "/service/application/cart/v1.0/detail",
11
16
  applyCoupon: "/service/application/cart/v1.0/coupon",
12
17
  applyRewardPoints: "/service/application/cart/v1.0/redeem/points/",
13
- checkoutCart: "/service/application/cart/v1.0/checkout",
14
18
  checkoutCartV2: "/service/application/cart/v2.0/checkout",
15
19
  deleteCart: "/service/application/cart/v1.0/cart_archive",
16
20
  getAddressById: "/service/application/cart/v1.0/address/{id}",
@@ -26,7 +30,6 @@ class Cart {
26
30
  getPromotionOffers: "/service/application/cart/v1.0/available-promotions",
27
31
  getPromotionPaymentOffers:
28
32
  "/service/application/cart/v1.0/available-payment-offers",
29
- getPromotions: "/service/application/cart/v1.0/promotion",
30
33
  getShipments: "/service/application/cart/v1.0/shipment",
31
34
  removeAddress: "/service/application/cart/v1.0/address/{id}",
32
35
  removeCoupon: "/service/application/cart/v1.0/coupon",
@@ -59,7 +62,7 @@ class Cart {
59
62
  /**
60
63
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
61
64
  * @param {import("../ApplicationAPIClient").Options} - Options
62
- * @returns {Promise<SaveAddressResult>} - Success response
65
+ * @returns {Promise<SaveAddressResponse>} - Success response
63
66
  * @name addAddress
64
67
  * @summary: Creates a new address for a customer
65
68
  * @description: Add a new address to their cart to save details such as name, email, contact information, and address. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/addAddress/).
@@ -68,6 +71,14 @@ class Cart {
68
71
  { body, requestHeaders } = { requestHeaders: {} },
69
72
  { responseHeaders } = { responseHeaders: false }
70
73
  ) {
74
+ let invalidInput = [];
75
+ if (invalidInput.length) {
76
+ const error = new Error();
77
+ error.message = "Missing required field";
78
+ error.details = invalidInput;
79
+ return Promise.reject(new FDKClientValidationError(error));
80
+ }
81
+
71
82
  const query_params = {};
72
83
 
73
84
  const xHeaders = {};
@@ -96,7 +107,7 @@ class Cart {
96
107
  /**
97
108
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
98
109
  * @param {import("../ApplicationAPIClient").Options} - Options
99
- * @returns {Promise<AddCartDetailResult>} - Success response
110
+ * @returns {Promise<AddCartDetailResponse>} - Success response
100
111
  * @name addItems
101
112
  * @summary: Add items to a cart
102
113
  * @description: Add product items to the customer's existing shopping cart. If there is no existing cart associated with the customer, it creates a new one and adds the items to it. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/addItems/).
@@ -107,6 +118,14 @@ class Cart {
107
118
  },
108
119
  { responseHeaders } = { responseHeaders: false }
109
120
  ) {
121
+ let invalidInput = [];
122
+ if (invalidInput.length) {
123
+ const error = new Error();
124
+ error.message = "Missing required field";
125
+ error.details = invalidInput;
126
+ return Promise.reject(new FDKClientValidationError(error));
127
+ }
128
+
110
129
  const query_params = {};
111
130
  query_params["i"] = i;
112
131
  query_params["b"] = b;
@@ -141,7 +160,7 @@ class Cart {
141
160
  /**
142
161
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
143
162
  * @param {import("../ApplicationAPIClient").Options} - Options
144
- * @returns {Promise<CartDetailResult>} - Success response
163
+ * @returns {Promise<CartDetailResponse>} - Success response
145
164
  * @name applyCoupon
146
165
  * @summary: Apply coupon
147
166
  * @description: Apply a coupon code to the cart to trigger discounts on eligible items. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/applyCoupon/).
@@ -152,6 +171,14 @@ class Cart {
152
171
  },
153
172
  { responseHeaders } = { responseHeaders: false }
154
173
  ) {
174
+ let invalidInput = [];
175
+ if (invalidInput.length) {
176
+ const error = new Error();
177
+ error.message = "Missing required field";
178
+ error.details = invalidInput;
179
+ return Promise.reject(new FDKClientValidationError(error));
180
+ }
181
+
155
182
  const query_params = {};
156
183
  query_params["i"] = i;
157
184
  query_params["b"] = b;
@@ -186,7 +213,7 @@ class Cart {
186
213
  /**
187
214
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
188
215
  * @param {import("../ApplicationAPIClient").Options} - Options
189
- * @returns {Promise<CartDetailResult>} - Success response
216
+ * @returns {Promise<CartDetailResponse>} - Success response
190
217
  * @name applyRewardPoints
191
218
  * @summary: Use reward points
192
219
  * @description: Users can redeem their accumulated reward points and apply them to the items in their cart, thereby availing discounts on their current purchases. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/applyRewardPoints/).
@@ -195,6 +222,14 @@ class Cart {
195
222
  { body, id, i, b, buyNow, requestHeaders } = { requestHeaders: {} },
196
223
  { responseHeaders } = { responseHeaders: false }
197
224
  ) {
225
+ let invalidInput = [];
226
+ if (invalidInput.length) {
227
+ const error = new Error();
228
+ error.message = "Missing required field";
229
+ error.details = invalidInput;
230
+ return Promise.reject(new FDKClientValidationError(error));
231
+ }
232
+
198
233
  const query_params = {};
199
234
  query_params["id"] = id;
200
235
  query_params["i"] = i;
@@ -227,46 +262,7 @@ class Cart {
227
262
  /**
228
263
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
229
264
  * @param {import("../ApplicationAPIClient").Options} - Options
230
- * @returns {Promise<CartCheckoutResult>} - Success response
231
- * @name checkoutCart
232
- * @summary: Checkout cart
233
- * @description: The checkout cart initiates the order creation process based on the selected address and payment method. It revalidates the cart details to ensure safe and seamless order placement. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/checkoutCart/).
234
- */
235
- async checkoutCart(
236
- { body, buyNow, cartType, requestHeaders } = { requestHeaders: {} },
237
- { responseHeaders } = { responseHeaders: false }
238
- ) {
239
- const query_params = {};
240
- query_params["buy_now"] = buyNow;
241
- query_params["cart_type"] = cartType;
242
-
243
- const xHeaders = {};
244
-
245
- const response = await ApplicationAPIClient.execute(
246
- this._conf,
247
- "post",
248
- constructUrl({
249
- url: this._urls["checkoutCart"],
250
- params: {},
251
- }),
252
- query_params,
253
- body,
254
- { ...xHeaders, ...requestHeaders },
255
- { responseHeaders }
256
- );
257
-
258
- let responseData = response;
259
- if (responseHeaders) {
260
- responseData = response[0];
261
- }
262
-
263
- return response;
264
- }
265
-
266
- /**
267
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
268
- * @param {import("../ApplicationAPIClient").Options} - Options
269
- * @returns {Promise<CartCheckoutResult>} - Success response
265
+ * @returns {Promise<CartCheckoutResponse>} - Success response
270
266
  * @name checkoutCartV2
271
267
  * @summary: Checkout cart
272
268
  * @description: The checkout cart initiates the order creation process based on the items in the user’s cart, their selected address, and chosen payment methods. It also supports multiple payment method options and revalidates the cart details to ensure a secure and seamless order placement. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/checkoutCartV2/).
@@ -275,6 +271,14 @@ class Cart {
275
271
  { body, buyNow, cartType, requestHeaders } = { requestHeaders: {} },
276
272
  { responseHeaders } = { responseHeaders: false }
277
273
  ) {
274
+ let invalidInput = [];
275
+ if (invalidInput.length) {
276
+ const error = new Error();
277
+ error.message = "Missing required field";
278
+ error.details = invalidInput;
279
+ return Promise.reject(new FDKClientValidationError(error));
280
+ }
281
+
278
282
  const query_params = {};
279
283
  query_params["buy_now"] = buyNow;
280
284
  query_params["cart_type"] = cartType;
@@ -305,7 +309,7 @@ class Cart {
305
309
  /**
306
310
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
307
311
  * @param {import("../ApplicationAPIClient").Options} - Options
308
- * @returns {Promise<DeleteCartDetailResult>} - Success response
312
+ * @returns {Promise<DeleteCartDetailResponse>} - Success response
309
313
  * @name deleteCart
310
314
  * @summary: Delete a cart
311
315
  * @description: Delete all items from the user's cart and resets it to its initial state, providing a clean slate for new selections. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/deleteCart/).
@@ -314,6 +318,14 @@ class Cart {
314
318
  { id, requestHeaders } = { requestHeaders: {} },
315
319
  { responseHeaders } = { responseHeaders: false }
316
320
  ) {
321
+ let invalidInput = [];
322
+ if (invalidInput.length) {
323
+ const error = new Error();
324
+ error.message = "Missing required field";
325
+ error.details = invalidInput;
326
+ return Promise.reject(new FDKClientValidationError(error));
327
+ }
328
+
317
329
  const query_params = {};
318
330
  query_params["id"] = id;
319
331
 
@@ -361,6 +373,21 @@ class Cart {
361
373
  } = { requestHeaders: {} },
362
374
  { responseHeaders } = { responseHeaders: false }
363
375
  ) {
376
+ let invalidInput = [];
377
+
378
+ if (!id) {
379
+ invalidInput.push({
380
+ message: `The 'id' field is required.`,
381
+ path: ["id"],
382
+ });
383
+ }
384
+ if (invalidInput.length) {
385
+ const error = new Error();
386
+ error.message = "Missing required field";
387
+ error.details = invalidInput;
388
+ return Promise.reject(new FDKClientValidationError(error));
389
+ }
390
+
364
391
  const query_params = {};
365
392
  query_params["cart_id"] = cartId;
366
393
  query_params["buy_now"] = buyNow;
@@ -395,7 +422,7 @@ class Cart {
395
422
  /**
396
423
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
397
424
  * @param {import("../ApplicationAPIClient").Options} - Options
398
- * @returns {Promise<GetAddressesResult>} - Success response
425
+ * @returns {Promise<GetAddressesResponse>} - Success response
399
426
  * @name getAddresses
400
427
  * @summary: Get a list of addresses for a customer
401
428
  * @description: List all addresses saved by the customer, simplifying the checkout process by offering pre-saved address options for delivery. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getAddresses/).
@@ -412,6 +439,14 @@ class Cart {
412
439
  } = { requestHeaders: {} },
413
440
  { responseHeaders } = { responseHeaders: false }
414
441
  ) {
442
+ let invalidInput = [];
443
+ if (invalidInput.length) {
444
+ const error = new Error();
445
+ error.message = "Missing required field";
446
+ error.details = invalidInput;
447
+ return Promise.reject(new FDKClientValidationError(error));
448
+ }
449
+
415
450
  const query_params = {};
416
451
  query_params["cart_id"] = cartId;
417
452
  query_params["buy_now"] = buyNow;
@@ -446,7 +481,7 @@ class Cart {
446
481
  /**
447
482
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
448
483
  * @param {import("../ApplicationAPIClient").Options} - Options
449
- * @returns {Promise<BulkPriceResult>} - Success response
484
+ * @returns {Promise<BulkPriceResponse>} - Success response
450
485
  * @name getBulkDiscountOffers
451
486
  * @summary: List bulk discounts
452
487
  * @description: List offer discounts with information about quantity and seller. One offer is marked with a "best" flag, indicating it as the best offer among the list. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getBulkDiscountOffers/).
@@ -455,6 +490,14 @@ class Cart {
455
490
  { itemId, articleId, uid, slug, requestHeaders } = { requestHeaders: {} },
456
491
  { responseHeaders } = { responseHeaders: false }
457
492
  ) {
493
+ let invalidInput = [];
494
+ if (invalidInput.length) {
495
+ const error = new Error();
496
+ error.message = "Missing required field";
497
+ error.details = invalidInput;
498
+ return Promise.reject(new FDKClientValidationError(error));
499
+ }
500
+
458
501
  const query_params = {};
459
502
  query_params["item_id"] = itemId;
460
503
  query_params["article_id"] = articleId;
@@ -487,7 +530,7 @@ class Cart {
487
530
  /**
488
531
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
489
532
  * @param {import("../ApplicationAPIClient").Options} - Options
490
- * @returns {Promise<CartDetailResult>} - Success response
533
+ * @returns {Promise<CartDetailResponse>} - Success response
491
534
  * @name getCart
492
535
  * @summary: Get a cart
493
536
  * @description: Get details of a cart linked to a specific customer using a unique cart ID. It offers an overview of the items, quantities, prices, and other relevant information associated with the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getCart/).
@@ -506,6 +549,14 @@ class Cart {
506
549
  } = { requestHeaders: {} },
507
550
  { responseHeaders } = { responseHeaders: false }
508
551
  ) {
552
+ let invalidInput = [];
553
+ if (invalidInput.length) {
554
+ const error = new Error();
555
+ error.message = "Missing required field";
556
+ error.details = invalidInput;
557
+ return Promise.reject(new FDKClientValidationError(error));
558
+ }
559
+
509
560
  const query_params = {};
510
561
  query_params["id"] = id;
511
562
  query_params["i"] = i;
@@ -551,6 +602,14 @@ class Cart {
551
602
  { id, requestHeaders } = { requestHeaders: {} },
552
603
  { responseHeaders } = { responseHeaders: false }
553
604
  ) {
605
+ let invalidInput = [];
606
+ if (invalidInput.length) {
607
+ const error = new Error();
608
+ error.message = "Missing required field";
609
+ error.details = invalidInput;
610
+ return Promise.reject(new FDKClientValidationError(error));
611
+ }
612
+
554
613
  const query_params = {};
555
614
  query_params["id"] = id;
556
615
 
@@ -580,7 +639,7 @@ class Cart {
580
639
  /**
581
640
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
582
641
  * @param {import("../ApplicationAPIClient").Options} - Options
583
- * @returns {Promise<GetShareCartLinkResult>} - Success response
642
+ * @returns {Promise<GetShareCartLinkResponse>} - Success response
584
643
  * @name getCartShareLink
585
644
  * @summary: Create share cart link
586
645
  * @description: Generate a unique shareable link for the customer's cart for a specific sales channel. This link enables easy sharing of the cart contents with other users, facilitating collaborative shopping experiences. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getCartShareLink/).
@@ -589,6 +648,14 @@ class Cart {
589
648
  { body, requestHeaders } = { requestHeaders: {} },
590
649
  { responseHeaders } = { responseHeaders: false }
591
650
  ) {
651
+ let invalidInput = [];
652
+ if (invalidInput.length) {
653
+ const error = new Error();
654
+ error.message = "Missing required field";
655
+ error.details = invalidInput;
656
+ return Promise.reject(new FDKClientValidationError(error));
657
+ }
658
+
592
659
  const query_params = {};
593
660
 
594
661
  const xHeaders = {};
@@ -617,7 +684,7 @@ class Cart {
617
684
  /**
618
685
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
619
686
  * @param {import("../ApplicationAPIClient").Options} - Options
620
- * @returns {Promise<SharedCartResult>} - Success response
687
+ * @returns {Promise<SharedCartResponse>} - Success response
621
688
  * @name getCartSharedItems
622
689
  * @summary: List shared cart items
623
690
  * @description: Get cart items from the shared cart link based on unique token. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getCartSharedItems/).
@@ -626,6 +693,21 @@ class Cart {
626
693
  { token, requestHeaders } = { requestHeaders: {} },
627
694
  { responseHeaders } = { responseHeaders: false }
628
695
  ) {
696
+ let invalidInput = [];
697
+
698
+ if (!token) {
699
+ invalidInput.push({
700
+ message: `The 'token' field is required.`,
701
+ path: ["token"],
702
+ });
703
+ }
704
+ if (invalidInput.length) {
705
+ const error = new Error();
706
+ error.message = "Missing required field";
707
+ error.details = invalidInput;
708
+ return Promise.reject(new FDKClientValidationError(error));
709
+ }
710
+
629
711
  const query_params = {};
630
712
 
631
713
  const xHeaders = {};
@@ -654,7 +736,7 @@ class Cart {
654
736
  /**
655
737
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
656
738
  * @param {import("../ApplicationAPIClient").Options} - Options
657
- * @returns {Promise<GetCouponResult>} - Success response
739
+ * @returns {Promise<GetCouponResponse>} - Success response
658
740
  * @name getCoupons
659
741
  * @summary: List available coupons
660
742
  * @description: List all available coupons that customer can apply to their carts. It provides details about each coupon, including its code, discount amount, and applicable conditions. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getCoupons/).
@@ -663,6 +745,14 @@ class Cart {
663
745
  { id, buyNow, slug, storeId, requestHeaders } = { requestHeaders: {} },
664
746
  { responseHeaders } = { responseHeaders: false }
665
747
  ) {
748
+ let invalidInput = [];
749
+ if (invalidInput.length) {
750
+ const error = new Error();
751
+ error.message = "Missing required field";
752
+ error.details = invalidInput;
753
+ return Promise.reject(new FDKClientValidationError(error));
754
+ }
755
+
666
756
  const query_params = {};
667
757
  query_params["id"] = id;
668
758
  query_params["buy_now"] = buyNow;
@@ -695,7 +785,7 @@ class Cart {
695
785
  /**
696
786
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
697
787
  * @param {import("../ApplicationAPIClient").Options} - Options
698
- * @returns {Promise<CartItemCountResult>} - Success response
788
+ * @returns {Promise<CartItemCountResponse>} - Success response
699
789
  * @name getItemCount
700
790
  * @summary: Get a cart items count
701
791
  * @description: Get total count of items currently present in the customer's cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getItemCount/).
@@ -704,6 +794,14 @@ class Cart {
704
794
  { id, buyNow, requestHeaders } = { requestHeaders: {} },
705
795
  { responseHeaders } = { responseHeaders: false }
706
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
+
707
805
  const query_params = {};
708
806
  query_params["id"] = id;
709
807
  query_params["buy_now"] = buyNow;
@@ -745,6 +843,21 @@ class Cart {
745
843
  },
746
844
  { responseHeaders } = { responseHeaders: false }
747
845
  ) {
846
+ let invalidInput = [];
847
+
848
+ if (!slug) {
849
+ invalidInput.push({
850
+ message: `The 'slug' field is required.`,
851
+ path: ["slug"],
852
+ });
853
+ }
854
+ if (invalidInput.length) {
855
+ const error = new Error();
856
+ error.message = "Missing required field";
857
+ error.details = invalidInput;
858
+ return Promise.reject(new FDKClientValidationError(error));
859
+ }
860
+
748
861
  const query_params = {};
749
862
  query_params["slug"] = slug;
750
863
  query_params["store_id"] = storeId;
@@ -777,30 +890,31 @@ class Cart {
777
890
  /**
778
891
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
779
892
  * @param {import("../ApplicationAPIClient").Options} - Options
780
- * @returns {Promise<PromotionOffersResult>} - Success response
893
+ * @returns {Promise<PromotionOffersResponse>} - Success response
781
894
  * @name getPromotionOffers
782
895
  * @summary: List available promotion offers
783
896
  * @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
897
  */
785
898
  async getPromotionOffers(
786
- {
787
- slug,
788
- pageSize,
789
- promotionGroup,
790
- storeId,
791
- cartType,
792
- sortBy,
793
- requestHeaders,
794
- } = { requestHeaders: {} },
899
+ { slug, pageSize, promotionGroup, storeId, cartType, requestHeaders } = {
900
+ requestHeaders: {},
901
+ },
795
902
  { responseHeaders } = { responseHeaders: false }
796
903
  ) {
904
+ let invalidInput = [];
905
+ if (invalidInput.length) {
906
+ const error = new Error();
907
+ error.message = "Missing required field";
908
+ error.details = invalidInput;
909
+ return Promise.reject(new FDKClientValidationError(error));
910
+ }
911
+
797
912
  const query_params = {};
798
913
  query_params["slug"] = slug;
799
914
  query_params["page_size"] = pageSize;
800
915
  query_params["promotion_group"] = promotionGroup;
801
916
  query_params["store_id"] = storeId;
802
917
  query_params["cart_type"] = cartType;
803
- query_params["sort_by"] = sortBy;
804
918
 
805
919
  const xHeaders = {};
806
920
 
@@ -828,7 +942,7 @@ class Cart {
828
942
  /**
829
943
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
830
944
  * @param {import("../ApplicationAPIClient").Options} - Options
831
- * @returns {Promise<PromotionPaymentOffersResult>} - Success response
945
+ * @returns {Promise<PromotionPaymentOffersResponse>} - Success response
832
946
  * @name getPromotionPaymentOffers
833
947
  * @summary: Fetch available promotions payment offers
834
948
  * @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/).
@@ -837,6 +951,14 @@ class Cart {
837
951
  { id, uid, requestHeaders } = { requestHeaders: {} },
838
952
  { responseHeaders } = { responseHeaders: false }
839
953
  ) {
954
+ let invalidInput = [];
955
+ if (invalidInput.length) {
956
+ const error = new Error();
957
+ error.message = "Missing required field";
958
+ error.details = invalidInput;
959
+ return Promise.reject(new FDKClientValidationError(error));
960
+ }
961
+
840
962
  const query_params = {};
841
963
  query_params["id"] = id;
842
964
  query_params["uid"] = uid;
@@ -867,46 +989,7 @@ class Cart {
867
989
  /**
868
990
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
869
991
  * @param {import("../ApplicationAPIClient").Options} - Options
870
- * @returns {Promise<Promotions>} - Success response
871
- * @name getPromotions
872
- * @summary: List all available promotions of the sales channel
873
- * @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/).
874
- */
875
- async getPromotions(
876
- { pageSize, pageNo, requestHeaders } = { requestHeaders: {} },
877
- { responseHeaders } = { responseHeaders: false }
878
- ) {
879
- const query_params = {};
880
- query_params["page_size"] = pageSize;
881
- query_params["page_no"] = pageNo;
882
-
883
- const xHeaders = {};
884
-
885
- const response = await ApplicationAPIClient.execute(
886
- this._conf,
887
- "get",
888
- constructUrl({
889
- url: this._urls["getPromotions"],
890
- params: {},
891
- }),
892
- query_params,
893
- undefined,
894
- { ...xHeaders, ...requestHeaders },
895
- { responseHeaders }
896
- );
897
-
898
- let responseData = response;
899
- if (responseHeaders) {
900
- responseData = response[0];
901
- }
902
-
903
- return response;
904
- }
905
-
906
- /**
907
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
908
- * @param {import("../ApplicationAPIClient").Options} - Options
909
- * @returns {Promise<CartShipmentsResult>} - Success response
992
+ * @returns {Promise<CartShipmentsResponse>} - Success response
910
993
  * @name getShipments
911
994
  * @summary: List shipments
912
995
  * @description: Get shipment details for the items in a cart, specific to the selected address. Shipment details include delivery promises, seller information, item details, and other relevant information. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getShipments/).
@@ -917,6 +1000,14 @@ class Cart {
917
1000
  },
918
1001
  { responseHeaders } = { responseHeaders: false }
919
1002
  ) {
1003
+ let invalidInput = [];
1004
+ if (invalidInput.length) {
1005
+ const error = new Error();
1006
+ error.message = "Missing required field";
1007
+ error.details = invalidInput;
1008
+ return Promise.reject(new FDKClientValidationError(error));
1009
+ }
1010
+
920
1011
  const query_params = {};
921
1012
  query_params["p"] = p;
922
1013
  query_params["id"] = id;
@@ -951,7 +1042,7 @@ class Cart {
951
1042
  /**
952
1043
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
953
1044
  * @param {import("../ApplicationAPIClient").Options} - Options
954
- * @returns {Promise<DeleteAddressResult>} - Success response
1045
+ * @returns {Promise<DeleteAddressResponse>} - Success response
955
1046
  * @name removeAddress
956
1047
  * @summary: Removes an address from a customer's address list
957
1048
  * @description: Delete an existing customer address from the system. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/removeAddress/).
@@ -960,6 +1051,21 @@ class Cart {
960
1051
  { id, requestHeaders } = { requestHeaders: {} },
961
1052
  { responseHeaders } = { responseHeaders: false }
962
1053
  ) {
1054
+ let invalidInput = [];
1055
+
1056
+ if (!id) {
1057
+ invalidInput.push({
1058
+ message: `The 'id' field is required.`,
1059
+ path: ["id"],
1060
+ });
1061
+ }
1062
+ if (invalidInput.length) {
1063
+ const error = new Error();
1064
+ error.message = "Missing required field";
1065
+ error.details = invalidInput;
1066
+ return Promise.reject(new FDKClientValidationError(error));
1067
+ }
1068
+
963
1069
  const query_params = {};
964
1070
 
965
1071
  const xHeaders = {};
@@ -988,7 +1094,7 @@ class Cart {
988
1094
  /**
989
1095
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
990
1096
  * @param {import("../ApplicationAPIClient").Options} - Options
991
- * @returns {Promise<CartDetailResult>} - Success response
1097
+ * @returns {Promise<CartDetailResponse>} - Success response
992
1098
  * @name removeCoupon
993
1099
  * @summary: Remove coupon
994
1100
  * @description: Remove an applied coupon from the customer's cart, thereby removing the associated discount from the cart total. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/removeCoupon/).
@@ -997,6 +1103,14 @@ class Cart {
997
1103
  { id, buyNow, requestHeaders } = { requestHeaders: {} },
998
1104
  { responseHeaders } = { responseHeaders: false }
999
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
+
1000
1114
  const query_params = {};
1001
1115
  query_params["id"] = id;
1002
1116
  query_params["buy_now"] = buyNow;
@@ -1027,7 +1141,7 @@ class Cart {
1027
1141
  /**
1028
1142
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1029
1143
  * @param {import("../ApplicationAPIClient").Options} - Options
1030
- * @returns {Promise<CartDetailResult>} - Success response
1144
+ * @returns {Promise<CartDetailResponse>} - Success response
1031
1145
  * @name selectAddress
1032
1146
  * @summary: Select customer address for order processing
1033
1147
  * @description: Select an address from the saved customer addresses and validates the availability of items in the cart. Additionally, it verifies and updates the delivery promise based on the selected address. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/selectAddress/).
@@ -1036,6 +1150,14 @@ class Cart {
1036
1150
  { body, cartId, buyNow, i, b, requestHeaders } = { requestHeaders: {} },
1037
1151
  { responseHeaders } = { responseHeaders: false }
1038
1152
  ) {
1153
+ let invalidInput = [];
1154
+ if (invalidInput.length) {
1155
+ const error = new Error();
1156
+ error.message = "Missing required field";
1157
+ error.details = invalidInput;
1158
+ return Promise.reject(new FDKClientValidationError(error));
1159
+ }
1160
+
1039
1161
  const query_params = {};
1040
1162
  query_params["cart_id"] = cartId;
1041
1163
  query_params["buy_now"] = buyNow;
@@ -1068,7 +1190,7 @@ class Cart {
1068
1190
  /**
1069
1191
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1070
1192
  * @param {import("../ApplicationAPIClient").Options} - Options
1071
- * @returns {Promise<CartDetailResult>} - Success response
1193
+ * @returns {Promise<CartDetailResponse>} - Success response
1072
1194
  * @name selectPaymentMode
1073
1195
  * @summary: Select payment mode
1074
1196
  * @description: Select a preferred payment mode from available options during the cart checkout process to securely and efficiently complete their transaction. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/selectPaymentMode/).
@@ -1077,6 +1199,14 @@ class Cart {
1077
1199
  { body, id, buyNow, requestHeaders } = { requestHeaders: {} },
1078
1200
  { responseHeaders } = { responseHeaders: false }
1079
1201
  ) {
1202
+ let invalidInput = [];
1203
+ if (invalidInput.length) {
1204
+ const error = new Error();
1205
+ error.message = "Missing required field";
1206
+ error.details = invalidInput;
1207
+ return Promise.reject(new FDKClientValidationError(error));
1208
+ }
1209
+
1080
1210
  const query_params = {};
1081
1211
  query_params["id"] = id;
1082
1212
  query_params["buy_now"] = buyNow;
@@ -1107,7 +1237,7 @@ class Cart {
1107
1237
  /**
1108
1238
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1109
1239
  * @param {import("../ApplicationAPIClient").Options} - Options
1110
- * @returns {Promise<UpdateAddressResult>} - Success response
1240
+ * @returns {Promise<UpdateAddressResponse>} - Success response
1111
1241
  * @name updateAddress
1112
1242
  * @summary: Updates an existing customer address
1113
1243
  * @description: Customer can modify the details of a previously saved addresses. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateAddress/).
@@ -1116,6 +1246,21 @@ class Cart {
1116
1246
  { id, body, requestHeaders } = { requestHeaders: {} },
1117
1247
  { responseHeaders } = { responseHeaders: false }
1118
1248
  ) {
1249
+ let invalidInput = [];
1250
+
1251
+ if (!id) {
1252
+ invalidInput.push({
1253
+ message: `The 'id' field is required.`,
1254
+ path: ["id"],
1255
+ });
1256
+ }
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
+
1119
1264
  const query_params = {};
1120
1265
 
1121
1266
  const xHeaders = {};
@@ -1144,7 +1289,7 @@ class Cart {
1144
1289
  /**
1145
1290
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1146
1291
  * @param {import("../ApplicationAPIClient").Options} - Options
1147
- * @returns {Promise<UpdateCartDetailResult>} - Success response
1292
+ * @returns {Promise<UpdateCartDetailResponse>} - Success response
1148
1293
  * @name updateCart
1149
1294
  * @summary: Update cart items
1150
1295
  * @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/).
@@ -1163,6 +1308,14 @@ class Cart {
1163
1308
  } = { requestHeaders: {} },
1164
1309
  { responseHeaders } = { responseHeaders: false }
1165
1310
  ) {
1311
+ let invalidInput = [];
1312
+ if (invalidInput.length) {
1313
+ const error = new Error();
1314
+ error.message = "Missing required field";
1315
+ error.details = invalidInput;
1316
+ return Promise.reject(new FDKClientValidationError(error));
1317
+ }
1318
+
1166
1319
  const query_params = {};
1167
1320
  query_params["id"] = id;
1168
1321
  query_params["i"] = i;
@@ -1198,7 +1351,7 @@ class Cart {
1198
1351
  /**
1199
1352
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1200
1353
  * @param {import("../ApplicationAPIClient").Options} - Options
1201
- * @returns {Promise<CartMetaResult>} - Success response
1354
+ * @returns {Promise<CartMetaResponse>} - Success response
1202
1355
  * @name updateCartMeta
1203
1356
  * @summary: Update cart metadata
1204
1357
  * @description: Update metadata associated with a cart, which includes customer preferences, delivery instructions, or any special requirements related to the cart items. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateCartMeta/).
@@ -1207,6 +1360,14 @@ class Cart {
1207
1360
  { body, id, buyNow, requestHeaders } = { requestHeaders: {} },
1208
1361
  { responseHeaders } = { responseHeaders: false }
1209
1362
  ) {
1363
+ let invalidInput = [];
1364
+ if (invalidInput.length) {
1365
+ const error = new Error();
1366
+ error.message = "Missing required field";
1367
+ error.details = invalidInput;
1368
+ return Promise.reject(new FDKClientValidationError(error));
1369
+ }
1370
+
1210
1371
  const query_params = {};
1211
1372
  query_params["id"] = id;
1212
1373
  query_params["buy_now"] = buyNow;
@@ -1237,7 +1398,7 @@ class Cart {
1237
1398
  /**
1238
1399
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1239
1400
  * @param {import("../ApplicationAPIClient").Options} - Options
1240
- * @returns {Promise<SharedCartResult>} - Success response
1401
+ * @returns {Promise<SharedCartResponse>} - Success response
1241
1402
  * @name updateCartWithSharedItems
1242
1403
  * @summary: Update with shared items
1243
1404
  * @description: Merge or replace shared cart items with existing cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateCartWithSharedItems/).
@@ -1246,6 +1407,27 @@ class Cart {
1246
1407
  { token, action, requestHeaders } = { requestHeaders: {} },
1247
1408
  { responseHeaders } = { responseHeaders: false }
1248
1409
  ) {
1410
+ let invalidInput = [];
1411
+
1412
+ if (!token) {
1413
+ invalidInput.push({
1414
+ message: `The 'token' field is required.`,
1415
+ path: ["token"],
1416
+ });
1417
+ }
1418
+ if (!action) {
1419
+ invalidInput.push({
1420
+ message: `The 'action' field is required.`,
1421
+ path: ["action"],
1422
+ });
1423
+ }
1424
+ if (invalidInput.length) {
1425
+ const error = new Error();
1426
+ error.message = "Missing required field";
1427
+ error.details = invalidInput;
1428
+ return Promise.reject(new FDKClientValidationError(error));
1429
+ }
1430
+
1249
1431
  const query_params = {};
1250
1432
 
1251
1433
  const xHeaders = {};
@@ -1297,6 +1479,14 @@ class Cart {
1297
1479
  } = { requestHeaders: {} },
1298
1480
  { responseHeaders } = { responseHeaders: false }
1299
1481
  ) {
1482
+ let invalidInput = [];
1483
+ if (invalidInput.length) {
1484
+ const error = new Error();
1485
+ error.message = "Missing required field";
1486
+ error.details = invalidInput;
1487
+ return Promise.reject(new FDKClientValidationError(error));
1488
+ }
1489
+
1300
1490
  const query_params = {};
1301
1491
  query_params["id"] = id;
1302
1492
  query_params["buy_now"] = buyNow;