@gofynd/fdk-client-javascript 1.2.0 → 1.3.1-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 (262) hide show
  1. package/README.md +44 -7
  2. package/package.json +1 -2
  3. package/sdk/application/ApplicationAPIClient.d.ts +3 -3
  4. package/sdk/application/ApplicationAPIClient.js +6 -4
  5. package/sdk/application/ApplicationClient.d.ts +2 -3
  6. package/sdk/application/ApplicationClient.js +1 -45
  7. package/sdk/application/ApplicationConfig.d.ts +46 -6
  8. package/sdk/application/ApplicationConfig.js +15 -16
  9. package/sdk/application/Cart/CartApplicationClient.d.ts +61 -33
  10. package/sdk/application/Cart/CartApplicationClient.js +225 -134
  11. package/sdk/application/Cart/CartApplicationModel.d.ts +6 -4
  12. package/sdk/application/Cart/CartApplicationModel.js +6 -4
  13. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +61 -30
  14. package/sdk/application/Catalog/CatalogApplicationClient.js +234 -146
  15. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +115 -13
  16. package/sdk/application/Catalog/CatalogApplicationModel.js +77 -12
  17. package/sdk/application/Common/CommonApplicationClient.d.ts +5 -3
  18. package/sdk/application/Common/CommonApplicationClient.js +13 -11
  19. package/sdk/application/Common/CommonApplicationModel.d.ts +3 -83
  20. package/sdk/application/Common/CommonApplicationModel.js +2 -58
  21. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +9 -3
  22. package/sdk/application/Communication/CommunicationApplicationClient.js +25 -13
  23. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +1 -34
  24. package/sdk/application/Communication/CommunicationApplicationModel.js +0 -36
  25. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +46 -16
  26. package/sdk/application/Configuration/ConfigurationApplicationClient.js +144 -68
  27. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +1 -219
  28. package/sdk/application/Configuration/ConfigurationApplicationModel.js +0 -226
  29. package/sdk/application/Content/ContentApplicationClient.d.ts +49 -21
  30. package/sdk/application/Content/ContentApplicationClient.js +159 -80
  31. package/sdk/application/Content/ContentApplicationModel.d.ts +5 -622
  32. package/sdk/application/Content/ContentApplicationModel.js +11 -763
  33. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +6 -3
  34. package/sdk/application/FileStorage/FileStorageApplicationClient.js +20 -14
  35. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +1 -152
  36. package/sdk/application/FileStorage/FileStorageApplicationModel.js +0 -180
  37. package/sdk/application/Lead/LeadApplicationClient.d.ts +14 -7
  38. package/sdk/application/Lead/LeadApplicationClient.js +50 -31
  39. package/sdk/application/Lead/LeadApplicationModel.d.ts +22 -741
  40. package/sdk/application/Lead/LeadApplicationModel.js +21 -481
  41. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +11 -5
  42. package/sdk/application/Logistic/LogisticApplicationClient.js +41 -20
  43. package/sdk/application/Order/OrderApplicationClient.d.ts +24 -12
  44. package/sdk/application/Order/OrderApplicationClient.js +88 -56
  45. package/sdk/application/Payment/PaymentApplicationClient.d.ts +91 -42
  46. package/sdk/application/Payment/PaymentApplicationClient.js +293 -194
  47. package/sdk/application/Payment/PaymentApplicationModel.d.ts +36 -36
  48. package/sdk/application/Payment/PaymentApplicationModel.js +36 -36
  49. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +59 -32
  50. package/sdk/application/PosCart/PosCartApplicationClient.js +214 -130
  51. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +2 -2
  52. package/sdk/application/PosCart/PosCartApplicationModel.js +2 -2
  53. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +16 -7
  54. package/sdk/application/Rewards/RewardsApplicationClient.js +56 -29
  55. package/sdk/application/Share/ShareApplicationClient.d.ts +15 -7
  56. package/sdk/application/Share/ShareApplicationClient.js +51 -31
  57. package/sdk/application/Share/ShareApplicationModel.d.ts +1 -33
  58. package/sdk/application/Share/ShareApplicationModel.js +0 -38
  59. package/sdk/application/Theme/ThemeApplicationClient.d.ts +9 -4
  60. package/sdk/application/Theme/ThemeApplicationClient.js +35 -18
  61. package/sdk/application/Theme/ThemeApplicationModel.d.ts +982 -312
  62. package/sdk/application/Theme/ThemeApplicationModel.js +621 -284
  63. package/sdk/application/User/UserApplicationClient.d.ts +74 -35
  64. package/sdk/application/User/UserApplicationClient.js +252 -161
  65. package/sdk/application/User/UserApplicationModel.d.ts +3 -401
  66. package/sdk/application/User/UserApplicationModel.js +2 -490
  67. package/sdk/common/AxiosHelper.js +1 -2
  68. package/sdk/common/FDKError.d.ts +3 -0
  69. package/sdk/common/FDKError.js +8 -0
  70. package/sdk/common/utils.d.ts +3 -0
  71. package/sdk/common/utils.js +29 -0
  72. package/sdk/partner/PartnerAPIClient.d.ts +5 -4
  73. package/sdk/partner/PartnerAPIClient.js +7 -4
  74. package/sdk/partner/PartnerClient.d.ts +2 -0
  75. package/sdk/partner/PartnerClient.js +3 -0
  76. package/sdk/partner/Theme/ThemePartnerClient.d.ts +299 -0
  77. package/sdk/partner/Theme/ThemePartnerClient.js +768 -0
  78. package/sdk/partner/Theme/ThemePartnerModel.d.ts +1706 -0
  79. package/sdk/partner/Theme/ThemePartnerModel.js +1409 -0
  80. package/sdk/partner/Theme/ThemePartnerValidator.d.ts +22 -0
  81. package/sdk/partner/Theme/ThemePartnerValidator.js +157 -0
  82. package/sdk/partner/index.d.ts +3 -1
  83. package/sdk/partner/index.js +3 -1
  84. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
  85. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +38 -16
  86. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +1 -13
  87. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +0 -12
  88. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +10 -0
  89. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +4 -0
  90. package/sdk/platform/Billing/BillingPlatformClient.d.ts +59 -14
  91. package/sdk/platform/Billing/BillingPlatformClient.js +315 -64
  92. package/sdk/platform/Billing/BillingPlatformModel.d.ts +56 -196
  93. package/sdk/platform/Billing/BillingPlatformModel.js +63 -217
  94. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +23 -1
  95. package/sdk/platform/Billing/BillingPlatformValidator.js +31 -0
  96. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +124 -63
  97. package/sdk/platform/Cart/CartPlatformApplicationClient.js +431 -265
  98. package/sdk/platform/Cart/CartPlatformModel.d.ts +253 -53
  99. package/sdk/platform/Cart/CartPlatformModel.js +104 -54
  100. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +120 -53
  101. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +398 -247
  102. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +155 -78
  103. package/sdk/platform/Catalog/CatalogPlatformClient.js +561 -355
  104. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +10 -12
  105. package/sdk/platform/Catalog/CatalogPlatformModel.js +10 -12
  106. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +30 -0
  107. package/sdk/platform/Catalog/CatalogPlatformValidator.js +13 -0
  108. package/sdk/platform/Common/CommonPlatformClient.d.ts +5 -3
  109. package/sdk/platform/Common/CommonPlatformClient.js +13 -11
  110. package/sdk/platform/Common/CommonPlatformModel.d.ts +39 -64
  111. package/sdk/platform/Common/CommonPlatformModel.js +23 -57
  112. package/sdk/platform/Common/CommonPlatformValidator.d.ts +5 -10
  113. package/sdk/platform/Common/CommonPlatformValidator.js +3 -4
  114. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +370 -120
  115. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +2328 -888
  116. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +143 -24
  117. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +179 -15
  118. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
  119. package/sdk/platform/Communication/CommunicationPlatformClient.js +6 -5
  120. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +386 -308
  121. package/sdk/platform/Communication/CommunicationPlatformModel.js +415 -355
  122. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +38 -13
  123. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +171 -57
  124. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +53 -1
  125. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +54 -0
  126. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +5 -1
  127. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +7 -0
  128. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +96 -29
  129. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +311 -126
  130. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +5 -1
  131. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +7 -0
  132. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
  133. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +121 -86
  134. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +13 -180
  135. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +5 -113
  136. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +162 -70
  137. package/sdk/platform/Content/ContentPlatformApplicationClient.js +528 -309
  138. package/sdk/platform/Content/ContentPlatformModel.d.ts +9 -198
  139. package/sdk/platform/Content/ContentPlatformModel.js +8 -231
  140. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +48 -11
  141. package/sdk/platform/Discount/DiscountPlatformClient.js +142 -48
  142. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +40 -1
  143. package/sdk/platform/Discount/DiscountPlatformModel.js +27 -0
  144. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +84 -18
  145. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +486 -53
  146. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +71 -7
  147. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +81 -5
  148. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +13 -18
  149. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +58 -65
  150. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +198 -71
  151. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +212 -64
  152. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +18 -10
  153. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -6
  154. package/sdk/platform/Finance/FinancePlatformClient.d.ts +177 -40
  155. package/sdk/platform/Finance/FinancePlatformClient.js +1028 -132
  156. package/sdk/platform/Finance/FinancePlatformModel.d.ts +670 -22
  157. package/sdk/platform/Finance/FinancePlatformModel.js +809 -23
  158. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +111 -1
  159. package/sdk/platform/Finance/FinancePlatformValidator.js +134 -0
  160. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +24 -12
  161. package/sdk/platform/Inventory/InventoryPlatformClient.js +94 -52
  162. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +27 -13
  163. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +101 -55
  164. package/sdk/platform/Lead/LeadPlatformClient.d.ts +50 -39
  165. package/sdk/platform/Lead/LeadPlatformClient.js +171 -112
  166. package/sdk/platform/Lead/LeadPlatformModel.d.ts +32 -390
  167. package/sdk/platform/Lead/LeadPlatformModel.js +31 -214
  168. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +33 -33
  169. package/sdk/platform/Lead/LeadPlatformValidator.js +23 -23
  170. package/sdk/platform/OAuthClient.js +6 -2
  171. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +4 -2
  172. package/sdk/platform/Order/OrderPlatformApplicationClient.js +12 -10
  173. package/sdk/platform/Order/OrderPlatformClient.d.ts +165 -71
  174. package/sdk/platform/Order/OrderPlatformClient.js +738 -205
  175. package/sdk/platform/Order/OrderPlatformModel.d.ts +261 -3
  176. package/sdk/platform/Order/OrderPlatformModel.js +225 -2
  177. package/sdk/platform/Order/OrderPlatformValidator.d.ts +104 -3
  178. package/sdk/platform/Order/OrderPlatformValidator.js +85 -2
  179. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -22
  180. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +12 -159
  181. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +1 -30
  182. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +0 -26
  183. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -690
  184. package/sdk/platform/Partner/PartnerPlatformModel.js +0 -809
  185. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +167 -32
  186. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +793 -145
  187. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +91 -1
  188. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +91 -0
  189. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +20 -10
  190. package/sdk/platform/Payment/PaymentPlatformClient.js +68 -47
  191. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +549 -7
  192. package/sdk/platform/Payment/PaymentPlatformModel.js +305 -6
  193. package/sdk/platform/PlatformAPIClient.d.ts +3 -3
  194. package/sdk/platform/PlatformAPIClient.js +2 -2
  195. package/sdk/platform/PlatformClient.d.ts +2 -2
  196. package/sdk/platform/PlatformClient.js +4 -4
  197. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +28 -12
  198. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +90 -53
  199. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +1 -12
  200. package/sdk/platform/Rewards/RewardsPlatformModel.js +0 -14
  201. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +62 -26
  202. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +210 -93
  203. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +20 -11
  204. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +23 -11
  205. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +36 -18
  206. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +142 -78
  207. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +12 -3
  208. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +14 -2
  209. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -26
  210. package/sdk/platform/Share/SharePlatformApplicationClient.js +36 -67
  211. package/sdk/platform/Share/SharePlatformModel.d.ts +4 -4
  212. package/sdk/platform/Share/SharePlatformModel.js +4 -4
  213. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +127 -57
  214. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +564 -189
  215. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +63 -26
  216. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +62 -22
  217. package/sdk/platform/Theme/ThemePlatformClient.d.ts +37 -0
  218. package/sdk/platform/Theme/ThemePlatformClient.js +235 -0
  219. package/sdk/platform/Theme/ThemePlatformModel.d.ts +1167 -261
  220. package/sdk/platform/Theme/ThemePlatformModel.js +801 -244
  221. package/sdk/platform/Theme/ThemePlatformValidator.d.ts +32 -0
  222. package/sdk/platform/Theme/ThemePlatformValidator.js +38 -0
  223. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +35 -17
  224. package/sdk/platform/User/UserPlatformApplicationClient.js +132 -73
  225. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +7 -0
  226. package/sdk/platform/User/UserPlatformApplicationValidator.js +3 -0
  227. package/sdk/platform/User/UserPlatformModel.d.ts +1 -738
  228. package/sdk/platform/User/UserPlatformModel.js +3 -899
  229. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +120 -7
  230. package/sdk/platform/Webhook/WebhookPlatformClient.js +799 -41
  231. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +476 -86
  232. package/sdk/platform/Webhook/WebhookPlatformModel.js +388 -89
  233. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +90 -7
  234. package/sdk/platform/Webhook/WebhookPlatformValidator.js +113 -3
  235. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +5 -3
  236. package/sdk/public/Configuration/ConfigurationPublicClient.js +13 -11
  237. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +3 -106
  238. package/sdk/public/Configuration/ConfigurationPublicModel.js +2 -59
  239. package/sdk/public/Inventory/InventoryPublicClient.d.ts +12 -6
  240. package/sdk/public/Inventory/InventoryPublicClient.js +42 -27
  241. package/sdk/public/Partner/PartnerPublicClient.d.ts +22 -0
  242. package/sdk/public/Partner/PartnerPublicClient.js +110 -0
  243. package/sdk/public/Partner/PartnerPublicModel.d.ts +240 -0
  244. package/sdk/public/Partner/PartnerPublicModel.js +280 -0
  245. package/sdk/public/Partner/PartnerPublicValidator.d.ts +18 -0
  246. package/sdk/public/Partner/PartnerPublicValidator.js +19 -0
  247. package/sdk/public/PublicAPIClient.d.ts +14 -1
  248. package/sdk/public/PublicAPIClient.js +7 -1
  249. package/sdk/public/PublicClient.d.ts +2 -0
  250. package/sdk/public/PublicClient.js +4 -0
  251. package/sdk/public/Webhook/WebhookPublicClient.d.ts +5 -2
  252. package/sdk/public/Webhook/WebhookPublicClient.js +15 -9
  253. package/sdk/public/Webhook/WebhookPublicModel.d.ts +1 -191
  254. package/sdk/public/Webhook/WebhookPublicModel.js +0 -229
  255. package/sdk/public/index.d.ts +1 -0
  256. package/sdk/public/index.js +2 -0
  257. package/sdk/application/ApplicationModels.d.ts +0 -48
  258. package/sdk/application/ApplicationModels.js +0 -38
  259. package/sdk/platform/Partner/PartnerPlatformClient.d.ts +0 -106
  260. package/sdk/platform/Partner/PartnerPlatformClient.js +0 -878
  261. package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +0 -208
  262. package/sdk/platform/Partner/PartnerPlatformValidator.js +0 -169
