@gofynd/fdk-client-javascript 1.4.15-beta.2 → 1.4.15
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 +2 -2
- package/application.d.ts +1 -2
- package/application.js +2 -3
- package/index.d.ts +1 -2
- package/index.js +7 -1
- package/package.json +2 -3
- package/sdk/application/ApplicationClient.d.ts +2 -0
- package/sdk/application/ApplicationClient.js +2 -18
- package/sdk/application/Cart/CartApplicationClient.d.ts +75 -90
- package/sdk/application/Cart/CartApplicationClient.js +108 -1199
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +81 -142
- package/sdk/application/Catalog/CatalogApplicationClient.js +41 -1344
- package/sdk/application/Common/CommonApplicationClient.d.ts +4 -8
- package/sdk/application/Common/CommonApplicationClient.js +2 -92
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +6 -19
- package/sdk/application/Communication/CommunicationApplicationClient.js +3 -148
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +32 -73
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +16 -727
- package/sdk/application/Content/ContentApplicationClient.d.ts +48 -111
- package/sdk/application/Content/ContentApplicationClient.js +43 -1065
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +8 -13
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +8 -138
- package/sdk/application/Finance/FinanceApplicationClient.d.ts +29 -0
- package/sdk/application/Finance/FinanceApplicationClient.js +105 -0
- package/sdk/application/Lead/LeadApplicationClient.d.ts +10 -18
- package/sdk/application/Lead/LeadApplicationClient.js +5 -217
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +42 -39
- package/sdk/application/Logistic/LogisticApplicationClient.js +91 -493
- package/sdk/application/Order/OrderApplicationClient.d.ts +36 -46
- package/sdk/application/Order/OrderApplicationClient.js +52 -507
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +103 -213
- package/sdk/application/Payment/PaymentApplicationClient.js +84 -2105
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +15 -29
- package/sdk/application/Rewards/RewardsApplicationClient.js +8 -312
- package/sdk/application/Share/ShareApplicationClient.d.ts +14 -24
- package/sdk/application/Share/ShareApplicationClient.js +7 -309
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -14
- package/sdk/application/Theme/ThemeApplicationClient.js +8 -176
- package/sdk/application/User/UserApplicationClient.d.ts +87 -138
- package/sdk/application/User/UserApplicationClient.js +44 -1820
- package/sdk/application/Webhook/WebhookApplicationClient.d.ts +4 -7
- package/sdk/application/Webhook/WebhookApplicationClient.js +3 -52
- package/sdk/application/index.d.ts +0 -18
- package/sdk/application/index.js +0 -33
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +86 -12
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +582 -24
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +116 -19
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +121 -14
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +8 -1
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +51 -4
- package/sdk/partner/Lead/LeadPartnerClient.d.ts +2 -2
- package/sdk/partner/Lead/LeadPartnerClient.js +2 -2
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +5 -5
- package/sdk/partner/Lead/LeadPartnerModel.js +15 -15
- package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +157 -30
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +1177 -56
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +1662 -249
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +774 -162
- package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +13 -1
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +141 -12
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +8 -10
- package/sdk/partner/Theme/ThemePartnerClient.js +14 -16
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +96 -37
- package/sdk/partner/Theme/ThemePartnerModel.js +90 -36
- package/sdk/partner/Theme/ThemePartnerValidator.js +4 -4
- package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +28 -18
- package/sdk/partner/Webhook/WebhookPartnerClient.js +103 -18
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +612 -179
- package/sdk/partner/Webhook/WebhookPartnerModel.js +253 -150
- package/sdk/partner/Webhook/WebhookPartnerValidator.d.ts +1 -0
- package/sdk/partner/Webhook/WebhookPartnerValidator.js +11 -3
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +5 -4
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +14 -8
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +59 -9
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +40 -4
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +2 -32
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +3 -243
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +11 -130
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +12 -152
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -39
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +0 -35
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +12 -12
- package/sdk/platform/Billing/BillingPlatformClient.js +15 -15
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +443 -388
- package/sdk/platform/Billing/BillingPlatformModel.js +280 -263
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +16 -18
- package/sdk/platform/Billing/BillingPlatformValidator.js +8 -9
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +134 -103
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +407 -112
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +111 -65
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +106 -44
- package/sdk/platform/Cart/CartPlatformModel.d.ts +5060 -1300
- package/sdk/platform/Cart/CartPlatformModel.js +1985 -1217
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +209 -183
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +452 -395
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +185 -142
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +96 -78
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +178 -117
- package/sdk/platform/Catalog/CatalogPlatformClient.js +468 -172
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +6554 -1772
- package/sdk/platform/Catalog/CatalogPlatformModel.js +3264 -1690
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +116 -31
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +85 -24
- package/sdk/platform/Common/CommonPlatformClient.d.ts +3 -2
- package/sdk/platform/Common/CommonPlatformClient.js +3 -2
- package/sdk/platform/Common/CommonPlatformModel.d.ts +9 -9
- package/sdk/platform/Common/CommonPlatformModel.js +6 -6
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +16 -17
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +16 -17
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +8 -8
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +8 -8
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +43 -33
- package/sdk/platform/Communication/CommunicationPlatformModel.js +38 -34
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +46 -42
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +47 -43
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +223 -223
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +210 -212
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +12 -12
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +12 -12
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +46 -33
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +67 -54
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +18 -18
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +18 -18
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +45 -24
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +134 -30
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +283 -124
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +219 -94
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +37 -9
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +27 -8
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +122 -191
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +447 -831
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +174 -220
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +164 -199
- package/sdk/platform/Content/ContentPlatformClient.d.ts +142 -106
- package/sdk/platform/Content/ContentPlatformClient.js +523 -336
- package/sdk/platform/Content/ContentPlatformModel.d.ts +1233 -476
- package/sdk/platform/Content/ContentPlatformModel.js +514 -487
- package/sdk/platform/Content/ContentPlatformValidator.d.ts +168 -117
- package/sdk/platform/Content/ContentPlatformValidator.js +162 -108
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +14 -12
- package/sdk/platform/Discount/DiscountPlatformClient.js +14 -12
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +13 -13
- package/sdk/platform/Discount/DiscountPlatformModel.js +12 -12
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +2 -2
- package/sdk/platform/Discount/DiscountPlatformValidator.js +2 -2
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +94 -36
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +462 -60
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +62 -15
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +75 -13
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +19 -19
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +21 -21
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +370 -101
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +313 -84
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +6 -6
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +6 -6
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +2 -2
- package/sdk/platform/Lead/LeadPlatformClient.js +2 -2
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +5 -5
- package/sdk/platform/Lead/LeadPlatformModel.js +16 -16
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +17 -6
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +85 -7
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +95 -24
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +39 -19
- package/sdk/platform/Order/OrderPlatformClient.d.ts +153 -96
- package/sdk/platform/Order/OrderPlatformClient.js +424 -198
- package/sdk/platform/Order/OrderPlatformModel.d.ts +7747 -1342
- package/sdk/platform/Order/OrderPlatformModel.js +3960 -1262
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +292 -109
- package/sdk/platform/Order/OrderPlatformValidator.js +145 -77
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +6 -4
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +9 -7
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +9 -9
- package/sdk/platform/Partner/PartnerPlatformModel.js +8 -8
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +93 -105
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +129 -141
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +48 -48
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +48 -48
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +20 -20
- package/sdk/platform/Payment/PaymentPlatformClient.js +20 -20
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +333 -319
- package/sdk/platform/Payment/PaymentPlatformModel.js +288 -278
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +8 -8
- package/sdk/platform/Payment/PaymentPlatformValidator.js +8 -8
- package/sdk/platform/PlatformClient.d.ts +0 -2
- package/sdk/platform/PlatformClient.js +0 -4
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +2 -2
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +2 -2
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +2 -2
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +2 -2
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +9 -9
- package/sdk/platform/Rewards/RewardsPlatformModel.js +8 -8
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +46 -36
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +132 -41
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +46 -17
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +34 -14
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +132 -44
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +681 -64
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +2458 -650
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1266 -572
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +176 -47
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +134 -28
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +2 -2
- package/sdk/platform/Share/SharePlatformApplicationClient.js +2 -2
- package/sdk/platform/Share/SharePlatformModel.d.ts +36 -5
- package/sdk/platform/Share/SharePlatformModel.js +27 -4
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +3 -3
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +8 -4
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +5 -0
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +2 -0
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +37 -11
- package/sdk/platform/Theme/ThemePlatformModel.js +33 -15
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +12 -12
- package/sdk/platform/User/UserPlatformApplicationClient.js +12 -12
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +2 -2
- package/sdk/platform/User/UserPlatformApplicationValidator.js +2 -2
- package/sdk/platform/User/UserPlatformModel.d.ts +21 -21
- package/sdk/platform/User/UserPlatformModel.js +23 -23
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +25 -78
- package/sdk/platform/Webhook/WebhookPlatformClient.js +75 -470
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +720 -427
- package/sdk/platform/Webhook/WebhookPlatformModel.js +410 -386
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +10 -55
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +12 -72
- package/sdk/platform/index.d.ts +0 -1
- package/sdk/platform/index.js +0 -2
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +3 -2
- package/sdk/public/Configuration/ConfigurationPublicClient.js +10 -7
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +9 -9
- package/sdk/public/Configuration/ConfigurationPublicModel.js +6 -6
- package/sdk/public/Content/ContentPublicClient.d.ts +112 -2
- package/sdk/public/Content/ContentPublicClient.js +795 -7
- package/sdk/public/Content/ContentPublicModel.d.ts +549 -3
- package/sdk/public/Content/ContentPublicModel.js +649 -3
- package/sdk/public/Content/ContentPublicValidator.d.ts +69 -3
- package/sdk/public/Content/ContentPublicValidator.js +88 -2
- package/sdk/public/Partner/PartnerPublicClient.js +4 -2
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +8 -8
- package/sdk/public/Webhook/WebhookPublicClient.js +12 -10
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +21 -21
- package/sdk/public/Webhook/WebhookPublicModel.js +15 -15
- package/sdk/public/Webhook/WebhookPublicValidator.d.ts +4 -4
- package/sdk/public/Webhook/WebhookPublicValidator.js +4 -4
- package/sdk/application/Cart/CartApplicationModel.d.ts +0 -3994
- package/sdk/application/Cart/CartApplicationModel.js +0 -2497
- package/sdk/application/Cart/CartApplicationValidator.d.ts +0 -769
- package/sdk/application/Cart/CartApplicationValidator.js +0 -530
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +0 -3857
- package/sdk/application/Catalog/CatalogApplicationModel.js +0 -2629
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +0 -791
- package/sdk/application/Catalog/CatalogApplicationValidator.js +0 -551
- package/sdk/application/Common/CommonApplicationModel.d.ts +0 -449
- package/sdk/application/Common/CommonApplicationModel.js +0 -308
- package/sdk/application/Common/CommonApplicationValidator.d.ts +0 -46
- package/sdk/application/Common/CommonApplicationValidator.js +0 -38
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +0 -293
- package/sdk/application/Communication/CommunicationApplicationModel.js +0 -201
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +0 -29
- package/sdk/application/Communication/CommunicationApplicationValidator.js +0 -38
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +0 -2556
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +0 -1887
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +0 -179
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +0 -176
- package/sdk/application/Content/ContentApplicationModel.d.ts +0 -2133
- package/sdk/application/Content/ContentApplicationModel.js +0 -1589
- package/sdk/application/Content/ContentApplicationValidator.d.ts +0 -284
- package/sdk/application/Content/ContentApplicationValidator.js +0 -264
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +0 -272
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +0 -190
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +0 -56
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +0 -53
- package/sdk/application/Lead/LeadApplicationModel.d.ts +0 -590
- package/sdk/application/Lead/LeadApplicationModel.js +0 -480
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +0 -68
- package/sdk/application/Lead/LeadApplicationValidator.js +0 -71
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +0 -1675
- package/sdk/application/Logistic/LogisticApplicationModel.js +0 -1121
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +0 -254
- package/sdk/application/Logistic/LogisticApplicationValidator.js +0 -190
- package/sdk/application/Order/OrderApplicationModel.d.ts +0 -2296
- package/sdk/application/Order/OrderApplicationModel.js +0 -1471
- package/sdk/application/Order/OrderApplicationValidator.d.ts +0 -265
- package/sdk/application/Order/OrderApplicationValidator.js +0 -197
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +0 -4058
- package/sdk/application/Payment/PaymentApplicationModel.js +0 -2630
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +0 -576
- package/sdk/application/Payment/PaymentApplicationValidator.js +0 -594
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +0 -365
- package/sdk/application/Rewards/RewardsApplicationModel.js +0 -396
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +0 -73
- package/sdk/application/Rewards/RewardsApplicationValidator.js +0 -84
- package/sdk/application/Share/ShareApplicationModel.d.ts +0 -339
- package/sdk/application/Share/ShareApplicationModel.js +0 -234
- package/sdk/application/Share/ShareApplicationValidator.d.ts +0 -90
- package/sdk/application/Share/ShareApplicationValidator.js +0 -91
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +0 -1713
- package/sdk/application/Theme/ThemeApplicationModel.js +0 -1426
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +0 -66
- package/sdk/application/Theme/ThemeApplicationValidator.js +0 -58
- package/sdk/application/User/UserApplicationModel.d.ts +0 -1943
- package/sdk/application/User/UserApplicationModel.js +0 -1382
- package/sdk/application/User/UserApplicationValidator.d.ts +0 -560
- package/sdk/application/User/UserApplicationValidator.js +0 -573
- package/sdk/application/Webhook/WebhookApplicationModel.d.ts +0 -52
- package/sdk/application/Webhook/WebhookApplicationModel.js +0 -46
- package/sdk/application/Webhook/WebhookApplicationValidator.d.ts +0 -16
- package/sdk/application/Webhook/WebhookApplicationValidator.js +0 -19
- package/sdk/common/Clickstream.d.ts +0 -1
- package/sdk/common/Clickstream.js +0 -464
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +0 -320
- package/sdk/platform/Finance/FinancePlatformClient.js +0 -2333
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +0 -2890
- package/sdk/platform/Finance/FinancePlatformModel.js +0 -2148
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +0 -284
- package/sdk/platform/Finance/FinancePlatformValidator.js +0 -354
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
2
|
-
const {
|
|
3
|
-
FDKClientValidationError,
|
|
4
|
-
FDKResponseValidationError,
|
|
5
|
-
} = require("../../common/FDKError");
|
|
6
2
|
const constructUrl = require("../constructUrl");
|
|
7
3
|
const Paginator = require("../../common/Paginator");
|
|
8
|
-
const CartApplicationValidator = require("./CartApplicationValidator");
|
|
9
|
-
const CartApplicationModel = require("./CartApplicationModel");
|
|
10
|
-
const { Logger } = require("./../../common/Logger");
|
|
11
|
-
const Joi = require("joi");
|
|
12
4
|
|
|
13
5
|
class Cart {
|
|
14
6
|
constructor(_conf) {
|
|
@@ -18,6 +10,7 @@ class Cart {
|
|
|
18
10
|
addItems: "/service/application/cart/v1.0/detail",
|
|
19
11
|
applyCoupon: "/service/application/cart/v1.0/coupon",
|
|
20
12
|
applyRewardPoints: "/service/application/cart/v1.0/redeem/points/",
|
|
13
|
+
checkoutCart: "/service/application/cart/v1.0/checkout",
|
|
21
14
|
checkoutCartV2: "/service/application/cart/v2.0/checkout",
|
|
22
15
|
deleteCart: "/service/application/cart/v1.0/cart_archive",
|
|
23
16
|
getAddressById: "/service/application/cart/v1.0/address/{id}",
|
|
@@ -40,6 +33,7 @@ class Cart {
|
|
|
40
33
|
selectPaymentMode: "/service/application/cart/v1.0/payment",
|
|
41
34
|
updateAddress: "/service/application/cart/v1.0/address/{id}",
|
|
42
35
|
updateCart: "/service/application/cart/v1.0/detail",
|
|
36
|
+
updateCartBreakup: "/service/application/cart/v1.0/detail",
|
|
43
37
|
updateCartMeta: "/service/application/cart/v1.0/meta",
|
|
44
38
|
updateCartWithSharedItems:
|
|
45
39
|
"/service/application/cart/v1.0/share-cart/{token}/{action}",
|
|
@@ -63,10 +57,9 @@ class Cart {
|
|
|
63
57
|
}
|
|
64
58
|
|
|
65
59
|
/**
|
|
66
|
-
* @param {CartApplicationValidator.AddAddressParam} arg - Arg object.
|
|
67
60
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
68
61
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
69
|
-
* @returns {Promise<
|
|
62
|
+
* @returns {Promise<SaveAddressResult>} - Success response
|
|
70
63
|
* @name addAddress
|
|
71
64
|
* @summary: Creates a new address for a customer
|
|
72
65
|
* @description: Add a new address to their cart to save details such as name, email, contact information, and address. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/addAddress/).
|
|
@@ -75,26 +68,6 @@ class Cart {
|
|
|
75
68
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
76
69
|
{ responseHeaders } = { responseHeaders: false }
|
|
77
70
|
) {
|
|
78
|
-
const { error } = CartApplicationValidator.addAddress().validate(
|
|
79
|
-
{ body },
|
|
80
|
-
{ abortEarly: false, allowUnknown: true }
|
|
81
|
-
);
|
|
82
|
-
if (error) {
|
|
83
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// Showing warrnings if extra unknown parameters are found
|
|
87
|
-
const { error: warrning } = CartApplicationValidator.addAddress().validate(
|
|
88
|
-
{ body },
|
|
89
|
-
{ abortEarly: false, allowUnknown: false }
|
|
90
|
-
);
|
|
91
|
-
if (warrning) {
|
|
92
|
-
Logger({
|
|
93
|
-
level: "WARN",
|
|
94
|
-
message: `Parameter Validation warrnings for application > Cart > addAddress \n ${warrning}`,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
71
|
const query_params = {};
|
|
99
72
|
|
|
100
73
|
const xHeaders = {};
|
|
@@ -117,32 +90,13 @@ class Cart {
|
|
|
117
90
|
responseData = response[0];
|
|
118
91
|
}
|
|
119
92
|
|
|
120
|
-
const {
|
|
121
|
-
error: res_error,
|
|
122
|
-
} = CartApplicationModel.SaveAddressResponse().validate(responseData, {
|
|
123
|
-
abortEarly: false,
|
|
124
|
-
allowUnknown: true,
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
if (res_error) {
|
|
128
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
129
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
130
|
-
} else {
|
|
131
|
-
Logger({
|
|
132
|
-
level: "WARN",
|
|
133
|
-
message: `Response Validation Warnings for application > Cart > addAddress \n ${res_error}`,
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
93
|
return response;
|
|
139
94
|
}
|
|
140
95
|
|
|
141
96
|
/**
|
|
142
|
-
* @param {CartApplicationValidator.AddItemsParam} arg - Arg object.
|
|
143
97
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
144
98
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
145
|
-
* @returns {Promise<
|
|
99
|
+
* @returns {Promise<AddCartDetailResult>} - Success response
|
|
146
100
|
* @name addItems
|
|
147
101
|
* @summary: Add items to a cart
|
|
148
102
|
* @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/application/cart/addItems/).
|
|
@@ -153,26 +107,6 @@ class Cart {
|
|
|
153
107
|
},
|
|
154
108
|
{ responseHeaders } = { responseHeaders: false }
|
|
155
109
|
) {
|
|
156
|
-
const { error } = CartApplicationValidator.addItems().validate(
|
|
157
|
-
{ body, i, b, areaCode, buyNow, id, orderType },
|
|
158
|
-
{ abortEarly: false, allowUnknown: true }
|
|
159
|
-
);
|
|
160
|
-
if (error) {
|
|
161
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// Showing warrnings if extra unknown parameters are found
|
|
165
|
-
const { error: warrning } = CartApplicationValidator.addItems().validate(
|
|
166
|
-
{ body, i, b, areaCode, buyNow, id, orderType },
|
|
167
|
-
{ abortEarly: false, allowUnknown: false }
|
|
168
|
-
);
|
|
169
|
-
if (warrning) {
|
|
170
|
-
Logger({
|
|
171
|
-
level: "WARN",
|
|
172
|
-
message: `Parameter Validation warrnings for application > Cart > addItems \n ${warrning}`,
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
|
|
176
110
|
const query_params = {};
|
|
177
111
|
query_params["i"] = i;
|
|
178
112
|
query_params["b"] = b;
|
|
@@ -201,32 +135,13 @@ class Cart {
|
|
|
201
135
|
responseData = response[0];
|
|
202
136
|
}
|
|
203
137
|
|
|
204
|
-
const {
|
|
205
|
-
error: res_error,
|
|
206
|
-
} = CartApplicationModel.AddCartDetailResponse().validate(responseData, {
|
|
207
|
-
abortEarly: false,
|
|
208
|
-
allowUnknown: true,
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
if (res_error) {
|
|
212
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
213
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
214
|
-
} else {
|
|
215
|
-
Logger({
|
|
216
|
-
level: "WARN",
|
|
217
|
-
message: `Response Validation Warnings for application > Cart > addItems \n ${res_error}`,
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
138
|
return response;
|
|
223
139
|
}
|
|
224
140
|
|
|
225
141
|
/**
|
|
226
|
-
* @param {CartApplicationValidator.ApplyCouponParam} arg - Arg object.
|
|
227
142
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
228
143
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
229
|
-
* @returns {Promise<
|
|
144
|
+
* @returns {Promise<CartDetailResult>} - Success response
|
|
230
145
|
* @name applyCoupon
|
|
231
146
|
* @summary: Apply coupon
|
|
232
147
|
* @description: Apply a coupon code to the cart to trigger discounts on eligible items. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/applyCoupon/).
|
|
@@ -237,26 +152,6 @@ class Cart {
|
|
|
237
152
|
},
|
|
238
153
|
{ responseHeaders } = { responseHeaders: false }
|
|
239
154
|
) {
|
|
240
|
-
const { error } = CartApplicationValidator.applyCoupon().validate(
|
|
241
|
-
{ body, i, b, p, id, buyNow, cartType },
|
|
242
|
-
{ abortEarly: false, allowUnknown: true }
|
|
243
|
-
);
|
|
244
|
-
if (error) {
|
|
245
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
// Showing warrnings if extra unknown parameters are found
|
|
249
|
-
const { error: warrning } = CartApplicationValidator.applyCoupon().validate(
|
|
250
|
-
{ body, i, b, p, id, buyNow, cartType },
|
|
251
|
-
{ abortEarly: false, allowUnknown: false }
|
|
252
|
-
);
|
|
253
|
-
if (warrning) {
|
|
254
|
-
Logger({
|
|
255
|
-
level: "WARN",
|
|
256
|
-
message: `Parameter Validation warrnings for application > Cart > applyCoupon \n ${warrning}`,
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
|
|
260
155
|
const query_params = {};
|
|
261
156
|
query_params["i"] = i;
|
|
262
157
|
query_params["b"] = b;
|
|
@@ -285,32 +180,13 @@ class Cart {
|
|
|
285
180
|
responseData = response[0];
|
|
286
181
|
}
|
|
287
182
|
|
|
288
|
-
const {
|
|
289
|
-
error: res_error,
|
|
290
|
-
} = CartApplicationModel.CartDetailResponse().validate(responseData, {
|
|
291
|
-
abortEarly: false,
|
|
292
|
-
allowUnknown: true,
|
|
293
|
-
});
|
|
294
|
-
|
|
295
|
-
if (res_error) {
|
|
296
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
297
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
298
|
-
} else {
|
|
299
|
-
Logger({
|
|
300
|
-
level: "WARN",
|
|
301
|
-
message: `Response Validation Warnings for application > Cart > applyCoupon \n ${res_error}`,
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
|
|
306
183
|
return response;
|
|
307
184
|
}
|
|
308
185
|
|
|
309
186
|
/**
|
|
310
|
-
* @param {CartApplicationValidator.ApplyRewardPointsParam} arg - Arg object.
|
|
311
187
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
312
188
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
313
|
-
* @returns {Promise<
|
|
189
|
+
* @returns {Promise<CartDetailResult>} - Success response
|
|
314
190
|
* @name applyRewardPoints
|
|
315
191
|
* @summary: Use reward points
|
|
316
192
|
* @description: Users can redeem their accumulated reward points and apply them to the items in their cart, thereby availing discounts on their current purchases. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/applyRewardPoints/).
|
|
@@ -319,28 +195,6 @@ class Cart {
|
|
|
319
195
|
{ body, id, i, b, buyNow, requestHeaders } = { requestHeaders: {} },
|
|
320
196
|
{ responseHeaders } = { responseHeaders: false }
|
|
321
197
|
) {
|
|
322
|
-
const { error } = CartApplicationValidator.applyRewardPoints().validate(
|
|
323
|
-
{ body, id, i, b, buyNow },
|
|
324
|
-
{ abortEarly: false, allowUnknown: true }
|
|
325
|
-
);
|
|
326
|
-
if (error) {
|
|
327
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
// Showing warrnings if extra unknown parameters are found
|
|
331
|
-
const {
|
|
332
|
-
error: warrning,
|
|
333
|
-
} = CartApplicationValidator.applyRewardPoints().validate(
|
|
334
|
-
{ body, id, i, b, buyNow },
|
|
335
|
-
{ abortEarly: false, allowUnknown: false }
|
|
336
|
-
);
|
|
337
|
-
if (warrning) {
|
|
338
|
-
Logger({
|
|
339
|
-
level: "WARN",
|
|
340
|
-
message: `Parameter Validation warrnings for application > Cart > applyRewardPoints \n ${warrning}`,
|
|
341
|
-
});
|
|
342
|
-
}
|
|
343
|
-
|
|
344
198
|
const query_params = {};
|
|
345
199
|
query_params["id"] = id;
|
|
346
200
|
query_params["i"] = i;
|
|
@@ -367,32 +221,52 @@ class Cart {
|
|
|
367
221
|
responseData = response[0];
|
|
368
222
|
}
|
|
369
223
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
224
|
+
return response;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
229
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
230
|
+
* @returns {Promise<CartCheckoutResult>} - Success response
|
|
231
|
+
* @name checkoutCart
|
|
232
|
+
* @summary: Checkout cart
|
|
233
|
+
* @description: The checkout cart initiates the order creation process based on the selected address and payment method. It revalidates the cart details to ensure safe and seamless order placement. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/checkoutCart/).
|
|
234
|
+
*/
|
|
235
|
+
async checkoutCart(
|
|
236
|
+
{ body, buyNow, cartType, requestHeaders } = { requestHeaders: {} },
|
|
237
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
238
|
+
) {
|
|
239
|
+
const query_params = {};
|
|
240
|
+
query_params["buy_now"] = buyNow;
|
|
241
|
+
query_params["cart_type"] = cartType;
|
|
242
|
+
|
|
243
|
+
const xHeaders = {};
|
|
244
|
+
|
|
245
|
+
const response = await ApplicationAPIClient.execute(
|
|
246
|
+
this._conf,
|
|
247
|
+
"post",
|
|
248
|
+
constructUrl({
|
|
249
|
+
url: this._urls["checkoutCart"],
|
|
250
|
+
params: {},
|
|
251
|
+
}),
|
|
252
|
+
query_params,
|
|
253
|
+
body,
|
|
254
|
+
{ ...xHeaders, ...requestHeaders },
|
|
255
|
+
{ responseHeaders }
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
let responseData = response;
|
|
259
|
+
if (responseHeaders) {
|
|
260
|
+
responseData = response[0];
|
|
386
261
|
}
|
|
387
262
|
|
|
388
263
|
return response;
|
|
389
264
|
}
|
|
390
265
|
|
|
391
266
|
/**
|
|
392
|
-
* @param {CartApplicationValidator.CheckoutCartV2Param} arg - Arg object.
|
|
393
267
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
394
268
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
395
|
-
* @returns {Promise<
|
|
269
|
+
* @returns {Promise<CartCheckoutResult>} - Success response
|
|
396
270
|
* @name checkoutCartV2
|
|
397
271
|
* @summary: Checkout cart
|
|
398
272
|
* @description: The checkout cart initiates the order creation process based on the items in the user’s cart, their selected address, and chosen payment methods. It also supports multiple payment method options and revalidates the cart details to ensure a secure and seamless order placement. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/checkoutCartV2/).
|
|
@@ -401,28 +275,6 @@ class Cart {
|
|
|
401
275
|
{ body, buyNow, cartType, requestHeaders } = { requestHeaders: {} },
|
|
402
276
|
{ responseHeaders } = { responseHeaders: false }
|
|
403
277
|
) {
|
|
404
|
-
const { error } = CartApplicationValidator.checkoutCartV2().validate(
|
|
405
|
-
{ body, buyNow, cartType },
|
|
406
|
-
{ abortEarly: false, allowUnknown: true }
|
|
407
|
-
);
|
|
408
|
-
if (error) {
|
|
409
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
// Showing warrnings if extra unknown parameters are found
|
|
413
|
-
const {
|
|
414
|
-
error: warrning,
|
|
415
|
-
} = CartApplicationValidator.checkoutCartV2().validate(
|
|
416
|
-
{ body, buyNow, cartType },
|
|
417
|
-
{ abortEarly: false, allowUnknown: false }
|
|
418
|
-
);
|
|
419
|
-
if (warrning) {
|
|
420
|
-
Logger({
|
|
421
|
-
level: "WARN",
|
|
422
|
-
message: `Parameter Validation warrnings for application > Cart > checkoutCartV2 \n ${warrning}`,
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
|
|
426
278
|
const query_params = {};
|
|
427
279
|
query_params["buy_now"] = buyNow;
|
|
428
280
|
query_params["cart_type"] = cartType;
|
|
@@ -447,33 +299,13 @@ class Cart {
|
|
|
447
299
|
responseData = response[0];
|
|
448
300
|
}
|
|
449
301
|
|
|
450
|
-
const {
|
|
451
|
-
error: res_error,
|
|
452
|
-
} = CartApplicationModel.CartCheckoutResponse().validate(responseData, {
|
|
453
|
-
abortEarly: false,
|
|
454
|
-
allowUnknown: true,
|
|
455
|
-
});
|
|
456
|
-
|
|
457
|
-
if (res_error) {
|
|
458
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
459
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
460
|
-
} else {
|
|
461
|
-
Logger({
|
|
462
|
-
level: "WARN",
|
|
463
|
-
message: `Response Validation Warnings for application > Cart > checkoutCartV2 \n ${res_error}`,
|
|
464
|
-
});
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
|
|
468
302
|
return response;
|
|
469
303
|
}
|
|
470
304
|
|
|
471
305
|
/**
|
|
472
|
-
* @param {CartApplicationValidator.DeleteCartParam} arg - Arg object.
|
|
473
306
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
474
307
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
475
|
-
* @returns {Promise<
|
|
476
|
-
* Success response
|
|
308
|
+
* @returns {Promise<DeleteCartDetailResult>} - Success response
|
|
477
309
|
* @name deleteCart
|
|
478
310
|
* @summary: Delete a cart
|
|
479
311
|
* @description: Delete all items from the user's cart and resets it to its initial state, providing a clean slate for new selections. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/deleteCart/).
|
|
@@ -482,26 +314,6 @@ class Cart {
|
|
|
482
314
|
{ id, requestHeaders } = { requestHeaders: {} },
|
|
483
315
|
{ responseHeaders } = { responseHeaders: false }
|
|
484
316
|
) {
|
|
485
|
-
const { error } = CartApplicationValidator.deleteCart().validate(
|
|
486
|
-
{ id },
|
|
487
|
-
{ abortEarly: false, allowUnknown: true }
|
|
488
|
-
);
|
|
489
|
-
if (error) {
|
|
490
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
// Showing warrnings if extra unknown parameters are found
|
|
494
|
-
const { error: warrning } = CartApplicationValidator.deleteCart().validate(
|
|
495
|
-
{ id },
|
|
496
|
-
{ abortEarly: false, allowUnknown: false }
|
|
497
|
-
);
|
|
498
|
-
if (warrning) {
|
|
499
|
-
Logger({
|
|
500
|
-
level: "WARN",
|
|
501
|
-
message: `Parameter Validation warrnings for application > Cart > deleteCart \n ${warrning}`,
|
|
502
|
-
});
|
|
503
|
-
}
|
|
504
|
-
|
|
505
317
|
const query_params = {};
|
|
506
318
|
query_params["id"] = id;
|
|
507
319
|
|
|
@@ -525,32 +337,13 @@ class Cart {
|
|
|
525
337
|
responseData = response[0];
|
|
526
338
|
}
|
|
527
339
|
|
|
528
|
-
const {
|
|
529
|
-
error: res_error,
|
|
530
|
-
} = CartApplicationModel.DeleteCartDetailResponse().validate(responseData, {
|
|
531
|
-
abortEarly: false,
|
|
532
|
-
allowUnknown: true,
|
|
533
|
-
});
|
|
534
|
-
|
|
535
|
-
if (res_error) {
|
|
536
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
537
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
538
|
-
} else {
|
|
539
|
-
Logger({
|
|
540
|
-
level: "WARN",
|
|
541
|
-
message: `Response Validation Warnings for application > Cart > deleteCart \n ${res_error}`,
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
|
|
546
340
|
return response;
|
|
547
341
|
}
|
|
548
342
|
|
|
549
343
|
/**
|
|
550
|
-
* @param {CartApplicationValidator.GetAddressByIdParam} arg - Arg object.
|
|
551
344
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
552
345
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
553
|
-
* @returns {Promise<
|
|
346
|
+
* @returns {Promise<Address>} - Success response
|
|
554
347
|
* @name getAddressById
|
|
555
348
|
* @summary: Get details for a single customer address
|
|
556
349
|
* @description: Get a specific customer address stored in the system by providing its unique identifier. This API provides detailed information about the address, including the recipient's name, address, city, postal code, and other relevant details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getAddressById/).
|
|
@@ -568,28 +361,6 @@ class Cart {
|
|
|
568
361
|
} = { requestHeaders: {} },
|
|
569
362
|
{ responseHeaders } = { responseHeaders: false }
|
|
570
363
|
) {
|
|
571
|
-
const { error } = CartApplicationValidator.getAddressById().validate(
|
|
572
|
-
{ id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
|
|
573
|
-
{ abortEarly: false, allowUnknown: true }
|
|
574
|
-
);
|
|
575
|
-
if (error) {
|
|
576
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
// Showing warrnings if extra unknown parameters are found
|
|
580
|
-
const {
|
|
581
|
-
error: warrning,
|
|
582
|
-
} = CartApplicationValidator.getAddressById().validate(
|
|
583
|
-
{ id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
|
|
584
|
-
{ abortEarly: false, allowUnknown: false }
|
|
585
|
-
);
|
|
586
|
-
if (warrning) {
|
|
587
|
-
Logger({
|
|
588
|
-
level: "WARN",
|
|
589
|
-
message: `Parameter Validation warrnings for application > Cart > getAddressById \n ${warrning}`,
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
|
-
|
|
593
364
|
const query_params = {};
|
|
594
365
|
query_params["cart_id"] = cartId;
|
|
595
366
|
query_params["buy_now"] = buyNow;
|
|
@@ -618,32 +389,13 @@ class Cart {
|
|
|
618
389
|
responseData = response[0];
|
|
619
390
|
}
|
|
620
391
|
|
|
621
|
-
const {
|
|
622
|
-
error: res_error,
|
|
623
|
-
} = CartApplicationModel.Address().validate(responseData, {
|
|
624
|
-
abortEarly: false,
|
|
625
|
-
allowUnknown: true,
|
|
626
|
-
});
|
|
627
|
-
|
|
628
|
-
if (res_error) {
|
|
629
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
630
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
631
|
-
} else {
|
|
632
|
-
Logger({
|
|
633
|
-
level: "WARN",
|
|
634
|
-
message: `Response Validation Warnings for application > Cart > getAddressById \n ${res_error}`,
|
|
635
|
-
});
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
|
|
639
392
|
return response;
|
|
640
393
|
}
|
|
641
394
|
|
|
642
395
|
/**
|
|
643
|
-
* @param {CartApplicationValidator.GetAddressesParam} arg - Arg object.
|
|
644
396
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
645
397
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
646
|
-
* @returns {Promise<
|
|
398
|
+
* @returns {Promise<GetAddressesResult>} - Success response
|
|
647
399
|
* @name getAddresses
|
|
648
400
|
* @summary: Get a list of addresses for a customer
|
|
649
401
|
* @description: List all addresses saved by the customer, simplifying the checkout process by offering pre-saved address options for delivery. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getAddresses/).
|
|
@@ -660,28 +412,6 @@ class Cart {
|
|
|
660
412
|
} = { requestHeaders: {} },
|
|
661
413
|
{ responseHeaders } = { responseHeaders: false }
|
|
662
414
|
) {
|
|
663
|
-
const { error } = CartApplicationValidator.getAddresses().validate(
|
|
664
|
-
{ cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
|
|
665
|
-
{ abortEarly: false, allowUnknown: true }
|
|
666
|
-
);
|
|
667
|
-
if (error) {
|
|
668
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
// Showing warrnings if extra unknown parameters are found
|
|
672
|
-
const {
|
|
673
|
-
error: warrning,
|
|
674
|
-
} = CartApplicationValidator.getAddresses().validate(
|
|
675
|
-
{ cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
|
|
676
|
-
{ abortEarly: false, allowUnknown: false }
|
|
677
|
-
);
|
|
678
|
-
if (warrning) {
|
|
679
|
-
Logger({
|
|
680
|
-
level: "WARN",
|
|
681
|
-
message: `Parameter Validation warrnings for application > Cart > getAddresses \n ${warrning}`,
|
|
682
|
-
});
|
|
683
|
-
}
|
|
684
|
-
|
|
685
415
|
const query_params = {};
|
|
686
416
|
query_params["cart_id"] = cartId;
|
|
687
417
|
query_params["buy_now"] = buyNow;
|
|
@@ -710,32 +440,13 @@ class Cart {
|
|
|
710
440
|
responseData = response[0];
|
|
711
441
|
}
|
|
712
442
|
|
|
713
|
-
const {
|
|
714
|
-
error: res_error,
|
|
715
|
-
} = CartApplicationModel.GetAddressesResponse().validate(responseData, {
|
|
716
|
-
abortEarly: false,
|
|
717
|
-
allowUnknown: true,
|
|
718
|
-
});
|
|
719
|
-
|
|
720
|
-
if (res_error) {
|
|
721
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
722
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
723
|
-
} else {
|
|
724
|
-
Logger({
|
|
725
|
-
level: "WARN",
|
|
726
|
-
message: `Response Validation Warnings for application > Cart > getAddresses \n ${res_error}`,
|
|
727
|
-
});
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
|
|
731
443
|
return response;
|
|
732
444
|
}
|
|
733
445
|
|
|
734
446
|
/**
|
|
735
|
-
* @param {CartApplicationValidator.GetBulkDiscountOffersParam} arg - Arg object.
|
|
736
447
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
737
448
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
738
|
-
* @returns {Promise<
|
|
449
|
+
* @returns {Promise<BulkPriceResult>} - Success response
|
|
739
450
|
* @name getBulkDiscountOffers
|
|
740
451
|
* @summary: List bulk discounts
|
|
741
452
|
* @description: List offer discounts with information about quantity and seller. One offer is marked with a "best" flag, indicating it as the best offer among the list. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getBulkDiscountOffers/).
|
|
@@ -744,28 +455,6 @@ class Cart {
|
|
|
744
455
|
{ itemId, articleId, uid, slug, requestHeaders } = { requestHeaders: {} },
|
|
745
456
|
{ responseHeaders } = { responseHeaders: false }
|
|
746
457
|
) {
|
|
747
|
-
const { error } = CartApplicationValidator.getBulkDiscountOffers().validate(
|
|
748
|
-
{ itemId, articleId, uid, slug },
|
|
749
|
-
{ abortEarly: false, allowUnknown: true }
|
|
750
|
-
);
|
|
751
|
-
if (error) {
|
|
752
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
// Showing warrnings if extra unknown parameters are found
|
|
756
|
-
const {
|
|
757
|
-
error: warrning,
|
|
758
|
-
} = CartApplicationValidator.getBulkDiscountOffers().validate(
|
|
759
|
-
{ itemId, articleId, uid, slug },
|
|
760
|
-
{ abortEarly: false, allowUnknown: false }
|
|
761
|
-
);
|
|
762
|
-
if (warrning) {
|
|
763
|
-
Logger({
|
|
764
|
-
level: "WARN",
|
|
765
|
-
message: `Parameter Validation warrnings for application > Cart > getBulkDiscountOffers \n ${warrning}`,
|
|
766
|
-
});
|
|
767
|
-
}
|
|
768
|
-
|
|
769
458
|
const query_params = {};
|
|
770
459
|
query_params["item_id"] = itemId;
|
|
771
460
|
query_params["article_id"] = articleId;
|
|
@@ -792,32 +481,13 @@ class Cart {
|
|
|
792
481
|
responseData = response[0];
|
|
793
482
|
}
|
|
794
483
|
|
|
795
|
-
const {
|
|
796
|
-
error: res_error,
|
|
797
|
-
} = CartApplicationModel.BulkPriceResponse().validate(responseData, {
|
|
798
|
-
abortEarly: false,
|
|
799
|
-
allowUnknown: true,
|
|
800
|
-
});
|
|
801
|
-
|
|
802
|
-
if (res_error) {
|
|
803
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
804
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
805
|
-
} else {
|
|
806
|
-
Logger({
|
|
807
|
-
level: "WARN",
|
|
808
|
-
message: `Response Validation Warnings for application > Cart > getBulkDiscountOffers \n ${res_error}`,
|
|
809
|
-
});
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
|
|
813
484
|
return response;
|
|
814
485
|
}
|
|
815
486
|
|
|
816
487
|
/**
|
|
817
|
-
* @param {CartApplicationValidator.GetCartParam} arg - Arg object.
|
|
818
488
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
819
489
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
820
|
-
* @returns {Promise<
|
|
490
|
+
* @returns {Promise<CartDetailResult>} - Success response
|
|
821
491
|
* @name getCart
|
|
822
492
|
* @summary: Get a cart
|
|
823
493
|
* @description: Get details of a cart linked to a specific customer using 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/application/cart/getCart/).
|
|
@@ -836,26 +506,6 @@ class Cart {
|
|
|
836
506
|
} = { requestHeaders: {} },
|
|
837
507
|
{ responseHeaders } = { responseHeaders: false }
|
|
838
508
|
) {
|
|
839
|
-
const { error } = CartApplicationValidator.getCart().validate(
|
|
840
|
-
{ id, i, b, c, assignCardId, areaCode, buyNow, orderType },
|
|
841
|
-
{ abortEarly: false, allowUnknown: true }
|
|
842
|
-
);
|
|
843
|
-
if (error) {
|
|
844
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
// Showing warrnings if extra unknown parameters are found
|
|
848
|
-
const { error: warrning } = CartApplicationValidator.getCart().validate(
|
|
849
|
-
{ id, i, b, c, assignCardId, areaCode, buyNow, orderType },
|
|
850
|
-
{ abortEarly: false, allowUnknown: false }
|
|
851
|
-
);
|
|
852
|
-
if (warrning) {
|
|
853
|
-
Logger({
|
|
854
|
-
level: "WARN",
|
|
855
|
-
message: `Parameter Validation warrnings for application > Cart > getCart \n ${warrning}`,
|
|
856
|
-
});
|
|
857
|
-
}
|
|
858
|
-
|
|
859
509
|
const query_params = {};
|
|
860
510
|
query_params["id"] = id;
|
|
861
511
|
query_params["i"] = i;
|
|
@@ -886,29 +536,10 @@ class Cart {
|
|
|
886
536
|
responseData = response[0];
|
|
887
537
|
}
|
|
888
538
|
|
|
889
|
-
const {
|
|
890
|
-
error: res_error,
|
|
891
|
-
} = CartApplicationModel.CartDetailResponse().validate(responseData, {
|
|
892
|
-
abortEarly: false,
|
|
893
|
-
allowUnknown: true,
|
|
894
|
-
});
|
|
895
|
-
|
|
896
|
-
if (res_error) {
|
|
897
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
898
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
899
|
-
} else {
|
|
900
|
-
Logger({
|
|
901
|
-
level: "WARN",
|
|
902
|
-
message: `Response Validation Warnings for application > Cart > getCart \n ${res_error}`,
|
|
903
|
-
});
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
|
-
|
|
907
539
|
return response;
|
|
908
540
|
}
|
|
909
541
|
|
|
910
542
|
/**
|
|
911
|
-
* @param {CartApplicationValidator.GetCartLastModifiedParam} arg - Arg object.
|
|
912
543
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
913
544
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
914
545
|
* @returns {Promise<any>} - Success response
|
|
@@ -920,28 +551,6 @@ class Cart {
|
|
|
920
551
|
{ id, requestHeaders } = { requestHeaders: {} },
|
|
921
552
|
{ responseHeaders } = { responseHeaders: false }
|
|
922
553
|
) {
|
|
923
|
-
const { error } = CartApplicationValidator.getCartLastModified().validate(
|
|
924
|
-
{ id },
|
|
925
|
-
{ abortEarly: false, allowUnknown: true }
|
|
926
|
-
);
|
|
927
|
-
if (error) {
|
|
928
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
// Showing warrnings if extra unknown parameters are found
|
|
932
|
-
const {
|
|
933
|
-
error: warrning,
|
|
934
|
-
} = CartApplicationValidator.getCartLastModified().validate(
|
|
935
|
-
{ id },
|
|
936
|
-
{ abortEarly: false, allowUnknown: false }
|
|
937
|
-
);
|
|
938
|
-
if (warrning) {
|
|
939
|
-
Logger({
|
|
940
|
-
level: "WARN",
|
|
941
|
-
message: `Parameter Validation warrnings for application > Cart > getCartLastModified \n ${warrning}`,
|
|
942
|
-
});
|
|
943
|
-
}
|
|
944
|
-
|
|
945
554
|
const query_params = {};
|
|
946
555
|
query_params["id"] = id;
|
|
947
556
|
|
|
@@ -965,30 +574,13 @@ class Cart {
|
|
|
965
574
|
responseData = response[0];
|
|
966
575
|
}
|
|
967
576
|
|
|
968
|
-
const { error: res_error } = Joi.string()
|
|
969
|
-
.allow("")
|
|
970
|
-
.validate(responseData, { abortEarly: false, allowUnknown: true });
|
|
971
|
-
|
|
972
|
-
if (res_error) {
|
|
973
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
974
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
975
|
-
} else {
|
|
976
|
-
Logger({
|
|
977
|
-
level: "WARN",
|
|
978
|
-
message: `Response Validation Warnings for application > Cart > getCartLastModified \n ${res_error}`,
|
|
979
|
-
});
|
|
980
|
-
}
|
|
981
|
-
}
|
|
982
|
-
|
|
983
577
|
return response;
|
|
984
578
|
}
|
|
985
579
|
|
|
986
580
|
/**
|
|
987
|
-
* @param {CartApplicationValidator.GetCartShareLinkParam} arg - Arg object.
|
|
988
581
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
989
582
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
990
|
-
* @returns {Promise<
|
|
991
|
-
* Success response
|
|
583
|
+
* @returns {Promise<GetShareCartLinkResult>} - Success response
|
|
992
584
|
* @name getCartShareLink
|
|
993
585
|
* @summary: Create share cart link
|
|
994
586
|
* @description: Generate a unique shareable link for the customer's cart for a specific sales channel. This link enables easy sharing of the cart contents with other users, facilitating collaborative shopping experiences. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getCartShareLink/).
|
|
@@ -997,28 +589,6 @@ class Cart {
|
|
|
997
589
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
998
590
|
{ responseHeaders } = { responseHeaders: false }
|
|
999
591
|
) {
|
|
1000
|
-
const { error } = CartApplicationValidator.getCartShareLink().validate(
|
|
1001
|
-
{ body },
|
|
1002
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1003
|
-
);
|
|
1004
|
-
if (error) {
|
|
1005
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1009
|
-
const {
|
|
1010
|
-
error: warrning,
|
|
1011
|
-
} = CartApplicationValidator.getCartShareLink().validate(
|
|
1012
|
-
{ body },
|
|
1013
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1014
|
-
);
|
|
1015
|
-
if (warrning) {
|
|
1016
|
-
Logger({
|
|
1017
|
-
level: "WARN",
|
|
1018
|
-
message: `Parameter Validation warrnings for application > Cart > getCartShareLink \n ${warrning}`,
|
|
1019
|
-
});
|
|
1020
|
-
}
|
|
1021
|
-
|
|
1022
592
|
const query_params = {};
|
|
1023
593
|
|
|
1024
594
|
const xHeaders = {};
|
|
@@ -1041,32 +611,13 @@ class Cart {
|
|
|
1041
611
|
responseData = response[0];
|
|
1042
612
|
}
|
|
1043
613
|
|
|
1044
|
-
const {
|
|
1045
|
-
error: res_error,
|
|
1046
|
-
} = CartApplicationModel.GetShareCartLinkResponse().validate(responseData, {
|
|
1047
|
-
abortEarly: false,
|
|
1048
|
-
allowUnknown: true,
|
|
1049
|
-
});
|
|
1050
|
-
|
|
1051
|
-
if (res_error) {
|
|
1052
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1053
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1054
|
-
} else {
|
|
1055
|
-
Logger({
|
|
1056
|
-
level: "WARN",
|
|
1057
|
-
message: `Response Validation Warnings for application > Cart > getCartShareLink \n ${res_error}`,
|
|
1058
|
-
});
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
|
|
1062
614
|
return response;
|
|
1063
615
|
}
|
|
1064
616
|
|
|
1065
617
|
/**
|
|
1066
|
-
* @param {CartApplicationValidator.GetCartSharedItemsParam} arg - Arg object.
|
|
1067
618
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1068
619
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1069
|
-
* @returns {Promise<
|
|
620
|
+
* @returns {Promise<SharedCartResult>} - Success response
|
|
1070
621
|
* @name getCartSharedItems
|
|
1071
622
|
* @summary: List shared cart items
|
|
1072
623
|
* @description: Get cart items from the shared cart link based on unique token. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getCartSharedItems/).
|
|
@@ -1075,28 +626,6 @@ class Cart {
|
|
|
1075
626
|
{ token, requestHeaders } = { requestHeaders: {} },
|
|
1076
627
|
{ responseHeaders } = { responseHeaders: false }
|
|
1077
628
|
) {
|
|
1078
|
-
const { error } = CartApplicationValidator.getCartSharedItems().validate(
|
|
1079
|
-
{ token },
|
|
1080
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1081
|
-
);
|
|
1082
|
-
if (error) {
|
|
1083
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1084
|
-
}
|
|
1085
|
-
|
|
1086
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1087
|
-
const {
|
|
1088
|
-
error: warrning,
|
|
1089
|
-
} = CartApplicationValidator.getCartSharedItems().validate(
|
|
1090
|
-
{ token },
|
|
1091
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1092
|
-
);
|
|
1093
|
-
if (warrning) {
|
|
1094
|
-
Logger({
|
|
1095
|
-
level: "WARN",
|
|
1096
|
-
message: `Parameter Validation warrnings for application > Cart > getCartSharedItems \n ${warrning}`,
|
|
1097
|
-
});
|
|
1098
|
-
}
|
|
1099
|
-
|
|
1100
629
|
const query_params = {};
|
|
1101
630
|
|
|
1102
631
|
const xHeaders = {};
|
|
@@ -1119,32 +648,13 @@ class Cart {
|
|
|
1119
648
|
responseData = response[0];
|
|
1120
649
|
}
|
|
1121
650
|
|
|
1122
|
-
const {
|
|
1123
|
-
error: res_error,
|
|
1124
|
-
} = CartApplicationModel.SharedCartResponse().validate(responseData, {
|
|
1125
|
-
abortEarly: false,
|
|
1126
|
-
allowUnknown: true,
|
|
1127
|
-
});
|
|
1128
|
-
|
|
1129
|
-
if (res_error) {
|
|
1130
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1131
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1132
|
-
} else {
|
|
1133
|
-
Logger({
|
|
1134
|
-
level: "WARN",
|
|
1135
|
-
message: `Response Validation Warnings for application > Cart > getCartSharedItems \n ${res_error}`,
|
|
1136
|
-
});
|
|
1137
|
-
}
|
|
1138
|
-
}
|
|
1139
|
-
|
|
1140
651
|
return response;
|
|
1141
652
|
}
|
|
1142
653
|
|
|
1143
654
|
/**
|
|
1144
|
-
* @param {CartApplicationValidator.GetCouponsParam} arg - Arg object.
|
|
1145
655
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1146
656
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1147
|
-
* @returns {Promise<
|
|
657
|
+
* @returns {Promise<GetCouponResult>} - Success response
|
|
1148
658
|
* @name getCoupons
|
|
1149
659
|
* @summary: List available coupons
|
|
1150
660
|
* @description: List all available coupons that customer can apply to their carts. It provides details about each coupon, including its code, discount amount, and applicable conditions. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getCoupons/).
|
|
@@ -1153,26 +663,6 @@ class Cart {
|
|
|
1153
663
|
{ id, buyNow, slug, storeId, requestHeaders } = { requestHeaders: {} },
|
|
1154
664
|
{ responseHeaders } = { responseHeaders: false }
|
|
1155
665
|
) {
|
|
1156
|
-
const { error } = CartApplicationValidator.getCoupons().validate(
|
|
1157
|
-
{ id, buyNow, slug, storeId },
|
|
1158
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1159
|
-
);
|
|
1160
|
-
if (error) {
|
|
1161
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1162
|
-
}
|
|
1163
|
-
|
|
1164
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1165
|
-
const { error: warrning } = CartApplicationValidator.getCoupons().validate(
|
|
1166
|
-
{ id, buyNow, slug, storeId },
|
|
1167
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1168
|
-
);
|
|
1169
|
-
if (warrning) {
|
|
1170
|
-
Logger({
|
|
1171
|
-
level: "WARN",
|
|
1172
|
-
message: `Parameter Validation warrnings for application > Cart > getCoupons \n ${warrning}`,
|
|
1173
|
-
});
|
|
1174
|
-
}
|
|
1175
|
-
|
|
1176
666
|
const query_params = {};
|
|
1177
667
|
query_params["id"] = id;
|
|
1178
668
|
query_params["buy_now"] = buyNow;
|
|
@@ -1199,32 +689,13 @@ class Cart {
|
|
|
1199
689
|
responseData = response[0];
|
|
1200
690
|
}
|
|
1201
691
|
|
|
1202
|
-
const {
|
|
1203
|
-
error: res_error,
|
|
1204
|
-
} = CartApplicationModel.GetCouponResponse().validate(responseData, {
|
|
1205
|
-
abortEarly: false,
|
|
1206
|
-
allowUnknown: true,
|
|
1207
|
-
});
|
|
1208
|
-
|
|
1209
|
-
if (res_error) {
|
|
1210
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1211
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1212
|
-
} else {
|
|
1213
|
-
Logger({
|
|
1214
|
-
level: "WARN",
|
|
1215
|
-
message: `Response Validation Warnings for application > Cart > getCoupons \n ${res_error}`,
|
|
1216
|
-
});
|
|
1217
|
-
}
|
|
1218
|
-
}
|
|
1219
|
-
|
|
1220
692
|
return response;
|
|
1221
693
|
}
|
|
1222
694
|
|
|
1223
695
|
/**
|
|
1224
|
-
* @param {CartApplicationValidator.GetItemCountParam} arg - Arg object.
|
|
1225
696
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1226
697
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1227
|
-
* @returns {Promise<
|
|
698
|
+
* @returns {Promise<CartItemCountResult>} - Success response
|
|
1228
699
|
* @name getItemCount
|
|
1229
700
|
* @summary: Get a cart items count
|
|
1230
701
|
* @description: Get total count of items currently present in the customer's cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getItemCount/).
|
|
@@ -1233,28 +704,6 @@ class Cart {
|
|
|
1233
704
|
{ id, buyNow, requestHeaders } = { requestHeaders: {} },
|
|
1234
705
|
{ responseHeaders } = { responseHeaders: false }
|
|
1235
706
|
) {
|
|
1236
|
-
const { error } = CartApplicationValidator.getItemCount().validate(
|
|
1237
|
-
{ id, buyNow },
|
|
1238
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1239
|
-
);
|
|
1240
|
-
if (error) {
|
|
1241
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1242
|
-
}
|
|
1243
|
-
|
|
1244
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1245
|
-
const {
|
|
1246
|
-
error: warrning,
|
|
1247
|
-
} = CartApplicationValidator.getItemCount().validate(
|
|
1248
|
-
{ id, buyNow },
|
|
1249
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1250
|
-
);
|
|
1251
|
-
if (warrning) {
|
|
1252
|
-
Logger({
|
|
1253
|
-
level: "WARN",
|
|
1254
|
-
message: `Parameter Validation warrnings for application > Cart > getItemCount \n ${warrning}`,
|
|
1255
|
-
});
|
|
1256
|
-
}
|
|
1257
|
-
|
|
1258
707
|
const query_params = {};
|
|
1259
708
|
query_params["id"] = id;
|
|
1260
709
|
query_params["buy_now"] = buyNow;
|
|
@@ -1279,32 +728,13 @@ class Cart {
|
|
|
1279
728
|
responseData = response[0];
|
|
1280
729
|
}
|
|
1281
730
|
|
|
1282
|
-
const {
|
|
1283
|
-
error: res_error,
|
|
1284
|
-
} = CartApplicationModel.CartItemCountResponse().validate(responseData, {
|
|
1285
|
-
abortEarly: false,
|
|
1286
|
-
allowUnknown: true,
|
|
1287
|
-
});
|
|
1288
|
-
|
|
1289
|
-
if (res_error) {
|
|
1290
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1291
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1292
|
-
} else {
|
|
1293
|
-
Logger({
|
|
1294
|
-
level: "WARN",
|
|
1295
|
-
message: `Response Validation Warnings for application > Cart > getItemCount \n ${res_error}`,
|
|
1296
|
-
});
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
|
-
|
|
1300
731
|
return response;
|
|
1301
732
|
}
|
|
1302
733
|
|
|
1303
734
|
/**
|
|
1304
|
-
* @param {CartApplicationValidator.GetLadderOffersParam} arg - Arg object.
|
|
1305
735
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1306
736
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1307
|
-
* @returns {Promise<
|
|
737
|
+
* @returns {Promise<LadderPriceOffers>} - Success response
|
|
1308
738
|
* @name getLadderOffers
|
|
1309
739
|
* @summary: List ladder offers
|
|
1310
740
|
* @description: Get ladder offers associated for the items in the cart. Ladder offers provide discounts or special pricing based on item quantity, allowing users to benefit from bulk purchases or promotional deals. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getLadderOffers/).
|
|
@@ -1315,28 +745,6 @@ class Cart {
|
|
|
1315
745
|
},
|
|
1316
746
|
{ responseHeaders } = { responseHeaders: false }
|
|
1317
747
|
) {
|
|
1318
|
-
const { error } = CartApplicationValidator.getLadderOffers().validate(
|
|
1319
|
-
{ slug, storeId, promotionId, pageSize },
|
|
1320
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1321
|
-
);
|
|
1322
|
-
if (error) {
|
|
1323
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1324
|
-
}
|
|
1325
|
-
|
|
1326
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1327
|
-
const {
|
|
1328
|
-
error: warrning,
|
|
1329
|
-
} = CartApplicationValidator.getLadderOffers().validate(
|
|
1330
|
-
{ slug, storeId, promotionId, pageSize },
|
|
1331
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1332
|
-
);
|
|
1333
|
-
if (warrning) {
|
|
1334
|
-
Logger({
|
|
1335
|
-
level: "WARN",
|
|
1336
|
-
message: `Parameter Validation warrnings for application > Cart > getLadderOffers \n ${warrning}`,
|
|
1337
|
-
});
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
748
|
const query_params = {};
|
|
1341
749
|
query_params["slug"] = slug;
|
|
1342
750
|
query_params["store_id"] = storeId;
|
|
@@ -1363,32 +771,13 @@ class Cart {
|
|
|
1363
771
|
responseData = response[0];
|
|
1364
772
|
}
|
|
1365
773
|
|
|
1366
|
-
const {
|
|
1367
|
-
error: res_error,
|
|
1368
|
-
} = CartApplicationModel.LadderPriceOffers().validate(responseData, {
|
|
1369
|
-
abortEarly: false,
|
|
1370
|
-
allowUnknown: true,
|
|
1371
|
-
});
|
|
1372
|
-
|
|
1373
|
-
if (res_error) {
|
|
1374
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1375
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1376
|
-
} else {
|
|
1377
|
-
Logger({
|
|
1378
|
-
level: "WARN",
|
|
1379
|
-
message: `Response Validation Warnings for application > Cart > getLadderOffers \n ${res_error}`,
|
|
1380
|
-
});
|
|
1381
|
-
}
|
|
1382
|
-
}
|
|
1383
|
-
|
|
1384
774
|
return response;
|
|
1385
775
|
}
|
|
1386
776
|
|
|
1387
777
|
/**
|
|
1388
|
-
* @param {CartApplicationValidator.GetPromotionOffersParam} arg - Arg object.
|
|
1389
778
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1390
779
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1391
|
-
* @returns {Promise<
|
|
780
|
+
* @returns {Promise<PromotionOffersResult>} - Success response
|
|
1392
781
|
* @name getPromotionOffers
|
|
1393
782
|
* @summary: List available promotion offers
|
|
1394
783
|
* @description: List 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/application/cart/getPromotionOffers/).
|
|
@@ -1399,28 +788,6 @@ class Cart {
|
|
|
1399
788
|
},
|
|
1400
789
|
{ responseHeaders } = { responseHeaders: false }
|
|
1401
790
|
) {
|
|
1402
|
-
const { error } = CartApplicationValidator.getPromotionOffers().validate(
|
|
1403
|
-
{ slug, pageSize, promotionGroup, storeId, cartType },
|
|
1404
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1405
|
-
);
|
|
1406
|
-
if (error) {
|
|
1407
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1408
|
-
}
|
|
1409
|
-
|
|
1410
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1411
|
-
const {
|
|
1412
|
-
error: warrning,
|
|
1413
|
-
} = CartApplicationValidator.getPromotionOffers().validate(
|
|
1414
|
-
{ slug, pageSize, promotionGroup, storeId, cartType },
|
|
1415
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1416
|
-
);
|
|
1417
|
-
if (warrning) {
|
|
1418
|
-
Logger({
|
|
1419
|
-
level: "WARN",
|
|
1420
|
-
message: `Parameter Validation warrnings for application > Cart > getPromotionOffers \n ${warrning}`,
|
|
1421
|
-
});
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
791
|
const query_params = {};
|
|
1425
792
|
query_params["slug"] = slug;
|
|
1426
793
|
query_params["page_size"] = pageSize;
|
|
@@ -1448,34 +815,13 @@ class Cart {
|
|
|
1448
815
|
responseData = response[0];
|
|
1449
816
|
}
|
|
1450
817
|
|
|
1451
|
-
const {
|
|
1452
|
-
error: res_error,
|
|
1453
|
-
} = CartApplicationModel.PromotionOffersResponse().validate(responseData, {
|
|
1454
|
-
abortEarly: false,
|
|
1455
|
-
allowUnknown: true,
|
|
1456
|
-
});
|
|
1457
|
-
|
|
1458
|
-
if (res_error) {
|
|
1459
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1460
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1461
|
-
} else {
|
|
1462
|
-
Logger({
|
|
1463
|
-
level: "WARN",
|
|
1464
|
-
message: `Response Validation Warnings for application > Cart > getPromotionOffers \n ${res_error}`,
|
|
1465
|
-
});
|
|
1466
|
-
}
|
|
1467
|
-
}
|
|
1468
|
-
|
|
1469
818
|
return response;
|
|
1470
819
|
}
|
|
1471
820
|
|
|
1472
821
|
/**
|
|
1473
|
-
* @param {CartApplicationValidator.GetPromotionPaymentOffersParam} arg - Arg object.
|
|
1474
822
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1475
823
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1476
|
-
* @returns {Promise<
|
|
1477
|
-
* - Success response
|
|
1478
|
-
*
|
|
824
|
+
* @returns {Promise<PromotionPaymentOffersResult>} - Success response
|
|
1479
825
|
* @name getPromotionPaymentOffers
|
|
1480
826
|
* @summary: Fetch available promotions payment offers
|
|
1481
827
|
* @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/application/cart/getPromotionPaymentOffers/).
|
|
@@ -1484,30 +830,6 @@ class Cart {
|
|
|
1484
830
|
{ id, uid, requestHeaders } = { requestHeaders: {} },
|
|
1485
831
|
{ responseHeaders } = { responseHeaders: false }
|
|
1486
832
|
) {
|
|
1487
|
-
const {
|
|
1488
|
-
error,
|
|
1489
|
-
} = CartApplicationValidator.getPromotionPaymentOffers().validate(
|
|
1490
|
-
{ id, uid },
|
|
1491
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1492
|
-
);
|
|
1493
|
-
if (error) {
|
|
1494
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1495
|
-
}
|
|
1496
|
-
|
|
1497
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1498
|
-
const {
|
|
1499
|
-
error: warrning,
|
|
1500
|
-
} = CartApplicationValidator.getPromotionPaymentOffers().validate(
|
|
1501
|
-
{ id, uid },
|
|
1502
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1503
|
-
);
|
|
1504
|
-
if (warrning) {
|
|
1505
|
-
Logger({
|
|
1506
|
-
level: "WARN",
|
|
1507
|
-
message: `Parameter Validation warrnings for application > Cart > getPromotionPaymentOffers \n ${warrning}`,
|
|
1508
|
-
});
|
|
1509
|
-
}
|
|
1510
|
-
|
|
1511
833
|
const query_params = {};
|
|
1512
834
|
query_params["id"] = id;
|
|
1513
835
|
query_params["uid"] = uid;
|
|
@@ -1532,32 +854,13 @@ class Cart {
|
|
|
1532
854
|
responseData = response[0];
|
|
1533
855
|
}
|
|
1534
856
|
|
|
1535
|
-
const {
|
|
1536
|
-
error: res_error,
|
|
1537
|
-
} = CartApplicationModel.PromotionPaymentOffersResponse().validate(
|
|
1538
|
-
responseData,
|
|
1539
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1540
|
-
);
|
|
1541
|
-
|
|
1542
|
-
if (res_error) {
|
|
1543
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1544
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1545
|
-
} else {
|
|
1546
|
-
Logger({
|
|
1547
|
-
level: "WARN",
|
|
1548
|
-
message: `Response Validation Warnings for application > Cart > getPromotionPaymentOffers \n ${res_error}`,
|
|
1549
|
-
});
|
|
1550
|
-
}
|
|
1551
|
-
}
|
|
1552
|
-
|
|
1553
857
|
return response;
|
|
1554
858
|
}
|
|
1555
859
|
|
|
1556
860
|
/**
|
|
1557
|
-
* @param {CartApplicationValidator.GetShipmentsParam} arg - Arg object.
|
|
1558
861
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1559
862
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1560
|
-
* @returns {Promise<
|
|
863
|
+
* @returns {Promise<CartShipmentsResult>} - Success response
|
|
1561
864
|
* @name getShipments
|
|
1562
865
|
* @summary: List shipments
|
|
1563
866
|
* @description: Get shipment details for the items in a cart, specific to the selected address. Shipment details include delivery promises, seller information, item details, and other relevant information. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getShipments/).
|
|
@@ -1568,28 +871,6 @@ class Cart {
|
|
|
1568
871
|
},
|
|
1569
872
|
{ responseHeaders } = { responseHeaders: false }
|
|
1570
873
|
) {
|
|
1571
|
-
const { error } = CartApplicationValidator.getShipments().validate(
|
|
1572
|
-
{ p, id, buyNow, addressId, areaCode, orderType },
|
|
1573
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1574
|
-
);
|
|
1575
|
-
if (error) {
|
|
1576
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1577
|
-
}
|
|
1578
|
-
|
|
1579
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1580
|
-
const {
|
|
1581
|
-
error: warrning,
|
|
1582
|
-
} = CartApplicationValidator.getShipments().validate(
|
|
1583
|
-
{ p, id, buyNow, addressId, areaCode, orderType },
|
|
1584
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1585
|
-
);
|
|
1586
|
-
if (warrning) {
|
|
1587
|
-
Logger({
|
|
1588
|
-
level: "WARN",
|
|
1589
|
-
message: `Parameter Validation warrnings for application > Cart > getShipments \n ${warrning}`,
|
|
1590
|
-
});
|
|
1591
|
-
}
|
|
1592
|
-
|
|
1593
874
|
const query_params = {};
|
|
1594
875
|
query_params["p"] = p;
|
|
1595
876
|
query_params["id"] = id;
|
|
@@ -1618,32 +899,13 @@ class Cart {
|
|
|
1618
899
|
responseData = response[0];
|
|
1619
900
|
}
|
|
1620
901
|
|
|
1621
|
-
const {
|
|
1622
|
-
error: res_error,
|
|
1623
|
-
} = CartApplicationModel.CartShipmentsResponse().validate(responseData, {
|
|
1624
|
-
abortEarly: false,
|
|
1625
|
-
allowUnknown: true,
|
|
1626
|
-
});
|
|
1627
|
-
|
|
1628
|
-
if (res_error) {
|
|
1629
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1630
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1631
|
-
} else {
|
|
1632
|
-
Logger({
|
|
1633
|
-
level: "WARN",
|
|
1634
|
-
message: `Response Validation Warnings for application > Cart > getShipments \n ${res_error}`,
|
|
1635
|
-
});
|
|
1636
|
-
}
|
|
1637
|
-
}
|
|
1638
|
-
|
|
1639
902
|
return response;
|
|
1640
903
|
}
|
|
1641
904
|
|
|
1642
905
|
/**
|
|
1643
|
-
* @param {CartApplicationValidator.RemoveAddressParam} arg - Arg object.
|
|
1644
906
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1645
907
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1646
|
-
* @returns {Promise<
|
|
908
|
+
* @returns {Promise<DeleteAddressResult>} - Success response
|
|
1647
909
|
* @name removeAddress
|
|
1648
910
|
* @summary: Removes an address from a customer's address list
|
|
1649
911
|
* @description: Delete an existing customer address from the system. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/removeAddress/).
|
|
@@ -1652,28 +914,6 @@ class Cart {
|
|
|
1652
914
|
{ id, requestHeaders } = { requestHeaders: {} },
|
|
1653
915
|
{ responseHeaders } = { responseHeaders: false }
|
|
1654
916
|
) {
|
|
1655
|
-
const { error } = CartApplicationValidator.removeAddress().validate(
|
|
1656
|
-
{ id },
|
|
1657
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1658
|
-
);
|
|
1659
|
-
if (error) {
|
|
1660
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1661
|
-
}
|
|
1662
|
-
|
|
1663
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1664
|
-
const {
|
|
1665
|
-
error: warrning,
|
|
1666
|
-
} = CartApplicationValidator.removeAddress().validate(
|
|
1667
|
-
{ id },
|
|
1668
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1669
|
-
);
|
|
1670
|
-
if (warrning) {
|
|
1671
|
-
Logger({
|
|
1672
|
-
level: "WARN",
|
|
1673
|
-
message: `Parameter Validation warrnings for application > Cart > removeAddress \n ${warrning}`,
|
|
1674
|
-
});
|
|
1675
|
-
}
|
|
1676
|
-
|
|
1677
917
|
const query_params = {};
|
|
1678
918
|
|
|
1679
919
|
const xHeaders = {};
|
|
@@ -1696,32 +936,13 @@ class Cart {
|
|
|
1696
936
|
responseData = response[0];
|
|
1697
937
|
}
|
|
1698
938
|
|
|
1699
|
-
const {
|
|
1700
|
-
error: res_error,
|
|
1701
|
-
} = CartApplicationModel.DeleteAddressResponse().validate(responseData, {
|
|
1702
|
-
abortEarly: false,
|
|
1703
|
-
allowUnknown: true,
|
|
1704
|
-
});
|
|
1705
|
-
|
|
1706
|
-
if (res_error) {
|
|
1707
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1708
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1709
|
-
} else {
|
|
1710
|
-
Logger({
|
|
1711
|
-
level: "WARN",
|
|
1712
|
-
message: `Response Validation Warnings for application > Cart > removeAddress \n ${res_error}`,
|
|
1713
|
-
});
|
|
1714
|
-
}
|
|
1715
|
-
}
|
|
1716
|
-
|
|
1717
939
|
return response;
|
|
1718
940
|
}
|
|
1719
941
|
|
|
1720
942
|
/**
|
|
1721
|
-
* @param {CartApplicationValidator.RemoveCouponParam} arg - Arg object.
|
|
1722
943
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1723
944
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1724
|
-
* @returns {Promise<
|
|
945
|
+
* @returns {Promise<CartDetailResult>} - Success response
|
|
1725
946
|
* @name removeCoupon
|
|
1726
947
|
* @summary: Remove coupon
|
|
1727
948
|
* @description: Remove an applied coupon from the customer's cart, thereby removing the associated discount from the cart total. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/removeCoupon/).
|
|
@@ -1730,28 +951,6 @@ class Cart {
|
|
|
1730
951
|
{ id, buyNow, requestHeaders } = { requestHeaders: {} },
|
|
1731
952
|
{ responseHeaders } = { responseHeaders: false }
|
|
1732
953
|
) {
|
|
1733
|
-
const { error } = CartApplicationValidator.removeCoupon().validate(
|
|
1734
|
-
{ id, buyNow },
|
|
1735
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1736
|
-
);
|
|
1737
|
-
if (error) {
|
|
1738
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1739
|
-
}
|
|
1740
|
-
|
|
1741
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1742
|
-
const {
|
|
1743
|
-
error: warrning,
|
|
1744
|
-
} = CartApplicationValidator.removeCoupon().validate(
|
|
1745
|
-
{ id, buyNow },
|
|
1746
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1747
|
-
);
|
|
1748
|
-
if (warrning) {
|
|
1749
|
-
Logger({
|
|
1750
|
-
level: "WARN",
|
|
1751
|
-
message: `Parameter Validation warrnings for application > Cart > removeCoupon \n ${warrning}`,
|
|
1752
|
-
});
|
|
1753
|
-
}
|
|
1754
|
-
|
|
1755
954
|
const query_params = {};
|
|
1756
955
|
query_params["id"] = id;
|
|
1757
956
|
query_params["buy_now"] = buyNow;
|
|
@@ -1776,32 +975,13 @@ class Cart {
|
|
|
1776
975
|
responseData = response[0];
|
|
1777
976
|
}
|
|
1778
977
|
|
|
1779
|
-
const {
|
|
1780
|
-
error: res_error,
|
|
1781
|
-
} = CartApplicationModel.CartDetailResponse().validate(responseData, {
|
|
1782
|
-
abortEarly: false,
|
|
1783
|
-
allowUnknown: true,
|
|
1784
|
-
});
|
|
1785
|
-
|
|
1786
|
-
if (res_error) {
|
|
1787
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1788
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1789
|
-
} else {
|
|
1790
|
-
Logger({
|
|
1791
|
-
level: "WARN",
|
|
1792
|
-
message: `Response Validation Warnings for application > Cart > removeCoupon \n ${res_error}`,
|
|
1793
|
-
});
|
|
1794
|
-
}
|
|
1795
|
-
}
|
|
1796
|
-
|
|
1797
978
|
return response;
|
|
1798
979
|
}
|
|
1799
980
|
|
|
1800
981
|
/**
|
|
1801
|
-
* @param {CartApplicationValidator.SelectAddressParam} arg - Arg object.
|
|
1802
982
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1803
983
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1804
|
-
* @returns {Promise<
|
|
984
|
+
* @returns {Promise<CartDetailResult>} - Success response
|
|
1805
985
|
* @name selectAddress
|
|
1806
986
|
* @summary: Select customer address for order processing
|
|
1807
987
|
* @description: Select an address from the saved customer addresses and validates the availability of items in the cart. Additionally, it verifies and updates the delivery promise based on the selected address. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/selectAddress/).
|
|
@@ -1810,28 +990,6 @@ class Cart {
|
|
|
1810
990
|
{ body, cartId, buyNow, i, b, requestHeaders } = { requestHeaders: {} },
|
|
1811
991
|
{ responseHeaders } = { responseHeaders: false }
|
|
1812
992
|
) {
|
|
1813
|
-
const { error } = CartApplicationValidator.selectAddress().validate(
|
|
1814
|
-
{ body, cartId, buyNow, i, b },
|
|
1815
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1816
|
-
);
|
|
1817
|
-
if (error) {
|
|
1818
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1819
|
-
}
|
|
1820
|
-
|
|
1821
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1822
|
-
const {
|
|
1823
|
-
error: warrning,
|
|
1824
|
-
} = CartApplicationValidator.selectAddress().validate(
|
|
1825
|
-
{ body, cartId, buyNow, i, b },
|
|
1826
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1827
|
-
);
|
|
1828
|
-
if (warrning) {
|
|
1829
|
-
Logger({
|
|
1830
|
-
level: "WARN",
|
|
1831
|
-
message: `Parameter Validation warrnings for application > Cart > selectAddress \n ${warrning}`,
|
|
1832
|
-
});
|
|
1833
|
-
}
|
|
1834
|
-
|
|
1835
993
|
const query_params = {};
|
|
1836
994
|
query_params["cart_id"] = cartId;
|
|
1837
995
|
query_params["buy_now"] = buyNow;
|
|
@@ -1858,32 +1016,13 @@ class Cart {
|
|
|
1858
1016
|
responseData = response[0];
|
|
1859
1017
|
}
|
|
1860
1018
|
|
|
1861
|
-
const {
|
|
1862
|
-
error: res_error,
|
|
1863
|
-
} = CartApplicationModel.CartDetailResponse().validate(responseData, {
|
|
1864
|
-
abortEarly: false,
|
|
1865
|
-
allowUnknown: true,
|
|
1866
|
-
});
|
|
1867
|
-
|
|
1868
|
-
if (res_error) {
|
|
1869
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1870
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1871
|
-
} else {
|
|
1872
|
-
Logger({
|
|
1873
|
-
level: "WARN",
|
|
1874
|
-
message: `Response Validation Warnings for application > Cart > selectAddress \n ${res_error}`,
|
|
1875
|
-
});
|
|
1876
|
-
}
|
|
1877
|
-
}
|
|
1878
|
-
|
|
1879
1019
|
return response;
|
|
1880
1020
|
}
|
|
1881
1021
|
|
|
1882
1022
|
/**
|
|
1883
|
-
* @param {CartApplicationValidator.SelectPaymentModeParam} arg - Arg object.
|
|
1884
1023
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1885
1024
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1886
|
-
* @returns {Promise<
|
|
1025
|
+
* @returns {Promise<CartDetailResult>} - Success response
|
|
1887
1026
|
* @name selectPaymentMode
|
|
1888
1027
|
* @summary: Select payment mode
|
|
1889
1028
|
* @description: Select a preferred payment mode from available options during the cart checkout process to securely and efficiently complete their transaction. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/selectPaymentMode/).
|
|
@@ -1892,28 +1031,6 @@ class Cart {
|
|
|
1892
1031
|
{ body, id, buyNow, requestHeaders } = { requestHeaders: {} },
|
|
1893
1032
|
{ responseHeaders } = { responseHeaders: false }
|
|
1894
1033
|
) {
|
|
1895
|
-
const { error } = CartApplicationValidator.selectPaymentMode().validate(
|
|
1896
|
-
{ body, id, buyNow },
|
|
1897
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1898
|
-
);
|
|
1899
|
-
if (error) {
|
|
1900
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1901
|
-
}
|
|
1902
|
-
|
|
1903
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1904
|
-
const {
|
|
1905
|
-
error: warrning,
|
|
1906
|
-
} = CartApplicationValidator.selectPaymentMode().validate(
|
|
1907
|
-
{ body, id, buyNow },
|
|
1908
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1909
|
-
);
|
|
1910
|
-
if (warrning) {
|
|
1911
|
-
Logger({
|
|
1912
|
-
level: "WARN",
|
|
1913
|
-
message: `Parameter Validation warrnings for application > Cart > selectPaymentMode \n ${warrning}`,
|
|
1914
|
-
});
|
|
1915
|
-
}
|
|
1916
|
-
|
|
1917
1034
|
const query_params = {};
|
|
1918
1035
|
query_params["id"] = id;
|
|
1919
1036
|
query_params["buy_now"] = buyNow;
|
|
@@ -1938,32 +1055,13 @@ class Cart {
|
|
|
1938
1055
|
responseData = response[0];
|
|
1939
1056
|
}
|
|
1940
1057
|
|
|
1941
|
-
const {
|
|
1942
|
-
error: res_error,
|
|
1943
|
-
} = CartApplicationModel.CartDetailResponse().validate(responseData, {
|
|
1944
|
-
abortEarly: false,
|
|
1945
|
-
allowUnknown: true,
|
|
1946
|
-
});
|
|
1947
|
-
|
|
1948
|
-
if (res_error) {
|
|
1949
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1950
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1951
|
-
} else {
|
|
1952
|
-
Logger({
|
|
1953
|
-
level: "WARN",
|
|
1954
|
-
message: `Response Validation Warnings for application > Cart > selectPaymentMode \n ${res_error}`,
|
|
1955
|
-
});
|
|
1956
|
-
}
|
|
1957
|
-
}
|
|
1958
|
-
|
|
1959
1058
|
return response;
|
|
1960
1059
|
}
|
|
1961
1060
|
|
|
1962
1061
|
/**
|
|
1963
|
-
* @param {CartApplicationValidator.UpdateAddressParam} arg - Arg object.
|
|
1964
1062
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1965
1063
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1966
|
-
* @returns {Promise<
|
|
1064
|
+
* @returns {Promise<UpdateAddressResult>} - Success response
|
|
1967
1065
|
* @name updateAddress
|
|
1968
1066
|
* @summary: Updates an existing customer address
|
|
1969
1067
|
* @description: Customer can modify the details of a previously saved addresses. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateAddress/).
|
|
@@ -1972,28 +1070,6 @@ class Cart {
|
|
|
1972
1070
|
{ id, body, requestHeaders } = { requestHeaders: {} },
|
|
1973
1071
|
{ responseHeaders } = { responseHeaders: false }
|
|
1974
1072
|
) {
|
|
1975
|
-
const { error } = CartApplicationValidator.updateAddress().validate(
|
|
1976
|
-
{ id, body },
|
|
1977
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1978
|
-
);
|
|
1979
|
-
if (error) {
|
|
1980
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1981
|
-
}
|
|
1982
|
-
|
|
1983
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1984
|
-
const {
|
|
1985
|
-
error: warrning,
|
|
1986
|
-
} = CartApplicationValidator.updateAddress().validate(
|
|
1987
|
-
{ id, body },
|
|
1988
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1989
|
-
);
|
|
1990
|
-
if (warrning) {
|
|
1991
|
-
Logger({
|
|
1992
|
-
level: "WARN",
|
|
1993
|
-
message: `Parameter Validation warrnings for application > Cart > updateAddress \n ${warrning}`,
|
|
1994
|
-
});
|
|
1995
|
-
}
|
|
1996
|
-
|
|
1997
1073
|
const query_params = {};
|
|
1998
1074
|
|
|
1999
1075
|
const xHeaders = {};
|
|
@@ -2016,33 +1092,13 @@ class Cart {
|
|
|
2016
1092
|
responseData = response[0];
|
|
2017
1093
|
}
|
|
2018
1094
|
|
|
2019
|
-
const {
|
|
2020
|
-
error: res_error,
|
|
2021
|
-
} = CartApplicationModel.UpdateAddressResponse().validate(responseData, {
|
|
2022
|
-
abortEarly: false,
|
|
2023
|
-
allowUnknown: true,
|
|
2024
|
-
});
|
|
2025
|
-
|
|
2026
|
-
if (res_error) {
|
|
2027
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
2028
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2029
|
-
} else {
|
|
2030
|
-
Logger({
|
|
2031
|
-
level: "WARN",
|
|
2032
|
-
message: `Response Validation Warnings for application > Cart > updateAddress \n ${res_error}`,
|
|
2033
|
-
});
|
|
2034
|
-
}
|
|
2035
|
-
}
|
|
2036
|
-
|
|
2037
1095
|
return response;
|
|
2038
1096
|
}
|
|
2039
1097
|
|
|
2040
1098
|
/**
|
|
2041
|
-
* @param {CartApplicationValidator.UpdateCartParam} arg - Arg object.
|
|
2042
1099
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2043
1100
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2044
|
-
* @returns {Promise<
|
|
2045
|
-
* Success response
|
|
1101
|
+
* @returns {Promise<UpdateCartDetailResult>} - Success response
|
|
2046
1102
|
* @name updateCart
|
|
2047
1103
|
* @summary: Update cart items
|
|
2048
1104
|
* @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://partners.fynd.com/help/docs/sdk/application/cart/updateCart/).
|
|
@@ -2061,26 +1117,6 @@ class Cart {
|
|
|
2061
1117
|
} = { requestHeaders: {} },
|
|
2062
1118
|
{ responseHeaders } = { responseHeaders: false }
|
|
2063
1119
|
) {
|
|
2064
|
-
const { error } = CartApplicationValidator.updateCart().validate(
|
|
2065
|
-
{ body, id, i, b, areaCode, buyNow, cartType, orderType },
|
|
2066
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2067
|
-
);
|
|
2068
|
-
if (error) {
|
|
2069
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2070
|
-
}
|
|
2071
|
-
|
|
2072
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2073
|
-
const { error: warrning } = CartApplicationValidator.updateCart().validate(
|
|
2074
|
-
{ body, id, i, b, areaCode, buyNow, cartType, orderType },
|
|
2075
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2076
|
-
);
|
|
2077
|
-
if (warrning) {
|
|
2078
|
-
Logger({
|
|
2079
|
-
level: "WARN",
|
|
2080
|
-
message: `Parameter Validation warrnings for application > Cart > updateCart \n ${warrning}`,
|
|
2081
|
-
});
|
|
2082
|
-
}
|
|
2083
|
-
|
|
2084
1120
|
const query_params = {};
|
|
2085
1121
|
query_params["id"] = id;
|
|
2086
1122
|
query_params["i"] = i;
|
|
@@ -2110,32 +1146,57 @@ class Cart {
|
|
|
2110
1146
|
responseData = response[0];
|
|
2111
1147
|
}
|
|
2112
1148
|
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
1149
|
+
return response;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
/**
|
|
1153
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1154
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1155
|
+
* @returns {Promise<UpdateCartDetailResult>} - Success response
|
|
1156
|
+
* @name updateCartBreakup
|
|
1157
|
+
* @summary: Update store credits into cart and their items
|
|
1158
|
+
* @description: Update cart. Customers can adjust the cart breakup by applying or removing store credits as needed. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateCartBreakup/).
|
|
1159
|
+
*/
|
|
1160
|
+
async updateCartBreakup(
|
|
1161
|
+
{ body, id, i, b, buyNow, cartType, requestHeaders } = {
|
|
1162
|
+
requestHeaders: {},
|
|
1163
|
+
},
|
|
1164
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1165
|
+
) {
|
|
1166
|
+
const query_params = {};
|
|
1167
|
+
query_params["id"] = id;
|
|
1168
|
+
query_params["i"] = i;
|
|
1169
|
+
query_params["b"] = b;
|
|
1170
|
+
query_params["buy_now"] = buyNow;
|
|
1171
|
+
query_params["cart_type"] = cartType;
|
|
1172
|
+
|
|
1173
|
+
const xHeaders = {};
|
|
1174
|
+
|
|
1175
|
+
const response = await ApplicationAPIClient.execute(
|
|
1176
|
+
this._conf,
|
|
1177
|
+
"patch",
|
|
1178
|
+
constructUrl({
|
|
1179
|
+
url: this._urls["updateCartBreakup"],
|
|
1180
|
+
params: {},
|
|
1181
|
+
}),
|
|
1182
|
+
query_params,
|
|
1183
|
+
body,
|
|
1184
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1185
|
+
{ responseHeaders }
|
|
1186
|
+
);
|
|
1187
|
+
|
|
1188
|
+
let responseData = response;
|
|
1189
|
+
if (responseHeaders) {
|
|
1190
|
+
responseData = response[0];
|
|
2129
1191
|
}
|
|
2130
1192
|
|
|
2131
1193
|
return response;
|
|
2132
1194
|
}
|
|
2133
1195
|
|
|
2134
1196
|
/**
|
|
2135
|
-
* @param {CartApplicationValidator.UpdateCartMetaParam} arg - Arg object.
|
|
2136
1197
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2137
1198
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2138
|
-
* @returns {Promise<
|
|
1199
|
+
* @returns {Promise<CartMetaResult>} - Success response
|
|
2139
1200
|
* @name updateCartMeta
|
|
2140
1201
|
* @summary: Update cart metadata
|
|
2141
1202
|
* @description: Update metadata associated with a cart, which includes customer preferences, delivery instructions, or any special requirements related to the cart items. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateCartMeta/).
|
|
@@ -2144,28 +1205,6 @@ class Cart {
|
|
|
2144
1205
|
{ body, id, buyNow, requestHeaders } = { requestHeaders: {} },
|
|
2145
1206
|
{ responseHeaders } = { responseHeaders: false }
|
|
2146
1207
|
) {
|
|
2147
|
-
const { error } = CartApplicationValidator.updateCartMeta().validate(
|
|
2148
|
-
{ body, id, buyNow },
|
|
2149
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2150
|
-
);
|
|
2151
|
-
if (error) {
|
|
2152
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2153
|
-
}
|
|
2154
|
-
|
|
2155
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2156
|
-
const {
|
|
2157
|
-
error: warrning,
|
|
2158
|
-
} = CartApplicationValidator.updateCartMeta().validate(
|
|
2159
|
-
{ body, id, buyNow },
|
|
2160
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2161
|
-
);
|
|
2162
|
-
if (warrning) {
|
|
2163
|
-
Logger({
|
|
2164
|
-
level: "WARN",
|
|
2165
|
-
message: `Parameter Validation warrnings for application > Cart > updateCartMeta \n ${warrning}`,
|
|
2166
|
-
});
|
|
2167
|
-
}
|
|
2168
|
-
|
|
2169
1208
|
const query_params = {};
|
|
2170
1209
|
query_params["id"] = id;
|
|
2171
1210
|
query_params["buy_now"] = buyNow;
|
|
@@ -2190,32 +1229,13 @@ class Cart {
|
|
|
2190
1229
|
responseData = response[0];
|
|
2191
1230
|
}
|
|
2192
1231
|
|
|
2193
|
-
const {
|
|
2194
|
-
error: res_error,
|
|
2195
|
-
} = CartApplicationModel.CartMetaResponse().validate(responseData, {
|
|
2196
|
-
abortEarly: false,
|
|
2197
|
-
allowUnknown: true,
|
|
2198
|
-
});
|
|
2199
|
-
|
|
2200
|
-
if (res_error) {
|
|
2201
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
2202
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2203
|
-
} else {
|
|
2204
|
-
Logger({
|
|
2205
|
-
level: "WARN",
|
|
2206
|
-
message: `Response Validation Warnings for application > Cart > updateCartMeta \n ${res_error}`,
|
|
2207
|
-
});
|
|
2208
|
-
}
|
|
2209
|
-
}
|
|
2210
|
-
|
|
2211
1232
|
return response;
|
|
2212
1233
|
}
|
|
2213
1234
|
|
|
2214
1235
|
/**
|
|
2215
|
-
* @param {CartApplicationValidator.UpdateCartWithSharedItemsParam} arg - Arg object.
|
|
2216
1236
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2217
1237
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2218
|
-
* @returns {Promise<
|
|
1238
|
+
* @returns {Promise<SharedCartResult>} - Success response
|
|
2219
1239
|
* @name updateCartWithSharedItems
|
|
2220
1240
|
* @summary: Update with shared items
|
|
2221
1241
|
* @description: Merge or replace shared cart items with existing cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateCartWithSharedItems/).
|
|
@@ -2224,30 +1244,6 @@ class Cart {
|
|
|
2224
1244
|
{ token, action, requestHeaders } = { requestHeaders: {} },
|
|
2225
1245
|
{ responseHeaders } = { responseHeaders: false }
|
|
2226
1246
|
) {
|
|
2227
|
-
const {
|
|
2228
|
-
error,
|
|
2229
|
-
} = CartApplicationValidator.updateCartWithSharedItems().validate(
|
|
2230
|
-
{ token, action },
|
|
2231
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2232
|
-
);
|
|
2233
|
-
if (error) {
|
|
2234
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2235
|
-
}
|
|
2236
|
-
|
|
2237
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2238
|
-
const {
|
|
2239
|
-
error: warrning,
|
|
2240
|
-
} = CartApplicationValidator.updateCartWithSharedItems().validate(
|
|
2241
|
-
{ token, action },
|
|
2242
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2243
|
-
);
|
|
2244
|
-
if (warrning) {
|
|
2245
|
-
Logger({
|
|
2246
|
-
level: "WARN",
|
|
2247
|
-
message: `Parameter Validation warrnings for application > Cart > updateCartWithSharedItems \n ${warrning}`,
|
|
2248
|
-
});
|
|
2249
|
-
}
|
|
2250
|
-
|
|
2251
1247
|
const query_params = {};
|
|
2252
1248
|
|
|
2253
1249
|
const xHeaders = {};
|
|
@@ -2270,32 +1266,13 @@ class Cart {
|
|
|
2270
1266
|
responseData = response[0];
|
|
2271
1267
|
}
|
|
2272
1268
|
|
|
2273
|
-
const {
|
|
2274
|
-
error: res_error,
|
|
2275
|
-
} = CartApplicationModel.SharedCartResponse().validate(responseData, {
|
|
2276
|
-
abortEarly: false,
|
|
2277
|
-
allowUnknown: true,
|
|
2278
|
-
});
|
|
2279
|
-
|
|
2280
|
-
if (res_error) {
|
|
2281
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
2282
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2283
|
-
} else {
|
|
2284
|
-
Logger({
|
|
2285
|
-
level: "WARN",
|
|
2286
|
-
message: `Response Validation Warnings for application > Cart > updateCartWithSharedItems \n ${res_error}`,
|
|
2287
|
-
});
|
|
2288
|
-
}
|
|
2289
|
-
}
|
|
2290
|
-
|
|
2291
1269
|
return response;
|
|
2292
1270
|
}
|
|
2293
1271
|
|
|
2294
1272
|
/**
|
|
2295
|
-
* @param {CartApplicationValidator.ValidateCouponForPaymentParam} arg - Arg object.
|
|
2296
1273
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2297
1274
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2298
|
-
* @returns {Promise<
|
|
1275
|
+
* @returns {Promise<PaymentCouponValidate>} - Success response
|
|
2299
1276
|
* @name validateCouponForPayment
|
|
2300
1277
|
* @summary: Validate applied coupon
|
|
2301
1278
|
* @description: Validate the applicability of a coupon code for the selected payment mode for the existing cart. This ensures the coupon's validity before proceeding with the payment process, enhancing user experience and preventing potential errors during transactions. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/validateCouponForPayment/).
|
|
@@ -2318,56 +1295,6 @@ class Cart {
|
|
|
2318
1295
|
} = { requestHeaders: {} },
|
|
2319
1296
|
{ responseHeaders } = { responseHeaders: false }
|
|
2320
1297
|
) {
|
|
2321
|
-
const {
|
|
2322
|
-
error,
|
|
2323
|
-
} = CartApplicationValidator.validateCouponForPayment().validate(
|
|
2324
|
-
{
|
|
2325
|
-
id,
|
|
2326
|
-
buyNow,
|
|
2327
|
-
addressId,
|
|
2328
|
-
paymentMode,
|
|
2329
|
-
paymentIdentifier,
|
|
2330
|
-
aggregatorName,
|
|
2331
|
-
merchantCode,
|
|
2332
|
-
iin,
|
|
2333
|
-
network,
|
|
2334
|
-
type,
|
|
2335
|
-
cardId,
|
|
2336
|
-
cartType,
|
|
2337
|
-
},
|
|
2338
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2339
|
-
);
|
|
2340
|
-
if (error) {
|
|
2341
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2342
|
-
}
|
|
2343
|
-
|
|
2344
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2345
|
-
const {
|
|
2346
|
-
error: warrning,
|
|
2347
|
-
} = CartApplicationValidator.validateCouponForPayment().validate(
|
|
2348
|
-
{
|
|
2349
|
-
id,
|
|
2350
|
-
buyNow,
|
|
2351
|
-
addressId,
|
|
2352
|
-
paymentMode,
|
|
2353
|
-
paymentIdentifier,
|
|
2354
|
-
aggregatorName,
|
|
2355
|
-
merchantCode,
|
|
2356
|
-
iin,
|
|
2357
|
-
network,
|
|
2358
|
-
type,
|
|
2359
|
-
cardId,
|
|
2360
|
-
cartType,
|
|
2361
|
-
},
|
|
2362
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2363
|
-
);
|
|
2364
|
-
if (warrning) {
|
|
2365
|
-
Logger({
|
|
2366
|
-
level: "WARN",
|
|
2367
|
-
message: `Parameter Validation warrnings for application > Cart > validateCouponForPayment \n ${warrning}`,
|
|
2368
|
-
});
|
|
2369
|
-
}
|
|
2370
|
-
|
|
2371
1298
|
const query_params = {};
|
|
2372
1299
|
query_params["id"] = id;
|
|
2373
1300
|
query_params["buy_now"] = buyNow;
|
|
@@ -2402,24 +1329,6 @@ class Cart {
|
|
|
2402
1329
|
responseData = response[0];
|
|
2403
1330
|
}
|
|
2404
1331
|
|
|
2405
|
-
const {
|
|
2406
|
-
error: res_error,
|
|
2407
|
-
} = CartApplicationModel.PaymentCouponValidate().validate(responseData, {
|
|
2408
|
-
abortEarly: false,
|
|
2409
|
-
allowUnknown: true,
|
|
2410
|
-
});
|
|
2411
|
-
|
|
2412
|
-
if (res_error) {
|
|
2413
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
2414
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2415
|
-
} else {
|
|
2416
|
-
Logger({
|
|
2417
|
-
level: "WARN",
|
|
2418
|
-
message: `Response Validation Warnings for application > Cart > validateCouponForPayment \n ${res_error}`,
|
|
2419
|
-
});
|
|
2420
|
-
}
|
|
2421
|
-
}
|
|
2422
|
-
|
|
2423
1332
|
return response;
|
|
2424
1333
|
}
|
|
2425
1334
|
}
|