@gofynd/fdk-client-javascript 3.22.0 → 3.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.d.ts +14 -14
  4. package/sdk/application/Cart/CartApplicationClient.js +124 -35
  5. package/sdk/application/Common/CommonApplicationClient.js +1 -1
  6. package/sdk/application/Logistic/LogisticApplicationClient.js +4 -2
  7. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +17 -17
  8. package/sdk/platform/Cart/CartPlatformApplicationClient.js +84 -13
  9. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +121 -0
  10. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +52 -0
  11. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +7 -2
  12. package/sdk/platform/Catalog/CatalogPlatformModel.js +5 -2
  13. package/sdk/platform/Common/CommonPlatformClient.js +1 -1
  14. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +96 -1
  15. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +61 -0
  16. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +0 -12
  17. package/sdk/platform/Content/ContentPlatformApplicationClient.js +0 -81
  18. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -10
  19. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +0 -12
  20. package/sdk/platform/Order/OrderPlatformClient.d.ts +28 -0
  21. package/sdk/platform/Order/OrderPlatformClient.js +179 -3
  22. package/sdk/platform/Order/OrderPlatformModel.d.ts +155 -6
  23. package/sdk/platform/Order/OrderPlatformModel.js +105 -3
  24. package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
  25. package/sdk/platform/Order/OrderPlatformValidator.js +30 -0
  26. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +94 -0
  27. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +574 -0
  28. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +70 -1
  29. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +81 -0
  30. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +14 -0
  31. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +85 -0
  32. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1382 -187
  33. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +955 -155
  34. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +10 -1
  35. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +12 -0
  36. package/sdk/platform/User/UserPlatformModel.d.ts +14 -1
  37. package/sdk/platform/User/UserPlatformModel.js +16 -0
  38. package/sdk/public/Configuration/ConfigurationPublicClient.js +1 -1
package/README.md CHANGED
@@ -234,7 +234,7 @@ console.log("Active Theme: ", response.information.name);
234
234
  The above code will log the curl command in the console
235
235
 
236
236
  ```bash
237
- curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 3.22.0' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
237
+ curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 3.24.0' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
238
238
  Active Theme: Emerge
239
239
  ```
240
240
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gofynd/fdk-client-javascript",
3
- "version": "3.22.0",
3
+ "version": "3.24.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -57,7 +57,7 @@ declare class Cart {
57
57
  * @summary: Add items to a cart
58
58
  * @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://docs.fynd.com/partners/commerce/sdk/application/cart/addItems/).
59
59
  */