@@ -60,13 +60,17 @@ class Cart {
60
60
 
61
61
  /**
62
62
  * @param {CartApplicationValidator.AddAddressParam} arg - Arg object.
63
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
63
64
  * @param {import("../ApplicationAPIClient").Options} - Options
64
65
  * @returns {Promise<CartApplicationModel.SaveAddressResponse>} - Success response
65
66
  * @name addAddress
66
67
  * @summary: Add address to an account
67
68
  * @description: Use this API to add an address to an account. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/addAddress/).
68
69
  */
69
- async addAddress({ body } = {}, { headers } = { headers: false }) {
70
+ async addAddress(
71
+ { body, requestHeaders } = { requestHeaders: {} },
72
+ { responseHeaders } = { responseHeaders: false }
73
+ ) {
70
74
  const { error } = CartApplicationValidator.addAddress().validate(
71
75
  { body },
72
76
  { abortEarly: false, allowUnknown: true }
@@ -100,12 +104,12 @@ class Cart {
100
104
  }),
101
105
  query_params,
102
106
  body,
103
- xHeaders,
104
- { headers }
107
+ { ...xHeaders, ...requestHeaders },
108
+ { responseHeaders }
105
109
  );
106
110
 
107
111
  let responseData = response;
108
- if (headers) {
112
+ if (responseHeaders) {
109
113
  responseData = response[0];
110
114
  }
111
115
 
@@ -128,6 +132,7 @@ class Cart {
128
132
 
129
133
  /**
130
134
  * @param {CartApplicationValidator.AddItemsParam} arg - Arg object.
135
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
131
136
  * @param {import("../ApplicationAPIClient").Options} - Options
132
137
  * @returns {Promise<CartApplicationModel.AddCartDetailResponse>} - Success response
133
138
  * @name addItems
@@ -135,8 +140,10 @@ class Cart {
135
140
  * @description: Use this API to add items to the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/addItems/).
136
141
  */
137
142
  async addItems(
138
- { body, i, b, areaCode, buyNow, id } = {},
139
- { headers } = { headers: false }
143
+ { body, i, b, areaCode, buyNow, id, requestHeaders } = {
144
+ requestHeaders: {},
145
+ },
146
+ { responseHeaders } = { responseHeaders: false }
140
147
  ) {
141
148
  const { error } = CartApplicationValidator.addItems().validate(
142
149
  { body, i, b, areaCode, buyNow, id },
@@ -176,12 +183,12 @@ class Cart {
176
183
  }),
177
184
  query_params,
178
185
  body,
179
- xHeaders,
180
- { headers }
186
+ { ...xHeaders, ...requestHeaders },
187
+ { responseHeaders }
181
188
  );
182
189
 
183
190
  let responseData = response;
184
- if (headers) {
191
+ if (responseHeaders) {
185
192
  responseData = response[0];
186
193
  }
187
194
 
@@ -204,6 +211,7 @@ class Cart {
204
211
 
205
212
  /**
206
213
  * @param {CartApplicationValidator.ApplyCouponParam} arg - Arg object.
214
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
207
215
  * @param {import("../ApplicationAPIClient").Options} - Options
208
216
  * @returns {Promise<CartApplicationModel.CartDetailResponse>} - Success response
209
217
  * @name applyCoupon
@@ -211,8 +219,8 @@ class Cart {
211
219
  * @description: Use this API to apply coupons on items in the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/applyCoupon/).
212
220
  */
213
221
  async applyCoupon(
214
- { body, i, b, p, id, buyNow } = {},
215
- { headers } = { headers: false }
222
+ { body, i, b, p, id, buyNow, requestHeaders } = { requestHeaders: {} },
223
+ { responseHeaders } = { responseHeaders: false }
216
224
  ) {
217
225
  const { error } = CartApplicationValidator.applyCoupon().validate(
218
226
  { body, i, b, p, id, buyNow },
@@ -252,12 +260,12 @@ class Cart {
252
260
  }),
253
261
  query_params,
254
262
  body,
255
- xHeaders,
256
- { headers }
263
+ { ...xHeaders, ...requestHeaders },
264
+ { responseHeaders }
257
265
  );
258
266
 
259
267
  let responseData = response;
260
- if (headers) {
268
+ if (responseHeaders) {
261
269
  responseData = response[0];
262
270
  }
263
271
 
@@ -280,6 +288,7 @@ class Cart {
280
288
 
281
289
  /**
282
290
  * @param {CartApplicationValidator.ApplyRewardPointsParam} arg - Arg object.
291
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
283
292
  * @param {import("../ApplicationAPIClient").Options} - Options
284
293
  * @returns {Promise<CartApplicationModel.CartDetailResponse>} - Success response
285
294
  * @name applyRewardPoints
@@ -287,8 +296,8 @@ class Cart {
287
296
  * @description: Use this API to redeem a fixed no. of reward points by applying it to the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/applyRewardPoints/).
288
297
  */
289
298
  async applyRewardPoints(
290
- { body, id, i, b, buyNow } = {},
291
- { headers } = { headers: false }
299
+ { body, id, i, b, buyNow, requestHeaders } = { requestHeaders: {} },
300
+ { responseHeaders } = { responseHeaders: false }
292
301
  ) {
293
302
  const { error } = CartApplicationValidator.applyRewardPoints().validate(
294
303
  { body, id, i, b, buyNow },
@@ -329,12 +338,12 @@ class Cart {
329
338
  }),
330
339
  query_params,
331
340
  body,
332
- xHeaders,
333
- { headers }
341
+ { ...xHeaders, ...requestHeaders },
342
+ { responseHeaders }
334
343
  );
335
344
 
336
345
  let responseData = response;
337
- if (headers) {
346
+ if (responseHeaders) {
338
347
  responseData = response[0];
339
348
  }
340
349
 
@@ -357,13 +366,17 @@ class Cart {
357
366
 
358
367
  /**
359
368
  * @param {CartApplicationValidator.CheckoutCartParam} arg - Arg object.
369
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
360
370
  * @param {import("../ApplicationAPIClient").Options} - Options
361
371
  * @returns {Promise<CartApplicationModel.CartCheckoutResponse>} - Success response
362
372
  * @name checkoutCart
363
373
  * @summary: Checkout all items in the cart
364
374
  * @description: Use this API to checkout all items in the cart for payment and order generation. For COD, order will be directly generated, whereas for other checkout modes, user will be redirected to a payment gateway. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/checkoutCart/).
365
375
  */
366
- async checkoutCart({ body, buyNow } = {}, { headers } = { headers: false }) {
376
+ async checkoutCart(
377
+ { body, buyNow, requestHeaders } = { requestHeaders: {} },
378
+ { responseHeaders } = { responseHeaders: false }
379
+ ) {
367
380
  const { error } = CartApplicationValidator.checkoutCart().validate(
368
381
  { body, buyNow },
369
382
  { abortEarly: false, allowUnknown: true }
@@ -400,12 +413,12 @@ class Cart {
400
413
  }),
401
414
  query_params,
402
415
  body,
403
- xHeaders,
404
- { headers }
416
+ { ...xHeaders, ...requestHeaders },
417
+ { responseHeaders }
405
418
  );
406
419
 
407
420
  let responseData = response;
408
- if (headers) {
421
+ if (responseHeaders) {
409
422
  responseData = response[0];
410
423
  }
411
424
 
@@ -428,6 +441,7 @@ class Cart {
428
441
 
429
442
  /**
430
443
  * @param {CartApplicationValidator.CheckoutCartV2Param} arg - Arg object.
444
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
431
445
  * @param {import("../ApplicationAPIClient").Options} - Options
432
446
  * @returns {Promise<CartApplicationModel.CartCheckoutResponse>} - Success response
433
447
  * @name checkoutCartV2
@@ -435,8 +449,8 @@ class Cart {
435
449
  * @description: Use this API to checkout all items in the cart for payment and order generation. For COD, order will be directly generated, whereas for other checkout modes, user will be redirected to a payment gateway. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/checkoutCartV2/).
436
450
  */
437
451
  async checkoutCartV2(
438
- { body, buyNow } = {},
439
- { headers } = { headers: false }
452
+ { body, buyNow, requestHeaders } = { requestHeaders: {} },
453
+ { responseHeaders } = { responseHeaders: false }
440
454
  ) {
441
455
  const { error } = CartApplicationValidator.checkoutCartV2().validate(
442
456
  { body, buyNow },
@@ -474,12 +488,12 @@ class Cart {
474
488
  }),
475
489
  query_params,
476
490
  body,
477
- xHeaders,
478
- { headers }
491
+ { ...xHeaders, ...requestHeaders },
492
+ { responseHeaders }
479
493
  );
480
494
 
481
495
  let responseData = response;
482
- if (headers) {
496
+ if (responseHeaders) {
483
497
  responseData = response[0];
484
498
  }
485
499
 
@@ -502,6 +516,7 @@ class Cart {
502
516
 
503
517
  /**
504
518
  * @param {CartApplicationValidator.DeleteCartParam} arg - Arg object.
519
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
505
520
  * @param {import("../ApplicationAPIClient").Options} - Options
506
521
  * @returns {Promise<CartApplicationModel.DeleteCartDetailResponse>} -
507
522
  * Success response
@@ -509,7 +524,10 @@ class Cart {
509
524
  * @summary: Delete cart once user made successful checkout
510
525
  * @description: Use this API to delete the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/deleteCart/).
511
526
  */
512
- async deleteCart({ id } = {}, { headers } = { headers: false }) {
527
+ async deleteCart(
528
+ { id, requestHeaders } = { requestHeaders: {} },
529
+ { responseHeaders } = { responseHeaders: false }
530
+ ) {
513
531
  const { error } = CartApplicationValidator.deleteCart().validate(
514
532
  { id },
515
533
  { abortEarly: false, allowUnknown: true }
@@ -544,12 +562,12 @@ class Cart {
544
562
  }),
545
563
  query_params,
546
564
  undefined,
547
- xHeaders,
548
- { headers }
565
+ { ...xHeaders, ...requestHeaders },
566
+ { responseHeaders }
549
567
  );
550
568
 
551
569
  let responseData = response;
552
- if (headers) {
570
+ if (responseHeaders) {
553
571
  responseData = response[0];
554
572
  }
555
573
 
@@ -572,15 +590,25 @@ class Cart {
572
590
 
573
591
  /**
574
592
  * @param {CartApplicationValidator.GetAddressByIdParam} arg - Arg object.
593
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
575
594
  * @param {import("../ApplicationAPIClient").Options} - Options
576
595
  * @returns {Promise<CartApplicationModel.Address>} - Success response
577
596
  * @name getAddressById
578
597
  * @summary: Fetch a single address by its ID
579
- * @description: Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `Address`. Attibutes listed below are optional <ul> <li> <font color="monochrome">mobile_no</font></li> <li> <font color="monochrome">checkout_mode</font></li> <li> <font color="monochrome">tags</font></li> <li> <font color="monochrome">default</font></li> </ul> - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getAddressById/).
598
+ * @description: Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `Address`. Attibutes listed below are optional mobile_no checkout_mode tags default - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getAddressById/).
580
599
  */
581
600
  async getAddressById(
582
- { id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault } = {},
583
- { headers } = { headers: false }
601
+ {
602
+ id,
603
+ cartId,
604
+ buyNow,
605
+ mobileNo,
606
+ checkoutMode,
607
+ tags,
608
+ isDefault,
609
+ requestHeaders,
610
+ } = { requestHeaders: {} },
611
+ { responseHeaders } = { responseHeaders: false }
584
612
  ) {
585
613
  const { error } = CartApplicationValidator.getAddressById().validate(
586
614
  { id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
@@ -623,12 +651,12 @@ class Cart {
623
651
  }),
624
652
  query_params,
625
653
  undefined,
626
- xHeaders,
627
- { headers }
654
+ { ...xHeaders, ...requestHeaders },
655
+ { responseHeaders }
628
656
  );
629
657
 
630
658
  let responseData = response;
631
- if (headers) {
659
+ if (responseHeaders) {
632
660
  responseData = response[0];
633
661
  }
634
662
 
@@ -651,15 +679,24 @@ class Cart {
651
679
 
652
680
  /**
653
681
  * @param {CartApplicationValidator.GetAddressesParam} arg - Arg object.
682
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
654
683
  * @param {import("../ApplicationAPIClient").Options} - Options
655
684
  * @returns {Promise<CartApplicationModel.GetAddressesResponse>} - Success response
656
685
  * @name getAddresses
657
686
  * @summary: Fetch address
658
- * @description: Use this API to get all the addresses associated with an account. If successful, returns a Address resource in the response body specified in GetAddressesResponse.attibutes listed below are optional <ul> <li> <font color="monochrome">uid</font></li> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">mobile_no</font></li> <li> <font color="monochrome">checkout_mode</font></li> <li> <font color="monochrome">tags</font></li> <li> <font color="monochrome">default</font></li> </ul> - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getAddresses/).
687
+ * @description: Use this API to get all the addresses associated with an account. If successful, returns a Address resource in the response body specified in GetAddressesResponse.attibutes listed below are optional uid address_id mobile_no checkout_mode tags default - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getAddresses/).
659
688
  */
660
689
  async getAddresses(
661
- { cartId, buyNow, mobileNo, checkoutMode, tags, isDefault } = {},
662
- { headers } = { headers: false }
690
+ {
691
+ cartId,
692
+ buyNow,
693
+ mobileNo,
694
+ checkoutMode,
695
+ tags,
696
+ isDefault,
697
+ requestHeaders,
698
+ } = { requestHeaders: {} },
699
+ { responseHeaders } = { responseHeaders: false }
663
700
  ) {
664
701
  const { error } = CartApplicationValidator.getAddresses().validate(
665
702
  { cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
@@ -702,12 +739,12 @@ class Cart {
702
739
  }),
703
740
  query_params,
704
741
  undefined,
705
- xHeaders,
706
- { headers }
742
+ { ...xHeaders, ...requestHeaders },
743
+ { responseHeaders }
707
744
  );
708
745
 
709
746
  let responseData = response;
710
- if (headers) {
747
+ if (responseHeaders) {
711
748
  responseData = response[0];
712
749
  }
713
750
 
@@ -730,6 +767,7 @@ class Cart {
730
767
 
731
768
  /**
732
769
  * @param {CartApplicationValidator.GetBulkDiscountOffersParam} arg - Arg object.
770
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
733
771
  * @param {import("../ApplicationAPIClient").Options} - Options
734
772
  * @returns {Promise<CartApplicationModel.BulkPriceResponse>} - Success response
735
773
  * @name getBulkDiscountOffers
@@ -737,8 +775,8 @@ class Cart {
737
775
  * @description: Use this API to get a list of applicable offers along with current, next and best offer for given product. Either one of uid, item_id, slug should be present. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getBulkDiscountOffers/).
738
776
  */
739
777
  async getBulkDiscountOffers(
740
- { itemId, articleId, uid, slug } = {},
741
- { headers } = { headers: false }
778
+ { itemId, articleId, uid, slug, requestHeaders } = { requestHeaders: {} },
779
+ { responseHeaders } = { responseHeaders: false }
742
780
  ) {
743
781
  const { error } = CartApplicationValidator.getBulkDiscountOffers().validate(
744
782
  { itemId, articleId, uid, slug },
@@ -779,12 +817,12 @@ class Cart {
779
817
  }),
780
818
  query_params,
781
819
  undefined,
782
- xHeaders,
783
- { headers }
820
+ { ...xHeaders, ...requestHeaders },
821
+ { responseHeaders }
784
822
  );
785
823
 
786
824
  let responseData = response;
787
- if (headers) {
825
+ if (responseHeaders) {
788
826
  responseData = response[0];
789
827
  }
790
828
 
@@ -807,6 +845,7 @@ class Cart {
807
845
 
808
846
  /**
809
847
  * @param {CartApplicationValidator.GetCartParam} arg - Arg object.
848
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
810
849
  * @param {import("../ApplicationAPIClient").Options} - Options
811
850
  * @returns {Promise<CartApplicationModel.CartDetailResponse>} - Success response
812
851
  * @name getCart
@@ -814,8 +853,10 @@ class Cart {
814
853
  * @description: Use this API to get details of all the items added to a cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getCart/).
815
854
  */
816
855
  async getCart(
817
- { id, i, b, assignCardId, areaCode, buyNow } = {},
818
- { headers } = { headers: false }
856
+ { id, i, b, assignCardId, areaCode, buyNow, requestHeaders } = {
857
+ requestHeaders: {},
858
+ },
859
+ { responseHeaders } = { responseHeaders: false }
819
860
  ) {
820
861
  const { error } = CartApplicationValidator.getCart().validate(
821
862
  { id, i, b, assignCardId, areaCode, buyNow },
@@ -856,12 +897,12 @@ class Cart {
856
897
  }),
857
898
  query_params,
858
899
  undefined,
859
- xHeaders,
860
- { headers }
900
+ { ...xHeaders, ...requestHeaders },
901
+ { responseHeaders }
861
902
  );
862
903
 
863
904
  let responseData = response;
864
- if (headers) {
905
+ if (responseHeaders) {
865
906
  responseData = response[0];
866
907
  }
867
908
 
@@ -884,13 +925,17 @@ class Cart {
884
925
 
885
926
  /**
886
927
  * @param {CartApplicationValidator.GetCartLastModifiedParam} arg - Arg object.
928
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
887
929
  * @param {import("../ApplicationAPIClient").Options} - Options
888
930
  * @returns {Promise<any>} - Success response
889
931
  * @name getCartLastModified
890
932
  * @summary: Fetch last-modified timestamp
891
933
  * @description: Use this API to fetch Last-Modified timestamp in header metadata. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getCartLastModified/).
892
934
  */
893
- async getCartLastModified({ id } = {}, { headers } = { headers: false }) {
935
+ async getCartLastModified(
936
+ { id, requestHeaders } = { requestHeaders: {} },
937
+ { responseHeaders } = { responseHeaders: false }
938
+ ) {
894
939
  const { error } = CartApplicationValidator.getCartLastModified().validate(
895
940
  { id },
896
941
  { abortEarly: false, allowUnknown: true }
@@ -927,12 +972,12 @@ class Cart {
927
972
  }),
928
973
  query_params,
929
974
  undefined,
930
- xHeaders,
931
- { headers }
975
+ { ...xHeaders, ...requestHeaders },
976
+ { responseHeaders }
932
977
  );
933
978
 
934
979
  let responseData = response;
935
- if (headers) {
980
+ if (responseHeaders) {
936
981
  responseData = response[0];
937
982
  }
938
983
 
@@ -952,6 +997,7 @@ class Cart {
952
997
 
953
998
  /**
954
999
  * @param {CartApplicationValidator.GetCartShareLinkParam} arg - Arg object.
1000
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
955
1001
  * @param {import("../ApplicationAPIClient").Options} - Options
956
1002
  * @returns {Promise<CartApplicationModel.GetShareCartLinkResponse>} -
957
1003
  * Success response
@@ -959,7 +1005,10 @@ class Cart {
959
1005
  * @summary: Generate token for sharing the cart
960
1006
  * @description: Use this API to generate a shared cart snapshot and return a shortlink token. The link can be shared with other users for getting the same items in their cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getCartShareLink/).
961
1007
  */
962
- async getCartShareLink({ body } = {}, { headers } = { headers: false }) {
1008
+ async getCartShareLink(
1009
+ { body, requestHeaders } = { requestHeaders: {} },
1010
+ { responseHeaders } = { responseHeaders: false }
1011
+ ) {
963
1012
  const { error } = CartApplicationValidator.getCartShareLink().validate(
964
1013
  { body },
965
1014
  { abortEarly: false, allowUnknown: true }
@@ -995,12 +1044,12 @@ class Cart {
995
1044
  }),
996
1045
  query_params,
997
1046
  body,
998
- xHeaders,
999
- { headers }
1047
+ { ...xHeaders, ...requestHeaders },
1048
+ { responseHeaders }
1000
1049
  );
1001
1050
 
1002
1051
  let responseData = response;
1003
- if (headers) {
1052
+ if (responseHeaders) {
1004
1053
  responseData = response[0];
1005
1054
  }
1006
1055
 
@@ -1023,13 +1072,17 @@ class Cart {
1023
1072
 
1024
1073
  /**
1025
1074
  * @param {CartApplicationValidator.GetCartSharedItemsParam} arg - Arg object.
1075
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1026
1076
  * @param {import("../ApplicationAPIClient").Options} - Options
1027
1077
  * @returns {Promise<CartApplicationModel.SharedCartResponse>} - Success response
1028
1078
  * @name getCartSharedItems
1029
1079
  * @summary: Get details of a shared cart
1030
1080
  * @description: Use this API to get the shared cart details as per the token generated using the share-cart API. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getCartSharedItems/).
1031
1081
  */
1032
- async getCartSharedItems({ token } = {}, { headers } = { headers: false }) {
1082
+ async getCartSharedItems(
1083
+ { token, requestHeaders } = { requestHeaders: {} },
1084
+ { responseHeaders } = { responseHeaders: false }
1085
+ ) {
1033
1086
  const { error } = CartApplicationValidator.getCartSharedItems().validate(
1034
1087
  { token },
1035
1088
  { abortEarly: false, allowUnknown: true }
@@ -1065,12 +1118,12 @@ class Cart {
1065
1118
  }),
1066
1119
  query_params,
1067
1120
  undefined,
1068
- xHeaders,
1069
- { headers }
1121
+ { ...xHeaders, ...requestHeaders },
1122
+ { responseHeaders }
1070
1123
  );
1071
1124
 
1072
1125
  let responseData = response;
1073
- if (headers) {
1126
+ if (responseHeaders) {
1074
1127
  responseData = response[0];
1075
1128
  }
1076
1129
 
@@ -1093,13 +1146,17 @@ class Cart {
1093
1146
 
1094
1147
  /**
1095
1148
  * @param {CartApplicationValidator.GetCouponsParam} arg - Arg object.
1149
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1096
1150
  * @param {import("../ApplicationAPIClient").Options} - Options
1097
1151
  * @returns {Promise<CartApplicationModel.GetCouponResponse>} - Success response
1098
1152
  * @name getCoupons
1099
1153
  * @summary: Fetch Coupon
1100
1154
  * @description: Use this API to get a list of available coupons along with their details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getCoupons/).
1101
1155
  */
1102
- async getCoupons({ id, buyNow } = {}, { headers } = { headers: false }) {
1156
+ async getCoupons(
1157
+ { id, buyNow, requestHeaders } = { requestHeaders: {} },
1158
+ { responseHeaders } = { responseHeaders: false }
1159
+ ) {
1103
1160
  const { error } = CartApplicationValidator.getCoupons().validate(
1104
1161
  { id, buyNow },
1105
1162
  { abortEarly: false, allowUnknown: true }
@@ -1135,12 +1192,12 @@ class Cart {
1135
1192
  }),
1136
1193
  query_params,
1137
1194
  undefined,
1138
- xHeaders,
1139
- { headers }
1195
+ { ...xHeaders, ...requestHeaders },
1196
+ { responseHeaders }
1140
1197
  );
1141
1198
 
1142
1199
  let responseData = response;
1143
- if (headers) {
1200
+ if (responseHeaders) {
1144
1201
  responseData = response[0];
1145
1202
  }
1146
1203
 
@@ -1163,13 +1220,17 @@ class Cart {
1163
1220
 
1164
1221
  /**
1165
1222
  * @param {CartApplicationValidator.GetItemCountParam} arg - Arg object.
1223
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1166
1224
  * @param {import("../ApplicationAPIClient").Options} - Options
1167
1225
  * @returns {Promise<CartApplicationModel.CartItemCountResponse>} - Success response
1168
1226
  * @name getItemCount
1169
1227
  * @summary: Count items in the cart
1170
1228
  * @description: Use this API to get the total number of items present in cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getItemCount/).
1171
1229
  */
1172
- async getItemCount({ id, buyNow } = {}, { headers } = { headers: false }) {
1230
+ async getItemCount(
1231
+ { id, buyNow, requestHeaders } = { requestHeaders: {} },
1232
+ { responseHeaders } = { responseHeaders: false }
1233
+ ) {
1173
1234
  const { error } = CartApplicationValidator.getItemCount().validate(
1174
1235
  { id, buyNow },
1175
1236
  { abortEarly: false, allowUnknown: true }
@@ -1207,12 +1268,12 @@ class Cart {
1207
1268
  }),
1208
1269
  query_params,
1209
1270
  undefined,
1210
- xHeaders,
1211
- { headers }
1271
+ { ...xHeaders, ...requestHeaders },
1272
+ { responseHeaders }
1212
1273
  );
1213
1274
 
1214
1275
  let responseData = response;
1215
- if (headers) {
1276
+ if (responseHeaders) {
1216
1277
  responseData = response[0];
1217
1278
  }
1218
1279
 
@@ -1235,6 +1296,7 @@ class Cart {
1235
1296
 
1236
1297
  /**
1237
1298
  * @param {CartApplicationValidator.GetLadderOffersParam} arg - Arg object.
1299
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1238
1300
  * @param {import("../ApplicationAPIClient").Options} - Options
1239
1301
  * @returns {Promise<CartApplicationModel.LadderPriceOffers>} - Success response
1240
1302
  * @name getLadderOffers
@@ -1242,8 +1304,10 @@ class Cart {
1242
1304
  * @description: Use this API to get applicable ladder price promotion for current product - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getLadderOffers/).
1243
1305
  */
1244
1306
  async getLadderOffers(
1245
- { slug, storeId, promotionId, pageSize } = {},
1246
- { headers } = { headers: false }
1307
+ { slug, storeId, promotionId, pageSize, requestHeaders } = {
1308
+ requestHeaders: {},
1309
+ },
1310
+ { responseHeaders } = { responseHeaders: false }
1247
1311
  ) {
1248
1312
  const { error } = CartApplicationValidator.getLadderOffers().validate(
1249
1313
  { slug, storeId, promotionId, pageSize },
@@ -1284,12 +1348,12 @@ class Cart {
1284
1348
  }),
1285
1349
  query_params,
1286
1350
  undefined,
1287
- xHeaders,
1288
- { headers }
1351
+ { ...xHeaders, ...requestHeaders },
1352
+ { responseHeaders }
1289
1353
  );
1290
1354
 
1291
1355
  let responseData = response;
1292
- if (headers) {
1356
+ if (responseHeaders) {
1293
1357
  responseData = response[0];
1294
1358
  }
1295
1359
 
@@ -1312,6 +1376,7 @@ class Cart {
1312
1376
 
1313
1377
  /**
1314
1378
  * @param {CartApplicationValidator.GetPromotionOffersParam} arg - Arg object.
1379
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1315
1380
  * @param {import("../ApplicationAPIClient").Options} - Options
1316
1381
  * @returns {Promise<CartApplicationModel.PromotionOffersResponse>} - Success response
1317
1382
  * @name getPromotionOffers
@@ -1319,8 +1384,10 @@ class Cart {
1319
1384
  * @description: Use this API to get top 5 offers available for current product - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getPromotionOffers/).
1320
1385
  */
1321
1386
  async getPromotionOffers(
1322
- { slug, pageSize, promotionGroup, storeId } = {},
1323
- { headers } = { headers: false }
1387
+ { slug, pageSize, promotionGroup, storeId, requestHeaders } = {
1388
+ requestHeaders: {},
1389
+ },
1390
+ { responseHeaders } = { responseHeaders: false }
1324
1391
  ) {
1325
1392
  const { error } = CartApplicationValidator.getPromotionOffers().validate(
1326
1393
  { slug, pageSize, promotionGroup, storeId },
@@ -1361,12 +1428,12 @@ class Cart {
1361
1428
  }),
1362
1429
  query_params,
1363
1430
  undefined,
1364
- xHeaders,
1365
- { headers }
1431
+ { ...xHeaders, ...requestHeaders },
1432
+ { responseHeaders }
1366
1433
  );
1367
1434
 
1368
1435
  let responseData = response;
1369
- if (headers) {
1436
+ if (responseHeaders) {
1370
1437
  responseData = response[0];
1371
1438
  }
1372
1439
 
@@ -1389,6 +1456,7 @@ class Cart {
1389
1456
 
1390
1457
  /**
1391
1458
  * @param {CartApplicationValidator.GetShipmentsParam} arg - Arg object.
1459
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1392
1460
  * @param {import("../ApplicationAPIClient").Options} - Options
1393
1461
  * @returns {Promise<CartApplicationModel.CartShipmentsResponse>} - Success response
1394
1462
  * @name getShipments
@@ -1396,8 +1464,10 @@ class Cart {
1396
1464
  * @description: Use this API to get shipment details, expected delivery date, items and price breakup of the shipment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getShipments/).
1397
1465
  */
1398
1466
  async getShipments(
1399
- { p, id, buyNow, addressId, areaCode, orderType } = {},
1400
- { headers } = { headers: false }
1467
+ { p, id, buyNow, addressId, areaCode, orderType, requestHeaders } = {
1468
+ requestHeaders: {},
1469
+ },
1470
+ { responseHeaders } = { responseHeaders: false }
1401
1471
  ) {
1402
1472
  const { error } = CartApplicationValidator.getShipments().validate(
1403
1473
  { p, id, buyNow, addressId, areaCode, orderType },
@@ -1440,12 +1510,12 @@ class Cart {
1440
1510
  }),
1441
1511
  query_params,
1442
1512
  undefined,
1443
- xHeaders,
1444
- { headers }
1513
+ { ...xHeaders, ...requestHeaders },
1514
+ { responseHeaders }
1445
1515
  );
1446
1516
 
1447
1517
  let responseData = response;
1448
- if (headers) {
1518
+ if (responseHeaders) {
1449
1519
  responseData = response[0];
1450
1520
  }
1451
1521
 
@@ -1468,13 +1538,17 @@ class Cart {
1468
1538
 
1469
1539
  /**
1470
1540
  * @param {CartApplicationValidator.RemoveAddressParam} arg - Arg object.
1541
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1471
1542
  * @param {import("../ApplicationAPIClient").Options} - Options
1472
1543
  * @returns {Promise<CartApplicationModel.DeleteAddressResponse>} - Success response
1473
1544
  * @name removeAddress
1474
1545
  * @summary: Remove address associated with an account
1475
1546
  * @description: Use this API to delete an address by its ID. This will returns an object that will indicate whether the address was deleted successfully or not. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/removeAddress/).
1476
1547
  */
1477
- async removeAddress({ id } = {}, { headers } = { headers: false }) {
1548
+ async removeAddress(
1549
+ { id, requestHeaders } = { requestHeaders: {} },
1550
+ { responseHeaders } = { responseHeaders: false }
1551
+ ) {
1478
1552
  const { error } = CartApplicationValidator.removeAddress().validate(
1479
1553
  { id },
1480
1554
  { abortEarly: false, allowUnknown: true }
@@ -1510,12 +1584,12 @@ class Cart {
1510
1584
  }),
1511
1585
  query_params,
1512
1586
  undefined,
1513
- xHeaders,
1514
- { headers }
1587
+ { ...xHeaders, ...requestHeaders },
1588
+ { responseHeaders }
1515
1589
  );
1516
1590
 
1517
1591
  let responseData = response;
1518
- if (headers) {
1592
+ if (responseHeaders) {
1519
1593
  responseData = response[0];
1520
1594
  }
1521
1595
 
@@ -1538,13 +1612,17 @@ class Cart {
1538
1612
 
1539
1613
  /**
1540
1614
  * @param {CartApplicationValidator.RemoveCouponParam} arg - Arg object.
1615
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1541
1616
  * @param {import("../ApplicationAPIClient").Options} - Options
1542
1617
  * @returns {Promise<CartApplicationModel.CartDetailResponse>} - Success response
1543
1618
  * @name removeCoupon
1544
1619
  * @summary: Remove Coupon Applied
1545
1620
  * @description: Remove Coupon applied on the cart by passing uid in request body. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/removeCoupon/).
1546
1621
  */
1547
- async removeCoupon({ id, buyNow } = {}, { headers } = { headers: false }) {
1622
+ async removeCoupon(
1623
+ { id, buyNow, requestHeaders } = { requestHeaders: {} },
1624
+ { responseHeaders } = { responseHeaders: false }
1625
+ ) {
1548
1626
  const { error } = CartApplicationValidator.removeCoupon().validate(
1549
1627
  { id, buyNow },
1550
1628
  { abortEarly: false, allowUnknown: true }
@@ -1582,12 +1660,12 @@ class Cart {
1582
1660
  }),
1583
1661
  query_params,
1584
1662
  undefined,
1585
- xHeaders,
1586
- { headers }
1663
+ { ...xHeaders, ...requestHeaders },
1664
+ { responseHeaders }
1587
1665
  );
1588
1666
 
1589
1667
  let responseData = response;
1590
- if (headers) {
1668
+ if (responseHeaders) {
1591
1669
  responseData = response[0];
1592
1670
  }
1593
1671
 
@@ -1610,15 +1688,16 @@ class Cart {
1610
1688
 
1611
1689
  /**
1612
1690
  * @param {CartApplicationValidator.SelectAddressParam} arg - Arg object.
1691
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1613
1692
  * @param {import("../ApplicationAPIClient").Options} - Options
1614
1693
  * @returns {Promise<CartApplicationModel.CartDetailResponse>} - Success response
1615
1694
  * @name selectAddress
1616
1695
  * @summary: Select an address from available addresses
1617
- * @description: <p>Select Address from all addresses associated with the account in order to ship the cart items to that address, otherwise default address will be selected implicitly. See `SelectCartAddressRequest` in schema of request body for the list of attributes needed to select Address from account. On successful request, this API returns a Cart object. Below address attributes are required. <ul> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">billing_address_id</font></li> <li> <font color="monochrome">uid</font></li> </ul></p> - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/selectAddress/).
1696
+ * @description: Select Address from all addresses associated with the account in order to ship the cart items to that address, otherwise default address will be selected implicitly. See `SelectCartAddressRequest` in schema of request body for the list of attributes needed to select Address from account. On successful request, this API returns a Cart object. Below address attributes are required. address_id billing_address_id uid - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/selectAddress/).
1618
1697
  */
1619
1698
  async selectAddress(
1620
- { body, cartId, buyNow, i, b } = {},
1621
- { headers } = { headers: false }
1699
+ { body, cartId, buyNow, i, b, requestHeaders } = { requestHeaders: {} },
1700
+ { responseHeaders } = { responseHeaders: false }
1622
1701
  ) {
1623
1702
  const { error } = CartApplicationValidator.selectAddress().validate(
1624
1703
  { body, cartId, buyNow, i, b },
@@ -1659,12 +1738,12 @@ class Cart {
1659
1738
  }),
1660
1739
  query_params,
1661
1740
  body,
1662
- xHeaders,
1663
- { headers }
1741
+ { ...xHeaders, ...requestHeaders },
1742
+ { responseHeaders }
1664
1743
  );
1665
1744
 
1666
1745
  let responseData = response;
1667
- if (headers) {
1746
+ if (responseHeaders) {
1668
1747
  responseData = response[0];
1669
1748
  }
1670
1749
 
@@ -1687,6 +1766,7 @@ class Cart {
1687
1766
 
1688
1767
  /**
1689
1768
  * @param {CartApplicationValidator.SelectPaymentModeParam} arg - Arg object.
1769
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1690
1770
  * @param {import("../ApplicationAPIClient").Options} - Options
1691
1771
  * @returns {Promise<CartApplicationModel.CartDetailResponse>} - Success response
1692
1772
  * @name selectPaymentMode
@@ -1694,8 +1774,8 @@ class Cart {
1694
1774
  * @description: Use this API to update cart payment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/selectPaymentMode/).
1695
1775
  */
1696
1776
  async selectPaymentMode(
1697
- { body, id, buyNow } = {},
1698
- { headers } = { headers: false }
1777
+ { body, id, buyNow, requestHeaders } = { requestHeaders: {} },
1778
+ { responseHeaders } = { responseHeaders: false }
1699
1779
  ) {
1700
1780
  const { error } = CartApplicationValidator.selectPaymentMode().validate(
1701
1781
  { body, id, buyNow },
@@ -1734,12 +1814,12 @@ class Cart {
1734
1814
  }),
1735
1815
  query_params,
1736
1816
  body,
1737
- xHeaders,
1738
- { headers }
1817
+ { ...xHeaders, ...requestHeaders },
1818
+ { responseHeaders }
1739
1819
  );
1740
1820
 
1741
1821
  let responseData = response;
1742
- if (headers) {
1822
+ if (responseHeaders) {
1743
1823
  responseData = response[0];
1744
1824
  }
1745
1825
 
@@ -1762,13 +1842,17 @@ class Cart {
1762
1842
 
1763
1843
  /**
1764
1844
  * @param {CartApplicationValidator.UpdateAddressParam} arg - Arg object.
1845
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1765
1846
  * @param {import("../ApplicationAPIClient").Options} - Options
1766
1847
  * @returns {Promise<CartApplicationModel.UpdateAddressResponse>} - Success response
1767
1848
  * @name updateAddress
1768
1849
  * @summary: Update address added to an account
1769
- * @description: <p>Use this API to update an existing address in the account. Request object should contain attributes mentioned in <font color="blue">Address </font> can be updated. These attributes are:</p> <ul> <li> <font color="monochrome">is_default_address</font></li> <li> <font color="monochrome">landmark</font></li> <li> <font color="monochrome">area</font></li> <li> <font color="monochrome">pincode</font></li> <li> <font color="monochrome">email</font></li> <li> <font color="monochrome">address_type</font></li> <li> <font color="monochrome">name</font></li> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">address</font></li> </ul> - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateAddress/).
1850
+ * @description: Use this API to update an existing address in the account. Request object should contain attributes mentioned in Address can be updated. These attributes are: is_default_address landmark area pincode email address_type name address_id address - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateAddress/).
1770
1851
  */
1771
- async updateAddress({ id, body } = {}, { headers } = { headers: false }) {
1852
+ async updateAddress(
1853
+ { id, body, requestHeaders } = { requestHeaders: {} },
1854
+ { responseHeaders } = { responseHeaders: false }
1855
+ ) {
1772
1856
  const { error } = CartApplicationValidator.updateAddress().validate(
1773
1857
  { id, body },
1774
1858
  { abortEarly: false, allowUnknown: true }
@@ -1804,12 +1888,12 @@ class Cart {
1804
1888
  }),
1805
1889
  query_params,
1806
1890
  body,
1807
- xHeaders,
1808
- { headers }
1891
+ { ...xHeaders, ...requestHeaders },
1892
+ { responseHeaders }
1809
1893
  );
1810
1894
 
1811
1895
  let responseData = response;
1812
- if (headers) {
1896
+ if (responseHeaders) {
1813
1897
  responseData = response[0];
1814
1898
  }
1815
1899
 
@@ -1832,16 +1916,19 @@ class Cart {
1832
1916
 
1833
1917
  /**
1834
1918
  * @param {CartApplicationValidator.UpdateCartParam} arg - Arg object.
1919
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1835
1920
  * @param {import("../ApplicationAPIClient").Options} - Options
1836
1921
  * @returns {Promise<CartApplicationModel.UpdateCartDetailResponse>} -
1837
1922
  * Success response
1838
1923
  * @name updateCart
1839
1924
  * @summary: Update items in the cart
1840
- * @description: <p>Use this API to update items added to the cart with the help of a request object containing attributes like item_quantity and item_size. These attributes will be fetched from the following APIs</p> <ul> <li><font color="monochrome">operation</font> Operation for current api call. <b>update_item</b> for update items. <b>remove_item</b> for removing items.</li> <li> <font color="monochrome">item_id</font> "/platform/content/v1/products/"</li> <li> <font color="monochrome">item_size</font> "/platform/content/v1/products/:slug/sizes/"</li> <li> <font color="monochrome">quantity</font> item quantity (must be greater than or equal to 1)</li> <li> <font color="monochrome">article_id</font> "/content​/v1​/products​/:identifier​/sizes​/price​/"</li> <li> <font color="monochrome">item_index</font> item position in the cart (must be greater than or equal to 0)</li> </ul> - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateCart/).
1925
+ * @description: Use this API to update items added to the cart with the help of a request object containing attributes like item_quantity and item_size. These attributes will be fetched from the following APIs operation: Operation for current api call. update_item for update items. remove_item for removing items. item_id "/platform/content/v1/products/" item_size "/platform/content/v1/products/:slug/sizes/" quantity item quantity (must be greater than or equal to 1) article_id "/content​/v1​/products​/:identifier​/sizes​/price​/" item_index item position in the cart (must be greater than or equal to 0) - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateCart/).
1841
1926
  */
1842
1927
  async updateCart(
1843
- { body, id, i, b, areaCode, buyNow } = {},
1844
- { headers } = { headers: false }
1928
+ { body, id, i, b, areaCode, buyNow, requestHeaders } = {
1929
+ requestHeaders: {},
1930
+ },
1931
+ { responseHeaders } = { responseHeaders: false }
1845
1932
  ) {
1846
1933
  const { error } = CartApplicationValidator.updateCart().validate(
1847
1934
  { body, id, i, b, areaCode, buyNow },
@@ -1881,12 +1968,12 @@ class Cart {
1881
1968
  }),
1882
1969
  query_params,
1883
1970
  body,
1884
- xHeaders,
1885
- { headers }
1971
+ { ...xHeaders, ...requestHeaders },
1972
+ { responseHeaders }
1886
1973
  );
1887
1974
 
1888
1975
  let responseData = response;
1889
- if (headers) {
1976
+ if (responseHeaders) {
1890
1977
  responseData = response[0];
1891
1978
  }
1892
1979
 
@@ -1909,6 +1996,7 @@ class Cart {
1909
1996
 
1910
1997
  /**
1911
1998
  * @param {CartApplicationValidator.UpdateCartMetaParam} arg - Arg object.
1999
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1912
2000
  * @param {import("../ApplicationAPIClient").Options} - Options
1913
2001
  * @returns {Promise<CartApplicationModel.CartMetaResponse>} - Success response
1914
2002
  * @name updateCartMeta
@@ -1916,8 +2004,8 @@ class Cart {
1916
2004
  * @description: Use this API to update cart meta like checkout_mode and gstin. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateCartMeta/).
1917
2005
  */
1918
2006
  async updateCartMeta(
1919
- { body, id, buyNow } = {},
1920
- { headers } = { headers: false }
2007
+ { body, id, buyNow, requestHeaders } = { requestHeaders: {} },
2008
+ { responseHeaders } = { responseHeaders: false }
1921
2009
  ) {
1922
2010
  const { error } = CartApplicationValidator.updateCartMeta().validate(
1923
2011
  { body, id, buyNow },
@@ -1956,12 +2044,12 @@ class Cart {
1956
2044
  }),
1957
2045
  query_params,
1958
2046
  body,
1959
- xHeaders,
1960
- { headers }
2047
+ { ...xHeaders, ...requestHeaders },
2048
+ { responseHeaders }
1961
2049
  );
1962
2050
 
1963
2051
  let responseData = response;
1964
- if (headers) {
2052
+ if (responseHeaders) {
1965
2053
  responseData = response[0];
1966
2054
  }
1967
2055
 
@@ -1984,6 +2072,7 @@ class Cart {
1984
2072
 
1985
2073
  /**
1986
2074
  * @param {CartApplicationValidator.UpdateCartWithSharedItemsParam} arg - Arg object.
2075
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1987
2076
  * @param {import("../ApplicationAPIClient").Options} - Options
1988
2077
  * @returns {Promise<CartApplicationModel.SharedCartResponse>} - Success response
1989
2078
  * @name updateCartWithSharedItems
@@ -1991,8 +2080,8 @@ class Cart {
1991
2080
  * @description: Use this API to merge the shared cart with existing cart, or replace the existing cart with the shared cart. The `action` parameter is used to indicate the operation Merge or Replace. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateCartWithSharedItems/).
1992
2081
  */
1993
2082
  async updateCartWithSharedItems(
1994
- { token, action } = {},
1995
- { headers } = { headers: false }
2083
+ { token, action, requestHeaders } = { requestHeaders: {} },
2084
+ { responseHeaders } = { responseHeaders: false }
1996
2085
  ) {
1997
2086
  const {
1998
2087
  error,
@@ -2031,12 +2120,12 @@ class Cart {
2031
2120
  }),
2032
2121
  query_params,
2033
2122
  undefined,
2034
- xHeaders,
2035
- { headers }
2123
+ { ...xHeaders, ...requestHeaders },
2124
+ { responseHeaders }
2036
2125
  );
2037
2126
 
2038
2127
  let responseData = response;
2039
- if (headers) {
2128
+ if (responseHeaders) {
2040
2129
  responseData = response[0];
2041
2130
  }
2042
2131
 
@@ -2059,6 +2148,7 @@ class Cart {
2059
2148
 
2060
2149
  /**
2061
2150
  * @param {CartApplicationValidator.ValidateCouponForPaymentParam} arg - Arg object.
2151
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2062
2152
  * @param {import("../ApplicationAPIClient").Options} - Options
2063
2153
  * @returns {Promise<CartApplicationModel.PaymentCouponValidate>} - Success response
2064
2154
  * @name validateCouponForPayment
@@ -2078,8 +2168,9 @@ class Cart {
2078
2168
  network,
2079
2169
  type,
2080
2170
  cardId,
2081
- } = {},
2082
- { headers } = { headers: false }
2171
+ requestHeaders,
2172
+ } = { requestHeaders: {} },
2173
+ { responseHeaders } = { responseHeaders: false }
2083
2174
  ) {
2084
2175
  const {
2085
2176
  error,
@@ -2153,12 +2244,12 @@ class Cart {
2153
2244
  }),
2154
2245
  query_params,
2155
2246
  undefined,
2156
- xHeaders,
2157
- { headers }
2247
+ { ...xHeaders, ...requestHeaders },
2248
+ { responseHeaders }
2158
2249
  );
2159
2250
 
2160
2251
  let responseData = response;
2161
- if (headers) {
2252
+ if (responseHeaders) {
2162
2253
  responseData = response[0];
2163
2254
  }
2164
2255