@gofynd/fdk-client-javascript 1.1.1 → 1.1.3

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 (140) hide show
  1. package/README.md +1 -2
  2. package/index.d.ts +4 -7
  3. package/index.js +5 -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 +45 -4
  8. package/sdk/application/Cart/CartApplicationClient.js +169 -9
  9. package/sdk/application/Cart/CartApplicationModel.d.ts +15 -0
  10. package/sdk/application/Cart/CartApplicationModel.js +177 -1
  11. package/sdk/application/Cart/CartApplicationValidator.d.ts +2 -0
  12. package/sdk/application/Cart/CartApplicationValidator.js +20 -0
  13. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +14 -4
  14. package/sdk/application/Catalog/CatalogApplicationClient.js +18 -6
  15. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +1 -0
  16. package/sdk/application/Catalog/CatalogApplicationModel.js +13 -0
  17. package/sdk/application/Catalog/CatalogApplicationValidator.js +2 -0
  18. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +14 -10
  19. package/sdk/application/Configuration/ConfigurationApplicationClient.js +16 -10
  20. package/sdk/application/Configuration/ConfigurationApplicationModel.js +1 -0
  21. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +1 -0
  22. package/sdk/application/Content/ContentApplicationModel.js +4 -1
  23. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +8 -2
  24. package/sdk/application/FileStorage/FileStorageApplicationClient.js +8 -2
  25. package/sdk/application/FileStorage/FileStorageApplicationModel.js +2 -2
  26. package/sdk/application/Logistic/LogisticApplicationModel.js +3 -2
  27. package/sdk/application/Order/OrderApplicationClient.d.ts +17 -2
  28. package/sdk/application/Order/OrderApplicationClient.js +70 -2
  29. package/sdk/application/Order/OrderApplicationModel.d.ts +17 -0
  30. package/sdk/application/Order/OrderApplicationModel.js +129 -8
  31. package/sdk/application/Order/OrderApplicationValidator.d.ts +1 -0
  32. package/sdk/application/Order/OrderApplicationValidator.js +7 -0
  33. package/sdk/application/Payment/PaymentApplicationClient.d.ts +35 -0
  34. package/sdk/application/Payment/PaymentApplicationClient.js +200 -0
  35. package/sdk/application/Payment/PaymentApplicationModel.d.ts +4 -0
  36. package/sdk/application/Payment/PaymentApplicationModel.js +58 -7
  37. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +3 -0
  38. package/sdk/application/Payment/PaymentApplicationValidator.js +19 -0
  39. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +16 -3
  40. package/sdk/application/PosCart/PosCartApplicationClient.js +39 -6
  41. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +10 -0
  42. package/sdk/application/PosCart/PosCartApplicationModel.js +113 -1
  43. package/sdk/application/PosCart/PosCartApplicationValidator.js +6 -0
  44. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +8 -8
  45. package/sdk/application/Rewards/RewardsApplicationClient.js +8 -8
  46. package/sdk/application/index.d.ts +10 -10
  47. package/sdk/application/index.js +13 -13
  48. package/sdk/common/AxiosHelper.js +1 -1
  49. package/sdk/common/Constant.d.ts +5 -0
  50. package/sdk/common/Constant.js +5 -0
  51. package/sdk/platform/Billing/BillingPlatformModel.js +6 -1
  52. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +479 -0
  53. package/sdk/platform/Cart/CartPlatformApplicationClient.js +2574 -307
  54. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +31 -0
  55. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +263 -0
  56. package/sdk/platform/Cart/CartPlatformModel.d.ts +61 -0
  57. package/sdk/platform/Cart/CartPlatformModel.js +697 -2
  58. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +8 -2
  59. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +10 -0
  60. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +1 -0
  61. package/sdk/platform/Catalog/CatalogPlatformClient.js +2 -2
  62. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1 -0
  63. package/sdk/platform/Catalog/CatalogPlatformModel.js +41 -29
  64. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1 -0
  65. package/sdk/platform/Communication/CommunicationPlatformModel.js +9 -0
  66. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +2 -2
  67. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +2 -2
  68. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +5 -4
  69. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +99 -78
  70. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +99 -78
  71. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +87 -71
  72. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +87 -71
  73. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +2 -0
  74. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +26 -0
  75. package/sdk/platform/Content/ContentPlatformModel.js +4 -1
  76. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +10 -4
  77. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +15 -9
  78. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
  79. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +1 -1
  80. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +8 -2
  81. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +8 -2
  82. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +2 -2
  83. package/sdk/platform/Finance/FinancePlatformClient.d.ts +135 -0
  84. package/sdk/platform/Finance/FinancePlatformClient.js +853 -0
  85. package/sdk/platform/Finance/FinancePlatformModel.d.ts +51 -0
  86. package/sdk/platform/Finance/FinancePlatformModel.js +342 -0
  87. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +16 -0
  88. package/sdk/platform/Finance/FinancePlatformValidator.js +84 -0
  89. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +11 -1
  90. package/sdk/platform/Order/OrderPlatformApplicationClient.js +66 -2
  91. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -0
  92. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -0
  93. package/sdk/platform/Order/OrderPlatformClient.d.ts +161 -81
  94. package/sdk/platform/Order/OrderPlatformClient.js +546 -119
  95. package/sdk/platform/Order/OrderPlatformModel.d.ts +42 -6
  96. package/sdk/platform/Order/OrderPlatformModel.js +570 -158
  97. package/sdk/platform/Order/OrderPlatformValidator.d.ts +6 -0
  98. package/sdk/platform/Order/OrderPlatformValidator.js +52 -10
  99. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +22 -0
  100. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +127 -0
  101. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +2 -0
  102. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +13 -0
  103. package/sdk/platform/Partner/PartnerPlatformClient.d.ts +145 -0
  104. package/sdk/platform/Partner/PartnerPlatformClient.js +799 -0
  105. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +39 -0
  106. package/sdk/platform/Partner/PartnerPlatformModel.js +367 -0
  107. package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +14 -0
  108. package/sdk/platform/Partner/PartnerPlatformValidator.js +87 -0
  109. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +221 -0
  110. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +1476 -190
  111. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +20 -0
  112. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +126 -0
  113. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +44 -0
  114. package/sdk/platform/Payment/PaymentPlatformModel.js +410 -0
  115. package/sdk/platform/PlatformApplicationClient.d.ts +1149 -930
  116. package/sdk/platform/PlatformApplicationClient.js +1260 -1027
  117. package/sdk/platform/PlatformClient.d.ts +10360 -8660
  118. package/sdk/platform/PlatformClient.js +11126 -9093
  119. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +14 -26
  120. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +14 -74
  121. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +0 -1
  122. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +0 -7
  123. package/sdk/platform/index.d.ts +15 -14
  124. package/sdk/platform/index.js +20 -18
  125. package/sdk/public/PublicClient.d.ts +2 -2
  126. package/sdk/public/PublicClient.js +4 -4
  127. package/sdk/public/index.d.ts +1 -1
  128. package/sdk/public/index.js +2 -2
  129. package/partner.d.ts +0 -4
  130. package/partner.js +0 -7
  131. package/sdk/partner/OAuthClient.d.ts +0 -14
  132. package/sdk/partner/OAuthClient.js +0 -112
  133. package/sdk/partner/PartnerAPIClient.d.ts +0 -12
  134. package/sdk/partner/PartnerAPIClient.js +0 -42
  135. package/sdk/partner/PartnerClient.d.ts +0 -6
  136. package/sdk/partner/PartnerClient.js +0 -17
  137. package/sdk/partner/PartnerConfig.d.ts +0 -30
  138. package/sdk/partner/PartnerConfig.js +0 -39
  139. package/sdk/partner/index.d.ts +0 -3
  140. package/sdk/partner/index.js +0 -5
