@gofynd/fdk-client-javascript 1.1.2 → 1.1.4

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 (120) hide show
  1. package/README.md +2 -2
  2. package/index.d.ts +7 -7
  3. package/index.js +12 -12
  4. package/package.json +1 -1
  5. package/sdk/application/ApplicationClient.d.ts +20 -20
  6. package/sdk/application/ApplicationClient.js +26 -26
  7. package/sdk/application/Cart/CartApplicationClient.d.ts +36 -6
  8. package/sdk/application/Cart/CartApplicationClient.js +105 -10
  9. package/sdk/application/Cart/CartApplicationModel.d.ts +9 -0
  10. package/sdk/application/Cart/CartApplicationModel.js +105 -1
  11. package/sdk/application/Cart/CartApplicationValidator.d.ts +1 -0
  12. package/sdk/application/Cart/CartApplicationValidator.js +15 -1
  13. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +1 -0
  14. package/sdk/application/Catalog/CatalogApplicationModel.js +13 -0
  15. package/sdk/application/Common/CommonApplicationModel.js +4 -0
  16. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +14 -10
  17. package/sdk/application/Configuration/ConfigurationApplicationClient.js +16 -10
  18. package/sdk/application/Configuration/ConfigurationApplicationModel.js +6 -5
  19. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +1 -0
  20. package/sdk/application/Content/ContentApplicationModel.js +3 -1
  21. package/sdk/application/Lead/LeadApplicationModel.js +4 -1
  22. package/sdk/application/Logistic/LogisticApplicationModel.js +3 -2
  23. package/sdk/application/Order/OrderApplicationClient.d.ts +2 -2
  24. package/sdk/application/Order/OrderApplicationClient.js +2 -2
  25. package/sdk/application/Order/OrderApplicationModel.js +18 -8
  26. package/sdk/application/Payment/PaymentApplicationClient.d.ts +35 -0
  27. package/sdk/application/Payment/PaymentApplicationClient.js +200 -0
  28. package/sdk/application/Payment/PaymentApplicationModel.d.ts +4 -0
  29. package/sdk/application/Payment/PaymentApplicationModel.js +58 -7
  30. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +3 -0
  31. package/sdk/application/Payment/PaymentApplicationValidator.js +19 -0
  32. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +16 -3
  33. package/sdk/application/PosCart/PosCartApplicationClient.js +39 -6
  34. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +6 -0
  35. package/sdk/application/PosCart/PosCartApplicationModel.js +63 -1
  36. package/sdk/application/PosCart/PosCartApplicationValidator.js +6 -0
  37. package/sdk/application/index.d.ts +10 -10
  38. package/sdk/application/index.js +13 -13
  39. package/sdk/common/Constant.d.ts +5 -0
  40. package/sdk/common/Constant.js +5 -0
  41. package/sdk/partner/OAuthClient.js +1 -1
  42. package/sdk/platform/Billing/BillingPlatformModel.js +6 -1
  43. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +491 -2
  44. package/sdk/platform/Cart/CartPlatformApplicationClient.js +2661 -337
  45. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +32 -0
  46. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +269 -0
  47. package/sdk/platform/Cart/CartPlatformModel.d.ts +58 -0
  48. package/sdk/platform/Cart/CartPlatformModel.js +652 -3
  49. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +8 -2
  50. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +10 -0
  51. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +1 -0
  52. package/sdk/platform/Catalog/CatalogPlatformClient.js +2 -2
  53. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1 -0
  54. package/sdk/platform/Catalog/CatalogPlatformModel.js +43 -31
  55. package/sdk/platform/Common/CommonPlatformModel.js +4 -0
  56. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1 -0
  57. package/sdk/platform/Communication/CommunicationPlatformModel.js +9 -0
  58. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +2 -2
  59. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +2 -2
  60. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +5 -4
  61. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +99 -78
  62. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +99 -78
  63. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +87 -71
  64. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +87 -71
  65. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +2 -0
  66. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +34 -7
  67. package/sdk/platform/Content/ContentPlatformModel.js +3 -1
  68. package/sdk/platform/Finance/FinancePlatformClient.d.ts +135 -0
  69. package/sdk/platform/Finance/FinancePlatformClient.js +853 -0
  70. package/sdk/platform/Finance/FinancePlatformModel.d.ts +51 -0
  71. package/sdk/platform/Finance/FinancePlatformModel.js +342 -0
  72. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +16 -0
  73. package/sdk/platform/Finance/FinancePlatformValidator.js +84 -0
  74. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +11 -1
  75. package/sdk/platform/Order/OrderPlatformApplicationClient.js +66 -2
  76. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -0
  77. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -0
  78. package/sdk/platform/Order/OrderPlatformClient.d.ts +161 -79
  79. package/sdk/platform/Order/OrderPlatformClient.js +546 -114
  80. package/sdk/platform/Order/OrderPlatformModel.d.ts +42 -6
  81. package/sdk/platform/Order/OrderPlatformModel.js +569 -159
  82. package/sdk/platform/Order/OrderPlatformValidator.d.ts +6 -0
  83. package/sdk/platform/Order/OrderPlatformValidator.js +52 -9
  84. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +22 -0
  85. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +127 -0
  86. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +2 -0
  87. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +13 -0
  88. package/sdk/platform/Partner/PartnerPlatformClient.d.ts +145 -0
  89. package/sdk/platform/Partner/PartnerPlatformClient.js +799 -0
  90. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +39 -0
  91. package/sdk/platform/Partner/PartnerPlatformModel.js +367 -0
  92. package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +14 -0
  93. package/sdk/platform/Partner/PartnerPlatformValidator.js +87 -0
  94. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +221 -0
  95. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +1476 -190
  96. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +20 -0
  97. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +126 -0
  98. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +48 -0
  99. package/sdk/platform/Payment/PaymentPlatformModel.js +452 -7
  100. package/sdk/platform/PlatformApplicationClient.d.ts +1249 -937
  101. package/sdk/platform/PlatformApplicationClient.js +1366 -1033
  102. package/sdk/platform/PlatformClient.d.ts +10979 -8771
  103. package/sdk/platform/PlatformClient.js +11874 -9197
  104. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +134 -0
  105. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +852 -0
  106. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +16 -0
  107. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +81 -0
  108. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +223 -0
  109. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +1296 -0
  110. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +97 -0
  111. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +778 -0
  112. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +21 -0
  113. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +130 -0
  114. package/sdk/platform/index.d.ts +16 -14
  115. package/sdk/platform/index.js +22 -18
  116. package/sdk/public/Configuration/ConfigurationPublicModel.js +5 -0
  117. package/sdk/public/PublicClient.d.ts +2 -2
  118. package/sdk/public/PublicClient.js +4 -4
  119. package/sdk/public/index.d.ts +1 -1
  120. package/sdk/public/index.js +2 -2
