@gofynd/fdk-client-javascript 3.20.0 → 3.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/sdk/application/ApplicationAPIClient.d.ts +1 -1
- package/sdk/application/ApplicationClient.d.ts +1 -3
- package/sdk/application/ApplicationClient.js +0 -2
- package/sdk/application/Cart/CartApplicationClient.d.ts +2 -2
- package/sdk/application/Cart/CartApplicationClient.js +4 -0
- package/sdk/partner/OAuthClient.d.ts +3 -3
- package/sdk/partner/PartnerAPIClient.d.ts +1 -1
- package/sdk/partner/PartnerClient.d.ts +2 -2
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +3 -3
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +12 -0
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +21 -0
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +9 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +7 -0
- package/sdk/platform/Cart/CartPlatformModel.js +3 -0
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +9 -0
- package/sdk/platform/Communication/CommunicationPlatformModel.js +4 -0
- package/sdk/platform/OAuthClient.d.ts +3 -3
- package/sdk/platform/Order/OrderPlatformModel.d.ts +24 -0
- package/sdk/platform/Order/OrderPlatformModel.js +11 -0
- package/sdk/platform/PlatformAPIClient.d.ts +1 -1
- package/sdk/platform/PlatformClient.d.ts +2 -2
- package/sdk/public/PublicAPIClient.d.ts +1 -1
- package/sdk/application/Webhook/WebhookApplicationClient.d.ts +0 -19
- package/sdk/application/Webhook/WebhookApplicationClient.js +0 -72
package/README.md
CHANGED
|
@@ -234,7 +234,7 @@ console.log("Active Theme: ", response.information.name);
|
|
|
234
234
|
The above code will log the curl command in the console
|
|
235
235
|
|
|
236
236
|
```bash
|
|
237
|
-
curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 3.
|
|
237
|
+
curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 3.22.0' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
|
|
238
238
|
Active Theme: Emerge
|
|
239
239
|
```
|
|
240
240
|
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@ declare class APIClient {
|
|
|
12
12
|
* @param {object} body
|
|
13
13
|
* @param {object} xHeaders
|
|
14
14
|
*/
|
|
15
|
-
static execute(conf: object, method: string, url: string, query: object, body: object, xHeaders: object, options: any): Promise<import("axios").AxiosResponse<any, any
|
|
15
|
+
static execute(conf: object, method: string, url: string, query: object, body: object, xHeaders: object, options: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
16
16
|
}
|
|
17
17
|
declare namespace APIClient {
|
|
18
18
|
export { Options };
|
|
@@ -23,7 +23,6 @@ declare class ApplicationClient {
|
|
|
23
23
|
share: Share;
|
|
24
24
|
theme: Theme;
|
|
25
25
|
user: User;
|
|
26
|
-
webhook: Webhook;
|
|
27
26
|
/**
|
|
28
27
|
* Sets the cookie for the application.
|
|
29
28
|
*
|
|
@@ -62,7 +61,7 @@ declare class ApplicationClient {
|
|
|
62
61
|
body: any;
|
|
63
62
|
headers: any;
|
|
64
63
|
responseHeaders?: boolean;
|
|
65
|
-
}): Promise<import("axios").AxiosResponse<any, any
|
|
64
|
+
}): Promise<import("axios").AxiosResponse<any, any>>;
|
|
66
65
|
}
|
|
67
66
|
import ApplicationConfig = require("./ApplicationConfig");
|
|
68
67
|
import Cart = require("./Cart/CartApplicationClient");
|
|
@@ -80,4 +79,3 @@ import Payment = require("./Payment/PaymentApplicationClient");
|
|
|
80
79
|
import Share = require("./Share/ShareApplicationClient");
|
|
81
80
|
import Theme = require("./Theme/ThemeApplicationClient");
|
|
82
81
|
import User = require("./User/UserApplicationClient");
|
|
83
|
-
import Webhook = require("./Webhook/WebhookApplicationClient");
|
|
@@ -13,7 +13,6 @@ const Payment = require("./Payment/PaymentApplicationClient");
|
|
|
13
13
|
const Share = require("./Share/ShareApplicationClient");
|
|
14
14
|
const Theme = require("./Theme/ThemeApplicationClient");
|
|
15
15
|
const User = require("./User/UserApplicationClient");
|
|
16
|
-
const Webhook = require("./Webhook/WebhookApplicationClient");
|
|
17
16
|
const { FDKClientValidationError } = require("../common/FDKError");
|
|
18
17
|
const { Logger } = require("../common/Logger");
|
|
19
18
|
const { convertStringToBase64 } = require("../common/utils");
|
|
@@ -49,7 +48,6 @@ class ApplicationClient {
|
|
|
49
48
|
this.share = new Share(this.config);
|
|
50
49
|
this.theme = new Theme(this.config);
|
|
51
50
|
this.user = new User(this.config);
|
|
52
|
-
this.webhook = new Webhook(this.config);
|
|
53
51
|
}
|
|
54
52
|
|
|
55
53
|
/**
|
|
@@ -57,7 +57,7 @@ declare class Cart {
|
|
|
57
57
|
* @summary: Add items to a cart
|
|
58
58
|
* @description: Add product items to the customer's existing shopping cart. If there is no existing cart associated with the customer, it creates a new one and adds the items to it. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/addItems/).
|
|
59
59
|
*/
|
|
60
|
-
addItems({ body, xOrderingSource, i, b, areaCode, buyNow, id, orderType, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<AddCartDetailResult>;
|
|
60
|
+
addItems({ body, xOrderingSource, i, b, includeCartCalculation, areaCode, buyNow, id, orderType, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<AddCartDetailResult>;
|
|
61
61
|
/**
|
|
62
62
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
63
63
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
@@ -309,7 +309,7 @@ declare class Cart {
|
|
|
309
309
|
* @summary: Update cart items
|
|
310
310
|
* @description: Update cart. Customers can modify added product attributes such as quantity and size, as well as remove items from the cart. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/cart/updateCart/).
|
|
311
311
|
*/
|
|
312
|
-
updateCart({ body, xOrderingSource, id, i, b, areaCode, buyNow, cartType, orderType, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<UpdateCartDetailResult>;
|
|
312
|
+
updateCart({ body, xOrderingSource, id, i, b, includeCartCalculation, areaCode, buyNow, cartType, orderType, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<UpdateCartDetailResult>;
|
|
313
313
|
/**
|
|
314
314
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
315
315
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
@@ -118,6 +118,7 @@ class Cart {
|
|
|
118
118
|
xOrderingSource,
|
|
119
119
|
i,
|
|
120
120
|
b,
|
|
121
|
+
includeCartCalculation,
|
|
121
122
|
areaCode,
|
|
122
123
|
buyNow,
|
|
123
124
|
id,
|
|
@@ -129,6 +130,7 @@ class Cart {
|
|
|
129
130
|
const query_params = {};
|
|
130
131
|
query_params["i"] = i;
|
|
131
132
|
query_params["b"] = b;
|
|
133
|
+
query_params["include_cart_calculation"] = includeCartCalculation;
|
|
132
134
|
query_params["area_code"] = areaCode;
|
|
133
135
|
query_params["buy_now"] = buyNow;
|
|
134
136
|
query_params["id"] = id;
|
|
@@ -1377,6 +1379,7 @@ class Cart {
|
|
|
1377
1379
|
id,
|
|
1378
1380
|
i,
|
|
1379
1381
|
b,
|
|
1382
|
+
includeCartCalculation,
|
|
1380
1383
|
areaCode,
|
|
1381
1384
|
buyNow,
|
|
1382
1385
|
cartType,
|
|
@@ -1389,6 +1392,7 @@ class Cart {
|
|
|
1389
1392
|
query_params["id"] = id;
|
|
1390
1393
|
query_params["i"] = i;
|
|
1391
1394
|
query_params["b"] = b;
|
|
1395
|
+
query_params["include_cart_calculation"] = includeCartCalculation;
|
|
1392
1396
|
query_params["area_code"] = areaCode;
|
|
1393
1397
|
query_params["buy_now"] = buyNow;
|
|
1394
1398
|
query_params["cart_type"] = cartType;
|
|
@@ -8,8 +8,8 @@ declare class OAuthClient extends BaseOAuthClient {
|
|
|
8
8
|
grant_type: any;
|
|
9
9
|
refresh_token: any;
|
|
10
10
|
code: any;
|
|
11
|
-
}): Promise<import("axios").AxiosResponse<any, any
|
|
12
|
-
getOfflineAccessToken(scopes: any, code: any): Promise<import("axios").AxiosResponse<any, any
|
|
13
|
-
getOfflineAccessTokenObj(scopes: any, code: any): Promise<import("axios").AxiosResponse<any, any
|
|
11
|
+
}): Promise<import("axios").AxiosResponse<any, any>>;
|
|
12
|
+
getOfflineAccessToken(scopes: any, code: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
13
|
+
getOfflineAccessTokenObj(scopes: any, code: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
14
14
|
}
|
|
15
15
|
import BaseOAuthClient = require("../common/BaseOAuthClient");
|
|
@@ -13,7 +13,7 @@ declare class APIClient {
|
|
|
13
13
|
* @param {object} xHeaders
|
|
14
14
|
* @param {Options} options
|
|
15
15
|
*/
|
|
16
|
-
static execute(conf: object, method: string, url: string, query: object, body: object, xHeaders: object, options: Options): Promise<import("axios").AxiosResponse<any, any
|
|
16
|
+
static execute(conf: object, method: string, url: string, query: object, body: object, xHeaders: object, options: Options): Promise<import("axios").AxiosResponse<any, any>>;
|
|
17
17
|
get(url: any, config: any): Promise<any>;
|
|
18
18
|
}
|
|
19
19
|
declare namespace APIClient {
|
|
@@ -32,8 +32,8 @@ declare class PartnerClient {
|
|
|
32
32
|
body: any;
|
|
33
33
|
headers: any;
|
|
34
34
|
responseHeaders?: boolean;
|
|
35
|
-
}): Promise<import("axios").AxiosResponse<any, any
|
|
36
|
-
getAccesstokenObj(options: any): Promise<import("axios").AxiosResponse<any, any
|
|
35
|
+
}): Promise<import("axios").AxiosResponse<any, any>>;
|
|
36
|
+
getAccesstokenObj(options: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
37
37
|
setToken(token: any): void;
|
|
38
38
|
}
|
|
39
39
|
import PartnerConfig = require("./PartnerConfig");
|
|
@@ -476,7 +476,7 @@ declare class Cart {
|
|
|
476
476
|
* @summary: Add items to cart
|
|
477
477
|
* @description: Adds product items to a customer's shopping cart. If the customer does not have an existing cart, a new one is created automatically. - The `new_cart` flag forces creation of a new cart even if one already exists. - The `default_cart` flag determines whether the item is added to the user's default storefront-visible cart. If `true`, the item is added to the user's default cart that is accessible via the storefront. If `false`, an existing active cart is fetched if available; otherwise, a new hidden cart is created. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/cart/platformAddItems/).
|
|
478
478
|
*/
|
|
479
|
-
platformAddItems({ body, xOrderingSource, xAnonymousCart, i, b, buyNow, orderType, id, requestHeaders, }?: CartPlatformApplicationValidator.PlatformAddItemsParam, { responseHeaders }?: object): Promise<CartPlatformModel.AddCartDetailResult>;
|
|
479
|
+
platformAddItems({ body, xOrderingSource, xAnonymousCart, i, b, includeCartCalculation, buyNow, orderType, id, requestHeaders, }?: CartPlatformApplicationValidator.PlatformAddItemsParam, { responseHeaders }?: object): Promise<CartPlatformModel.AddCartDetailResult>;
|
|
480
480
|
/**
|
|
481
481
|
* @param {CartPlatformApplicationValidator.PlatformCheckoutCartParam} arg
|
|
482
482
|
* - Arg object
|
|
@@ -510,7 +510,7 @@ declare class Cart {
|
|
|
510
510
|
* @summary: Update cart items
|
|
511
511
|
* @description: Customers can modify added product attributes such as quantity and size, as well as remove items from the cart. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/cart/platformUpdateCart/).
|
|
512
512
|
*/
|
|
513
|
-
platformUpdateCart({ body, xOrderingSource, xAnonymousCart, id, i, orderType, b, buyNow, requestHeaders, }?: CartPlatformApplicationValidator.PlatformUpdateCartParam, { responseHeaders }?: object): Promise<CartPlatformModel.UpdateCartDetailResult>;
|
|
513
|
+
platformUpdateCart({ body, xOrderingSource, xAnonymousCart, id, i, orderType, b, includeCartCalculation, buyNow, requestHeaders, }?: CartPlatformApplicationValidator.PlatformUpdateCartParam, { responseHeaders }?: object): Promise<CartPlatformModel.UpdateCartDetailResult>;
|
|
514
514
|
/**
|
|
515
515
|
* @param {CartPlatformApplicationValidator.RemoveAddressParam} arg - Arg object
|
|
516
516
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -602,7 +602,7 @@ declare class Cart {
|
|
|
602
602
|
* @summary: Update cart breakup values
|
|
603
603
|
* @description: Updates the cart breakup based on the enabled features and user preferences. This endpoint allows customers to modify how their cart totals are calculated — including options such as applying store credits, loyalty points, discounts, and other promotional benefits. The API recalculates and returns the updated breakup reflecting the selected configurations in real-time. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/cart/updateCartBreakup/).
|
|
604
604
|
*/
|
|
605
|
-
updateCartBreakup({ body, xOrderingSource, xAnonymousCart, id, i, b, buyNow, requestHeaders, }?: CartPlatformApplicationValidator.UpdateCartBreakupParam, { responseHeaders }?: object): Promise<CartPlatformModel.CartDetailResult>;
|
|
605
|
+
updateCartBreakup({ body, xOrderingSource, xAnonymousCart, id, i, b, includeCartCalculation, buyNow, requestHeaders, }?: CartPlatformApplicationValidator.UpdateCartBreakupParam, { responseHeaders }?: object): Promise<CartPlatformModel.CartDetailResult>;
|
|
606
606
|
/**
|
|
607
607
|
* @param {CartPlatformApplicationValidator.UpdateCartMetaParam} arg - Arg object
|
|
608
608
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -3981,6 +3981,7 @@ class Cart {
|
|
|
3981
3981
|
xAnonymousCart,
|
|
3982
3982
|
i,
|
|
3983
3983
|
b,
|
|
3984
|
+
includeCartCalculation,
|
|
3984
3985
|
buyNow,
|
|
3985
3986
|
orderType,
|
|
3986
3987
|
id,
|
|
@@ -3997,6 +3998,7 @@ class Cart {
|
|
|
3997
3998
|
xAnonymousCart,
|
|
3998
3999
|
i,
|
|
3999
4000
|
b,
|
|
4001
|
+
includeCartCalculation,
|
|
4000
4002
|
buyNow,
|
|
4001
4003
|
orderType,
|
|
4002
4004
|
id,
|
|
@@ -4017,6 +4019,7 @@ class Cart {
|
|
|
4017
4019
|
xAnonymousCart,
|
|
4018
4020
|
i,
|
|
4019
4021
|
b,
|
|
4022
|
+
includeCartCalculation,
|
|
4020
4023
|
buyNow,
|
|
4021
4024
|
orderType,
|
|
4022
4025
|
id,
|
|
@@ -4033,6 +4036,7 @@ class Cart {
|
|
|
4033
4036
|
const query_params = {};
|
|
4034
4037
|
query_params["i"] = i;
|
|
4035
4038
|
query_params["b"] = b;
|
|
4039
|
+
query_params["include_cart_calculation"] = includeCartCalculation;
|
|
4036
4040
|
query_params["buy_now"] = buyNow;
|
|
4037
4041
|
query_params["order_type"] = orderType;
|
|
4038
4042
|
query_params["id"] = id;
|
|
@@ -4281,6 +4285,7 @@ class Cart {
|
|
|
4281
4285
|
i,
|
|
4282
4286
|
orderType,
|
|
4283
4287
|
b,
|
|
4288
|
+
includeCartCalculation,
|
|
4284
4289
|
buyNow,
|
|
4285
4290
|
requestHeaders,
|
|
4286
4291
|
} = { requestHeaders: {} },
|
|
@@ -4297,6 +4302,7 @@ class Cart {
|
|
|
4297
4302
|
i,
|
|
4298
4303
|
orderType,
|
|
4299
4304
|
b,
|
|
4305
|
+
includeCartCalculation,
|
|
4300
4306
|
buyNow,
|
|
4301
4307
|
},
|
|
4302
4308
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -4317,6 +4323,7 @@ class Cart {
|
|
|
4317
4323
|
i,
|
|
4318
4324
|
orderType,
|
|
4319
4325
|
b,
|
|
4326
|
+
includeCartCalculation,
|
|
4320
4327
|
buyNow,
|
|
4321
4328
|
},
|
|
4322
4329
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -4333,6 +4340,7 @@ class Cart {
|
|
|
4333
4340
|
query_params["i"] = i;
|
|
4334
4341
|
query_params["order_type"] = orderType;
|
|
4335
4342
|
query_params["b"] = b;
|
|
4343
|
+
query_params["include_cart_calculation"] = includeCartCalculation;
|
|
4336
4344
|
query_params["buy_now"] = buyNow;
|
|
4337
4345
|
|
|
4338
4346
|
const response = await PlatformAPIClient.execute(
|
|
@@ -5091,6 +5099,7 @@ class Cart {
|
|
|
5091
5099
|
id,
|
|
5092
5100
|
i,
|
|
5093
5101
|
b,
|
|
5102
|
+
includeCartCalculation,
|
|
5094
5103
|
buyNow,
|
|
5095
5104
|
requestHeaders,
|
|
5096
5105
|
} = { requestHeaders: {} },
|
|
@@ -5106,6 +5115,7 @@ class Cart {
|
|
|
5106
5115
|
id,
|
|
5107
5116
|
i,
|
|
5108
5117
|
b,
|
|
5118
|
+
includeCartCalculation,
|
|
5109
5119
|
buyNow,
|
|
5110
5120
|
},
|
|
5111
5121
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -5125,6 +5135,7 @@ class Cart {
|
|
|
5125
5135
|
id,
|
|
5126
5136
|
i,
|
|
5127
5137
|
b,
|
|
5138
|
+
includeCartCalculation,
|
|
5128
5139
|
buyNow,
|
|
5129
5140
|
},
|
|
5130
5141
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -5140,6 +5151,7 @@ class Cart {
|
|
|
5140
5151
|
query_params["id"] = id;
|
|
5141
5152
|
query_params["i"] = i;
|
|
5142
5153
|
query_params["b"] = b;
|
|
5154
|
+
query_params["include_cart_calculation"] = includeCartCalculation;
|
|
5143
5155
|
query_params["buy_now"] = buyNow;
|
|
5144
5156
|
|
|
5145
5157
|
const response = await PlatformAPIClient.execute(
|
|
@@ -332,6 +332,8 @@ export = CartPlatformApplicationValidator;
|
|
|
332
332
|
* all the items added in the cart.
|
|
333
333
|
* @property {boolean} [b] - This is a boolean value. Select `true` to retrieve
|
|
334
334
|
* the price breakup of cart items.
|
|
335
|
+
* @property {boolean} [includeCartCalculation] - Set to `false` to skip
|
|
336
|
+
* recalculating and fetching the updated cart after the edit. Defaults to `true`.
|
|
335
337
|
* @property {boolean} [buyNow] - This is a boolen value. Select `true` to
|
|
336
338
|
* set/initialize buy now cart
|
|
337
339
|
* @property {string} [orderType] - The order type of shipment HomeDelivery - If
|
|
@@ -379,6 +381,8 @@ export = CartPlatformApplicationValidator;
|
|
|
379
381
|
* wants the handover of an order at the store itself.
|
|
380
382
|
* @property {boolean} [b] - This is a boolean value. Select `true` to retrieve
|
|
381
383
|
* the price breakup of cart items.
|
|
384
|
+
* @property {boolean} [includeCartCalculation] - Set to `false` to skip
|
|
385
|
+
* recalculating and fetching the updated cart after the edit. Defaults to `true`.
|
|
382
386
|
* @property {boolean} [buyNow] - This is a boolen value. Select `true` to
|
|
383
387
|
* set/initialize buy now cart
|
|
384
388
|
* @property {CartPlatformModel.PlatformUpdateCartDetails} body
|
|
@@ -461,6 +465,8 @@ export = CartPlatformApplicationValidator;
|
|
|
461
465
|
* to the cart in the response.
|
|
462
466
|
* @property {boolean} [b] - Set to `true` to include the detailed price breakup
|
|
463
467
|
* of each cart item in the response.
|
|
468
|
+
* @property {boolean} [includeCartCalculation] - Set to `false` to skip
|
|
469
|
+
* recalculating and fetching the updated cart after the edit. Defaults to `true`.
|
|
464
470
|
* @property {boolean} [buyNow] - Set to `true` to initialize a "Buy Now" cart
|
|
465
471
|
* flow, enabling direct checkout for a single item.
|
|
466
472
|
* @property {CartPlatformModel.UpdateCartBreakup} body
|
|
@@ -1189,6 +1195,11 @@ type PlatformAddItemsParam = {
|
|
|
1189
1195
|
* the price breakup of cart items.
|
|
1190
1196
|
*/
|
|
1191
1197
|
b?: boolean;
|
|
1198
|
+
/**
|
|
1199
|
+
* - Set to `false` to skip
|
|
1200
|
+
* recalculating and fetching the updated cart after the edit. Defaults to `true`.
|
|
1201
|
+
*/
|
|
1202
|
+
includeCartCalculation?: boolean;
|
|
1192
1203
|
/**
|
|
1193
1204
|
* - This is a boolen value. Select `true` to
|
|
1194
1205
|
* set/initialize buy now cart
|
|
@@ -1284,6 +1295,11 @@ type PlatformUpdateCartParam = {
|
|
|
1284
1295
|
* the price breakup of cart items.
|
|
1285
1296
|
*/
|
|
1286
1297
|
b?: boolean;
|
|
1298
|
+
/**
|
|
1299
|
+
* - Set to `false` to skip
|
|
1300
|
+
* recalculating and fetching the updated cart after the edit. Defaults to `true`.
|
|
1301
|
+
*/
|
|
1302
|
+
includeCartCalculation?: boolean;
|
|
1287
1303
|
/**
|
|
1288
1304
|
* - This is a boolen value. Select `true` to
|
|
1289
1305
|
* set/initialize buy now cart
|
|
@@ -1408,6 +1424,11 @@ type UpdateCartBreakupParam = {
|
|
|
1408
1424
|
* of each cart item in the response.
|
|
1409
1425
|
*/
|
|
1410
1426
|
b?: boolean;
|
|
1427
|
+
/**
|
|
1428
|
+
* - Set to `false` to skip
|
|
1429
|
+
* recalculating and fetching the updated cart after the edit. Defaults to `true`.
|
|
1430
|
+
*/
|
|
1431
|
+
includeCartCalculation?: boolean;
|
|
1411
1432
|
/**
|
|
1412
1433
|
* - Set to `true` to initialize a "Buy Now" cart
|
|
1413
1434
|
* flow, enabling direct checkout for a single item.
|
|
@@ -379,6 +379,8 @@ const CartPlatformModel = require("./CartPlatformModel");
|
|
|
379
379
|
* all the items added in the cart.
|
|
380
380
|
* @property {boolean} [b] - This is a boolean value. Select `true` to retrieve
|
|
381
381
|
* the price breakup of cart items.
|
|
382
|
+
* @property {boolean} [includeCartCalculation] - Set to `false` to skip
|
|
383
|
+
* recalculating and fetching the updated cart after the edit. Defaults to `true`.
|
|
382
384
|
* @property {boolean} [buyNow] - This is a boolen value. Select `true` to
|
|
383
385
|
* set/initialize buy now cart
|
|
384
386
|
* @property {string} [orderType] - The order type of shipment HomeDelivery - If
|
|
@@ -429,6 +431,8 @@ const CartPlatformModel = require("./CartPlatformModel");
|
|
|
429
431
|
* wants the handover of an order at the store itself.
|
|
430
432
|
* @property {boolean} [b] - This is a boolean value. Select `true` to retrieve
|
|
431
433
|
* the price breakup of cart items.
|
|
434
|
+
* @property {boolean} [includeCartCalculation] - Set to `false` to skip
|
|
435
|
+
* recalculating and fetching the updated cart after the edit. Defaults to `true`.
|
|
432
436
|
* @property {boolean} [buyNow] - This is a boolen value. Select `true` to
|
|
433
437
|
* set/initialize buy now cart
|
|
434
438
|
* @property {CartPlatformModel.PlatformUpdateCartDetails} body
|
|
@@ -520,6 +524,8 @@ const CartPlatformModel = require("./CartPlatformModel");
|
|
|
520
524
|
* to the cart in the response.
|
|
521
525
|
* @property {boolean} [b] - Set to `true` to include the detailed price breakup
|
|
522
526
|
* of each cart item in the response.
|
|
527
|
+
* @property {boolean} [includeCartCalculation] - Set to `false` to skip
|
|
528
|
+
* recalculating and fetching the updated cart after the edit. Defaults to `true`.
|
|
523
529
|
* @property {boolean} [buyNow] - Set to `true` to initialize a "Buy Now" cart
|
|
524
530
|
* flow, enabling direct checkout for a single item.
|
|
525
531
|
* @property {CartPlatformModel.UpdateCartBreakup} body
|
|
@@ -1063,6 +1069,7 @@ class CartPlatformApplicationValidator {
|
|
|
1063
1069
|
|
|
1064
1070
|
i: Joi.boolean(),
|
|
1065
1071
|
b: Joi.boolean(),
|
|
1072
|
+
includeCartCalculation: Joi.boolean(),
|
|
1066
1073
|
buyNow: Joi.boolean(),
|
|
1067
1074
|
orderType: Joi.string().allow(""),
|
|
1068
1075
|
id: Joi.string().allow(""),
|
|
@@ -1104,6 +1111,7 @@ class CartPlatformApplicationValidator {
|
|
|
1104
1111
|
i: Joi.boolean(),
|
|
1105
1112
|
orderType: Joi.string().allow(""),
|
|
1106
1113
|
b: Joi.boolean(),
|
|
1114
|
+
includeCartCalculation: Joi.boolean(),
|
|
1107
1115
|
buyNow: Joi.boolean(),
|
|
1108
1116
|
body: CartPlatformModel.PlatformUpdateCartDetails().required(),
|
|
1109
1117
|
}).required();
|
|
@@ -1200,6 +1208,7 @@ class CartPlatformApplicationValidator {
|
|
|
1200
1208
|
id: Joi.string().allow(""),
|
|
1201
1209
|
i: Joi.boolean(),
|
|
1202
1210
|
b: Joi.boolean(),
|
|
1211
|
+
includeCartCalculation: Joi.boolean(),
|
|
1203
1212
|
buyNow: Joi.boolean(),
|
|
1204
1213
|
body: CartPlatformModel.UpdateCartBreakup().required(),
|
|
1205
1214
|
}).required();
|
|
@@ -773,6 +773,8 @@ export = CartPlatformModel;
|
|
|
773
773
|
* below this threshold, the price adjustment will be automatically removed.
|
|
774
774
|
* (Applicable only for price adjustment discount type)
|
|
775
775
|
* @property {number} [article_index] - Index of the line item in the cart
|
|
776
|
+
* @property {string} [identifier] - Cart line item identifier (prefixed with
|
|
777
|
+
* 'cart:') used to uniquely target a specific line item.
|
|
776
778
|
*/
|
|
777
779
|
/**
|
|
778
780
|
* @typedef PriceAdjustmentRestrictions
|
|
@@ -4746,6 +4748,11 @@ type Article = {
|
|
|
4746
4748
|
* - Index of the line item in the cart
|
|
4747
4749
|
*/
|
|
4748
4750
|
article_index?: number;
|
|
4751
|
+
/**
|
|
4752
|
+
* - Cart line item identifier (prefixed with
|
|
4753
|
+
* 'cart:') used to uniquely target a specific line item.
|
|
4754
|
+
*/
|
|
4755
|
+
identifier?: string;
|
|
4749
4756
|
};
|
|
4750
4757
|
/** @returns {PriceAdjustmentRestrictions} */
|
|
4751
4758
|
declare function PriceAdjustmentRestrictions(): PriceAdjustmentRestrictions;
|
|
@@ -837,6 +837,8 @@ const Joi = require("joi");
|
|
|
837
837
|
* below this threshold, the price adjustment will be automatically removed.
|
|
838
838
|
* (Applicable only for price adjustment discount type)
|
|
839
839
|
* @property {number} [article_index] - Index of the line item in the cart
|
|
840
|
+
* @property {string} [identifier] - Cart line item identifier (prefixed with
|
|
841
|
+
* 'cart:') used to uniquely target a specific line item.
|
|
840
842
|
*/
|
|
841
843
|
|
|
842
844
|
/**
|
|
@@ -3938,6 +3940,7 @@ class CartPlatformModel {
|
|
|
3938
3940
|
allowed_refund: Joi.boolean(),
|
|
3939
3941
|
min_price_threshold: Joi.number(),
|
|
3940
3942
|
article_index: Joi.number(),
|
|
3943
|
+
identifier: Joi.string().allow(""),
|
|
3941
3944
|
});
|
|
3942
3945
|
}
|
|
3943
3946
|
|
|
@@ -625,6 +625,9 @@ export = CommunicationPlatformModel;
|
|
|
625
625
|
* @property {string} [mobile]
|
|
626
626
|
* @property {string} [country_code]
|
|
627
627
|
* @property {string} [to]
|
|
628
|
+
* @property {Object} [additional_template_variables] - Additional key-value
|
|
629
|
+
* pairs for personalizing message content. Values can be of any type and will
|
|
630
|
+
* be substituted into the communication templates when rendering the message.
|
|
628
631
|
*/
|
|
629
632
|
/**
|
|
630
633
|
* @typedef SendOtpCommsReqSms
|
|
@@ -1666,6 +1669,12 @@ type SendOtpCommsReqData = {
|
|
|
1666
1669
|
mobile?: string;
|
|
1667
1670
|
country_code?: string;
|
|
1668
1671
|
to?: string;
|
|
1672
|
+
/**
|
|
1673
|
+
* - Additional key-value
|
|
1674
|
+
* pairs for personalizing message content. Values can be of any type and will
|
|
1675
|
+
* be substituted into the communication templates when rendering the message.
|
|
1676
|
+
*/
|
|
1677
|
+
additional_template_variables?: any;
|
|
1669
1678
|
};
|
|
1670
1679
|
/** @returns {SendOtpCommsReqSms} */
|
|
1671
1680
|
declare function SendOtpCommsReqSms(): SendOtpCommsReqSms;
|
|
@@ -715,6 +715,9 @@ const Joi = require("joi");
|
|
|
715
715
|
* @property {string} [mobile]
|
|
716
716
|
* @property {string} [country_code]
|
|
717
717
|
* @property {string} [to]
|
|
718
|
+
* @property {Object} [additional_template_variables] - Additional key-value
|
|
719
|
+
* pairs for personalizing message content. Values can be of any type and will
|
|
720
|
+
* be substituted into the communication templates when rendering the message.
|
|
718
721
|
*/
|
|
719
722
|
|
|
720
723
|
/**
|
|
@@ -1940,6 +1943,7 @@ class CommunicationPlatformModel {
|
|
|
1940
1943
|
mobile: Joi.string().allow(""),
|
|
1941
1944
|
country_code: Joi.string().allow(""),
|
|
1942
1945
|
to: Joi.string().allow(""),
|
|
1946
|
+
additional_template_variables: Joi.object().pattern(/\S/, Joi.any()),
|
|
1943
1947
|
});
|
|
1944
1948
|
}
|
|
1945
1949
|
|
|
@@ -20,7 +20,7 @@ declare class OAuthClient {
|
|
|
20
20
|
grant_type: any;
|
|
21
21
|
refresh_token: any;
|
|
22
22
|
code: any;
|
|
23
|
-
}): Promise<import("axios").AxiosResponse<any, any
|
|
24
|
-
getOfflineAccessToken(scopes: any, code: any): Promise<import("axios").AxiosResponse<any, any
|
|
25
|
-
getOfflineAccessTokenObj(scopes: any, code: any): Promise<import("axios").AxiosResponse<any, any
|
|
23
|
+
}): Promise<import("axios").AxiosResponse<any, any>>;
|
|
24
|
+
getOfflineAccessToken(scopes: any, code: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
25
|
+
getOfflineAccessTokenObj(scopes: any, code: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
26
26
|
}
|
|
@@ -3372,6 +3372,15 @@ export = OrderPlatformModel;
|
|
|
3372
3372
|
* acquire or produce the product before margin or discount.
|
|
3373
3373
|
* @property {number} [loyalty_discount] - Amount reduced from the payable price
|
|
3374
3374
|
* when the customer applies loyalty program points while placing the order.
|
|
3375
|
+
* @property {number} [marketplace_promotion_effective_discount] - The share of
|
|
3376
|
+
* the promotion discount funded by the marketplace or platform (e.g., Fynd).
|
|
3377
|
+
* Marketplace promotions are created and funded by the platform itself to
|
|
3378
|
+
* drive sales, attract customers, or run platform-wide campaigns. The cost of
|
|
3379
|
+
* these promotions is borne by the marketplace, not the seller.
|
|
3380
|
+
* @property {number} [seller_promotion_effective_discount] - The share of the
|
|
3381
|
+
* promotion discount funded by the seller. Seller promotions are created and
|
|
3382
|
+
* funded by the individual seller or brand to boost their own product sales.
|
|
3383
|
+
* The cost of these promotions is borne entirely by the seller.
|
|
3375
3384
|
*/
|
|
3376
3385
|
/**
|
|
3377
3386
|
* @typedef ChargeDistributionSchema
|
|
@@ -12588,6 +12597,21 @@ type Prices = {
|
|
|
12588
12597
|
* when the customer applies loyalty program points while placing the order.
|
|
12589
12598
|
*/
|
|
12590
12599
|
loyalty_discount?: number;
|
|
12600
|
+
/**
|
|
12601
|
+
* - The share of
|
|
12602
|
+
* the promotion discount funded by the marketplace or platform (e.g., Fynd).
|
|
12603
|
+
* Marketplace promotions are created and funded by the platform itself to
|
|
12604
|
+
* drive sales, attract customers, or run platform-wide campaigns. The cost of
|
|
12605
|
+
* these promotions is borne by the marketplace, not the seller.
|
|
12606
|
+
*/
|
|
12607
|
+
marketplace_promotion_effective_discount?: number;
|
|
12608
|
+
/**
|
|
12609
|
+
* - The share of the
|
|
12610
|
+
* promotion discount funded by the seller. Seller promotions are created and
|
|
12611
|
+
* funded by the individual seller or brand to boost their own product sales.
|
|
12612
|
+
* The cost of these promotions is borne entirely by the seller.
|
|
12613
|
+
*/
|
|
12614
|
+
seller_promotion_effective_discount?: number;
|
|
12591
12615
|
};
|
|
12592
12616
|
/** @returns {ChargeDistributionSchema} */
|
|
12593
12617
|
declare function ChargeDistributionSchema(): ChargeDistributionSchema;
|
|
@@ -3664,6 +3664,15 @@ const Joi = require("joi");
|
|
|
3664
3664
|
* acquire or produce the product before margin or discount.
|
|
3665
3665
|
* @property {number} [loyalty_discount] - Amount reduced from the payable price
|
|
3666
3666
|
* when the customer applies loyalty program points while placing the order.
|
|
3667
|
+
* @property {number} [marketplace_promotion_effective_discount] - The share of
|
|
3668
|
+
* the promotion discount funded by the marketplace or platform (e.g., Fynd).
|
|
3669
|
+
* Marketplace promotions are created and funded by the platform itself to
|
|
3670
|
+
* drive sales, attract customers, or run platform-wide campaigns. The cost of
|
|
3671
|
+
* these promotions is borne by the marketplace, not the seller.
|
|
3672
|
+
* @property {number} [seller_promotion_effective_discount] - The share of the
|
|
3673
|
+
* promotion discount funded by the seller. Seller promotions are created and
|
|
3674
|
+
* funded by the individual seller or brand to boost their own product sales.
|
|
3675
|
+
* The cost of these promotions is borne entirely by the seller.
|
|
3667
3676
|
*/
|
|
3668
3677
|
|
|
3669
3678
|
/**
|
|
@@ -9357,6 +9366,8 @@ class OrderPlatformModel {
|
|
|
9357
9366
|
amount_to_be_collected: Joi.number().allow(null),
|
|
9358
9367
|
cost_price: Joi.number().allow(null),
|
|
9359
9368
|
loyalty_discount: Joi.number(),
|
|
9369
|
+
marketplace_promotion_effective_discount: Joi.number().allow(null),
|
|
9370
|
+
seller_promotion_effective_discount: Joi.number().allow(null),
|
|
9360
9371
|
});
|
|
9361
9372
|
}
|
|
9362
9373
|
|
|
@@ -13,7 +13,7 @@ declare class APIClient {
|
|
|
13
13
|
* @param {object} xHeaders
|
|
14
14
|
* @param {Options} options
|
|
15
15
|
*/
|
|
16
|
-
static execute(conf: object, method: string, url: string, query: object, body: object, xHeaders: object, options: Options): Promise<import("axios").AxiosResponse<any, any
|
|
16
|
+
static execute(conf: object, method: string, url: string, query: object, body: object, xHeaders: object, options: Options): Promise<import("axios").AxiosResponse<any, any>>;
|
|
17
17
|
get(url: any, config: any): Promise<any>;
|
|
18
18
|
}
|
|
19
19
|
declare namespace APIClient {
|
|
@@ -52,8 +52,8 @@ declare class PlatformClient {
|
|
|
52
52
|
body: any;
|
|
53
53
|
headers: any;
|
|
54
54
|
responseHeaders?: boolean;
|
|
55
|
-
}): Promise<import("axios").AxiosResponse<any, any
|
|
56
|
-
getAccesstokenObj(options: any): Promise<import("axios").AxiosResponse<any, any
|
|
55
|
+
}): Promise<import("axios").AxiosResponse<any, any>>;
|
|
56
|
+
getAccesstokenObj(options: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
57
57
|
setToken(token: any): void;
|
|
58
58
|
}
|
|
59
59
|
import PlatformConfig = require("./PlatformConfig");
|
|
@@ -11,7 +11,7 @@ declare class PublicAPIClient {
|
|
|
11
11
|
* @param {object} query
|
|
12
12
|
* @param {object} body
|
|
13
13
|
*/
|
|
14
|
-
static execute(conf: object, method: string, url: string, query: object, body: object, xHeaders: any, options: any): Promise<import("axios").AxiosResponse<any, any
|
|
14
|
+
static execute(conf: object, method: string, url: string, query: object, body: object, xHeaders: any, options: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
15
15
|
}
|
|
16
16
|
declare namespace PublicAPIClient {
|
|
17
17
|
export { Options };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export = Webhook;
|
|
2
|
-
declare class Webhook {
|
|
3
|
-
constructor(_conf: any);
|
|
4
|
-
_conf: any;
|
|
5
|
-
_relativeUrls: {
|
|
6
|
-
saveClickEvent: string;
|
|
7
|
-
};
|
|
8
|
-
_urls: {};
|
|
9
|
-
updateUrls(urls: any): void;
|
|
10
|
-
/**
|
|
11
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
12
|
-
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
13
|
-
* @returns {Promise<ClickEventDetails>} - Success response
|
|
14
|
-
* @name saveClickEvent
|
|
15
|
-
* @summary: Capture and save click events from various sales channels
|
|
16
|
-
* @description: Send click events from various sales channels to enable insightful data collection and analysis. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/webhook/saveClickEvent/).
|
|
17
|
-
*/
|
|
18
|
-
saveClickEvent({ body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<ClickEventDetails>;
|
|
19
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
const {
|
|
2
|
-
FDKClientValidationError,
|
|
3
|
-
FDKResponseValidationError,
|
|
4
|
-
} = require("../../common/FDKError");
|
|
5
|
-
|
|
6
|
-
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
7
|
-
const constructUrl = require("../constructUrl");
|
|
8
|
-
const Paginator = require("../../common/Paginator");
|
|
9
|
-
const { validateRequiredParams } = require("../../common/Validator");
|
|
10
|
-
|
|
11
|
-
class Webhook {
|
|
12
|
-
constructor(_conf) {
|
|
13
|
-
this._conf = _conf;
|
|
14
|
-
this._relativeUrls = {
|
|
15
|
-
saveClickEvent:
|
|
16
|
-
"/service/application/webhook/v1.0/click-analytics/events",
|
|
17
|
-
};
|
|
18
|
-
this._urls = Object.entries(this._relativeUrls).reduce(
|
|
19
|
-
(urls, [method, relativeUrl]) => {
|
|
20
|
-
urls[method] = `${_conf.domain}${relativeUrl}`;
|
|
21
|
-
return urls;
|
|
22
|
-
},
|
|
23
|
-
{}
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
updateUrls(urls) {
|
|
28
|
-
this._urls = {
|
|
29
|
-
...this._urls,
|
|
30
|
-
...urls,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
36
|
-
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
37
|
-
* @returns {Promise<ClickEventDetails>} - Success response
|
|
38
|
-
* @name saveClickEvent
|
|
39
|
-
* @summary: Capture and save click events from various sales channels
|
|
40
|
-
* @description: Send click events from various sales channels to enable insightful data collection and analysis. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/webhook/saveClickEvent/).
|
|
41
|
-
*/
|
|
42
|
-
async saveClickEvent(
|
|
43
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
44
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
45
|
-
) {
|
|
46
|
-
const query_params = {};
|
|
47
|
-
|
|
48
|
-
const xHeaders = {};
|
|
49
|
-
|
|
50
|
-
const response = await ApplicationAPIClient.execute(
|
|
51
|
-
this._conf,
|
|
52
|
-
"post",
|
|
53
|
-
constructUrl({
|
|
54
|
-
url: this._urls["saveClickEvent"],
|
|
55
|
-
params: {},
|
|
56
|
-
}),
|
|
57
|
-
query_params,
|
|
58
|
-
body,
|
|
59
|
-
{ ...xHeaders, ...requestHeaders },
|
|
60
|
-
{ responseHeaders }
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
let responseData = response;
|
|
64
|
-
if (responseHeaders) {
|
|
65
|
-
responseData = response[0];
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return response;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
module.exports = Webhook;
|