package/README.md CHANGED
@@ -183,8 +183,7 @@ 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
187
  - [Platform Front](documentation/platform/README.md)
189
- - [Partner Front](documentation/partner/README.md)
188
+ - [Public Front](documentation/public/README.md)
190
189
 
package/index.d.ts CHANGED
@@ -1,16 +1,13 @@
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
4
  import { PlatformConfig } from "./sdk/platform";
8
5
  import { PlatformClient } from "./sdk/platform";
9
6
  import { PlatformModel } from "./sdk/platform";
10
- import { PartnerConfig } from "./sdk/partner";
11
- import { PartnerClient } from "./sdk/partner";
12
- import { PartnerModel } from "./sdk/partner";
7
+ import { PublicConfig } from "./sdk/public";
8
+ import { PublicClient } from "./sdk/public";
9
+ import { PublicModel } from "./sdk/public";
13
10
  import { fdkAxios } from "./sdk/common/AxiosHelper";
14
11
  import Utility = require("./sdk/common/Utility");
15
12
  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 };
13
+ export { ApplicationConfig, ApplicationClient, ApplicationModel, PlatformConfig, PlatformClient, PlatformModel, PublicConfig, PublicClient, PublicModel, fdkAxios as FdkAxios, Utility, Constant };
package/index.js CHANGED
@@ -1,9 +1,8 @@
1
1
 