package/README.md CHANGED
@@ -183,8 +183,8 @@ import { ApplicationConfig, ApplicationClient } from "fdk-client-javascript";
183
183
  ---
184
184
  ### Documentation
185
185
 
186
- - [Public Front](documentation/public/README.md)
187
186
  - [Application Front](documentation/application/README.md)
188
- - [Platform Front](documentation/platform/README.md)
189
187
  - [Partner Front](documentation/partner/README.md)
188
+ - [Platform Front](documentation/platform/README.md)
189
+ - [Public Front](documentation/public/README.md)
190
190
 
package/index.d.ts CHANGED
@@ -1,16 +1,16 @@
1
- import { PublicConfig } from "./sdk/public";
2
- import { PublicClient } from "./sdk/public";
3
- import { PublicModel } from "./sdk/public";
4
1
  import { ApplicationConfig } from "./sdk/application";
5
2
  import { ApplicationClient } from "./sdk/application";
6
3
  import { ApplicationModel } from "./sdk/application";
7
- import { PlatformConfig } from "./sdk/platform";
8
- import { PlatformClient } from "./sdk/platform";
9
- import { PlatformModel } from "./sdk/platform";
10
4
  import { PartnerConfig } from "./sdk/partner";
11
5
  import { PartnerClient } from "./sdk/partner";
12
6
  import { PartnerModel } from "./sdk/partner";
7
+ import { PlatformConfig } from "./sdk/platform";
8
+ import { PlatformClient } from "./sdk/platform";
9
+ import { PlatformModel } from "./sdk/platform";
10
+ import { PublicConfig } from "./sdk/public";
11
+ import { PublicClient } from "./sdk/public";
12
+ import { PublicModel } from "./sdk/public";
13
13
  import { fdkAxios } from "./sdk/common/AxiosHelper";
14
14
  import Utility = require("./sdk/common/Utility");
15
15
  import Constant = require("./sdk/common/Constant");
16
- export { PublicConfig, PublicClient, PublicModel, ApplicationConfig, ApplicationClient, ApplicationModel, PlatformConfig, PlatformClient, PlatformModel, PartnerConfig, PartnerClient, PartnerModel, fdkAxios as FdkAxios, Utility, Constant };
16
+ export { ApplicationConfig, ApplicationClient, ApplicationModel, PartnerConfig, PartnerClient, PartnerModel, PlatformConfig, PlatformClient, PlatformModel, PublicConfig, PublicClient, PublicModel, fdkAxios as FdkAxios, Utility, Constant };
package/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
 
2
- const { PublicConfig, PublicClient, PublicModel } = require('./sdk/public');
3
- const { ApplicationConfig, ApplicationClient, ApplicationModel } = require('./sdk/application');
4
- const { PlatformConfig, PlatformClient, PlatformModel } = require('./sdk/platform');
5
2
 
