@gofynd/fdk-client-javascript 1.1.2 → 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.
- package/README.md +1 -2
- package/index.d.ts +4 -7
- package/index.js +5 -12
- package/package.json +1 -1
- package/sdk/application/ApplicationClient.d.ts +20 -20
- package/sdk/application/ApplicationClient.js +26 -26
- package/sdk/application/Cart/CartApplicationClient.d.ts +36 -6
- package/sdk/application/Cart/CartApplicationClient.js +105 -10
- package/sdk/application/Cart/CartApplicationModel.d.ts +9 -0
- package/sdk/application/Cart/CartApplicationModel.js +105 -1
- package/sdk/application/Cart/CartApplicationValidator.d.ts +1 -0
- package/sdk/application/Cart/CartApplicationValidator.js +15 -1
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +1 -0
- package/sdk/application/Catalog/CatalogApplicationModel.js +13 -0
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +14 -10
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +16 -10
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +1 -0
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +1 -0
- package/sdk/application/Content/ContentApplicationModel.js +3 -1
- package/sdk/application/Logistic/LogisticApplicationModel.js +3 -2
- package/sdk/application/Order/OrderApplicationClient.d.ts +2 -2
- package/sdk/application/Order/OrderApplicationClient.js +2 -2
- package/sdk/application/Order/OrderApplicationModel.js +18 -8
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +35 -0
- package/sdk/application/Payment/PaymentApplicationClient.js +200 -0
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +4 -0
- package/sdk/application/Payment/PaymentApplicationModel.js +58 -7
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +3 -0
- package/sdk/application/Payment/PaymentApplicationValidator.js +19 -0
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +16 -3
- package/sdk/application/PosCart/PosCartApplicationClient.js +39 -6
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +6 -0
- package/sdk/application/PosCart/PosCartApplicationModel.js +63 -1
- package/sdk/application/PosCart/PosCartApplicationValidator.js +6 -0
- package/sdk/application/index.d.ts +10 -10
- package/sdk/application/index.js +13 -13
- package/sdk/common/Constant.d.ts +5 -0
- package/sdk/common/Constant.js +5 -0
- package/sdk/platform/Billing/BillingPlatformModel.js +6 -1
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +459 -2
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +2480 -340
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +29 -0
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +250 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +52 -0
- package/sdk/platform/Cart/CartPlatformModel.js +580 -2
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +8 -2
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +10 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +1 -0
- package/sdk/platform/Catalog/CatalogPlatformClient.js +2 -2
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1 -0
- package/sdk/platform/Catalog/CatalogPlatformModel.js +41 -29
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1 -0
- package/sdk/platform/Communication/CommunicationPlatformModel.js +9 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +2 -2
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +2 -2
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +5 -4
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +99 -78
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +99 -78
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +87 -71
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +87 -71
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +2 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +26 -0
- package/sdk/platform/Content/ContentPlatformModel.js +3 -1
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +135 -0
- package/sdk/platform/Finance/FinancePlatformClient.js +853 -0
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +51 -0
- package/sdk/platform/Finance/FinancePlatformModel.js +342 -0
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +16 -0
- package/sdk/platform/Finance/FinancePlatformValidator.js +84 -0
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +11 -1
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +66 -2
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -0
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -0
- package/sdk/platform/Order/OrderPlatformClient.d.ts +159 -79
- package/sdk/platform/Order/OrderPlatformClient.js +541 -114
- package/sdk/platform/Order/OrderPlatformModel.d.ts +42 -6
- package/sdk/platform/Order/OrderPlatformModel.js +569 -159
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +6 -0
- package/sdk/platform/Order/OrderPlatformValidator.js +51 -9
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +22 -0
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +127 -0
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +2 -0
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +13 -0
- package/sdk/platform/Partner/PartnerPlatformClient.d.ts +145 -0
- package/sdk/platform/Partner/PartnerPlatformClient.js +799 -0
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +39 -0
- package/sdk/platform/Partner/PartnerPlatformModel.js +367 -0
- package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +14 -0
- package/sdk/platform/Partner/PartnerPlatformValidator.js +87 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +221 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +1476 -190
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +20 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +126 -0
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +44 -0
- package/sdk/platform/Payment/PaymentPlatformModel.js +410 -0
- package/sdk/platform/PlatformApplicationClient.d.ts +1149 -938
- package/sdk/platform/PlatformApplicationClient.js +1259 -1035
- package/sdk/platform/PlatformClient.d.ts +9888 -8286
- package/sdk/platform/PlatformClient.js +10960 -9038
- package/sdk/platform/index.d.ts +15 -14
- package/sdk/platform/index.js +20 -18
- package/sdk/public/PublicClient.d.ts +2 -2
- package/sdk/public/PublicClient.js +4 -4
- package/sdk/public/index.d.ts +1 -1
- package/sdk/public/index.js +2 -2
- package/partner.d.ts +0 -4
- package/partner.js +0 -7
- package/sdk/partner/OAuthClient.d.ts +0 -14
- package/sdk/partner/OAuthClient.js +0 -112
- package/sdk/partner/PartnerAPIClient.d.ts +0 -12
- package/sdk/partner/PartnerAPIClient.js +0 -42
- package/sdk/partner/PartnerClient.d.ts +0 -6
- package/sdk/partner/PartnerClient.js +0 -17
- package/sdk/partner/PartnerConfig.d.ts +0 -30
- package/sdk/partner/PartnerConfig.js +0 -39
- package/sdk/partner/index.d.ts +0 -3
- 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
|
-
- [
|
|
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 {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
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 {
|
|
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
|
-
|
|
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
|
-
|
|
35
|
-
PartnerClient,
|
|
36
|
-
PartnerModel,
|
|
27
|
+
PublicConfig,
|
|
28
|
+
PublicClient,
|
|
29
|
+
PublicModel,
|
|
37
30
|
|
|
38
31
|
|
|
39
32
|
FdkAxios: fdkAxios,
|
package/package.json
CHANGED
|
@@ -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
|
-
|
|
10
|
+
content: Content;
|
|
11
|
+
fileStorage: FileStorage;
|
|
12
|
+
lead: Lead;
|
|
13
|
+
logistic: Logistic;
|
|
17
14
|
order: Order;
|
|
18
|
-
|
|
15
|
+
payment: Payment;
|
|
19
16
|
posCart: PosCart;
|
|
20
|
-
|
|
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
|
|
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
|
|
36
|
+
import Payment = require("./Payment/PaymentApplicationClient");
|
|
40
37
|
import PosCart = require("./PosCart/PosCartApplicationClient");
|
|
41
|
-
import
|
|
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
|
|
5
|
+
const Catalog = require("./Catalog/CatalogApplicationClient");
|
|
8
6
|
|
|
9
|
-
const
|
|
7
|
+
const Common = require("./Common/CommonApplicationClient");
|
|
10
8
|
|
|
11
|
-
const
|
|
9
|
+
const Communication = require("./Communication/CommunicationApplicationClient");
|
|
12
10
|
|
|
13
|
-
const
|
|
11
|
+
const Configuration = require("./Configuration/ConfigurationApplicationClient");
|
|
14
12
|
|
|
15
13
|
const Content = require("./Content/ContentApplicationClient");
|
|
16
14
|
|
|
17
|
-
const
|
|
15
|
+
const FileStorage = require("./FileStorage/FileStorageApplicationClient");
|
|
18
16
|
|
|
19
|
-
const
|
|
17
|
+
const Lead = require("./Lead/LeadApplicationClient");
|
|
20
18
|
|
|
21
|
-
const
|
|
19
|
+
const Logistic = require("./Logistic/LogisticApplicationClient");
|
|
22
20
|
|
|
23
|
-
const
|
|
21
|
+
const Order = require("./Order/OrderApplicationClient");
|
|
24
22
|
|
|
25
23
|
const Payment = require("./Payment/PaymentApplicationClient");
|
|
26
24
|
|
|
27
|
-
const
|
|
25
|
+
const PosCart = require("./PosCart/PosCartApplicationClient");
|
|
28
26
|
|
|
29
27
|
const Rewards = require("./Rewards/RewardsApplicationClient");
|
|
30
28
|
|
|
31
|
-
const
|
|
29
|
+
const Share = require("./Share/ShareApplicationClient");
|
|
32
30
|
|
|
33
|
-
const
|
|
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.
|
|
43
|
+
this.catalog = new Catalog(config);
|
|
46
44
|
|
|
47
|
-
this.
|
|
45
|
+
this.common = new Common(config);
|
|
48
46
|
|
|
49
|
-
this.
|
|
47
|
+
this.communication = new Communication(config);
|
|
50
48
|
|
|
51
|
-
this.
|
|
49
|
+
this.configuration = new Configuration(config);
|
|
52
50
|
|
|
53
51
|
this.content = new Content(config);
|
|
54
52
|
|
|
55
|
-
this.
|
|
53
|
+
this.fileStorage = new FileStorage(config);
|
|
56
54
|
|
|
57
|
-
this.
|
|
55
|
+
this.lead = new Lead(config);
|
|
58
56
|
|
|
59
|
-
this.
|
|
57
|
+
this.logistic = new Logistic(config);
|
|
60
58
|
|
|
61
|
-
this.
|
|
59
|
+
this.order = new Order(config);
|
|
62
60
|
|
|
63
61
|
this.payment = new Payment(config);
|
|
64
62
|
|
|
65
|
-
this.
|
|
63
|
+
this.posCart = new PosCart(config);
|
|
66
64
|
|
|
67
65
|
this.rewards = new Rewards(config);
|
|
68
66
|
|
|
69
|
-
this.
|
|
67
|
+
this.share = new Share(config);
|
|
70
68
|
|
|
71
|
-
this.
|
|
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 {
|
|
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?:
|
|
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 {
|
|
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;
|