2
- const { PublicConfig, PublicClient, PublicModel } = require('./sdk/public');
2
+
3
3
  const { ApplicationConfig, ApplicationClient, ApplicationModel } = require('./sdk/application');
4
4
  const { PlatformConfig, PlatformClient, PlatformModel } = require('./sdk/platform');
5
-
6
- const { PartnerConfig, PartnerClient, PartnerModel } = require('./sdk/partner');
5
+ const { PublicConfig, PublicClient, PublicModel } = require('./sdk/public');
7
6
  const {fdkAxios} = require('./sdk/common/AxiosHelper');
8
7
  const Utility = require('./sdk/common/Utility');
9
8
  const Constant = require('./sdk/common/Constant');
@@ -11,10 +10,6 @@ const Constant = require('./sdk/common/Constant');
11
10
  module.exports = {
12
11
 
13
12
 
14
- PublicConfig,
15
- PublicClient,
16
- PublicModel,
17
-
18
13
 
19
14
 
20
15
  ApplicationConfig,
@@ -29,11 +24,9 @@ module.exports = {
29
24
 
30
25
 
31
26
 
32
-
33
-
34
- PartnerConfig,
35
- PartnerClient,
36
- PartnerModel,
27
+ PublicConfig,
28
+ PublicClient,
29
+ PublicModel,
37
30
 
38
31
 
39
32
  FdkAxios: fdkAxios,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gofynd/fdk-client-javascript",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
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,8 @@ declare class Cart {
8
8
  applyCoupon: string;
9
9
  applyRewardPoints: string;
10
10
  checkoutCart: string;
11
+ checkoutCartV2: string;
12
+ deleteCart: string;
11
13
  getAddressById: string;
12
14
  getAddresses: string;
13
15
  getBulkDiscountOffers: string;
@@ -48,16 +50,18 @@ declare class Cart {
48
50
  * @param {boolean} [arg.b] -
49
51
  * @param {string} [arg.areaCode] -
50
52
  * @param {boolean} [arg.buyNow] -
53
+ * @param {string} [arg.id] -
51
54
  * @param {AddCartRequest} arg.body
52
55
  * @returns {Promise<AddCartDetailResponse>} - Success response
53
56
  * @summary: Add items to cart
54
57
  * @description: Use this API to add items to the cart.
55
58
  */
56
- addItems({ body, i, b, areaCode, buyNow }?: {
59
+ addItems({ body, i, b, areaCode, buyNow, id }?: {
57
60
  i?: boolean;
58
61
  b?: boolean;
59
62
  areaCode?: string;
60
63
  buyNow?: boolean;
64
+ id?: string;
61
65
  body: AddCartRequest;
62
66
  }): Promise<AddCartDetailResponse>;
63
67
  /**
@@ -110,6 +114,28 @@ declare class Cart {
110
114
  buyNow?: boolean;
111
115
  body: CartCheckoutDetailRequest;
112
116
  }): Promise<CartCheckoutResponse>;
117
+ /**
118
+ * @param {Object} arg - Arg object.
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.
132
+ * @returns {Promise<DeleteCartDetailResponse>} - Success response
133
+ * @summary: Delete cart once user made successful checkout
134
+ * @description: Use this API to delete the cart.
135
+ */
136
+ deleteCart({ id }?: {
137
+ id?: string;
138
+ }): Promise<DeleteCartDetailResponse>;
113
139
  /**
114
140
  * @param {Object} arg - Arg object.
115
141
  * @param {string} arg.id -
@@ -271,14 +297,16 @@ declare class Cart {
271
297
  * /service/application/catalog/v1.0/products/
272
298
  * @param {number} [arg.pageSize] - Number of offers to be fetched to show
273
299
  * @param {string} [arg.promotionGroup] - Type of promotion groups
300
+ * @param {number} [arg.storeId] - Store id
274
301
  * @returns {Promise<PromotionOffersResponse>} - Success response
275
302
  * @summary: Fetch available promotions
276
303
  * @description: Use this API to get top 5 offers available for current product
277
304
  */
278
- getPromotionOffers({ slug, pageSize, promotionGroup }?: {
305
+ getPromotionOffers({ slug, pageSize, promotionGroup, storeId }?: {
279
306
  slug?: string;
280
307
  pageSize?: number;
281
308
  promotionGroup?: string;
309
+ storeId?: number;
282
310
  }): Promise<PromotionOffersResponse>;
283
311
  /**
284
312
  * @param {Object} arg - Arg object.
@@ -289,16 +317,21 @@ declare class Cart {
289
317
  * @param {string} [arg.addressId] - ID allotted to the selected address
290
318
  * @param {string} [arg.areaCode] - The PIN Code of the destination address,
291
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 )
292
324
  * @returns {Promise<CartShipmentsResponse>} - Success response
293
325
  * @summary: Get delivery date and options before checkout
294
326
  * @description: Use this API to get shipment details, expected delivery date, items and price breakup of the shipment.
295
327
  */
296
- getShipments({ p, id, buyNow, addressId, areaCode }?: {
328
+ getShipments({ p, id, buyNow, addressId, areaCode, orderType }?: {
297
329
  p?: boolean;
298
330
  id?: string;
299
331
  buyNow?: boolean;
300
332
  addressId?: string;
301
333
  areaCode?: string;
334
+ orderType?: string;
302
335
  }): Promise<CartShipmentsResponse>;
303
336
  /**
304
337
  * @param {Object} arg - Arg object.
@@ -422,11 +455,15 @@ declare class Cart {
422
455
  * @param {string} [arg.paymentIdentifier] -
423
456
  * @param {string} [arg.aggregatorName] -
424
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] -
425
462
  * @returns {Promise<PaymentCouponValidate>} - Success response
426
463
  * @summary: Verify the coupon eligibility against the payment mode
427
464
  * @description: Use this API to validate a coupon against the payment mode such as NetBanking, Wallet, UPI etc.
428
465
  */
429
- validateCouponForPayment({ id, buyNow, addressId, paymentMode, paymentIdentifier, aggregatorName, merchantCode, }?: {
466
+ validateCouponForPayment({ id, buyNow, addressId, paymentMode, paymentIdentifier, aggregatorName, merchantCode, iin, network, type, cardId, }?: {
430
467
  id?: string;
431
468
  buyNow?: boolean;
432
469
  addressId?: string;
@@ -434,5 +471,9 @@ declare class Cart {
434
471
  paymentIdentifier?: string;
435
472
  aggregatorName?: string;
436
473
  merchantCode?: string;
474
+ iin?: string;
475
+ network?: string;
476
+ type?: string;
477
+ cardId?: string;
437
478
  }): Promise<PaymentCouponValidate>;
438
479
  }
@@ -16,6 +16,8 @@ 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",
20
+ deleteCart: "/service/application/cart/v1.0/cart_archive",
19
21
  getAddressById: "/service/application/cart/v1.0/address/{id}",
20
22
  getAddresses: "/service/application/cart/v1.0/address",
21
23
  getBulkDiscountOffers: "/service/application/cart/v1.0/bulk-price",
@@ -125,14 +127,15 @@ class Cart {
125
127
  * @param {boolean} [arg.b] -
126
128
  * @param {string} [arg.areaCode] -
127
129
  * @param {boolean} [arg.buyNow] -
130
+ * @param {string} [arg.id] -
128
131
  * @param {AddCartRequest} arg.body
129
132
  * @returns {Promise<AddCartDetailResponse>} - Success response
130
133
  * @summary: Add items to cart
131
134
  * @description: Use this API to add items to the cart.
132
135
  */
133
- async addItems({ body, i, b, areaCode, buyNow } = {}) {
136
+ async addItems({ body, i, b, areaCode, buyNow, id } = {}) {
134
137
  const { error } = CartValidator.addItems().validate(
135
- { body, i, b, areaCode, buyNow },
138
+ { body, i, b, areaCode, buyNow, id },
136
139
  { abortEarly: false, allowUnknown: true }
137
140
  );
138
141
  if (error) {
@@ -141,7 +144,7 @@ class Cart {
141
144
 
142
145
  // Showing warrnings if extra unknown parameters are found
143
146
  const { error: warrning } = CartValidator.addItems().validate(
144
- { body, i, b, areaCode, buyNow },
147
+ { body, i, b, areaCode, buyNow, id },
145
148
  { abortEarly: false, allowUnknown: false }
146
149
  );
147
150
  if (warrning) {
@@ -157,6 +160,7 @@ class Cart {
157
160
  query_params["b"] = b;
158
161
  query_params["area_code"] = areaCode;
159
162
  query_params["buy_now"] = buyNow;
163
+ query_params["id"] = id;
160
164
 
161
165
  const xHeaders = {};
162
166
 
@@ -399,6 +403,135 @@ class Cart {
399
403
  return response;
400
404
  }
401
405
 
406
+ /**
407
+ * @param {Object} arg - Arg object.
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.
474
+ * @returns {Promise<DeleteCartDetailResponse>} - Success response
475
+ * @summary: Delete cart once user made successful checkout
476
+ * @description: Use this API to delete the cart.
477
+ */
478
+ async deleteCart({ id } = {}) {
479
+ const { error } = CartValidator.deleteCart().validate(
480
+ { id },
481
+ { abortEarly: false, allowUnknown: true }
482
+ );
483
+ if (error) {
484
+ return Promise.reject(new FDKClientValidationError(error));
485
+ }
486
+
487
+ // Showing warrnings if extra unknown parameters are found
488
+ const { error: warrning } = CartValidator.deleteCart().validate(
489
+ { id },
490
+ { abortEarly: false, allowUnknown: false }
491
+ );
492
+ if (warrning) {
493
+ Logger({
494
+ level: "WARN",
495
+ message: "Parameter Validation warrnings for deleteCart",
496
+ });
497
+ Logger({ level: "WARN", message: warrning });
498
+ }
499
+
500
+ const query_params = {};
501
+ query_params["id"] = id;
502
+
503
+ const xHeaders = {};
504
+
505
+ const response = await ApplicationAPIClient.execute(
506
+ this._conf,
507
+ "put",
508
+ constructUrl({
509
+ url: this._urls["deleteCart"],
510
+ params: {},
511
+ }),
512
+ query_params,
513
+ undefined,
514
+ xHeaders
515
+ );
516
+
517
+ const {
518
+ error: res_error,
519
+ } = CartModel.DeleteCartDetailResponse().validate(response, {
520
+ abortEarly: false,
521
+ allowUnknown: false,
522
+ });
523
+
524
+ if (res_error) {
525
+ Logger({
526
+ level: "WARN",
527
+ message: "Response Validation Warnnings for deleteCart",
528
+ });
529
+ Logger({ level: "WARN", message: res_error });
530
+ }
531
+
532
+ return response;
533
+ }
534
+
402
535
  /**
403
536
  * @param {Object} arg - Arg object.
404
537
  * @param {string} arg.id -
@@ -1107,13 +1240,14 @@ class Cart {
1107
1240
  * /service/application/catalog/v1.0/products/
1108
1241
  * @param {number} [arg.pageSize] - Number of offers to be fetched to show
1109
1242
  * @param {string} [arg.promotionGroup] - Type of promotion groups
1243
+ * @param {number} [arg.storeId] - Store id
1110
1244
  * @returns {Promise<PromotionOffersResponse>} - Success response
1111
1245
  * @summary: Fetch available promotions
1112
1246
  * @description: Use this API to get top 5 offers available for current product
1113
1247
  */
1114
- async getPromotionOffers({ slug, pageSize, promotionGroup } = {}) {
1248
+ async getPromotionOffers({ slug, pageSize, promotionGroup, storeId } = {}) {
1115
1249
  const { error } = CartValidator.getPromotionOffers().validate(
1116
- { slug, pageSize, promotionGroup },
1250
+ { slug, pageSize, promotionGroup, storeId },
1117
1251
  { abortEarly: false, allowUnknown: true }
1118
1252
  );
1119
1253
  if (error) {
@@ -1122,7 +1256,7 @@ class Cart {
1122
1256
 
1123
1257
  // Showing warrnings if extra unknown parameters are found
1124
1258
  const { error: warrning } = CartValidator.getPromotionOffers().validate(
1125
- { slug, pageSize, promotionGroup },
1259
+ { slug, pageSize, promotionGroup, storeId },
1126
1260
  { abortEarly: false, allowUnknown: false }
1127
1261
  );
1128
1262
  if (warrning) {
@@ -1137,6 +1271,7 @@ class Cart {
1137
1271
  query_params["slug"] = slug;
1138
1272
  query_params["page_size"] = pageSize;
1139
1273
  query_params["promotion_group"] = promotionGroup;
1274
+ query_params["store_id"] = storeId;
1140
1275
 
1141
1276
  const xHeaders = {};
1142
1277
 
@@ -1179,13 +1314,17 @@ class Cart {
1179
1314
  * @param {string} [arg.addressId] - ID allotted to the selected address
1180
1315
  * @param {string} [arg.areaCode] - The PIN Code of the destination address,
1181
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 )
1182
1321
  * @returns {Promise<CartShipmentsResponse>} - Success response
1183
1322
  * @summary: Get delivery date and options before checkout
1184
1323
  * @description: Use this API to get shipment details, expected delivery date, items and price breakup of the shipment.
1185
1324
  */
1186
- async getShipments({ p, id, buyNow, addressId, areaCode } = {}) {
1325
+ async getShipments({ p, id, buyNow, addressId, areaCode, orderType } = {}) {
1187
1326
  const { error } = CartValidator.getShipments().validate(
1188
- { p, id, buyNow, addressId, areaCode },
1327
+ { p, id, buyNow, addressId, areaCode, orderType },
1189
1328
  { abortEarly: false, allowUnknown: true }
1190
1329
  );
1191
1330
  if (error) {
@@ -1194,7 +1333,7 @@ class Cart {
1194
1333
 
1195
1334
  // Showing warrnings if extra unknown parameters are found
1196
1335
  const { error: warrning } = CartValidator.getShipments().validate(
1197
- { p, id, buyNow, addressId, areaCode },
1336
+ { p, id, buyNow, addressId, areaCode, orderType },
1198
1337
  { abortEarly: false, allowUnknown: false }
1199
1338
  );
1200
1339
  if (warrning) {
@@ -1211,6 +1350,7 @@ class Cart {
1211
1350
  query_params["buy_now"] = buyNow;
1212
1351
  query_params["address_id"] = addressId;
1213
1352
  query_params["area_code"] = areaCode;
1353
+ query_params["order_type"] = orderType;
1214
1354
 
1215
1355
  const xHeaders = {};
1216
1356
 
@@ -1789,6 +1929,10 @@ class Cart {
1789
1929
  * @param {string} [arg.paymentIdentifier] -
1790
1930
  * @param {string} [arg.aggregatorName] -
1791
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] -
1792
1936
  * @returns {Promise<PaymentCouponValidate>} - Success response
1793
1937
  * @summary: Verify the coupon eligibility against the payment mode
1794
1938
  * @description: Use this API to validate a coupon against the payment mode such as NetBanking, Wallet, UPI etc.
@@ -1801,6 +1945,10 @@ class Cart {
1801
1945
  paymentIdentifier,
1802
1946
  aggregatorName,
1803
1947
  merchantCode,
1948
+ iin,
1949
+ network,
1950
+ type,
1951
+ cardId,
1804
1952
  } = {}) {
1805
1953
  const { error } = CartValidator.validateCouponForPayment().validate(
1806
1954
  {
@@ -1811,6 +1959,10 @@ class Cart {
1811
1959
  paymentIdentifier,
1812
1960
  aggregatorName,
1813
1961
  merchantCode,
1962
+ iin,
1963
+ network,
1964
+ type,
1965
+ cardId,
1814
1966
  },
1815
1967
  { abortEarly: false, allowUnknown: true }
1816
1968
  );
@@ -1830,6 +1982,10 @@ class Cart {
1830
1982
  paymentIdentifier,
1831
1983
  aggregatorName,
1832
1984
  merchantCode,
1985
+ iin,
1986
+ network,
1987
+ type,
1988
+ cardId,
1833
1989
  },
1834
1990
  { abortEarly: false, allowUnknown: false }
1835
1991
  );
@@ -1849,6 +2005,10 @@ class Cart {
1849
2005
  query_params["payment_identifier"] = paymentIdentifier;
1850
2006
  query_params["aggregator_name"] = aggregatorName;
1851
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;
1852
2012
 
1853
2013
  const xHeaders = {};
1854
2014