@gofynd/fdk-client-javascript 1.1.6 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/index.js +0 -3
- package/package.json +1 -1
- package/sdk/application/ApplicationAPIClient.d.ts +15 -1
- package/sdk/application/ApplicationAPIClient.js +8 -1
- package/sdk/application/ApplicationClient.d.ts +37 -6
- package/sdk/application/ApplicationClient.js +31 -0
- package/sdk/application/ApplicationConfig.d.ts +52 -12
- package/sdk/application/ApplicationConfig.js +37 -2
- package/sdk/application/ApplicationModels.d.ts +46 -1
- package/sdk/application/ApplicationModels.js +18 -0
- package/sdk/application/Cart/CartApplicationClient.d.ts +172 -357
- package/sdk/application/Cart/CartApplicationClient.js +620 -483
- package/sdk/application/Cart/CartApplicationModel.d.ts +2054 -96
- package/sdk/application/Cart/CartApplicationModel.js +1224 -93
- package/sdk/application/Cart/CartApplicationValidator.d.ts +508 -30
- package/sdk/application/Cart/CartApplicationValidator.js +270 -15
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +234 -413
- package/sdk/application/Catalog/CatalogApplicationClient.js +777 -630
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +2218 -117
- package/sdk/application/Catalog/CatalogApplicationModel.js +1499 -170
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +798 -31
- package/sdk/application/Catalog/CatalogApplicationValidator.js +318 -3
- package/sdk/application/Common/CommonApplicationClient.d.ts +14 -21
- package/sdk/application/Common/CommonApplicationClient.js +50 -33
- package/sdk/application/Common/CommonApplicationModel.d.ts +448 -19
- package/sdk/application/Common/CommonApplicationModel.js +224 -16
- package/sdk/application/Common/CommonApplicationValidator.d.ts +42 -4
- package/sdk/application/Common/CommonApplicationValidator.js +21 -3
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +25 -18
- package/sdk/application/Communication/CommunicationApplicationClient.js +74 -47
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +190 -14
- package/sdk/application/Communication/CommunicationApplicationModel.js +124 -7
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +27 -4
- package/sdk/application/Communication/CommunicationApplicationValidator.js +21 -5
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +113 -112
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +381 -260
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +2453 -110
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +1254 -108
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +160 -8
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +88 -4
- package/sdk/application/Content/ContentApplicationClient.d.ts +120 -138
- package/sdk/application/Content/ContentApplicationClient.js +409 -277
- package/sdk/application/Content/ContentApplicationModel.d.ts +1627 -105
- package/sdk/application/Content/ContentApplicationModel.js +1202 -109
- package/sdk/application/Content/ContentApplicationValidator.d.ts +214 -12
- package/sdk/application/Content/ContentApplicationValidator.js +113 -3
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +20 -29
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +68 -47
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +299 -20
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +209 -16
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +55 -5
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +33 -6
- package/sdk/application/Lead/LeadApplicationClient.d.ts +50 -53
- package/sdk/application/Lead/LeadApplicationClient.js +169 -103
- package/sdk/application/Lead/LeadApplicationModel.d.ts +1405 -54
- package/sdk/application/Lead/LeadApplicationModel.js +619 -73
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +91 -9
- package/sdk/application/Lead/LeadApplicationValidator.js +51 -6
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +34 -33
- package/sdk/application/Logistic/LogisticApplicationClient.js +110 -73
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +399 -28
- package/sdk/application/Logistic/LogisticApplicationModel.js +293 -24
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +48 -6
- package/sdk/application/Logistic/LogisticApplicationValidator.js +34 -6
- package/sdk/application/Order/OrderApplicationClient.d.ts +81 -133
- package/sdk/application/Order/OrderApplicationClient.js +297 -217
- package/sdk/application/Order/OrderApplicationModel.d.ts +1101 -66
- package/sdk/application/Order/OrderApplicationModel.js +776 -57
- package/sdk/application/Order/OrderApplicationValidator.d.ts +249 -14
- package/sdk/application/Order/OrderApplicationValidator.js +114 -5
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +341 -356
- package/sdk/application/Payment/PaymentApplicationClient.js +1077 -703
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +3125 -99
- package/sdk/application/Payment/PaymentApplicationModel.js +1158 -62
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +494 -41
- package/sdk/application/Payment/PaymentApplicationValidator.js +297 -25
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +178 -350
- package/sdk/application/PosCart/PosCartApplicationClient.js +636 -491
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1823 -89
- package/sdk/application/PosCart/PosCartApplicationModel.js +1117 -85
- package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +480 -29
- package/sdk/application/PosCart/PosCartApplicationValidator.js +262 -15
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +49 -47
- package/sdk/application/Rewards/RewardsApplicationClient.js +160 -102
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +343 -22
- package/sdk/application/Rewards/RewardsApplicationModel.js +230 -15
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +70 -7
- package/sdk/application/Rewards/RewardsApplicationValidator.js +45 -6
- package/sdk/application/Share/ShareApplicationClient.d.ts +44 -50
- package/sdk/application/Share/ShareApplicationClient.js +165 -97
- package/sdk/application/Share/ShareApplicationModel.d.ts +230 -15
- package/sdk/application/Share/ShareApplicationModel.js +154 -16
- package/sdk/application/Share/ShareApplicationValidator.d.ts +86 -8
- package/sdk/application/Share/ShareApplicationValidator.js +48 -4
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +25 -27
- package/sdk/application/Theme/ThemeApplicationClient.js +83 -54
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +621 -48
- package/sdk/application/Theme/ThemeApplicationModel.js +464 -40
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +49 -5
- package/sdk/application/Theme/ThemeApplicationValidator.js +26 -3
- package/sdk/application/User/UserApplicationClient.d.ts +219 -303
- package/sdk/application/User/UserApplicationClient.js +819 -522
- package/sdk/application/User/UserApplicationModel.d.ts +1390 -101
- package/sdk/application/User/UserApplicationModel.js +983 -44
- package/sdk/application/User/UserApplicationValidator.d.ts +457 -33
- package/sdk/application/User/UserApplicationValidator.js +265 -31
- package/sdk/common/AxiosHelper.js +8 -2
- package/sdk/common/Paginator.d.ts +27 -12
- package/sdk/common/Paginator.js +15 -0
- package/sdk/common/RequestSigner.js +0 -1
- package/sdk/partner/PartnerAPIClient.d.ts +15 -1
- package/sdk/partner/PartnerAPIClient.js +8 -1
- package/sdk/partner/PartnerClient.d.ts +20 -3
- package/sdk/partner/PartnerClient.js +17 -0
- package/sdk/partner/PartnerConfig.d.ts +40 -14
- package/sdk/partner/PartnerConfig.js +31 -6
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +26 -25
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +82 -53
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +202 -17
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +139 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +42 -5
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +26 -4
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +88 -97
- package/sdk/platform/Billing/BillingPlatformClient.js +310 -191
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +1211 -68
- package/sdk/platform/Billing/BillingPlatformModel.js +824 -59
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +153 -12
- package/sdk/platform/Billing/BillingPlatformValidator.js +87 -8
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +392 -634
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +1480 -957
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +827 -57
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +492 -34
- package/sdk/platform/Cart/CartPlatformModel.d.ts +3639 -175
- package/sdk/platform/Cart/CartPlatformModel.js +2368 -212
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +438 -615
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1449 -984
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +1081 -49
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +482 -23
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +573 -824
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1773 -1264
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +6871 -326
- package/sdk/platform/Catalog/CatalogPlatformModel.js +4215 -349
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +1331 -71
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +611 -30
- package/sdk/platform/Common/CommonPlatformClient.d.ts +14 -21
- package/sdk/platform/Common/CommonPlatformClient.js +48 -33
- package/sdk/platform/Common/CommonPlatformModel.d.ts +448 -19
- package/sdk/platform/Common/CommonPlatformModel.js +224 -16
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +42 -4
- package/sdk/platform/Common/CommonPlatformValidator.js +21 -3
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +457 -279
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1423 -553
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +581 -42
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +294 -22
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +18 -5
- package/sdk/platform/Communication/CommunicationPlatformClient.js +58 -19
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1630 -102
- package/sdk/platform/Communication/CommunicationPlatformModel.js +1150 -85
- package/sdk/platform/Communication/CommunicationPlatformValidator.d.ts +16 -3
- package/sdk/platform/Communication/CommunicationPlatformValidator.js +11 -3
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +102 -111
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +321 -225
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +830 -43
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +612 -78
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +180 -13
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +98 -10
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +232 -212
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +737 -438
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +293 -22
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +184 -17
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +166 -178
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +519 -310
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +4504 -188
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2242 -204
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +332 -19
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +153 -10
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +495 -560
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1777 -987
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +872 -62
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +487 -35
- package/sdk/platform/Content/ContentPlatformModel.d.ts +1661 -108
- package/sdk/platform/Content/ContentPlatformModel.js +1217 -113
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +67 -101
- package/sdk/platform/Discount/DiscountPlatformClient.js +240 -176
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +242 -15
- package/sdk/platform/Discount/DiscountPlatformModel.js +162 -10
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +185 -13
- package/sdk/platform/Discount/DiscountPlatformValidator.js +88 -8
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +32 -41
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +106 -74
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +77 -6
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +41 -6
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +39 -54
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +124 -99
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +299 -20
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +207 -16
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +98 -8
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +54 -7
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +85 -91
- package/sdk/platform/Finance/FinancePlatformClient.js +272 -180
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +619 -50
- package/sdk/platform/Finance/FinancePlatformModel.js +458 -30
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +123 -15
- package/sdk/platform/Finance/FinancePlatformValidator.js +95 -16
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +99 -97
- package/sdk/platform/Inventory/InventoryPlatformClient.js +288 -199
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +1354 -61
- package/sdk/platform/Inventory/InventoryPlatformModel.js +916 -83
- package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +168 -12
- package/sdk/platform/Inventory/InventoryPlatformValidator.js +82 -6
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +86 -106
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +326 -186
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +180 -14
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +94 -9
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +75 -101
- package/sdk/platform/Lead/LeadPlatformClient.js +240 -174
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +1403 -54
- package/sdk/platform/Lead/LeadPlatformModel.js +618 -73
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +173 -12
- package/sdk/platform/Lead/LeadPlatformValidator.js +85 -8
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +18 -14
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +56 -29
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +26 -4
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +16 -3
- package/sdk/platform/Order/OrderPlatformClient.d.ts +343 -556
- package/sdk/platform/Order/OrderPlatformClient.js +969 -762
- package/sdk/platform/Order/OrderPlatformModel.d.ts +4967 -247
- package/sdk/platform/Order/OrderPlatformModel.js +3249 -259
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +758 -37
- package/sdk/platform/Order/OrderPlatformValidator.js +351 -22
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +28 -36
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +103 -59
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +66 -6
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +32 -4
- package/sdk/platform/Partner/PartnerPlatformClient.d.ts +68 -107
- package/sdk/platform/Partner/PartnerPlatformClient.js +253 -174
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +767 -45
- package/sdk/platform/Partner/PartnerPlatformModel.js +524 -41
- package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +207 -13
- package/sdk/platform/Partner/PartnerPlatformValidator.js +87 -5
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +255 -260
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +860 -504
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +348 -30
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +221 -19
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +73 -73
- package/sdk/platform/Payment/PaymentPlatformClient.js +238 -154
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2658 -93
- package/sdk/platform/Payment/PaymentPlatformModel.js +1035 -36
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +111 -11
- package/sdk/platform/Payment/PaymentPlatformValidator.js +68 -7
- package/sdk/platform/PlatformAPIClient.d.ts +16 -1
- package/sdk/platform/PlatformAPIClient.js +9 -1
- package/sdk/platform/PlatformApplicationClient.d.ts +22 -1798
- package/sdk/platform/PlatformApplicationClient.js +17 -1899
- package/sdk/platform/PlatformClient.d.ts +29 -12579
- package/sdk/platform/PlatformClient.js +26 -15085
- package/sdk/platform/PlatformConfig.d.ts +37 -11
- package/sdk/platform/PlatformConfig.js +32 -6
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +80 -92
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +307 -177
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +149 -12
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +82 -8
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +371 -23
- package/sdk/platform/Rewards/RewardsPlatformModel.js +246 -16
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +120 -89
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +349 -201
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +128 -12
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +85 -11
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +148 -178
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +454 -329
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1399 -96
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1022 -71
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +280 -18
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +134 -11
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +38 -47
- package/sdk/platform/Share/SharePlatformApplicationClient.js +137 -73
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +87 -7
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +42 -5
- package/sdk/platform/Share/SharePlatformModel.d.ts +250 -16
- package/sdk/platform/Share/SharePlatformModel.js +165 -17
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +149 -183
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +579 -330
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +308 -24
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +162 -10
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +621 -48
- package/sdk/platform/Theme/ThemePlatformModel.js +464 -40
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +119 -151
- package/sdk/platform/User/UserPlatformApplicationClient.js +411 -244
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +235 -18
- package/sdk/platform/User/UserPlatformApplicationValidator.js +126 -12
- package/sdk/platform/User/UserPlatformModel.d.ts +1390 -101
- package/sdk/platform/User/UserPlatformModel.js +983 -44
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +38 -47
- package/sdk/platform/Webhook/WebhookPlatformClient.js +137 -87
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +242 -16
- package/sdk/platform/Webhook/WebhookPlatformModel.js +167 -18
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +83 -7
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +43 -5
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +14 -21
- package/sdk/public/Configuration/ConfigurationPublicClient.js +46 -33
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +473 -19
- package/sdk/public/Configuration/ConfigurationPublicModel.js +224 -16
- package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +42 -4
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +21 -3
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +48 -48
- package/sdk/public/Inventory/InventoryPublicClient.js +146 -98
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +392 -21
- package/sdk/public/Inventory/InventoryPublicModel.js +267 -27
- package/sdk/public/Inventory/InventoryPublicValidator.d.ts +90 -8
- package/sdk/public/Inventory/InventoryPublicValidator.js +44 -4
- package/sdk/public/PublicClient.d.ts +19 -3
- package/sdk/public/PublicClient.js +16 -0
- package/sdk/public/PublicConfig.d.ts +27 -6
- package/sdk/public/PublicConfig.js +17 -1
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +13 -11
- package/sdk/public/Webhook/WebhookPublicClient.js +42 -27
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +242 -16
- package/sdk/public/Webhook/WebhookPublicModel.js +167 -18
- package/sdk/public/Webhook/WebhookPublicValidator.d.ts +18 -3
- package/sdk/public/Webhook/WebhookPublicValidator.js +14 -4
|
@@ -2,8 +2,8 @@ const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
|
2
2
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
3
|
const constructUrl = require("../constructUrl");
|
|
4
4
|
const Paginator = require("../../common/Paginator");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const PosCartApplicationValidator = require("./PosCartApplicationValidator");
|
|
6
|
+
const PosCartApplicationModel = require("./PosCartApplicationModel");
|
|
7
7
|
const { Logger } = require("./../../common/Logger");
|
|
8
8
|
const Joi = require("joi");
|
|
9
9
|
|
|
@@ -60,14 +60,15 @@ class PosCart {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
|
-
* @param {
|
|
64
|
-
* @param {
|
|
65
|
-
* @returns {Promise<SaveAddressResponse>} - Success response
|
|
63
|
+
* @param {PosCartApplicationValidator.AddAddressParam} arg - Arg object.
|
|
64
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
65
|
+
* @returns {Promise<PosCartApplicationModel.SaveAddressResponse>} - Success response
|
|
66
|
+
* @name addAddress
|
|
66
67
|
* @summary: Add address to an account
|
|
67
|
-
* @description: Use this API to add an address to an account.
|
|
68
|
+
* @description: Use this API to add an address to an account. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/addAddress/).
|
|
68
69
|
*/
|
|
69
|
-
async addAddress({ body } = {}) {
|
|
70
|
-
const { error } =
|
|
70
|
+
async addAddress({ body } = {}, { headers } = { headers: false }) {
|
|
71
|
+
const { error } = PosCartApplicationValidator.addAddress().validate(
|
|
71
72
|
{ body },
|
|
72
73
|
{ abortEarly: false, allowUnknown: true }
|
|
73
74
|
);
|
|
@@ -76,16 +77,17 @@ class PosCart {
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
// Showing warrnings if extra unknown parameters are found
|
|
79
|
-
const {
|
|
80
|
+
const {
|
|
81
|
+
error: warrning,
|
|
82
|
+
} = PosCartApplicationValidator.addAddress().validate(
|
|
80
83
|
{ body },
|
|
81
84
|
{ abortEarly: false, allowUnknown: false }
|
|
82
85
|
);
|
|
83
86
|
if (warrning) {
|
|
84
87
|
Logger({
|
|
85
88
|
level: "WARN",
|
|
86
|
-
message:
|
|
89
|
+
message: `Parameter Validation warrnings for application > PosCart > addAddress \n ${warrning}`,
|
|
87
90
|
});
|
|
88
|
-
Logger({ level: "WARN", message: warrning });
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
const query_params = {};
|
|
@@ -101,12 +103,18 @@ class PosCart {
|
|
|
101
103
|
}),
|
|
102
104
|
query_params,
|
|
103
105
|
body,
|
|
104
|
-
xHeaders
|
|
106
|
+
xHeaders,
|
|
107
|
+
{ headers }
|
|
105
108
|
);
|
|
106
109
|
|
|
110
|
+
let responseData = response;
|
|
111
|
+
if (headers) {
|
|
112
|
+
responseData = response[0];
|
|
113
|
+
}
|
|
114
|
+
|
|
107
115
|
const {
|
|
108
116
|
error: res_error,
|
|
109
|
-
} =
|
|
117
|
+
} = PosCartApplicationModel.SaveAddressResponse().validate(responseData, {
|
|
110
118
|
abortEarly: false,
|
|
111
119
|
allowUnknown: false,
|
|
112
120
|
});
|
|
@@ -114,28 +122,27 @@ class PosCart {
|
|
|
114
122
|
if (res_error) {
|
|
115
123
|
Logger({
|
|
116
124
|
level: "WARN",
|
|
117
|
-
message:
|
|
125
|
+
message: `Response Validation Warnnings for application > PosCart > addAddress \n ${res_error}`,
|
|
118
126
|
});
|
|
119
|
-
Logger({ level: "WARN", message: res_error });
|
|
120
127
|
}
|
|
121
128
|
|
|
122
129
|
return response;
|
|
123
130
|
}
|
|
124
131
|
|
|
125
132
|
/**
|
|
126
|
-
* @param {
|
|
127
|
-
* @param {
|
|
128
|
-
* @
|
|
129
|
-
*
|
|
130
|
-
* @
|
|
131
|
-
* @param {string} [arg.id] -
|
|
132
|
-
* @param {AddCartRequest} arg.body
|
|
133
|
-
* @returns {Promise<AddCartDetailResponse>} - Success response
|
|
133
|
+
* @param {PosCartApplicationValidator.AddItemsParam} arg - Arg object.
|
|
134
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
135
|
+
* @returns {Promise<PosCartApplicationModel.AddCartDetailResponse>} -
|
|
136
|
+
* Success response
|
|
137
|
+
* @name addItems
|
|
134
138
|
* @summary: Add items to cart
|
|
135
|
-
* @description: Use this API to add items to the cart.
|
|
139
|
+
* @description: Use this API to add items to the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/addItems/).
|
|
136
140
|
*/
|
|
137
|
-
async addItems(
|
|
138
|
-
|
|
141
|
+
async addItems(
|
|
142
|
+
{ body, i, b, areaCode, buyNow, id } = {},
|
|
143
|
+
{ headers } = { headers: false }
|
|
144
|
+
) {
|
|
145
|
+
const { error } = PosCartApplicationValidator.addItems().validate(
|
|
139
146
|
{ body, i, b, areaCode, buyNow, id },
|
|
140
147
|
{ abortEarly: false, allowUnknown: true }
|
|
141
148
|
);
|
|
@@ -144,16 +151,15 @@ class PosCart {
|
|
|
144
151
|
}
|
|
145
152
|
|
|
146
153
|
// Showing warrnings if extra unknown parameters are found
|
|
147
|
-
const { error: warrning } =
|
|
154
|
+
const { error: warrning } = PosCartApplicationValidator.addItems().validate(
|
|
148
155
|
{ body, i, b, areaCode, buyNow, id },
|
|
149
156
|
{ abortEarly: false, allowUnknown: false }
|
|
150
157
|
);
|
|
151
158
|
if (warrning) {
|
|
152
159
|
Logger({
|
|
153
160
|
level: "WARN",
|
|
154
|
-
message:
|
|
161
|
+
message: `Parameter Validation warrnings for application > PosCart > addItems \n ${warrning}`,
|
|
155
162
|
});
|
|
156
|
-
Logger({ level: "WARN", message: warrning });
|
|
157
163
|
}
|
|
158
164
|
|
|
159
165
|
const query_params = {};
|
|
@@ -174,12 +180,18 @@ class PosCart {
|
|
|
174
180
|
}),
|
|
175
181
|
query_params,
|
|
176
182
|
body,
|
|
177
|
-
xHeaders
|
|
183
|
+
xHeaders,
|
|
184
|
+
{ headers }
|
|
178
185
|
);
|
|
179
186
|
|
|
187
|
+
let responseData = response;
|
|
188
|
+
if (headers) {
|
|
189
|
+
responseData = response[0];
|
|
190
|
+
}
|
|
191
|
+
|
|
180
192
|
const {
|
|
181
193
|
error: res_error,
|
|
182
|
-
} =
|
|
194
|
+
} = PosCartApplicationModel.AddCartDetailResponse().validate(responseData, {
|
|
183
195
|
abortEarly: false,
|
|
184
196
|
allowUnknown: false,
|
|
185
197
|
});
|
|
@@ -187,28 +199,26 @@ class PosCart {
|
|
|
187
199
|
if (res_error) {
|
|
188
200
|
Logger({
|
|
189
201
|
level: "WARN",
|
|
190
|
-
message:
|
|
202
|
+
message: `Response Validation Warnnings for application > PosCart > addItems \n ${res_error}`,
|
|
191
203
|
});
|
|
192
|
-
Logger({ level: "WARN", message: res_error });
|
|
193
204
|
}
|
|
194
205
|
|
|
195
206
|
return response;
|
|
196
207
|
}
|
|
197
208
|
|
|
198
209
|
/**
|
|
199
|
-
* @param {
|
|
200
|
-
* @param {
|
|
201
|
-
* @
|
|
202
|
-
* @
|
|
203
|
-
* @param {string} [arg.id] -
|
|
204
|
-
* @param {boolean} [arg.buyNow] -
|
|
205
|
-
* @param {ApplyCouponRequest} arg.body
|
|
206
|
-
* @returns {Promise<CartDetailResponse>} - Success response
|
|
210
|
+
* @param {PosCartApplicationValidator.ApplyCouponParam} arg - Arg object.
|
|
211
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
212
|
+
* @returns {Promise<PosCartApplicationModel.CartDetailResponse>} - Success response
|
|
213
|
+
* @name applyCoupon
|
|
207
214
|
* @summary: Apply Coupon
|
|
208
|
-
* @description: Use this API to apply coupons on items in the cart.
|
|
215
|
+
* @description: Use this API to apply coupons on items in the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/applyCoupon/).
|
|
209
216
|
*/
|
|
210
|
-
async applyCoupon(
|
|
211
|
-
|
|
217
|
+
async applyCoupon(
|
|
218
|
+
{ body, i, b, p, id, buyNow } = {},
|
|
219
|
+
{ headers } = { headers: false }
|
|
220
|
+
) {
|
|
221
|
+
const { error } = PosCartApplicationValidator.applyCoupon().validate(
|
|
212
222
|
{ body, i, b, p, id, buyNow },
|
|
213
223
|
{ abortEarly: false, allowUnknown: true }
|
|
214
224
|
);
|
|
@@ -217,16 +227,17 @@ class PosCart {
|
|
|
217
227
|
}
|
|
218
228
|
|
|
219
229
|
// Showing warrnings if extra unknown parameters are found
|
|
220
|
-
const {
|
|
230
|
+
const {
|
|
231
|
+
error: warrning,
|
|
232
|
+
} = PosCartApplicationValidator.applyCoupon().validate(
|
|
221
233
|
{ body, i, b, p, id, buyNow },
|
|
222
234
|
{ abortEarly: false, allowUnknown: false }
|
|
223
235
|
);
|
|
224
236
|
if (warrning) {
|
|
225
237
|
Logger({
|
|
226
238
|
level: "WARN",
|
|
227
|
-
message:
|
|
239
|
+
message: `Parameter Validation warrnings for application > PosCart > applyCoupon \n ${warrning}`,
|
|
228
240
|
});
|
|
229
|
-
Logger({ level: "WARN", message: warrning });
|
|
230
241
|
}
|
|
231
242
|
|
|
232
243
|
const query_params = {};
|
|
@@ -247,12 +258,18 @@ class PosCart {
|
|
|
247
258
|
}),
|
|
248
259
|
query_params,
|
|
249
260
|
body,
|
|
250
|
-
xHeaders
|
|
261
|
+
xHeaders,
|
|
262
|
+
{ headers }
|
|
251
263
|
);
|
|
252
264
|
|
|
265
|
+
let responseData = response;
|
|
266
|
+
if (headers) {
|
|
267
|
+
responseData = response[0];
|
|
268
|
+
}
|
|
269
|
+
|
|
253
270
|
const {
|
|
254
271
|
error: res_error,
|
|
255
|
-
} =
|
|
272
|
+
} = PosCartApplicationModel.CartDetailResponse().validate(responseData, {
|
|
256
273
|
abortEarly: false,
|
|
257
274
|
allowUnknown: false,
|
|
258
275
|
});
|
|
@@ -260,27 +277,26 @@ class PosCart {
|
|
|
260
277
|
if (res_error) {
|
|
261
278
|
Logger({
|
|
262
279
|
level: "WARN",
|
|
263
|
-
message:
|
|
280
|
+
message: `Response Validation Warnnings for application > PosCart > applyCoupon \n ${res_error}`,
|
|
264
281
|
});
|
|
265
|
-
Logger({ level: "WARN", message: res_error });
|
|
266
282
|
}
|
|
267
283
|
|
|
268
284
|
return response;
|
|
269
285
|
}
|
|
270
286
|
|
|
271
287
|
/**
|
|
272
|
-
* @param {
|
|
273
|
-
* @param {
|
|
274
|
-
* @
|
|
275
|
-
* @
|
|
276
|
-
* @param {boolean} [arg.buyNow] -
|
|
277
|
-
* @param {RewardPointRequest} arg.body
|
|
278
|
-
* @returns {Promise<CartDetailResponse>} - Success response
|
|
288
|
+
* @param {PosCartApplicationValidator.ApplyRewardPointsParam} arg - Arg object.
|
|
289
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
290
|
+
* @returns {Promise<PosCartApplicationModel.CartDetailResponse>} - Success response
|
|
291
|
+
* @name applyRewardPoints
|
|
279
292
|
* @summary: Apply reward points at cart
|
|
280
|
-
* @description: Use this API to redeem a fixed no. of reward points by applying it to the cart.
|
|
293
|
+
* @description: Use this API to redeem a fixed no. of reward points by applying it to the cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/applyRewardPoints/).
|
|
281
294
|
*/
|
|
282
|
-
async applyRewardPoints(
|
|
283
|
-
|
|
295
|
+
async applyRewardPoints(
|
|
296
|
+
{ body, id, i, b, buyNow } = {},
|
|
297
|
+
{ headers } = { headers: false }
|
|
298
|
+
) {
|
|
299
|
+
const { error } = PosCartApplicationValidator.applyRewardPoints().validate(
|
|
284
300
|
{ body, id, i, b, buyNow },
|
|
285
301
|
{ abortEarly: false, allowUnknown: true }
|
|
286
302
|
);
|
|
@@ -289,16 +305,17 @@ class PosCart {
|
|
|
289
305
|
}
|
|
290
306
|
|
|
291
307
|
// Showing warrnings if extra unknown parameters are found
|
|
292
|
-
const {
|
|
308
|
+
const {
|
|
309
|
+
error: warrning,
|
|
310
|
+
} = PosCartApplicationValidator.applyRewardPoints().validate(
|
|
293
311
|
{ body, id, i, b, buyNow },
|
|
294
312
|
{ abortEarly: false, allowUnknown: false }
|
|
295
313
|
);
|
|
296
314
|
if (warrning) {
|
|
297
315
|
Logger({
|
|
298
316
|
level: "WARN",
|
|
299
|
-
message:
|
|
317
|
+
message: `Parameter Validation warrnings for application > PosCart > applyRewardPoints \n ${warrning}`,
|
|
300
318
|
});
|
|
301
|
-
Logger({ level: "WARN", message: warrning });
|
|
302
319
|
}
|
|
303
320
|
|
|
304
321
|
const query_params = {};
|
|
@@ -318,12 +335,18 @@ class PosCart {
|
|
|
318
335
|
}),
|
|
319
336
|
query_params,
|
|
320
337
|
body,
|
|
321
|
-
xHeaders
|
|
338
|
+
xHeaders,
|
|
339
|
+
{ headers }
|
|
322
340
|
);
|
|
323
341
|
|
|
342
|
+
let responseData = response;
|
|
343
|
+
if (headers) {
|
|
344
|
+
responseData = response[0];
|
|
345
|
+
}
|
|
346
|
+
|
|
324
347
|
const {
|
|
325
348
|
error: res_error,
|
|
326
|
-
} =
|
|
349
|
+
} = PosCartApplicationModel.CartDetailResponse().validate(responseData, {
|
|
327
350
|
abortEarly: false,
|
|
328
351
|
allowUnknown: false,
|
|
329
352
|
});
|
|
@@ -331,24 +354,23 @@ class PosCart {
|
|
|
331
354
|
if (res_error) {
|
|
332
355
|
Logger({
|
|
333
356
|
level: "WARN",
|
|
334
|
-
message:
|
|
357
|
+
message: `Response Validation Warnnings for application > PosCart > applyRewardPoints \n ${res_error}`,
|
|
335
358
|
});
|
|
336
|
-
Logger({ level: "WARN", message: res_error });
|
|
337
359
|
}
|
|
338
360
|
|
|
339
361
|
return response;
|
|
340
362
|
}
|
|
341
363
|
|
|
342
364
|
/**
|
|
343
|
-
* @param {
|
|
344
|
-
* @param {
|
|
345
|
-
* @
|
|
346
|
-
* @
|
|
365
|
+
* @param {PosCartApplicationValidator.CheckoutCartParam} arg - Arg object.
|
|
366
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
367
|
+
* @returns {Promise<PosCartApplicationModel.CartCheckoutResponse>} - Success response
|
|
368
|
+
* @name checkoutCart
|
|
347
369
|
* @summary: Checkout all items in the cart
|
|
348
|
-
* @description: Use this API to checkout all items in the cart for payment and order generation. For COD, order will be generated directly, whereas for other checkout modes, user will be redirected to a payment gateway.
|
|
370
|
+
* @description: Use this API to checkout all items in the cart for payment and order generation. For COD, order will be generated directly, whereas for other checkout modes, user will be redirected to a payment gateway. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/checkoutCart/).
|
|
349
371
|
*/
|
|
350
|
-
async checkoutCart({ body, id } = {}) {
|
|
351
|
-
const { error } =
|
|
372
|
+
async checkoutCart({ body, id } = {}, { headers } = { headers: false }) {
|
|
373
|
+
const { error } = PosCartApplicationValidator.checkoutCart().validate(
|
|
352
374
|
{ body, id },
|
|
353
375
|
{ abortEarly: false, allowUnknown: true }
|
|
354
376
|
);
|
|
@@ -357,16 +379,17 @@ class PosCart {
|
|
|
357
379
|
}
|
|
358
380
|
|
|
359
381
|
// Showing warrnings if extra unknown parameters are found
|
|
360
|
-
const {
|
|
382
|
+
const {
|
|
383
|
+
error: warrning,
|
|
384
|
+
} = PosCartApplicationValidator.checkoutCart().validate(
|
|
361
385
|
{ body, id },
|
|
362
386
|
{ abortEarly: false, allowUnknown: false }
|
|
363
387
|
);
|
|
364
388
|
if (warrning) {
|
|
365
389
|
Logger({
|
|
366
390
|
level: "WARN",
|
|
367
|
-
message:
|
|
391
|
+
message: `Parameter Validation warrnings for application > PosCart > checkoutCart \n ${warrning}`,
|
|
368
392
|
});
|
|
369
|
-
Logger({ level: "WARN", message: warrning });
|
|
370
393
|
}
|
|
371
394
|
|
|
372
395
|
const query_params = {};
|
|
@@ -383,12 +406,18 @@ class PosCart {
|
|
|
383
406
|
}),
|
|
384
407
|
query_params,
|
|
385
408
|
body,
|
|
386
|
-
xHeaders
|
|
409
|
+
xHeaders,
|
|
410
|
+
{ headers }
|
|
387
411
|
);
|
|
388
412
|
|
|
413
|
+
let responseData = response;
|
|
414
|
+
if (headers) {
|
|
415
|
+
responseData = response[0];
|
|
416
|
+
}
|
|
417
|
+
|
|
389
418
|
const {
|
|
390
419
|
error: res_error,
|
|
391
|
-
} =
|
|
420
|
+
} = PosCartApplicationModel.CartCheckoutResponse().validate(responseData, {
|
|
392
421
|
abortEarly: false,
|
|
393
422
|
allowUnknown: false,
|
|
394
423
|
});
|
|
@@ -396,37 +425,26 @@ class PosCart {
|
|
|
396
425
|
if (res_error) {
|
|
397
426
|
Logger({
|
|
398
427
|
level: "WARN",
|
|
399
|
-
message:
|
|
428
|
+
message: `Response Validation Warnnings for application > PosCart > checkoutCart \n ${res_error}`,
|
|
400
429
|
});
|
|
401
|
-
Logger({ level: "WARN", message: res_error });
|
|
402
430
|
}
|
|
403
431
|
|
|
404
432
|
return response;
|
|
405
433
|
}
|
|
406
434
|
|
|
407
435
|
/**
|
|
408
|
-
* @param {
|
|
409
|
-
* @param {
|
|
410
|
-
* @
|
|
411
|
-
* @
|
|
412
|
-
* @param {string} [arg.mobileNo] -
|
|
413
|
-
* @param {string} [arg.checkoutMode] -
|
|
414
|
-
* @param {string} [arg.tags] -
|
|
415
|
-
* @param {boolean} [arg.isDefault] -
|
|
416
|
-
* @returns {Promise<Address>} - Success response
|
|
436
|
+
* @param {PosCartApplicationValidator.GetAddressByIdParam} arg - Arg object.
|
|
437
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
438
|
+
* @returns {Promise<PosCartApplicationModel.Address>} - Success response
|
|
439
|
+
* @name getAddressById
|
|
417
440
|
* @summary: Fetch a single address by its ID
|
|
418
|
-
* @description: Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `Address`. Attibutes listed below are optional <ul> <li> <font color="monochrome">mobile_no</font></li> <li> <font color="monochrome">checkout_mode</font></li> <li> <font color="monochrome">tags</font></li> <li> <font color="monochrome">default</font></li> </ul>
|
|
441
|
+
* @description: Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `Address`. Attibutes listed below are optional <ul> <li> <font color="monochrome">mobile_no</font></li> <li> <font color="monochrome">checkout_mode</font></li> <li> <font color="monochrome">tags</font></li> <li> <font color="monochrome">default</font></li> </ul> - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getAddressById/).
|
|
419
442
|
*/
|
|
420
|
-
async getAddressById(
|
|
421
|
-
id,
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
checkoutMode,
|
|
426
|
-
tags,
|
|
427
|
-
isDefault,
|
|
428
|
-
} = {}) {
|
|
429
|
-
const { error } = PosCartValidator.getAddressById().validate(
|
|
443
|
+
async getAddressById(
|
|
444
|
+
{ id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault } = {},
|
|
445
|
+
{ headers } = { headers: false }
|
|
446
|
+
) {
|
|
447
|
+
const { error } = PosCartApplicationValidator.getAddressById().validate(
|
|
430
448
|
{ id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
|
|
431
449
|
{ abortEarly: false, allowUnknown: true }
|
|
432
450
|
);
|
|
@@ -435,16 +453,17 @@ class PosCart {
|
|
|
435
453
|
}
|
|
436
454
|
|
|
437
455
|
// Showing warrnings if extra unknown parameters are found
|
|
438
|
-
const {
|
|
456
|
+
const {
|
|
457
|
+
error: warrning,
|
|
458
|
+
} = PosCartApplicationValidator.getAddressById().validate(
|
|
439
459
|
{ id, cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
|
|
440
460
|
{ abortEarly: false, allowUnknown: false }
|
|
441
461
|
);
|
|
442
462
|
if (warrning) {
|
|
443
463
|
Logger({
|
|
444
464
|
level: "WARN",
|
|
445
|
-
message:
|
|
465
|
+
message: `Parameter Validation warrnings for application > PosCart > getAddressById \n ${warrning}`,
|
|
446
466
|
});
|
|
447
|
-
Logger({ level: "WARN", message: warrning });
|
|
448
467
|
}
|
|
449
468
|
|
|
450
469
|
const query_params = {};
|
|
@@ -466,10 +485,18 @@ class PosCart {
|
|
|
466
485
|
}),
|
|
467
486
|
query_params,
|
|
468
487
|
undefined,
|
|
469
|
-
xHeaders
|
|
488
|
+
xHeaders,
|
|
489
|
+
{ headers }
|
|
470
490
|
);
|
|
471
491
|
|
|
472
|
-
|
|
492
|
+
let responseData = response;
|
|
493
|
+
if (headers) {
|
|
494
|
+
responseData = response[0];
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
const {
|
|
498
|
+
error: res_error,
|
|
499
|
+
} = PosCartApplicationModel.Address().validate(responseData, {
|
|
473
500
|
abortEarly: false,
|
|
474
501
|
allowUnknown: false,
|
|
475
502
|
});
|
|
@@ -477,35 +504,26 @@ class PosCart {
|
|
|
477
504
|
if (res_error) {
|
|
478
505
|
Logger({
|
|
479
506
|
level: "WARN",
|
|
480
|
-
message:
|
|
507
|
+
message: `Response Validation Warnnings for application > PosCart > getAddressById \n ${res_error}`,
|
|
481
508
|
});
|
|
482
|
-
Logger({ level: "WARN", message: res_error });
|
|
483
509
|
}
|
|
484
510
|
|
|
485
511
|
return response;
|
|
486
512
|
}
|
|
487
513
|
|
|
488
514
|
/**
|
|
489
|
-
* @param {
|
|
490
|
-
* @param {
|
|
491
|
-
* @
|
|
492
|
-
* @
|
|
493
|
-
* @param {string} [arg.checkoutMode] -
|
|
494
|
-
* @param {string} [arg.tags] -
|
|
495
|
-
* @param {boolean} [arg.isDefault] -
|
|
496
|
-
* @returns {Promise<GetAddressesResponse>} - Success response
|
|
515
|
+
* @param {PosCartApplicationValidator.GetAddressesParam} arg - Arg object.
|
|
516
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
517
|
+
* @returns {Promise<PosCartApplicationModel.GetAddressesResponse>} - Success response
|
|
518
|
+
* @name getAddresses
|
|
497
519
|
* @summary: Fetch address
|
|
498
|
-
* @description: Use this API to get all the addresses associated with an account. If successful, returns a Address resource in the response body specified in GetAddressesResponse.attibutes listed below are optional <ul> <li> <font color="monochrome">uid</font></li> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">mobile_no</font></li> <li> <font color="monochrome">checkout_mode</font></li> <li> <font color="monochrome">tags</font></li> <li> <font color="monochrome">default</font></li> </ul>
|
|
520
|
+
* @description: Use this API to get all the addresses associated with an account. If successful, returns a Address resource in the response body specified in GetAddressesResponse.attibutes listed below are optional <ul> <li> <font color="monochrome">uid</font></li> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">mobile_no</font></li> <li> <font color="monochrome">checkout_mode</font></li> <li> <font color="monochrome">tags</font></li> <li> <font color="monochrome">default</font></li> </ul> - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getAddresses/).
|
|
499
521
|
*/
|
|
500
|
-
async getAddresses(
|
|
501
|
-
cartId,
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
tags,
|
|
506
|
-
isDefault,
|
|
507
|
-
} = {}) {
|
|
508
|
-
const { error } = PosCartValidator.getAddresses().validate(
|
|
522
|
+
async getAddresses(
|
|
523
|
+
{ cartId, buyNow, mobileNo, checkoutMode, tags, isDefault } = {},
|
|
524
|
+
{ headers } = { headers: false }
|
|
525
|
+
) {
|
|
526
|
+
const { error } = PosCartApplicationValidator.getAddresses().validate(
|
|
509
527
|
{ cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
|
|
510
528
|
{ abortEarly: false, allowUnknown: true }
|
|
511
529
|
);
|
|
@@ -514,16 +532,17 @@ class PosCart {
|
|
|
514
532
|
}
|
|
515
533
|
|
|
516
534
|
// Showing warrnings if extra unknown parameters are found
|
|
517
|
-
const {
|
|
535
|
+
const {
|
|
536
|
+
error: warrning,
|
|
537
|
+
} = PosCartApplicationValidator.getAddresses().validate(
|
|
518
538
|
{ cartId, buyNow, mobileNo, checkoutMode, tags, isDefault },
|
|
519
539
|
{ abortEarly: false, allowUnknown: false }
|
|
520
540
|
);
|
|
521
541
|
if (warrning) {
|
|
522
542
|
Logger({
|
|
523
543
|
level: "WARN",
|
|
524
|
-
message:
|
|
544
|
+
message: `Parameter Validation warrnings for application > PosCart > getAddresses \n ${warrning}`,
|
|
525
545
|
});
|
|
526
|
-
Logger({ level: "WARN", message: warrning });
|
|
527
546
|
}
|
|
528
547
|
|
|
529
548
|
const query_params = {};
|
|
@@ -545,12 +564,18 @@ class PosCart {
|
|
|
545
564
|
}),
|
|
546
565
|
query_params,
|
|
547
566
|
undefined,
|
|
548
|
-
xHeaders
|
|
567
|
+
xHeaders,
|
|
568
|
+
{ headers }
|
|
549
569
|
);
|
|
550
570
|
|
|
571
|
+
let responseData = response;
|
|
572
|
+
if (headers) {
|
|
573
|
+
responseData = response[0];
|
|
574
|
+
}
|
|
575
|
+
|
|
551
576
|
const {
|
|
552
577
|
error: res_error,
|
|
553
|
-
} =
|
|
578
|
+
} = PosCartApplicationModel.GetAddressesResponse().validate(responseData, {
|
|
554
579
|
abortEarly: false,
|
|
555
580
|
allowUnknown: false,
|
|
556
581
|
});
|
|
@@ -558,24 +583,31 @@ class PosCart {
|
|
|
558
583
|
if (res_error) {
|
|
559
584
|
Logger({
|
|
560
585
|
level: "WARN",
|
|
561
|
-
message:
|
|
586
|
+
message: `Response Validation Warnnings for application > PosCart > getAddresses \n ${res_error}`,
|
|
562
587
|
});
|
|
563
|
-
Logger({ level: "WARN", message: res_error });
|
|
564
588
|
}
|
|
565
589
|
|
|
566
590
|
return response;
|
|
567
591
|
}
|
|
568
592
|
|
|
569
593
|
/**
|
|
570
|
-
* @param {
|
|
571
|
-
*
|
|
572
|
-
*
|
|
573
|
-
* @
|
|
594
|
+
* @param {PosCartApplicationValidator.GetAvailableDeliveryModesParam} arg
|
|
595
|
+
* - Arg object.
|
|
596
|
+
*
|
|
597
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
598
|
+
* @returns {Promise<PosCartApplicationModel.CartDeliveryModesResponse>} -
|
|
599
|
+
* Success response
|
|
600
|
+
* @name getAvailableDeliveryModes
|
|
574
601
|
* @summary: Get available delivery modes for cart
|
|
575
|
-
* @description: Use this API to get the delivery modes (home-delivery/store-pickup) along with a list of pickup stores available for a given cart at a given PIN Code. User can then view the address of a pickup store with the help of store-address API.
|
|
602
|
+
* @description: Use this API to get the delivery modes (home-delivery/store-pickup) along with a list of pickup stores available for a given cart at a given PIN Code. User can then view the address of a pickup store with the help of store-address API. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getAvailableDeliveryModes/).
|
|
576
603
|
*/
|
|
577
|
-
async getAvailableDeliveryModes(
|
|
578
|
-
|
|
604
|
+
async getAvailableDeliveryModes(
|
|
605
|
+
{ areaCode, id } = {},
|
|
606
|
+
{ headers } = { headers: false }
|
|
607
|
+
) {
|
|
608
|
+
const {
|
|
609
|
+
error,
|
|
610
|
+
} = PosCartApplicationValidator.getAvailableDeliveryModes().validate(
|
|
579
611
|
{ areaCode, id },
|
|
580
612
|
{ abortEarly: false, allowUnknown: true }
|
|
581
613
|
);
|
|
@@ -586,16 +618,15 @@ class PosCart {
|
|
|
586
618
|
// Showing warrnings if extra unknown parameters are found
|
|
587
619
|
const {
|
|
588
620
|
error: warrning,
|
|
589
|
-
} =
|
|
621
|
+
} = PosCartApplicationValidator.getAvailableDeliveryModes().validate(
|
|
590
622
|
{ areaCode, id },
|
|
591
623
|
{ abortEarly: false, allowUnknown: false }
|
|
592
624
|
);
|
|
593
625
|
if (warrning) {
|
|
594
626
|
Logger({
|
|
595
627
|
level: "WARN",
|
|
596
|
-
message:
|
|
628
|
+
message: `Parameter Validation warrnings for application > PosCart > getAvailableDeliveryModes \n ${warrning}`,
|
|
597
629
|
});
|
|
598
|
-
Logger({ level: "WARN", message: warrning });
|
|
599
630
|
}
|
|
600
631
|
|
|
601
632
|
const query_params = {};
|
|
@@ -613,41 +644,47 @@ class PosCart {
|
|
|
613
644
|
}),
|
|
614
645
|
query_params,
|
|
615
646
|
undefined,
|
|
616
|
-
xHeaders
|
|
647
|
+
xHeaders,
|
|
648
|
+
{ headers }
|
|
617
649
|
);
|
|
618
650
|
|
|
651
|
+
let responseData = response;
|
|
652
|
+
if (headers) {
|
|
653
|
+
responseData = response[0];
|
|
654
|
+
}
|
|
655
|
+
|
|
619
656
|
const {
|
|
620
657
|
error: res_error,
|
|
621
|
-
} =
|
|
622
|
-
|
|
623
|
-
allowUnknown: false
|
|
624
|
-
|
|
658
|
+
} = PosCartApplicationModel.CartDeliveryModesResponse().validate(
|
|
659
|
+
responseData,
|
|
660
|
+
{ abortEarly: false, allowUnknown: false }
|
|
661
|
+
);
|
|
625
662
|
|
|
626
663
|
if (res_error) {
|
|
627
664
|
Logger({
|
|
628
665
|
level: "WARN",
|
|
629
|
-
message:
|
|
666
|
+
message: `Response Validation Warnnings for application > PosCart > getAvailableDeliveryModes \n ${res_error}`,
|
|
630
667
|
});
|
|
631
|
-
Logger({ level: "WARN", message: res_error });
|
|
632
668
|
}
|
|
633
669
|
|
|
634
670
|
return response;
|
|
635
671
|
}
|
|
636
672
|
|
|
637
673
|
/**
|
|
638
|
-
* @param {
|
|
639
|
-
* @param {
|
|
640
|
-
* @
|
|
641
|
-
* @
|
|
642
|
-
* @param {string} [arg.slug] - A short, human-readable, URL-friendly
|
|
643
|
-
* identifier of a product. You can get slug value from the endpoint
|
|
644
|
-
* /service/application/catalog/v1.0/products/
|
|
645
|
-
* @returns {Promise<BulkPriceResponse>} - Success response
|
|
674
|
+
* @param {PosCartApplicationValidator.GetBulkDiscountOffersParam} arg - Arg object.
|
|
675
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
676
|
+
* @returns {Promise<PosCartApplicationModel.BulkPriceResponse>} - Success response
|
|
677
|
+
* @name getBulkDiscountOffers
|
|
646
678
|
* @summary: Get discount offers based on quantity
|
|
647
|
-
* @description: Use this API to get a list of applicable offers along with current, next and best offer for given product. Either one of uid, item_id, slug should be present.
|
|
679
|
+
* @description: Use this API to get a list of applicable offers along with current, next and best offer for given product. Either one of uid, item_id, slug should be present. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getBulkDiscountOffers/).
|
|
648
680
|
*/
|
|
649
|
-
async getBulkDiscountOffers(
|
|
650
|
-
|
|
681
|
+
async getBulkDiscountOffers(
|
|
682
|
+
{ itemId, articleId, uid, slug } = {},
|
|
683
|
+
{ headers } = { headers: false }
|
|
684
|
+
) {
|
|
685
|
+
const {
|
|
686
|
+
error,
|
|
687
|
+
} = PosCartApplicationValidator.getBulkDiscountOffers().validate(
|
|
651
688
|
{ itemId, articleId, uid, slug },
|
|
652
689
|
{ abortEarly: false, allowUnknown: true }
|
|
653
690
|
);
|
|
@@ -658,16 +695,15 @@ class PosCart {
|
|
|
658
695
|
// Showing warrnings if extra unknown parameters are found
|
|
659
696
|
const {
|
|
660
697
|
error: warrning,
|
|
661
|
-
} =
|
|
698
|
+
} = PosCartApplicationValidator.getBulkDiscountOffers().validate(
|
|
662
699
|
{ itemId, articleId, uid, slug },
|
|
663
700
|
{ abortEarly: false, allowUnknown: false }
|
|
664
701
|
);
|
|
665
702
|
if (warrning) {
|
|
666
703
|
Logger({
|
|
667
704
|
level: "WARN",
|
|
668
|
-
message:
|
|
705
|
+
message: `Parameter Validation warrnings for application > PosCart > getBulkDiscountOffers \n ${warrning}`,
|
|
669
706
|
});
|
|
670
|
-
Logger({ level: "WARN", message: warrning });
|
|
671
707
|
}
|
|
672
708
|
|
|
673
709
|
const query_params = {};
|
|
@@ -687,12 +723,18 @@ class PosCart {
|
|
|
687
723
|
}),
|
|
688
724
|
query_params,
|
|
689
725
|
undefined,
|
|
690
|
-
xHeaders
|
|
726
|
+
xHeaders,
|
|
727
|
+
{ headers }
|
|
691
728
|
);
|
|
692
729
|
|
|
730
|
+
let responseData = response;
|
|
731
|
+
if (headers) {
|
|
732
|
+
responseData = response[0];
|
|
733
|
+
}
|
|
734
|
+
|
|
693
735
|
const {
|
|
694
736
|
error: res_error,
|
|
695
|
-
} =
|
|
737
|
+
} = PosCartApplicationModel.BulkPriceResponse().validate(responseData, {
|
|
696
738
|
abortEarly: false,
|
|
697
739
|
allowUnknown: false,
|
|
698
740
|
});
|
|
@@ -700,28 +742,26 @@ class PosCart {
|
|
|
700
742
|
if (res_error) {
|
|
701
743
|
Logger({
|
|
702
744
|
level: "WARN",
|
|
703
|
-
message:
|
|
745
|
+
message: `Response Validation Warnnings for application > PosCart > getBulkDiscountOffers \n ${res_error}`,
|
|
704
746
|
});
|
|
705
|
-
Logger({ level: "WARN", message: res_error });
|
|
706
747
|
}
|
|
707
748
|
|
|
708
749
|
return response;
|
|
709
750
|
}
|
|
710
751
|
|
|
711
752
|
/**
|
|
712
|
-
* @param {
|
|
713
|
-
* @param {
|
|
714
|
-
* @
|
|
715
|
-
* @
|
|
716
|
-
* @param {number} [arg.assignCardId] -
|
|
717
|
-
* @param {string} [arg.areaCode] -
|
|
718
|
-
* @param {boolean} [arg.buyNow] -
|
|
719
|
-
* @returns {Promise<CartDetailResponse>} - Success response
|
|
753
|
+
* @param {PosCartApplicationValidator.GetCartParam} arg - Arg object.
|
|
754
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
755
|
+
* @returns {Promise<PosCartApplicationModel.CartDetailResponse>} - Success response
|
|
756
|
+
* @name getCart
|
|
720
757
|
* @summary: Fetch all items added to the cart
|
|
721
|
-
* @description: Use this API to get details of all the items added to a cart.
|
|
758
|
+
* @description: Use this API to get details of all the items added to a cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getCart/).
|
|
722
759
|
*/
|
|
723
|
-
async getCart(
|
|
724
|
-
|
|
760
|
+
async getCart(
|
|
761
|
+
{ id, i, b, assignCardId, areaCode, buyNow } = {},
|
|
762
|
+
{ headers } = { headers: false }
|
|
763
|
+
) {
|
|
764
|
+
const { error } = PosCartApplicationValidator.getCart().validate(
|
|
725
765
|
{ id, i, b, assignCardId, areaCode, buyNow },
|
|
726
766
|
{ abortEarly: false, allowUnknown: true }
|
|
727
767
|
);
|
|
@@ -730,16 +770,15 @@ class PosCart {
|
|
|
730
770
|
}
|
|
731
771
|
|
|
732
772
|
// Showing warrnings if extra unknown parameters are found
|
|
733
|
-
const { error: warrning } =
|
|
773
|
+
const { error: warrning } = PosCartApplicationValidator.getCart().validate(
|
|
734
774
|
{ id, i, b, assignCardId, areaCode, buyNow },
|
|
735
775
|
{ abortEarly: false, allowUnknown: false }
|
|
736
776
|
);
|
|
737
777
|
if (warrning) {
|
|
738
778
|
Logger({
|
|
739
779
|
level: "WARN",
|
|
740
|
-
message:
|
|
780
|
+
message: `Parameter Validation warrnings for application > PosCart > getCart \n ${warrning}`,
|
|
741
781
|
});
|
|
742
|
-
Logger({ level: "WARN", message: warrning });
|
|
743
782
|
}
|
|
744
783
|
|
|
745
784
|
const query_params = {};
|
|
@@ -761,12 +800,18 @@ class PosCart {
|
|
|
761
800
|
}),
|
|
762
801
|
query_params,
|
|
763
802
|
undefined,
|
|
764
|
-
xHeaders
|
|
803
|
+
xHeaders,
|
|
804
|
+
{ headers }
|
|
765
805
|
);
|
|
766
806
|
|
|
807
|
+
let responseData = response;
|
|
808
|
+
if (headers) {
|
|
809
|
+
responseData = response[0];
|
|
810
|
+
}
|
|
811
|
+
|
|
767
812
|
const {
|
|
768
813
|
error: res_error,
|
|
769
|
-
} =
|
|
814
|
+
} = PosCartApplicationModel.CartDetailResponse().validate(responseData, {
|
|
770
815
|
abortEarly: false,
|
|
771
816
|
allowUnknown: false,
|
|
772
817
|
});
|
|
@@ -774,23 +819,25 @@ class PosCart {
|
|
|
774
819
|
if (res_error) {
|
|
775
820
|
Logger({
|
|
776
821
|
level: "WARN",
|
|
777
|
-
message:
|
|
822
|
+
message: `Response Validation Warnnings for application > PosCart > getCart \n ${res_error}`,
|
|
778
823
|
});
|
|
779
|
-
Logger({ level: "WARN", message: res_error });
|
|
780
824
|
}
|
|
781
825
|
|
|
782
826
|
return response;
|
|
783
827
|
}
|
|
784
828
|
|
|
785
829
|
/**
|
|
786
|
-
* @param {
|
|
787
|
-
* @param {
|
|
830
|
+
* @param {PosCartApplicationValidator.GetCartLastModifiedParam} arg - Arg object.
|
|
831
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
788
832
|
* @returns {Promise<any>} - Success response
|
|
833
|
+
* @name getCartLastModified
|
|
789
834
|
* @summary: Fetch last-modified timestamp
|
|
790
|
-
* @description: Use this API to fetch Last-Modified timestamp in header metadata.
|
|
835
|
+
* @description: Use this API to fetch Last-Modified timestamp in header metadata. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getCartLastModified/).
|
|
791
836
|
*/
|
|
792
|
-
async getCartLastModified({ id } = {}) {
|
|
793
|
-
const {
|
|
837
|
+
async getCartLastModified({ id } = {}, { headers } = { headers: false }) {
|
|
838
|
+
const {
|
|
839
|
+
error,
|
|
840
|
+
} = PosCartApplicationValidator.getCartLastModified().validate(
|
|
794
841
|
{ id },
|
|
795
842
|
{ abortEarly: false, allowUnknown: true }
|
|
796
843
|
);
|
|
@@ -799,16 +846,17 @@ class PosCart {
|
|
|
799
846
|
}
|
|
800
847
|
|
|
801
848
|
// Showing warrnings if extra unknown parameters are found
|
|
802
|
-
const {
|
|
849
|
+
const {
|
|
850
|
+
error: warrning,
|
|
851
|
+
} = PosCartApplicationValidator.getCartLastModified().validate(
|
|
803
852
|
{ id },
|
|
804
853
|
{ abortEarly: false, allowUnknown: false }
|
|
805
854
|
);
|
|
806
855
|
if (warrning) {
|
|
807
856
|
Logger({
|
|
808
857
|
level: "WARN",
|
|
809
|
-
message:
|
|
858
|
+
message: `Parameter Validation warrnings for application > PosCart > getCartLastModified \n ${warrning}`,
|
|
810
859
|
});
|
|
811
|
-
Logger({ level: "WARN", message: warrning });
|
|
812
860
|
}
|
|
813
861
|
|
|
814
862
|
const query_params = {};
|
|
@@ -825,33 +873,40 @@ class PosCart {
|
|
|
825
873
|
}),
|
|
826
874
|
query_params,
|
|
827
875
|
undefined,
|
|
828
|
-
xHeaders
|
|
876
|
+
xHeaders,
|
|
877
|
+
{ headers }
|
|
829
878
|
);
|
|
830
879
|
|
|
880
|
+
let responseData = response;
|
|
881
|
+
if (headers) {
|
|
882
|
+
responseData = response[0];
|
|
883
|
+
}
|
|
884
|
+
|
|
831
885
|
const { error: res_error } = Joi.string()
|
|
832
886
|
.allow("")
|
|
833
|
-
.validate(
|
|
887
|
+
.validate(responseData, { abortEarly: false, allowUnknown: false });
|
|
834
888
|
|
|
835
889
|
if (res_error) {
|
|
836
890
|
Logger({
|
|
837
891
|
level: "WARN",
|
|
838
|
-
message:
|
|
892
|
+
message: `Response Validation Warnnings for application > PosCart > getCartLastModified \n ${res_error}`,
|
|
839
893
|
});
|
|
840
|
-
Logger({ level: "WARN", message: res_error });
|
|
841
894
|
}
|
|
842
895
|
|
|
843
896
|
return response;
|
|
844
897
|
}
|
|
845
898
|
|
|
846
899
|
/**
|
|
847
|
-
* @param {
|
|
848
|
-
* @param {
|
|
849
|
-
* @returns {Promise<GetShareCartLinkResponse>} -
|
|
900
|
+
* @param {PosCartApplicationValidator.GetCartShareLinkParam} arg - Arg object.
|
|
901
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
902
|
+
* @returns {Promise<PosCartApplicationModel.GetShareCartLinkResponse>} -
|
|
903
|
+
* Success response
|
|
904
|
+
* @name getCartShareLink
|
|
850
905
|
* @summary: Generate token for sharing the cart
|
|
851
|
-
* @description: Use this API to generate a shared cart snapshot and return a shortlink token. The link can be shared with other users for getting the same items in their cart.
|
|
906
|
+
* @description: Use this API to generate a shared cart snapshot and return a shortlink token. The link can be shared with other users for getting the same items in their cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getCartShareLink/).
|
|
852
907
|
*/
|
|
853
|
-
async getCartShareLink({ body } = {}) {
|
|
854
|
-
const { error } =
|
|
908
|
+
async getCartShareLink({ body } = {}, { headers } = { headers: false }) {
|
|
909
|
+
const { error } = PosCartApplicationValidator.getCartShareLink().validate(
|
|
855
910
|
{ body },
|
|
856
911
|
{ abortEarly: false, allowUnknown: true }
|
|
857
912
|
);
|
|
@@ -860,16 +915,17 @@ class PosCart {
|
|
|
860
915
|
}
|
|
861
916
|
|
|
862
917
|
// Showing warrnings if extra unknown parameters are found
|
|
863
|
-
const {
|
|
918
|
+
const {
|
|
919
|
+
error: warrning,
|
|
920
|
+
} = PosCartApplicationValidator.getCartShareLink().validate(
|
|
864
921
|
{ body },
|
|
865
922
|
{ abortEarly: false, allowUnknown: false }
|
|
866
923
|
);
|
|
867
924
|
if (warrning) {
|
|
868
925
|
Logger({
|
|
869
926
|
level: "WARN",
|
|
870
|
-
message:
|
|
927
|
+
message: `Parameter Validation warrnings for application > PosCart > getCartShareLink \n ${warrning}`,
|
|
871
928
|
});
|
|
872
|
-
Logger({ level: "WARN", message: warrning });
|
|
873
929
|
}
|
|
874
930
|
|
|
875
931
|
const query_params = {};
|
|
@@ -885,36 +941,42 @@ class PosCart {
|
|
|
885
941
|
}),
|
|
886
942
|
query_params,
|
|
887
943
|
body,
|
|
888
|
-
xHeaders
|
|
944
|
+
xHeaders,
|
|
945
|
+
{ headers }
|
|
889
946
|
);
|
|
890
947
|
|
|
948
|
+
let responseData = response;
|
|
949
|
+
if (headers) {
|
|
950
|
+
responseData = response[0];
|
|
951
|
+
}
|
|
952
|
+
|
|
891
953
|
const {
|
|
892
954
|
error: res_error,
|
|
893
|
-
} =
|
|
894
|
-
|
|
895
|
-
allowUnknown: false
|
|
896
|
-
|
|
955
|
+
} = PosCartApplicationModel.GetShareCartLinkResponse().validate(
|
|
956
|
+
responseData,
|
|
957
|
+
{ abortEarly: false, allowUnknown: false }
|
|
958
|
+
);
|
|
897
959
|
|
|
898
960
|
if (res_error) {
|
|
899
961
|
Logger({
|
|
900
962
|
level: "WARN",
|
|
901
|
-
message:
|
|
963
|
+
message: `Response Validation Warnnings for application > PosCart > getCartShareLink \n ${res_error}`,
|
|
902
964
|
});
|
|
903
|
-
Logger({ level: "WARN", message: res_error });
|
|
904
965
|
}
|
|
905
966
|
|
|
906
967
|
return response;
|
|
907
968
|
}
|
|
908
969
|
|
|
909
970
|
/**
|
|
910
|
-
* @param {
|
|
911
|
-
* @param {
|
|
912
|
-
* @returns {Promise<SharedCartResponse>} - Success response
|
|
971
|
+
* @param {PosCartApplicationValidator.GetCartSharedItemsParam} arg - Arg object.
|
|
972
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
973
|
+
* @returns {Promise<PosCartApplicationModel.SharedCartResponse>} - Success response
|
|
974
|
+
* @name getCartSharedItems
|
|
913
975
|
* @summary: Get details of a shared cart
|
|
914
|
-
* @description: Use this API to get the shared cart details as per the token generated using the share-cart API.
|
|
976
|
+
* @description: Use this API to get the shared cart details as per the token generated using the share-cart API. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getCartSharedItems/).
|
|
915
977
|
*/
|
|
916
|
-
async getCartSharedItems({ token } = {}) {
|
|
917
|
-
const { error } =
|
|
978
|
+
async getCartSharedItems({ token } = {}, { headers } = { headers: false }) {
|
|
979
|
+
const { error } = PosCartApplicationValidator.getCartSharedItems().validate(
|
|
918
980
|
{ token },
|
|
919
981
|
{ abortEarly: false, allowUnknown: true }
|
|
920
982
|
);
|
|
@@ -923,16 +985,17 @@ class PosCart {
|
|
|
923
985
|
}
|
|
924
986
|
|
|
925
987
|
// Showing warrnings if extra unknown parameters are found
|
|
926
|
-
const {
|
|
988
|
+
const {
|
|
989
|
+
error: warrning,
|
|
990
|
+
} = PosCartApplicationValidator.getCartSharedItems().validate(
|
|
927
991
|
{ token },
|
|
928
992
|
{ abortEarly: false, allowUnknown: false }
|
|
929
993
|
);
|
|
930
994
|
if (warrning) {
|
|
931
995
|
Logger({
|
|
932
996
|
level: "WARN",
|
|
933
|
-
message:
|
|
997
|
+
message: `Parameter Validation warrnings for application > PosCart > getCartSharedItems \n ${warrning}`,
|
|
934
998
|
});
|
|
935
|
-
Logger({ level: "WARN", message: warrning });
|
|
936
999
|
}
|
|
937
1000
|
|
|
938
1001
|
const query_params = {};
|
|
@@ -948,12 +1011,18 @@ class PosCart {
|
|
|
948
1011
|
}),
|
|
949
1012
|
query_params,
|
|
950
1013
|
undefined,
|
|
951
|
-
xHeaders
|
|
1014
|
+
xHeaders,
|
|
1015
|
+
{ headers }
|
|
952
1016
|
);
|
|
953
1017
|
|
|
1018
|
+
let responseData = response;
|
|
1019
|
+
if (headers) {
|
|
1020
|
+
responseData = response[0];
|
|
1021
|
+
}
|
|
1022
|
+
|
|
954
1023
|
const {
|
|
955
1024
|
error: res_error,
|
|
956
|
-
} =
|
|
1025
|
+
} = PosCartApplicationModel.SharedCartResponse().validate(responseData, {
|
|
957
1026
|
abortEarly: false,
|
|
958
1027
|
allowUnknown: false,
|
|
959
1028
|
});
|
|
@@ -961,24 +1030,23 @@ class PosCart {
|
|
|
961
1030
|
if (res_error) {
|
|
962
1031
|
Logger({
|
|
963
1032
|
level: "WARN",
|
|
964
|
-
message:
|
|
1033
|
+
message: `Response Validation Warnnings for application > PosCart > getCartSharedItems \n ${res_error}`,
|
|
965
1034
|
});
|
|
966
|
-
Logger({ level: "WARN", message: res_error });
|
|
967
1035
|
}
|
|
968
1036
|
|
|
969
1037
|
return response;
|
|
970
1038
|
}
|
|
971
1039
|
|
|
972
1040
|
/**
|
|
973
|
-
* @param {
|
|
974
|
-
* @param {
|
|
975
|
-
* @
|
|
976
|
-
* @
|
|
1041
|
+
* @param {PosCartApplicationValidator.GetCouponsParam} arg - Arg object.
|
|
1042
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1043
|
+
* @returns {Promise<PosCartApplicationModel.GetCouponResponse>} - Success response
|
|
1044
|
+
* @name getCoupons
|
|
977
1045
|
* @summary: Fetch Coupon
|
|
978
|
-
* @description: Use this API to get a list of available coupons along with their details.
|
|
1046
|
+
* @description: Use this API to get a list of available coupons along with their details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getCoupons/).
|
|
979
1047
|
*/
|
|
980
|
-
async getCoupons({ id, buyNow } = {}) {
|
|
981
|
-
const { error } =
|
|
1048
|
+
async getCoupons({ id, buyNow } = {}, { headers } = { headers: false }) {
|
|
1049
|
+
const { error } = PosCartApplicationValidator.getCoupons().validate(
|
|
982
1050
|
{ id, buyNow },
|
|
983
1051
|
{ abortEarly: false, allowUnknown: true }
|
|
984
1052
|
);
|
|
@@ -987,16 +1055,17 @@ class PosCart {
|
|
|
987
1055
|
}
|
|
988
1056
|
|
|
989
1057
|
// Showing warrnings if extra unknown parameters are found
|
|
990
|
-
const {
|
|
1058
|
+
const {
|
|
1059
|
+
error: warrning,
|
|
1060
|
+
} = PosCartApplicationValidator.getCoupons().validate(
|
|
991
1061
|
{ id, buyNow },
|
|
992
1062
|
{ abortEarly: false, allowUnknown: false }
|
|
993
1063
|
);
|
|
994
1064
|
if (warrning) {
|
|
995
1065
|
Logger({
|
|
996
1066
|
level: "WARN",
|
|
997
|
-
message:
|
|
1067
|
+
message: `Parameter Validation warrnings for application > PosCart > getCoupons \n ${warrning}`,
|
|
998
1068
|
});
|
|
999
|
-
Logger({ level: "WARN", message: warrning });
|
|
1000
1069
|
}
|
|
1001
1070
|
|
|
1002
1071
|
const query_params = {};
|
|
@@ -1014,12 +1083,18 @@ class PosCart {
|
|
|
1014
1083
|
}),
|
|
1015
1084
|
query_params,
|
|
1016
1085
|
undefined,
|
|
1017
|
-
xHeaders
|
|
1086
|
+
xHeaders,
|
|
1087
|
+
{ headers }
|
|
1018
1088
|
);
|
|
1019
1089
|
|
|
1090
|
+
let responseData = response;
|
|
1091
|
+
if (headers) {
|
|
1092
|
+
responseData = response[0];
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1020
1095
|
const {
|
|
1021
1096
|
error: res_error,
|
|
1022
|
-
} =
|
|
1097
|
+
} = PosCartApplicationModel.GetCouponResponse().validate(responseData, {
|
|
1023
1098
|
abortEarly: false,
|
|
1024
1099
|
allowUnknown: false,
|
|
1025
1100
|
});
|
|
@@ -1027,24 +1102,24 @@ class PosCart {
|
|
|
1027
1102
|
if (res_error) {
|
|
1028
1103
|
Logger({
|
|
1029
1104
|
level: "WARN",
|
|
1030
|
-
message:
|
|
1105
|
+
message: `Response Validation Warnnings for application > PosCart > getCoupons \n ${res_error}`,
|
|
1031
1106
|
});
|
|
1032
|
-
Logger({ level: "WARN", message: res_error });
|
|
1033
1107
|
}
|
|
1034
1108
|
|
|
1035
1109
|
return response;
|
|
1036
1110
|
}
|
|
1037
1111
|
|
|
1038
1112
|
/**
|
|
1039
|
-
* @param {
|
|
1040
|
-
* @param {
|
|
1041
|
-
* @
|
|
1042
|
-
*
|
|
1113
|
+
* @param {PosCartApplicationValidator.GetItemCountParam} arg - Arg object.
|
|
1114
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1115
|
+
* @returns {Promise<PosCartApplicationModel.CartItemCountResponse>} -
|
|
1116
|
+
* Success response
|
|
1117
|
+
* @name getItemCount
|
|
1043
1118
|
* @summary: Count items in the cart
|
|
1044
|
-
* @description: Use this API to get the total number of items present in cart.
|
|
1119
|
+
* @description: Use this API to get the total number of items present in cart. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getItemCount/).
|
|
1045
1120
|
*/
|
|
1046
|
-
async getItemCount({ id, buyNow } = {}) {
|
|
1047
|
-
const { error } =
|
|
1121
|
+
async getItemCount({ id, buyNow } = {}, { headers } = { headers: false }) {
|
|
1122
|
+
const { error } = PosCartApplicationValidator.getItemCount().validate(
|
|
1048
1123
|
{ id, buyNow },
|
|
1049
1124
|
{ abortEarly: false, allowUnknown: true }
|
|
1050
1125
|
);
|
|
@@ -1053,16 +1128,17 @@ class PosCart {
|
|
|
1053
1128
|
}
|
|
1054
1129
|
|
|
1055
1130
|
// Showing warrnings if extra unknown parameters are found
|
|
1056
|
-
const {
|
|
1131
|
+
const {
|
|
1132
|
+
error: warrning,
|
|
1133
|
+
} = PosCartApplicationValidator.getItemCount().validate(
|
|
1057
1134
|
{ id, buyNow },
|
|
1058
1135
|
{ abortEarly: false, allowUnknown: false }
|
|
1059
1136
|
);
|
|
1060
1137
|
if (warrning) {
|
|
1061
1138
|
Logger({
|
|
1062
1139
|
level: "WARN",
|
|
1063
|
-
message:
|
|
1140
|
+
message: `Parameter Validation warrnings for application > PosCart > getItemCount \n ${warrning}`,
|
|
1064
1141
|
});
|
|
1065
|
-
Logger({ level: "WARN", message: warrning });
|
|
1066
1142
|
}
|
|
1067
1143
|
|
|
1068
1144
|
const query_params = {};
|
|
@@ -1080,12 +1156,18 @@ class PosCart {
|
|
|
1080
1156
|
}),
|
|
1081
1157
|
query_params,
|
|
1082
1158
|
undefined,
|
|
1083
|
-
xHeaders
|
|
1159
|
+
xHeaders,
|
|
1160
|
+
{ headers }
|
|
1084
1161
|
);
|
|
1085
1162
|
|
|
1163
|
+
let responseData = response;
|
|
1164
|
+
if (headers) {
|
|
1165
|
+
responseData = response[0];
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1086
1168
|
const {
|
|
1087
1169
|
error: res_error,
|
|
1088
|
-
} =
|
|
1170
|
+
} = PosCartApplicationModel.CartItemCountResponse().validate(responseData, {
|
|
1089
1171
|
abortEarly: false,
|
|
1090
1172
|
allowUnknown: false,
|
|
1091
1173
|
});
|
|
@@ -1093,41 +1175,35 @@ class PosCart {
|
|
|
1093
1175
|
if (res_error) {
|
|
1094
1176
|
Logger({
|
|
1095
1177
|
level: "WARN",
|
|
1096
|
-
message:
|
|
1178
|
+
message: `Response Validation Warnnings for application > PosCart > getItemCount \n ${res_error}`,
|
|
1097
1179
|
});
|
|
1098
|
-
Logger({ level: "WARN", message: res_error });
|
|
1099
1180
|
}
|
|
1100
1181
|
|
|
1101
1182
|
return response;
|
|
1102
1183
|
}
|
|
1103
1184
|
|
|
1104
1185
|
/**
|
|
1105
|
-
* @param {
|
|
1106
|
-
* @param {
|
|
1107
|
-
* @
|
|
1108
|
-
*
|
|
1109
|
-
*
|
|
1110
|
-
* @param {string} [arg.id] - The unique identifier of the cart
|
|
1111
|
-
* @param {string} [arg.addressId] - ID allotted to the selected address
|
|
1112
|
-
* @param {string} [arg.areaCode] - The PIN Code of the destination address,
|
|
1113
|
-
* e.g. 400059
|
|
1114
|
-
* @param {string} [arg.orderType] - The order type of shipment HomeDelivery
|
|
1115
|
-
* - If the customer wants the order home-delivered PickAtStore - If the
|
|
1116
|
-
* customer wants the handover of an order at the store itself.
|
|
1117
|
-
* @returns {Promise<CartShipmentsResponse>} - Success response
|
|
1186
|
+
* @param {PosCartApplicationValidator.GetShipmentsParam} arg - Arg object.
|
|
1187
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1188
|
+
* @returns {Promise<PosCartApplicationModel.CartShipmentsResponse>} -
|
|
1189
|
+
* Success response
|
|
1190
|
+
* @name getShipments
|
|
1118
1191
|
* @summary: Get delivery date and options before checkout
|
|
1119
|
-
* @description: Use this API to get shipment details, expected delivery date, items and price breakup of the shipment.
|
|
1192
|
+
* @description: Use this API to get shipment details, expected delivery date, items and price breakup of the shipment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getShipments/).
|
|
1120
1193
|
*/
|
|
1121
|
-
async getShipments(
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1194
|
+
async getShipments(
|
|
1195
|
+
{
|
|
1196
|
+
pickAtStoreUid,
|
|
1197
|
+
orderingStoreId,
|
|
1198
|
+
p,
|
|
1199
|
+
id,
|
|
1200
|
+
addressId,
|
|
1201
|
+
areaCode,
|
|
1202
|
+
orderType,
|
|
1203
|
+
} = {},
|
|
1204
|
+
{ headers } = { headers: false }
|
|
1205
|
+
) {
|
|
1206
|
+
const { error } = PosCartApplicationValidator.getShipments().validate(
|
|
1131
1207
|
{
|
|
1132
1208
|
pickAtStoreUid,
|
|
1133
1209
|
orderingStoreId,
|
|
@@ -1144,7 +1220,9 @@ class PosCart {
|
|
|
1144
1220
|
}
|
|
1145
1221
|
|
|
1146
1222
|
// Showing warrnings if extra unknown parameters are found
|
|
1147
|
-
const {
|
|
1223
|
+
const {
|
|
1224
|
+
error: warrning,
|
|
1225
|
+
} = PosCartApplicationValidator.getShipments().validate(
|
|
1148
1226
|
{
|
|
1149
1227
|
pickAtStoreUid,
|
|
1150
1228
|
orderingStoreId,
|
|
@@ -1159,9 +1237,8 @@ class PosCart {
|
|
|
1159
1237
|
if (warrning) {
|
|
1160
1238
|
Logger({
|
|
1161
1239
|
level: "WARN",
|
|
1162
|
-
message:
|
|
1240
|
+
message: `Parameter Validation warrnings for application > PosCart > getShipments \n ${warrning}`,
|
|
1163
1241
|
});
|
|
1164
|
-
Logger({ level: "WARN", message: warrning });
|
|
1165
1242
|
}
|
|
1166
1243
|
|
|
1167
1244
|
const query_params = {};
|
|
@@ -1184,12 +1261,18 @@ class PosCart {
|
|
|
1184
1261
|
}),
|
|
1185
1262
|
query_params,
|
|
1186
1263
|
undefined,
|
|
1187
|
-
xHeaders
|
|
1264
|
+
xHeaders,
|
|
1265
|
+
{ headers }
|
|
1188
1266
|
);
|
|
1189
1267
|
|
|
1268
|
+
let responseData = response;
|
|
1269
|
+
if (headers) {
|
|
1270
|
+
responseData = response[0];
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1190
1273
|
const {
|
|
1191
1274
|
error: res_error,
|
|
1192
|
-
} =
|
|
1275
|
+
} = PosCartApplicationModel.CartShipmentsResponse().validate(responseData, {
|
|
1193
1276
|
abortEarly: false,
|
|
1194
1277
|
allowUnknown: false,
|
|
1195
1278
|
});
|
|
@@ -1197,23 +1280,28 @@ class PosCart {
|
|
|
1197
1280
|
if (res_error) {
|
|
1198
1281
|
Logger({
|
|
1199
1282
|
level: "WARN",
|
|
1200
|
-
message:
|
|
1283
|
+
message: `Response Validation Warnnings for application > PosCart > getShipments \n ${res_error}`,
|
|
1201
1284
|
});
|
|
1202
|
-
Logger({ level: "WARN", message: res_error });
|
|
1203
1285
|
}
|
|
1204
1286
|
|
|
1205
1287
|
return response;
|
|
1206
1288
|
}
|
|
1207
1289
|
|
|
1208
1290
|
/**
|
|
1209
|
-
* @param {
|
|
1210
|
-
* @param {
|
|
1211
|
-
* @returns {Promise<StoreDetailsResponse>} - Success response
|
|
1291
|
+
* @param {PosCartApplicationValidator.GetStoreAddressByUidParam} arg - Arg object.
|
|
1292
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1293
|
+
* @returns {Promise<PosCartApplicationModel.StoreDetailsResponse>} - Success response
|
|
1294
|
+
* @name getStoreAddressByUid
|
|
1212
1295
|
* @summary: Get list of stores for give uids
|
|
1213
|
-
* @description: Use this API to get the store details by entering the unique identifier of the pickup stores shown in the response of available-delivery-mode API.
|
|
1296
|
+
* @description: Use this API to get the store details by entering the unique identifier of the pickup stores shown in the response of available-delivery-mode API. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/getStoreAddressByUid/).
|
|
1214
1297
|
*/
|
|
1215
|
-
async getStoreAddressByUid(
|
|
1216
|
-
|
|
1298
|
+
async getStoreAddressByUid(
|
|
1299
|
+
{ storeUid } = {},
|
|
1300
|
+
{ headers } = { headers: false }
|
|
1301
|
+
) {
|
|
1302
|
+
const {
|
|
1303
|
+
error,
|
|
1304
|
+
} = PosCartApplicationValidator.getStoreAddressByUid().validate(
|
|
1217
1305
|
{ storeUid },
|
|
1218
1306
|
{ abortEarly: false, allowUnknown: true }
|
|
1219
1307
|
);
|
|
@@ -1224,16 +1312,15 @@ class PosCart {
|
|
|
1224
1312
|
// Showing warrnings if extra unknown parameters are found
|
|
1225
1313
|
const {
|
|
1226
1314
|
error: warrning,
|
|
1227
|
-
} =
|
|
1315
|
+
} = PosCartApplicationValidator.getStoreAddressByUid().validate(
|
|
1228
1316
|
{ storeUid },
|
|
1229
1317
|
{ abortEarly: false, allowUnknown: false }
|
|
1230
1318
|
);
|
|
1231
1319
|
if (warrning) {
|
|
1232
1320
|
Logger({
|
|
1233
1321
|
level: "WARN",
|
|
1234
|
-
message:
|
|
1322
|
+
message: `Parameter Validation warrnings for application > PosCart > getStoreAddressByUid \n ${warrning}`,
|
|
1235
1323
|
});
|
|
1236
|
-
Logger({ level: "WARN", message: warrning });
|
|
1237
1324
|
}
|
|
1238
1325
|
|
|
1239
1326
|
const query_params = {};
|
|
@@ -1250,12 +1337,18 @@ class PosCart {
|
|
|
1250
1337
|
}),
|
|
1251
1338
|
query_params,
|
|
1252
1339
|
undefined,
|
|
1253
|
-
xHeaders
|
|
1340
|
+
xHeaders,
|
|
1341
|
+
{ headers }
|
|
1254
1342
|
);
|
|
1255
1343
|
|
|
1344
|
+
let responseData = response;
|
|
1345
|
+
if (headers) {
|
|
1346
|
+
responseData = response[0];
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1256
1349
|
const {
|
|
1257
1350
|
error: res_error,
|
|
1258
|
-
} =
|
|
1351
|
+
} = PosCartApplicationModel.StoreDetailsResponse().validate(responseData, {
|
|
1259
1352
|
abortEarly: false,
|
|
1260
1353
|
allowUnknown: false,
|
|
1261
1354
|
});
|
|
@@ -1263,23 +1356,24 @@ class PosCart {
|
|
|
1263
1356
|
if (res_error) {
|
|
1264
1357
|
Logger({
|
|
1265
1358
|
level: "WARN",
|
|
1266
|
-
message:
|
|
1359
|
+
message: `Response Validation Warnnings for application > PosCart > getStoreAddressByUid \n ${res_error}`,
|
|
1267
1360
|
});
|
|
1268
|
-
Logger({ level: "WARN", message: res_error });
|
|
1269
1361
|
}
|
|
1270
1362
|
|
|
1271
1363
|
return response;
|
|
1272
1364
|
}
|
|
1273
1365
|
|
|
1274
1366
|
/**
|
|
1275
|
-
* @param {
|
|
1276
|
-
* @param {
|
|
1277
|
-
* @returns {Promise<DeleteAddressResponse>} -
|
|
1367
|
+
* @param {PosCartApplicationValidator.RemoveAddressParam} arg - Arg object.
|
|
1368
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1369
|
+
* @returns {Promise<PosCartApplicationModel.DeleteAddressResponse>} -
|
|
1370
|
+
* Success response
|
|
1371
|
+
* @name removeAddress
|
|
1278
1372
|
* @summary: Remove address associated with an account
|
|
1279
|
-
* @description: Use this API to delete an address by its ID. This will returns an object that will indicate whether the address was deleted successfully or not.
|
|
1373
|
+
* @description: Use this API to delete an address by its ID. This will returns an object that will indicate whether the address was deleted successfully or not. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/removeAddress/).
|
|
1280
1374
|
*/
|
|
1281
|
-
async removeAddress({ id } = {}) {
|
|
1282
|
-
const { error } =
|
|
1375
|
+
async removeAddress({ id } = {}, { headers } = { headers: false }) {
|
|
1376
|
+
const { error } = PosCartApplicationValidator.removeAddress().validate(
|
|
1283
1377
|
{ id },
|
|
1284
1378
|
{ abortEarly: false, allowUnknown: true }
|
|
1285
1379
|
);
|
|
@@ -1288,16 +1382,17 @@ class PosCart {
|
|
|
1288
1382
|
}
|
|
1289
1383
|
|
|
1290
1384
|
// Showing warrnings if extra unknown parameters are found
|
|
1291
|
-
const {
|
|
1385
|
+
const {
|
|
1386
|
+
error: warrning,
|
|
1387
|
+
} = PosCartApplicationValidator.removeAddress().validate(
|
|
1292
1388
|
{ id },
|
|
1293
1389
|
{ abortEarly: false, allowUnknown: false }
|
|
1294
1390
|
);
|
|
1295
1391
|
if (warrning) {
|
|
1296
1392
|
Logger({
|
|
1297
1393
|
level: "WARN",
|
|
1298
|
-
message:
|
|
1394
|
+
message: `Parameter Validation warrnings for application > PosCart > removeAddress \n ${warrning}`,
|
|
1299
1395
|
});
|
|
1300
|
-
Logger({ level: "WARN", message: warrning });
|
|
1301
1396
|
}
|
|
1302
1397
|
|
|
1303
1398
|
const query_params = {};
|
|
@@ -1313,12 +1408,18 @@ class PosCart {
|
|
|
1313
1408
|
}),
|
|
1314
1409
|
query_params,
|
|
1315
1410
|
undefined,
|
|
1316
|
-
xHeaders
|
|
1411
|
+
xHeaders,
|
|
1412
|
+
{ headers }
|
|
1317
1413
|
);
|
|
1318
1414
|
|
|
1415
|
+
let responseData = response;
|
|
1416
|
+
if (headers) {
|
|
1417
|
+
responseData = response[0];
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1319
1420
|
const {
|
|
1320
1421
|
error: res_error,
|
|
1321
|
-
} =
|
|
1422
|
+
} = PosCartApplicationModel.DeleteAddressResponse().validate(responseData, {
|
|
1322
1423
|
abortEarly: false,
|
|
1323
1424
|
allowUnknown: false,
|
|
1324
1425
|
});
|
|
@@ -1326,24 +1427,23 @@ class PosCart {
|
|
|
1326
1427
|
if (res_error) {
|
|
1327
1428
|
Logger({
|
|
1328
1429
|
level: "WARN",
|
|
1329
|
-
message:
|
|
1430
|
+
message: `Response Validation Warnnings for application > PosCart > removeAddress \n ${res_error}`,
|
|
1330
1431
|
});
|
|
1331
|
-
Logger({ level: "WARN", message: res_error });
|
|
1332
1432
|
}
|
|
1333
1433
|
|
|
1334
1434
|
return response;
|
|
1335
1435
|
}
|
|
1336
1436
|
|
|
1337
1437
|
/**
|
|
1338
|
-
* @param {
|
|
1339
|
-
* @param {
|
|
1340
|
-
* @
|
|
1341
|
-
* @
|
|
1438
|
+
* @param {PosCartApplicationValidator.RemoveCouponParam} arg - Arg object.
|
|
1439
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1440
|
+
* @returns {Promise<PosCartApplicationModel.CartDetailResponse>} - Success response
|
|
1441
|
+
* @name removeCoupon
|
|
1342
1442
|
* @summary: Remove Coupon Applied
|
|
1343
|
-
* @description: Remove Coupon applied on the cart by passing uid in request body.
|
|
1443
|
+
* @description: Remove Coupon applied on the cart by passing uid in request body. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/removeCoupon/).
|
|
1344
1444
|
*/
|
|
1345
|
-
async removeCoupon({ id, buyNow } = {}) {
|
|
1346
|
-
const { error } =
|
|
1445
|
+
async removeCoupon({ id, buyNow } = {}, { headers } = { headers: false }) {
|
|
1446
|
+
const { error } = PosCartApplicationValidator.removeCoupon().validate(
|
|
1347
1447
|
{ id, buyNow },
|
|
1348
1448
|
{ abortEarly: false, allowUnknown: true }
|
|
1349
1449
|
);
|
|
@@ -1352,16 +1452,17 @@ class PosCart {
|
|
|
1352
1452
|
}
|
|
1353
1453
|
|
|
1354
1454
|
// Showing warrnings if extra unknown parameters are found
|
|
1355
|
-
const {
|
|
1455
|
+
const {
|
|
1456
|
+
error: warrning,
|
|
1457
|
+
} = PosCartApplicationValidator.removeCoupon().validate(
|
|
1356
1458
|
{ id, buyNow },
|
|
1357
1459
|
{ abortEarly: false, allowUnknown: false }
|
|
1358
1460
|
);
|
|
1359
1461
|
if (warrning) {
|
|
1360
1462
|
Logger({
|
|
1361
1463
|
level: "WARN",
|
|
1362
|
-
message:
|
|
1464
|
+
message: `Parameter Validation warrnings for application > PosCart > removeCoupon \n ${warrning}`,
|
|
1363
1465
|
});
|
|
1364
|
-
Logger({ level: "WARN", message: warrning });
|
|
1365
1466
|
}
|
|
1366
1467
|
|
|
1367
1468
|
const query_params = {};
|
|
@@ -1379,12 +1480,18 @@ class PosCart {
|
|
|
1379
1480
|
}),
|
|
1380
1481
|
query_params,
|
|
1381
1482
|
undefined,
|
|
1382
|
-
xHeaders
|
|
1483
|
+
xHeaders,
|
|
1484
|
+
{ headers }
|
|
1383
1485
|
);
|
|
1384
1486
|
|
|
1487
|
+
let responseData = response;
|
|
1488
|
+
if (headers) {
|
|
1489
|
+
responseData = response[0];
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1385
1492
|
const {
|
|
1386
1493
|
error: res_error,
|
|
1387
|
-
} =
|
|
1494
|
+
} = PosCartApplicationModel.CartDetailResponse().validate(responseData, {
|
|
1388
1495
|
abortEarly: false,
|
|
1389
1496
|
allowUnknown: false,
|
|
1390
1497
|
});
|
|
@@ -1392,27 +1499,26 @@ class PosCart {
|
|
|
1392
1499
|
if (res_error) {
|
|
1393
1500
|
Logger({
|
|
1394
1501
|
level: "WARN",
|
|
1395
|
-
message:
|
|
1502
|
+
message: `Response Validation Warnnings for application > PosCart > removeCoupon \n ${res_error}`,
|
|
1396
1503
|
});
|
|
1397
|
-
Logger({ level: "WARN", message: res_error });
|
|
1398
1504
|
}
|
|
1399
1505
|
|
|
1400
1506
|
return response;
|
|
1401
1507
|
}
|
|
1402
1508
|
|
|
1403
1509
|
/**
|
|
1404
|
-
* @param {
|
|
1405
|
-
* @param {
|
|
1406
|
-
* @
|
|
1407
|
-
* @
|
|
1408
|
-
* @param {boolean} [arg.b] -
|
|
1409
|
-
* @param {SelectCartAddressRequest} arg.body
|
|
1410
|
-
* @returns {Promise<CartDetailResponse>} - Success response
|
|
1510
|
+
* @param {PosCartApplicationValidator.SelectAddressParam} arg - Arg object.
|
|
1511
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1512
|
+
* @returns {Promise<PosCartApplicationModel.CartDetailResponse>} - Success response
|
|
1513
|
+
* @name selectAddress
|
|
1411
1514
|
* @summary: Select an address from available addresses
|
|
1412
|
-
* @description: <p>Select Address from all addresses associated with the account in order to ship the cart items to that address, otherwise default address will be selected implicitly. See `SelectCartAddressRequest` in schema of request body for the list of attributes needed to select Address from account. On successful request, this API returns a Cart object. Below address attributes are required. <ul> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">billing_address_id</font></li> <li> <font color="monochrome">uid</font></li> </ul></p>
|
|
1515
|
+
* @description: <p>Select Address from all addresses associated with the account in order to ship the cart items to that address, otherwise default address will be selected implicitly. See `SelectCartAddressRequest` in schema of request body for the list of attributes needed to select Address from account. On successful request, this API returns a Cart object. Below address attributes are required. <ul> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">billing_address_id</font></li> <li> <font color="monochrome">uid</font></li> </ul></p> - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/selectAddress/).
|
|
1413
1516
|
*/
|
|
1414
|
-
async selectAddress(
|
|
1415
|
-
|
|
1517
|
+
async selectAddress(
|
|
1518
|
+
{ body, cartId, buyNow, i, b } = {},
|
|
1519
|
+
{ headers } = { headers: false }
|
|
1520
|
+
) {
|
|
1521
|
+
const { error } = PosCartApplicationValidator.selectAddress().validate(
|
|
1416
1522
|
{ body, cartId, buyNow, i, b },
|
|
1417
1523
|
{ abortEarly: false, allowUnknown: true }
|
|
1418
1524
|
);
|
|
@@ -1421,16 +1527,17 @@ class PosCart {
|
|
|
1421
1527
|
}
|
|
1422
1528
|
|
|
1423
1529
|
// Showing warrnings if extra unknown parameters are found
|
|
1424
|
-
const {
|
|
1530
|
+
const {
|
|
1531
|
+
error: warrning,
|
|
1532
|
+
} = PosCartApplicationValidator.selectAddress().validate(
|
|
1425
1533
|
{ body, cartId, buyNow, i, b },
|
|
1426
1534
|
{ abortEarly: false, allowUnknown: false }
|
|
1427
1535
|
);
|
|
1428
1536
|
if (warrning) {
|
|
1429
1537
|
Logger({
|
|
1430
1538
|
level: "WARN",
|
|
1431
|
-
message:
|
|
1539
|
+
message: `Parameter Validation warrnings for application > PosCart > selectAddress \n ${warrning}`,
|
|
1432
1540
|
});
|
|
1433
|
-
Logger({ level: "WARN", message: warrning });
|
|
1434
1541
|
}
|
|
1435
1542
|
|
|
1436
1543
|
const query_params = {};
|
|
@@ -1450,12 +1557,18 @@ class PosCart {
|
|
|
1450
1557
|
}),
|
|
1451
1558
|
query_params,
|
|
1452
1559
|
body,
|
|
1453
|
-
xHeaders
|
|
1560
|
+
xHeaders,
|
|
1561
|
+
{ headers }
|
|
1454
1562
|
);
|
|
1455
1563
|
|
|
1564
|
+
let responseData = response;
|
|
1565
|
+
if (headers) {
|
|
1566
|
+
responseData = response[0];
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1456
1569
|
const {
|
|
1457
1570
|
error: res_error,
|
|
1458
|
-
} =
|
|
1571
|
+
} = PosCartApplicationModel.CartDetailResponse().validate(responseData, {
|
|
1459
1572
|
abortEarly: false,
|
|
1460
1573
|
allowUnknown: false,
|
|
1461
1574
|
});
|
|
@@ -1463,25 +1576,26 @@ class PosCart {
|
|
|
1463
1576
|
if (res_error) {
|
|
1464
1577
|
Logger({
|
|
1465
1578
|
level: "WARN",
|
|
1466
|
-
message:
|
|
1579
|
+
message: `Response Validation Warnnings for application > PosCart > selectAddress \n ${res_error}`,
|
|
1467
1580
|
});
|
|
1468
|
-
Logger({ level: "WARN", message: res_error });
|
|
1469
1581
|
}
|
|
1470
1582
|
|
|
1471
1583
|
return response;
|
|
1472
1584
|
}
|
|
1473
1585
|
|
|
1474
1586
|
/**
|
|
1475
|
-
* @param {
|
|
1476
|
-
* @param {
|
|
1477
|
-
* @
|
|
1478
|
-
* @
|
|
1479
|
-
* @returns {Promise<CartDetailResponse>} - Success response
|
|
1587
|
+
* @param {PosCartApplicationValidator.SelectPaymentModeParam} arg - Arg object.
|
|
1588
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1589
|
+
* @returns {Promise<PosCartApplicationModel.CartDetailResponse>} - Success response
|
|
1590
|
+
* @name selectPaymentMode
|
|
1480
1591
|
* @summary: Update cart payment
|
|
1481
|
-
* @description: Use this API to update cart payment.
|
|
1592
|
+
* @description: Use this API to update cart payment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/selectPaymentMode/).
|
|
1482
1593
|
*/
|
|
1483
|
-
async selectPaymentMode(
|
|
1484
|
-
|
|
1594
|
+
async selectPaymentMode(
|
|
1595
|
+
{ body, id, buyNow } = {},
|
|
1596
|
+
{ headers } = { headers: false }
|
|
1597
|
+
) {
|
|
1598
|
+
const { error } = PosCartApplicationValidator.selectPaymentMode().validate(
|
|
1485
1599
|
{ body, id, buyNow },
|
|
1486
1600
|
{ abortEarly: false, allowUnknown: true }
|
|
1487
1601
|
);
|
|
@@ -1490,16 +1604,17 @@ class PosCart {
|
|
|
1490
1604
|
}
|
|
1491
1605
|
|
|
1492
1606
|
// Showing warrnings if extra unknown parameters are found
|
|
1493
|
-
const {
|
|
1607
|
+
const {
|
|
1608
|
+
error: warrning,
|
|
1609
|
+
} = PosCartApplicationValidator.selectPaymentMode().validate(
|
|
1494
1610
|
{ body, id, buyNow },
|
|
1495
1611
|
{ abortEarly: false, allowUnknown: false }
|
|
1496
1612
|
);
|
|
1497
1613
|
if (warrning) {
|
|
1498
1614
|
Logger({
|
|
1499
1615
|
level: "WARN",
|
|
1500
|
-
message:
|
|
1616
|
+
message: `Parameter Validation warrnings for application > PosCart > selectPaymentMode \n ${warrning}`,
|
|
1501
1617
|
});
|
|
1502
|
-
Logger({ level: "WARN", message: warrning });
|
|
1503
1618
|
}
|
|
1504
1619
|
|
|
1505
1620
|
const query_params = {};
|
|
@@ -1517,12 +1632,18 @@ class PosCart {
|
|
|
1517
1632
|
}),
|
|
1518
1633
|
query_params,
|
|
1519
1634
|
body,
|
|
1520
|
-
xHeaders
|
|
1635
|
+
xHeaders,
|
|
1636
|
+
{ headers }
|
|
1521
1637
|
);
|
|
1522
1638
|
|
|
1639
|
+
let responseData = response;
|
|
1640
|
+
if (headers) {
|
|
1641
|
+
responseData = response[0];
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1523
1644
|
const {
|
|
1524
1645
|
error: res_error,
|
|
1525
|
-
} =
|
|
1646
|
+
} = PosCartApplicationModel.CartDetailResponse().validate(responseData, {
|
|
1526
1647
|
abortEarly: false,
|
|
1527
1648
|
allowUnknown: false,
|
|
1528
1649
|
});
|
|
@@ -1530,24 +1651,24 @@ class PosCart {
|
|
|
1530
1651
|
if (res_error) {
|
|
1531
1652
|
Logger({
|
|
1532
1653
|
level: "WARN",
|
|
1533
|
-
message:
|
|
1654
|
+
message: `Response Validation Warnnings for application > PosCart > selectPaymentMode \n ${res_error}`,
|
|
1534
1655
|
});
|
|
1535
|
-
Logger({ level: "WARN", message: res_error });
|
|
1536
1656
|
}
|
|
1537
1657
|
|
|
1538
1658
|
return response;
|
|
1539
1659
|
}
|
|
1540
1660
|
|
|
1541
1661
|
/**
|
|
1542
|
-
* @param {
|
|
1543
|
-
* @param {
|
|
1544
|
-
* @
|
|
1545
|
-
*
|
|
1662
|
+
* @param {PosCartApplicationValidator.UpdateAddressParam} arg - Arg object.
|
|
1663
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1664
|
+
* @returns {Promise<PosCartApplicationModel.UpdateAddressResponse>} -
|
|
1665
|
+
* Success response
|
|
1666
|
+
* @name updateAddress
|
|
1546
1667
|
* @summary: Update address added to an account
|
|
1547
|
-
* @description: <p>Use this API to update an existing address in the account. Request object should contain attributes mentioned in <font color="blue">Address </font> can be updated. These attributes are:</p> <ul> <li> <font color="monochrome">is_default_address</font></li> <li> <font color="monochrome">landmark</font></li> <li> <font color="monochrome">area</font></li> <li> <font color="monochrome">pincode</font></li> <li> <font color="monochrome">email</font></li> <li> <font color="monochrome">address_type</font></li> <li> <font color="monochrome">name</font></li> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">address</font></li> </ul>
|
|
1668
|
+
* @description: <p>Use this API to update an existing address in the account. Request object should contain attributes mentioned in <font color="blue">Address </font> can be updated. These attributes are:</p> <ul> <li> <font color="monochrome">is_default_address</font></li> <li> <font color="monochrome">landmark</font></li> <li> <font color="monochrome">area</font></li> <li> <font color="monochrome">pincode</font></li> <li> <font color="monochrome">email</font></li> <li> <font color="monochrome">address_type</font></li> <li> <font color="monochrome">name</font></li> <li> <font color="monochrome">address_id</font></li> <li> <font color="monochrome">address</font></li> </ul> - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/updateAddress/).
|
|
1548
1669
|
*/
|
|
1549
|
-
async updateAddress({ id, body } = {}) {
|
|
1550
|
-
const { error } =
|
|
1670
|
+
async updateAddress({ id, body } = {}, { headers } = { headers: false }) {
|
|
1671
|
+
const { error } = PosCartApplicationValidator.updateAddress().validate(
|
|
1551
1672
|
{ id, body },
|
|
1552
1673
|
{ abortEarly: false, allowUnknown: true }
|
|
1553
1674
|
);
|
|
@@ -1556,16 +1677,17 @@ class PosCart {
|
|
|
1556
1677
|
}
|
|
1557
1678
|
|
|
1558
1679
|
// Showing warrnings if extra unknown parameters are found
|
|
1559
|
-
const {
|
|
1680
|
+
const {
|
|
1681
|
+
error: warrning,
|
|
1682
|
+
} = PosCartApplicationValidator.updateAddress().validate(
|
|
1560
1683
|
{ id, body },
|
|
1561
1684
|
{ abortEarly: false, allowUnknown: false }
|
|
1562
1685
|
);
|
|
1563
1686
|
if (warrning) {
|
|
1564
1687
|
Logger({
|
|
1565
1688
|
level: "WARN",
|
|
1566
|
-
message:
|
|
1689
|
+
message: `Parameter Validation warrnings for application > PosCart > updateAddress \n ${warrning}`,
|
|
1567
1690
|
});
|
|
1568
|
-
Logger({ level: "WARN", message: warrning });
|
|
1569
1691
|
}
|
|
1570
1692
|
|
|
1571
1693
|
const query_params = {};
|
|
@@ -1581,12 +1703,18 @@ class PosCart {
|
|
|
1581
1703
|
}),
|
|
1582
1704
|
query_params,
|
|
1583
1705
|
body,
|
|
1584
|
-
xHeaders
|
|
1706
|
+
xHeaders,
|
|
1707
|
+
{ headers }
|
|
1585
1708
|
);
|
|
1586
1709
|
|
|
1710
|
+
let responseData = response;
|
|
1711
|
+
if (headers) {
|
|
1712
|
+
responseData = response[0];
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1587
1715
|
const {
|
|
1588
1716
|
error: res_error,
|
|
1589
|
-
} =
|
|
1717
|
+
} = PosCartApplicationModel.UpdateAddressResponse().validate(responseData, {
|
|
1590
1718
|
abortEarly: false,
|
|
1591
1719
|
allowUnknown: false,
|
|
1592
1720
|
});
|
|
@@ -1594,28 +1722,27 @@ class PosCart {
|
|
|
1594
1722
|
if (res_error) {
|
|
1595
1723
|
Logger({
|
|
1596
1724
|
level: "WARN",
|
|
1597
|
-
message:
|
|
1725
|
+
message: `Response Validation Warnnings for application > PosCart > updateAddress \n ${res_error}`,
|
|
1598
1726
|
});
|
|
1599
|
-
Logger({ level: "WARN", message: res_error });
|
|
1600
1727
|
}
|
|
1601
1728
|
|
|
1602
1729
|
return response;
|
|
1603
1730
|
}
|
|
1604
1731
|
|
|
1605
1732
|
/**
|
|
1606
|
-
* @param {
|
|
1607
|
-
* @param {
|
|
1608
|
-
* @
|
|
1609
|
-
*
|
|
1610
|
-
* @
|
|
1611
|
-
* @param {boolean} [arg.buyNow] -
|
|
1612
|
-
* @param {UpdateCartRequest} arg.body
|
|
1613
|
-
* @returns {Promise<UpdateCartDetailResponse>} - Success response
|
|
1733
|
+
* @param {PosCartApplicationValidator.UpdateCartParam} arg - Arg object.
|
|
1734
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1735
|
+
* @returns {Promise<PosCartApplicationModel.UpdateCartDetailResponse>} -
|
|
1736
|
+
* Success response
|
|
1737
|
+
* @name updateCart
|
|
1614
1738
|
* @summary: Update items in the cart
|
|
1615
|
-
* @description: <p>Use this API to update items added to the cart with the help of a request object containing attributes like item_quantity and item_size. These attributes will be fetched from the following APIs</p> <ul> <li><font color="monochrome">operation</font> Operation for current api call. <b>update_item</b> for update items. <b>remove_item</b> for removing items.</li> <li> <font color="monochrome">item_id</font> "/platform/content/v1/products/"</li> <li> <font color="monochrome">item_size</font> "/platform/content/v1/products/:slug/sizes/"</li> <li> <font color="monochrome">quantity</font> item quantity (must be greater than or equal to 1)</li> <li> <font color="monochrome">article_id</font> "/content/v1/products/:identifier/sizes/price/"</li> <li> <font color="monochrome">item_index</font> item position in the cart (must be greater than or equal to 0)</li> </ul>
|
|
1739
|
+
* @description: <p>Use this API to update items added to the cart with the help of a request object containing attributes like item_quantity and item_size. These attributes will be fetched from the following APIs</p> <ul> <li><font color="monochrome">operation</font> Operation for current api call. <b>update_item</b> for update items. <b>remove_item</b> for removing items.</li> <li> <font color="monochrome">item_id</font> "/platform/content/v1/products/"</li> <li> <font color="monochrome">item_size</font> "/platform/content/v1/products/:slug/sizes/"</li> <li> <font color="monochrome">quantity</font> item quantity (must be greater than or equal to 1)</li> <li> <font color="monochrome">article_id</font> "/content/v1/products/:identifier/sizes/price/"</li> <li> <font color="monochrome">item_index</font> item position in the cart (must be greater than or equal to 0)</li> </ul> - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/updateCart/).
|
|
1616
1740
|
*/
|
|
1617
|
-
async updateCart(
|
|
1618
|
-
|
|
1741
|
+
async updateCart(
|
|
1742
|
+
{ body, id, i, b, areaCode, buyNow } = {},
|
|
1743
|
+
{ headers } = { headers: false }
|
|
1744
|
+
) {
|
|
1745
|
+
const { error } = PosCartApplicationValidator.updateCart().validate(
|
|
1619
1746
|
{ body, id, i, b, areaCode, buyNow },
|
|
1620
1747
|
{ abortEarly: false, allowUnknown: true }
|
|
1621
1748
|
);
|
|
@@ -1624,16 +1751,17 @@ class PosCart {
|
|
|
1624
1751
|
}
|
|
1625
1752
|
|
|
1626
1753
|
// Showing warrnings if extra unknown parameters are found
|
|
1627
|
-
const {
|
|
1754
|
+
const {
|
|
1755
|
+
error: warrning,
|
|
1756
|
+
} = PosCartApplicationValidator.updateCart().validate(
|
|
1628
1757
|
{ body, id, i, b, areaCode, buyNow },
|
|
1629
1758
|
{ abortEarly: false, allowUnknown: false }
|
|
1630
1759
|
);
|
|
1631
1760
|
if (warrning) {
|
|
1632
1761
|
Logger({
|
|
1633
1762
|
level: "WARN",
|
|
1634
|
-
message:
|
|
1763
|
+
message: `Parameter Validation warrnings for application > PosCart > updateCart \n ${warrning}`,
|
|
1635
1764
|
});
|
|
1636
|
-
Logger({ level: "WARN", message: warrning });
|
|
1637
1765
|
}
|
|
1638
1766
|
|
|
1639
1767
|
const query_params = {};
|
|
@@ -1654,38 +1782,45 @@ class PosCart {
|
|
|
1654
1782
|
}),
|
|
1655
1783
|
query_params,
|
|
1656
1784
|
body,
|
|
1657
|
-
xHeaders
|
|
1785
|
+
xHeaders,
|
|
1786
|
+
{ headers }
|
|
1658
1787
|
);
|
|
1659
1788
|
|
|
1789
|
+
let responseData = response;
|
|
1790
|
+
if (headers) {
|
|
1791
|
+
responseData = response[0];
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1660
1794
|
const {
|
|
1661
1795
|
error: res_error,
|
|
1662
|
-
} =
|
|
1663
|
-
|
|
1664
|
-
allowUnknown: false
|
|
1665
|
-
|
|
1796
|
+
} = PosCartApplicationModel.UpdateCartDetailResponse().validate(
|
|
1797
|
+
responseData,
|
|
1798
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1799
|
+
);
|
|
1666
1800
|
|
|
1667
1801
|
if (res_error) {
|
|
1668
1802
|
Logger({
|
|
1669
1803
|
level: "WARN",
|
|
1670
|
-
message:
|
|
1804
|
+
message: `Response Validation Warnnings for application > PosCart > updateCart \n ${res_error}`,
|
|
1671
1805
|
});
|
|
1672
|
-
Logger({ level: "WARN", message: res_error });
|
|
1673
1806
|
}
|
|
1674
1807
|
|
|
1675
1808
|
return response;
|
|
1676
1809
|
}
|
|
1677
1810
|
|
|
1678
1811
|
/**
|
|
1679
|
-
* @param {
|
|
1680
|
-
* @param {
|
|
1681
|
-
* @
|
|
1682
|
-
* @
|
|
1683
|
-
* @returns {Promise<CartMetaResponse>} - Success response
|
|
1812
|
+
* @param {PosCartApplicationValidator.UpdateCartMetaParam} arg - Arg object.
|
|
1813
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1814
|
+
* @returns {Promise<PosCartApplicationModel.CartMetaResponse>} - Success response
|
|
1815
|
+
* @name updateCartMeta
|
|
1684
1816
|
* @summary: Update the cart meta
|
|
1685
|
-
* @description: Use this API to update cart meta like checkout_mode and gstin.
|
|
1817
|
+
* @description: Use this API to update cart meta like checkout_mode and gstin. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/updateCartMeta/).
|
|
1686
1818
|
*/
|
|
1687
|
-
async updateCartMeta(
|
|
1688
|
-
|
|
1819
|
+
async updateCartMeta(
|
|
1820
|
+
{ body, id, buyNow } = {},
|
|
1821
|
+
{ headers } = { headers: false }
|
|
1822
|
+
) {
|
|
1823
|
+
const { error } = PosCartApplicationValidator.updateCartMeta().validate(
|
|
1689
1824
|
{ body, id, buyNow },
|
|
1690
1825
|
{ abortEarly: false, allowUnknown: true }
|
|
1691
1826
|
);
|
|
@@ -1694,16 +1829,17 @@ class PosCart {
|
|
|
1694
1829
|
}
|
|
1695
1830
|
|
|
1696
1831
|
// Showing warrnings if extra unknown parameters are found
|
|
1697
|
-
const {
|
|
1832
|
+
const {
|
|
1833
|
+
error: warrning,
|
|
1834
|
+
} = PosCartApplicationValidator.updateCartMeta().validate(
|
|
1698
1835
|
{ body, id, buyNow },
|
|
1699
1836
|
{ abortEarly: false, allowUnknown: false }
|
|
1700
1837
|
);
|
|
1701
1838
|
if (warrning) {
|
|
1702
1839
|
Logger({
|
|
1703
1840
|
level: "WARN",
|
|
1704
|
-
message:
|
|
1841
|
+
message: `Parameter Validation warrnings for application > PosCart > updateCartMeta \n ${warrning}`,
|
|
1705
1842
|
});
|
|
1706
|
-
Logger({ level: "WARN", message: warrning });
|
|
1707
1843
|
}
|
|
1708
1844
|
|
|
1709
1845
|
const query_params = {};
|
|
@@ -1721,12 +1857,18 @@ class PosCart {
|
|
|
1721
1857
|
}),
|
|
1722
1858
|
query_params,
|
|
1723
1859
|
body,
|
|
1724
|
-
xHeaders
|
|
1860
|
+
xHeaders,
|
|
1861
|
+
{ headers }
|
|
1725
1862
|
);
|
|
1726
1863
|
|
|
1864
|
+
let responseData = response;
|
|
1865
|
+
if (headers) {
|
|
1866
|
+
responseData = response[0];
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1727
1869
|
const {
|
|
1728
1870
|
error: res_error,
|
|
1729
|
-
} =
|
|
1871
|
+
} = PosCartApplicationModel.CartMetaResponse().validate(responseData, {
|
|
1730
1872
|
abortEarly: false,
|
|
1731
1873
|
allowUnknown: false,
|
|
1732
1874
|
});
|
|
@@ -1734,25 +1876,30 @@ class PosCart {
|
|
|
1734
1876
|
if (res_error) {
|
|
1735
1877
|
Logger({
|
|
1736
1878
|
level: "WARN",
|
|
1737
|
-
message:
|
|
1879
|
+
message: `Response Validation Warnnings for application > PosCart > updateCartMeta \n ${res_error}`,
|
|
1738
1880
|
});
|
|
1739
|
-
Logger({ level: "WARN", message: res_error });
|
|
1740
1881
|
}
|
|
1741
1882
|
|
|
1742
1883
|
return response;
|
|
1743
1884
|
}
|
|
1744
1885
|
|
|
1745
1886
|
/**
|
|
1746
|
-
* @param {
|
|
1747
|
-
*
|
|
1748
|
-
*
|
|
1749
|
-
*
|
|
1750
|
-
* @returns {Promise<SharedCartResponse>} - Success response
|
|
1887
|
+
* @param {PosCartApplicationValidator.UpdateCartWithSharedItemsParam} arg
|
|
1888
|
+
* - Arg object.
|
|
1889
|
+
*
|
|
1890
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1891
|
+
* @returns {Promise<PosCartApplicationModel.SharedCartResponse>} - Success response
|
|
1892
|
+
* @name updateCartWithSharedItems
|
|
1751
1893
|
* @summary: Merge or replace existing cart
|
|
1752
|
-
* @description: Use this API to merge the shared cart with existing cart, or replace the existing cart with the shared cart. The `action` parameter is used to indicate the operation Merge or Replace.
|
|
1894
|
+
* @description: Use this API to merge the shared cart with existing cart, or replace the existing cart with the shared cart. The `action` parameter is used to indicate the operation Merge or Replace. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/updateCartWithSharedItems/).
|
|
1753
1895
|
*/
|
|
1754
|
-
async updateCartWithSharedItems(
|
|
1755
|
-
|
|
1896
|
+
async updateCartWithSharedItems(
|
|
1897
|
+
{ token, action } = {},
|
|
1898
|
+
{ headers } = { headers: false }
|
|
1899
|
+
) {
|
|
1900
|
+
const {
|
|
1901
|
+
error,
|
|
1902
|
+
} = PosCartApplicationValidator.updateCartWithSharedItems().validate(
|
|
1756
1903
|
{ token, action },
|
|
1757
1904
|
{ abortEarly: false, allowUnknown: true }
|
|
1758
1905
|
);
|
|
@@ -1763,16 +1910,15 @@ class PosCart {
|
|
|
1763
1910
|
// Showing warrnings if extra unknown parameters are found
|
|
1764
1911
|
const {
|
|
1765
1912
|
error: warrning,
|
|
1766
|
-
} =
|
|
1913
|
+
} = PosCartApplicationValidator.updateCartWithSharedItems().validate(
|
|
1767
1914
|
{ token, action },
|
|
1768
1915
|
{ abortEarly: false, allowUnknown: false }
|
|
1769
1916
|
);
|
|
1770
1917
|
if (warrning) {
|
|
1771
1918
|
Logger({
|
|
1772
1919
|
level: "WARN",
|
|
1773
|
-
message:
|
|
1920
|
+
message: `Parameter Validation warrnings for application > PosCart > updateCartWithSharedItems \n ${warrning}`,
|
|
1774
1921
|
});
|
|
1775
|
-
Logger({ level: "WARN", message: warrning });
|
|
1776
1922
|
}
|
|
1777
1923
|
|
|
1778
1924
|
const query_params = {};
|
|
@@ -1788,12 +1934,18 @@ class PosCart {
|
|
|
1788
1934
|
}),
|
|
1789
1935
|
query_params,
|
|
1790
1936
|
undefined,
|
|
1791
|
-
xHeaders
|
|
1937
|
+
xHeaders,
|
|
1938
|
+
{ headers }
|
|
1792
1939
|
);
|
|
1793
1940
|
|
|
1941
|
+
let responseData = response;
|
|
1942
|
+
if (headers) {
|
|
1943
|
+
responseData = response[0];
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1794
1946
|
const {
|
|
1795
1947
|
error: res_error,
|
|
1796
|
-
} =
|
|
1948
|
+
} = PosCartApplicationModel.SharedCartResponse().validate(responseData, {
|
|
1797
1949
|
abortEarly: false,
|
|
1798
1950
|
allowUnknown: false,
|
|
1799
1951
|
});
|
|
@@ -1801,42 +1953,27 @@ class PosCart {
|
|
|
1801
1953
|
if (res_error) {
|
|
1802
1954
|
Logger({
|
|
1803
1955
|
level: "WARN",
|
|
1804
|
-
message:
|
|
1956
|
+
message: `Response Validation Warnnings for application > PosCart > updateCartWithSharedItems \n ${res_error}`,
|
|
1805
1957
|
});
|
|
1806
|
-
Logger({ level: "WARN", message: res_error });
|
|
1807
1958
|
}
|
|
1808
1959
|
|
|
1809
1960
|
return response;
|
|
1810
1961
|
}
|
|
1811
1962
|
|
|
1812
1963
|
/**
|
|
1813
|
-
* @param {
|
|
1814
|
-
* @param {
|
|
1815
|
-
*
|
|
1816
|
-
*
|
|
1817
|
-
*
|
|
1818
|
-
* @param {string} [arg.id] - The unique identifier of the cart
|
|
1819
|
-
* @param {string} [arg.addressId] - ID allotted to an address
|
|
1820
|
-
* @param {string} [arg.areaCode] - The PIN Code of the destination address,
|
|
1821
|
-
* e.g. 400059
|
|
1822
|
-
* @param {string} [arg.orderType] - The order type of shipment HomeDelivery
|
|
1823
|
-
* - If the customer wants the order home-delivered PickAtStore - If the
|
|
1824
|
-
* customer wants the handover of an order at the store itself.
|
|
1825
|
-
* @param {UpdateCartShipmentRequest} arg.body
|
|
1826
|
-
* @returns {Promise<CartShipmentsResponse>} - Success response
|
|
1964
|
+
* @param {PosCartApplicationValidator.UpdateShipmentsParam} arg - Arg object.
|
|
1965
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1966
|
+
* @returns {Promise<PosCartApplicationModel.CartShipmentsResponse>} -
|
|
1967
|
+
* Success response
|
|
1968
|
+
* @name updateShipments
|
|
1827
1969
|
* @summary: Update shipment delivery type and quantity before checkout
|
|
1828
|
-
* @description: Use this API to update the delivery type and quantity as per customer's preference for either store pick-up or home-delivery.
|
|
1970
|
+
* @description: Use this API to update the delivery type and quantity as per customer's preference for either store pick-up or home-delivery. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/updateShipments/).
|
|
1829
1971
|
*/
|
|
1830
|
-
async updateShipments(
|
|
1831
|
-
body,
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
addressId,
|
|
1836
|
-
areaCode,
|
|
1837
|
-
orderType,
|
|
1838
|
-
} = {}) {
|
|
1839
|
-
const { error } = PosCartValidator.updateShipments().validate(
|
|
1972
|
+
async updateShipments(
|
|
1973
|
+
{ body, i, p, id, addressId, areaCode, orderType } = {},
|
|
1974
|
+
{ headers } = { headers: false }
|
|
1975
|
+
) {
|
|
1976
|
+
const { error } = PosCartApplicationValidator.updateShipments().validate(
|
|
1840
1977
|
{ body, i, p, id, addressId, areaCode, orderType },
|
|
1841
1978
|
{ abortEarly: false, allowUnknown: true }
|
|
1842
1979
|
);
|
|
@@ -1845,16 +1982,17 @@ class PosCart {
|
|
|
1845
1982
|
}
|
|
1846
1983
|
|
|
1847
1984
|
// Showing warrnings if extra unknown parameters are found
|
|
1848
|
-
const {
|
|
1985
|
+
const {
|
|
1986
|
+
error: warrning,
|
|
1987
|
+
} = PosCartApplicationValidator.updateShipments().validate(
|
|
1849
1988
|
{ body, i, p, id, addressId, areaCode, orderType },
|
|
1850
1989
|
{ abortEarly: false, allowUnknown: false }
|
|
1851
1990
|
);
|
|
1852
1991
|
if (warrning) {
|
|
1853
1992
|
Logger({
|
|
1854
1993
|
level: "WARN",
|
|
1855
|
-
message:
|
|
1994
|
+
message: `Parameter Validation warrnings for application > PosCart > updateShipments \n ${warrning}`,
|
|
1856
1995
|
});
|
|
1857
|
-
Logger({ level: "WARN", message: warrning });
|
|
1858
1996
|
}
|
|
1859
1997
|
|
|
1860
1998
|
const query_params = {};
|
|
@@ -1876,12 +2014,18 @@ class PosCart {
|
|
|
1876
2014
|
}),
|
|
1877
2015
|
query_params,
|
|
1878
2016
|
body,
|
|
1879
|
-
xHeaders
|
|
2017
|
+
xHeaders,
|
|
2018
|
+
{ headers }
|
|
1880
2019
|
);
|
|
1881
2020
|
|
|
2021
|
+
let responseData = response;
|
|
2022
|
+
if (headers) {
|
|
2023
|
+
responseData = response[0];
|
|
2024
|
+
}
|
|
2025
|
+
|
|
1882
2026
|
const {
|
|
1883
2027
|
error: res_error,
|
|
1884
|
-
} =
|
|
2028
|
+
} = PosCartApplicationModel.CartShipmentsResponse().validate(responseData, {
|
|
1885
2029
|
abortEarly: false,
|
|
1886
2030
|
allowUnknown: false,
|
|
1887
2031
|
});
|
|
@@ -1889,45 +2033,42 @@ class PosCart {
|
|
|
1889
2033
|
if (res_error) {
|
|
1890
2034
|
Logger({
|
|
1891
2035
|
level: "WARN",
|
|
1892
|
-
message:
|
|
2036
|
+
message: `Response Validation Warnnings for application > PosCart > updateShipments \n ${res_error}`,
|
|
1893
2037
|
});
|
|
1894
|
-
Logger({ level: "WARN", message: res_error });
|
|
1895
2038
|
}
|
|
1896
2039
|
|
|
1897
2040
|
return response;
|
|
1898
2041
|
}
|
|
1899
2042
|
|
|
1900
2043
|
/**
|
|
1901
|
-
* @param {
|
|
1902
|
-
*
|
|
1903
|
-
* @param {
|
|
1904
|
-
* @
|
|
1905
|
-
*
|
|
1906
|
-
* @
|
|
1907
|
-
* @param {string} [arg.aggregatorName] -
|
|
1908
|
-
* @param {string} [arg.merchantCode] -
|
|
1909
|
-
* @param {string} [arg.iin] -
|
|
1910
|
-
* @param {string} [arg.network] -
|
|
1911
|
-
* @param {string} [arg.type] -
|
|
1912
|
-
* @param {string} [arg.cardId] -
|
|
1913
|
-
* @returns {Promise<PaymentCouponValidate>} - Success response
|
|
2044
|
+
* @param {PosCartApplicationValidator.ValidateCouponForPaymentParam} arg -
|
|
2045
|
+
* Arg object.
|
|
2046
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2047
|
+
* @returns {Promise<PosCartApplicationModel.PaymentCouponValidate>} -
|
|
2048
|
+
* Success response
|
|
2049
|
+
* @name validateCouponForPayment
|
|
1914
2050
|
* @summary: Verify the coupon eligibility against the payment mode
|
|
1915
|
-
* @description: Use this API to validate a coupon against the payment mode such as NetBanking, Wallet, UPI etc.
|
|
2051
|
+
* @description: Use this API to validate a coupon against the payment mode such as NetBanking, Wallet, UPI etc. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/poscart/validateCouponForPayment/).
|
|
1916
2052
|
*/
|
|
1917
|
-
async validateCouponForPayment(
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
2053
|
+
async validateCouponForPayment(
|
|
2054
|
+
{
|
|
2055
|
+
id,
|
|
2056
|
+
buyNow,
|
|
2057
|
+
addressId,
|
|
2058
|
+
paymentMode,
|
|
2059
|
+
paymentIdentifier,
|
|
2060
|
+
aggregatorName,
|
|
2061
|
+
merchantCode,
|
|
2062
|
+
iin,
|
|
2063
|
+
network,
|
|
2064
|
+
type,
|
|
2065
|
+
cardId,
|
|
2066
|
+
} = {},
|
|
2067
|
+
{ headers } = { headers: false }
|
|
2068
|
+
) {
|
|
2069
|
+
const {
|
|
2070
|
+
error,
|
|
2071
|
+
} = PosCartApplicationValidator.validateCouponForPayment().validate(
|
|
1931
2072
|
{
|
|
1932
2073
|
id,
|
|
1933
2074
|
buyNow,
|
|
@@ -1950,7 +2091,7 @@ class PosCart {
|
|
|
1950
2091
|
// Showing warrnings if extra unknown parameters are found
|
|
1951
2092
|
const {
|
|
1952
2093
|
error: warrning,
|
|
1953
|
-
} =
|
|
2094
|
+
} = PosCartApplicationValidator.validateCouponForPayment().validate(
|
|
1954
2095
|
{
|
|
1955
2096
|
id,
|
|
1956
2097
|
buyNow,
|
|
@@ -1969,9 +2110,8 @@ class PosCart {
|
|
|
1969
2110
|
if (warrning) {
|
|
1970
2111
|
Logger({
|
|
1971
2112
|
level: "WARN",
|
|
1972
|
-
message:
|
|
2113
|
+
message: `Parameter Validation warrnings for application > PosCart > validateCouponForPayment \n ${warrning}`,
|
|
1973
2114
|
});
|
|
1974
|
-
Logger({ level: "WARN", message: warrning });
|
|
1975
2115
|
}
|
|
1976
2116
|
|
|
1977
2117
|
const query_params = {};
|
|
@@ -1998,12 +2138,18 @@ class PosCart {
|
|
|
1998
2138
|
}),
|
|
1999
2139
|
query_params,
|
|
2000
2140
|
undefined,
|
|
2001
|
-
xHeaders
|
|
2141
|
+
xHeaders,
|
|
2142
|
+
{ headers }
|
|
2002
2143
|
);
|
|
2003
2144
|
|
|
2145
|
+
let responseData = response;
|
|
2146
|
+
if (headers) {
|
|
2147
|
+
responseData = response[0];
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2004
2150
|
const {
|
|
2005
2151
|
error: res_error,
|
|
2006
|
-
} =
|
|
2152
|
+
} = PosCartApplicationModel.PaymentCouponValidate().validate(responseData, {
|
|
2007
2153
|
abortEarly: false,
|
|
2008
2154
|
allowUnknown: false,
|
|
2009
2155
|
});
|
|
@@ -2011,9 +2157,8 @@ class PosCart {
|
|
|
2011
2157
|
if (res_error) {
|
|
2012
2158
|
Logger({
|
|
2013
2159
|
level: "WARN",
|
|
2014
|
-
message:
|
|
2160
|
+
message: `Response Validation Warnnings for application > PosCart > validateCouponForPayment \n ${res_error}`,
|
|
2015
2161
|
});
|
|
2016
|
-
Logger({ level: "WARN", message: res_error });
|
|
2017
2162
|
}
|
|
2018
2163
|
|
|
2019
2164
|
return response;
|