@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 FinancePlatformValidator = require("./FinancePlatformValidator");
|
|
5
|
+
const FinancePlatformModel = require("./FinancePlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
7
|
const Joi = require("joi");
|
|
8
8
|
|
|
@@ -12,14 +12,640 @@ class Finance {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* @param {
|
|
16
|
-
* @param {
|
|
17
|
-
* @
|
|
18
|
-
* @
|
|
19
|
-
*
|
|
15
|
+
* @param {FinancePlatformValidator.ChannelDisplayNameParam} arg - Arg object
|
|
16
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
17
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
18
|
+
* @returns {Promise<FinancePlatformModel.ChannelDisplayNameResponse>} -
|
|
19
|
+
* Success response
|
|
20
|
+
* @name channelDisplayName
|
|
21
|
+
* @summary: Provide channel display name dict.
|
|
22
|
+
* @description: Provide channel display name dict. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/channelDisplayName/).
|
|
20
23
|
*/
|
|
21
|
-
async
|
|
22
|
-
|
|
24
|
+
async channelDisplayName(
|
|
25
|
+
{ filterKey, requestHeaders } = { requestHeaders: {} },
|
|
26
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
27
|
+
) {
|
|
28
|
+
const { error } = FinancePlatformValidator.channelDisplayName().validate(
|
|
29
|
+
{
|
|
30
|
+
filterKey,
|
|
31
|
+
},
|
|
32
|
+
{ abortEarly: false, allowUnknown: true }
|
|
33
|
+
);
|
|
34
|
+
if (error) {
|
|
35
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Showing warrnings if extra unknown parameters are found
|
|
39
|
+
const {
|
|
40
|
+
error: warrning,
|
|
41
|
+
} = FinancePlatformValidator.channelDisplayName().validate(
|
|
42
|
+
{
|
|
43
|
+
filterKey,
|
|
44
|
+
},
|
|
45
|
+
{ abortEarly: false, allowUnknown: false }
|
|
46
|
+
);
|
|
47
|
+
if (warrning) {
|
|
48
|
+
Logger({
|
|
49
|
+
level: "WARN",
|
|
50
|
+
message: `Parameter Validation warrnings for platform > Finance > channelDisplayName \n ${warrning}`,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const query_params = {};
|
|
55
|
+
query_params["filter_key"] = filterKey;
|
|
56
|
+
|
|
57
|
+
const xHeaders = {};
|
|
58
|
+
|
|
59
|
+
const response = await PlatformAPIClient.execute(
|
|
60
|
+
this.config,
|
|
61
|
+
"get",
|
|
62
|
+
`/service/platform/finance/v1.0/company/${this.config.companyId}/channel-display-names`,
|
|
63
|
+
query_params,
|
|
64
|
+
undefined,
|
|
65
|
+
{ ...xHeaders, ...requestHeaders },
|
|
66
|
+
{ responseHeaders }
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
let responseData = response;
|
|
70
|
+
if (responseHeaders) {
|
|
71
|
+
responseData = response[0];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const {
|
|
75
|
+
error: res_error,
|
|
76
|
+
} = FinancePlatformModel.ChannelDisplayNameResponse().validate(
|
|
77
|
+
responseData,
|
|
78
|
+
{ abortEarly: false, allowUnknown: false }
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
if (res_error) {
|
|
82
|
+
Logger({
|
|
83
|
+
level: "WARN",
|
|
84
|
+
message: `Response Validation Warnnings for platform > Finance > channelDisplayName \n ${res_error}`,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return response;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @param {FinancePlatformValidator.CreateSellerCreditNoteConfigParam} arg
|
|
93
|
+
* - Arg object
|
|
94
|
+
*
|
|
95
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
96
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
97
|
+
* @returns {Promise<FinancePlatformModel.CreateSellerCreditNoteConfigResponse>}
|
|
98
|
+
* - Success response
|
|
99
|
+
*
|
|
100
|
+
* @name createSellerCreditNoteConfig
|
|
101
|
+
* @summary: Creates credit note config.
|
|
102
|
+
* @description: Creates credit note config. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/createSellerCreditNoteConfig/).
|
|
103
|
+
*/
|
|
104
|
+
async createSellerCreditNoteConfig(
|
|
105
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
106
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
107
|
+
) {
|
|
108
|
+
const {
|
|
109
|
+
error,
|
|
110
|
+
} = FinancePlatformValidator.createSellerCreditNoteConfig().validate(
|
|
111
|
+
{
|
|
112
|
+
body,
|
|
113
|
+
},
|
|
114
|
+
{ abortEarly: false, allowUnknown: true }
|
|
115
|
+
);
|
|
116
|
+
if (error) {
|
|
117
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Showing warrnings if extra unknown parameters are found
|
|
121
|
+
const {
|
|
122
|
+
error: warrning,
|
|
123
|
+
} = FinancePlatformValidator.createSellerCreditNoteConfig().validate(
|
|
124
|
+
{
|
|
125
|
+
body,
|
|
126
|
+
},
|
|
127
|
+
{ abortEarly: false, allowUnknown: false }
|
|
128
|
+
);
|
|
129
|
+
if (warrning) {
|
|
130
|
+
Logger({
|
|
131
|
+
level: "WARN",
|
|
132
|
+
message: `Parameter Validation warrnings for platform > Finance > createSellerCreditNoteConfig \n ${warrning}`,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const query_params = {};
|
|
137
|
+
|
|
138
|
+
const xHeaders = {};
|
|
139
|
+
|
|
140
|
+
const response = await PlatformAPIClient.execute(
|
|
141
|
+
this.config,
|
|
142
|
+
"post",
|
|
143
|
+
`/service/platform/finance/v1.0/company/${this.config.companyId}/create-update-credit-note-config`,
|
|
144
|
+
query_params,
|
|
145
|
+
body,
|
|
146
|
+
{ ...xHeaders, ...requestHeaders },
|
|
147
|
+
{ responseHeaders }
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
let responseData = response;
|
|
151
|
+
if (responseHeaders) {
|
|
152
|
+
responseData = response[0];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const {
|
|
156
|
+
error: res_error,
|
|
157
|
+
} = FinancePlatformModel.CreateSellerCreditNoteConfigResponse().validate(
|
|
158
|
+
responseData,
|
|
159
|
+
{ abortEarly: false, allowUnknown: false }
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
if (res_error) {
|
|
163
|
+
Logger({
|
|
164
|
+
level: "WARN",
|
|
165
|
+
message: `Response Validation Warnnings for platform > Finance > createSellerCreditNoteConfig \n ${res_error}`,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return response;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @param {FinancePlatformValidator.CreditNoteDetailsParam} arg - Arg object
|
|
174
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
175
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
176
|
+
* @returns {Promise<FinancePlatformModel.CreditNoteDetailsResponse>} -
|
|
177
|
+
* Success response
|
|
178
|
+
* @name creditNoteDetails
|
|
179
|
+
* @summary: Gives credit note details.
|
|
180
|
+
* @description: Gives credit note details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/creditNoteDetails/).
|
|
181
|
+
*/
|
|
182
|
+
async creditNoteDetails(
|
|
183
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
184
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
185
|
+
) {
|
|
186
|
+
const { error } = FinancePlatformValidator.creditNoteDetails().validate(
|
|
187
|
+
{
|
|
188
|
+
body,
|
|
189
|
+
},
|
|
190
|
+
{ abortEarly: false, allowUnknown: true }
|
|
191
|
+
);
|
|
192
|
+
if (error) {
|
|
193
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// Showing warrnings if extra unknown parameters are found
|
|
197
|
+
const {
|
|
198
|
+
error: warrning,
|
|
199
|
+
} = FinancePlatformValidator.creditNoteDetails().validate(
|
|
200
|
+
{
|
|
201
|
+
body,
|
|
202
|
+
},
|
|
203
|
+
{ abortEarly: false, allowUnknown: false }
|
|
204
|
+
);
|
|
205
|
+
if (warrning) {
|
|
206
|
+
Logger({
|
|
207
|
+
level: "WARN",
|
|
208
|
+
message: `Parameter Validation warrnings for platform > Finance > creditNoteDetails \n ${warrning}`,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
const query_params = {};
|
|
213
|
+
|
|
214
|
+
const xHeaders = {};
|
|
215
|
+
|
|
216
|
+
const response = await PlatformAPIClient.execute(
|
|
217
|
+
this.config,
|
|
218
|
+
"post",
|
|
219
|
+
`/service/platform/finance/v1.0/company/${this.config.companyId}/credit-note-details`,
|
|
220
|
+
query_params,
|
|
221
|
+
body,
|
|
222
|
+
{ ...xHeaders, ...requestHeaders },
|
|
223
|
+
{ responseHeaders }
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
let responseData = response;
|
|
227
|
+
if (responseHeaders) {
|
|
228
|
+
responseData = response[0];
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const {
|
|
232
|
+
error: res_error,
|
|
233
|
+
} = FinancePlatformModel.CreditNoteDetailsResponse().validate(
|
|
234
|
+
responseData,
|
|
235
|
+
{ abortEarly: false, allowUnknown: false }
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
if (res_error) {
|
|
239
|
+
Logger({
|
|
240
|
+
level: "WARN",
|
|
241
|
+
message: `Response Validation Warnnings for platform > Finance > creditNoteDetails \n ${res_error}`,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return response;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* @param {FinancePlatformValidator.CreditlineDataplatformParam} arg - Arg object
|
|
250
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
251
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
252
|
+
* @returns {Promise<FinancePlatformModel.CreditlineDataPlatformResponse>}
|
|
253
|
+
* - Success response
|
|
254
|
+
*
|
|
255
|
+
* @name creditlineDataplatform
|
|
256
|
+
* @summary: Used to fetch creditline data.
|
|
257
|
+
* @description: Used to fetch creditline data. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/creditlineDataplatform/).
|
|
258
|
+
*/
|
|
259
|
+
async creditlineDataplatform(
|
|
260
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
261
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
262
|
+
) {
|
|
263
|
+
const {
|
|
264
|
+
error,
|
|
265
|
+
} = FinancePlatformValidator.creditlineDataplatform().validate(
|
|
266
|
+
{
|
|
267
|
+
body,
|
|
268
|
+
},
|
|
269
|
+
{ abortEarly: false, allowUnknown: true }
|
|
270
|
+
);
|
|
271
|
+
if (error) {
|
|
272
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// Showing warrnings if extra unknown parameters are found
|
|
276
|
+
const {
|
|
277
|
+
error: warrning,
|
|
278
|
+
} = FinancePlatformValidator.creditlineDataplatform().validate(
|
|
279
|
+
{
|
|
280
|
+
body,
|
|
281
|
+
},
|
|
282
|
+
{ abortEarly: false, allowUnknown: false }
|
|
283
|
+
);
|
|
284
|
+
if (warrning) {
|
|
285
|
+
Logger({
|
|
286
|
+
level: "WARN",
|
|
287
|
+
message: `Parameter Validation warrnings for platform > Finance > creditlineDataplatform \n ${warrning}`,
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
const query_params = {};
|
|
292
|
+
|
|
293
|
+
const xHeaders = {};
|
|
294
|
+
|
|
295
|
+
const response = await PlatformAPIClient.execute(
|
|
296
|
+
this.config,
|
|
297
|
+
"post",
|
|
298
|
+
`/service/platform/finance/v1.0/company/${this.config.companyId}/credit-line-data`,
|
|
299
|
+
query_params,
|
|
300
|
+
body,
|
|
301
|
+
{ ...xHeaders, ...requestHeaders },
|
|
302
|
+
{ responseHeaders }
|
|
303
|
+
);
|
|
304
|
+
|
|
305
|
+
let responseData = response;
|
|
306
|
+
if (responseHeaders) {
|
|
307
|
+
responseData = response[0];
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
const {
|
|
311
|
+
error: res_error,
|
|
312
|
+
} = FinancePlatformModel.CreditlineDataPlatformResponse().validate(
|
|
313
|
+
responseData,
|
|
314
|
+
{ abortEarly: false, allowUnknown: false }
|
|
315
|
+
);
|
|
316
|
+
|
|
317
|
+
if (res_error) {
|
|
318
|
+
Logger({
|
|
319
|
+
level: "WARN",
|
|
320
|
+
message: `Response Validation Warnnings for platform > Finance > creditlineDataplatform \n ${res_error}`,
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
return response;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* @param {FinancePlatformValidator.DeleteConfigParam} arg - Arg object
|
|
329
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
330
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
331
|
+
* @returns {Promise<FinancePlatformModel.DeleteConfigResponse>} - Success response
|
|
332
|
+
* @name deleteConfig
|
|
333
|
+
* @summary: Deletes credit note config.
|
|
334
|
+
* @description: Deletes credit note config. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/deleteConfig/).
|
|
335
|
+
*/
|
|
336
|
+
async deleteConfig(
|
|
337
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
338
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
339
|
+
) {
|
|
340
|
+
const { error } = FinancePlatformValidator.deleteConfig().validate(
|
|
341
|
+
{
|
|
342
|
+
body,
|
|
343
|
+
},
|
|
344
|
+
{ abortEarly: false, allowUnknown: true }
|
|
345
|
+
);
|
|
346
|
+
if (error) {
|
|
347
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// Showing warrnings if extra unknown parameters are found
|
|
351
|
+
const {
|
|
352
|
+
error: warrning,
|
|
353
|
+
} = FinancePlatformValidator.deleteConfig().validate(
|
|
354
|
+
{
|
|
355
|
+
body,
|
|
356
|
+
},
|
|
357
|
+
{ abortEarly: false, allowUnknown: false }
|
|
358
|
+
);
|
|
359
|
+
if (warrning) {
|
|
360
|
+
Logger({
|
|
361
|
+
level: "WARN",
|
|
362
|
+
message: `Parameter Validation warrnings for platform > Finance > deleteConfig \n ${warrning}`,
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
const query_params = {};
|
|
367
|
+
|
|
368
|
+
const xHeaders = {};
|
|
369
|
+
|
|
370
|
+
const response = await PlatformAPIClient.execute(
|
|
371
|
+
this.config,
|
|
372
|
+
"post",
|
|
373
|
+
`/service/platform/finance/v1.0/company/${this.config.companyId}/delete-seller-config`,
|
|
374
|
+
query_params,
|
|
375
|
+
body,
|
|
376
|
+
{ ...xHeaders, ...requestHeaders },
|
|
377
|
+
{ responseHeaders }
|
|
378
|
+
);
|
|
379
|
+
|
|
380
|
+
let responseData = response;
|
|
381
|
+
if (responseHeaders) {
|
|
382
|
+
responseData = response[0];
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
const {
|
|
386
|
+
error: res_error,
|
|
387
|
+
} = FinancePlatformModel.DeleteConfigResponse().validate(responseData, {
|
|
388
|
+
abortEarly: false,
|
|
389
|
+
allowUnknown: false,
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
if (res_error) {
|
|
393
|
+
Logger({
|
|
394
|
+
level: "WARN",
|
|
395
|
+
message: `Response Validation Warnnings for platform > Finance > deleteConfig \n ${res_error}`,
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
return response;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* @param {FinancePlatformValidator.DownloadCreditDebitNoteParam} arg - Arg object
|
|
404
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
405
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
406
|
+
* @returns {Promise<FinancePlatformModel.DownloadCreditDebitNoteResponse>}
|
|
407
|
+
* - Success response
|
|
408
|
+
*
|
|
409
|
+
* @name downloadCreditDebitNote
|
|
410
|
+
* @summary: Download credit debit note pdf.
|
|
411
|
+
* @description: Download credit debit note pdf. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/downloadCreditDebitNote/).
|
|
412
|
+
*/
|
|
413
|
+
async downloadCreditDebitNote(
|
|
414
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
415
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
416
|
+
) {
|
|
417
|
+
const {
|
|
418
|
+
error,
|
|
419
|
+
} = FinancePlatformValidator.downloadCreditDebitNote().validate(
|
|
420
|
+
{
|
|
421
|
+
body,
|
|
422
|
+
},
|
|
423
|
+
{ abortEarly: false, allowUnknown: true }
|
|
424
|
+
);
|
|
425
|
+
if (error) {
|
|
426
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// Showing warrnings if extra unknown parameters are found
|
|
430
|
+
const {
|
|
431
|
+
error: warrning,
|
|
432
|
+
} = FinancePlatformValidator.downloadCreditDebitNote().validate(
|
|
433
|
+
{
|
|
434
|
+
body,
|
|
435
|
+
},
|
|
436
|
+
{ abortEarly: false, allowUnknown: false }
|
|
437
|
+
);
|
|
438
|
+
if (warrning) {
|
|
439
|
+
Logger({
|
|
440
|
+
level: "WARN",
|
|
441
|
+
message: `Parameter Validation warrnings for platform > Finance > downloadCreditDebitNote \n ${warrning}`,
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
const query_params = {};
|
|
446
|
+
|
|
447
|
+
const xHeaders = {};
|
|
448
|
+
|
|
449
|
+
const response = await PlatformAPIClient.execute(
|
|
450
|
+
this.config,
|
|
451
|
+
"post",
|
|
452
|
+
`/service/platform/finance/v1.0/company/${this.config.companyId}/download-credit-debit-note`,
|
|
453
|
+
query_params,
|
|
454
|
+
body,
|
|
455
|
+
{ ...xHeaders, ...requestHeaders },
|
|
456
|
+
{ responseHeaders }
|
|
457
|
+
);
|
|
458
|
+
|
|
459
|
+
let responseData = response;
|
|
460
|
+
if (responseHeaders) {
|
|
461
|
+
responseData = response[0];
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
const {
|
|
465
|
+
error: res_error,
|
|
466
|
+
} = FinancePlatformModel.DownloadCreditDebitNoteResponse().validate(
|
|
467
|
+
responseData,
|
|
468
|
+
{ abortEarly: false, allowUnknown: false }
|
|
469
|
+
);
|
|
470
|
+
|
|
471
|
+
if (res_error) {
|
|
472
|
+
Logger({
|
|
473
|
+
level: "WARN",
|
|
474
|
+
message: `Response Validation Warnnings for platform > Finance > downloadCreditDebitNote \n ${res_error}`,
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
return response;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* @param {FinancePlatformValidator.DownloadReportParam} arg - Arg object
|
|
483
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
484
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
485
|
+
* @returns {Promise<FinancePlatformModel.DownloadReportList>} - Success response
|
|
486
|
+
* @name downloadReport
|
|
487
|
+
* @summary: Gives list of all downloaded reports.
|
|
488
|
+
* @description: Gives list of all downloaded reports. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/downloadReport/).
|
|
489
|
+
*/
|
|
490
|
+
async downloadReport(
|
|
491
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
492
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
493
|
+
) {
|
|
494
|
+
const { error } = FinancePlatformValidator.downloadReport().validate(
|
|
495
|
+
{
|
|
496
|
+
body,
|
|
497
|
+
},
|
|
498
|
+
{ abortEarly: false, allowUnknown: true }
|
|
499
|
+
);
|
|
500
|
+
if (error) {
|
|
501
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
// Showing warrnings if extra unknown parameters are found
|
|
505
|
+
const {
|
|
506
|
+
error: warrning,
|
|
507
|
+
} = FinancePlatformValidator.downloadReport().validate(
|
|
508
|
+
{
|
|
509
|
+
body,
|
|
510
|
+
},
|
|
511
|
+
{ abortEarly: false, allowUnknown: false }
|
|
512
|
+
);
|
|
513
|
+
if (warrning) {
|
|
514
|
+
Logger({
|
|
515
|
+
level: "WARN",
|
|
516
|
+
message: `Parameter Validation warrnings for platform > Finance > downloadReport \n ${warrning}`,
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
const query_params = {};
|
|
521
|
+
|
|
522
|
+
const xHeaders = {};
|
|
523
|
+
|
|
524
|
+
const response = await PlatformAPIClient.execute(
|
|
525
|
+
this.config,
|
|
526
|
+
"post",
|
|
527
|
+
`/service/platform/finance/v1.0/company/${this.config.companyId}/download-report`,
|
|
528
|
+
query_params,
|
|
529
|
+
body,
|
|
530
|
+
{ ...xHeaders, ...requestHeaders },
|
|
531
|
+
{ responseHeaders }
|
|
532
|
+
);
|
|
533
|
+
|
|
534
|
+
let responseData = response;
|
|
535
|
+
if (responseHeaders) {
|
|
536
|
+
responseData = response[0];
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
const {
|
|
540
|
+
error: res_error,
|
|
541
|
+
} = FinancePlatformModel.DownloadReportList().validate(responseData, {
|
|
542
|
+
abortEarly: false,
|
|
543
|
+
allowUnknown: false,
|
|
544
|
+
});
|
|
545
|
+
|
|
546
|
+
if (res_error) {
|
|
547
|
+
Logger({
|
|
548
|
+
level: "WARN",
|
|
549
|
+
message: `Response Validation Warnnings for platform > Finance > downloadReport \n ${res_error}`,
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
return response;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* @param {FinancePlatformValidator.DownloadReportCustomerCnParam} arg - Arg object
|
|
558
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
559
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
560
|
+
* @returns {Promise<FinancePlatformModel.DownloadReportCustomerCnResponse>}
|
|
561
|
+
* - Success response
|
|
562
|
+
*
|
|
563
|
+
* @name downloadReportCustomerCn
|
|
564
|
+
* @summary: Gives list of downloaded reports.
|
|
565
|
+
* @description: Gives list of downloaded reports. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/downloadReportCustomerCn/).
|
|
566
|
+
*/
|
|
567
|
+
async downloadReportCustomerCn(
|
|
568
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
569
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
570
|
+
) {
|
|
571
|
+
const {
|
|
572
|
+
error,
|
|
573
|
+
} = FinancePlatformValidator.downloadReportCustomerCn().validate(
|
|
574
|
+
{
|
|
575
|
+
body,
|
|
576
|
+
},
|
|
577
|
+
{ abortEarly: false, allowUnknown: true }
|
|
578
|
+
);
|
|
579
|
+
if (error) {
|
|
580
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
// Showing warrnings if extra unknown parameters are found
|
|
584
|
+
const {
|
|
585
|
+
error: warrning,
|
|
586
|
+
} = FinancePlatformValidator.downloadReportCustomerCn().validate(
|
|
587
|
+
{
|
|
588
|
+
body,
|
|
589
|
+
},
|
|
590
|
+
{ abortEarly: false, allowUnknown: false }
|
|
591
|
+
);
|
|
592
|
+
if (warrning) {
|
|
593
|
+
Logger({
|
|
594
|
+
level: "WARN",
|
|
595
|
+
message: `Parameter Validation warrnings for platform > Finance > downloadReportCustomerCn \n ${warrning}`,
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
const query_params = {};
|
|
600
|
+
|
|
601
|
+
const xHeaders = {};
|
|
602
|
+
|
|
603
|
+
const response = await PlatformAPIClient.execute(
|
|
604
|
+
this.config,
|
|
605
|
+
"post",
|
|
606
|
+
`/service/platform/finance/v1.0/company/${this.config.companyId}/download-report-customer-cn`,
|
|
607
|
+
query_params,
|
|
608
|
+
body,
|
|
609
|
+
{ ...xHeaders, ...requestHeaders },
|
|
610
|
+
{ responseHeaders }
|
|
611
|
+
);
|
|
612
|
+
|
|
613
|
+
let responseData = response;
|
|
614
|
+
if (responseHeaders) {
|
|
615
|
+
responseData = response[0];
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
const {
|
|
619
|
+
error: res_error,
|
|
620
|
+
} = FinancePlatformModel.DownloadReportCustomerCnResponse().validate(
|
|
621
|
+
responseData,
|
|
622
|
+
{ abortEarly: false, allowUnknown: false }
|
|
623
|
+
);
|
|
624
|
+
|
|
625
|
+
if (res_error) {
|
|
626
|
+
Logger({
|
|
627
|
+
level: "WARN",
|
|
628
|
+
message: `Response Validation Warnnings for platform > Finance > downloadReportCustomerCn \n ${res_error}`,
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
return response;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* @param {FinancePlatformValidator.GenerateReportParam} arg - Arg object
|
|
637
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
638
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
639
|
+
* @returns {Promise<FinancePlatformModel.GenerateReportJson>} - Success response
|
|
640
|
+
* @name generateReport
|
|
641
|
+
* @summary: Generate finance reports.
|
|
642
|
+
* @description: Generate finance reports. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/generateReport/).
|
|
643
|
+
*/
|
|
644
|
+
async generateReport(
|
|
645
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
646
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
647
|
+
) {
|
|
648
|
+
const { error } = FinancePlatformValidator.generateReport().validate(
|
|
23
649
|
{
|
|
24
650
|
body,
|
|
25
651
|
},
|
|
@@ -32,7 +658,7 @@ class Finance {
|
|
|
32
658
|
// Showing warrnings if extra unknown parameters are found
|
|
33
659
|
const {
|
|
34
660
|
error: warrning,
|
|
35
|
-
} =
|
|
661
|
+
} = FinancePlatformValidator.generateReport().validate(
|
|
36
662
|
{
|
|
37
663
|
body,
|
|
38
664
|
},
|
|
@@ -41,9 +667,8 @@ class Finance {
|
|
|
41
667
|
if (warrning) {
|
|
42
668
|
Logger({
|
|
43
669
|
level: "WARN",
|
|
44
|
-
message:
|
|
670
|
+
message: `Parameter Validation warrnings for platform > Finance > generateReport \n ${warrning}`,
|
|
45
671
|
});
|
|
46
|
-
Logger({ level: "WARN", message: warrning });
|
|
47
672
|
}
|
|
48
673
|
|
|
49
674
|
const query_params = {};
|
|
@@ -53,15 +678,21 @@ class Finance {
|
|
|
53
678
|
const response = await PlatformAPIClient.execute(
|
|
54
679
|
this.config,
|
|
55
680
|
"post",
|
|
56
|
-
`/service/platform/finance/v1.0/company/${this.config.companyId}/
|
|
681
|
+
`/service/platform/finance/v1.0/company/${this.config.companyId}/generate-report`,
|
|
57
682
|
query_params,
|
|
58
683
|
body,
|
|
59
|
-
xHeaders
|
|
684
|
+
{ ...xHeaders, ...requestHeaders },
|
|
685
|
+
{ responseHeaders }
|
|
60
686
|
);
|
|
61
687
|
|
|
688
|
+
let responseData = response;
|
|
689
|
+
if (responseHeaders) {
|
|
690
|
+
responseData = response[0];
|
|
691
|
+
}
|
|
692
|
+
|
|
62
693
|
const {
|
|
63
694
|
error: res_error,
|
|
64
|
-
} =
|
|
695
|
+
} = FinancePlatformModel.GenerateReportJson().validate(responseData, {
|
|
65
696
|
abortEarly: false,
|
|
66
697
|
allowUnknown: false,
|
|
67
698
|
});
|
|
@@ -69,23 +700,31 @@ class Finance {
|
|
|
69
700
|
if (res_error) {
|
|
70
701
|
Logger({
|
|
71
702
|
level: "WARN",
|
|
72
|
-
message:
|
|
703
|
+
message: `Response Validation Warnnings for platform > Finance > generateReport \n ${res_error}`,
|
|
73
704
|
});
|
|
74
|
-
Logger({ level: "WARN", message: res_error });
|
|
75
705
|
}
|
|
76
706
|
|
|
77
707
|
return response;
|
|
78
708
|
}
|
|
79
709
|
|
|
80
710
|
/**
|
|
81
|
-
* @param {
|
|
82
|
-
* @param {
|
|
83
|
-
* @
|
|
84
|
-
* @
|
|
85
|
-
*
|
|
711
|
+
* @param {FinancePlatformValidator.GenerateReportCustomerCnParam} arg - Arg object
|
|
712
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
713
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
714
|
+
* @returns {Promise<FinancePlatformModel.GenerateReportCustomerCnResponse>}
|
|
715
|
+
* - Success response
|
|
716
|
+
*
|
|
717
|
+
* @name generateReportCustomerCn
|
|
718
|
+
* @summary: Generate Credit Note report and gives Note details.
|
|
719
|
+
* @description: Generate Credit Note report and gives Note details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/generateReportCustomerCn/).
|
|
86
720
|
*/
|
|
87
|
-
async
|
|
88
|
-
|
|
721
|
+
async generateReportCustomerCn(
|
|
722
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
723
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
724
|
+
) {
|
|
725
|
+
const {
|
|
726
|
+
error,
|
|
727
|
+
} = FinancePlatformValidator.generateReportCustomerCn().validate(
|
|
89
728
|
{
|
|
90
729
|
body,
|
|
91
730
|
},
|
|
@@ -98,7 +737,7 @@ class Finance {
|
|
|
98
737
|
// Showing warrnings if extra unknown parameters are found
|
|
99
738
|
const {
|
|
100
739
|
error: warrning,
|
|
101
|
-
} =
|
|
740
|
+
} = FinancePlatformValidator.generateReportCustomerCn().validate(
|
|
102
741
|
{
|
|
103
742
|
body,
|
|
104
743
|
},
|
|
@@ -107,9 +746,8 @@ class Finance {
|
|
|
107
746
|
if (warrning) {
|
|
108
747
|
Logger({
|
|
109
748
|
level: "WARN",
|
|
110
|
-
message:
|
|
749
|
+
message: `Parameter Validation warrnings for platform > Finance > generateReportCustomerCn \n ${warrning}`,
|
|
111
750
|
});
|
|
112
|
-
Logger({ level: "WARN", message: warrning });
|
|
113
751
|
}
|
|
114
752
|
|
|
115
753
|
const query_params = {};
|
|
@@ -119,39 +757,49 @@ class Finance {
|
|
|
119
757
|
const response = await PlatformAPIClient.execute(
|
|
120
758
|
this.config,
|
|
121
759
|
"post",
|
|
122
|
-
`/service/platform/finance/v1.0/company/${this.config.companyId}/
|
|
760
|
+
`/service/platform/finance/v1.0/company/${this.config.companyId}/generate-report-customer-cn`,
|
|
123
761
|
query_params,
|
|
124
762
|
body,
|
|
125
|
-
xHeaders
|
|
763
|
+
{ ...xHeaders, ...requestHeaders },
|
|
764
|
+
{ responseHeaders }
|
|
126
765
|
);
|
|
127
766
|
|
|
767
|
+
let responseData = response;
|
|
768
|
+
if (responseHeaders) {
|
|
769
|
+
responseData = response[0];
|
|
770
|
+
}
|
|
771
|
+
|
|
128
772
|
const {
|
|
129
773
|
error: res_error,
|
|
130
|
-
} =
|
|
131
|
-
|
|
132
|
-
allowUnknown: false
|
|
133
|
-
|
|
774
|
+
} = FinancePlatformModel.GenerateReportCustomerCnResponse().validate(
|
|
775
|
+
responseData,
|
|
776
|
+
{ abortEarly: false, allowUnknown: false }
|
|
777
|
+
);
|
|
134
778
|
|
|
135
779
|
if (res_error) {
|
|
136
780
|
Logger({
|
|
137
781
|
level: "WARN",
|
|
138
|
-
message:
|
|
782
|
+
message: `Response Validation Warnnings for platform > Finance > generateReportCustomerCn \n ${res_error}`,
|
|
139
783
|
});
|
|
140
|
-
Logger({ level: "WARN", message: res_error });
|
|
141
784
|
}
|
|
142
785
|
|
|
143
786
|
return response;
|
|
144
787
|
}
|
|
145
788
|
|
|
146
789
|
/**
|
|
147
|
-
* @param {
|
|
148
|
-
* @param {
|
|
149
|
-
* @
|
|
150
|
-
* @
|
|
151
|
-
* @
|
|
790
|
+
* @param {FinancePlatformValidator.GetAffiliateParam} arg - Arg object
|
|
791
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
792
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
793
|
+
* @returns {Promise<FinancePlatformModel.GetAffiliateResponse>} - Success response
|
|
794
|
+
* @name getAffiliate
|
|
795
|
+
* @summary: Gives list of affiliates for company.
|
|
796
|
+
* @description: Gives list of affiliates for company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/getAffiliate/).
|
|
152
797
|
*/
|
|
153
|
-
async
|
|
154
|
-
|
|
798
|
+
async getAffiliate(
|
|
799
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
800
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
801
|
+
) {
|
|
802
|
+
const { error } = FinancePlatformValidator.getAffiliate().validate(
|
|
155
803
|
{
|
|
156
804
|
body,
|
|
157
805
|
},
|
|
@@ -162,7 +810,9 @@ class Finance {
|
|
|
162
810
|
}
|
|
163
811
|
|
|
164
812
|
// Showing warrnings if extra unknown parameters are found
|
|
165
|
-
const {
|
|
813
|
+
const {
|
|
814
|
+
error: warrning,
|
|
815
|
+
} = FinancePlatformValidator.getAffiliate().validate(
|
|
166
816
|
{
|
|
167
817
|
body,
|
|
168
818
|
},
|
|
@@ -171,9 +821,8 @@ class Finance {
|
|
|
171
821
|
if (warrning) {
|
|
172
822
|
Logger({
|
|
173
823
|
level: "WARN",
|
|
174
|
-
message:
|
|
824
|
+
message: `Parameter Validation warrnings for platform > Finance > getAffiliate \n ${warrning}`,
|
|
175
825
|
});
|
|
176
|
-
Logger({ level: "WARN", message: warrning });
|
|
177
826
|
}
|
|
178
827
|
|
|
179
828
|
const query_params = {};
|
|
@@ -183,15 +832,21 @@ class Finance {
|
|
|
183
832
|
const response = await PlatformAPIClient.execute(
|
|
184
833
|
this.config,
|
|
185
834
|
"post",
|
|
186
|
-
`/service/platform/finance/v1.0/company/${this.config.companyId}/
|
|
835
|
+
`/service/platform/finance/v1.0/company/${this.config.companyId}/get-affiliate-list`,
|
|
187
836
|
query_params,
|
|
188
837
|
body,
|
|
189
|
-
xHeaders
|
|
838
|
+
{ ...xHeaders, ...requestHeaders },
|
|
839
|
+
{ responseHeaders }
|
|
190
840
|
);
|
|
191
841
|
|
|
842
|
+
let responseData = response;
|
|
843
|
+
if (responseHeaders) {
|
|
844
|
+
responseData = response[0];
|
|
845
|
+
}
|
|
846
|
+
|
|
192
847
|
const {
|
|
193
848
|
error: res_error,
|
|
194
|
-
} =
|
|
849
|
+
} = FinancePlatformModel.GetAffiliateResponse().validate(responseData, {
|
|
195
850
|
abortEarly: false,
|
|
196
851
|
allowUnknown: false,
|
|
197
852
|
});
|
|
@@ -199,23 +854,27 @@ class Finance {
|
|
|
199
854
|
if (res_error) {
|
|
200
855
|
Logger({
|
|
201
856
|
level: "WARN",
|
|
202
|
-
message:
|
|
857
|
+
message: `Response Validation Warnnings for platform > Finance > getAffiliate \n ${res_error}`,
|
|
203
858
|
});
|
|
204
|
-
Logger({ level: "WARN", message: res_error });
|
|
205
859
|
}
|
|
206
860
|
|
|
207
861
|
return response;
|
|
208
862
|
}
|
|
209
863
|
|
|
210
864
|
/**
|
|
211
|
-
* @param {
|
|
212
|
-
* @param {
|
|
213
|
-
* @
|
|
214
|
-
* @
|
|
215
|
-
* @
|
|
865
|
+
* @param {FinancePlatformValidator.GetCnConfigParam} arg - Arg object
|
|
866
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
867
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
868
|
+
* @returns {Promise<FinancePlatformModel.GetCnConfigResponse>} - Success response
|
|
869
|
+
* @name getCnConfig
|
|
870
|
+
* @summary: Gives credit note config.
|
|
871
|
+
* @description: Gives credit note config. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/getCnConfig/).
|
|
216
872
|
*/
|
|
217
|
-
async
|
|
218
|
-
|
|
873
|
+
async getCnConfig(
|
|
874
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
875
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
876
|
+
) {
|
|
877
|
+
const { error } = FinancePlatformValidator.getCnConfig().validate(
|
|
219
878
|
{
|
|
220
879
|
body,
|
|
221
880
|
},
|
|
@@ -226,7 +885,7 @@ class Finance {
|
|
|
226
885
|
}
|
|
227
886
|
|
|
228
887
|
// Showing warrnings if extra unknown parameters are found
|
|
229
|
-
const { error: warrning } =
|
|
888
|
+
const { error: warrning } = FinancePlatformValidator.getCnConfig().validate(
|
|
230
889
|
{
|
|
231
890
|
body,
|
|
232
891
|
},
|
|
@@ -235,9 +894,8 @@ class Finance {
|
|
|
235
894
|
if (warrning) {
|
|
236
895
|
Logger({
|
|
237
896
|
level: "WARN",
|
|
238
|
-
message:
|
|
897
|
+
message: `Parameter Validation warrnings for platform > Finance > getCnConfig \n ${warrning}`,
|
|
239
898
|
});
|
|
240
|
-
Logger({ level: "WARN", message: warrning });
|
|
241
899
|
}
|
|
242
900
|
|
|
243
901
|
const query_params = {};
|
|
@@ -247,15 +905,21 @@ class Finance {
|
|
|
247
905
|
const response = await PlatformAPIClient.execute(
|
|
248
906
|
this.config,
|
|
249
907
|
"post",
|
|
250
|
-
`/service/platform/finance/v1.0/company/${this.config.companyId}/
|
|
908
|
+
`/service/platform/finance/v1.0/company/${this.config.companyId}/get-seller-cn-config`,
|
|
251
909
|
query_params,
|
|
252
910
|
body,
|
|
253
|
-
xHeaders
|
|
911
|
+
{ ...xHeaders, ...requestHeaders },
|
|
912
|
+
{ responseHeaders }
|
|
254
913
|
);
|
|
255
914
|
|
|
915
|
+
let responseData = response;
|
|
916
|
+
if (responseHeaders) {
|
|
917
|
+
responseData = response[0];
|
|
918
|
+
}
|
|
919
|
+
|
|
256
920
|
const {
|
|
257
921
|
error: res_error,
|
|
258
|
-
} =
|
|
922
|
+
} = FinancePlatformModel.GetCnConfigResponse().validate(responseData, {
|
|
259
923
|
abortEarly: false,
|
|
260
924
|
allowUnknown: false,
|
|
261
925
|
});
|
|
@@ -263,23 +927,31 @@ class Finance {
|
|
|
263
927
|
if (res_error) {
|
|
264
928
|
Logger({
|
|
265
929
|
level: "WARN",
|
|
266
|
-
message:
|
|
930
|
+
message: `Response Validation Warnnings for platform > Finance > getCnConfig \n ${res_error}`,
|
|
267
931
|
});
|
|
268
|
-
Logger({ level: "WARN", message: res_error });
|
|
269
932
|
}
|
|
270
933
|
|
|
271
934
|
return response;
|
|
272
935
|
}
|
|
273
936
|
|
|
274
937
|
/**
|
|
275
|
-
* @param {
|
|
276
|
-
* @param {
|
|
277
|
-
* @
|
|
278
|
-
* @
|
|
279
|
-
*
|
|
938
|
+
* @param {FinancePlatformValidator.GetCustomerCreditBalanceParam} arg - Arg object
|
|
939
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
940
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
941
|
+
* @returns {Promise<FinancePlatformModel.GetCustomerCreditBalanceResponse>}
|
|
942
|
+
* - Success response
|
|
943
|
+
*
|
|
944
|
+
* @name getCustomerCreditBalance
|
|
945
|
+
* @summary: Gives customer credit balance.
|
|
946
|
+
* @description: Gives customer credit balance. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/getCustomerCreditBalance/).
|
|
280
947
|
*/
|
|
281
|
-
async
|
|
282
|
-
|
|
948
|
+
async getCustomerCreditBalance(
|
|
949
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
950
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
951
|
+
) {
|
|
952
|
+
const {
|
|
953
|
+
error,
|
|
954
|
+
} = FinancePlatformValidator.getCustomerCreditBalance().validate(
|
|
283
955
|
{
|
|
284
956
|
body,
|
|
285
957
|
},
|
|
@@ -290,7 +962,9 @@ class Finance {
|
|
|
290
962
|
}
|
|
291
963
|
|
|
292
964
|
// Showing warrnings if extra unknown parameters are found
|
|
293
|
-
const {
|
|
965
|
+
const {
|
|
966
|
+
error: warrning,
|
|
967
|
+
} = FinancePlatformValidator.getCustomerCreditBalance().validate(
|
|
294
968
|
{
|
|
295
969
|
body,
|
|
296
970
|
},
|
|
@@ -299,9 +973,8 @@ class Finance {
|
|
|
299
973
|
if (warrning) {
|
|
300
974
|
Logger({
|
|
301
975
|
level: "WARN",
|
|
302
|
-
message:
|
|
976
|
+
message: `Parameter Validation warrnings for platform > Finance > getCustomerCreditBalance \n ${warrning}`,
|
|
303
977
|
});
|
|
304
|
-
Logger({ level: "WARN", message: warrning });
|
|
305
978
|
}
|
|
306
979
|
|
|
307
980
|
const query_params = {};
|
|
@@ -311,15 +984,94 @@ class Finance {
|
|
|
311
984
|
const response = await PlatformAPIClient.execute(
|
|
312
985
|
this.config,
|
|
313
986
|
"post",
|
|
314
|
-
`/service/platform/finance/v1.0/company/${this.config.companyId}/
|
|
987
|
+
`/service/platform/finance/v1.0/company/${this.config.companyId}/customer-credit-balance`,
|
|
988
|
+
query_params,
|
|
989
|
+
body,
|
|
990
|
+
{ ...xHeaders, ...requestHeaders },
|
|
991
|
+
{ responseHeaders }
|
|
992
|
+
);
|
|
993
|
+
|
|
994
|
+
let responseData = response;
|
|
995
|
+
if (responseHeaders) {
|
|
996
|
+
responseData = response[0];
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
const {
|
|
1000
|
+
error: res_error,
|
|
1001
|
+
} = FinancePlatformModel.GetCustomerCreditBalanceResponse().validate(
|
|
1002
|
+
responseData,
|
|
1003
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1004
|
+
);
|
|
1005
|
+
|
|
1006
|
+
if (res_error) {
|
|
1007
|
+
Logger({
|
|
1008
|
+
level: "WARN",
|
|
1009
|
+
message: `Response Validation Warnnings for platform > Finance > getCustomerCreditBalance \n ${res_error}`,
|
|
1010
|
+
});
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
return response;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
/**
|
|
1017
|
+
* @param {FinancePlatformValidator.GetDataParam} arg - Arg object
|
|
1018
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1019
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1020
|
+
* @returns {Promise<FinancePlatformModel.GetEngineResponse>} - Success response
|
|
1021
|
+
* @name getData
|
|
1022
|
+
* @summary: Gives list of columns for table provided.
|
|
1023
|
+
* @description: Gives list of columns for table provided. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/getData/).
|
|
1024
|
+
*/
|
|
1025
|
+
async getData(
|
|
1026
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1027
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1028
|
+
) {
|
|
1029
|
+
const { error } = FinancePlatformValidator.getData().validate(
|
|
1030
|
+
{
|
|
1031
|
+
body,
|
|
1032
|
+
},
|
|
1033
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1034
|
+
);
|
|
1035
|
+
if (error) {
|
|
1036
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1040
|
+
const { error: warrning } = FinancePlatformValidator.getData().validate(
|
|
1041
|
+
{
|
|
1042
|
+
body,
|
|
1043
|
+
},
|
|
1044
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1045
|
+
);
|
|
1046
|
+
if (warrning) {
|
|
1047
|
+
Logger({
|
|
1048
|
+
level: "WARN",
|
|
1049
|
+
message: `Parameter Validation warrnings for platform > Finance > getData \n ${warrning}`,
|
|
1050
|
+
});
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
const query_params = {};
|
|
1054
|
+
|
|
1055
|
+
const xHeaders = {};
|
|
1056
|
+
|
|
1057
|
+
const response = await PlatformAPIClient.execute(
|
|
1058
|
+
this.config,
|
|
1059
|
+
"post",
|
|
1060
|
+
`/service/platform/finance/v1.0/company/${this.config.companyId}/get-data`,
|
|
315
1061
|
query_params,
|
|
316
1062
|
body,
|
|
317
|
-
xHeaders
|
|
1063
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1064
|
+
{ responseHeaders }
|
|
318
1065
|
);
|
|
319
1066
|
|
|
1067
|
+
let responseData = response;
|
|
1068
|
+
if (responseHeaders) {
|
|
1069
|
+
responseData = response[0];
|
|
1070
|
+
}
|
|
1071
|
+
|
|
320
1072
|
const {
|
|
321
1073
|
error: res_error,
|
|
322
|
-
} =
|
|
1074
|
+
} = FinancePlatformModel.GetEngineResponse().validate(responseData, {
|
|
323
1075
|
abortEarly: false,
|
|
324
1076
|
allowUnknown: false,
|
|
325
1077
|
});
|
|
@@ -327,23 +1079,27 @@ class Finance {
|
|
|
327
1079
|
if (res_error) {
|
|
328
1080
|
Logger({
|
|
329
1081
|
level: "WARN",
|
|
330
|
-
message:
|
|
1082
|
+
message: `Response Validation Warnnings for platform > Finance > getData \n ${res_error}`,
|
|
331
1083
|
});
|
|
332
|
-
Logger({ level: "WARN", message: res_error });
|
|
333
1084
|
}
|
|
334
1085
|
|
|
335
1086
|
return response;
|
|
336
1087
|
}
|
|
337
1088
|
|
|
338
1089
|
/**
|
|
339
|
-
* @param {
|
|
340
|
-
* @param {
|
|
341
|
-
* @
|
|
342
|
-
* @
|
|
343
|
-
* @
|
|
1090
|
+
* @param {FinancePlatformValidator.GetPdfUrlViewParam} arg - Arg object
|
|
1091
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1092
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1093
|
+
* @returns {Promise<FinancePlatformModel.GetPdfUrlViewResponse>} - Success response
|
|
1094
|
+
* @name getPdfUrlView
|
|
1095
|
+
* @summary: Gives cn pdf url.
|
|
1096
|
+
* @description: Gives cn pdf url. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/getPdfUrlView/).
|
|
344
1097
|
*/
|
|
345
|
-
async
|
|
346
|
-
|
|
1098
|
+
async getPdfUrlView(
|
|
1099
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1100
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1101
|
+
) {
|
|
1102
|
+
const { error } = FinancePlatformValidator.getPdfUrlView().validate(
|
|
347
1103
|
{
|
|
348
1104
|
body,
|
|
349
1105
|
},
|
|
@@ -354,7 +1110,9 @@ class Finance {
|
|
|
354
1110
|
}
|
|
355
1111
|
|
|
356
1112
|
// Showing warrnings if extra unknown parameters are found
|
|
357
|
-
const {
|
|
1113
|
+
const {
|
|
1114
|
+
error: warrning,
|
|
1115
|
+
} = FinancePlatformValidator.getPdfUrlView().validate(
|
|
358
1116
|
{
|
|
359
1117
|
body,
|
|
360
1118
|
},
|
|
@@ -363,9 +1121,8 @@ class Finance {
|
|
|
363
1121
|
if (warrning) {
|
|
364
1122
|
Logger({
|
|
365
1123
|
level: "WARN",
|
|
366
|
-
message:
|
|
1124
|
+
message: `Parameter Validation warrnings for platform > Finance > getPdfUrlView \n ${warrning}`,
|
|
367
1125
|
});
|
|
368
|
-
Logger({ level: "WARN", message: warrning });
|
|
369
1126
|
}
|
|
370
1127
|
|
|
371
1128
|
const query_params = {};
|
|
@@ -375,15 +1132,21 @@ class Finance {
|
|
|
375
1132
|
const response = await PlatformAPIClient.execute(
|
|
376
1133
|
this.config,
|
|
377
1134
|
"post",
|
|
378
|
-
`/service/platform/finance/v1.0/company/${this.config.companyId}/get-
|
|
1135
|
+
`/service/platform/finance/v1.0/company/${this.config.companyId}/get-cn-pdf-link`,
|
|
379
1136
|
query_params,
|
|
380
1137
|
body,
|
|
381
|
-
xHeaders
|
|
1138
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1139
|
+
{ responseHeaders }
|
|
382
1140
|
);
|
|
383
1141
|
|
|
1142
|
+
let responseData = response;
|
|
1143
|
+
if (responseHeaders) {
|
|
1144
|
+
responseData = response[0];
|
|
1145
|
+
}
|
|
1146
|
+
|
|
384
1147
|
const {
|
|
385
1148
|
error: res_error,
|
|
386
|
-
} =
|
|
1149
|
+
} = FinancePlatformModel.GetPdfUrlViewResponse().validate(responseData, {
|
|
387
1150
|
abortEarly: false,
|
|
388
1151
|
allowUnknown: false,
|
|
389
1152
|
});
|
|
@@ -391,23 +1154,27 @@ class Finance {
|
|
|
391
1154
|
if (res_error) {
|
|
392
1155
|
Logger({
|
|
393
1156
|
level: "WARN",
|
|
394
|
-
message:
|
|
1157
|
+
message: `Response Validation Warnnings for platform > Finance > getPdfUrlView \n ${res_error}`,
|
|
395
1158
|
});
|
|
396
|
-
Logger({ level: "WARN", message: res_error });
|
|
397
1159
|
}
|
|
398
1160
|
|
|
399
1161
|
return response;
|
|
400
1162
|
}
|
|
401
1163
|
|
|
402
1164
|
/**
|
|
403
|
-
* @param {
|
|
404
|
-
* @param {
|
|
405
|
-
* @
|
|
406
|
-
* @
|
|
407
|
-
* @
|
|
1165
|
+
* @param {FinancePlatformValidator.GetReasonParam} arg - Arg object
|
|
1166
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1167
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1168
|
+
* @returns {Promise<FinancePlatformModel.GetReasonResponse>} - Success response
|
|
1169
|
+
* @name getReason
|
|
1170
|
+
* @summary: Gives list of the reasons.
|
|
1171
|
+
* @description: Gives list of the reasons. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/getReason/).
|
|
408
1172
|
*/
|
|
409
|
-
async getReason(
|
|
410
|
-
|
|
1173
|
+
async getReason(
|
|
1174
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1175
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1176
|
+
) {
|
|
1177
|
+
const { error } = FinancePlatformValidator.getReason().validate(
|
|
411
1178
|
{
|
|
412
1179
|
body,
|
|
413
1180
|
},
|
|
@@ -418,7 +1185,7 @@ class Finance {
|
|
|
418
1185
|
}
|
|
419
1186
|
|
|
420
1187
|
// Showing warrnings if extra unknown parameters are found
|
|
421
|
-
const { error: warrning } =
|
|
1188
|
+
const { error: warrning } = FinancePlatformValidator.getReason().validate(
|
|
422
1189
|
{
|
|
423
1190
|
body,
|
|
424
1191
|
},
|
|
@@ -427,9 +1194,8 @@ class Finance {
|
|
|
427
1194
|
if (warrning) {
|
|
428
1195
|
Logger({
|
|
429
1196
|
level: "WARN",
|
|
430
|
-
message:
|
|
1197
|
+
message: `Parameter Validation warrnings for platform > Finance > getReason \n ${warrning}`,
|
|
431
1198
|
});
|
|
432
|
-
Logger({ level: "WARN", message: warrning });
|
|
433
1199
|
}
|
|
434
1200
|
|
|
435
1201
|
const query_params = {};
|
|
@@ -442,12 +1208,18 @@ class Finance {
|
|
|
442
1208
|
`/service/platform/finance/v1.0/company/${this.config.companyId}/get-reason`,
|
|
443
1209
|
query_params,
|
|
444
1210
|
body,
|
|
445
|
-
xHeaders
|
|
1211
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1212
|
+
{ responseHeaders }
|
|
446
1213
|
);
|
|
447
1214
|
|
|
1215
|
+
let responseData = response;
|
|
1216
|
+
if (responseHeaders) {
|
|
1217
|
+
responseData = response[0];
|
|
1218
|
+
}
|
|
1219
|
+
|
|
448
1220
|
const {
|
|
449
1221
|
error: res_error,
|
|
450
|
-
} =
|
|
1222
|
+
} = FinancePlatformModel.GetReasonResponse().validate(responseData, {
|
|
451
1223
|
abortEarly: false,
|
|
452
1224
|
allowUnknown: false,
|
|
453
1225
|
});
|
|
@@ -455,23 +1227,27 @@ class Finance {
|
|
|
455
1227
|
if (res_error) {
|
|
456
1228
|
Logger({
|
|
457
1229
|
level: "WARN",
|
|
458
|
-
message:
|
|
1230
|
+
message: `Response Validation Warnnings for platform > Finance > getReason \n ${res_error}`,
|
|
459
1231
|
});
|
|
460
|
-
Logger({ level: "WARN", message: res_error });
|
|
461
1232
|
}
|
|
462
1233
|
|
|
463
1234
|
return response;
|
|
464
1235
|
}
|
|
465
1236
|
|
|
466
1237
|
/**
|
|
467
|
-
* @param {
|
|
468
|
-
* @param {
|
|
469
|
-
* @
|
|
470
|
-
* @
|
|
471
|
-
* @
|
|
1238
|
+
* @param {FinancePlatformValidator.GetReportListParam} arg - Arg object
|
|
1239
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1240
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1241
|
+
* @returns {Promise<FinancePlatformModel.GetReportListResponse>} - Success response
|
|
1242
|
+
* @name getReportList
|
|
1243
|
+
* @summary: Get the list of available reports for a company.
|
|
1244
|
+
* @description: Gives list of reports. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/getReportList/).
|
|
472
1245
|
*/
|
|
473
|
-
async getReportList(
|
|
474
|
-
|
|
1246
|
+
async getReportList(
|
|
1247
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1248
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1249
|
+
) {
|
|
1250
|
+
const { error } = FinancePlatformValidator.getReportList().validate(
|
|
475
1251
|
{
|
|
476
1252
|
body,
|
|
477
1253
|
},
|
|
@@ -482,7 +1258,9 @@ class Finance {
|
|
|
482
1258
|
}
|
|
483
1259
|
|
|
484
1260
|
// Showing warrnings if extra unknown parameters are found
|
|
485
|
-
const {
|
|
1261
|
+
const {
|
|
1262
|
+
error: warrning,
|
|
1263
|
+
} = FinancePlatformValidator.getReportList().validate(
|
|
486
1264
|
{
|
|
487
1265
|
body,
|
|
488
1266
|
},
|
|
@@ -491,9 +1269,8 @@ class Finance {
|
|
|
491
1269
|
if (warrning) {
|
|
492
1270
|
Logger({
|
|
493
1271
|
level: "WARN",
|
|
494
|
-
message:
|
|
1272
|
+
message: `Parameter Validation warrnings for platform > Finance > getReportList \n ${warrning}`,
|
|
495
1273
|
});
|
|
496
|
-
Logger({ level: "WARN", message: warrning });
|
|
497
1274
|
}
|
|
498
1275
|
|
|
499
1276
|
const query_params = {};
|
|
@@ -506,12 +1283,18 @@ class Finance {
|
|
|
506
1283
|
`/service/platform/finance/v1.0/company/${this.config.companyId}/get-report-list`,
|
|
507
1284
|
query_params,
|
|
508
1285
|
body,
|
|
509
|
-
xHeaders
|
|
1286
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1287
|
+
{ responseHeaders }
|
|
510
1288
|
);
|
|
511
1289
|
|
|
1290
|
+
let responseData = response;
|
|
1291
|
+
if (responseHeaders) {
|
|
1292
|
+
responseData = response[0];
|
|
1293
|
+
}
|
|
1294
|
+
|
|
512
1295
|
const {
|
|
513
1296
|
error: res_error,
|
|
514
|
-
} =
|
|
1297
|
+
} = FinancePlatformModel.GetReportListResponse().validate(responseData, {
|
|
515
1298
|
abortEarly: false,
|
|
516
1299
|
allowUnknown: false,
|
|
517
1300
|
});
|
|
@@ -519,23 +1302,107 @@ class Finance {
|
|
|
519
1302
|
if (res_error) {
|
|
520
1303
|
Logger({
|
|
521
1304
|
level: "WARN",
|
|
522
|
-
message:
|
|
1305
|
+
message: `Response Validation Warnnings for platform > Finance > getReportList \n ${res_error}`,
|
|
1306
|
+
});
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
return response;
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
/**
|
|
1313
|
+
* @param {FinancePlatformValidator.GetReportingFiltersParam} arg - Arg object
|
|
1314
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1315
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1316
|
+
* @returns {Promise<FinancePlatformModel.GetReportingFiltersResponse>} -
|
|
1317
|
+
* Success response
|
|
1318
|
+
* @name getReportingFilters
|
|
1319
|
+
* @summary: Gets all customer Cn filters and search.
|
|
1320
|
+
* @description: Gets all customer Cn filters and search. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/getReportingFilters/).
|
|
1321
|
+
*/
|
|
1322
|
+
async getReportingFilters(
|
|
1323
|
+
{ filterKey, affiliateId, requestHeaders } = { requestHeaders: {} },
|
|
1324
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1325
|
+
) {
|
|
1326
|
+
const { error } = FinancePlatformValidator.getReportingFilters().validate(
|
|
1327
|
+
{
|
|
1328
|
+
filterKey,
|
|
1329
|
+
affiliateId,
|
|
1330
|
+
},
|
|
1331
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1332
|
+
);
|
|
1333
|
+
if (error) {
|
|
1334
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1338
|
+
const {
|
|
1339
|
+
error: warrning,
|
|
1340
|
+
} = FinancePlatformValidator.getReportingFilters().validate(
|
|
1341
|
+
{
|
|
1342
|
+
filterKey,
|
|
1343
|
+
affiliateId,
|
|
1344
|
+
},
|
|
1345
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1346
|
+
);
|
|
1347
|
+
if (warrning) {
|
|
1348
|
+
Logger({
|
|
1349
|
+
level: "WARN",
|
|
1350
|
+
message: `Parameter Validation warrnings for platform > Finance > getReportingFilters \n ${warrning}`,
|
|
1351
|
+
});
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
const query_params = {};
|
|
1355
|
+
query_params["filter_key"] = filterKey;
|
|
1356
|
+
query_params["affiliate_id"] = affiliateId;
|
|
1357
|
+
|
|
1358
|
+
const xHeaders = {};
|
|
1359
|
+
|
|
1360
|
+
const response = await PlatformAPIClient.execute(
|
|
1361
|
+
this.config,
|
|
1362
|
+
"get",
|
|
1363
|
+
`/service/platform/finance/v1.0/company/${this.config.companyId}/reporting-filters`,
|
|
1364
|
+
query_params,
|
|
1365
|
+
undefined,
|
|
1366
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1367
|
+
{ responseHeaders }
|
|
1368
|
+
);
|
|
1369
|
+
|
|
1370
|
+
let responseData = response;
|
|
1371
|
+
if (responseHeaders) {
|
|
1372
|
+
responseData = response[0];
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
const {
|
|
1376
|
+
error: res_error,
|
|
1377
|
+
} = FinancePlatformModel.GetReportingFiltersResponse().validate(
|
|
1378
|
+
responseData,
|
|
1379
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1380
|
+
);
|
|
1381
|
+
|
|
1382
|
+
if (res_error) {
|
|
1383
|
+
Logger({
|
|
1384
|
+
level: "WARN",
|
|
1385
|
+
message: `Response Validation Warnnings for platform > Finance > getReportingFilters \n ${res_error}`,
|
|
523
1386
|
});
|
|
524
|
-
Logger({ level: "WARN", message: res_error });
|
|
525
1387
|
}
|
|
526
1388
|
|
|
527
1389
|
return response;
|
|
528
1390
|
}
|
|
529
1391
|
|
|
530
1392
|
/**
|
|
531
|
-
* @param {
|
|
532
|
-
* @param {
|
|
533
|
-
* @
|
|
534
|
-
* @
|
|
535
|
-
* @
|
|
1393
|
+
* @param {FinancePlatformValidator.InvoiceListingParam} arg - Arg object
|
|
1394
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1395
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1396
|
+
* @returns {Promise<FinancePlatformModel.InvoiceListingResponse>} - Success response
|
|
1397
|
+
* @name invoiceListing
|
|
1398
|
+
* @summary: Gives list of invoices.
|
|
1399
|
+
* @description: Gives list of invoices. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/invoiceListing/).
|
|
536
1400
|
*/
|
|
537
|
-
async invoiceListing(
|
|
538
|
-
|
|
1401
|
+
async invoiceListing(
|
|
1402
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1403
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1404
|
+
) {
|
|
1405
|
+
const { error } = FinancePlatformValidator.invoiceListing().validate(
|
|
539
1406
|
{
|
|
540
1407
|
body,
|
|
541
1408
|
},
|
|
@@ -546,7 +1413,9 @@ class Finance {
|
|
|
546
1413
|
}
|
|
547
1414
|
|
|
548
1415
|
// Showing warrnings if extra unknown parameters are found
|
|
549
|
-
const {
|
|
1416
|
+
const {
|
|
1417
|
+
error: warrning,
|
|
1418
|
+
} = FinancePlatformValidator.invoiceListing().validate(
|
|
550
1419
|
{
|
|
551
1420
|
body,
|
|
552
1421
|
},
|
|
@@ -555,9 +1424,8 @@ class Finance {
|
|
|
555
1424
|
if (warrning) {
|
|
556
1425
|
Logger({
|
|
557
1426
|
level: "WARN",
|
|
558
|
-
message:
|
|
1427
|
+
message: `Parameter Validation warrnings for platform > Finance > invoiceListing \n ${warrning}`,
|
|
559
1428
|
});
|
|
560
|
-
Logger({ level: "WARN", message: warrning });
|
|
561
1429
|
}
|
|
562
1430
|
|
|
563
1431
|
const query_params = {};
|
|
@@ -570,12 +1438,18 @@ class Finance {
|
|
|
570
1438
|
`/service/platform/finance/v1.0/company/${this.config.companyId}/invoice/listing`,
|
|
571
1439
|
query_params,
|
|
572
1440
|
body,
|
|
573
|
-
xHeaders
|
|
1441
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1442
|
+
{ responseHeaders }
|
|
574
1443
|
);
|
|
575
1444
|
|
|
1445
|
+
let responseData = response;
|
|
1446
|
+
if (responseHeaders) {
|
|
1447
|
+
responseData = response[0];
|
|
1448
|
+
}
|
|
1449
|
+
|
|
576
1450
|
const {
|
|
577
1451
|
error: res_error,
|
|
578
|
-
} =
|
|
1452
|
+
} = FinancePlatformModel.InvoiceListingResponse().validate(responseData, {
|
|
579
1453
|
abortEarly: false,
|
|
580
1454
|
allowUnknown: false,
|
|
581
1455
|
});
|
|
@@ -583,23 +1457,27 @@ class Finance {
|
|
|
583
1457
|
if (res_error) {
|
|
584
1458
|
Logger({
|
|
585
1459
|
level: "WARN",
|
|
586
|
-
message:
|
|
1460
|
+
message: `Response Validation Warnnings for platform > Finance > invoiceListing \n ${res_error}`,
|
|
587
1461
|
});
|
|
588
|
-
Logger({ level: "WARN", message: res_error });
|
|
589
1462
|
}
|
|
590
1463
|
|
|
591
1464
|
return response;
|
|
592
1465
|
}
|
|
593
1466
|
|
|
594
1467
|
/**
|
|
595
|
-
* @param {
|
|
596
|
-
* @param {
|
|
597
|
-
* @
|
|
598
|
-
* @
|
|
599
|
-
* @
|
|
1468
|
+
* @param {FinancePlatformValidator.InvoicePDFParam} arg - Arg object
|
|
1469
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1470
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1471
|
+
* @returns {Promise<FinancePlatformModel.InvoicePdfResponse>} - Success response
|
|
1472
|
+
* @name invoicePDF
|
|
1473
|
+
* @summary: Gives pdf view of invoice.
|
|
1474
|
+
* @description: Gives pdf view of invoice. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/invoicePDF/).
|
|
600
1475
|
*/
|
|
601
|
-
async invoicePDF(
|
|
602
|
-
|
|
1476
|
+
async invoicePDF(
|
|
1477
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1478
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1479
|
+
) {
|
|
1480
|
+
const { error } = FinancePlatformValidator.invoicePDF().validate(
|
|
603
1481
|
{
|
|
604
1482
|
body,
|
|
605
1483
|
},
|
|
@@ -610,7 +1488,7 @@ class Finance {
|
|
|
610
1488
|
}
|
|
611
1489
|
|
|
612
1490
|
// Showing warrnings if extra unknown parameters are found
|
|
613
|
-
const { error: warrning } =
|
|
1491
|
+
const { error: warrning } = FinancePlatformValidator.invoicePDF().validate(
|
|
614
1492
|
{
|
|
615
1493
|
body,
|
|
616
1494
|
},
|
|
@@ -619,9 +1497,8 @@ class Finance {
|
|
|
619
1497
|
if (warrning) {
|
|
620
1498
|
Logger({
|
|
621
1499
|
level: "WARN",
|
|
622
|
-
message:
|
|
1500
|
+
message: `Parameter Validation warrnings for platform > Finance > invoicePDF \n ${warrning}`,
|
|
623
1501
|
});
|
|
624
|
-
Logger({ level: "WARN", message: warrning });
|
|
625
1502
|
}
|
|
626
1503
|
|
|
627
1504
|
const query_params = {};
|
|
@@ -634,12 +1511,18 @@ class Finance {
|
|
|
634
1511
|
`/service/platform/finance/v1.0/company/${this.config.companyId}/invoice/pdf-view`,
|
|
635
1512
|
query_params,
|
|
636
1513
|
body,
|
|
637
|
-
xHeaders
|
|
1514
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1515
|
+
{ responseHeaders }
|
|
638
1516
|
);
|
|
639
1517
|
|
|
1518
|
+
let responseData = response;
|
|
1519
|
+
if (responseHeaders) {
|
|
1520
|
+
responseData = response[0];
|
|
1521
|
+
}
|
|
1522
|
+
|
|
640
1523
|
const {
|
|
641
1524
|
error: res_error,
|
|
642
|
-
} =
|
|
1525
|
+
} = FinancePlatformModel.InvoicePdfResponse().validate(responseData, {
|
|
643
1526
|
abortEarly: false,
|
|
644
1527
|
allowUnknown: false,
|
|
645
1528
|
});
|
|
@@ -647,23 +1530,27 @@ class Finance {
|
|
|
647
1530
|
if (res_error) {
|
|
648
1531
|
Logger({
|
|
649
1532
|
level: "WARN",
|
|
650
|
-
message:
|
|
1533
|
+
message: `Response Validation Warnnings for platform > Finance > invoicePDF \n ${res_error}`,
|
|
651
1534
|
});
|
|
652
|
-
Logger({ level: "WARN", message: res_error });
|
|
653
1535
|
}
|
|
654
1536
|
|
|
655
1537
|
return response;
|
|
656
1538
|
}
|
|
657
1539
|
|
|
658
1540
|
/**
|
|
659
|
-
* @param {
|
|
660
|
-
* @param {
|
|
661
|
-
* @
|
|
662
|
-
* @
|
|
663
|
-
* @
|
|
1541
|
+
* @param {FinancePlatformValidator.InvoiceTypeParam} arg - Arg object
|
|
1542
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1543
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1544
|
+
* @returns {Promise<FinancePlatformModel.InvoiceTypeResponse>} - Success response
|
|
1545
|
+
* @name invoiceType
|
|
1546
|
+
* @summary: Gives list of active invoice type.
|
|
1547
|
+
* @description: Gives list of active invoice type. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/invoiceType/).
|
|
664
1548
|
*/
|
|
665
|
-
async invoiceType(
|
|
666
|
-
|
|
1549
|
+
async invoiceType(
|
|
1550
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1551
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1552
|
+
) {
|
|
1553
|
+
const { error } = FinancePlatformValidator.invoiceType().validate(
|
|
667
1554
|
{
|
|
668
1555
|
body,
|
|
669
1556
|
},
|
|
@@ -674,7 +1561,7 @@ class Finance {
|
|
|
674
1561
|
}
|
|
675
1562
|
|
|
676
1563
|
// Showing warrnings if extra unknown parameters are found
|
|
677
|
-
const { error: warrning } =
|
|
1564
|
+
const { error: warrning } = FinancePlatformValidator.invoiceType().validate(
|
|
678
1565
|
{
|
|
679
1566
|
body,
|
|
680
1567
|
},
|
|
@@ -683,9 +1570,8 @@ class Finance {
|
|
|
683
1570
|
if (warrning) {
|
|
684
1571
|
Logger({
|
|
685
1572
|
level: "WARN",
|
|
686
|
-
message:
|
|
1573
|
+
message: `Parameter Validation warrnings for platform > Finance > invoiceType \n ${warrning}`,
|
|
687
1574
|
});
|
|
688
|
-
Logger({ level: "WARN", message: warrning });
|
|
689
1575
|
}
|
|
690
1576
|
|
|
691
1577
|
const query_params = {};
|
|
@@ -698,12 +1584,18 @@ class Finance {
|
|
|
698
1584
|
`/service/platform/finance/v1.0/company/${this.config.companyId}/invoice-type`,
|
|
699
1585
|
query_params,
|
|
700
1586
|
body,
|
|
701
|
-
xHeaders
|
|
1587
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1588
|
+
{ responseHeaders }
|
|
702
1589
|
);
|
|
703
1590
|
|
|
1591
|
+
let responseData = response;
|
|
1592
|
+
if (responseHeaders) {
|
|
1593
|
+
responseData = response[0];
|
|
1594
|
+
}
|
|
1595
|
+
|
|
704
1596
|
const {
|
|
705
1597
|
error: res_error,
|
|
706
|
-
} =
|
|
1598
|
+
} = FinancePlatformModel.InvoiceTypeResponse().validate(responseData, {
|
|
707
1599
|
abortEarly: false,
|
|
708
1600
|
allowUnknown: false,
|
|
709
1601
|
});
|
|
@@ -711,23 +1603,28 @@ class Finance {
|
|
|
711
1603
|
if (res_error) {
|
|
712
1604
|
Logger({
|
|
713
1605
|
level: "WARN",
|
|
714
|
-
message:
|
|
1606
|
+
message: `Response Validation Warnnings for platform > Finance > invoiceType \n ${res_error}`,
|
|
715
1607
|
});
|
|
716
|
-
Logger({ level: "WARN", message: res_error });
|
|
717
1608
|
}
|
|
718
1609
|
|
|
719
1610
|
return response;
|
|
720
1611
|
}
|
|
721
1612
|
|
|
722
1613
|
/**
|
|
723
|
-
* @param {
|
|
724
|
-
* @param {
|
|
725
|
-
* @
|
|
726
|
-
* @
|
|
727
|
-
*
|
|
1614
|
+
* @param {FinancePlatformValidator.IsCnRefundMethodParam} arg - Arg object
|
|
1615
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1616
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1617
|
+
* @returns {Promise<FinancePlatformModel.IsCnRefundMethodResponse>} -
|
|
1618
|
+
* Success response
|
|
1619
|
+
* @name isCnRefundMethod
|
|
1620
|
+
* @summary: Checks if seller has obtained cn as refund method or not.
|
|
1621
|
+
* @description: Checks if seller has obtained cn as refund method or not. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/isCnRefundMethod/).
|
|
728
1622
|
*/
|
|
729
|
-
async
|
|
730
|
-
|
|
1623
|
+
async isCnRefundMethod(
|
|
1624
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1625
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1626
|
+
) {
|
|
1627
|
+
const { error } = FinancePlatformValidator.isCnRefundMethod().validate(
|
|
731
1628
|
{
|
|
732
1629
|
body,
|
|
733
1630
|
},
|
|
@@ -740,7 +1637,7 @@ class Finance {
|
|
|
740
1637
|
// Showing warrnings if extra unknown parameters are found
|
|
741
1638
|
const {
|
|
742
1639
|
error: warrning,
|
|
743
|
-
} =
|
|
1640
|
+
} = FinancePlatformValidator.isCnRefundMethod().validate(
|
|
744
1641
|
{
|
|
745
1642
|
body,
|
|
746
1643
|
},
|
|
@@ -749,9 +1646,8 @@ class Finance {
|
|
|
749
1646
|
if (warrning) {
|
|
750
1647
|
Logger({
|
|
751
1648
|
level: "WARN",
|
|
752
|
-
message:
|
|
1649
|
+
message: `Parameter Validation warrnings for platform > Finance > isCnRefundMethod \n ${warrning}`,
|
|
753
1650
|
});
|
|
754
|
-
Logger({ level: "WARN", message: warrning });
|
|
755
1651
|
}
|
|
756
1652
|
|
|
757
1653
|
const query_params = {};
|
|
@@ -761,15 +1657,21 @@ class Finance {
|
|
|
761
1657
|
const response = await PlatformAPIClient.execute(
|
|
762
1658
|
this.config,
|
|
763
1659
|
"post",
|
|
764
|
-
`/service/platform/finance/v1.0/company/${this.config.companyId}/
|
|
1660
|
+
`/service/platform/finance/v1.0/company/${this.config.companyId}/cn-as-refund-method`,
|
|
765
1661
|
query_params,
|
|
766
1662
|
body,
|
|
767
|
-
xHeaders
|
|
1663
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1664
|
+
{ responseHeaders }
|
|
768
1665
|
);
|
|
769
1666
|
|
|
1667
|
+
let responseData = response;
|
|
1668
|
+
if (responseHeaders) {
|
|
1669
|
+
responseData = response[0];
|
|
1670
|
+
}
|
|
1671
|
+
|
|
770
1672
|
const {
|
|
771
1673
|
error: res_error,
|
|
772
|
-
} =
|
|
1674
|
+
} = FinancePlatformModel.IsCnRefundMethodResponse().validate(responseData, {
|
|
773
1675
|
abortEarly: false,
|
|
774
1676
|
allowUnknown: false,
|
|
775
1677
|
});
|
|
@@ -777,23 +1679,103 @@ class Finance {
|
|
|
777
1679
|
if (res_error) {
|
|
778
1680
|
Logger({
|
|
779
1681
|
level: "WARN",
|
|
780
|
-
message:
|
|
1682
|
+
message: `Response Validation Warnnings for platform > Finance > isCnRefundMethod \n ${res_error}`,
|
|
1683
|
+
});
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
return response;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
/**
|
|
1690
|
+
* @param {FinancePlatformValidator.IsCreditlinePlatformParam} arg - Arg object
|
|
1691
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1692
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1693
|
+
* @returns {Promise<FinancePlatformModel.IsCreditlinePlatformResponse>} -
|
|
1694
|
+
* Success response
|
|
1695
|
+
* @name isCreditlinePlatform
|
|
1696
|
+
* @summary: Checks if seller has opted for creditline or not.
|
|
1697
|
+
* @description: Checks if seller has opted for creditline or not. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/isCreditlinePlatform/).
|
|
1698
|
+
*/
|
|
1699
|
+
async isCreditlinePlatform(
|
|
1700
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1701
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1702
|
+
) {
|
|
1703
|
+
const { error } = FinancePlatformValidator.isCreditlinePlatform().validate(
|
|
1704
|
+
{
|
|
1705
|
+
body,
|
|
1706
|
+
},
|
|
1707
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1708
|
+
);
|
|
1709
|
+
if (error) {
|
|
1710
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1714
|
+
const {
|
|
1715
|
+
error: warrning,
|
|
1716
|
+
} = FinancePlatformValidator.isCreditlinePlatform().validate(
|
|
1717
|
+
{
|
|
1718
|
+
body,
|
|
1719
|
+
},
|
|
1720
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1721
|
+
);
|
|
1722
|
+
if (warrning) {
|
|
1723
|
+
Logger({
|
|
1724
|
+
level: "WARN",
|
|
1725
|
+
message: `Parameter Validation warrnings for platform > Finance > isCreditlinePlatform \n ${warrning}`,
|
|
1726
|
+
});
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
const query_params = {};
|
|
1730
|
+
|
|
1731
|
+
const xHeaders = {};
|
|
1732
|
+
|
|
1733
|
+
const response = await PlatformAPIClient.execute(
|
|
1734
|
+
this.config,
|
|
1735
|
+
"post",
|
|
1736
|
+
`/service/platform/finance/v1.0/company/${this.config.companyId}/creditline-opted`,
|
|
1737
|
+
query_params,
|
|
1738
|
+
body,
|
|
1739
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1740
|
+
{ responseHeaders }
|
|
1741
|
+
);
|
|
1742
|
+
|
|
1743
|
+
let responseData = response;
|
|
1744
|
+
if (responseHeaders) {
|
|
1745
|
+
responseData = response[0];
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
const {
|
|
1749
|
+
error: res_error,
|
|
1750
|
+
} = FinancePlatformModel.IsCreditlinePlatformResponse().validate(
|
|
1751
|
+
responseData,
|
|
1752
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1753
|
+
);
|
|
1754
|
+
|
|
1755
|
+
if (res_error) {
|
|
1756
|
+
Logger({
|
|
1757
|
+
level: "WARN",
|
|
1758
|
+
message: `Response Validation Warnnings for platform > Finance > isCreditlinePlatform \n ${res_error}`,
|
|
781
1759
|
});
|
|
782
|
-
Logger({ level: "WARN", message: res_error });
|
|
783
1760
|
}
|
|
784
1761
|
|
|
785
1762
|
return response;
|
|
786
1763
|
}
|
|
787
1764
|
|
|
788
1765
|
/**
|
|
789
|
-
* @param {
|
|
790
|
-
* @param {
|
|
791
|
-
* @
|
|
792
|
-
* @
|
|
793
|
-
* @
|
|
1766
|
+
* @param {FinancePlatformValidator.PaymentProcessParam} arg - Arg object
|
|
1767
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1768
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1769
|
+
* @returns {Promise<FinancePlatformModel.PaymentProcessResponse>} - Success response
|
|
1770
|
+
* @name paymentProcess
|
|
1771
|
+
* @summary: Payment Processing API.
|
|
1772
|
+
* @description: Payment Processing API. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/paymentProcess/).
|
|
794
1773
|
*/
|
|
795
|
-
async paymentProcess(
|
|
796
|
-
|
|
1774
|
+
async paymentProcess(
|
|
1775
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1776
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1777
|
+
) {
|
|
1778
|
+
const { error } = FinancePlatformValidator.paymentProcess().validate(
|
|
797
1779
|
{
|
|
798
1780
|
body,
|
|
799
1781
|
},
|
|
@@ -804,7 +1786,9 @@ class Finance {
|
|
|
804
1786
|
}
|
|
805
1787
|
|
|
806
1788
|
// Showing warrnings if extra unknown parameters are found
|
|
807
|
-
const {
|
|
1789
|
+
const {
|
|
1790
|
+
error: warrning,
|
|
1791
|
+
} = FinancePlatformValidator.paymentProcess().validate(
|
|
808
1792
|
{
|
|
809
1793
|
body,
|
|
810
1794
|
},
|
|
@@ -813,9 +1797,8 @@ class Finance {
|
|
|
813
1797
|
if (warrning) {
|
|
814
1798
|
Logger({
|
|
815
1799
|
level: "WARN",
|
|
816
|
-
message:
|
|
1800
|
+
message: `Parameter Validation warrnings for platform > Finance > paymentProcess \n ${warrning}`,
|
|
817
1801
|
});
|
|
818
|
-
Logger({ level: "WARN", message: warrning });
|
|
819
1802
|
}
|
|
820
1803
|
|
|
821
1804
|
const query_params = {};
|
|
@@ -828,12 +1811,18 @@ class Finance {
|
|
|
828
1811
|
`/service/platform/finance/v1.0/company/${this.config.companyId}/payment-process`,
|
|
829
1812
|
query_params,
|
|
830
1813
|
body,
|
|
831
|
-
xHeaders
|
|
1814
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1815
|
+
{ responseHeaders }
|
|
832
1816
|
);
|
|
833
1817
|
|
|
1818
|
+
let responseData = response;
|
|
1819
|
+
if (responseHeaders) {
|
|
1820
|
+
responseData = response[0];
|
|
1821
|
+
}
|
|
1822
|
+
|
|
834
1823
|
const {
|
|
835
1824
|
error: res_error,
|
|
836
|
-
} =
|
|
1825
|
+
} = FinancePlatformModel.PaymentProcessResponse().validate(responseData, {
|
|
837
1826
|
abortEarly: false,
|
|
838
1827
|
allowUnknown: false,
|
|
839
1828
|
});
|
|
@@ -841,9 +1830,8 @@ class Finance {
|
|
|
841
1830
|
if (res_error) {
|
|
842
1831
|
Logger({
|
|
843
1832
|
level: "WARN",
|
|
844
|
-
message:
|
|
1833
|
+
message: `Response Validation Warnnings for platform > Finance > paymentProcess \n ${res_error}`,
|
|
845
1834
|
});
|
|
846
|
-
Logger({ level: "WARN", message: res_error });
|
|
847
1835
|
}
|
|
848
1836
|
|
|
849
1837
|
return response;
|