60
- addItems({ body, xOrderingSource, i, b, includeCartCalculation, areaCode, buyNow, id, orderType, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<AddCartDetailResult>;
60
+ addItems({ body, xOrderingSource, xOrderingSourceType, i, b, includeCartCalculation, areaCode, buyNow, id, orderType, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<AddCartDetailResult>;
61
61
  /**
62
62
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
63
63
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -66,7 +66,7 @@ declare class Cart {
66
66
  * @summary: Apply coupon
67
67
  * @description: Apply a coupon code to the cart to trigger discounts on eligible items. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/applyCoupon/).
68
68
  */
69
- applyCoupon({ body, xOrderingSource, i, b, p, id, buyNow, cartType, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CartDetailResult>;
69
+ applyCoupon({ body, xOrderingSource, xOrderingSourceType, i, b, p, id, buyNow, cartType, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CartDetailResult>;
70
70
  /**
71
71
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
72
72
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -75,7 +75,7 @@ declare class Cart {
75
75
  * @summary: Use loyalty points
76
76
  * @description: Users can redeem their accumulated loyalty points and apply them to the items in their cart, thereby availing discounts on their current purchases. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/applyLoyaltyPoints/).
77
77
  */
78
- applyLoyaltyPoints({ body, xOrderingSource, id, i, b, buyNow, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CartDetailResult>;
78
+ applyLoyaltyPoints({ body, xOrderingSource, xOrderingSourceType, id, i, b, buyNow, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CartDetailResult>;
79
79
  /**
80
80
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
81
81
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -93,7 +93,7 @@ declare class Cart {
93
93
  * @summary: Checkout cart
94
94
  * @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://docs.fynd.com/partners/commerce/sdk/application/cart/checkoutCart/).
95
95
  */
96
- checkoutCart({ body, xOrderingSource, buyNow, cartType, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CartCheckoutResult>;
96
+ checkoutCart({ body, xOrderingSource, xOrderingSourceType, buyNow, cartType, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CartCheckoutResult>;
97
97
  /**
98
98
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
99
99
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -102,7 +102,7 @@ declare class Cart {
102
102
  * @summary: Checkout cart
103
103
  * @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://docs.fynd.com/partners/commerce/sdk/application/cart/checkoutCartV2/).
104
104
  */
105
- checkoutCartV2({ body, xOrderingSource, xLocationDetail, xCurrencyCode, buyNow, cartType, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CartCheckoutResult>;
105
+ checkoutCartV2({ body, xOrderingSource, xOrderingSourceType, xLocationDetail, xCurrencyCode, buyNow, cartType, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CartCheckoutResult>;
106
106
  /**
107
107
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
108
108
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -147,7 +147,7 @@ declare class Cart {
147
147
  * @summary: Get a cart
148
148
  * @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://docs.fynd.com/partners/commerce/sdk/application/cart/getCart/).
149
149
  */
150
- getCart({ xOrderingSource, id, i, b, c, assignCardId, areaCode, buyNow, orderType, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CartDetailResult>;
150
+ getCart({ xOrderingSource, xOrderingSourceType, id, i, b, c, assignCardId, areaCode, buyNow, orderType, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CartDetailResult>;
151
151
  /**
152
152
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
153
153
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -217,9 +217,9 @@ declare class Cart {
217
217
  * @returns {Promise<EligibleProductsResult>} - Success response
218
218
  * @name getProductsByOfferId
219
219
  * @summary: List eligible offer products
220
- * @description: List all products eligible for the given offer id. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/getProductsByOfferId/).
220
+ * @description: List all products eligible for the given offer. Lookup can be done by offer_code (takes priority) or offer_id. At least one must be provided. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/getProductsByOfferId/).
221
221
  */
222
- getProductsByOfferId({ offerId, page, pageSize, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<EligibleProductsResult>;
222
+ getProductsByOfferId({ offerCode, offerId, page, pageSize, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<EligibleProductsResult>;
223
223
  /**
224
224
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
225
225
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -264,7 +264,7 @@ declare class Cart {
264
264
  * @summary: Remove coupon
265
265
  * @description: Remove an applied coupon from the customer's cart, thereby removing the associated discount from the cart total. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/removeCoupon/).
266
266
  */
267
- removeCoupon({ xOrderingSource, id, buyNow, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CartDetailResult>;
267
+ removeCoupon({ xOrderingSource, xOrderingSourceType, id, buyNow, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CartDetailResult>;
268
268
  /**
269
269
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
270
270
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -282,7 +282,7 @@ declare class Cart {
282
282
  * @summary: Select customer address for order processing
283
283
  * @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://docs.fynd.com/partners/commerce/sdk/application/cart/selectAddress/).
284
284
  */
285
- selectAddress({ body, xOrderingSource, cartId, buyNow, i, b, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CartDetailResult>;
285
+ selectAddress({ body, xOrderingSource, xOrderingSourceType, cartId, buyNow, i, b, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CartDetailResult>;
286
286
  /**
287
287
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
288
288
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -291,7 +291,7 @@ declare class Cart {
291
291
  * @summary: Select payment mode
292
292
  * @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://docs.fynd.com/partners/commerce/sdk/application/cart/selectPaymentMode/).
293
293
  */
294
- selectPaymentMode({ body, xOrderingSource, id, buyNow, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CartDetailResult>;
294
+ selectPaymentMode({ body, xOrderingSource, xOrderingSourceType, id, buyNow, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CartDetailResult>;
295
295
  /**
296
296
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
297
297
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -309,7 +309,7 @@ declare class Cart {
309
309
  * @summary: Update cart items
310
310
  * @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://docs.fynd.com/partners/commerce/sdk/application/cart/updateCart/).
311
311
  */
312
- updateCart({ body, xOrderingSource, id, i, b, includeCartCalculation, areaCode, buyNow, cartType, orderType, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<UpdateCartDetailResult>;
312
+ updateCart({ body, xOrderingSource, xOrderingSourceType, id, i, b, includeCartCalculation, areaCode, buyNow, cartType, orderType, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<UpdateCartDetailResult>;
313
313
  /**
314
314
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
315
315
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -318,7 +318,7 @@ declare class Cart {
318
318
  * @summary: Update store credits into cart and their items
319
319
  * @description: Update cart. Customers can adjust the cart breakup by applying or removing store credits as needed. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/updateCartBreakup/).
320
320
  */
321
- updateCartBreakup({ body, xOrderingSource, id, i, b, buyNow, cartType, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<UpdateCartDetailResult>;
321
+ updateCartBreakup({ body, xOrderingSource, xOrderingSourceType, id, i, b, buyNow, cartType, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<UpdateCartDetailResult>;
322
322
  /**
323
323
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
324
324
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -345,5 +345,5 @@ declare class Cart {
345
345
  * @summary: Validate applied coupon
346
346
  * @description: Validate the applicability of a coupon code for the selected payment mode for the existing cart. This ensures the coupon's validity before proceeding with the payment process, enhancing user experience and preventing potential errors during transactions. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/validateCouponForPayment/).
347
347
  */
348
- validateCouponForPayment({ xOrderingSource, id, buyNow, addressId, paymentMode, paymentIdentifier, aggregatorName, merchantCode, iin, network, type, cardId, cartType, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<PaymentCouponValidate>;
348
+ validateCouponForPayment({ xOrderingSource, xOrderingSourceType, id, buyNow, addressId, paymentMode, paymentIdentifier, aggregatorName, merchantCode, iin, network, type, cardId, cartType, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<PaymentCouponValidate>;
349
349
  }
@@ -116,6 +116,7 @@ class Cart {
116
116
  {
117
117
  body,
118
118
  xOrderingSource,
119
+ xOrderingSourceType,
119
120
  i,
120
121
  b,
121
122
  includeCartCalculation,
@@ -137,7 +138,10 @@ class Cart {
137
138
  query_params["order_type"] = orderType;
138
139
 
139
140
  const xHeaders = {};
140
- xHeaders["x-ordering-source"] = xOrderingSource;
141
+ if (xOrderingSource !== undefined)
142
+ xHeaders["x-ordering-source"] = xOrderingSource;
143
+ if (xOrderingSourceType !== undefined)
144
+ xHeaders["x-ordering-source-type"] = xOrderingSourceType;
141
145
 
142
146
  const response = await ApplicationAPIClient.execute(
143
147
  this._conf,
@@ -169,9 +173,18 @@ class Cart {
169
173
  * @description: Apply a coupon code to the cart to trigger discounts on eligible items. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/applyCoupon/).
170
174
  */
171
175
  async applyCoupon(
172
- { body, xOrderingSource, i, b, p, id, buyNow, cartType, requestHeaders } = {
173
- requestHeaders: {},
174
- },
176
+ {
177
+ body,
178
+ xOrderingSource,
179
+ xOrderingSourceType,
180
+ i,
181
+ b,
182
+ p,
183
+ id,
184
+ buyNow,
185
+ cartType,
186
+ requestHeaders,
187
+ } = { requestHeaders: {} },
175
188
  { responseHeaders } = { responseHeaders: false }
176
189
  ) {
177
190
  const query_params = {};
@@ -183,7 +196,10 @@ class Cart {
183
196
  query_params["cart_type"] = cartType;
184
197
 
185
198
  const xHeaders = {};
186
- xHeaders["x-ordering-source"] = xOrderingSource;
199
+ if (xOrderingSource !== undefined)
200
+ xHeaders["x-ordering-source"] = xOrderingSource;
201
+ if (xOrderingSourceType !== undefined)
202
+ xHeaders["x-ordering-source-type"] = xOrderingSourceType;
187
203
 
188
204
  const response = await ApplicationAPIClient.execute(
189
205
  this._conf,
@@ -215,9 +231,16 @@ class Cart {
215
231
  * @description: Users can redeem their accumulated loyalty points and apply them to the items in their cart, thereby availing discounts on their current purchases. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/applyLoyaltyPoints/).
216
232
  */
217
233
  async applyLoyaltyPoints(
218
- { body, xOrderingSource, id, i, b, buyNow, requestHeaders } = {
219
- requestHeaders: {},
220
- },
234
+ {
235
+ body,
236
+ xOrderingSource,
237
+ xOrderingSourceType,
238
+ id,
239
+ i,
240
+ b,
241
+ buyNow,
242
+ requestHeaders,
243
+ } = { requestHeaders: {} },
221
244
  { responseHeaders } = { responseHeaders: false }
222
245
  ) {
223
246
  const query_params = {};
@@ -227,7 +250,10 @@ class Cart {
227
250
  query_params["buy_now"] = buyNow;
228
251
 
229
252
  const xHeaders = {};
230
- xHeaders["x-ordering-source"] = xOrderingSource;
253
+ if (xOrderingSource !== undefined)
254
+ xHeaders["x-ordering-source"] = xOrderingSource;
255
+ if (xOrderingSourceType !== undefined)
256
+ xHeaders["x-ordering-source-type"] = xOrderingSourceType;
231
257
 
232
258
  const response = await ApplicationAPIClient.execute(
233
259
  this._conf,
@@ -298,9 +324,14 @@ class Cart {
298
324
  * @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://docs.fynd.com/partners/commerce/sdk/application/cart/checkoutCart/).
299
325
  */
300
326
  async checkoutCart(
301
- { body, xOrderingSource, buyNow, cartType, requestHeaders } = {
302
- requestHeaders: {},
303
- },
327
+ {
328
+ body,
329
+ xOrderingSource,
330
+ xOrderingSourceType,
331
+ buyNow,
332
+ cartType,
333
+ requestHeaders,
334
+ } = { requestHeaders: {} },
304
335
  { responseHeaders } = { responseHeaders: false }
305
336
  ) {
306
337
  const query_params = {};
@@ -308,7 +339,10 @@ class Cart {
308
339
  query_params["cart_type"] = cartType;
309
340
 
310
341
  const xHeaders = {};
311
- xHeaders["x-ordering-source"] = xOrderingSource;
342
+ if (xOrderingSource !== undefined)
343
+ xHeaders["x-ordering-source"] = xOrderingSource;
344
+ if (xOrderingSourceType !== undefined)
345
+ xHeaders["x-ordering-source-type"] = xOrderingSourceType;
312
346
 
313
347
  const response = await ApplicationAPIClient.execute(
314
348
  this._conf,
@@ -343,6 +377,7 @@ class Cart {
343
377
  {
344
378
  body,
345
379
  xOrderingSource,
380
+ xOrderingSourceType,
346
381
  xLocationDetail,
347
382
  xCurrencyCode,
348
383
  buyNow,
@@ -356,9 +391,14 @@ class Cart {
356
391
  query_params["cart_type"] = cartType;
357
392
 
358
393
  const xHeaders = {};
359
- xHeaders["x-ordering-source"] = xOrderingSource;
360
- xHeaders["x-location-detail"] = xLocationDetail;
361
- xHeaders["x-currency-code"] = xCurrencyCode;
394
+ if (xOrderingSource !== undefined)
395
+ xHeaders["x-ordering-source"] = xOrderingSource;
396
+ if (xOrderingSourceType !== undefined)
397
+ xHeaders["x-ordering-source-type"] = xOrderingSourceType;
398
+ if (xLocationDetail !== undefined)
399
+ xHeaders["x-location-detail"] = xLocationDetail;
400
+ if (xCurrencyCode !== undefined)
401
+ xHeaders["x-currency-code"] = xCurrencyCode;
362
402
 
363
403
  const response = await ApplicationAPIClient.execute(
364
404
  this._conf,
@@ -583,6 +623,7 @@ class Cart {
583
623
  async getCart(
584
624
  {
585
625
  xOrderingSource,
626
+ xOrderingSourceType,
586
627
  id,
587
628
  i,
588
629
  b,
@@ -606,7 +647,10 @@ class Cart {
606
647
  query_params["order_type"] = orderType;
607
648
 
608
649
  const xHeaders = {};
609
- xHeaders["x-ordering-source"] = xOrderingSource;
650
+ if (xOrderingSource !== undefined)
651
+ xHeaders["x-ordering-source"] = xOrderingSource;
652
+ if (xOrderingSourceType !== undefined)
653
+ xHeaders["x-ordering-source-type"] = xOrderingSourceType;
610
654
 
611
655
  const response = await ApplicationAPIClient.execute(
612
656
  this._conf,
@@ -934,13 +978,16 @@ class Cart {
934
978
  * @returns {Promise<EligibleProductsResult>} - Success response
935
979
  * @name getProductsByOfferId
936
980
  * @summary: List eligible offer products
937
- * @description: List all products eligible for the given offer id. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/getProductsByOfferId/).
981
+ * @description: List all products eligible for the given offer. Lookup can be done by offer_code (takes priority) or offer_id. At least one must be provided. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/getProductsByOfferId/).
938
982
  */
939
983
  async getProductsByOfferId(
940
- { offerId, page, pageSize, requestHeaders } = { requestHeaders: {} },
984
+ { offerCode, offerId, page, pageSize, requestHeaders } = {
985
+ requestHeaders: {},
986
+ },
941
987
  { responseHeaders } = { responseHeaders: false }
942
988
  ) {
943
989
  const query_params = {};
990
+ query_params["offer_code"] = offerCode;
944
991
  query_params["offer_id"] = offerId;
945
992
  query_params["page"] = page;
946
993
  query_params["page_size"] = pageSize;
@@ -1162,7 +1209,9 @@ class Cart {
1162
1209
  * @description: Remove an applied coupon from the customer's cart, thereby removing the associated discount from the cart total. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/removeCoupon/).
1163
1210
  */
1164
1211
  async removeCoupon(
1165
- { xOrderingSource, id, buyNow, requestHeaders } = { requestHeaders: {} },
1212
+ { xOrderingSource, xOrderingSourceType, id, buyNow, requestHeaders } = {
1213
+ requestHeaders: {},
1214
+ },
1166
1215
  { responseHeaders } = { responseHeaders: false }
1167
1216
  ) {
1168
1217
  const query_params = {};
@@ -1170,7 +1219,10 @@ class Cart {
1170
1219
  query_params["buy_now"] = buyNow;
1171
1220
 
1172
1221
  const xHeaders = {};
1173
- xHeaders["x-ordering-source"] = xOrderingSource;
1222
+ if (xOrderingSource !== undefined)
1223
+ xHeaders["x-ordering-source"] = xOrderingSource;
1224
+ if (xOrderingSourceType !== undefined)
1225
+ xHeaders["x-ordering-source-type"] = xOrderingSourceType;
1174
1226
 
1175
1227
  const response = await ApplicationAPIClient.execute(
1176
1228
  this._conf,
@@ -1241,9 +1293,16 @@ class Cart {
1241
1293
  * @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://docs.fynd.com/partners/commerce/sdk/application/cart/selectAddress/).
1242
1294
  */
1243
1295
  async selectAddress(
1244
- { body, xOrderingSource, cartId, buyNow, i, b, requestHeaders } = {
1245
- requestHeaders: {},
1246
- },
1296
+ {
1297
+ body,
1298
+ xOrderingSource,
1299
+ xOrderingSourceType,
1300
+ cartId,
1301
+ buyNow,
1302
+ i,
1303
+ b,
1304
+ requestHeaders,
1305
+ } = { requestHeaders: {} },
1247
1306
  { responseHeaders } = { responseHeaders: false }
1248
1307
  ) {
1249
1308
  const query_params = {};
@@ -1253,7 +1312,10 @@ class Cart {
1253
1312
  query_params["b"] = b;
1254
1313
 
1255
1314
  const xHeaders = {};
1256
- xHeaders["x-ordering-source"] = xOrderingSource;
1315
+ if (xOrderingSource !== undefined)
1316
+ xHeaders["x-ordering-source"] = xOrderingSource;
1317
+ if (xOrderingSourceType !== undefined)
1318
+ xHeaders["x-ordering-source-type"] = xOrderingSourceType;
1257
1319
 
1258
1320
  const response = await ApplicationAPIClient.execute(
1259
1321
  this._conf,
@@ -1285,9 +1347,14 @@ class Cart {
1285
1347
  * @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://docs.fynd.com/partners/commerce/sdk/application/cart/selectPaymentMode/).
1286
1348
  */
1287
1349
  async selectPaymentMode(
1288
- { body, xOrderingSource, id, buyNow, requestHeaders } = {
1289
- requestHeaders: {},
1290
- },
1350
+ {
1351
+ body,
1352
+ xOrderingSource,
1353
+ xOrderingSourceType,
1354
+ id,
1355
+ buyNow,
1356
+ requestHeaders,
1357
+ } = { requestHeaders: {} },
1291
1358
  { responseHeaders } = { responseHeaders: false }
1292
1359
  ) {
1293
1360
  const query_params = {};
@@ -1295,7 +1362,10 @@ class Cart {
1295
1362
  query_params["buy_now"] = buyNow;
1296
1363
 
1297
1364
  const xHeaders = {};
1298
- xHeaders["x-ordering-source"] = xOrderingSource;
1365
+ if (xOrderingSource !== undefined)
1366
+ xHeaders["x-ordering-source"] = xOrderingSource;
1367
+ if (xOrderingSourceType !== undefined)
1368
+ xHeaders["x-ordering-source-type"] = xOrderingSourceType;
1299
1369
 
1300
1370
  const response = await ApplicationAPIClient.execute(
1301
1371
  this._conf,
@@ -1376,6 +1446,7 @@ class Cart {
1376
1446
  {
1377
1447
  body,
1378
1448
  xOrderingSource,
1449
+ xOrderingSourceType,
1379
1450
  id,
1380
1451
  i,
1381
1452
  b,
@@ -1399,7 +1470,10 @@ class Cart {
1399
1470
  query_params["order_type"] = orderType;
1400
1471
 
1401
1472
  const xHeaders = {};
1402
- xHeaders["x-ordering-source"] = xOrderingSource;
1473
+ if (xOrderingSource !== undefined)
1474
+ xHeaders["x-ordering-source"] = xOrderingSource;
1475
+ if (xOrderingSourceType !== undefined)
1476
+ xHeaders["x-ordering-source-type"] = xOrderingSourceType;
1403
1477
 
1404
1478
  const response = await ApplicationAPIClient.execute(
1405
1479
  this._conf,
@@ -1431,9 +1505,17 @@ class Cart {
1431
1505
  * @description: Update cart. Customers can adjust the cart breakup by applying or removing store credits as needed. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/updateCartBreakup/).
1432
1506
  */
1433
1507
  async updateCartBreakup(
1434
- { body, xOrderingSource, id, i, b, buyNow, cartType, requestHeaders } = {
1435
- requestHeaders: {},
1436
- },
1508
+ {
1509
+ body,
1510
+ xOrderingSource,
1511
+ xOrderingSourceType,
1512
+ id,
1513
+ i,
1514
+ b,
1515
+ buyNow,
1516
+ cartType,
1517
+ requestHeaders,
1518
+ } = { requestHeaders: {} },
1437
1519
  { responseHeaders } = { responseHeaders: false }
1438
1520
  ) {
1439
1521
  const query_params = {};
@@ -1444,7 +1526,10 @@ class Cart {
1444
1526
  query_params["cart_type"] = cartType;
1445
1527
 
1446
1528
  const xHeaders = {};
1447
- xHeaders["x-ordering-source"] = xOrderingSource;
1529
+ if (xOrderingSource !== undefined)
1530
+ xHeaders["x-ordering-source"] = xOrderingSource;
1531
+ if (xOrderingSourceType !== undefined)
1532
+ xHeaders["x-ordering-source-type"] = xOrderingSourceType;
1448
1533
 
1449
1534
  const response = await ApplicationAPIClient.execute(
1450
1535
  this._conf,
@@ -1563,6 +1648,7 @@ class Cart {
1563
1648
  async validateCouponForPayment(
1564
1649
  {
1565
1650
  xOrderingSource,
1651
+ xOrderingSourceType,
1566
1652
  id,
1567
1653
  buyNow,
1568
1654
  addressId,
@@ -1594,7 +1680,10 @@ class Cart {
1594
1680
  query_params["cart_type"] = cartType;
1595
1681
 
1596
1682
  const xHeaders = {};
1597
- xHeaders["x-ordering-source"] = xOrderingSource;
1683
+ if (xOrderingSource !== undefined)
1684
+ xHeaders["x-ordering-source"] = xOrderingSource;
1685
+ if (xOrderingSourceType !== undefined)
1686
+ xHeaders["x-ordering-source-type"] = xOrderingSourceType;
1598
1687
 
1599
1688
  const response = await ApplicationAPIClient.execute(
1600
1689
  this._conf,
@@ -87,7 +87,7 @@ class Common {
87
87
  query_params["query"] = query;
88
88
 
89
89
  const xHeaders = {};
90
- xHeaders["authorization"] = authorization;
90
+ if (authorization !== undefined) xHeaders["authorization"] = authorization;
91
91
 
92
92
  const response = await ApplicationAPIClient.execute(
93
93
  this._conf,
@@ -198,7 +198,8 @@ class Logistic {
198
198
  query_params["page_size"] = pageSize;
199
199
 
200
200
  const xHeaders = {};
201
- xHeaders["x-location-detail"] = xLocationDetail;
201
+ if (xLocationDetail !== undefined)
202
+ xHeaders["x-location-detail"] = xLocationDetail;
202
203
 
203
204
  const response = await ApplicationAPIClient.execute(
204
205
  this._conf,
@@ -288,7 +289,8 @@ class Logistic {
288
289
  query_params["store_id"] = storeId;
289
290
 
290
291
  const xHeaders = {};
291
- xHeaders["x-application-data"] = xApplicationData;
292
+ if (xApplicationData !== undefined)
293
+ xHeaders["x-application-data"] = xApplicationData;
292
294
 
293
295
  const response = await ApplicationAPIClient.execute(
294
296
  this._conf,