@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
2
2
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
3
|
const Paginator = require("../../common/Paginator");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const DiscountPlatformValidator = require("./DiscountPlatformValidator");
|
|
5
|
+
const DiscountPlatformModel = require("./DiscountPlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
7
|
const Joi = require("joi");
|
|
8
8
|
|
|
@@ -12,14 +12,19 @@ class Discount {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* @param {
|
|
16
|
-
* @param {
|
|
17
|
-
* @
|
|
15
|
+
* @param {DiscountPlatformValidator.CancelDownloadJobParam} arg - Arg object
|
|
16
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
17
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
18
|
+
* @returns {Promise<DiscountPlatformModel.CancelJobResponse>} - Success response
|
|
19
|
+
* @name cancelDownloadJob
|
|
18
20
|
* @summary: Cancel Download Job.
|
|
19
|
-
* @description: Cancel Download Job.
|
|
21
|
+
* @description: Cancel Download Job. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/cancelDownloadJob/).
|
|
20
22
|
*/
|
|
21
|
-
async cancelDownloadJob(
|
|
22
|
-
|
|
23
|
+
async cancelDownloadJob(
|
|
24
|
+
{ id, requestHeaders } = { requestHeaders: {} },
|
|
25
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
26
|
+
) {
|
|
27
|
+
const { error } = DiscountPlatformValidator.cancelDownloadJob().validate(
|
|
23
28
|
{
|
|
24
29
|
id,
|
|
25
30
|
},
|
|
@@ -30,7 +35,9 @@ class Discount {
|
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
// Showing warrnings if extra unknown parameters are found
|
|
33
|
-
const {
|
|
38
|
+
const {
|
|
39
|
+
error: warrning,
|
|
40
|
+
} = DiscountPlatformValidator.cancelDownloadJob().validate(
|
|
34
41
|
{
|
|
35
42
|
id,
|
|
36
43
|
},
|
|
@@ -39,9 +46,8 @@ class Discount {
|
|
|
39
46
|
if (warrning) {
|
|
40
47
|
Logger({
|
|
41
48
|
level: "WARN",
|
|
42
|
-
message:
|
|
49
|
+
message: `Parameter Validation warrnings for platform > Discount > cancelDownloadJob \n ${warrning}`,
|
|
43
50
|
});
|
|
44
|
-
Logger({ level: "WARN", message: warrning });
|
|
45
51
|
}
|
|
46
52
|
|
|
47
53
|
const query_params = {};
|
|
@@ -54,12 +60,18 @@ class Discount {
|
|
|
54
60
|
`/service/platform/discount/v1.0/company/${this.config.companyId}/file/download/${id}/`,
|
|
55
61
|
query_params,
|
|
56
62
|
undefined,
|
|
57
|
-
xHeaders
|
|
63
|
+
{ ...xHeaders, ...requestHeaders },
|
|
64
|
+
{ responseHeaders }
|
|
58
65
|
);
|
|
59
66
|
|
|
67
|
+
let responseData = response;
|
|
68
|
+
if (responseHeaders) {
|
|
69
|
+
responseData = response[0];
|
|
70
|
+
}
|
|
71
|
+
|
|
60
72
|
const {
|
|
61
73
|
error: res_error,
|
|
62
|
-
} =
|
|
74
|
+
} = DiscountPlatformModel.CancelJobResponse().validate(responseData, {
|
|
63
75
|
abortEarly: false,
|
|
64
76
|
allowUnknown: false,
|
|
65
77
|
});
|
|
@@ -67,23 +79,27 @@ class Discount {
|
|
|
67
79
|
if (res_error) {
|
|
68
80
|
Logger({
|
|
69
81
|
level: "WARN",
|
|
70
|
-
message:
|
|
82
|
+
message: `Response Validation Warnnings for platform > Discount > cancelDownloadJob \n ${res_error}`,
|
|
71
83
|
});
|
|
72
|
-
Logger({ level: "WARN", message: res_error });
|
|
73
84
|
}
|
|
74
85
|
|
|
75
86
|
return response;
|
|
76
87
|
}
|
|
77
88
|
|
|
78
89
|
/**
|
|
79
|
-
* @param {
|
|
80
|
-
* @param {
|
|
81
|
-
* @
|
|
90
|
+
* @param {DiscountPlatformValidator.CancelValidationJobParam} arg - Arg object
|
|
91
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
92
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
93
|
+
* @returns {Promise<DiscountPlatformModel.CancelJobResponse>} - Success response
|
|
94
|
+
* @name cancelValidationJob
|
|
82
95
|
* @summary: Cancel Validation Job.
|
|
83
|
-
* @description: Cancel Validation Job.
|
|
96
|
+
* @description: Cancel Validation Job. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/cancelValidationJob/).
|
|
84
97
|
*/
|
|
85
|
-
async cancelValidationJob(
|
|
86
|
-
|
|
98
|
+
async cancelValidationJob(
|
|
99
|
+
{ id, requestHeaders } = { requestHeaders: {} },
|
|
100
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
101
|
+
) {
|
|
102
|
+
const { error } = DiscountPlatformValidator.cancelValidationJob().validate(
|
|
87
103
|
{
|
|
88
104
|
id,
|
|
89
105
|
},
|
|
@@ -96,7 +112,7 @@ class Discount {
|
|
|
96
112
|
// Showing warrnings if extra unknown parameters are found
|
|
97
113
|
const {
|
|
98
114
|
error: warrning,
|
|
99
|
-
} =
|
|
115
|
+
} = DiscountPlatformValidator.cancelValidationJob().validate(
|
|
100
116
|
{
|
|
101
117
|
id,
|
|
102
118
|
},
|
|
@@ -105,9 +121,8 @@ class Discount {
|
|
|
105
121
|
if (warrning) {
|
|
106
122
|
Logger({
|
|
107
123
|
level: "WARN",
|
|
108
|
-
message:
|
|
124
|
+
message: `Parameter Validation warrnings for platform > Discount > cancelValidationJob \n ${warrning}`,
|
|
109
125
|
});
|
|
110
|
-
Logger({ level: "WARN", message: warrning });
|
|
111
126
|
}
|
|
112
127
|
|
|
113
128
|
const query_params = {};
|
|
@@ -120,12 +135,18 @@ class Discount {
|
|
|
120
135
|
`/service/platform/discount/v1.0/company/${this.config.companyId}/file/validation/${id}/`,
|
|
121
136
|
query_params,
|
|
122
137
|
undefined,
|
|
123
|
-
xHeaders
|
|
138
|
+
{ ...xHeaders, ...requestHeaders },
|
|
139
|
+
{ responseHeaders }
|
|
124
140
|
);
|
|
125
141
|
|
|
142
|
+
let responseData = response;
|
|
143
|
+
if (responseHeaders) {
|
|
144
|
+
responseData = response[0];
|
|
145
|
+
}
|
|
146
|
+
|
|
126
147
|
const {
|
|
127
148
|
error: res_error,
|
|
128
|
-
} =
|
|
149
|
+
} = DiscountPlatformModel.CancelJobResponse().validate(responseData, {
|
|
129
150
|
abortEarly: false,
|
|
130
151
|
allowUnknown: false,
|
|
131
152
|
});
|
|
@@ -133,23 +154,27 @@ class Discount {
|
|
|
133
154
|
if (res_error) {
|
|
134
155
|
Logger({
|
|
135
156
|
level: "WARN",
|
|
136
|
-
message:
|
|
157
|
+
message: `Response Validation Warnnings for platform > Discount > cancelValidationJob \n ${res_error}`,
|
|
137
158
|
});
|
|
138
|
-
Logger({ level: "WARN", message: res_error });
|
|
139
159
|
}
|
|
140
160
|
|
|
141
161
|
return response;
|
|
142
162
|
}
|
|
143
163
|
|
|
144
164
|
/**
|
|
145
|
-
* @param {
|
|
146
|
-
* @param {
|
|
147
|
-
* @
|
|
165
|
+
* @param {DiscountPlatformValidator.CreateDiscountParam} arg - Arg object
|
|
166
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
167
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
168
|
+
* @returns {Promise<DiscountPlatformModel.DiscountJob>} - Success response
|
|
169
|
+
* @name createDiscount
|
|
148
170
|
* @summary: Create Discount.
|
|
149
|
-
* @description: Create Discount.
|
|
171
|
+
* @description: Create Discount. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/createDiscount/).
|
|
150
172
|
*/
|
|
151
|
-
async createDiscount(
|
|
152
|
-
|
|
173
|
+
async createDiscount(
|
|
174
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
175
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
176
|
+
) {
|
|
177
|
+
const { error } = DiscountPlatformValidator.createDiscount().validate(
|
|
153
178
|
{
|
|
154
179
|
body,
|
|
155
180
|
},
|
|
@@ -160,7 +185,9 @@ class Discount {
|
|
|
160
185
|
}
|
|
161
186
|
|
|
162
187
|
// Showing warrnings if extra unknown parameters are found
|
|
163
|
-
const {
|
|
188
|
+
const {
|
|
189
|
+
error: warrning,
|
|
190
|
+
} = DiscountPlatformValidator.createDiscount().validate(
|
|
164
191
|
{
|
|
165
192
|
body,
|
|
166
193
|
},
|
|
@@ -169,9 +196,8 @@ class Discount {
|
|
|
169
196
|
if (warrning) {
|
|
170
197
|
Logger({
|
|
171
198
|
level: "WARN",
|
|
172
|
-
message:
|
|
199
|
+
message: `Parameter Validation warrnings for platform > Discount > createDiscount \n ${warrning}`,
|
|
173
200
|
});
|
|
174
|
-
Logger({ level: "WARN", message: warrning });
|
|
175
201
|
}
|
|
176
202
|
|
|
177
203
|
const query_params = {};
|
|
@@ -184,35 +210,46 @@ class Discount {
|
|
|
184
210
|
`/service/platform/discount/v1.0/company/${this.config.companyId}/job/`,
|
|
185
211
|
query_params,
|
|
186
212
|
body,
|
|
187
|
-
xHeaders
|
|
213
|
+
{ ...xHeaders, ...requestHeaders },
|
|
214
|
+
{ responseHeaders }
|
|
188
215
|
);
|
|
189
216
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
217
|
+
let responseData = response;
|
|
218
|
+
if (responseHeaders) {
|
|
219
|
+
responseData = response[0];
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const {
|
|
223
|
+
error: res_error,
|
|
224
|
+
} = DiscountPlatformModel.DiscountJob().validate(responseData, {
|
|
225
|
+
abortEarly: false,
|
|
226
|
+
allowUnknown: false,
|
|
227
|
+
});
|
|
194
228
|
|
|
195
229
|
if (res_error) {
|
|
196
230
|
Logger({
|
|
197
231
|
level: "WARN",
|
|
198
|
-
message:
|
|
232
|
+
message: `Response Validation Warnnings for platform > Discount > createDiscount \n ${res_error}`,
|
|
199
233
|
});
|
|
200
|
-
Logger({ level: "WARN", message: res_error });
|
|
201
234
|
}
|
|
202
235
|
|
|
203
236
|
return response;
|
|
204
237
|
}
|
|
205
238
|
|
|
206
239
|
/**
|
|
207
|
-
* @param {
|
|
208
|
-
* @param {
|
|
209
|
-
* @param {
|
|
210
|
-
* @returns {Promise<FileJobResponse>} - Success response
|
|
240
|
+
* @param {DiscountPlatformValidator.DownloadDiscountFileParam} arg - Arg object
|
|
241
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
242
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
243
|
+
* @returns {Promise<DiscountPlatformModel.FileJobResponse>} - Success response
|
|
244
|
+
* @name downloadDiscountFile
|
|
211
245
|
* @summary: Validate File.
|
|
212
|
-
* @description: Validate File.
|
|
246
|
+
* @description: Validate File. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/downloadDiscountFile/).
|
|
213
247
|
*/
|
|
214
|
-
async downloadDiscountFile(
|
|
215
|
-
|
|
248
|
+
async downloadDiscountFile(
|
|
249
|
+
{ type, body, requestHeaders } = { requestHeaders: {} },
|
|
250
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
251
|
+
) {
|
|
252
|
+
const { error } = DiscountPlatformValidator.downloadDiscountFile().validate(
|
|
216
253
|
{
|
|
217
254
|
type,
|
|
218
255
|
body,
|
|
@@ -226,7 +263,7 @@ class Discount {
|
|
|
226
263
|
// Showing warrnings if extra unknown parameters are found
|
|
227
264
|
const {
|
|
228
265
|
error: warrning,
|
|
229
|
-
} =
|
|
266
|
+
} = DiscountPlatformValidator.downloadDiscountFile().validate(
|
|
230
267
|
{
|
|
231
268
|
type,
|
|
232
269
|
body,
|
|
@@ -236,9 +273,8 @@ class Discount {
|
|
|
236
273
|
if (warrning) {
|
|
237
274
|
Logger({
|
|
238
275
|
level: "WARN",
|
|
239
|
-
message:
|
|
276
|
+
message: `Parameter Validation warrnings for platform > Discount > downloadDiscountFile \n ${warrning}`,
|
|
240
277
|
});
|
|
241
|
-
Logger({ level: "WARN", message: warrning });
|
|
242
278
|
}
|
|
243
279
|
|
|
244
280
|
const query_params = {};
|
|
@@ -251,12 +287,18 @@ class Discount {
|
|
|
251
287
|
`/service/platform/discount/v1.0/company/${this.config.companyId}/file/${type}/download/`,
|
|
252
288
|
query_params,
|
|
253
289
|
body,
|
|
254
|
-
xHeaders
|
|
290
|
+
{ ...xHeaders, ...requestHeaders },
|
|
291
|
+
{ responseHeaders }
|
|
255
292
|
);
|
|
256
293
|
|
|
294
|
+
let responseData = response;
|
|
295
|
+
if (responseHeaders) {
|
|
296
|
+
responseData = response[0];
|
|
297
|
+
}
|
|
298
|
+
|
|
257
299
|
const {
|
|
258
300
|
error: res_error,
|
|
259
|
-
} =
|
|
301
|
+
} = DiscountPlatformModel.FileJobResponse().validate(responseData, {
|
|
260
302
|
abortEarly: false,
|
|
261
303
|
allowUnknown: false,
|
|
262
304
|
});
|
|
@@ -264,23 +306,27 @@ class Discount {
|
|
|
264
306
|
if (res_error) {
|
|
265
307
|
Logger({
|
|
266
308
|
level: "WARN",
|
|
267
|
-
message:
|
|
309
|
+
message: `Response Validation Warnnings for platform > Discount > downloadDiscountFile \n ${res_error}`,
|
|
268
310
|
});
|
|
269
|
-
Logger({ level: "WARN", message: res_error });
|
|
270
311
|
}
|
|
271
312
|
|
|
272
313
|
return response;
|
|
273
314
|
}
|
|
274
315
|
|
|
275
316
|
/**
|
|
276
|
-
* @param {
|
|
277
|
-
* @param {
|
|
278
|
-
* @
|
|
317
|
+
* @param {DiscountPlatformValidator.GetDiscountParam} arg - Arg object
|
|
318
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
319
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
320
|
+
* @returns {Promise<DiscountPlatformModel.DiscountJob>} - Success response
|
|
321
|
+
* @name getDiscount
|
|
279
322
|
* @summary: Fetch discount.
|
|
280
|
-
* @description: Fetch discount.
|
|
323
|
+
* @description: Fetch discount. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/getDiscount/).
|
|
281
324
|
*/
|
|
282
|
-
async getDiscount(
|
|
283
|
-
|
|
325
|
+
async getDiscount(
|
|
326
|
+
{ id, requestHeaders } = { requestHeaders: {} },
|
|
327
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
328
|
+
) {
|
|
329
|
+
const { error } = DiscountPlatformValidator.getDiscount().validate(
|
|
284
330
|
{
|
|
285
331
|
id,
|
|
286
332
|
},
|
|
@@ -291,7 +337,9 @@ class Discount {
|
|
|
291
337
|
}
|
|
292
338
|
|
|
293
339
|
// Showing warrnings if extra unknown parameters are found
|
|
294
|
-
const {
|
|
340
|
+
const {
|
|
341
|
+
error: warrning,
|
|
342
|
+
} = DiscountPlatformValidator.getDiscount().validate(
|
|
295
343
|
{
|
|
296
344
|
id,
|
|
297
345
|
},
|
|
@@ -300,9 +348,8 @@ class Discount {
|
|
|
300
348
|
if (warrning) {
|
|
301
349
|
Logger({
|
|
302
350
|
level: "WARN",
|
|
303
|
-
message:
|
|
351
|
+
message: `Parameter Validation warrnings for platform > Discount > getDiscount \n ${warrning}`,
|
|
304
352
|
});
|
|
305
|
-
Logger({ level: "WARN", message: warrning });
|
|
306
353
|
}
|
|
307
354
|
|
|
308
355
|
const query_params = {};
|
|
@@ -315,53 +362,57 @@ class Discount {
|
|
|
315
362
|
`/service/platform/discount/v1.0/company/${this.config.companyId}/job/${id}/`,
|
|
316
363
|
query_params,
|
|
317
364
|
undefined,
|
|
318
|
-
xHeaders
|
|
365
|
+
{ ...xHeaders, ...requestHeaders },
|
|
366
|
+
{ responseHeaders }
|
|
319
367
|
);
|
|
320
368
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
369
|
+
let responseData = response;
|
|
370
|
+
if (responseHeaders) {
|
|
371
|
+
responseData = response[0];
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
const {
|
|
375
|
+
error: res_error,
|
|
376
|
+
} = DiscountPlatformModel.DiscountJob().validate(responseData, {
|
|
377
|
+
abortEarly: false,
|
|
378
|
+
allowUnknown: false,
|
|
379
|
+
});
|
|
325
380
|
|
|
326
381
|
if (res_error) {
|
|
327
382
|
Logger({
|
|
328
383
|
level: "WARN",
|
|
329
|
-
message:
|
|
384
|
+
message: `Response Validation Warnnings for platform > Discount > getDiscount \n ${res_error}`,
|
|
330
385
|
});
|
|
331
|
-
Logger({ level: "WARN", message: res_error });
|
|
332
386
|
}
|
|
333
387
|
|
|
334
388
|
return response;
|
|
335
389
|
}
|
|
336
390
|
|
|
337
391
|
/**
|
|
338
|
-
* @param {
|
|
339
|
-
* @param {
|
|
340
|
-
* @param {
|
|
341
|
-
*
|
|
342
|
-
* @
|
|
343
|
-
* @param {number} [arg.pageSize] - Page size. Default is 12.
|
|
344
|
-
* @param {boolean} [arg.archived] - Archived. Default is false.
|
|
345
|
-
* @param {number} [arg.month] - Month. Default is current month.
|
|
346
|
-
* @param {number} [arg.year] - Year. Default is current year.
|
|
347
|
-
* @param {string} [arg.type] - Basic or custom.
|
|
348
|
-
* @param {string[]} [arg.appIds] - Application ids.
|
|
349
|
-
* @returns {Promise<ListOrCalender>} - Success response
|
|
392
|
+
* @param {DiscountPlatformValidator.GetDiscountsParam} arg - Arg object
|
|
393
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
394
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
395
|
+
* @returns {Promise<DiscountPlatformModel.ListOrCalender>} - Success response
|
|
396
|
+
* @name getDiscounts
|
|
350
397
|
* @summary: Fetch discount list.
|
|
351
|
-
* @description: Fetch discount list.
|
|
398
|
+
* @description: Fetch discount list. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/getDiscounts/).
|
|
352
399
|
*/
|
|
353
|
-
async getDiscounts(
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
400
|
+
async getDiscounts(
|
|
401
|
+
{
|
|
402
|
+
view,
|
|
403
|
+
q,
|
|
404
|
+
pageNo,
|
|
405
|
+
pageSize,
|
|
406
|
+
archived,
|
|
407
|
+
month,
|
|
408
|
+
year,
|
|
409
|
+
type,
|
|
410
|
+
appIds,
|
|
411
|
+
requestHeaders,
|
|
412
|
+
} = { requestHeaders: {} },
|
|
413
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
414
|
+
) {
|
|
415
|
+
const { error } = DiscountPlatformValidator.getDiscounts().validate(
|
|
365
416
|
{
|
|
366
417
|
view,
|
|
367
418
|
q,
|
|
@@ -380,7 +431,9 @@ class Discount {
|
|
|
380
431
|
}
|
|
381
432
|
|
|
382
433
|
// Showing warrnings if extra unknown parameters are found
|
|
383
|
-
const {
|
|
434
|
+
const {
|
|
435
|
+
error: warrning,
|
|
436
|
+
} = DiscountPlatformValidator.getDiscounts().validate(
|
|
384
437
|
{
|
|
385
438
|
view,
|
|
386
439
|
q,
|
|
@@ -397,9 +450,8 @@ class Discount {
|
|
|
397
450
|
if (warrning) {
|
|
398
451
|
Logger({
|
|
399
452
|
level: "WARN",
|
|
400
|
-
message:
|
|
453
|
+
message: `Parameter Validation warrnings for platform > Discount > getDiscounts \n ${warrning}`,
|
|
401
454
|
});
|
|
402
|
-
Logger({ level: "WARN", message: warrning });
|
|
403
455
|
}
|
|
404
456
|
|
|
405
457
|
const query_params = {};
|
|
@@ -421,12 +473,18 @@ class Discount {
|
|
|
421
473
|
`/service/platform/discount/v1.0/company/${this.config.companyId}/job/`,
|
|
422
474
|
query_params,
|
|
423
475
|
undefined,
|
|
424
|
-
xHeaders
|
|
476
|
+
{ ...xHeaders, ...requestHeaders },
|
|
477
|
+
{ responseHeaders }
|
|
425
478
|
);
|
|
426
479
|
|
|
480
|
+
let responseData = response;
|
|
481
|
+
if (responseHeaders) {
|
|
482
|
+
responseData = response[0];
|
|
483
|
+
}
|
|
484
|
+
|
|
427
485
|
const {
|
|
428
486
|
error: res_error,
|
|
429
|
-
} =
|
|
487
|
+
} = DiscountPlatformModel.ListOrCalender().validate(responseData, {
|
|
430
488
|
abortEarly: false,
|
|
431
489
|
allowUnknown: false,
|
|
432
490
|
});
|
|
@@ -434,9 +492,8 @@ class Discount {
|
|
|
434
492
|
if (res_error) {
|
|
435
493
|
Logger({
|
|
436
494
|
level: "WARN",
|
|
437
|
-
message:
|
|
495
|
+
message: `Response Validation Warnnings for platform > Discount > getDiscounts \n ${res_error}`,
|
|
438
496
|
});
|
|
439
|
-
Logger({ level: "WARN", message: res_error });
|
|
440
497
|
}
|
|
441
498
|
|
|
442
499
|
return response;
|
|
@@ -444,13 +501,69 @@ class Discount {
|
|
|
444
501
|
|
|
445
502
|
/**
|
|
446
503
|
* @param {Object} arg - Arg object.
|
|
447
|
-
* @param {string} arg.
|
|
448
|
-
* @
|
|
504
|
+
* @param {string} [arg.view] - Listing or calender. Default is listing.
|
|
505
|
+
* @param {string} [arg.q] - The search query. This can be a partial or
|
|
506
|
+
* complete name of a discount.
|
|
507
|
+
* @param {number} [arg.pageSize] - Page size. Default is 12.
|
|
508
|
+
* @param {boolean} [arg.archived] - Archived. Default is false.
|
|
509
|
+
* @param {number} [arg.month] - Month. Default is current month.
|
|
510
|
+
* @param {number} [arg.year] - Year. Default is current year.
|
|
511
|
+
* @param {string} [arg.type] - Basic or custom.
|
|
512
|
+
* @param {string[]} [arg.appIds] - Application ids.
|
|
513
|
+
* @returns {Paginator<DiscountPlatformModel.ListOrCalender>}
|
|
514
|
+
* @summary: Fetch discount list.
|
|
515
|
+
* @description: Fetch discount list.
|
|
516
|
+
*/
|
|
517
|
+
getDiscountsPaginator({
|
|
518
|
+
view,
|
|
519
|
+
q,
|
|
520
|
+
pageSize,
|
|
521
|
+
archived,
|
|
522
|
+
month,
|
|
523
|
+
year,
|
|
524
|
+
type,
|
|
525
|
+
appIds,
|
|
526
|
+
} = {}) {
|
|
527
|
+
const paginator = new Paginator();
|
|
528
|
+
const callback = async () => {
|
|
529
|
+
const pageId = paginator.nextId;
|
|
530
|
+
const pageNo = paginator.pageNo;
|
|
531
|
+
const pageType = "number";
|
|
532
|
+
const data = await this.getDiscounts({
|
|
533
|
+
view: view,
|
|
534
|
+
q: q,
|
|
535
|
+
pageNo: pageNo,
|
|
536
|
+
pageSize: pageSize,
|
|
537
|
+
archived: archived,
|
|
538
|
+
month: month,
|
|
539
|
+
year: year,
|
|
540
|
+
type: type,
|
|
541
|
+
appIds: appIds,
|
|
542
|
+
});
|
|
543
|
+
paginator.setPaginator({
|
|
544
|
+
hasNext: data.page.has_next ? true : false,
|
|
545
|
+
nextId: data.page.next_id,
|
|
546
|
+
});
|
|
547
|
+
return data;
|
|
548
|
+
};
|
|
549
|
+
paginator.setCallback(callback.bind(this));
|
|
550
|
+
return paginator;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* @param {DiscountPlatformValidator.GetDownloadJobParam} arg - Arg object
|
|
555
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
556
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
557
|
+
* @returns {Promise<DiscountPlatformModel.FileJobResponse>} - Success response
|
|
558
|
+
* @name getDownloadJob
|
|
449
559
|
* @summary: Download File Job.
|
|
450
|
-
* @description: Download File Job.
|
|
560
|
+
* @description: Download File Job. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/getDownloadJob/).
|
|
451
561
|
*/
|
|
452
|
-
async getDownloadJob(
|
|
453
|
-
|
|
562
|
+
async getDownloadJob(
|
|
563
|
+
{ id, requestHeaders } = { requestHeaders: {} },
|
|
564
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
565
|
+
) {
|
|
566
|
+
const { error } = DiscountPlatformValidator.getDownloadJob().validate(
|
|
454
567
|
{
|
|
455
568
|
id,
|
|
456
569
|
},
|
|
@@ -461,7 +574,9 @@ class Discount {
|
|
|
461
574
|
}
|
|
462
575
|
|
|
463
576
|
// Showing warrnings if extra unknown parameters are found
|
|
464
|
-
const {
|
|
577
|
+
const {
|
|
578
|
+
error: warrning,
|
|
579
|
+
} = DiscountPlatformValidator.getDownloadJob().validate(
|
|
465
580
|
{
|
|
466
581
|
id,
|
|
467
582
|
},
|
|
@@ -470,9 +585,8 @@ class Discount {
|
|
|
470
585
|
if (warrning) {
|
|
471
586
|
Logger({
|
|
472
587
|
level: "WARN",
|
|
473
|
-
message:
|
|
588
|
+
message: `Parameter Validation warrnings for platform > Discount > getDownloadJob \n ${warrning}`,
|
|
474
589
|
});
|
|
475
|
-
Logger({ level: "WARN", message: warrning });
|
|
476
590
|
}
|
|
477
591
|
|
|
478
592
|
const query_params = {};
|
|
@@ -485,12 +599,18 @@ class Discount {
|
|
|
485
599
|
`/service/platform/discount/v1.0/company/${this.config.companyId}/file/download/${id}/`,
|
|
486
600
|
query_params,
|
|
487
601
|
undefined,
|
|
488
|
-
xHeaders
|
|
602
|
+
{ ...xHeaders, ...requestHeaders },
|
|
603
|
+
{ responseHeaders }
|
|
489
604
|
);
|
|
490
605
|
|
|
606
|
+
let responseData = response;
|
|
607
|
+
if (responseHeaders) {
|
|
608
|
+
responseData = response[0];
|
|
609
|
+
}
|
|
610
|
+
|
|
491
611
|
const {
|
|
492
612
|
error: res_error,
|
|
493
|
-
} =
|
|
613
|
+
} = DiscountPlatformModel.FileJobResponse().validate(responseData, {
|
|
494
614
|
abortEarly: false,
|
|
495
615
|
allowUnknown: false,
|
|
496
616
|
});
|
|
@@ -498,23 +618,27 @@ class Discount {
|
|
|
498
618
|
if (res_error) {
|
|
499
619
|
Logger({
|
|
500
620
|
level: "WARN",
|
|
501
|
-
message:
|
|
621
|
+
message: `Response Validation Warnnings for platform > Discount > getDownloadJob \n ${res_error}`,
|
|
502
622
|
});
|
|
503
|
-
Logger({ level: "WARN", message: res_error });
|
|
504
623
|
}
|
|
505
624
|
|
|
506
625
|
return response;
|
|
507
626
|
}
|
|
508
627
|
|
|
509
628
|
/**
|
|
510
|
-
* @param {
|
|
511
|
-
* @param {
|
|
512
|
-
* @
|
|
629
|
+
* @param {DiscountPlatformValidator.GetValidationJobParam} arg - Arg object
|
|
630
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
631
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
632
|
+
* @returns {Promise<DiscountPlatformModel.FileJobResponse>} - Success response
|
|
633
|
+
* @name getValidationJob
|
|
513
634
|
* @summary: Validate File Job.
|
|
514
|
-
* @description: Validate File Job.
|
|
635
|
+
* @description: Validate File Job. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/getValidationJob/).
|
|
515
636
|
*/
|
|
516
|
-
async getValidationJob(
|
|
517
|
-
|
|
637
|
+
async getValidationJob(
|
|
638
|
+
{ id, requestHeaders } = { requestHeaders: {} },
|
|
639
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
640
|
+
) {
|
|
641
|
+
const { error } = DiscountPlatformValidator.getValidationJob().validate(
|
|
518
642
|
{
|
|
519
643
|
id,
|
|
520
644
|
},
|
|
@@ -525,7 +649,9 @@ class Discount {
|
|
|
525
649
|
}
|
|
526
650
|
|
|
527
651
|
// Showing warrnings if extra unknown parameters are found
|
|
528
|
-
const {
|
|
652
|
+
const {
|
|
653
|
+
error: warrning,
|
|
654
|
+
} = DiscountPlatformValidator.getValidationJob().validate(
|
|
529
655
|
{
|
|
530
656
|
id,
|
|
531
657
|
},
|
|
@@ -534,9 +660,8 @@ class Discount {
|
|
|
534
660
|
if (warrning) {
|
|
535
661
|
Logger({
|
|
536
662
|
level: "WARN",
|
|
537
|
-
message:
|
|
663
|
+
message: `Parameter Validation warrnings for platform > Discount > getValidationJob \n ${warrning}`,
|
|
538
664
|
});
|
|
539
|
-
Logger({ level: "WARN", message: warrning });
|
|
540
665
|
}
|
|
541
666
|
|
|
542
667
|
const query_params = {};
|
|
@@ -549,12 +674,18 @@ class Discount {
|
|
|
549
674
|
`/service/platform/discount/v1.0/company/${this.config.companyId}/file/validation/${id}/`,
|
|
550
675
|
query_params,
|
|
551
676
|
undefined,
|
|
552
|
-
xHeaders
|
|
677
|
+
{ ...xHeaders, ...requestHeaders },
|
|
678
|
+
{ responseHeaders }
|
|
553
679
|
);
|
|
554
680
|
|
|
681
|
+
let responseData = response;
|
|
682
|
+
if (responseHeaders) {
|
|
683
|
+
responseData = response[0];
|
|
684
|
+
}
|
|
685
|
+
|
|
555
686
|
const {
|
|
556
687
|
error: res_error,
|
|
557
|
-
} =
|
|
688
|
+
} = DiscountPlatformModel.FileJobResponse().validate(responseData, {
|
|
558
689
|
abortEarly: false,
|
|
559
690
|
allowUnknown: false,
|
|
560
691
|
});
|
|
@@ -562,24 +693,27 @@ class Discount {
|
|
|
562
693
|
if (res_error) {
|
|
563
694
|
Logger({
|
|
564
695
|
level: "WARN",
|
|
565
|
-
message:
|
|
696
|
+
message: `Response Validation Warnnings for platform > Discount > getValidationJob \n ${res_error}`,
|
|
566
697
|
});
|
|
567
|
-
Logger({ level: "WARN", message: res_error });
|
|
568
698
|
}
|
|
569
699
|
|
|
570
700
|
return response;
|
|
571
701
|
}
|
|
572
702
|
|
|
573
703
|
/**
|
|
574
|
-
* @param {
|
|
575
|
-
* @param {
|
|
576
|
-
* @param {
|
|
577
|
-
* @returns {Promise<DiscountJob>} - Success response
|
|
704
|
+
* @param {DiscountPlatformValidator.UpdateDiscountParam} arg - Arg object
|
|
705
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
706
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
707
|
+
* @returns {Promise<DiscountPlatformModel.DiscountJob>} - Success response
|
|
708
|
+
* @name updateDiscount
|
|
578
709
|
* @summary: Create Discount.
|
|
579
|
-
* @description: Create Discount.
|
|
710
|
+
* @description: Create Discount. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/updateDiscount/).
|
|
580
711
|
*/
|
|
581
|
-
async updateDiscount(
|
|
582
|
-
|
|
712
|
+
async updateDiscount(
|
|
713
|
+
{ id, body, requestHeaders } = { requestHeaders: {} },
|
|
714
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
715
|
+
) {
|
|
716
|
+
const { error } = DiscountPlatformValidator.updateDiscount().validate(
|
|
583
717
|
{
|
|
584
718
|
id,
|
|
585
719
|
body,
|
|
@@ -591,7 +725,9 @@ class Discount {
|
|
|
591
725
|
}
|
|
592
726
|
|
|
593
727
|
// Showing warrnings if extra unknown parameters are found
|
|
594
|
-
const {
|
|
728
|
+
const {
|
|
729
|
+
error: warrning,
|
|
730
|
+
} = DiscountPlatformValidator.updateDiscount().validate(
|
|
595
731
|
{
|
|
596
732
|
id,
|
|
597
733
|
body,
|
|
@@ -601,9 +737,8 @@ class Discount {
|
|
|
601
737
|
if (warrning) {
|
|
602
738
|
Logger({
|
|
603
739
|
level: "WARN",
|
|
604
|
-
message:
|
|
740
|
+
message: `Parameter Validation warrnings for platform > Discount > updateDiscount \n ${warrning}`,
|
|
605
741
|
});
|
|
606
|
-
Logger({ level: "WARN", message: warrning });
|
|
607
742
|
}
|
|
608
743
|
|
|
609
744
|
const query_params = {};
|
|
@@ -616,35 +751,46 @@ class Discount {
|
|
|
616
751
|
`/service/platform/discount/v1.0/company/${this.config.companyId}/job/${id}/`,
|
|
617
752
|
query_params,
|
|
618
753
|
body,
|
|
619
|
-
xHeaders
|
|
754
|
+
{ ...xHeaders, ...requestHeaders },
|
|
755
|
+
{ responseHeaders }
|
|
620
756
|
);
|
|
621
757
|
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
758
|
+
let responseData = response;
|
|
759
|
+
if (responseHeaders) {
|
|
760
|
+
responseData = response[0];
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
const {
|
|
764
|
+
error: res_error,
|
|
765
|
+
} = DiscountPlatformModel.DiscountJob().validate(responseData, {
|
|
766
|
+
abortEarly: false,
|
|
767
|
+
allowUnknown: false,
|
|
768
|
+
});
|
|
626
769
|
|
|
627
770
|
if (res_error) {
|
|
628
771
|
Logger({
|
|
629
772
|
level: "WARN",
|
|
630
|
-
message:
|
|
773
|
+
message: `Response Validation Warnnings for platform > Discount > updateDiscount \n ${res_error}`,
|
|
631
774
|
});
|
|
632
|
-
Logger({ level: "WARN", message: res_error });
|
|
633
775
|
}
|
|
634
776
|
|
|
635
777
|
return response;
|
|
636
778
|
}
|
|
637
779
|
|
|
638
780
|
/**
|
|
639
|
-
* @param {
|
|
640
|
-
* @param {
|
|
641
|
-
* @param {
|
|
781
|
+
* @param {DiscountPlatformValidator.UpsertDiscountItemsParam} arg - Arg object
|
|
782
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
783
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
642
784
|
* @returns {Promise<Object>} - Success response
|
|
785
|
+
* @name upsertDiscountItems
|
|
643
786
|
* @summary: Create custom discount from bulk.
|
|
644
|
-
* @description: Create custom discounts through API.
|
|
787
|
+
* @description: Create custom discounts through API. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/upsertDiscountItems/).
|
|
645
788
|
*/
|
|
646
|
-
async upsertDiscountItems(
|
|
647
|
-
|
|
789
|
+
async upsertDiscountItems(
|
|
790
|
+
{ id, body, requestHeaders } = { requestHeaders: {} },
|
|
791
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
792
|
+
) {
|
|
793
|
+
const { error } = DiscountPlatformValidator.upsertDiscountItems().validate(
|
|
648
794
|
{
|
|
649
795
|
id,
|
|
650
796
|
body,
|
|
@@ -658,7 +804,7 @@ class Discount {
|
|
|
658
804
|
// Showing warrnings if extra unknown parameters are found
|
|
659
805
|
const {
|
|
660
806
|
error: warrning,
|
|
661
|
-
} =
|
|
807
|
+
} = DiscountPlatformValidator.upsertDiscountItems().validate(
|
|
662
808
|
{
|
|
663
809
|
id,
|
|
664
810
|
body,
|
|
@@ -668,9 +814,8 @@ class Discount {
|
|
|
668
814
|
if (warrning) {
|
|
669
815
|
Logger({
|
|
670
816
|
level: "WARN",
|
|
671
|
-
message:
|
|
817
|
+
message: `Parameter Validation warrnings for platform > Discount > upsertDiscountItems \n ${warrning}`,
|
|
672
818
|
});
|
|
673
|
-
Logger({ level: "WARN", message: warrning });
|
|
674
819
|
}
|
|
675
820
|
|
|
676
821
|
const query_params = {};
|
|
@@ -683,10 +828,16 @@ class Discount {
|
|
|
683
828
|
`/service/platform/discount/v1.0/company/${this.config.companyId}/job/${id}/items/`,
|
|
684
829
|
query_params,
|
|
685
830
|
body,
|
|
686
|
-
xHeaders
|
|
831
|
+
{ ...xHeaders, ...requestHeaders },
|
|
832
|
+
{ responseHeaders }
|
|
687
833
|
);
|
|
688
834
|
|
|
689
|
-
|
|
835
|
+
let responseData = response;
|
|
836
|
+
if (responseHeaders) {
|
|
837
|
+
responseData = response[0];
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
const { error: res_error } = Joi.any().validate(responseData, {
|
|
690
841
|
abortEarly: false,
|
|
691
842
|
allowUnknown: false,
|
|
692
843
|
});
|
|
@@ -694,24 +845,27 @@ class Discount {
|
|
|
694
845
|
if (res_error) {
|
|
695
846
|
Logger({
|
|
696
847
|
level: "WARN",
|
|
697
|
-
message:
|
|
848
|
+
message: `Response Validation Warnnings for platform > Discount > upsertDiscountItems \n ${res_error}`,
|
|
698
849
|
});
|
|
699
|
-
Logger({ level: "WARN", message: res_error });
|
|
700
850
|
}
|
|
701
851
|
|
|
702
852
|
return response;
|
|
703
853
|
}
|
|
704
854
|
|
|
705
855
|
/**
|
|
706
|
-
* @param {
|
|
707
|
-
* @param {
|
|
708
|
-
* @param {
|
|
709
|
-
* @returns {Promise<FileJobResponse>} - Success response
|
|
856
|
+
* @param {DiscountPlatformValidator.ValidateDiscountFileParam} arg - Arg object
|
|
857
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
858
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
859
|
+
* @returns {Promise<DiscountPlatformModel.FileJobResponse>} - Success response
|
|
860
|
+
* @name validateDiscountFile
|
|
710
861
|
* @summary: Validate File.
|
|
711
|
-
* @description: Validate File.
|
|
862
|
+
* @description: Validate File. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/validateDiscountFile/).
|
|
712
863
|
*/
|
|
713
|
-
async validateDiscountFile(
|
|
714
|
-
|
|
864
|
+
async validateDiscountFile(
|
|
865
|
+
{ body, discount, requestHeaders } = { requestHeaders: {} },
|
|
866
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
867
|
+
) {
|
|
868
|
+
const { error } = DiscountPlatformValidator.validateDiscountFile().validate(
|
|
715
869
|
{
|
|
716
870
|
body,
|
|
717
871
|
discount,
|
|
@@ -725,7 +879,7 @@ class Discount {
|
|
|
725
879
|
// Showing warrnings if extra unknown parameters are found
|
|
726
880
|
const {
|
|
727
881
|
error: warrning,
|
|
728
|
-
} =
|
|
882
|
+
} = DiscountPlatformValidator.validateDiscountFile().validate(
|
|
729
883
|
{
|
|
730
884
|
body,
|
|
731
885
|
discount,
|
|
@@ -735,9 +889,8 @@ class Discount {
|
|
|
735
889
|
if (warrning) {
|
|
736
890
|
Logger({
|
|
737
891
|
level: "WARN",
|
|
738
|
-
message:
|
|
892
|
+
message: `Parameter Validation warrnings for platform > Discount > validateDiscountFile \n ${warrning}`,
|
|
739
893
|
});
|
|
740
|
-
Logger({ level: "WARN", message: warrning });
|
|
741
894
|
}
|
|
742
895
|
|
|
743
896
|
const query_params = {};
|
|
@@ -751,12 +904,18 @@ class Discount {
|
|
|
751
904
|
`/service/platform/discount/v1.0/company/${this.config.companyId}/file/validation/`,
|
|
752
905
|
query_params,
|
|
753
906
|
body,
|
|
754
|
-
xHeaders
|
|
907
|
+
{ ...xHeaders, ...requestHeaders },
|
|
908
|
+
{ responseHeaders }
|
|
755
909
|
);
|
|
756
910
|
|
|
911
|
+
let responseData = response;
|
|
912
|
+
if (responseHeaders) {
|
|
913
|
+
responseData = response[0];
|
|
914
|
+
}
|
|
915
|
+
|
|
757
916
|
const {
|
|
758
917
|
error: res_error,
|
|
759
|
-
} =
|
|
918
|
+
} = DiscountPlatformModel.FileJobResponse().validate(responseData, {
|
|
760
919
|
abortEarly: false,
|
|
761
920
|
allowUnknown: false,
|
|
762
921
|
});
|
|
@@ -764,9 +923,8 @@ class Discount {
|
|
|
764
923
|
if (res_error) {
|
|
765
924
|
Logger({
|
|
766
925
|
level: "WARN",
|
|
767
|
-
message:
|
|
926
|
+
message: `Response Validation Warnnings for platform > Discount > validateDiscountFile \n ${res_error}`,
|
|
768
927
|
});
|
|
769
|
-
Logger({ level: "WARN", message: res_error });
|
|
770
928
|
}
|
|
771
929
|
|
|
772
930
|
return response;
|