@gofynd/fdk-client-javascript 1.4.7 → 1.4.8-beta.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 -1
- package/package.json +1 -1
- package/sdk/application/Cart/CartApplicationClient.d.ts +16 -3
- package/sdk/application/Cart/CartApplicationClient.js +118 -13
- package/sdk/application/Cart/CartApplicationModel.d.ts +121 -45
- package/sdk/application/Cart/CartApplicationModel.js +98 -26
- package/sdk/application/Cart/CartApplicationValidator.d.ts +45 -1
- package/sdk/application/Cart/CartApplicationValidator.js +26 -0
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +4 -2
- package/sdk/application/Catalog/CatalogApplicationModel.js +4 -2
- package/sdk/application/Content/ContentApplicationClient.d.ts +1 -1
- package/sdk/application/Content/ContentApplicationClient.js +5 -3
- package/sdk/application/Content/ContentApplicationModel.d.ts +7 -18
- package/sdk/application/Content/ContentApplicationModel.js +6 -20
- package/sdk/application/Content/ContentApplicationValidator.d.ts +10 -0
- package/sdk/application/Content/ContentApplicationValidator.js +4 -0
- package/sdk/application/Lead/LeadApplicationClient.d.ts +0 -27
- package/sdk/application/Lead/LeadApplicationClient.js +0 -167
- package/sdk/application/Lead/LeadApplicationModel.d.ts +1 -146
- package/sdk/application/Lead/LeadApplicationModel.js +0 -126
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +1 -25
- package/sdk/application/Lead/LeadApplicationValidator.js +0 -24
- package/sdk/application/Logistic/LogisticApplicationClient.js +1 -1
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +2 -0
- package/sdk/application/Logistic/LogisticApplicationModel.js +2 -0
- package/sdk/application/Order/OrderApplicationModel.d.ts +4 -0
- package/sdk/application/Order/OrderApplicationModel.js +4 -0
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +9 -2
- package/sdk/application/Payment/PaymentApplicationModel.js +5 -2
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +2 -0
- package/sdk/application/Theme/ThemeApplicationModel.js +2 -0
- package/sdk/partner/Lead/LeadPartnerClient.d.ts +0 -23
- package/sdk/partner/Lead/LeadPartnerClient.js +0 -157
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +12 -581
- package/sdk/partner/Lead/LeadPartnerModel.js +14 -403
- package/sdk/partner/Lead/LeadPartnerValidator.d.ts +0 -2
- package/sdk/partner/Lead/LeadPartnerValidator.js +0 -12
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +1 -1
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +47 -1
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +56 -4
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +2 -2
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +22 -0
- package/sdk/partner/Theme/ThemePartnerClient.js +162 -0
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +119 -1
- package/sdk/partner/Theme/ThemePartnerModel.js +142 -0
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +2 -0
- package/sdk/partner/Theme/ThemePartnerValidator.js +14 -0
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +304 -43
- package/sdk/platform/Billing/BillingPlatformClient.js +2218 -118
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +1330 -282
- package/sdk/platform/Billing/BillingPlatformModel.js +1808 -590
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +324 -16
- package/sdk/platform/Billing/BillingPlatformValidator.js +340 -12
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +28 -5
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +198 -5
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +81 -1
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +48 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +214 -40
- package/sdk/platform/Cart/CartPlatformModel.js +164 -24
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +20 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +37 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +16 -0
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +2 -2
- package/sdk/platform/Catalog/CatalogPlatformClient.js +18 -2
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +4 -0
- package/sdk/platform/Catalog/CatalogPlatformModel.js +4 -0
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +28 -0
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +12 -0
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +18 -1
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +25 -0
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +10 -0
- package/sdk/platform/Content/ContentPlatformModel.d.ts +8 -4
- package/sdk/platform/Content/ContentPlatformModel.js +8 -4
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +49 -28
- package/sdk/platform/Finance/FinancePlatformClient.js +181 -28
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +369 -129
- package/sdk/platform/Finance/FinancePlatformModel.js +404 -110
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +56 -43
- package/sdk/platform/Finance/FinancePlatformValidator.js +61 -42
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +0 -47
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +0 -321
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +1 -46
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +0 -48
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +2 -25
- package/sdk/platform/Lead/LeadPlatformClient.js +2 -167
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +82 -204
- package/sdk/platform/Lead/LeadPlatformModel.js +98 -178
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +1 -25
- package/sdk/platform/Lead/LeadPlatformValidator.js +0 -24
- package/sdk/platform/Order/OrderPlatformModel.d.ts +126 -15
- package/sdk/platform/Order/OrderPlatformModel.js +55 -14
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +12 -0
- package/sdk/platform/Payment/PaymentPlatformModel.js +5 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +1 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +4 -4
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +20 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +26 -4
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +4 -4
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +4 -4
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +12 -0
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +82 -0
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +18 -1
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +14 -0
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +67 -1
- package/sdk/platform/Theme/ThemePlatformModel.js +78 -0
- package/sdk/platform/User/UserPlatformModel.d.ts +0 -2
- package/sdk/platform/User/UserPlatformModel.js +0 -2
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +0 -40
- package/sdk/platform/Webhook/WebhookPlatformClient.js +0 -307
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +94 -146
- package/sdk/platform/Webhook/WebhookPlatformModel.js +100 -151
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +9 -35
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +8 -46
- package/sdk/public/Billing/BillingPublicClient.d.ts +24 -2
- package/sdk/public/Billing/BillingPublicClient.js +156 -3
- package/sdk/public/Billing/BillingPublicModel.d.ts +368 -26
- package/sdk/public/Billing/BillingPublicModel.js +317 -18
- package/sdk/public/Billing/BillingPublicValidator.d.ts +19 -3
- package/sdk/public/Billing/BillingPublicValidator.js +22 -3
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +22 -22
- package/sdk/public/Webhook/WebhookPublicModel.js +22 -22
|
@@ -1574,7 +1574,7 @@ class Cart {
|
|
|
1574
1574
|
* @description: Retrieve details of a cart linked to a specific customer using either the customer's ID or a unique cart ID. It offers an overview of the items, quantities, prices, and other relevant information associated with the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getCart/).
|
|
1575
1575
|
*/
|
|
1576
1576
|
async getCart(
|
|
1577
|
-
{ id, userId, i, b, assignCardId, buyNow, requestHeaders } = {
|
|
1577
|
+
{ id, userId, orderType, i, b, assignCardId, buyNow, requestHeaders } = {
|
|
1578
1578
|
requestHeaders: {},
|
|
1579
1579
|
},
|
|
1580
1580
|
{ responseHeaders } = { responseHeaders: false }
|
|
@@ -1583,6 +1583,7 @@ class Cart {
|
|
|
1583
1583
|
{
|
|
1584
1584
|
id,
|
|
1585
1585
|
userId,
|
|
1586
|
+
orderType,
|
|
1586
1587
|
i,
|
|
1587
1588
|
b,
|
|
1588
1589
|
assignCardId,
|
|
@@ -1601,6 +1602,7 @@ class Cart {
|
|
|
1601
1602
|
{
|
|
1602
1603
|
id,
|
|
1603
1604
|
userId,
|
|
1605
|
+
orderType,
|
|
1604
1606
|
i,
|
|
1605
1607
|
b,
|
|
1606
1608
|
assignCardId,
|
|
@@ -1618,6 +1620,7 @@ class Cart {
|
|
|
1618
1620
|
const query_params = {};
|
|
1619
1621
|
query_params["id"] = id;
|
|
1620
1622
|
query_params["user_id"] = userId;
|
|
1623
|
+
query_params["order_type"] = orderType;
|
|
1621
1624
|
query_params["i"] = i;
|
|
1622
1625
|
query_params["b"] = b;
|
|
1623
1626
|
query_params["assign_card_id"] = assignCardId;
|
|
@@ -2325,7 +2328,7 @@ class Cart {
|
|
|
2325
2328
|
* @param {CartPlatformApplicationValidator.GetPriceAdjustmentsParam} arg - Arg object
|
|
2326
2329
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2327
2330
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2328
|
-
* @returns {Promise<CartPlatformModel.
|
|
2331
|
+
* @returns {Promise<CartPlatformModel.GetPriceAdjustmentResponse>} - Success response
|
|
2329
2332
|
* @name getPriceAdjustments
|
|
2330
2333
|
* @summary: Get a list of all price adjustments associated with a cart
|
|
2331
2334
|
* @description: This API helps to get price adjustments data associated to a particular cart - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getPriceAdjustments/).
|
|
@@ -2382,7 +2385,7 @@ class Cart {
|
|
|
2382
2385
|
|
|
2383
2386
|
const {
|
|
2384
2387
|
error: res_error,
|
|
2385
|
-
} = CartPlatformModel.
|
|
2388
|
+
} = CartPlatformModel.GetPriceAdjustmentResponse().validate(responseData, {
|
|
2386
2389
|
abortEarly: false,
|
|
2387
2390
|
allowUnknown: true,
|
|
2388
2391
|
});
|
|
@@ -2645,6 +2648,186 @@ class Cart {
|
|
|
2645
2648
|
return response;
|
|
2646
2649
|
}
|
|
2647
2650
|
|
|
2651
|
+
/**
|
|
2652
|
+
* @param {CartPlatformApplicationValidator.GetPromotionOffersParam} arg - Arg object
|
|
2653
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2654
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2655
|
+
* @returns {Promise<CartPlatformModel.PromotionOffersResponse>} - Success response
|
|
2656
|
+
* @name getPromotionOffers
|
|
2657
|
+
* @summary: List available promotion offers
|
|
2658
|
+
* @description: Retrieve a list of all promotional offers available for the items in the cart, including details such as offer text, unique promotion ID, and validity period. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getPromotionOffers/).
|
|
2659
|
+
*/
|
|
2660
|
+
async getPromotionOffers(
|
|
2661
|
+
{ slug, pageSize, promotionGroup, storeId, cartType, requestHeaders } = {
|
|
2662
|
+
requestHeaders: {},
|
|
2663
|
+
},
|
|
2664
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2665
|
+
) {
|
|
2666
|
+
const {
|
|
2667
|
+
error,
|
|
2668
|
+
} = CartPlatformApplicationValidator.getPromotionOffers().validate(
|
|
2669
|
+
{
|
|
2670
|
+
slug,
|
|
2671
|
+
pageSize,
|
|
2672
|
+
promotionGroup,
|
|
2673
|
+
storeId,
|
|
2674
|
+
cartType,
|
|
2675
|
+
},
|
|
2676
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2677
|
+
);
|
|
2678
|
+
if (error) {
|
|
2679
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2680
|
+
}
|
|
2681
|
+
|
|
2682
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2683
|
+
const {
|
|
2684
|
+
error: warrning,
|
|
2685
|
+
} = CartPlatformApplicationValidator.getPromotionOffers().validate(
|
|
2686
|
+
{
|
|
2687
|
+
slug,
|
|
2688
|
+
pageSize,
|
|
2689
|
+
promotionGroup,
|
|
2690
|
+
storeId,
|
|
2691
|
+
cartType,
|
|
2692
|
+
},
|
|
2693
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2694
|
+
);
|
|
2695
|
+
if (warrning) {
|
|
2696
|
+
Logger({
|
|
2697
|
+
level: "WARN",
|
|
2698
|
+
message: `Parameter Validation warrnings for platform > Cart > getPromotionOffers \n ${warrning}`,
|
|
2699
|
+
});
|
|
2700
|
+
}
|
|
2701
|
+
|
|
2702
|
+
const query_params = {};
|
|
2703
|
+
query_params["slug"] = slug;
|
|
2704
|
+
query_params["page_size"] = pageSize;
|
|
2705
|
+
query_params["promotion_group"] = promotionGroup;
|
|
2706
|
+
query_params["store_id"] = storeId;
|
|
2707
|
+
query_params["cart_type"] = cartType;
|
|
2708
|
+
|
|
2709
|
+
const response = await PlatformAPIClient.execute(
|
|
2710
|
+
this.config,
|
|
2711
|
+
"get",
|
|
2712
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/available-promotions`,
|
|
2713
|
+
query_params,
|
|
2714
|
+
undefined,
|
|
2715
|
+
requestHeaders,
|
|
2716
|
+
{ responseHeaders }
|
|
2717
|
+
);
|
|
2718
|
+
|
|
2719
|
+
let responseData = response;
|
|
2720
|
+
if (responseHeaders) {
|
|
2721
|
+
responseData = response[0];
|
|
2722
|
+
}
|
|
2723
|
+
|
|
2724
|
+
const {
|
|
2725
|
+
error: res_error,
|
|
2726
|
+
} = CartPlatformModel.PromotionOffersResponse().validate(responseData, {
|
|
2727
|
+
abortEarly: false,
|
|
2728
|
+
allowUnknown: true,
|
|
2729
|
+
});
|
|
2730
|
+
|
|
2731
|
+
if (res_error) {
|
|
2732
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2733
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2734
|
+
} else {
|
|
2735
|
+
Logger({
|
|
2736
|
+
level: "WARN",
|
|
2737
|
+
message: `Response Validation Warnings for platform > Cart > getPromotionOffers \n ${res_error}`,
|
|
2738
|
+
});
|
|
2739
|
+
}
|
|
2740
|
+
}
|
|
2741
|
+
|
|
2742
|
+
return response;
|
|
2743
|
+
}
|
|
2744
|
+
|
|
2745
|
+
/**
|
|
2746
|
+
* @param {CartPlatformApplicationValidator.GetPromotionPaymentOffersParam} arg
|
|
2747
|
+
* - Arg object
|
|
2748
|
+
*
|
|
2749
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2750
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2751
|
+
* @returns {Promise<CartPlatformModel.PromotionPaymentOffersResponse>} -
|
|
2752
|
+
* Success response
|
|
2753
|
+
* @name getPromotionPaymentOffers
|
|
2754
|
+
* @summary: Fetch available promotions payment offers
|
|
2755
|
+
* @description: Use this API to get top 5 payment offers available for current product - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/cart/getPromotionPaymentOffers/).
|
|
2756
|
+
*/
|
|
2757
|
+
async getPromotionPaymentOffers(
|
|
2758
|
+
{ id, uid, requestHeaders } = { requestHeaders: {} },
|
|
2759
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2760
|
+
) {
|
|
2761
|
+
const {
|
|
2762
|
+
error,
|
|
2763
|
+
} = CartPlatformApplicationValidator.getPromotionPaymentOffers().validate(
|
|
2764
|
+
{
|
|
2765
|
+
id,
|
|
2766
|
+
uid,
|
|
2767
|
+
},
|
|
2768
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2769
|
+
);
|
|
2770
|
+
if (error) {
|
|
2771
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2772
|
+
}
|
|
2773
|
+
|
|
2774
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2775
|
+
const {
|
|
2776
|
+
error: warrning,
|
|
2777
|
+
} = CartPlatformApplicationValidator.getPromotionPaymentOffers().validate(
|
|
2778
|
+
{
|
|
2779
|
+
id,
|
|
2780
|
+
uid,
|
|
2781
|
+
},
|
|
2782
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2783
|
+
);
|
|
2784
|
+
if (warrning) {
|
|
2785
|
+
Logger({
|
|
2786
|
+
level: "WARN",
|
|
2787
|
+
message: `Parameter Validation warrnings for platform > Cart > getPromotionPaymentOffers \n ${warrning}`,
|
|
2788
|
+
});
|
|
2789
|
+
}
|
|
2790
|
+
|
|
2791
|
+
const query_params = {};
|
|
2792
|
+
query_params["id"] = id;
|
|
2793
|
+
query_params["uid"] = uid;
|
|
2794
|
+
|
|
2795
|
+
const response = await PlatformAPIClient.execute(
|
|
2796
|
+
this.config,
|
|
2797
|
+
"get",
|
|
2798
|
+
`/service/platform/cart/v1.0/company/${this.config.companyId}/application/${this.applicationId}/available-payment-offers`,
|
|
2799
|
+
query_params,
|
|
2800
|
+
undefined,
|
|
2801
|
+
requestHeaders,
|
|
2802
|
+
{ responseHeaders }
|
|
2803
|
+
);
|
|
2804
|
+
|
|
2805
|
+
let responseData = response;
|
|
2806
|
+
if (responseHeaders) {
|
|
2807
|
+
responseData = response[0];
|
|
2808
|
+
}
|
|
2809
|
+
|
|
2810
|
+
const {
|
|
2811
|
+
error: res_error,
|
|
2812
|
+
} = CartPlatformModel.PromotionPaymentOffersResponse().validate(
|
|
2813
|
+
responseData,
|
|
2814
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2815
|
+
);
|
|
2816
|
+
|
|
2817
|
+
if (res_error) {
|
|
2818
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2819
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2820
|
+
} else {
|
|
2821
|
+
Logger({
|
|
2822
|
+
level: "WARN",
|
|
2823
|
+
message: `Response Validation Warnings for platform > Cart > getPromotionPaymentOffers \n ${res_error}`,
|
|
2824
|
+
});
|
|
2825
|
+
}
|
|
2826
|
+
}
|
|
2827
|
+
|
|
2828
|
+
return response;
|
|
2829
|
+
}
|
|
2830
|
+
|
|
2648
2831
|
/**
|
|
2649
2832
|
* @param {CartPlatformApplicationValidator.GetPromotionsParam} arg - Arg object
|
|
2650
2833
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -3033,7 +3216,9 @@ class Cart {
|
|
|
3033
3216
|
* @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://partners.fynd.com/help/docs/sdk/platform/cart/platformAddItems/).
|
|
3034
3217
|
*/
|
|
3035
3218
|
async platformAddItems(
|
|
3036
|
-
{ body, i, b, buyNow, id, requestHeaders } = {
|
|
3219
|
+
{ body, i, b, buyNow, orderType, id, requestHeaders } = {
|
|
3220
|
+
requestHeaders: {},
|
|
3221
|
+
},
|
|
3037
3222
|
{ responseHeaders } = { responseHeaders: false }
|
|
3038
3223
|
) {
|
|
3039
3224
|
const {
|
|
@@ -3044,6 +3229,7 @@ class Cart {
|
|
|
3044
3229
|
i,
|
|
3045
3230
|
b,
|
|
3046
3231
|
buyNow,
|
|
3232
|
+
orderType,
|
|
3047
3233
|
id,
|
|
3048
3234
|
},
|
|
3049
3235
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -3061,6 +3247,7 @@ class Cart {
|
|
|
3061
3247
|
i,
|
|
3062
3248
|
b,
|
|
3063
3249
|
buyNow,
|
|
3250
|
+
orderType,
|
|
3064
3251
|
id,
|
|
3065
3252
|
},
|
|
3066
3253
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -3076,6 +3263,7 @@ class Cart {
|
|
|
3076
3263
|
query_params["i"] = i;
|
|
3077
3264
|
query_params["b"] = b;
|
|
3078
3265
|
query_params["buy_now"] = buyNow;
|
|
3266
|
+
query_params["order_type"] = orderType;
|
|
3079
3267
|
query_params["id"] = id;
|
|
3080
3268
|
|
|
3081
3269
|
const response = await PlatformAPIClient.execute(
|
|
@@ -3292,7 +3480,9 @@ class Cart {
|
|
|
3292
3480
|
* @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://partners.fynd.com/help/docs/sdk/platform/cart/platformUpdateCart/).
|
|
3293
3481
|
*/
|
|
3294
3482
|
async platformUpdateCart(
|
|
3295
|
-
{ body, id, i, b, buyNow, requestHeaders } = {
|
|
3483
|
+
{ body, id, i, orderType, b, buyNow, requestHeaders } = {
|
|
3484
|
+
requestHeaders: {},
|
|
3485
|
+
},
|
|
3296
3486
|
{ responseHeaders } = { responseHeaders: false }
|
|
3297
3487
|
) {
|
|
3298
3488
|
const {
|
|
@@ -3302,6 +3492,7 @@ class Cart {
|
|
|
3302
3492
|
body,
|
|
3303
3493
|
id,
|
|
3304
3494
|
i,
|
|
3495
|
+
orderType,
|
|
3305
3496
|
b,
|
|
3306
3497
|
buyNow,
|
|
3307
3498
|
},
|
|
@@ -3319,6 +3510,7 @@ class Cart {
|
|
|
3319
3510
|
body,
|
|
3320
3511
|
id,
|
|
3321
3512
|
i,
|
|
3513
|
+
orderType,
|
|
3322
3514
|
b,
|
|
3323
3515
|
buyNow,
|
|
3324
3516
|
},
|
|
@@ -3334,6 +3526,7 @@ class Cart {
|
|
|
3334
3526
|
const query_params = {};
|
|
3335
3527
|
query_params["id"] = id;
|
|
3336
3528
|
query_params["i"] = i;
|
|
3529
|
+
query_params["order_type"] = orderType;
|
|
3337
3530
|
query_params["b"] = b;
|
|
3338
3531
|
query_params["buy_now"] = buyNow;
|
|
3339
3532
|
|
|
@@ -106,6 +106,9 @@ export = CartPlatformApplicationValidator;
|
|
|
106
106
|
* @typedef GetCartParam
|
|
107
107
|
* @property {string} [id] - The unique identifier of the cart
|
|
108
108
|
* @property {string} [userId] - Option to fetch cart for the provided user_id.
|
|
109
|
+
* @property {string} [orderType] - The order type of shipment HomeDelivery - If
|
|
110
|
+
* the customer wants the order home-delivered PickAtStore - If the customer
|
|
111
|
+
* wants the handover of an order at the store itself.
|
|
109
112
|
* @property {boolean} [i] - This is a boolean value. Select `true` to retrieve
|
|
110
113
|
* all the items added in the cart.
|
|
111
114
|
* @property {boolean} [b] - This is a boolean value. Select `true` to retrieve
|
|
@@ -170,6 +173,21 @@ export = CartPlatformApplicationValidator;
|
|
|
170
173
|
* @typedef GetPromotionCodeExistsParam
|
|
171
174
|
* @property {string} [code]
|
|
172
175
|
*/
|
|
176
|
+
/**
|
|
177
|
+
* @typedef GetPromotionOffersParam
|
|
178
|
+
* @property {string} [slug] - A short, human-readable, URL-friendly identifier
|
|
179
|
+
* of a product. You can get slug value from the endpoint
|
|
180
|
+
* /service/application/catalog/v1.0/products/
|
|
181
|
+
* @property {number} [pageSize] - Number of offers to be fetched to show
|
|
182
|
+
* @property {string} [promotionGroup] - Type of promotion groups
|
|
183
|
+
* @property {number} [storeId] - Store id
|
|
184
|
+
* @property {string} [cartType] - The type of cart
|
|
185
|
+
*/
|
|
186
|
+
/**
|
|
187
|
+
* @typedef GetPromotionPaymentOffersParam
|
|
188
|
+
* @property {string} [id] - Cart id
|
|
189
|
+
* @property {number} [uid] - Cart uid
|
|
190
|
+
*/
|
|
173
191
|
/**
|
|
174
192
|
* @typedef GetPromotionsParam
|
|
175
193
|
* @property {number} [pageNo]
|
|
@@ -212,6 +230,9 @@ export = CartPlatformApplicationValidator;
|
|
|
212
230
|
* the price breakup of cart items.
|
|
213
231
|
* @property {boolean} [buyNow] - This is a boolen value. Select `true` to
|
|
214
232
|
* set/initialize buy now cart
|
|
233
|
+
* @property {string} [orderType] - The order type of shipment HomeDelivery - If
|
|
234
|
+
* the customer wants the order home-delivered PickAtStore - If the customer
|
|
235
|
+
* wants the handover of an order at the store itself.
|
|
215
236
|
* @property {string} [id] - The unique identifier of the cart
|
|
216
237
|
* @property {CartPlatformModel.PlatformAddCartRequest} body
|
|
217
238
|
*/
|
|
@@ -230,6 +251,9 @@ export = CartPlatformApplicationValidator;
|
|
|
230
251
|
* @property {string} [id] - The unique identifier of the cart
|
|
231
252
|
* @property {boolean} [i] - This is a boolean value. Select `true` to retrieve
|
|
232
253
|
* all the items added in the cart.
|
|
254
|
+
* @property {string} [orderType] - The order type of shipment HomeDelivery - If
|
|
255
|
+
* the customer wants the order home-delivered PickAtStore - If the customer
|
|
256
|
+
* wants the handover of an order at the store itself.
|
|
233
257
|
* @property {boolean} [b] - This is a boolean value. Select `true` to retrieve
|
|
234
258
|
* the price breakup of cart items.
|
|
235
259
|
* @property {boolean} [buyNow] - This is a boolen value. Select `true` to
|
|
@@ -422,6 +446,10 @@ declare class CartPlatformApplicationValidator {
|
|
|
422
446
|
static getPromotionById(): GetPromotionByIdParam;
|
|
423
447
|
/** @returns {GetPromotionCodeExistsParam} */
|
|
424
448
|
static getPromotionCodeExists(): GetPromotionCodeExistsParam;
|
|
449
|
+
/** @returns {GetPromotionOffersParam} */
|
|
450
|
+
static getPromotionOffers(): GetPromotionOffersParam;
|
|
451
|
+
/** @returns {GetPromotionPaymentOffersParam} */
|
|
452
|
+
static getPromotionPaymentOffers(): GetPromotionPaymentOffersParam;
|
|
425
453
|
/** @returns {GetPromotionsParam} */
|
|
426
454
|
static getPromotions(): GetPromotionsParam;
|
|
427
455
|
/** @returns {GetShipmentsParam} */
|
|
@@ -478,7 +506,7 @@ declare class CartPlatformApplicationValidator {
|
|
|
478
506
|
static validateCouponForPayment(): ValidateCouponForPaymentParam;
|
|
479
507
|
}
|
|
480
508
|
declare namespace CartPlatformApplicationValidator {
|
|
481
|
-
export { AddAddressParam, AddItemsParam, AddPriceAdjustmentParam, ApplyCouponParam, CheckCartServiceabilityParam, CheckoutCartParam, CreateCartMetaConfigParam, CreateCouponParam, CreatePromotionParam, DeleteCartParam, FetchAndvalidateCartItemsParam, FetchCartMetaConfigParam, GetAbandonedCartParam, GetAbandonedCartDetailsParam, GetAddressByIdParam, GetAddressesParam, GetAppCouponsParam, GetAvailableDeliveryModesParam, GetCartParam, GetCartListParam, GetCartShareLinkParam, GetCartSharedItemsParam, GetCouponByIdParam, GetCouponCodeExistsParam, GetCouponOptionValuesParam, GetCouponsParam, GetItemCountParam, GetPriceAdjustmentsParam, GetPromosCouponConfigParam, GetPromotionByIdParam, GetPromotionCodeExistsParam, GetPromotionsParam, GetShipmentsParam, GetStoreAddressByUidParam, OverrideCartParam, PlatformAddItemsParam, PlatformCheckoutCartParam, PlatformCheckoutCartV2Param, PlatformUpdateCartParam, RemoveAddressParam, RemoveCouponParam, RemovePriceAdjustmentParam, SelectAddressParam, SelectPaymentModeParam, SelectPaymentModeV2Param, UpdateAddressParam, UpdateCartParam, UpdateCartMetaParam, UpdateCartMetaConfigParam, UpdateCartUserParam, UpdateCartWithSharedItemsParam, UpdateCouponParam, UpdateCouponPartiallyParam, UpdatePriceAdjustmentParam, UpdatePromotionParam, UpdatePromotionPartiallyParam, UpdateShipmentsParam, ValidateCouponForPaymentParam };
|
|
509
|
+
export { AddAddressParam, AddItemsParam, AddPriceAdjustmentParam, ApplyCouponParam, CheckCartServiceabilityParam, CheckoutCartParam, CreateCartMetaConfigParam, CreateCouponParam, CreatePromotionParam, DeleteCartParam, FetchAndvalidateCartItemsParam, FetchCartMetaConfigParam, GetAbandonedCartParam, GetAbandonedCartDetailsParam, GetAddressByIdParam, GetAddressesParam, GetAppCouponsParam, GetAvailableDeliveryModesParam, GetCartParam, GetCartListParam, GetCartShareLinkParam, GetCartSharedItemsParam, GetCouponByIdParam, GetCouponCodeExistsParam, GetCouponOptionValuesParam, GetCouponsParam, GetItemCountParam, GetPriceAdjustmentsParam, GetPromosCouponConfigParam, GetPromotionByIdParam, GetPromotionCodeExistsParam, GetPromotionOffersParam, GetPromotionPaymentOffersParam, GetPromotionsParam, GetShipmentsParam, GetStoreAddressByUidParam, OverrideCartParam, PlatformAddItemsParam, PlatformCheckoutCartParam, PlatformCheckoutCartV2Param, PlatformUpdateCartParam, RemoveAddressParam, RemoveCouponParam, RemovePriceAdjustmentParam, SelectAddressParam, SelectPaymentModeParam, SelectPaymentModeV2Param, UpdateAddressParam, UpdateCartParam, UpdateCartMetaParam, UpdateCartMetaConfigParam, UpdateCartUserParam, UpdateCartWithSharedItemsParam, UpdateCouponParam, UpdateCouponPartiallyParam, UpdatePriceAdjustmentParam, UpdatePromotionParam, UpdatePromotionPartiallyParam, UpdateShipmentsParam, ValidateCouponForPaymentParam };
|
|
482
510
|
}
|
|
483
511
|
type AddAddressParam = {
|
|
484
512
|
body: CartPlatformModel.PlatformAddress;
|
|
@@ -580,6 +608,12 @@ type GetCartParam = {
|
|
|
580
608
|
* - Option to fetch cart for the provided user_id.
|
|
581
609
|
*/
|
|
582
610
|
userId?: string;
|
|
611
|
+
/**
|
|
612
|
+
* - The order type of shipment HomeDelivery - If
|
|
613
|
+
* the customer wants the order home-delivered PickAtStore - If the customer
|
|
614
|
+
* wants the handover of an order at the store itself.
|
|
615
|
+
*/
|
|
616
|
+
orderType?: string;
|
|
583
617
|
/**
|
|
584
618
|
* - This is a boolean value. Select `true` to retrieve
|
|
585
619
|
* all the items added in the cart.
|
|
@@ -662,6 +696,40 @@ type GetPromotionByIdParam = {
|
|
|
662
696
|
type GetPromotionCodeExistsParam = {
|
|
663
697
|
code?: string;
|
|
664
698
|
};
|
|
699
|
+
type GetPromotionOffersParam = {
|
|
700
|
+
/**
|
|
701
|
+
* - A short, human-readable, URL-friendly identifier
|
|
702
|
+
* of a product. You can get slug value from the endpoint
|
|
703
|
+
* /service/application/catalog/v1.0/products/
|
|
704
|
+
*/
|
|
705
|
+
slug?: string;
|
|
706
|
+
/**
|
|
707
|
+
* - Number of offers to be fetched to show
|
|
708
|
+
*/
|
|
709
|
+
pageSize?: number;
|
|
710
|
+
/**
|
|
711
|
+
* - Type of promotion groups
|
|
712
|
+
*/
|
|
713
|
+
promotionGroup?: string;
|
|
714
|
+
/**
|
|
715
|
+
* - Store id
|
|
716
|
+
*/
|
|
717
|
+
storeId?: number;
|
|
718
|
+
/**
|
|
719
|
+
* - The type of cart
|
|
720
|
+
*/
|
|
721
|
+
cartType?: string;
|
|
722
|
+
};
|
|
723
|
+
type GetPromotionPaymentOffersParam = {
|
|
724
|
+
/**
|
|
725
|
+
* - Cart id
|
|
726
|
+
*/
|
|
727
|
+
id?: string;
|
|
728
|
+
/**
|
|
729
|
+
* - Cart uid
|
|
730
|
+
*/
|
|
731
|
+
uid?: number;
|
|
732
|
+
};
|
|
665
733
|
type GetPromotionsParam = {
|
|
666
734
|
pageNo?: number;
|
|
667
735
|
pageSize?: number;
|
|
@@ -726,6 +794,12 @@ type PlatformAddItemsParam = {
|
|
|
726
794
|
* set/initialize buy now cart
|
|
727
795
|
*/
|
|
728
796
|
buyNow?: boolean;
|
|
797
|
+
/**
|
|
798
|
+
* - The order type of shipment HomeDelivery - If
|
|
799
|
+
* the customer wants the order home-delivered PickAtStore - If the customer
|
|
800
|
+
* wants the handover of an order at the store itself.
|
|
801
|
+
*/
|
|
802
|
+
orderType?: string;
|
|
729
803
|
/**
|
|
730
804
|
* - The unique identifier of the cart
|
|
731
805
|
*/
|
|
@@ -756,6 +830,12 @@ type PlatformUpdateCartParam = {
|
|
|
756
830
|
* all the items added in the cart.
|
|
757
831
|
*/
|
|
758
832
|
i?: boolean;
|
|
833
|
+
/**
|
|
834
|
+
* - The order type of shipment HomeDelivery - If
|
|
835
|
+
* the customer wants the order home-delivered PickAtStore - If the customer
|
|
836
|
+
* wants the handover of an order at the store itself.
|
|
837
|
+
*/
|
|
838
|
+
orderType?: string;
|
|
759
839
|
/**
|
|
760
840
|
* - This is a boolean value. Select `true` to retrieve
|
|
761
841
|
* the price breakup of cart items.
|
|
@@ -127,6 +127,9 @@ const CartPlatformModel = require("./CartPlatformModel");
|
|
|
127
127
|
* @typedef GetCartParam
|
|
128
128
|
* @property {string} [id] - The unique identifier of the cart
|
|
129
129
|
* @property {string} [userId] - Option to fetch cart for the provided user_id.
|
|
130
|
+
* @property {string} [orderType] - The order type of shipment HomeDelivery - If
|
|
131
|
+
* the customer wants the order home-delivered PickAtStore - If the customer
|
|
132
|
+
* wants the handover of an order at the store itself.
|
|
130
133
|
* @property {boolean} [i] - This is a boolean value. Select `true` to retrieve
|
|
131
134
|
* all the items added in the cart.
|
|
132
135
|
* @property {boolean} [b] - This is a boolean value. Select `true` to retrieve
|
|
@@ -204,6 +207,23 @@ const CartPlatformModel = require("./CartPlatformModel");
|
|
|
204
207
|
* @property {string} [code]
|
|
205
208
|
*/
|
|
206
209
|
|
|
210
|
+
/**
|
|
211
|
+
* @typedef GetPromotionOffersParam
|
|
212
|
+
* @property {string} [slug] - A short, human-readable, URL-friendly identifier
|
|
213
|
+
* of a product. You can get slug value from the endpoint
|
|
214
|
+
* /service/application/catalog/v1.0/products/
|
|
215
|
+
* @property {number} [pageSize] - Number of offers to be fetched to show
|
|
216
|
+
* @property {string} [promotionGroup] - Type of promotion groups
|
|
217
|
+
* @property {number} [storeId] - Store id
|
|
218
|
+
* @property {string} [cartType] - The type of cart
|
|
219
|
+
*/
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* @typedef GetPromotionPaymentOffersParam
|
|
223
|
+
* @property {string} [id] - Cart id
|
|
224
|
+
* @property {number} [uid] - Cart uid
|
|
225
|
+
*/
|
|
226
|
+
|
|
207
227
|
/**
|
|
208
228
|
* @typedef GetPromotionsParam
|
|
209
229
|
* @property {number} [pageNo]
|
|
@@ -250,6 +270,9 @@ const CartPlatformModel = require("./CartPlatformModel");
|
|
|
250
270
|
* the price breakup of cart items.
|
|
251
271
|
* @property {boolean} [buyNow] - This is a boolen value. Select `true` to
|
|
252
272
|
* set/initialize buy now cart
|
|
273
|
+
* @property {string} [orderType] - The order type of shipment HomeDelivery - If
|
|
274
|
+
* the customer wants the order home-delivered PickAtStore - If the customer
|
|
275
|
+
* wants the handover of an order at the store itself.
|
|
253
276
|
* @property {string} [id] - The unique identifier of the cart
|
|
254
277
|
* @property {CartPlatformModel.PlatformAddCartRequest} body
|
|
255
278
|
*/
|
|
@@ -271,6 +294,9 @@ const CartPlatformModel = require("./CartPlatformModel");
|
|
|
271
294
|
* @property {string} [id] - The unique identifier of the cart
|
|
272
295
|
* @property {boolean} [i] - This is a boolean value. Select `true` to retrieve
|
|
273
296
|
* all the items added in the cart.
|
|
297
|
+
* @property {string} [orderType] - The order type of shipment HomeDelivery - If
|
|
298
|
+
* the customer wants the order home-delivered PickAtStore - If the customer
|
|
299
|
+
* wants the handover of an order at the store itself.
|
|
274
300
|
* @property {boolean} [b] - This is a boolean value. Select `true` to retrieve
|
|
275
301
|
* the price breakup of cart items.
|
|
276
302
|
* @property {boolean} [buyNow] - This is a boolen value. Select `true` to
|
|
@@ -584,6 +610,7 @@ class CartPlatformApplicationValidator {
|
|
|
584
610
|
return Joi.object({
|
|
585
611
|
id: Joi.string().allow(""),
|
|
586
612
|
userId: Joi.string().allow(""),
|
|
613
|
+
orderType: Joi.string().allow(""),
|
|
587
614
|
i: Joi.boolean(),
|
|
588
615
|
b: Joi.boolean(),
|
|
589
616
|
assignCardId: Joi.number(),
|
|
@@ -684,6 +711,25 @@ class CartPlatformApplicationValidator {
|
|
|
684
711
|
}).required();
|
|
685
712
|
}
|
|
686
713
|
|
|
714
|
+
/** @returns {GetPromotionOffersParam} */
|
|
715
|
+
static getPromotionOffers() {
|
|
716
|
+
return Joi.object({
|
|
717
|
+
slug: Joi.string().allow(""),
|
|
718
|
+
pageSize: Joi.number(),
|
|
719
|
+
promotionGroup: Joi.string().allow(""),
|
|
720
|
+
storeId: Joi.number(),
|
|
721
|
+
cartType: Joi.string().allow(""),
|
|
722
|
+
}).required();
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
/** @returns {GetPromotionPaymentOffersParam} */
|
|
726
|
+
static getPromotionPaymentOffers() {
|
|
727
|
+
return Joi.object({
|
|
728
|
+
id: Joi.string().allow(""),
|
|
729
|
+
uid: Joi.number(),
|
|
730
|
+
}).required();
|
|
731
|
+
}
|
|
732
|
+
|
|
687
733
|
/** @returns {GetPromotionsParam} */
|
|
688
734
|
static getPromotions() {
|
|
689
735
|
return Joi.object({
|
|
@@ -732,6 +778,7 @@ class CartPlatformApplicationValidator {
|
|
|
732
778
|
i: Joi.boolean(),
|
|
733
779
|
b: Joi.boolean(),
|
|
734
780
|
buyNow: Joi.boolean(),
|
|
781
|
+
orderType: Joi.string().allow(""),
|
|
735
782
|
id: Joi.string().allow(""),
|
|
736
783
|
body: CartPlatformModel.PlatformAddCartRequest().required(),
|
|
737
784
|
}).required();
|
|
@@ -758,6 +805,7 @@ class CartPlatformApplicationValidator {
|
|
|
758
805
|
return Joi.object({
|
|
759
806
|
id: Joi.string().allow(""),
|
|
760
807
|
i: Joi.boolean(),
|
|
808
|
+
orderType: Joi.string().allow(""),
|
|
761
809
|
b: Joi.boolean(),
|
|
762
810
|
buyNow: Joi.boolean(),
|
|
763
811
|
body: CartPlatformModel.PlatformUpdateCartRequest().required(),
|