3
+ const { ApplicationConfig, ApplicationClient, ApplicationModel } = require('./sdk/application');
6
4
  const { PartnerConfig, PartnerClient, PartnerModel } = require('./sdk/partner');
5
+ const { PlatformConfig, PlatformClient, PlatformModel } = require('./sdk/platform');
6
+ const { PublicConfig, PublicClient, PublicModel } = require('./sdk/public');
7
7
  const {fdkAxios} = require('./sdk/common/AxiosHelper');
8
8
  const Utility = require('./sdk/common/Utility');
9
9
  const Constant = require('./sdk/common/Constant');
@@ -11,10 +11,6 @@ const Constant = require('./sdk/common/Constant');
11
11
  module.exports = {
12
12
 
13
13
 
14
- PublicConfig,
15
- PublicClient,
16
- PublicModel,
17
-
18
14
 
19
15
 
20
16
  ApplicationConfig,
@@ -23,17 +19,21 @@ module.exports = {
23
19
 
24
20
 
25
21
 
22
+ PartnerConfig,
23
+ PartnerClient,
24
+ PartnerModel,
25
+
26
+
27
+
26
28
  PlatformConfig,
27
29
  PlatformClient,
28
30
  PlatformModel,
29
31
 
30
32
 
31
33
 
32
-
33
-
34
- PartnerConfig,
35
- PartnerClient,
36
- PartnerModel,
34
+ PublicConfig,
35
+ PublicClient,
36
+ PublicModel,
37
37
 
38
38
 
39
39
  FdkAxios: fdkAxios,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gofynd/fdk-client-javascript",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -2,40 +2,40 @@ export = ApplicationClient;
2
2
  declare class ApplicationClient {
3
3
  constructor(config: any);
4
4
  config: any;
5
- catalog: Catalog;
6
5
  cart: Cart;
6
+ catalog: Catalog;
7
7
  common: Common;
8
- lead: Lead;
9
- theme: Theme;
10
- user: User;
11
- content: Content;
12
8
  communication: Communication;
13
- share: Share;
14
- fileStorage: FileStorage;
15
9
  configuration: Configuration;
16
- payment: Payment;
10
+ content: Content;
11
+ fileStorage: FileStorage;
12
+ lead: Lead;
13
+ logistic: Logistic;
17
14
  order: Order;
18
- rewards: Rewards;
15
+ payment: Payment;
19
16
  posCart: PosCart;
20
- logistic: Logistic;
17
+ rewards: Rewards;
18
+ share: Share;
19
+ theme: Theme;
20
+ user: User;
21
21
  setCookie(cookie: any): void;
22
22
  setLocationDetails(locationDetails: any): void;
23
23
  setCurrencyCode(currencyCode: any): void;
24
24
  setExtraHeaders(header: any): void;
25
25
  }
26
- import Catalog = require("./Catalog/CatalogApplicationClient");
27
26
  import Cart = require("./Cart/CartApplicationClient");
27
+ import Catalog = require("./Catalog/CatalogApplicationClient");
28
28
  import Common = require("./Common/CommonApplicationClient");
29
- import Lead = require("./Lead/LeadApplicationClient");
30
- import Theme = require("./Theme/ThemeApplicationClient");
31
- import User = require("./User/UserApplicationClient");
32
- import Content = require("./Content/ContentApplicationClient");
33
29
  import Communication = require("./Communication/CommunicationApplicationClient");
34
- import Share = require("./Share/ShareApplicationClient");
35
- import FileStorage = require("./FileStorage/FileStorageApplicationClient");
36
30
  import Configuration = require("./Configuration/ConfigurationApplicationClient");
37
- import Payment = require("./Payment/PaymentApplicationClient");
31
+ import Content = require("./Content/ContentApplicationClient");
32
+ import FileStorage = require("./FileStorage/FileStorageApplicationClient");
33
+ import Lead = require("./Lead/LeadApplicationClient");
34
+ import Logistic = require("./Logistic/LogisticApplicationClient");
38
35
  import Order = require("./Order/OrderApplicationClient");
39
- import Rewards = require("./Rewards/RewardsApplicationClient");
36
+ import Payment = require("./Payment/PaymentApplicationClient");
40
37
  import PosCart = require("./PosCart/PosCartApplicationClient");
41
- import Logistic = require("./Logistic/LogisticApplicationClient");
38
+ import Rewards = require("./Rewards/RewardsApplicationClient");
39
+ import Share = require("./Share/ShareApplicationClient");
40
+ import Theme = require("./Theme/ThemeApplicationClient");
41
+ import User = require("./User/UserApplicationClient");
@@ -1,36 +1,36 @@
1
1
  const { LocationValidator } = require("./ApplicationModels");
2
2
 
3
- const Catalog = require("./Catalog/CatalogApplicationClient");
4
-
5
3
  const Cart = require("./Cart/CartApplicationClient");
6
4
 
7
- const Common = require("./Common/CommonApplicationClient");
5
+ const Catalog = require("./Catalog/CatalogApplicationClient");
8
6
 
9
- const Lead = require("./Lead/LeadApplicationClient");
7
+ const Common = require("./Common/CommonApplicationClient");
10
8
 
11
- const Theme = require("./Theme/ThemeApplicationClient");
9
+ const Communication = require("./Communication/CommunicationApplicationClient");
12
10
 
13
- const User = require("./User/UserApplicationClient");
11
+ const Configuration = require("./Configuration/ConfigurationApplicationClient");
14
12
 
15
13
  const Content = require("./Content/ContentApplicationClient");
16
14
 
17
- const Communication = require("./Communication/CommunicationApplicationClient");
15
+ const FileStorage = require("./FileStorage/FileStorageApplicationClient");
18
16
 
19
- const Share = require("./Share/ShareApplicationClient");
17
+ const Lead = require("./Lead/LeadApplicationClient");
20
18
 
21
- const FileStorage = require("./FileStorage/FileStorageApplicationClient");
19
+ const Logistic = require("./Logistic/LogisticApplicationClient");
22
20
 
23
- const Configuration = require("./Configuration/ConfigurationApplicationClient");
21
+ const Order = require("./Order/OrderApplicationClient");
24
22
 
25
23
  const Payment = require("./Payment/PaymentApplicationClient");
26
24
 
27
- const Order = require("./Order/OrderApplicationClient");
25
+ const PosCart = require("./PosCart/PosCartApplicationClient");
28
26
 
29
27
  const Rewards = require("./Rewards/RewardsApplicationClient");
30
28
 
31
- const PosCart = require("./PosCart/PosCartApplicationClient");
29
+ const Share = require("./Share/ShareApplicationClient");
32
30
 
33
- const Logistic = require("./Logistic/LogisticApplicationClient");
31
+ const Theme = require("./Theme/ThemeApplicationClient");
32
+
33
+ const User = require("./User/UserApplicationClient");
34
34
 
35
35
  const { FDKClientValidationError } = require("../common/FDKError");
36
36
 
@@ -38,37 +38,37 @@ class ApplicationClient {
38
38
  constructor(config) {
39
39
  this.config = config;
40
40
 
41
- this.catalog = new Catalog(config);
42
-
43
41
  this.cart = new Cart(config);
44
42
 
45
- this.common = new Common(config);
43
+ this.catalog = new Catalog(config);
46
44
 
47
- this.lead = new Lead(config);
45
+ this.common = new Common(config);
48
46
 
49
- this.theme = new Theme(config);
47
+ this.communication = new Communication(config);
50
48
 
51
- this.user = new User(config);
49
+ this.configuration = new Configuration(config);
52
50
 
53
51
  this.content = new Content(config);
54
52
 
55
- this.communication = new Communication(config);
53
+ this.fileStorage = new FileStorage(config);
56
54
 
57
- this.share = new Share(config);
55
+ this.lead = new Lead(config);
58
56
 
59
- this.fileStorage = new FileStorage(config);
57
+ this.logistic = new Logistic(config);
60
58
 
61
- this.configuration = new Configuration(config);
59
+ this.order = new Order(config);
62
60
 
63
61
  this.payment = new Payment(config);
64
62
 
65
- this.order = new Order(config);
63
+ this.posCart = new PosCart(config);
66
64
 
67
65
  this.rewards = new Rewards(config);
68
66
 
69
- this.posCart = new PosCart(config);
67
+ this.share = new Share(config);
70
68
 
71
- this.logistic = new Logistic(config);
69
+ this.theme = new Theme(config);
70
+
71
+ this.user = new User(config);
72
72
  }
73
73
 
74
74
  setCookie(cookie) {
@@ -8,6 +8,7 @@ declare class Cart {
8
8
  applyCoupon: string;
9
9
  applyRewardPoints: string;
10
10
  checkoutCart: string;
11
+ checkoutCartV2: string;
11
12
  deleteCart: string;
12
13
  getAddressById: string;
13
14
  getAddresses: string;
@@ -49,16 +50,18 @@ declare class Cart {
49
50
  * @param {boolean} [arg.b] -
50
51
  * @param {string} [arg.areaCode] -
51
52
  * @param {boolean} [arg.buyNow] -
53
+ * @param {string} [arg.id] -
52
54
  * @param {AddCartRequest} arg.body
53
55
  * @returns {Promise<AddCartDetailResponse>} - Success response
54
56
  * @summary: Add items to cart
55
57
  * @description: Use this API to add items to the cart.
56
58
  */
57
- addItems({ body, i, b, areaCode, buyNow }?: {
59
+ addItems({ body, i, b, areaCode, buyNow, id }?: {
58
60
  i?: boolean;
59
61
  b?: boolean;
60
62
  areaCode?: string;
61
63
  buyNow?: boolean;
64
+ id?: string;
62
65
  body: AddCartRequest;
63
66
  }): Promise<AddCartDetailResponse>;
64
67
  /**
@@ -113,13 +116,25 @@ declare class Cart {
113
116
  }): Promise<CartCheckoutResponse>;
114
117
  /**
115
118
  * @param {Object} arg - Arg object.
116
- * @param {number} [arg.id] - The unique identifier of the cart.
119
+ * @param {boolean} [arg.buyNow] - This indicates the type of cart to checkout
120
+ * @param {CartCheckoutDetailV2Request} arg.body
121
+ * @returns {Promise<CartCheckoutResponse>} - Success response
122
+ * @summary: Checkout all items in the cart
123
+ * @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.
124
+ */
125
+ checkoutCartV2({ body, buyNow }?: {
126
+ buyNow?: boolean;
127
+ body: CartCheckoutDetailV2Request;
128
+ }): Promise<CartCheckoutResponse>;
129
+ /**
130
+ * @param {Object} arg - Arg object.
131
+ * @param {string} [arg.id] - The unique identifier of the cart.
117
132
  * @returns {Promise<DeleteCartDetailResponse>} - Success response
118
133
  * @summary: Delete cart once user made successful checkout
119
134
  * @description: Use this API to delete the cart.
120
135
  */
121
136
  deleteCart({ id }?: {
122
- id?: number;
137
+ id?: string;
123
138
  }): Promise<DeleteCartDetailResponse>;
124
139
  /**
125
140
  * @param {Object} arg - Arg object.
@@ -282,14 +297,16 @@ declare class Cart {
282
297
  * /service/application/catalog/v1.0/products/
283
298
  * @param {number} [arg.pageSize] - Number of offers to be fetched to show
284
299
  * @param {string} [arg.promotionGroup] - Type of promotion groups
300
+ * @param {number} [arg.storeId] - Store id
285
301
  * @returns {Promise<PromotionOffersResponse>} - Success response
286
302
  * @summary: Fetch available promotions
287
303
  * @description: Use this API to get top 5 offers available for current product
288
304
  */
289
- getPromotionOffers({ slug, pageSize, promotionGroup }?: {
305
+ getPromotionOffers({ slug, pageSize, promotionGroup, storeId }?: {
290
306
  slug?: string;
291
307
  pageSize?: number;
292
308
  promotionGroup?: string;
309
+ storeId?: number;
293
310
  }): Promise<PromotionOffersResponse>;
294
311
  /**
295
312
  * @param {Object} arg - Arg object.
@@ -300,16 +317,21 @@ declare class Cart {
300
317
  * @param {string} [arg.addressId] - ID allotted to the selected address
301
318
  * @param {string} [arg.areaCode] - The PIN Code of the destination address,
302
319
  * e.g. 400059
320
+ * @param {string} [arg.orderType] - The order type of shipment HomeDelivery
321
+ * - If the customer wants the order home-delivered PickAtStore - If the
322
+ * customer wants the handover of an order at the store itself. Digital -
323
+ * If the customer wants to buy digital voucher ( for jiogames )
303
324
  * @returns {Promise<CartShipmentsResponse>} - Success response
304
325
  * @summary: Get delivery date and options before checkout
305
326
  * @description: Use this API to get shipment details, expected delivery date, items and price breakup of the shipment.
306
327
  */
307
- getShipments({ p, id, buyNow, addressId, areaCode }?: {
328
+ getShipments({ p, id, buyNow, addressId, areaCode, orderType }?: {
308
329
  p?: boolean;
309
330
  id?: string;
310
331
  buyNow?: boolean;
311
332
  addressId?: string;
312
333
  areaCode?: string;
334
+ orderType?: string;
313
335
  }): Promise<CartShipmentsResponse>;
314
336
  /**
315
337
  * @param {Object} arg - Arg object.
@@ -433,11 +455,15 @@ declare class Cart {
433
455
  * @param {string} [arg.paymentIdentifier] -
434
456
  * @param {string} [arg.aggregatorName] -
435
457
  * @param {string} [arg.merchantCode] -
458
+ * @param {string} [arg.iin] -
459
+ * @param {string} [arg.network] -
460
+ * @param {string} [arg.type] -
461
+ * @param {string} [arg.cardId] -
436
462
  * @returns {Promise<PaymentCouponValidate>} - Success response
437
463
  * @summary: Verify the coupon eligibility against the payment mode
438
464
  * @description: Use this API to validate a coupon against the payment mode such as NetBanking, Wallet, UPI etc.
439
465
  */
440
- validateCouponForPayment({ id, buyNow, addressId, paymentMode, paymentIdentifier, aggregatorName, merchantCode, }?: {
466
+ validateCouponForPayment({ id, buyNow, addressId, paymentMode, paymentIdentifier, aggregatorName, merchantCode, iin, network, type, cardId, }?: {
441
467
  id?: string;
442
468
  buyNow?: boolean;
443
469
  addressId?: string;
@@ -445,5 +471,9 @@ declare class Cart {
445
471
  paymentIdentifier?: string;
446
472
  aggregatorName?: string;
447
473
  merchantCode?: string;
474
+ iin?: string;
475
+ network?: string;
476
+ type?: string;
477
+ cardId?: string;
448
478
  }): Promise<PaymentCouponValidate>;
449
479
  }
@@ -16,6 +16,7 @@ class Cart {
16
16
  applyCoupon: "/service/application/cart/v1.0/coupon",
17
17
  applyRewardPoints: "/service/application/cart/v1.0/redeem/points/",
18
18
  checkoutCart: "/service/application/cart/v1.0/checkout",
19
+ checkoutCartV2: "/service/application/cart/v2.0/checkout",
19
20
  deleteCart: "/service/application/cart/v1.0/cart_archive",
20
21
  getAddressById: "/service/application/cart/v1.0/address/{id}",
21
22
  getAddresses: "/service/application/cart/v1.0/address",
@@ -126,14 +127,15 @@ class Cart {
126
127
  * @param {boolean} [arg.b] -
127
128
  * @param {string} [arg.areaCode] -
128
129
  * @param {boolean} [arg.buyNow] -
130
+ * @param {string} [arg.id] -
129
131
  * @param {AddCartRequest} arg.body
130
132
  * @returns {Promise<AddCartDetailResponse>} - Success response
131
133
  * @summary: Add items to cart
132
134
  * @description: Use this API to add items to the cart.
133
135
  */
134
- async addItems({ body, i, b, areaCode, buyNow } = {}) {
136
+ async addItems({ body, i, b, areaCode, buyNow, id } = {}) {
135
137
  const { error } = CartValidator.addItems().validate(
136
- { body, i, b, areaCode, buyNow },
138
+ { body, i, b, areaCode, buyNow, id },
137
139
  { abortEarly: false, allowUnknown: true }
138
140
  );
139
141
  if (error) {
@@ -142,7 +144,7 @@ class Cart {
142
144
 
143
145
  // Showing warrnings if extra unknown parameters are found
144
146
  const { error: warrning } = CartValidator.addItems().validate(
145
- { body, i, b, areaCode, buyNow },
147
+ { body, i, b, areaCode, buyNow, id },
146
148
  { abortEarly: false, allowUnknown: false }
147
149
  );
148
150
  if (warrning) {
@@ -158,6 +160,7 @@ class Cart {
158
160
  query_params["b"] = b;
159
161
  query_params["area_code"] = areaCode;
160
162
  query_params["buy_now"] = buyNow;
163
+ query_params["id"] = id;
161
164
 
162
165
  const xHeaders = {};
163
166
 
@@ -402,7 +405,72 @@ class Cart {
402
405
 
403
406
  /**
404
407
  * @param {Object} arg - Arg object.
405
- * @param {number} [arg.id] - The unique identifier of the cart.
408
+ * @param {boolean} [arg.buyNow] - This indicates the type of cart to checkout
409
+ * @param {CartCheckoutDetailV2Request} arg.body
410
+ * @returns {Promise<CartCheckoutResponse>} - Success response
411
+ * @summary: Checkout all items in the cart
412
+ * @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.
413
+ */
414
+ async checkoutCartV2({ body, buyNow } = {}) {
415
+ const { error } = CartValidator.checkoutCartV2().validate(
416
+ { body, buyNow },
417
+ { abortEarly: false, allowUnknown: true }
418
+ );
419
+ if (error) {
420
+ return Promise.reject(new FDKClientValidationError(error));
421
+ }
422
+
423
+ // Showing warrnings if extra unknown parameters are found
424
+ const { error: warrning } = CartValidator.checkoutCartV2().validate(
425
+ { body, buyNow },
426
+ { abortEarly: false, allowUnknown: false }
427
+ );
428
+ if (warrning) {
429
+ Logger({
430
+ level: "WARN",
431
+ message: "Parameter Validation warrnings for checkoutCartV2",
432
+ });
433
+ Logger({ level: "WARN", message: warrning });
434
+ }
435
+
436
+ const query_params = {};
437
+ query_params["buy_now"] = buyNow;
438
+
439
+ const xHeaders = {};
440
+
441
+ const response = await ApplicationAPIClient.execute(
442
+ this._conf,
443
+ "post",
444
+ constructUrl({
445
+ url: this._urls["checkoutCartV2"],
446
+ params: {},
447
+ }),
448
+ query_params,
449
+ body,
450
+ xHeaders
451
+ );
452
+
453
+ const {
454
+ error: res_error,
455
+ } = CartModel.CartCheckoutResponse().validate(response, {
456
+ abortEarly: false,
457
+ allowUnknown: false,
458
+ });
459
+
460
+ if (res_error) {
461
+ Logger({
462
+ level: "WARN",
463
+ message: "Response Validation Warnnings for checkoutCartV2",
464
+ });
465
+ Logger({ level: "WARN", message: res_error });
466
+ }
467
+
468
+ return response;
469
+ }
470
+
471
+ /**
472
+ * @param {Object} arg - Arg object.
473
+ * @param {string} [arg.id] - The unique identifier of the cart.
406
474
  * @returns {Promise<DeleteCartDetailResponse>} - Success response
407
475
  * @summary: Delete cart once user made successful checkout
408
476
  * @description: Use this API to delete the cart.
@@ -1172,13 +1240,14 @@ class Cart {
1172
1240
  * /service/application/catalog/v1.0/products/
1173
1241
  * @param {number} [arg.pageSize] - Number of offers to be fetched to show
1174
1242
  * @param {string} [arg.promotionGroup] - Type of promotion groups
1243
+ * @param {number} [arg.storeId] - Store id
1175
1244
  * @returns {Promise<PromotionOffersResponse>} - Success response
1176
1245
  * @summary: Fetch available promotions
1177
1246
  * @description: Use this API to get top 5 offers available for current product
1178
1247
  */
1179
- async getPromotionOffers({ slug, pageSize, promotionGroup } = {}) {
1248
+ async getPromotionOffers({ slug, pageSize, promotionGroup, storeId } = {}) {
1180
1249
  const { error } = CartValidator.getPromotionOffers().validate(
1181
- { slug, pageSize, promotionGroup },
1250
+ { slug, pageSize, promotionGroup, storeId },
1182
1251
  { abortEarly: false, allowUnknown: true }
1183
1252
  );
1184
1253
  if (error) {
@@ -1187,7 +1256,7 @@ class Cart {
1187
1256
 
1188
1257
  // Showing warrnings if extra unknown parameters are found
1189
1258
  const { error: warrning } = CartValidator.getPromotionOffers().validate(
1190
- { slug, pageSize, promotionGroup },
1259
+ { slug, pageSize, promotionGroup, storeId },
1191
1260
  { abortEarly: false, allowUnknown: false }
1192
1261
  );
1193
1262
  if (warrning) {
@@ -1202,6 +1271,7 @@ class Cart {
1202
1271
  query_params["slug"] = slug;
1203
1272
  query_params["page_size"] = pageSize;
1204
1273
  query_params["promotion_group"] = promotionGroup;
1274
+ query_params["store_id"] = storeId;
1205
1275
 
1206
1276
  const xHeaders = {};
1207
1277
 
@@ -1244,13 +1314,17 @@ class Cart {
1244
1314
  * @param {string} [arg.addressId] - ID allotted to the selected address
1245
1315
  * @param {string} [arg.areaCode] - The PIN Code of the destination address,
1246
1316
  * e.g. 400059
1317
+ * @param {string} [arg.orderType] - The order type of shipment HomeDelivery
1318
+ * - If the customer wants the order home-delivered PickAtStore - If the
1319
+ * customer wants the handover of an order at the store itself. Digital -
1320
+ * If the customer wants to buy digital voucher ( for jiogames )
1247
1321
  * @returns {Promise<CartShipmentsResponse>} - Success response
1248
1322
  * @summary: Get delivery date and options before checkout
1249
1323
  * @description: Use this API to get shipment details, expected delivery date, items and price breakup of the shipment.
1250
1324
  */
1251
- async getShipments({ p, id, buyNow, addressId, areaCode } = {}) {
1325
+ async getShipments({ p, id, buyNow, addressId, areaCode, orderType } = {}) {
1252
1326
  const { error } = CartValidator.getShipments().validate(
1253
- { p, id, buyNow, addressId, areaCode },
1327
+ { p, id, buyNow, addressId, areaCode, orderType },
1254
1328
  { abortEarly: false, allowUnknown: true }
1255
1329
  );
1256
1330
  if (error) {
@@ -1259,7 +1333,7 @@ class Cart {
1259
1333
 
1260
1334
  // Showing warrnings if extra unknown parameters are found
1261
1335
  const { error: warrning } = CartValidator.getShipments().validate(
1262
- { p, id, buyNow, addressId, areaCode },
1336
+ { p, id, buyNow, addressId, areaCode, orderType },
1263
1337
  { abortEarly: false, allowUnknown: false }
1264
1338
  );
1265
1339
  if (warrning) {
@@ -1276,6 +1350,7 @@ class Cart {
1276
1350
  query_params["buy_now"] = buyNow;
1277
1351
  query_params["address_id"] = addressId;
1278
1352
  query_params["area_code"] = areaCode;
1353
+ query_params["order_type"] = orderType;
1279
1354
 
1280
1355
  const xHeaders = {};
1281
1356
 
@@ -1854,6 +1929,10 @@ class Cart {
1854
1929
  * @param {string} [arg.paymentIdentifier] -
1855
1930
  * @param {string} [arg.aggregatorName] -
1856
1931
  * @param {string} [arg.merchantCode] -
1932
+ * @param {string} [arg.iin] -
1933
+ * @param {string} [arg.network] -
1934
+ * @param {string} [arg.type] -
1935
+ * @param {string} [arg.cardId] -
1857
1936
  * @returns {Promise<PaymentCouponValidate>} - Success response
1858
1937
  * @summary: Verify the coupon eligibility against the payment mode
1859
1938
  * @description: Use this API to validate a coupon against the payment mode such as NetBanking, Wallet, UPI etc.
@@ -1866,6 +1945,10 @@ class Cart {
1866
1945
  paymentIdentifier,
1867
1946
  aggregatorName,
1868
1947
  merchantCode,
1948
+ iin,
1949
+ network,
1950
+ type,
1951
+ cardId,
1869
1952
  } = {}) {
1870
1953
  const { error } = CartValidator.validateCouponForPayment().validate(
1871
1954
  {
@@ -1876,6 +1959,10 @@ class Cart {
1876
1959
  paymentIdentifier,
1877
1960
  aggregatorName,
1878
1961
  merchantCode,
1962
+ iin,
1963
+ network,
1964
+ type,
1965
+ cardId,
1879
1966
  },
1880
1967
  { abortEarly: false, allowUnknown: true }
1881
1968
  );
@@ -1895,6 +1982,10 @@ class Cart {
1895
1982
  paymentIdentifier,
1896
1983
  aggregatorName,
1897
1984
  merchantCode,
1985
+ iin,
1986
+ network,
1987
+ type,
1988
+ cardId,
1898
1989
  },
1899
1990
  { abortEarly: false, allowUnknown: false }
1900
1991
  );
@@ -1914,6 +2005,10 @@ class Cart {
1914
2005
  query_params["payment_identifier"] = paymentIdentifier;
1915
2006
  query_params["aggregator_name"] = aggregatorName;
1916
2007
  query_params["merchant_code"] = merchantCode;
2008
+ query_params["iin"] = iin;
2009
+ query_params["network"] = network;
2010
+ query_params["type"] = type;
2011
+ query_params["card_id"] = cardId;
1917
2012
 
1918
2013
  const xHeaders = {};
1919
2014
 
@@ -8,6 +8,7 @@ declare class CartModel {
8
8
  static AppliedFreeArticles(): any;
9
9
  static AppliedPromotion(): any;
10
10
  static ApplyCouponRequest(): any;
11
+ static ArticleGiftDetail(): any;
11
12
  static ArticlePriceInfo(): any;
12
13
  static BaseInfo(): any;
13
14
  static BasePrice(): any;
@@ -17,6 +18,7 @@ declare class CartModel {
17
18
  static CartBreakup(): any;
18
19
  static CartCheckoutCustomMeta(): any;
19
20
  static CartCheckoutDetailRequest(): any;
21
+ static CartCheckoutDetailV2Request(): any;
20
22
  static CartCheckoutResponse(): any;
21
23
  static CartCurrency(): any;
22
24
  static CartDetailResponse(): any;
@@ -32,8 +34,10 @@ declare class CartModel {
32
34
  static CheckCart(): any;
33
35
  static Coupon(): any;
34
36
  static CouponBreakup(): any;
37
+ static CouponDetails(): any;
35
38
  static CouponValidity(): any;
36
39
  static CurrencyInfo(): any;
40
+ static CustomerDetails(): any;
37
41
  static DeleteAddressResponse(): any;
38
42
  static DeleteCartDetailResponse(): any;
39
43
  static DiscountRulesApp(): any;
@@ -45,6 +49,7 @@ declare class CartModel {
45
49
  static GetCouponResponse(): any;
46
50
  static GetShareCartLinkRequest(): any;
47
51
  static GetShareCartLinkResponse(): any;
52
+ static GiftDetail(): any;
48
53
  static LadderOfferItem(): any;
49
54
  static LadderPrice(): any;
50
55
  static LadderPriceOffer(): any;
@@ -57,6 +62,8 @@ declare class CartModel {
57
62
  static Ownership(): any;
58
63
  static PageCoupon(): any;
59
64
  static PaymentCouponValidate(): any;
65
+ static PaymentMeta(): any;
66
+ static PaymentMethod(): any;
60
67
  static PaymentSelectionLock(): any;
61
68
  static ProductAction(): any;
62
69
  static ProductArticle(): any;
@@ -80,6 +87,8 @@ declare class CartModel {
80
87
  static ShipmentPromise(): any;
81
88
  static ShipmentResponse(): any;
82
89
  static StaffCheckout(): any;
90
+ static StoreInfo(): any;
91
+ static Tags(): any;
83
92
  static UpdateAddressResponse(): any;
84
93
  static UpdateCartDetailResponse(): any;
85
94
  static UpdateCartPaymentRequest(): any;