@gofynd/fdk-client-javascript 1.4.14 → 1.4.15-beta.10
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 +0 -2
- package/sdk/application/ApplicationClient.js +0 -20
- package/sdk/application/Cart/CartApplicationClient.d.ts +55 -97
- package/sdk/application/Cart/CartApplicationClient.js +60 -1262
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +80 -162
- package/sdk/application/Catalog/CatalogApplicationClient.js +148 -1313
- package/sdk/application/Common/CommonApplicationClient.d.ts +4 -9
- package/sdk/application/Common/CommonApplicationClient.js +5 -90
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +6 -19
- package/sdk/application/Communication/CommunicationApplicationClient.js +6 -145
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +32 -80
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +31 -725
- package/sdk/application/Content/ContentApplicationClient.d.ts +63 -85
- package/sdk/application/Content/ContentApplicationClient.js +126 -942
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +11 -15
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +26 -130
- package/sdk/application/Lead/LeadApplicationClient.d.ts +10 -17
- package/sdk/application/Lead/LeadApplicationClient.js +32 -201
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +22 -62
- package/sdk/application/Logistic/LogisticApplicationClient.js +51 -647
- package/sdk/application/Order/OrderApplicationClient.d.ts +22 -56
- package/sdk/application/Order/OrderApplicationClient.js +86 -555
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +92 -209
- package/sdk/application/Payment/PaymentApplicationClient.js +57 -2099
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +15 -26
- package/sdk/application/Rewards/RewardsApplicationClient.js +17 -303
- package/sdk/application/Share/ShareApplicationClient.d.ts +14 -24
- package/sdk/application/Share/ShareApplicationClient.js +34 -294
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -14
- package/sdk/application/Theme/ThemeApplicationClient.js +30 -166
- package/sdk/application/User/UserApplicationClient.d.ts +87 -138
- package/sdk/application/User/UserApplicationClient.js +47 -1817
- package/sdk/application/Webhook/WebhookApplicationClient.d.ts +4 -7
- package/sdk/application/Webhook/WebhookApplicationClient.js +6 -49
- package/sdk/application/index.d.ts +0 -19
- package/sdk/application/index.js +0 -35
- package/sdk/common/Utility.d.ts +1 -1
- package/sdk/common/Utility.js +10 -7
- package/sdk/common/Validator.d.ts +1 -0
- package/sdk/common/Validator.js +20 -0
- package/sdk/common/utils.d.ts +0 -1
- package/sdk/common/utils.js +0 -14
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +12 -86
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +24 -582
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +21 -116
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +16 -121
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +1 -8
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +4 -51
- 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 +20 -126
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +20 -970
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +85 -767
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +76 -429
- package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +0 -10
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +6 -120
- package/sdk/partner/OAuthClient.js +1 -0
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +10 -8
- package/sdk/partner/Theme/ThemePartnerClient.js +16 -14
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +39 -135
- package/sdk/partner/Theme/ThemePartnerModel.js +38 -114
- package/sdk/partner/Theme/ThemePartnerValidator.js +4 -4
- package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +18 -28
- package/sdk/partner/Webhook/WebhookPartnerClient.js +18 -103
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +179 -612
- package/sdk/partner/Webhook/WebhookPartnerModel.js +150 -253
- package/sdk/partner/Webhook/WebhookPartnerValidator.d.ts +0 -1
- package/sdk/partner/Webhook/WebhookPartnerValidator.js +3 -11
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +4 -5
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +8 -14
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +9 -59
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +4 -40
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +32 -2
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +243 -3
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +130 -11
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +152 -12
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +39 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +35 -0
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +12 -12
- package/sdk/platform/Billing/BillingPlatformClient.js +15 -15
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +388 -443
- package/sdk/platform/Billing/BillingPlatformModel.js +263 -280
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +18 -16
- package/sdk/platform/Billing/BillingPlatformValidator.js +9 -8
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +103 -134
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +112 -407
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +65 -111
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +44 -106
- package/sdk/platform/Cart/CartPlatformModel.d.ts +1328 -4975
- package/sdk/platform/Cart/CartPlatformModel.js +1229 -1922
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +183 -208
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +358 -383
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +126 -122
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +68 -66
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +118 -141
- package/sdk/platform/Catalog/CatalogPlatformClient.js +170 -193
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1744 -1501
- package/sdk/platform/Catalog/CatalogPlatformModel.js +1211 -1383
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +18 -18
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +18 -18
- package/sdk/platform/Common/CommonPlatformClient.d.ts +2 -3
- package/sdk/platform/Common/CommonPlatformClient.js +2 -3
- package/sdk/platform/Common/CommonPlatformModel.d.ts +9 -9
- package/sdk/platform/Common/CommonPlatformModel.js +6 -6
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +17 -16
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +17 -16
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +8 -8
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +8 -8
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +33 -43
- package/sdk/platform/Communication/CommunicationPlatformModel.js +34 -38
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +42 -46
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +43 -47
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +223 -223
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +212 -210
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +12 -12
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +12 -12
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +33 -46
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +54 -67
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +18 -18
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +18 -18
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +24 -45
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +30 -134
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +138 -283
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +100 -219
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -37
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +8 -27
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +141 -124
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +422 -449
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +141 -179
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +130 -168
- package/sdk/platform/Content/ContentPlatformClient.d.ts +106 -142
- package/sdk/platform/Content/ContentPlatformClient.js +336 -523
- package/sdk/platform/Content/ContentPlatformModel.d.ts +395 -1241
- package/sdk/platform/Content/ContentPlatformModel.js +390 -521
- package/sdk/platform/Content/ContentPlatformValidator.d.ts +117 -168
- package/sdk/platform/Content/ContentPlatformValidator.js +108 -162
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +12 -14
- package/sdk/platform/Discount/DiscountPlatformClient.js +12 -14
- 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 +39 -95
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +63 -462
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +15 -62
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +13 -75
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +22 -20
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +24 -21
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +116 -370
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +104 -313
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +6 -6
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +6 -6
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +320 -0
- package/sdk/platform/Finance/FinancePlatformClient.js +2333 -0
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +2890 -0
- package/sdk/platform/Finance/FinancePlatformModel.js +2148 -0
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +284 -0
- package/sdk/platform/Finance/FinancePlatformValidator.js +354 -0
- 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 +4 -25
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +5 -175
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +4 -52
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +3 -34
- package/sdk/platform/Order/OrderPlatformClient.d.ts +103 -174
- package/sdk/platform/Order/OrderPlatformClient.js +275 -528
- package/sdk/platform/Order/OrderPlatformModel.d.ts +3078 -5449
- package/sdk/platform/Order/OrderPlatformModel.js +1659 -3501
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +219 -234
- package/sdk/platform/Order/OrderPlatformValidator.js +118 -146
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -6
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +7 -9
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +9 -9
- package/sdk/platform/Partner/PartnerPlatformModel.js +8 -8
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +106 -94
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +146 -131
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +93 -64
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +70 -62
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +20 -20
- package/sdk/platform/Payment/PaymentPlatformClient.js +20 -20
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +507 -386
- package/sdk/platform/Payment/PaymentPlatformModel.js +376 -323
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +10 -10
- package/sdk/platform/Payment/PaymentPlatformValidator.js +10 -10
- package/sdk/platform/PlatformClient.d.ts +2 -0
- package/sdk/platform/PlatformClient.js +4 -0
- 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 +35 -45
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +38 -117
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +13 -22
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +12 -24
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +46 -40
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +68 -62
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +396 -620
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +326 -501
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +11 -11
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +10 -10
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +2 -2
- package/sdk/platform/Share/SharePlatformApplicationClient.js +2 -2
- package/sdk/platform/Share/SharePlatformModel.d.ts +5 -36
- package/sdk/platform/Share/SharePlatformModel.js +4 -27
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +3 -3
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +4 -8
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +0 -5
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +0 -2
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +13 -76
- package/sdk/platform/Theme/ThemePlatformModel.js +17 -57
- 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 +78 -25
- package/sdk/platform/Webhook/WebhookPlatformClient.js +470 -75
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +427 -720
- package/sdk/platform/Webhook/WebhookPlatformModel.js +386 -410
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +55 -10
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +72 -12
- package/sdk/platform/index.d.ts +1 -0
- package/sdk/platform/index.js +2 -0
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +2 -3
- package/sdk/public/Configuration/ConfigurationPublicClient.js +10 -8
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +9 -9
- package/sdk/public/Configuration/ConfigurationPublicModel.js +6 -6
- package/sdk/public/Content/ContentPublicClient.d.ts +2 -112
- package/sdk/public/Content/ContentPublicClient.js +19 -793
- package/sdk/public/Content/ContentPublicModel.d.ts +3 -549
- package/sdk/public/Content/ContentPublicModel.js +3 -649
- package/sdk/public/Content/ContentPublicValidator.d.ts +3 -69
- package/sdk/public/Content/ContentPublicValidator.js +2 -88
- package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
- package/sdk/public/Partner/PartnerPublicClient.js +14 -2
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +8 -8
- package/sdk/public/Webhook/WebhookPublicClient.js +13 -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 -4340
- package/sdk/application/Cart/CartApplicationModel.js +0 -2718
- package/sdk/application/Cart/CartApplicationValidator.d.ts +0 -788
- package/sdk/application/Cart/CartApplicationValidator.js +0 -546
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +0 -3909
- package/sdk/application/Catalog/CatalogApplicationModel.js +0 -2667
- 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 -2544
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +0 -1875
- 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 -2189
- package/sdk/application/Content/ContentApplicationModel.js +0 -1640
- package/sdk/application/Content/ContentApplicationValidator.d.ts +0 -290
- package/sdk/application/Content/ContentApplicationValidator.js +0 -269
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +0 -270
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +0 -188
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +0 -56
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +0 -53
- package/sdk/application/Finance/FinanceApplicationClient.d.ts +0 -36
- package/sdk/application/Finance/FinanceApplicationClient.js +0 -202
- package/sdk/application/Finance/FinanceApplicationModel.d.ts +0 -289
- package/sdk/application/Finance/FinanceApplicationModel.js +0 -208
- package/sdk/application/Finance/FinanceApplicationValidator.d.ts +0 -25
- package/sdk/application/Finance/FinanceApplicationValidator.js +0 -31
- 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 -2034
- package/sdk/application/Logistic/LogisticApplicationModel.js +0 -1391
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +0 -299
- package/sdk/application/Logistic/LogisticApplicationValidator.js +0 -224
- package/sdk/application/Order/OrderApplicationModel.d.ts +0 -2612
- package/sdk/application/Order/OrderApplicationModel.js +0 -1669
- package/sdk/application/Order/OrderApplicationValidator.d.ts +0 -279
- package/sdk/application/Order/OrderApplicationValidator.js +0 -210
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +0 -4062
- package/sdk/application/Payment/PaymentApplicationModel.js +0 -2632
- 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 -1744
- package/sdk/application/Theme/ThemeApplicationModel.js +0 -1446
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +0 -79
- package/sdk/application/Theme/ThemeApplicationValidator.js +0 -65
- 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 -54
- package/sdk/application/Webhook/WebhookApplicationModel.js +0 -48
- 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
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
2
1
|
const {
|
|
3
2
|
FDKClientValidationError,
|
|
4
3
|
FDKResponseValidationError,
|
|
5
4
|
} = require("../../common/FDKError");
|
|
5
|
+
|
|
6
|
+
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
6
7
|
const constructUrl = require("../constructUrl");
|
|
7
8
|
const Paginator = require("../../common/Paginator");
|
|
8
|
-
const
|
|
9
|
-
const CartApplicationModel = require("./CartApplicationModel");
|
|
10
|
-
const { Logger } = require("./../../common/Logger");
|
|
11
|
-
const Joi = require("joi");
|
|
9
|
+
const { validateRequiredParams } = require("../../common/Validator");
|
|
12
10
|
|
|
13
11
|
class Cart {
|
|
14
12
|
constructor(_conf) {
|
|
@@ -18,7 +16,6 @@ class Cart {
|
|
|
18
16
|
addItems: "/service/application/cart/v1.0/detail",
|
|
19
17
|
applyCoupon: "/service/application/cart/v1.0/coupon",
|
|
20
18
|
applyRewardPoints: "/service/application/cart/v1.0/redeem/points/",
|
|
21
|
-
checkoutCart: "/service/application/cart/v1.0/checkout",
|
|
22
19
|
checkoutCartV2: "/service/application/cart/v2.0/checkout",
|
|
23
20
|
deleteCart: "/service/application/cart/v1.0/cart_archive",
|
|
24
21
|
getAddressById: "/service/application/cart/v1.0/address/{id}",
|
|
@@ -64,10 +61,9 @@ class Cart {
|
|
|
64
61
|
}
|
|
65
62
|
|
|
66
63
|
/**
|
|
67
|
-
* @param {CartApplicationValidator.AddAddressParam} arg - Arg object.
|
|
68
64
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
69
65
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
70
|
-
* @returns {Promise<
|
|
66
|
+
* @returns {Promise<SaveAddressResponse>} - Success response
|
|
71
67
|
* @name addAddress
|
|
72
68
|
* @summary: Creates a new address for a customer
|
|
73
69
|
* @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/).
|
|
@@ -76,26 +72,6 @@ class Cart {
|
|
|
76
72
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
77
73
|
{ responseHeaders } = { responseHeaders: false }
|
|
78
74
|
) {
|
|
79
|
-
const { error } = CartApplicationValidator.addAddress().validate(
|
|
80
|
-
{ body },
|
|
81
|
-
{ abortEarly: false, allowUnknown: true }
|
|
82
|
-
);
|
|
83
|
-
if (error) {
|
|
84
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Showing warrnings if extra unknown parameters are found
|
|
88
|
-
const { error: warrning } = CartApplicationValidator.addAddress().validate(
|
|
89
|
-
{ body },
|
|
90
|
-
{ abortEarly: false, allowUnknown: false }
|
|
91
|
-
);
|
|
92
|
-
if (warrning) {
|
|
93
|
-
Logger({
|
|
94
|
-
level: "WARN",
|
|
95
|
-
message: `Parameter Validation warrnings for application > Cart > addAddress \n ${warrning}`,
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
|
|
99
75
|
const query_params = {};
|
|
100
76
|
|
|
101
77
|
const xHeaders = {};
|
|
@@ -118,32 +94,13 @@ class Cart {
|
|
|
118
94
|
responseData = response[0];
|
|
119
95
|
}
|
|
120
96
|
|
|
121
|
-
const {
|
|
122
|
-
error: res_error,
|
|
123
|
-
} = CartApplicationModel.SaveAddressResult().validate(responseData, {
|
|
124
|
-
abortEarly: false,
|
|
125
|
-
allowUnknown: true,
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
if (res_error) {
|
|
129
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
130
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
131
|
-
} else {
|
|
132
|
-
Logger({
|
|
133
|
-
level: "WARN",
|
|
134
|
-
message: `Response Validation Warnings for application > Cart > addAddress \n ${res_error}`,
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
97
|
return response;
|
|
140
98
|
}
|
|
141
99
|
|
|
142
100
|
/**
|
|
143
|
-
* @param {CartApplicationValidator.AddItemsParam} arg - Arg object.
|
|
144
101
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
145
102
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
146
|
-
* @returns {Promise<
|
|
103
|
+
* @returns {Promise<AddCartDetailResponse>} - Success response
|
|
147
104
|
* @name addItems
|
|
148
105
|
* @summary: Add items to a cart
|
|
149
106
|
* @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/).
|
|
@@ -154,26 +111,6 @@ class Cart {
|
|
|
154
111
|
},
|
|
155
112
|
{ responseHeaders } = { responseHeaders: false }
|
|
156
113
|
) {
|
|
157
|
-
const { error } = CartApplicationValidator.addItems().validate(
|
|
158
|
-
{ body, i, b, areaCode, buyNow, id, orderType },
|
|
159
|
-
{ abortEarly: false, allowUnknown: true }
|
|
160
|
-
);
|
|
161
|
-
if (error) {
|
|
162
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// Showing warrnings if extra unknown parameters are found
|
|
166
|
-
const { error: warrning } = CartApplicationValidator.addItems().validate(
|
|
167
|
-
{ body, i, b, areaCode, buyNow, id, orderType },
|
|
168
|
-
{ abortEarly: false, allowUnknown: false }
|
|
169
|
-
);
|
|
170
|
-
if (warrning) {
|
|
171
|
-
Logger({
|
|
172
|
-
level: "WARN",
|
|
173
|
-
message: `Parameter Validation warrnings for application > Cart > addItems \n ${warrning}`,
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
|
|
177
114
|
const query_params = {};
|
|
178
115
|
query_params["i"] = i;
|
|
179
116
|
query_params["b"] = b;
|
|
@@ -202,32 +139,13 @@ class Cart {
|
|
|
202
139
|
responseData = response[0];
|
|
203
140
|
}
|
|
204
141
|
|
|
205
|
-
const {
|
|
206
|
-
error: res_error,
|
|
207
|
-
} = CartApplicationModel.AddCartDetailResult().validate(responseData, {
|
|
208
|
-
abortEarly: false,
|
|
209
|
-
allowUnknown: true,
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
if (res_error) {
|
|
213
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
214
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
215
|
-
} else {
|
|
216
|
-
Logger({
|
|
217
|
-
level: "WARN",
|
|
218
|
-
message: `Response Validation Warnings for application > Cart > addItems \n ${res_error}`,
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
142
|
return response;
|
|
224
143
|
}
|
|
225
144
|
|
|
226
145
|
/**
|
|
227
|
-
* @param {CartApplicationValidator.ApplyCouponParam} arg - Arg object.
|
|
228
146
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
229
147
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
230
|
-
* @returns {Promise<
|
|
148
|
+
* @returns {Promise<CartDetailResponse>} - Success response
|
|
231
149
|
* @name applyCoupon
|
|
232
150
|
* @summary: Apply coupon
|
|
233
151
|
* @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/).
|
|
@@ -238,26 +156,6 @@ class Cart {
|
|
|
238
156
|
},
|
|
239
157
|
{ responseHeaders } = { responseHeaders: false }
|
|
240
158
|
) {
|
|
241
|
-
const { error } = CartApplicationValidator.applyCoupon().validate(
|
|
242
|
-
{ body, i, b, p, id, buyNow, cartType },
|
|
243
|
-
{ abortEarly: false, allowUnknown: true }
|
|
244
|
-
);
|
|
245
|
-
if (error) {
|
|
246
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
// Showing warrnings if extra unknown parameters are found
|
|
250
|
-
const { error: warrning } = CartApplicationValidator.applyCoupon().validate(
|
|
251
|
-
{ body, i, b, p, id, buyNow, cartType },
|
|
252
|
-
{ abortEarly: false, allowUnknown: false }
|
|
253
|
-
);
|
|
254
|
-
if (warrning) {
|
|
255
|
-
Logger({
|
|
256
|
-
level: "WARN",
|
|
257
|
-
message: `Parameter Validation warrnings for application > Cart > applyCoupon \n ${warrning}`,
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
|
|
261
159
|
const query_params = {};
|
|
262
160
|
query_params["i"] = i;
|
|
263
161
|
query_params["b"] = b;
|
|
@@ -286,32 +184,13 @@ class Cart {
|
|
|
286
184
|
responseData = response[0];
|
|
287
185
|
}
|
|
288
186
|
|
|
289
|
-
const {
|
|
290
|
-
error: res_error,
|
|
291
|
-
} = CartApplicationModel.CartDetailResult().validate(responseData, {
|
|
292
|
-
abortEarly: false,
|
|
293
|
-
allowUnknown: true,
|
|
294
|
-
});
|
|
295
|
-
|
|
296
|
-
if (res_error) {
|
|
297
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
298
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
299
|
-
} else {
|
|
300
|
-
Logger({
|
|
301
|
-
level: "WARN",
|
|
302
|
-
message: `Response Validation Warnings for application > Cart > applyCoupon \n ${res_error}`,
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
|
|
307
187
|
return response;
|
|
308
188
|
}
|
|
309
189
|
|
|
310
190
|
/**
|
|
311
|
-
* @param {CartApplicationValidator.ApplyRewardPointsParam} arg - Arg object.
|
|
312
191
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
313
192
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
314
|
-
* @returns {Promise<
|
|
193
|
+
* @returns {Promise<CartDetailResponse>} - Success response
|
|
315
194
|
* @name applyRewardPoints
|
|
316
195
|
* @summary: Use reward points
|
|
317
196
|
* @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/).
|
|
@@ -320,28 +199,6 @@ class Cart {
|
|
|
320
199
|
{ body, id, i, b, buyNow, requestHeaders } = { requestHeaders: {} },
|
|
321
200
|
{ responseHeaders } = { responseHeaders: false }
|
|
322
201
|
) {
|
|
323
|
-
const { error } = CartApplicationValidator.applyRewardPoints().validate(
|
|
324
|
-
{ body, id, i, b, buyNow },
|
|
325
|
-
{ abortEarly: false, allowUnknown: true }
|
|
326
|
-
);
|
|
327
|
-
if (error) {
|
|
328
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
// Showing warrnings if extra unknown parameters are found
|
|
332
|
-
const {
|
|
333
|
-
error: warrning,
|
|
334
|
-
} = CartApplicationValidator.applyRewardPoints().validate(
|
|
335
|
-
{ body, id, i, b, buyNow },
|
|
336
|
-
{ abortEarly: false, allowUnknown: false }
|
|
337
|
-
);
|
|
338
|
-
if (warrning) {
|
|
339
|
-
Logger({
|
|
340
|
-
level: "WARN",
|
|
341
|
-
message: `Parameter Validation warrnings for application > Cart > applyRewardPoints \n ${warrning}`,
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
|
|
345
202
|
const query_params = {};
|
|
346
203
|
query_params["id"] = id;
|
|
347
204
|
query_params["i"] = i;
|
|
@@ -368,112 +225,13 @@ class Cart {
|
|
|
368
225
|
responseData = response[0];
|
|
369
226
|
}
|
|
370
227
|
|
|
371
|
-
const {
|
|
372
|
-
error: res_error,
|
|
373
|
-
} = CartApplicationModel.CartDetailResult().validate(responseData, {
|
|
374
|
-
abortEarly: false,
|
|
375
|
-
allowUnknown: true,
|
|
376
|
-
});
|
|
377
|
-
|
|
378
|
-
if (res_error) {
|
|
379
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
380
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
381
|
-
} else {
|
|
382
|
-
Logger({
|
|
383
|
-
level: "WARN",
|
|
384
|
-
message: `Response Validation Warnings for application > Cart > applyRewardPoints \n ${res_error}`,
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
|
|
389
228
|
return response;
|
|
390
229
|
}
|
|
391
230
|
|
|
392
231
|
/**
|
|
393
|
-
* @param {CartApplicationValidator.CheckoutCartParam} arg - Arg object.
|
|
394
232
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
395
233
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
396
|
-
* @returns {Promise<
|
|
397
|
-
* @name checkoutCart
|
|
398
|
-
* @summary: Checkout cart
|
|
399
|
-
* @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/).
|
|
400
|
-
*/
|
|
401
|
-
async checkoutCart(
|
|
402
|
-
{ body, buyNow, cartType, requestHeaders } = { requestHeaders: {} },
|
|
403
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
404
|
-
) {
|
|
405
|
-
const { error } = CartApplicationValidator.checkoutCart().validate(
|
|
406
|
-
{ body, buyNow, cartType },
|
|
407
|
-
{ abortEarly: false, allowUnknown: true }
|
|
408
|
-
);
|
|
409
|
-
if (error) {
|
|
410
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
// Showing warrnings if extra unknown parameters are found
|
|
414
|
-
const {
|
|
415
|
-
error: warrning,
|
|
416
|
-
} = CartApplicationValidator.checkoutCart().validate(
|
|
417
|
-
{ body, buyNow, cartType },
|
|
418
|
-
{ abortEarly: false, allowUnknown: false }
|
|
419
|
-
);
|
|
420
|
-
if (warrning) {
|
|
421
|
-
Logger({
|
|
422
|
-
level: "WARN",
|
|
423
|
-
message: `Parameter Validation warrnings for application > Cart > checkoutCart \n ${warrning}`,
|
|
424
|
-
});
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
const query_params = {};
|
|
428
|
-
query_params["buy_now"] = buyNow;
|
|
429
|
-
query_params["cart_type"] = cartType;
|
|
430
|
-
|
|
431
|
-
const xHeaders = {};
|
|
432
|
-
|
|
433
|
-
const response = await ApplicationAPIClient.execute(
|
|
434
|
-
this._conf,
|
|
435
|
-
"post",
|
|
436
|
-
constructUrl({
|
|
437
|
-
url: this._urls["checkoutCart"],
|
|
438
|
-
params: {},
|
|
439
|
-
}),
|
|
440
|
-
query_params,
|
|
441
|
-
body,
|
|
442
|
-
{ ...xHeaders, ...requestHeaders },
|
|
443
|
-
{ responseHeaders }
|
|
444
|
-
);
|
|
445
|
-
|
|
446
|
-
let responseData = response;
|
|
447
|
-
if (responseHeaders) {
|
|
448
|
-
responseData = response[0];
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
const {
|
|
452
|
-
error: res_error,
|
|
453
|
-
} = CartApplicationModel.CartCheckoutResult().validate(responseData, {
|
|
454
|
-
abortEarly: false,
|
|
455
|
-
allowUnknown: true,
|
|
456
|
-
});
|
|
457
|
-
|
|
458
|
-
if (res_error) {
|
|
459
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
460
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
461
|
-
} else {
|
|
462
|
-
Logger({
|
|
463
|
-
level: "WARN",
|
|
464
|
-
message: `Response Validation Warnings for application > Cart > checkoutCart \n ${res_error}`,
|
|
465
|
-
});
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
return response;
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
/**
|
|
473
|
-
* @param {CartApplicationValidator.CheckoutCartV2Param} arg - Arg object.
|
|
474
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
475
|
-
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
476
|
-
* @returns {Promise<CartApplicationModel.CartCheckoutResult>} - Success response
|
|
234
|
+
* @returns {Promise<CartCheckoutResponse>} - Success response
|
|
477
235
|
* @name checkoutCartV2
|
|
478
236
|
* @summary: Checkout cart
|
|
479
237
|
* @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/).
|
|
@@ -482,28 +240,6 @@ class Cart {
|
|
|
482
240
|
{ body, buyNow, cartType, requestHeaders } = { requestHeaders: {} },
|
|
483
241
|
{ responseHeaders } = { responseHeaders: false }
|
|
484
242
|
) {
|
|
485
|
-
const { error } = CartApplicationValidator.checkoutCartV2().validate(
|
|
486
|
-
{ body, buyNow, cartType },
|
|
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 {
|
|
495
|
-
error: warrning,
|
|
496
|
-
} = CartApplicationValidator.checkoutCartV2().validate(
|
|
497
|
-
{ body, buyNow, cartType },
|
|
498
|
-
{ abortEarly: false, allowUnknown: false }
|
|
499
|
-
);
|
|
500
|
-
if (warrning) {
|
|
501
|
-
Logger({
|
|
502
|
-
level: "WARN",
|
|
503
|
-
message: `Parameter Validation warrnings for application > Cart > checkoutCartV2 \n ${warrning}`,
|
|
504
|
-
});
|
|
505
|
-
}
|
|
506
|
-
|
|
507
243
|
const query_params = {};
|
|
508
244
|
query_params["buy_now"] = buyNow;
|
|
509
245
|
query_params["cart_type"] = cartType;
|
|
@@ -528,32 +264,13 @@ class Cart {
|
|
|
528
264
|
responseData = response[0];
|
|
529
265
|
}
|
|
530
266
|
|
|
531
|
-
const {
|
|
532
|
-
error: res_error,
|
|
533
|
-
} = CartApplicationModel.CartCheckoutResult().validate(responseData, {
|
|
534
|
-
abortEarly: false,
|
|
535
|
-
allowUnknown: true,
|
|
536
|
-
});
|
|
537
|
-
|
|
538
|
-
if (res_error) {
|
|
539
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
540
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
541
|
-
} else {
|
|
542
|
-
Logger({
|
|
543
|
-
level: "WARN",
|
|
544
|
-
message: `Response Validation Warnings for application > Cart > checkoutCartV2 \n ${res_error}`,
|
|
545
|
-
});
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
|
|
549
267
|
return response;
|
|
550
268
|
}
|
|
551
269
|
|
|
552
270
|
/**
|
|
553
|
-
* @param {CartApplicationValidator.DeleteCartParam} arg - Arg object.
|
|
554
271
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
555
272
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
556
|
-
* @returns {Promise<
|
|
273
|
+
* @returns {Promise<DeleteCartDetailResponse>} - Success response
|
|
557
274
|
* @name deleteCart
|
|
558
275
|
* @summary: Delete a cart
|
|
559
276
|
* @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/).
|
|
@@ -562,26 +279,6 @@ class Cart {
|
|
|
562
279
|
{ id, requestHeaders } = { requestHeaders: {} },
|
|
563
280
|
{ responseHeaders } = { responseHeaders: false }
|
|
564
281
|
) {
|
|
565
|
-
const { error } = CartApplicationValidator.deleteCart().validate(
|
|
566
|
-
{ id },
|
|
567
|
-
{ abortEarly: false, allowUnknown: true }
|
|
568
|
-
);
|
|
569
|
-
if (error) {
|
|
570
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
// Showing warrnings if extra unknown parameters are found
|
|
574
|
-
const { error: warrning } = CartApplicationValidator.deleteCart().validate(
|
|
575
|
-
{ id },
|
|
576
|
-
{ abortEarly: false, allowUnknown: false }
|
|
577
|
-
);
|
|
578
|
-
if (warrning) {
|
|
579
|
-
Logger({
|
|
580
|
-
level: "WARN",
|
|
581
|
-
message: `Parameter Validation warrnings for application > Cart > deleteCart \n ${warrning}`,
|
|
582
|
-
});
|
|
583
|
-
}
|
|
584
|
-
|
|
585
282
|
const query_params = {};
|
|
586
283
|
query_params["id"] = id;
|
|
587
284
|
|
|
@@ -605,32 +302,13 @@ class Cart {
|
|
|
605
302
|
responseData = response[0];
|
|
606
303
|
}
|
|
607
304
|
|
|
608
|
-
const {
|
|
609
|
-
error: res_error,
|
|
610
|
-
} = CartApplicationModel.DeleteCartDetailResult().validate(responseData, {
|
|
611
|
-
abortEarly: false,
|
|
612
|
-
allowUnknown: true,
|
|
613
|
-
});
|
|
614
|
-
|
|
615
|
-
if (res_error) {
|
|
616
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
617
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
618
|
-
} else {
|
|
619
|
-
Logger({
|
|
620
|
-
level: "WARN",
|
|
621
|
-
message: `Response Validation Warnings for application > Cart > deleteCart \n ${res_error}`,
|
|
622
|
-
});
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
|
|
626
305
|
return response;
|
|
627
306
|
}
|
|
628
307
|
|
|
629
308
|
/**
|
|
630
|
-
* @param {CartApplicationValidator.GetAddressByIdParam} arg - Arg object.
|
|
631
309
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
632
310
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
633
|
-
* @returns {Promise<
|
|
311
|
+
* @returns {Promise<Address>} - Success response
|
|
634
312
|
* @name getAddressById
|
|
635
313
|
* @summary: Get details for a single customer address
|
|
636
314
|
* @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/).
|
|
@@ -648,26 +326,13 @@ class Cart {
|
|
|
648
326
|
} = { requestHeaders: {} },
|
|
649
327
|
{ responseHeaders } = { responseHeaders: false }
|
|
650
328
|
) {
|
|
651
|
-
const
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
// Showing warrnings if extra unknown parameters are found
|
|
660
|
-
const {
|
|
661
|
-
error: warrning,
|
|
662
|
-
} = CartApplicationValidator.getAddressById().validate(
|
|
663
|
-
{ id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
|
|
664
|
-
{ abortEarly: false, allowUnknown: false }
|
|
665
|
-
);
|
|
666
|
-
if (warrning) {
|
|
667
|
-
Logger({
|
|
668
|
-
level: "WARN",
|
|
669
|
-
message: `Parameter Validation warrnings for application > Cart > getAddressById \n ${warrning}`,
|
|
329
|
+
const errors = validateRequiredParams(arguments[0], ["id"]);
|
|
330
|
+
if (errors.length > 0) {
|
|
331
|
+
const error = new FDKClientValidationError({
|
|
332
|
+
message: "Missing required field",
|
|
333
|
+
details: errors,
|
|
670
334
|
});
|
|
335
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
671
336
|
}
|
|
672
337
|
|
|
673
338
|
const query_params = {};
|
|
@@ -698,32 +363,13 @@ class Cart {
|
|
|
698
363
|
responseData = response[0];
|
|
699
364
|
}
|
|
700
365
|
|
|
701
|
-
const {
|
|
702
|
-
error: res_error,
|
|
703
|
-
} = CartApplicationModel.Address().validate(responseData, {
|
|
704
|
-
abortEarly: false,
|
|
705
|
-
allowUnknown: true,
|
|
706
|
-
});
|
|
707
|
-
|
|
708
|
-
if (res_error) {
|
|
709
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
710
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
711
|
-
} else {
|
|
712
|
-
Logger({
|
|
713
|
-
level: "WARN",
|
|
714
|
-
message: `Response Validation Warnings for application > Cart > getAddressById \n ${res_error}`,
|
|
715
|
-
});
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
|
|
719
366
|
return response;
|
|
720
367
|
}
|
|
721
368
|
|
|
722
369
|
/**
|
|
723
|
-
* @param {CartApplicationValidator.GetAddressesParam} arg - Arg object.
|
|
724
370
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
725
371
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
726
|
-
* @returns {Promise<
|
|
372
|
+
* @returns {Promise<GetAddressesResponse>} - Success response
|
|
727
373
|
* @name getAddresses
|
|
728
374
|
* @summary: Get a list of addresses for a customer
|
|
729
375
|
* @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/).
|
|
@@ -740,28 +386,6 @@ class Cart {
|
|
|
740
386
|
} = { requestHeaders: {} },
|
|
741
387
|
{ responseHeaders } = { responseHeaders: false }
|
|
742
388
|
) {
|
|
743
|
-
const { error } = CartApplicationValidator.getAddresses().validate(
|
|
744
|
-
{ cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
|
|
745
|
-
{ abortEarly: false, allowUnknown: true }
|
|
746
|
-
);
|
|
747
|
-
if (error) {
|
|
748
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
// Showing warrnings if extra unknown parameters are found
|
|
752
|
-
const {
|
|
753
|
-
error: warrning,
|
|
754
|
-
} = CartApplicationValidator.getAddresses().validate(
|
|
755
|
-
{ cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
|
|
756
|
-
{ abortEarly: false, allowUnknown: false }
|
|
757
|
-
);
|
|
758
|
-
if (warrning) {
|
|
759
|
-
Logger({
|
|
760
|
-
level: "WARN",
|
|
761
|
-
message: `Parameter Validation warrnings for application > Cart > getAddresses \n ${warrning}`,
|
|
762
|
-
});
|
|
763
|
-
}
|
|
764
|
-
|
|
765
389
|
const query_params = {};
|
|
766
390
|
query_params["cart_id"] = cartId;
|
|
767
391
|
query_params["buy_now"] = buyNow;
|
|
@@ -790,32 +414,13 @@ class Cart {
|
|
|
790
414
|
responseData = response[0];
|
|
791
415
|
}
|
|
792
416
|
|
|
793
|
-
const {
|
|
794
|
-
error: res_error,
|
|
795
|
-
} = CartApplicationModel.GetAddressesResult().validate(responseData, {
|
|
796
|
-
abortEarly: false,
|
|
797
|
-
allowUnknown: true,
|
|
798
|
-
});
|
|
799
|
-
|
|
800
|
-
if (res_error) {
|
|
801
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
802
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
803
|
-
} else {
|
|
804
|
-
Logger({
|
|
805
|
-
level: "WARN",
|
|
806
|
-
message: `Response Validation Warnings for application > Cart > getAddresses \n ${res_error}`,
|
|
807
|
-
});
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
|
-
|
|
811
417
|
return response;
|
|
812
418
|
}
|
|
813
419
|
|
|
814
420
|
/**
|
|
815
|
-
* @param {CartApplicationValidator.GetBulkDiscountOffersParam} arg - Arg object.
|
|
816
421
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
817
422
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
818
|
-
* @returns {Promise<
|
|
423
|
+
* @returns {Promise<BulkPriceResponse>} - Success response
|
|
819
424
|
* @name getBulkDiscountOffers
|
|
820
425
|
* @summary: List bulk discounts
|
|
821
426
|
* @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/).
|
|
@@ -824,28 +429,6 @@ class Cart {
|
|
|
824
429
|
{ itemId, articleId, uid, slug, requestHeaders } = { requestHeaders: {} },
|
|
825
430
|
{ responseHeaders } = { responseHeaders: false }
|
|
826
431
|
) {
|
|
827
|
-
const { error } = CartApplicationValidator.getBulkDiscountOffers().validate(
|
|
828
|
-
{ itemId, articleId, uid, slug },
|
|
829
|
-
{ abortEarly: false, allowUnknown: true }
|
|
830
|
-
);
|
|
831
|
-
if (error) {
|
|
832
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
// Showing warrnings if extra unknown parameters are found
|
|
836
|
-
const {
|
|
837
|
-
error: warrning,
|
|
838
|
-
} = CartApplicationValidator.getBulkDiscountOffers().validate(
|
|
839
|
-
{ itemId, articleId, uid, slug },
|
|
840
|
-
{ abortEarly: false, allowUnknown: false }
|
|
841
|
-
);
|
|
842
|
-
if (warrning) {
|
|
843
|
-
Logger({
|
|
844
|
-
level: "WARN",
|
|
845
|
-
message: `Parameter Validation warrnings for application > Cart > getBulkDiscountOffers \n ${warrning}`,
|
|
846
|
-
});
|
|
847
|
-
}
|
|
848
|
-
|
|
849
432
|
const query_params = {};
|
|
850
433
|
query_params["item_id"] = itemId;
|
|
851
434
|
query_params["article_id"] = articleId;
|
|
@@ -872,32 +455,13 @@ class Cart {
|
|
|
872
455
|
responseData = response[0];
|
|
873
456
|
}
|
|
874
457
|
|
|
875
|
-
const {
|
|
876
|
-
error: res_error,
|
|
877
|
-
} = CartApplicationModel.BulkPriceResult().validate(responseData, {
|
|
878
|
-
abortEarly: false,
|
|
879
|
-
allowUnknown: true,
|
|
880
|
-
});
|
|
881
|
-
|
|
882
|
-
if (res_error) {
|
|
883
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
884
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
885
|
-
} else {
|
|
886
|
-
Logger({
|
|
887
|
-
level: "WARN",
|
|
888
|
-
message: `Response Validation Warnings for application > Cart > getBulkDiscountOffers \n ${res_error}`,
|
|
889
|
-
});
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
|
|
893
458
|
return response;
|
|
894
459
|
}
|
|
895
460
|
|
|
896
461
|
/**
|
|
897
|
-
* @param {CartApplicationValidator.GetCartParam} arg - Arg object.
|
|
898
462
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
899
463
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
900
|
-
* @returns {Promise<
|
|
464
|
+
* @returns {Promise<CartDetailResponse>} - Success response
|
|
901
465
|
* @name getCart
|
|
902
466
|
* @summary: Get a cart
|
|
903
467
|
* @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/).
|
|
@@ -916,26 +480,6 @@ class Cart {
|
|
|
916
480
|
} = { requestHeaders: {} },
|
|
917
481
|
{ responseHeaders } = { responseHeaders: false }
|
|
918
482
|
) {
|
|
919
|
-
const { error } = CartApplicationValidator.getCart().validate(
|
|
920
|
-
{ id, i, b, c, assignCardId, areaCode, buyNow, orderType },
|
|
921
|
-
{ abortEarly: false, allowUnknown: true }
|
|
922
|
-
);
|
|
923
|
-
if (error) {
|
|
924
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
// Showing warrnings if extra unknown parameters are found
|
|
928
|
-
const { error: warrning } = CartApplicationValidator.getCart().validate(
|
|
929
|
-
{ id, i, b, c, assignCardId, areaCode, buyNow, orderType },
|
|
930
|
-
{ abortEarly: false, allowUnknown: false }
|
|
931
|
-
);
|
|
932
|
-
if (warrning) {
|
|
933
|
-
Logger({
|
|
934
|
-
level: "WARN",
|
|
935
|
-
message: `Parameter Validation warrnings for application > Cart > getCart \n ${warrning}`,
|
|
936
|
-
});
|
|
937
|
-
}
|
|
938
|
-
|
|
939
483
|
const query_params = {};
|
|
940
484
|
query_params["id"] = id;
|
|
941
485
|
query_params["i"] = i;
|
|
@@ -966,29 +510,10 @@ class Cart {
|
|
|
966
510
|
responseData = response[0];
|
|
967
511
|
}
|
|
968
512
|
|
|
969
|
-
const {
|
|
970
|
-
error: res_error,
|
|
971
|
-
} = CartApplicationModel.CartDetailResult().validate(responseData, {
|
|
972
|
-
abortEarly: false,
|
|
973
|
-
allowUnknown: true,
|
|
974
|
-
});
|
|
975
|
-
|
|
976
|
-
if (res_error) {
|
|
977
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
978
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
979
|
-
} else {
|
|
980
|
-
Logger({
|
|
981
|
-
level: "WARN",
|
|
982
|
-
message: `Response Validation Warnings for application > Cart > getCart \n ${res_error}`,
|
|
983
|
-
});
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
|
|
987
513
|
return response;
|
|
988
514
|
}
|
|
989
515
|
|
|
990
516
|
/**
|
|
991
|
-
* @param {CartApplicationValidator.GetCartLastModifiedParam} arg - Arg object.
|
|
992
517
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
993
518
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
994
519
|
* @returns {Promise<any>} - Success response
|
|
@@ -1000,28 +525,6 @@ class Cart {
|
|
|
1000
525
|
{ id, requestHeaders } = { requestHeaders: {} },
|
|
1001
526
|
{ responseHeaders } = { responseHeaders: false }
|
|
1002
527
|
) {
|
|
1003
|
-
const { error } = CartApplicationValidator.getCartLastModified().validate(
|
|
1004
|
-
{ id },
|
|
1005
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1006
|
-
);
|
|
1007
|
-
if (error) {
|
|
1008
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1009
|
-
}
|
|
1010
|
-
|
|
1011
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1012
|
-
const {
|
|
1013
|
-
error: warrning,
|
|
1014
|
-
} = CartApplicationValidator.getCartLastModified().validate(
|
|
1015
|
-
{ id },
|
|
1016
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1017
|
-
);
|
|
1018
|
-
if (warrning) {
|
|
1019
|
-
Logger({
|
|
1020
|
-
level: "WARN",
|
|
1021
|
-
message: `Parameter Validation warrnings for application > Cart > getCartLastModified \n ${warrning}`,
|
|
1022
|
-
});
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
528
|
const query_params = {};
|
|
1026
529
|
query_params["id"] = id;
|
|
1027
530
|
|
|
@@ -1045,29 +548,13 @@ class Cart {
|
|
|
1045
548
|
responseData = response[0];
|
|
1046
549
|
}
|
|
1047
550
|
|
|
1048
|
-
const { error: res_error } = Joi.string()
|
|
1049
|
-
.allow("")
|
|
1050
|
-
.validate(responseData, { abortEarly: false, allowUnknown: true });
|
|
1051
|
-
|
|
1052
|
-
if (res_error) {
|
|
1053
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1054
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1055
|
-
} else {
|
|
1056
|
-
Logger({
|
|
1057
|
-
level: "WARN",
|
|
1058
|
-
message: `Response Validation Warnings for application > Cart > getCartLastModified \n ${res_error}`,
|
|
1059
|
-
});
|
|
1060
|
-
}
|
|
1061
|
-
}
|
|
1062
|
-
|
|
1063
551
|
return response;
|
|
1064
552
|
}
|
|
1065
553
|
|
|
1066
554
|
/**
|
|
1067
|
-
* @param {CartApplicationValidator.GetCartShareLinkParam} arg - Arg object.
|
|
1068
555
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1069
556
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1070
|
-
* @returns {Promise<
|
|
557
|
+
* @returns {Promise<GetShareCartLinkResponse>} - Success response
|
|
1071
558
|
* @name getCartShareLink
|
|
1072
559
|
* @summary: Create share cart link
|
|
1073
560
|
* @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/).
|
|
@@ -1076,28 +563,6 @@ class Cart {
|
|
|
1076
563
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1077
564
|
{ responseHeaders } = { responseHeaders: false }
|
|
1078
565
|
) {
|
|
1079
|
-
const { error } = CartApplicationValidator.getCartShareLink().validate(
|
|
1080
|
-
{ body },
|
|
1081
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1082
|
-
);
|
|
1083
|
-
if (error) {
|
|
1084
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1085
|
-
}
|
|
1086
|
-
|
|
1087
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1088
|
-
const {
|
|
1089
|
-
error: warrning,
|
|
1090
|
-
} = CartApplicationValidator.getCartShareLink().validate(
|
|
1091
|
-
{ body },
|
|
1092
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1093
|
-
);
|
|
1094
|
-
if (warrning) {
|
|
1095
|
-
Logger({
|
|
1096
|
-
level: "WARN",
|
|
1097
|
-
message: `Parameter Validation warrnings for application > Cart > getCartShareLink \n ${warrning}`,
|
|
1098
|
-
});
|
|
1099
|
-
}
|
|
1100
|
-
|
|
1101
566
|
const query_params = {};
|
|
1102
567
|
|
|
1103
568
|
const xHeaders = {};
|
|
@@ -1120,32 +585,13 @@ class Cart {
|
|
|
1120
585
|
responseData = response[0];
|
|
1121
586
|
}
|
|
1122
587
|
|
|
1123
|
-
const {
|
|
1124
|
-
error: res_error,
|
|
1125
|
-
} = CartApplicationModel.GetShareCartLinkResult().validate(responseData, {
|
|
1126
|
-
abortEarly: false,
|
|
1127
|
-
allowUnknown: true,
|
|
1128
|
-
});
|
|
1129
|
-
|
|
1130
|
-
if (res_error) {
|
|
1131
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1132
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1133
|
-
} else {
|
|
1134
|
-
Logger({
|
|
1135
|
-
level: "WARN",
|
|
1136
|
-
message: `Response Validation Warnings for application > Cart > getCartShareLink \n ${res_error}`,
|
|
1137
|
-
});
|
|
1138
|
-
}
|
|
1139
|
-
}
|
|
1140
|
-
|
|
1141
588
|
return response;
|
|
1142
589
|
}
|
|
1143
590
|
|
|
1144
591
|
/**
|
|
1145
|
-
* @param {CartApplicationValidator.GetCartSharedItemsParam} arg - Arg object.
|
|
1146
592
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1147
593
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1148
|
-
* @returns {Promise<
|
|
594
|
+
* @returns {Promise<SharedCartResponse>} - Success response
|
|
1149
595
|
* @name getCartSharedItems
|
|
1150
596
|
* @summary: List shared cart items
|
|
1151
597
|
* @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/).
|
|
@@ -1154,26 +600,13 @@ class Cart {
|
|
|
1154
600
|
{ token, requestHeaders } = { requestHeaders: {} },
|
|
1155
601
|
{ responseHeaders } = { responseHeaders: false }
|
|
1156
602
|
) {
|
|
1157
|
-
const
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1163
|
-
}
|
|
1164
|
-
|
|
1165
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1166
|
-
const {
|
|
1167
|
-
error: warrning,
|
|
1168
|
-
} = CartApplicationValidator.getCartSharedItems().validate(
|
|
1169
|
-
{ token },
|
|
1170
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1171
|
-
);
|
|
1172
|
-
if (warrning) {
|
|
1173
|
-
Logger({
|
|
1174
|
-
level: "WARN",
|
|
1175
|
-
message: `Parameter Validation warrnings for application > Cart > getCartSharedItems \n ${warrning}`,
|
|
603
|
+
const errors = validateRequiredParams(arguments[0], ["token"]);
|
|
604
|
+
if (errors.length > 0) {
|
|
605
|
+
const error = new FDKClientValidationError({
|
|
606
|
+
message: "Missing required field",
|
|
607
|
+
details: errors,
|
|
1176
608
|
});
|
|
609
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1177
610
|
}
|
|
1178
611
|
|
|
1179
612
|
const query_params = {};
|
|
@@ -1198,32 +631,13 @@ class Cart {
|
|
|
1198
631
|
responseData = response[0];
|
|
1199
632
|
}
|
|
1200
633
|
|
|
1201
|
-
const {
|
|
1202
|
-
error: res_error,
|
|
1203
|
-
} = CartApplicationModel.SharedCartResult().validate(responseData, {
|
|
1204
|
-
abortEarly: false,
|
|
1205
|
-
allowUnknown: true,
|
|
1206
|
-
});
|
|
1207
|
-
|
|
1208
|
-
if (res_error) {
|
|
1209
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1210
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1211
|
-
} else {
|
|
1212
|
-
Logger({
|
|
1213
|
-
level: "WARN",
|
|
1214
|
-
message: `Response Validation Warnings for application > Cart > getCartSharedItems \n ${res_error}`,
|
|
1215
|
-
});
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
634
|
return response;
|
|
1220
635
|
}
|
|
1221
636
|
|
|
1222
637
|
/**
|
|
1223
|
-
* @param {CartApplicationValidator.GetCouponsParam} arg - Arg object.
|
|
1224
638
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1225
639
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1226
|
-
* @returns {Promise<
|
|
640
|
+
* @returns {Promise<GetCouponResponse>} - Success response
|
|
1227
641
|
* @name getCoupons
|
|
1228
642
|
* @summary: List available coupons
|
|
1229
643
|
* @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/).
|
|
@@ -1232,26 +646,6 @@ class Cart {
|
|
|
1232
646
|
{ id, buyNow, slug, storeId, requestHeaders } = { requestHeaders: {} },
|
|
1233
647
|
{ responseHeaders } = { responseHeaders: false }
|
|
1234
648
|
) {
|
|
1235
|
-
const { error } = CartApplicationValidator.getCoupons().validate(
|
|
1236
|
-
{ id, buyNow, slug, storeId },
|
|
1237
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1238
|
-
);
|
|
1239
|
-
if (error) {
|
|
1240
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1241
|
-
}
|
|
1242
|
-
|
|
1243
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1244
|
-
const { error: warrning } = CartApplicationValidator.getCoupons().validate(
|
|
1245
|
-
{ id, buyNow, slug, storeId },
|
|
1246
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1247
|
-
);
|
|
1248
|
-
if (warrning) {
|
|
1249
|
-
Logger({
|
|
1250
|
-
level: "WARN",
|
|
1251
|
-
message: `Parameter Validation warrnings for application > Cart > getCoupons \n ${warrning}`,
|
|
1252
|
-
});
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
649
|
const query_params = {};
|
|
1256
650
|
query_params["id"] = id;
|
|
1257
651
|
query_params["buy_now"] = buyNow;
|
|
@@ -1278,32 +672,13 @@ class Cart {
|
|
|
1278
672
|
responseData = response[0];
|
|
1279
673
|
}
|
|
1280
674
|
|
|
1281
|
-
const {
|
|
1282
|
-
error: res_error,
|
|
1283
|
-
} = CartApplicationModel.GetCouponResult().validate(responseData, {
|
|
1284
|
-
abortEarly: false,
|
|
1285
|
-
allowUnknown: true,
|
|
1286
|
-
});
|
|
1287
|
-
|
|
1288
|
-
if (res_error) {
|
|
1289
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1290
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1291
|
-
} else {
|
|
1292
|
-
Logger({
|
|
1293
|
-
level: "WARN",
|
|
1294
|
-
message: `Response Validation Warnings for application > Cart > getCoupons \n ${res_error}`,
|
|
1295
|
-
});
|
|
1296
|
-
}
|
|
1297
|
-
}
|
|
1298
|
-
|
|
1299
675
|
return response;
|
|
1300
676
|
}
|
|
1301
677
|
|
|
1302
678
|
/**
|
|
1303
|
-
* @param {CartApplicationValidator.GetItemCountParam} arg - Arg object.
|
|
1304
679
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1305
680
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1306
|
-
* @returns {Promise<
|
|
681
|
+
* @returns {Promise<CartItemCountResponse>} - Success response
|
|
1307
682
|
* @name getItemCount
|
|
1308
683
|
* @summary: Get a cart items count
|
|
1309
684
|
* @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/).
|
|
@@ -1312,28 +687,6 @@ class Cart {
|
|
|
1312
687
|
{ id, buyNow, requestHeaders } = { requestHeaders: {} },
|
|
1313
688
|
{ responseHeaders } = { responseHeaders: false }
|
|
1314
689
|
) {
|
|
1315
|
-
const { error } = CartApplicationValidator.getItemCount().validate(
|
|
1316
|
-
{ id, buyNow },
|
|
1317
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1318
|
-
);
|
|
1319
|
-
if (error) {
|
|
1320
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1321
|
-
}
|
|
1322
|
-
|
|
1323
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1324
|
-
const {
|
|
1325
|
-
error: warrning,
|
|
1326
|
-
} = CartApplicationValidator.getItemCount().validate(
|
|
1327
|
-
{ id, buyNow },
|
|
1328
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1329
|
-
);
|
|
1330
|
-
if (warrning) {
|
|
1331
|
-
Logger({
|
|
1332
|
-
level: "WARN",
|
|
1333
|
-
message: `Parameter Validation warrnings for application > Cart > getItemCount \n ${warrning}`,
|
|
1334
|
-
});
|
|
1335
|
-
}
|
|
1336
|
-
|
|
1337
690
|
const query_params = {};
|
|
1338
691
|
query_params["id"] = id;
|
|
1339
692
|
query_params["buy_now"] = buyNow;
|
|
@@ -1358,32 +711,13 @@ class Cart {
|
|
|
1358
711
|
responseData = response[0];
|
|
1359
712
|
}
|
|
1360
713
|
|
|
1361
|
-
const {
|
|
1362
|
-
error: res_error,
|
|
1363
|
-
} = CartApplicationModel.CartItemCountResult().validate(responseData, {
|
|
1364
|
-
abortEarly: false,
|
|
1365
|
-
allowUnknown: true,
|
|
1366
|
-
});
|
|
1367
|
-
|
|
1368
|
-
if (res_error) {
|
|
1369
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1370
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1371
|
-
} else {
|
|
1372
|
-
Logger({
|
|
1373
|
-
level: "WARN",
|
|
1374
|
-
message: `Response Validation Warnings for application > Cart > getItemCount \n ${res_error}`,
|
|
1375
|
-
});
|
|
1376
|
-
}
|
|
1377
|
-
}
|
|
1378
|
-
|
|
1379
714
|
return response;
|
|
1380
715
|
}
|
|
1381
716
|
|
|
1382
717
|
/**
|
|
1383
|
-
* @param {CartApplicationValidator.GetLadderOffersParam} arg - Arg object.
|
|
1384
718
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1385
719
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1386
|
-
* @returns {Promise<
|
|
720
|
+
* @returns {Promise<LadderPriceOffers>} - Success response
|
|
1387
721
|
* @name getLadderOffers
|
|
1388
722
|
* @summary: List ladder offers
|
|
1389
723
|
* @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/).
|
|
@@ -1394,28 +728,6 @@ class Cart {
|
|
|
1394
728
|
},
|
|
1395
729
|
{ responseHeaders } = { responseHeaders: false }
|
|
1396
730
|
) {
|
|
1397
|
-
const { error } = CartApplicationValidator.getLadderOffers().validate(
|
|
1398
|
-
{ slug, storeId, promotionId, pageSize },
|
|
1399
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1400
|
-
);
|
|
1401
|
-
if (error) {
|
|
1402
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1403
|
-
}
|
|
1404
|
-
|
|
1405
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1406
|
-
const {
|
|
1407
|
-
error: warrning,
|
|
1408
|
-
} = CartApplicationValidator.getLadderOffers().validate(
|
|
1409
|
-
{ slug, storeId, promotionId, pageSize },
|
|
1410
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1411
|
-
);
|
|
1412
|
-
if (warrning) {
|
|
1413
|
-
Logger({
|
|
1414
|
-
level: "WARN",
|
|
1415
|
-
message: `Parameter Validation warrnings for application > Cart > getLadderOffers \n ${warrning}`,
|
|
1416
|
-
});
|
|
1417
|
-
}
|
|
1418
|
-
|
|
1419
731
|
const query_params = {};
|
|
1420
732
|
query_params["slug"] = slug;
|
|
1421
733
|
query_params["store_id"] = storeId;
|
|
@@ -1442,32 +754,13 @@ class Cart {
|
|
|
1442
754
|
responseData = response[0];
|
|
1443
755
|
}
|
|
1444
756
|
|
|
1445
|
-
const {
|
|
1446
|
-
error: res_error,
|
|
1447
|
-
} = CartApplicationModel.LadderPriceOffers().validate(responseData, {
|
|
1448
|
-
abortEarly: false,
|
|
1449
|
-
allowUnknown: true,
|
|
1450
|
-
});
|
|
1451
|
-
|
|
1452
|
-
if (res_error) {
|
|
1453
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1454
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1455
|
-
} else {
|
|
1456
|
-
Logger({
|
|
1457
|
-
level: "WARN",
|
|
1458
|
-
message: `Response Validation Warnings for application > Cart > getLadderOffers \n ${res_error}`,
|
|
1459
|
-
});
|
|
1460
|
-
}
|
|
1461
|
-
}
|
|
1462
|
-
|
|
1463
757
|
return response;
|
|
1464
758
|
}
|
|
1465
759
|
|
|
1466
760
|
/**
|
|
1467
|
-
* @param {CartApplicationValidator.GetPromotionOffersParam} arg - Arg object.
|
|
1468
761
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1469
762
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1470
|
-
* @returns {Promise<
|
|
763
|
+
* @returns {Promise<PromotionOffersResponse>} - Success response
|
|
1471
764
|
* @name getPromotionOffers
|
|
1472
765
|
* @summary: List available promotion offers
|
|
1473
766
|
* @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/).
|
|
@@ -1478,28 +771,6 @@ class Cart {
|
|
|
1478
771
|
},
|
|
1479
772
|
{ responseHeaders } = { responseHeaders: false }
|
|
1480
773
|
) {
|
|
1481
|
-
const { error } = CartApplicationValidator.getPromotionOffers().validate(
|
|
1482
|
-
{ slug, pageSize, promotionGroup, storeId, cartType },
|
|
1483
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1484
|
-
);
|
|
1485
|
-
if (error) {
|
|
1486
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1487
|
-
}
|
|
1488
|
-
|
|
1489
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1490
|
-
const {
|
|
1491
|
-
error: warrning,
|
|
1492
|
-
} = CartApplicationValidator.getPromotionOffers().validate(
|
|
1493
|
-
{ slug, pageSize, promotionGroup, storeId, cartType },
|
|
1494
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1495
|
-
);
|
|
1496
|
-
if (warrning) {
|
|
1497
|
-
Logger({
|
|
1498
|
-
level: "WARN",
|
|
1499
|
-
message: `Parameter Validation warrnings for application > Cart > getPromotionOffers \n ${warrning}`,
|
|
1500
|
-
});
|
|
1501
|
-
}
|
|
1502
|
-
|
|
1503
774
|
const query_params = {};
|
|
1504
775
|
query_params["slug"] = slug;
|
|
1505
776
|
query_params["page_size"] = pageSize;
|
|
@@ -1527,33 +798,13 @@ class Cart {
|
|
|
1527
798
|
responseData = response[0];
|
|
1528
799
|
}
|
|
1529
800
|
|
|
1530
|
-
const {
|
|
1531
|
-
error: res_error,
|
|
1532
|
-
} = CartApplicationModel.PromotionOffersResult().validate(responseData, {
|
|
1533
|
-
abortEarly: false,
|
|
1534
|
-
allowUnknown: true,
|
|
1535
|
-
});
|
|
1536
|
-
|
|
1537
|
-
if (res_error) {
|
|
1538
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1539
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1540
|
-
} else {
|
|
1541
|
-
Logger({
|
|
1542
|
-
level: "WARN",
|
|
1543
|
-
message: `Response Validation Warnings for application > Cart > getPromotionOffers \n ${res_error}`,
|
|
1544
|
-
});
|
|
1545
|
-
}
|
|
1546
|
-
}
|
|
1547
|
-
|
|
1548
801
|
return response;
|
|
1549
802
|
}
|
|
1550
803
|
|
|
1551
804
|
/**
|
|
1552
|
-
* @param {CartApplicationValidator.GetPromotionPaymentOffersParam} arg - Arg object.
|
|
1553
805
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1554
806
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1555
|
-
* @returns {Promise<
|
|
1556
|
-
* Success response
|
|
807
|
+
* @returns {Promise<PromotionPaymentOffersResponse>} - Success response
|
|
1557
808
|
* @name getPromotionPaymentOffers
|
|
1558
809
|
* @summary: Fetch available promotions payment offers
|
|
1559
810
|
* @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/).
|
|
@@ -1562,30 +813,6 @@ class Cart {
|
|
|
1562
813
|
{ id, uid, requestHeaders } = { requestHeaders: {} },
|
|
1563
814
|
{ responseHeaders } = { responseHeaders: false }
|
|
1564
815
|
) {
|
|
1565
|
-
const {
|
|
1566
|
-
error,
|
|
1567
|
-
} = CartApplicationValidator.getPromotionPaymentOffers().validate(
|
|
1568
|
-
{ id, uid },
|
|
1569
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1570
|
-
);
|
|
1571
|
-
if (error) {
|
|
1572
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1573
|
-
}
|
|
1574
|
-
|
|
1575
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1576
|
-
const {
|
|
1577
|
-
error: warrning,
|
|
1578
|
-
} = CartApplicationValidator.getPromotionPaymentOffers().validate(
|
|
1579
|
-
{ id, uid },
|
|
1580
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1581
|
-
);
|
|
1582
|
-
if (warrning) {
|
|
1583
|
-
Logger({
|
|
1584
|
-
level: "WARN",
|
|
1585
|
-
message: `Parameter Validation warrnings for application > Cart > getPromotionPaymentOffers \n ${warrning}`,
|
|
1586
|
-
});
|
|
1587
|
-
}
|
|
1588
|
-
|
|
1589
816
|
const query_params = {};
|
|
1590
817
|
query_params["id"] = id;
|
|
1591
818
|
query_params["uid"] = uid;
|
|
@@ -1610,32 +837,13 @@ class Cart {
|
|
|
1610
837
|
responseData = response[0];
|
|
1611
838
|
}
|
|
1612
839
|
|
|
1613
|
-
const {
|
|
1614
|
-
error: res_error,
|
|
1615
|
-
} = CartApplicationModel.PromotionPaymentOffersResult().validate(
|
|
1616
|
-
responseData,
|
|
1617
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1618
|
-
);
|
|
1619
|
-
|
|
1620
|
-
if (res_error) {
|
|
1621
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1622
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1623
|
-
} else {
|
|
1624
|
-
Logger({
|
|
1625
|
-
level: "WARN",
|
|
1626
|
-
message: `Response Validation Warnings for application > Cart > getPromotionPaymentOffers \n ${res_error}`,
|
|
1627
|
-
});
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
|
|
1631
840
|
return response;
|
|
1632
841
|
}
|
|
1633
842
|
|
|
1634
843
|
/**
|
|
1635
|
-
* @param {CartApplicationValidator.GetShipmentsParam} arg - Arg object.
|
|
1636
844
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1637
845
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1638
|
-
* @returns {Promise<
|
|
846
|
+
* @returns {Promise<CartShipmentsResponse>} - Success response
|
|
1639
847
|
* @name getShipments
|
|
1640
848
|
* @summary: List shipments
|
|
1641
849
|
* @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/).
|
|
@@ -1646,28 +854,6 @@ class Cart {
|
|
|
1646
854
|
},
|
|
1647
855
|
{ responseHeaders } = { responseHeaders: false }
|
|
1648
856
|
) {
|
|
1649
|
-
const { error } = CartApplicationValidator.getShipments().validate(
|
|
1650
|
-
{ p, id, buyNow, addressId, areaCode, orderType },
|
|
1651
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1652
|
-
);
|
|
1653
|
-
if (error) {
|
|
1654
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1655
|
-
}
|
|
1656
|
-
|
|
1657
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1658
|
-
const {
|
|
1659
|
-
error: warrning,
|
|
1660
|
-
} = CartApplicationValidator.getShipments().validate(
|
|
1661
|
-
{ p, id, buyNow, addressId, areaCode, orderType },
|
|
1662
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1663
|
-
);
|
|
1664
|
-
if (warrning) {
|
|
1665
|
-
Logger({
|
|
1666
|
-
level: "WARN",
|
|
1667
|
-
message: `Parameter Validation warrnings for application > Cart > getShipments \n ${warrning}`,
|
|
1668
|
-
});
|
|
1669
|
-
}
|
|
1670
|
-
|
|
1671
857
|
const query_params = {};
|
|
1672
858
|
query_params["p"] = p;
|
|
1673
859
|
query_params["id"] = id;
|
|
@@ -1696,32 +882,13 @@ class Cart {
|
|
|
1696
882
|
responseData = response[0];
|
|
1697
883
|
}
|
|
1698
884
|
|
|
1699
|
-
const {
|
|
1700
|
-
error: res_error,
|
|
1701
|
-
} = CartApplicationModel.CartShipmentsResult().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 > getShipments \n ${res_error}`,
|
|
1713
|
-
});
|
|
1714
|
-
}
|
|
1715
|
-
}
|
|
1716
|
-
|
|
1717
885
|
return response;
|
|
1718
886
|
}
|
|
1719
887
|
|
|
1720
888
|
/**
|
|
1721
|
-
* @param {CartApplicationValidator.RemoveAddressParam} arg - Arg object.
|
|
1722
889
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1723
890
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1724
|
-
* @returns {Promise<
|
|
891
|
+
* @returns {Promise<DeleteAddressResponse>} - Success response
|
|
1725
892
|
* @name removeAddress
|
|
1726
893
|
* @summary: Removes an address from a customer's address list
|
|
1727
894
|
* @description: Delete an existing customer address from the system. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/removeAddress/).
|
|
@@ -1730,26 +897,13 @@ class Cart {
|
|
|
1730
897
|
{ id, requestHeaders } = { requestHeaders: {} },
|
|
1731
898
|
{ responseHeaders } = { responseHeaders: false }
|
|
1732
899
|
) {
|
|
1733
|
-
const
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
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.removeAddress().validate(
|
|
1745
|
-
{ id },
|
|
1746
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1747
|
-
);
|
|
1748
|
-
if (warrning) {
|
|
1749
|
-
Logger({
|
|
1750
|
-
level: "WARN",
|
|
1751
|
-
message: `Parameter Validation warrnings for application > Cart > removeAddress \n ${warrning}`,
|
|
900
|
+
const errors = validateRequiredParams(arguments[0], ["id"]);
|
|
901
|
+
if (errors.length > 0) {
|
|
902
|
+
const error = new FDKClientValidationError({
|
|
903
|
+
message: "Missing required field",
|
|
904
|
+
details: errors,
|
|
1752
905
|
});
|
|
906
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1753
907
|
}
|
|
1754
908
|
|
|
1755
909
|
const query_params = {};
|
|
@@ -1774,32 +928,13 @@ class Cart {
|
|
|
1774
928
|
responseData = response[0];
|
|
1775
929
|
}
|
|
1776
930
|
|
|
1777
|
-
const {
|
|
1778
|
-
error: res_error,
|
|
1779
|
-
} = CartApplicationModel.DeleteAddressResult().validate(responseData, {
|
|
1780
|
-
abortEarly: false,
|
|
1781
|
-
allowUnknown: true,
|
|
1782
|
-
});
|
|
1783
|
-
|
|
1784
|
-
if (res_error) {
|
|
1785
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1786
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1787
|
-
} else {
|
|
1788
|
-
Logger({
|
|
1789
|
-
level: "WARN",
|
|
1790
|
-
message: `Response Validation Warnings for application > Cart > removeAddress \n ${res_error}`,
|
|
1791
|
-
});
|
|
1792
|
-
}
|
|
1793
|
-
}
|
|
1794
|
-
|
|
1795
931
|
return response;
|
|
1796
932
|
}
|
|
1797
933
|
|
|
1798
934
|
/**
|
|
1799
|
-
* @param {CartApplicationValidator.RemoveCouponParam} arg - Arg object.
|
|
1800
935
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1801
936
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1802
|
-
* @returns {Promise<
|
|
937
|
+
* @returns {Promise<CartDetailResponse>} - Success response
|
|
1803
938
|
* @name removeCoupon
|
|
1804
939
|
* @summary: Remove coupon
|
|
1805
940
|
* @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/).
|
|
@@ -1808,28 +943,6 @@ class Cart {
|
|
|
1808
943
|
{ id, buyNow, requestHeaders } = { requestHeaders: {} },
|
|
1809
944
|
{ responseHeaders } = { responseHeaders: false }
|
|
1810
945
|
) {
|
|
1811
|
-
const { error } = CartApplicationValidator.removeCoupon().validate(
|
|
1812
|
-
{ id, buyNow },
|
|
1813
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1814
|
-
);
|
|
1815
|
-
if (error) {
|
|
1816
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1817
|
-
}
|
|
1818
|
-
|
|
1819
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1820
|
-
const {
|
|
1821
|
-
error: warrning,
|
|
1822
|
-
} = CartApplicationValidator.removeCoupon().validate(
|
|
1823
|
-
{ id, buyNow },
|
|
1824
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1825
|
-
);
|
|
1826
|
-
if (warrning) {
|
|
1827
|
-
Logger({
|
|
1828
|
-
level: "WARN",
|
|
1829
|
-
message: `Parameter Validation warrnings for application > Cart > removeCoupon \n ${warrning}`,
|
|
1830
|
-
});
|
|
1831
|
-
}
|
|
1832
|
-
|
|
1833
946
|
const query_params = {};
|
|
1834
947
|
query_params["id"] = id;
|
|
1835
948
|
query_params["buy_now"] = buyNow;
|
|
@@ -1854,32 +967,13 @@ class Cart {
|
|
|
1854
967
|
responseData = response[0];
|
|
1855
968
|
}
|
|
1856
969
|
|
|
1857
|
-
const {
|
|
1858
|
-
error: res_error,
|
|
1859
|
-
} = CartApplicationModel.CartDetailResult().validate(responseData, {
|
|
1860
|
-
abortEarly: false,
|
|
1861
|
-
allowUnknown: true,
|
|
1862
|
-
});
|
|
1863
|
-
|
|
1864
|
-
if (res_error) {
|
|
1865
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1866
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1867
|
-
} else {
|
|
1868
|
-
Logger({
|
|
1869
|
-
level: "WARN",
|
|
1870
|
-
message: `Response Validation Warnings for application > Cart > removeCoupon \n ${res_error}`,
|
|
1871
|
-
});
|
|
1872
|
-
}
|
|
1873
|
-
}
|
|
1874
|
-
|
|
1875
970
|
return response;
|
|
1876
971
|
}
|
|
1877
972
|
|
|
1878
973
|
/**
|
|
1879
|
-
* @param {CartApplicationValidator.SelectAddressParam} arg - Arg object.
|
|
1880
974
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1881
975
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1882
|
-
* @returns {Promise<
|
|
976
|
+
* @returns {Promise<CartDetailResponse>} - Success response
|
|
1883
977
|
* @name selectAddress
|
|
1884
978
|
* @summary: Select customer address for order processing
|
|
1885
979
|
* @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/).
|
|
@@ -1888,28 +982,6 @@ class Cart {
|
|
|
1888
982
|
{ body, cartId, buyNow, i, b, requestHeaders } = { requestHeaders: {} },
|
|
1889
983
|
{ responseHeaders } = { responseHeaders: false }
|
|
1890
984
|
) {
|
|
1891
|
-
const { error } = CartApplicationValidator.selectAddress().validate(
|
|
1892
|
-
{ body, cartId, buyNow, i, b },
|
|
1893
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1894
|
-
);
|
|
1895
|
-
if (error) {
|
|
1896
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1897
|
-
}
|
|
1898
|
-
|
|
1899
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1900
|
-
const {
|
|
1901
|
-
error: warrning,
|
|
1902
|
-
} = CartApplicationValidator.selectAddress().validate(
|
|
1903
|
-
{ body, cartId, buyNow, i, b },
|
|
1904
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1905
|
-
);
|
|
1906
|
-
if (warrning) {
|
|
1907
|
-
Logger({
|
|
1908
|
-
level: "WARN",
|
|
1909
|
-
message: `Parameter Validation warrnings for application > Cart > selectAddress \n ${warrning}`,
|
|
1910
|
-
});
|
|
1911
|
-
}
|
|
1912
|
-
|
|
1913
985
|
const query_params = {};
|
|
1914
986
|
query_params["cart_id"] = cartId;
|
|
1915
987
|
query_params["buy_now"] = buyNow;
|
|
@@ -1936,32 +1008,13 @@ class Cart {
|
|
|
1936
1008
|
responseData = response[0];
|
|
1937
1009
|
}
|
|
1938
1010
|
|
|
1939
|
-
const {
|
|
1940
|
-
error: res_error,
|
|
1941
|
-
} = CartApplicationModel.CartDetailResult().validate(responseData, {
|
|
1942
|
-
abortEarly: false,
|
|
1943
|
-
allowUnknown: true,
|
|
1944
|
-
});
|
|
1945
|
-
|
|
1946
|
-
if (res_error) {
|
|
1947
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
1948
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1949
|
-
} else {
|
|
1950
|
-
Logger({
|
|
1951
|
-
level: "WARN",
|
|
1952
|
-
message: `Response Validation Warnings for application > Cart > selectAddress \n ${res_error}`,
|
|
1953
|
-
});
|
|
1954
|
-
}
|
|
1955
|
-
}
|
|
1956
|
-
|
|
1957
1011
|
return response;
|
|
1958
1012
|
}
|
|
1959
1013
|
|
|
1960
1014
|
/**
|
|
1961
|
-
* @param {CartApplicationValidator.SelectPaymentModeParam} arg - Arg object.
|
|
1962
1015
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1963
1016
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1964
|
-
* @returns {Promise<
|
|
1017
|
+
* @returns {Promise<CartDetailResponse>} - Success response
|
|
1965
1018
|
* @name selectPaymentMode
|
|
1966
1019
|
* @summary: Select payment mode
|
|
1967
1020
|
* @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/).
|
|
@@ -1970,28 +1023,6 @@ class Cart {
|
|
|
1970
1023
|
{ body, id, buyNow, requestHeaders } = { requestHeaders: {} },
|
|
1971
1024
|
{ responseHeaders } = { responseHeaders: false }
|
|
1972
1025
|
) {
|
|
1973
|
-
const { error } = CartApplicationValidator.selectPaymentMode().validate(
|
|
1974
|
-
{ body, id, buyNow },
|
|
1975
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1976
|
-
);
|
|
1977
|
-
if (error) {
|
|
1978
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1979
|
-
}
|
|
1980
|
-
|
|
1981
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1982
|
-
const {
|
|
1983
|
-
error: warrning,
|
|
1984
|
-
} = CartApplicationValidator.selectPaymentMode().validate(
|
|
1985
|
-
{ body, id, buyNow },
|
|
1986
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1987
|
-
);
|
|
1988
|
-
if (warrning) {
|
|
1989
|
-
Logger({
|
|
1990
|
-
level: "WARN",
|
|
1991
|
-
message: `Parameter Validation warrnings for application > Cart > selectPaymentMode \n ${warrning}`,
|
|
1992
|
-
});
|
|
1993
|
-
}
|
|
1994
|
-
|
|
1995
1026
|
const query_params = {};
|
|
1996
1027
|
query_params["id"] = id;
|
|
1997
1028
|
query_params["buy_now"] = buyNow;
|
|
@@ -2016,32 +1047,13 @@ class Cart {
|
|
|
2016
1047
|
responseData = response[0];
|
|
2017
1048
|
}
|
|
2018
1049
|
|
|
2019
|
-
const {
|
|
2020
|
-
error: res_error,
|
|
2021
|
-
} = CartApplicationModel.CartDetailResult().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 > selectPaymentMode \n ${res_error}`,
|
|
2033
|
-
});
|
|
2034
|
-
}
|
|
2035
|
-
}
|
|
2036
|
-
|
|
2037
1050
|
return response;
|
|
2038
1051
|
}
|
|
2039
1052
|
|
|
2040
1053
|
/**
|
|
2041
|
-
* @param {CartApplicationValidator.UpdateAddressParam} arg - Arg object.
|
|
2042
1054
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2043
1055
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2044
|
-
* @returns {Promise<
|
|
1056
|
+
* @returns {Promise<UpdateAddressResponse>} - Success response
|
|
2045
1057
|
* @name updateAddress
|
|
2046
1058
|
* @summary: Updates an existing customer address
|
|
2047
1059
|
* @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/).
|
|
@@ -2050,26 +1062,13 @@ class Cart {
|
|
|
2050
1062
|
{ id, body, requestHeaders } = { requestHeaders: {} },
|
|
2051
1063
|
{ responseHeaders } = { responseHeaders: false }
|
|
2052
1064
|
) {
|
|
2053
|
-
const
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2059
|
-
}
|
|
2060
|
-
|
|
2061
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2062
|
-
const {
|
|
2063
|
-
error: warrning,
|
|
2064
|
-
} = CartApplicationValidator.updateAddress().validate(
|
|
2065
|
-
{ id, body },
|
|
2066
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2067
|
-
);
|
|
2068
|
-
if (warrning) {
|
|
2069
|
-
Logger({
|
|
2070
|
-
level: "WARN",
|
|
2071
|
-
message: `Parameter Validation warrnings for application > Cart > updateAddress \n ${warrning}`,
|
|
1065
|
+
const errors = validateRequiredParams(arguments[0], ["id"]);
|
|
1066
|
+
if (errors.length > 0) {
|
|
1067
|
+
const error = new FDKClientValidationError({
|
|
1068
|
+
message: "Missing required field",
|
|
1069
|
+
details: errors,
|
|
2072
1070
|
});
|
|
1071
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2073
1072
|
}
|
|
2074
1073
|
|
|
2075
1074
|
const query_params = {};
|
|
@@ -2094,32 +1093,13 @@ class Cart {
|
|
|
2094
1093
|
responseData = response[0];
|
|
2095
1094
|
}
|
|
2096
1095
|
|
|
2097
|
-
const {
|
|
2098
|
-
error: res_error,
|
|
2099
|
-
} = CartApplicationModel.UpdateAddressResult().validate(responseData, {
|
|
2100
|
-
abortEarly: false,
|
|
2101
|
-
allowUnknown: true,
|
|
2102
|
-
});
|
|
2103
|
-
|
|
2104
|
-
if (res_error) {
|
|
2105
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
2106
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2107
|
-
} else {
|
|
2108
|
-
Logger({
|
|
2109
|
-
level: "WARN",
|
|
2110
|
-
message: `Response Validation Warnings for application > Cart > updateAddress \n ${res_error}`,
|
|
2111
|
-
});
|
|
2112
|
-
}
|
|
2113
|
-
}
|
|
2114
|
-
|
|
2115
1096
|
return response;
|
|
2116
1097
|
}
|
|
2117
1098
|
|
|
2118
1099
|
/**
|
|
2119
|
-
* @param {CartApplicationValidator.UpdateCartParam} arg - Arg object.
|
|
2120
1100
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2121
1101
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2122
|
-
* @returns {Promise<
|
|
1102
|
+
* @returns {Promise<UpdateCartDetailResponse>} - Success response
|
|
2123
1103
|
* @name updateCart
|
|
2124
1104
|
* @summary: Update cart items
|
|
2125
1105
|
* @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/).
|
|
@@ -2138,26 +1118,6 @@ class Cart {
|
|
|
2138
1118
|
} = { requestHeaders: {} },
|
|
2139
1119
|
{ responseHeaders } = { responseHeaders: false }
|
|
2140
1120
|
) {
|
|
2141
|
-
const { error } = CartApplicationValidator.updateCart().validate(
|
|
2142
|
-
{ body, id, i, b, areaCode, buyNow, cartType, orderType },
|
|
2143
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2144
|
-
);
|
|
2145
|
-
if (error) {
|
|
2146
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2147
|
-
}
|
|
2148
|
-
|
|
2149
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2150
|
-
const { error: warrning } = CartApplicationValidator.updateCart().validate(
|
|
2151
|
-
{ body, id, i, b, areaCode, buyNow, cartType, orderType },
|
|
2152
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2153
|
-
);
|
|
2154
|
-
if (warrning) {
|
|
2155
|
-
Logger({
|
|
2156
|
-
level: "WARN",
|
|
2157
|
-
message: `Parameter Validation warrnings for application > Cart > updateCart \n ${warrning}`,
|
|
2158
|
-
});
|
|
2159
|
-
}
|
|
2160
|
-
|
|
2161
1121
|
const query_params = {};
|
|
2162
1122
|
query_params["id"] = id;
|
|
2163
1123
|
query_params["i"] = i;
|
|
@@ -2187,32 +1147,13 @@ class Cart {
|
|
|
2187
1147
|
responseData = response[0];
|
|
2188
1148
|
}
|
|
2189
1149
|
|
|
2190
|
-
const {
|
|
2191
|
-
error: res_error,
|
|
2192
|
-
} = CartApplicationModel.UpdateCartDetailResult().validate(responseData, {
|
|
2193
|
-
abortEarly: false,
|
|
2194
|
-
allowUnknown: true,
|
|
2195
|
-
});
|
|
2196
|
-
|
|
2197
|
-
if (res_error) {
|
|
2198
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
2199
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2200
|
-
} else {
|
|
2201
|
-
Logger({
|
|
2202
|
-
level: "WARN",
|
|
2203
|
-
message: `Response Validation Warnings for application > Cart > updateCart \n ${res_error}`,
|
|
2204
|
-
});
|
|
2205
|
-
}
|
|
2206
|
-
}
|
|
2207
|
-
|
|
2208
1150
|
return response;
|
|
2209
1151
|
}
|
|
2210
1152
|
|
|
2211
1153
|
/**
|
|
2212
|
-
* @param {CartApplicationValidator.UpdateCartMetaParam} arg - Arg object.
|
|
2213
1154
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2214
1155
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2215
|
-
* @returns {Promise<
|
|
1156
|
+
* @returns {Promise<CartMetaResponse>} - Success response
|
|
2216
1157
|
* @name updateCartMeta
|
|
2217
1158
|
* @summary: Update cart metadata
|
|
2218
1159
|
* @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/).
|
|
@@ -2221,28 +1162,6 @@ class Cart {
|
|
|
2221
1162
|
{ body, id, buyNow, requestHeaders } = { requestHeaders: {} },
|
|
2222
1163
|
{ responseHeaders } = { responseHeaders: false }
|
|
2223
1164
|
) {
|
|
2224
|
-
const { error } = CartApplicationValidator.updateCartMeta().validate(
|
|
2225
|
-
{ body, id, buyNow },
|
|
2226
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2227
|
-
);
|
|
2228
|
-
if (error) {
|
|
2229
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2230
|
-
}
|
|
2231
|
-
|
|
2232
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2233
|
-
const {
|
|
2234
|
-
error: warrning,
|
|
2235
|
-
} = CartApplicationValidator.updateCartMeta().validate(
|
|
2236
|
-
{ body, id, buyNow },
|
|
2237
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2238
|
-
);
|
|
2239
|
-
if (warrning) {
|
|
2240
|
-
Logger({
|
|
2241
|
-
level: "WARN",
|
|
2242
|
-
message: `Parameter Validation warrnings for application > Cart > updateCartMeta \n ${warrning}`,
|
|
2243
|
-
});
|
|
2244
|
-
}
|
|
2245
|
-
|
|
2246
1165
|
const query_params = {};
|
|
2247
1166
|
query_params["id"] = id;
|
|
2248
1167
|
query_params["buy_now"] = buyNow;
|
|
@@ -2267,32 +1186,13 @@ class Cart {
|
|
|
2267
1186
|
responseData = response[0];
|
|
2268
1187
|
}
|
|
2269
1188
|
|
|
2270
|
-
const {
|
|
2271
|
-
error: res_error,
|
|
2272
|
-
} = CartApplicationModel.CartMetaResult().validate(responseData, {
|
|
2273
|
-
abortEarly: false,
|
|
2274
|
-
allowUnknown: true,
|
|
2275
|
-
});
|
|
2276
|
-
|
|
2277
|
-
if (res_error) {
|
|
2278
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
2279
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2280
|
-
} else {
|
|
2281
|
-
Logger({
|
|
2282
|
-
level: "WARN",
|
|
2283
|
-
message: `Response Validation Warnings for application > Cart > updateCartMeta \n ${res_error}`,
|
|
2284
|
-
});
|
|
2285
|
-
}
|
|
2286
|
-
}
|
|
2287
|
-
|
|
2288
1189
|
return response;
|
|
2289
1190
|
}
|
|
2290
1191
|
|
|
2291
1192
|
/**
|
|
2292
|
-
* @param {CartApplicationValidator.UpdateCartWithSharedItemsParam} arg - Arg object.
|
|
2293
1193
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2294
1194
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2295
|
-
* @returns {Promise<
|
|
1195
|
+
* @returns {Promise<SharedCartResponse>} - Success response
|
|
2296
1196
|
* @name updateCartWithSharedItems
|
|
2297
1197
|
* @summary: Update with shared items
|
|
2298
1198
|
* @description: Merge or replace shared cart items with existing cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/updateCartWithSharedItems/).
|
|
@@ -2301,28 +1201,13 @@ class Cart {
|
|
|
2301
1201
|
{ token, action, requestHeaders } = { requestHeaders: {} },
|
|
2302
1202
|
{ responseHeaders } = { responseHeaders: false }
|
|
2303
1203
|
) {
|
|
2304
|
-
const
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
);
|
|
2310
|
-
if (error) {
|
|
2311
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2312
|
-
}
|
|
2313
|
-
|
|
2314
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2315
|
-
const {
|
|
2316
|
-
error: warrning,
|
|
2317
|
-
} = CartApplicationValidator.updateCartWithSharedItems().validate(
|
|
2318
|
-
{ token, action },
|
|
2319
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2320
|
-
);
|
|
2321
|
-
if (warrning) {
|
|
2322
|
-
Logger({
|
|
2323
|
-
level: "WARN",
|
|
2324
|
-
message: `Parameter Validation warrnings for application > Cart > updateCartWithSharedItems \n ${warrning}`,
|
|
1204
|
+
const errors = validateRequiredParams(arguments[0], ["token", "action"]);
|
|
1205
|
+
if (errors.length > 0) {
|
|
1206
|
+
const error = new FDKClientValidationError({
|
|
1207
|
+
message: "Missing required field",
|
|
1208
|
+
details: errors,
|
|
2325
1209
|
});
|
|
1210
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2326
1211
|
}
|
|
2327
1212
|
|
|
2328
1213
|
const query_params = {};
|
|
@@ -2347,32 +1232,13 @@ class Cart {
|
|
|
2347
1232
|
responseData = response[0];
|
|
2348
1233
|
}
|
|
2349
1234
|
|
|
2350
|
-
const {
|
|
2351
|
-
error: res_error,
|
|
2352
|
-
} = CartApplicationModel.SharedCartResult().validate(responseData, {
|
|
2353
|
-
abortEarly: false,
|
|
2354
|
-
allowUnknown: true,
|
|
2355
|
-
});
|
|
2356
|
-
|
|
2357
|
-
if (res_error) {
|
|
2358
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
2359
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2360
|
-
} else {
|
|
2361
|
-
Logger({
|
|
2362
|
-
level: "WARN",
|
|
2363
|
-
message: `Response Validation Warnings for application > Cart > updateCartWithSharedItems \n ${res_error}`,
|
|
2364
|
-
});
|
|
2365
|
-
}
|
|
2366
|
-
}
|
|
2367
|
-
|
|
2368
1235
|
return response;
|
|
2369
1236
|
}
|
|
2370
1237
|
|
|
2371
1238
|
/**
|
|
2372
|
-
* @param {CartApplicationValidator.ValidateCouponForPaymentParam} arg - Arg object.
|
|
2373
1239
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2374
1240
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2375
|
-
* @returns {Promise<
|
|
1241
|
+
* @returns {Promise<PaymentCouponValidate>} - Success response
|
|
2376
1242
|
* @name validateCouponForPayment
|
|
2377
1243
|
* @summary: Validate applied coupon
|
|
2378
1244
|
* @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/).
|
|
@@ -2395,56 +1261,6 @@ class Cart {
|
|
|
2395
1261
|
} = { requestHeaders: {} },
|
|
2396
1262
|
{ responseHeaders } = { responseHeaders: false }
|
|
2397
1263
|
) {
|
|
2398
|
-
const {
|
|
2399
|
-
error,
|
|
2400
|
-
} = CartApplicationValidator.validateCouponForPayment().validate(
|
|
2401
|
-
{
|
|
2402
|
-
id,
|
|
2403
|
-
buyNow,
|
|
2404
|
-
addressId,
|
|
2405
|
-
paymentMode,
|
|
2406
|
-
paymentIdentifier,
|
|
2407
|
-
aggregatorName,
|
|
2408
|
-
merchantCode,
|
|
2409
|
-
iin,
|
|
2410
|
-
network,
|
|
2411
|
-
type,
|
|
2412
|
-
cardId,
|
|
2413
|
-
cartType,
|
|
2414
|
-
},
|
|
2415
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2416
|
-
);
|
|
2417
|
-
if (error) {
|
|
2418
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2419
|
-
}
|
|
2420
|
-
|
|
2421
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2422
|
-
const {
|
|
2423
|
-
error: warrning,
|
|
2424
|
-
} = CartApplicationValidator.validateCouponForPayment().validate(
|
|
2425
|
-
{
|
|
2426
|
-
id,
|
|
2427
|
-
buyNow,
|
|
2428
|
-
addressId,
|
|
2429
|
-
paymentMode,
|
|
2430
|
-
paymentIdentifier,
|
|
2431
|
-
aggregatorName,
|
|
2432
|
-
merchantCode,
|
|
2433
|
-
iin,
|
|
2434
|
-
network,
|
|
2435
|
-
type,
|
|
2436
|
-
cardId,
|
|
2437
|
-
cartType,
|
|
2438
|
-
},
|
|
2439
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2440
|
-
);
|
|
2441
|
-
if (warrning) {
|
|
2442
|
-
Logger({
|
|
2443
|
-
level: "WARN",
|
|
2444
|
-
message: `Parameter Validation warrnings for application > Cart > validateCouponForPayment \n ${warrning}`,
|
|
2445
|
-
});
|
|
2446
|
-
}
|
|
2447
|
-
|
|
2448
1264
|
const query_params = {};
|
|
2449
1265
|
query_params["id"] = id;
|
|
2450
1266
|
query_params["buy_now"] = buyNow;
|
|
@@ -2479,24 +1295,6 @@ class Cart {
|
|
|
2479
1295
|
responseData = response[0];
|
|
2480
1296
|
}
|
|
2481
1297
|
|
|
2482
|
-
const {
|
|
2483
|
-
error: res_error,
|
|
2484
|
-
} = CartApplicationModel.PaymentCouponValidate().validate(responseData, {
|
|
2485
|
-
abortEarly: false,
|
|
2486
|
-
allowUnknown: true,
|
|
2487
|
-
});
|
|
2488
|
-
|
|
2489
|
-
if (res_error) {
|
|
2490
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
2491
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2492
|
-
} else {
|
|
2493
|
-
Logger({
|
|
2494
|
-
level: "WARN",
|
|
2495
|
-
message: `Response Validation Warnings for application > Cart > validateCouponForPayment \n ${res_error}`,
|
|
2496
|
-
});
|
|
2497
|
-
}
|
|
2498
|
-
}
|
|
2499
|
-
|
|
2500
1298
|
return response;
|
|
2501
1299
|
}
|
|
2502
1300
|
}
|