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