@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 BillingPlatformValidator = require("./BillingPlatformValidator");
|
|
5
|
+
const BillingPlatformModel = require("./BillingPlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
7
|
const Joi = require("joi");
|
|
8
8
|
|
|
@@ -12,14 +12,21 @@ class Billing {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* @param {
|
|
16
|
-
* @param {
|
|
17
|
-
* @
|
|
15
|
+
* @param {BillingPlatformValidator.ActivateSubscriptionPlanParam} arg - Arg object
|
|
16
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
17
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
18
|
+
* @returns {Promise<BillingPlatformModel.SubscriptionActivateRes>} - Success response
|
|
19
|
+
* @name activateSubscriptionPlan
|
|
18
20
|
* @summary: Activate subscription
|
|
19
|
-
* @description: It will activate subscription plan for customer
|
|
21
|
+
* @description: It will activate subscription plan for customer - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/activateSubscriptionPlan/).
|
|
20
22
|
*/
|
|
21
|
-
async activateSubscriptionPlan(
|
|
22
|
-
|
|
23
|
+
async activateSubscriptionPlan(
|
|
24
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
25
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
26
|
+
) {
|
|
27
|
+
const {
|
|
28
|
+
error,
|
|
29
|
+
} = BillingPlatformValidator.activateSubscriptionPlan().validate(
|
|
23
30
|
{
|
|
24
31
|
body,
|
|
25
32
|
},
|
|
@@ -32,7 +39,7 @@ class Billing {
|
|
|
32
39
|
// Showing warrnings if extra unknown parameters are found
|
|
33
40
|
const {
|
|
34
41
|
error: warrning,
|
|
35
|
-
} =
|
|
42
|
+
} = BillingPlatformValidator.activateSubscriptionPlan().validate(
|
|
36
43
|
{
|
|
37
44
|
body,
|
|
38
45
|
},
|
|
@@ -41,9 +48,8 @@ class Billing {
|
|
|
41
48
|
if (warrning) {
|
|
42
49
|
Logger({
|
|
43
50
|
level: "WARN",
|
|
44
|
-
message:
|
|
51
|
+
message: `Parameter Validation warrnings for platform > Billing > activateSubscriptionPlan \n ${warrning}`,
|
|
45
52
|
});
|
|
46
|
-
Logger({ level: "WARN", message: warrning });
|
|
47
53
|
}
|
|
48
54
|
|
|
49
55
|
const query_params = {};
|
|
@@ -56,12 +62,18 @@ class Billing {
|
|
|
56
62
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/activate`,
|
|
57
63
|
query_params,
|
|
58
64
|
body,
|
|
59
|
-
xHeaders
|
|
65
|
+
{ ...xHeaders, ...requestHeaders },
|
|
66
|
+
{ responseHeaders }
|
|
60
67
|
);
|
|
61
68
|
|
|
69
|
+
let responseData = response;
|
|
70
|
+
if (responseHeaders) {
|
|
71
|
+
responseData = response[0];
|
|
72
|
+
}
|
|
73
|
+
|
|
62
74
|
const {
|
|
63
75
|
error: res_error,
|
|
64
|
-
} =
|
|
76
|
+
} = BillingPlatformModel.SubscriptionActivateRes().validate(responseData, {
|
|
65
77
|
abortEarly: false,
|
|
66
78
|
allowUnknown: false,
|
|
67
79
|
});
|
|
@@ -69,24 +81,29 @@ class Billing {
|
|
|
69
81
|
if (res_error) {
|
|
70
82
|
Logger({
|
|
71
83
|
level: "WARN",
|
|
72
|
-
message:
|
|
84
|
+
message: `Response Validation Warnnings for platform > Billing > activateSubscriptionPlan \n ${res_error}`,
|
|
73
85
|
});
|
|
74
|
-
Logger({ level: "WARN", message: res_error });
|
|
75
86
|
}
|
|
76
87
|
|
|
77
88
|
return response;
|
|
78
89
|
}
|
|
79
90
|
|
|
80
91
|
/**
|
|
81
|
-
* @param {
|
|
82
|
-
* @param {
|
|
83
|
-
* @param {
|
|
84
|
-
* @returns {Promise<EntitySubscription>} - Success response
|
|
92
|
+
* @param {BillingPlatformValidator.CancelSubscriptionChargeParam} arg - Arg object
|
|
93
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
94
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
95
|
+
* @returns {Promise<BillingPlatformModel.EntitySubscription>} - Success response
|
|
96
|
+
* @name cancelSubscriptionCharge
|
|
85
97
|
* @summary: Cancel subscription charge
|
|
86
|
-
* @description: Cancel subscription and attached charges.
|
|
98
|
+
* @description: Cancel subscription and attached charges. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/cancelSubscriptionCharge/).
|
|
87
99
|
*/
|
|
88
|
-
async cancelSubscriptionCharge(
|
|
89
|
-
|
|
100
|
+
async cancelSubscriptionCharge(
|
|
101
|
+
{ extensionId, subscriptionId, requestHeaders } = { requestHeaders: {} },
|
|
102
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
103
|
+
) {
|
|
104
|
+
const {
|
|
105
|
+
error,
|
|
106
|
+
} = BillingPlatformValidator.cancelSubscriptionCharge().validate(
|
|
90
107
|
{
|
|
91
108
|
extensionId,
|
|
92
109
|
subscriptionId,
|
|
@@ -100,7 +117,7 @@ class Billing {
|
|
|
100
117
|
// Showing warrnings if extra unknown parameters are found
|
|
101
118
|
const {
|
|
102
119
|
error: warrning,
|
|
103
|
-
} =
|
|
120
|
+
} = BillingPlatformValidator.cancelSubscriptionCharge().validate(
|
|
104
121
|
{
|
|
105
122
|
extensionId,
|
|
106
123
|
subscriptionId,
|
|
@@ -110,9 +127,8 @@ class Billing {
|
|
|
110
127
|
if (warrning) {
|
|
111
128
|
Logger({
|
|
112
129
|
level: "WARN",
|
|
113
|
-
message:
|
|
130
|
+
message: `Parameter Validation warrnings for platform > Billing > cancelSubscriptionCharge \n ${warrning}`,
|
|
114
131
|
});
|
|
115
|
-
Logger({ level: "WARN", message: warrning });
|
|
116
132
|
}
|
|
117
133
|
|
|
118
134
|
const query_params = {};
|
|
@@ -125,12 +141,18 @@ class Billing {
|
|
|
125
141
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscription/${subscriptionId}/cancel`,
|
|
126
142
|
query_params,
|
|
127
143
|
undefined,
|
|
128
|
-
xHeaders
|
|
144
|
+
{ ...xHeaders, ...requestHeaders },
|
|
145
|
+
{ responseHeaders }
|
|
129
146
|
);
|
|
130
147
|
|
|
148
|
+
let responseData = response;
|
|
149
|
+
if (responseHeaders) {
|
|
150
|
+
responseData = response[0];
|
|
151
|
+
}
|
|
152
|
+
|
|
131
153
|
const {
|
|
132
154
|
error: res_error,
|
|
133
|
-
} =
|
|
155
|
+
} = BillingPlatformModel.EntitySubscription().validate(responseData, {
|
|
134
156
|
abortEarly: false,
|
|
135
157
|
allowUnknown: false,
|
|
136
158
|
});
|
|
@@ -138,23 +160,29 @@ class Billing {
|
|
|
138
160
|
if (res_error) {
|
|
139
161
|
Logger({
|
|
140
162
|
level: "WARN",
|
|
141
|
-
message:
|
|
163
|
+
message: `Response Validation Warnnings for platform > Billing > cancelSubscriptionCharge \n ${res_error}`,
|
|
142
164
|
});
|
|
143
|
-
Logger({ level: "WARN", message: res_error });
|
|
144
165
|
}
|
|
145
166
|
|
|
146
167
|
return response;
|
|
147
168
|
}
|
|
148
169
|
|
|
149
170
|
/**
|
|
150
|
-
* @param {
|
|
151
|
-
* @param {
|
|
152
|
-
* @
|
|
171
|
+
* @param {BillingPlatformValidator.CancelSubscriptionPlanParam} arg - Arg object
|
|
172
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
173
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
174
|
+
* @returns {Promise<BillingPlatformModel.CancelSubscriptionRes>} - Success response
|
|
175
|
+
* @name cancelSubscriptionPlan
|
|
153
176
|
* @summary: Cancel subscription
|
|
154
|
-
* @description: It will cancel current active subscription.
|
|
177
|
+
* @description: It will cancel current active subscription. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/cancelSubscriptionPlan/).
|
|
155
178
|
*/
|
|
156
|
-
async cancelSubscriptionPlan(
|
|
157
|
-
|
|
179
|
+
async cancelSubscriptionPlan(
|
|
180
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
181
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
182
|
+
) {
|
|
183
|
+
const {
|
|
184
|
+
error,
|
|
185
|
+
} = BillingPlatformValidator.cancelSubscriptionPlan().validate(
|
|
158
186
|
{
|
|
159
187
|
body,
|
|
160
188
|
},
|
|
@@ -167,7 +195,7 @@ class Billing {
|
|
|
167
195
|
// Showing warrnings if extra unknown parameters are found
|
|
168
196
|
const {
|
|
169
197
|
error: warrning,
|
|
170
|
-
} =
|
|
198
|
+
} = BillingPlatformValidator.cancelSubscriptionPlan().validate(
|
|
171
199
|
{
|
|
172
200
|
body,
|
|
173
201
|
},
|
|
@@ -176,9 +204,8 @@ class Billing {
|
|
|
176
204
|
if (warrning) {
|
|
177
205
|
Logger({
|
|
178
206
|
level: "WARN",
|
|
179
|
-
message:
|
|
207
|
+
message: `Parameter Validation warrnings for platform > Billing > cancelSubscriptionPlan \n ${warrning}`,
|
|
180
208
|
});
|
|
181
|
-
Logger({ level: "WARN", message: warrning });
|
|
182
209
|
}
|
|
183
210
|
|
|
184
211
|
const query_params = {};
|
|
@@ -191,12 +218,18 @@ class Billing {
|
|
|
191
218
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/cancel`,
|
|
192
219
|
query_params,
|
|
193
220
|
body,
|
|
194
|
-
xHeaders
|
|
221
|
+
{ ...xHeaders, ...requestHeaders },
|
|
222
|
+
{ responseHeaders }
|
|
195
223
|
);
|
|
196
224
|
|
|
225
|
+
let responseData = response;
|
|
226
|
+
if (responseHeaders) {
|
|
227
|
+
responseData = response[0];
|
|
228
|
+
}
|
|
229
|
+
|
|
197
230
|
const {
|
|
198
231
|
error: res_error,
|
|
199
|
-
} =
|
|
232
|
+
} = BillingPlatformModel.CancelSubscriptionRes().validate(responseData, {
|
|
200
233
|
abortEarly: false,
|
|
201
234
|
allowUnknown: false,
|
|
202
235
|
});
|
|
@@ -204,24 +237,27 @@ class Billing {
|
|
|
204
237
|
if (res_error) {
|
|
205
238
|
Logger({
|
|
206
239
|
level: "WARN",
|
|
207
|
-
message:
|
|
240
|
+
message: `Response Validation Warnnings for platform > Billing > cancelSubscriptionPlan \n ${res_error}`,
|
|
208
241
|
});
|
|
209
|
-
Logger({ level: "WARN", message: res_error });
|
|
210
242
|
}
|
|
211
243
|
|
|
212
244
|
return response;
|
|
213
245
|
}
|
|
214
246
|
|
|
215
247
|
/**
|
|
216
|
-
* @param {
|
|
217
|
-
* @param {
|
|
218
|
-
* @param {
|
|
219
|
-
* @returns {Promise<CheckValidityResponse>} - Success response
|
|
248
|
+
* @param {BillingPlatformValidator.CheckCouponValidityParam} arg - Arg object
|
|
249
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
250
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
251
|
+
* @returns {Promise<BillingPlatformModel.CheckValidityResponse>} - Success response
|
|
252
|
+
* @name checkCouponValidity
|
|
220
253
|
* @summary: Check coupon validity
|
|
221
|
-
* @description: Check coupon validity.
|
|
254
|
+
* @description: Check coupon validity. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/checkCouponValidity/).
|
|
222
255
|
*/
|
|
223
|
-
async checkCouponValidity(
|
|
224
|
-
|
|
256
|
+
async checkCouponValidity(
|
|
257
|
+
{ plan, couponCode, requestHeaders } = { requestHeaders: {} },
|
|
258
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
259
|
+
) {
|
|
260
|
+
const { error } = BillingPlatformValidator.checkCouponValidity().validate(
|
|
225
261
|
{
|
|
226
262
|
plan,
|
|
227
263
|
couponCode,
|
|
@@ -233,7 +269,9 @@ class Billing {
|
|
|
233
269
|
}
|
|
234
270
|
|
|
235
271
|
// Showing warrnings if extra unknown parameters are found
|
|
236
|
-
const {
|
|
272
|
+
const {
|
|
273
|
+
error: warrning,
|
|
274
|
+
} = BillingPlatformValidator.checkCouponValidity().validate(
|
|
237
275
|
{
|
|
238
276
|
plan,
|
|
239
277
|
couponCode,
|
|
@@ -243,9 +281,8 @@ class Billing {
|
|
|
243
281
|
if (warrning) {
|
|
244
282
|
Logger({
|
|
245
283
|
level: "WARN",
|
|
246
|
-
message:
|
|
284
|
+
message: `Parameter Validation warrnings for platform > Billing > checkCouponValidity \n ${warrning}`,
|
|
247
285
|
});
|
|
248
|
-
Logger({ level: "WARN", message: warrning });
|
|
249
286
|
}
|
|
250
287
|
|
|
251
288
|
const query_params = {};
|
|
@@ -260,12 +297,18 @@ class Billing {
|
|
|
260
297
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/coupon/check-validity`,
|
|
261
298
|
query_params,
|
|
262
299
|
undefined,
|
|
263
|
-
xHeaders
|
|
300
|
+
{ ...xHeaders, ...requestHeaders },
|
|
301
|
+
{ responseHeaders }
|
|
264
302
|
);
|
|
265
303
|
|
|
304
|
+
let responseData = response;
|
|
305
|
+
if (responseHeaders) {
|
|
306
|
+
responseData = response[0];
|
|
307
|
+
}
|
|
308
|
+
|
|
266
309
|
const {
|
|
267
310
|
error: res_error,
|
|
268
|
-
} =
|
|
311
|
+
} = BillingPlatformModel.CheckValidityResponse().validate(responseData, {
|
|
269
312
|
abortEarly: false,
|
|
270
313
|
allowUnknown: false,
|
|
271
314
|
});
|
|
@@ -273,24 +316,28 @@ class Billing {
|
|
|
273
316
|
if (res_error) {
|
|
274
317
|
Logger({
|
|
275
318
|
level: "WARN",
|
|
276
|
-
message:
|
|
319
|
+
message: `Response Validation Warnnings for platform > Billing > checkCouponValidity \n ${res_error}`,
|
|
277
320
|
});
|
|
278
|
-
Logger({ level: "WARN", message: res_error });
|
|
279
321
|
}
|
|
280
322
|
|
|
281
323
|
return response;
|
|
282
324
|
}
|
|
283
325
|
|
|
284
326
|
/**
|
|
285
|
-
* @param {
|
|
286
|
-
* @param {
|
|
287
|
-
* @param {
|
|
288
|
-
* @returns {Promise<CreateOneTimeChargeResponse>} -
|
|
327
|
+
* @param {BillingPlatformValidator.CreateOneTimeChargeParam} arg - Arg object
|
|
328
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
329
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
330
|
+
* @returns {Promise<BillingPlatformModel.CreateOneTimeChargeResponse>} -
|
|
331
|
+
* Success response
|
|
332
|
+
* @name createOneTimeCharge
|
|
289
333
|
* @summary: Create one time subscription charge
|
|
290
|
-
* @description: Register one time subscription charge for a seller of your extension.
|
|
334
|
+
* @description: Register one time subscription charge for a seller of your extension. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/createOneTimeCharge/).
|
|
291
335
|
*/
|
|
292
|
-
async createOneTimeCharge(
|
|
293
|
-
|
|
336
|
+
async createOneTimeCharge(
|
|
337
|
+
{ extensionId, body, requestHeaders } = { requestHeaders: {} },
|
|
338
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
339
|
+
) {
|
|
340
|
+
const { error } = BillingPlatformValidator.createOneTimeCharge().validate(
|
|
294
341
|
{
|
|
295
342
|
extensionId,
|
|
296
343
|
body,
|
|
@@ -302,7 +349,9 @@ class Billing {
|
|
|
302
349
|
}
|
|
303
350
|
|
|
304
351
|
// Showing warrnings if extra unknown parameters are found
|
|
305
|
-
const {
|
|
352
|
+
const {
|
|
353
|
+
error: warrning,
|
|
354
|
+
} = BillingPlatformValidator.createOneTimeCharge().validate(
|
|
306
355
|
{
|
|
307
356
|
extensionId,
|
|
308
357
|
body,
|
|
@@ -312,9 +361,8 @@ class Billing {
|
|
|
312
361
|
if (warrning) {
|
|
313
362
|
Logger({
|
|
314
363
|
level: "WARN",
|
|
315
|
-
message:
|
|
364
|
+
message: `Parameter Validation warrnings for platform > Billing > createOneTimeCharge \n ${warrning}`,
|
|
316
365
|
});
|
|
317
|
-
Logger({ level: "WARN", message: warrning });
|
|
318
366
|
}
|
|
319
367
|
|
|
320
368
|
const query_params = {};
|
|
@@ -327,37 +375,49 @@ class Billing {
|
|
|
327
375
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/one_time_charge`,
|
|
328
376
|
query_params,
|
|
329
377
|
body,
|
|
330
|
-
xHeaders
|
|
378
|
+
{ ...xHeaders, ...requestHeaders },
|
|
379
|
+
{ responseHeaders }
|
|
331
380
|
);
|
|
332
381
|
|
|
382
|
+
let responseData = response;
|
|
383
|
+
if (responseHeaders) {
|
|
384
|
+
responseData = response[0];
|
|
385
|
+
}
|
|
386
|
+
|
|
333
387
|
const {
|
|
334
388
|
error: res_error,
|
|
335
|
-
} =
|
|
336
|
-
|
|
337
|
-
allowUnknown: false
|
|
338
|
-
|
|
389
|
+
} = BillingPlatformModel.CreateOneTimeChargeResponse().validate(
|
|
390
|
+
responseData,
|
|
391
|
+
{ abortEarly: false, allowUnknown: false }
|
|
392
|
+
);
|
|
339
393
|
|
|
340
394
|
if (res_error) {
|
|
341
395
|
Logger({
|
|
342
396
|
level: "WARN",
|
|
343
|
-
message:
|
|
397
|
+
message: `Response Validation Warnnings for platform > Billing > createOneTimeCharge \n ${res_error}`,
|
|
344
398
|
});
|
|
345
|
-
Logger({ level: "WARN", message: res_error });
|
|
346
399
|
}
|
|
347
400
|
|
|
348
401
|
return response;
|
|
349
402
|
}
|
|
350
403
|
|
|
351
404
|
/**
|
|
352
|
-
* @param {
|
|
353
|
-
* @param {
|
|
354
|
-
* @param {
|
|
355
|
-
* @returns {Promise<CreateSubscriptionResponse>} -
|
|
405
|
+
* @param {BillingPlatformValidator.CreateSubscriptionChargeParam} arg - Arg object
|
|
406
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
407
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
408
|
+
* @returns {Promise<BillingPlatformModel.CreateSubscriptionResponse>} -
|
|
409
|
+
* Success response
|
|
410
|
+
* @name createSubscriptionCharge
|
|
356
411
|
* @summary: Create subscription charge
|
|
357
|
-
* @description: Register subscription charge for a seller of your extension.
|
|
412
|
+
* @description: Register subscription charge for a seller of your extension. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/createSubscriptionCharge/).
|
|
358
413
|
*/
|
|
359
|
-
async createSubscriptionCharge(
|
|
360
|
-
|
|
414
|
+
async createSubscriptionCharge(
|
|
415
|
+
{ extensionId, body, requestHeaders } = { requestHeaders: {} },
|
|
416
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
417
|
+
) {
|
|
418
|
+
const {
|
|
419
|
+
error,
|
|
420
|
+
} = BillingPlatformValidator.createSubscriptionCharge().validate(
|
|
361
421
|
{
|
|
362
422
|
extensionId,
|
|
363
423
|
body,
|
|
@@ -371,7 +431,7 @@ class Billing {
|
|
|
371
431
|
// Showing warrnings if extra unknown parameters are found
|
|
372
432
|
const {
|
|
373
433
|
error: warrning,
|
|
374
|
-
} =
|
|
434
|
+
} = BillingPlatformValidator.createSubscriptionCharge().validate(
|
|
375
435
|
{
|
|
376
436
|
extensionId,
|
|
377
437
|
body,
|
|
@@ -381,9 +441,8 @@ class Billing {
|
|
|
381
441
|
if (warrning) {
|
|
382
442
|
Logger({
|
|
383
443
|
level: "WARN",
|
|
384
|
-
message:
|
|
444
|
+
message: `Parameter Validation warrnings for platform > Billing > createSubscriptionCharge \n ${warrning}`,
|
|
385
445
|
});
|
|
386
|
-
Logger({ level: "WARN", message: warrning });
|
|
387
446
|
}
|
|
388
447
|
|
|
389
448
|
const query_params = {};
|
|
@@ -396,37 +455,46 @@ class Billing {
|
|
|
396
455
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscription`,
|
|
397
456
|
query_params,
|
|
398
457
|
body,
|
|
399
|
-
xHeaders
|
|
458
|
+
{ ...xHeaders, ...requestHeaders },
|
|
459
|
+
{ responseHeaders }
|
|
400
460
|
);
|
|
401
461
|
|
|
462
|
+
let responseData = response;
|
|
463
|
+
if (responseHeaders) {
|
|
464
|
+
responseData = response[0];
|
|
465
|
+
}
|
|
466
|
+
|
|
402
467
|
const {
|
|
403
468
|
error: res_error,
|
|
404
|
-
} =
|
|
405
|
-
|
|
406
|
-
allowUnknown: false
|
|
407
|
-
|
|
469
|
+
} = BillingPlatformModel.CreateSubscriptionResponse().validate(
|
|
470
|
+
responseData,
|
|
471
|
+
{ abortEarly: false, allowUnknown: false }
|
|
472
|
+
);
|
|
408
473
|
|
|
409
474
|
if (res_error) {
|
|
410
475
|
Logger({
|
|
411
476
|
level: "WARN",
|
|
412
|
-
message:
|
|
477
|
+
message: `Response Validation Warnnings for platform > Billing > createSubscriptionCharge \n ${res_error}`,
|
|
413
478
|
});
|
|
414
|
-
Logger({ level: "WARN", message: res_error });
|
|
415
479
|
}
|
|
416
480
|
|
|
417
481
|
return response;
|
|
418
482
|
}
|
|
419
483
|
|
|
420
484
|
/**
|
|
421
|
-
* @param {
|
|
422
|
-
* @param {
|
|
423
|
-
* @param {
|
|
424
|
-
* @returns {Promise<OneTimeChargeEntity>} - Success response
|
|
485
|
+
* @param {BillingPlatformValidator.GetChargeDetailsParam} arg - Arg object
|
|
486
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
487
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
488
|
+
* @returns {Promise<BillingPlatformModel.OneTimeChargeEntity>} - Success response
|
|
489
|
+
* @name getChargeDetails
|
|
425
490
|
* @summary: Get subscription charge details
|
|
426
|
-
* @description: Get created subscription charge details
|
|
491
|
+
* @description: Get created subscription charge details - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getChargeDetails/).
|
|
427
492
|
*/
|
|
428
|
-
async getChargeDetails(
|
|
429
|
-
|
|
493
|
+
async getChargeDetails(
|
|
494
|
+
{ extensionId, chargeId, requestHeaders } = { requestHeaders: {} },
|
|
495
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
496
|
+
) {
|
|
497
|
+
const { error } = BillingPlatformValidator.getChargeDetails().validate(
|
|
430
498
|
{
|
|
431
499
|
extensionId,
|
|
432
500
|
chargeId,
|
|
@@ -438,7 +506,9 @@ class Billing {
|
|
|
438
506
|
}
|
|
439
507
|
|
|
440
508
|
// Showing warrnings if extra unknown parameters are found
|
|
441
|
-
const {
|
|
509
|
+
const {
|
|
510
|
+
error: warrning,
|
|
511
|
+
} = BillingPlatformValidator.getChargeDetails().validate(
|
|
442
512
|
{
|
|
443
513
|
extensionId,
|
|
444
514
|
chargeId,
|
|
@@ -448,9 +518,8 @@ class Billing {
|
|
|
448
518
|
if (warrning) {
|
|
449
519
|
Logger({
|
|
450
520
|
level: "WARN",
|
|
451
|
-
message:
|
|
521
|
+
message: `Parameter Validation warrnings for platform > Billing > getChargeDetails \n ${warrning}`,
|
|
452
522
|
});
|
|
453
|
-
Logger({ level: "WARN", message: warrning });
|
|
454
523
|
}
|
|
455
524
|
|
|
456
525
|
const query_params = {};
|
|
@@ -463,12 +532,18 @@ class Billing {
|
|
|
463
532
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/charge/${chargeId}`,
|
|
464
533
|
query_params,
|
|
465
534
|
undefined,
|
|
466
|
-
xHeaders
|
|
535
|
+
{ ...xHeaders, ...requestHeaders },
|
|
536
|
+
{ responseHeaders }
|
|
467
537
|
);
|
|
468
538
|
|
|
539
|
+
let responseData = response;
|
|
540
|
+
if (responseHeaders) {
|
|
541
|
+
responseData = response[0];
|
|
542
|
+
}
|
|
543
|
+
|
|
469
544
|
const {
|
|
470
545
|
error: res_error,
|
|
471
|
-
} =
|
|
546
|
+
} = BillingPlatformModel.OneTimeChargeEntity().validate(responseData, {
|
|
472
547
|
abortEarly: false,
|
|
473
548
|
allowUnknown: false,
|
|
474
549
|
});
|
|
@@ -476,22 +551,27 @@ class Billing {
|
|
|
476
551
|
if (res_error) {
|
|
477
552
|
Logger({
|
|
478
553
|
level: "WARN",
|
|
479
|
-
message:
|
|
554
|
+
message: `Response Validation Warnnings for platform > Billing > getChargeDetails \n ${res_error}`,
|
|
480
555
|
});
|
|
481
|
-
Logger({ level: "WARN", message: res_error });
|
|
482
556
|
}
|
|
483
557
|
|
|
484
558
|
return response;
|
|
485
559
|
}
|
|
486
560
|
|
|
487
561
|
/**
|
|
488
|
-
* @param {
|
|
489
|
-
* @
|
|
562
|
+
* @param {BillingPlatformValidator.GetCustomerDetailParam} arg - Arg object
|
|
563
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
564
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
565
|
+
* @returns {Promise<BillingPlatformModel.SubscriptionCustomer>} - Success response
|
|
566
|
+
* @name getCustomerDetail
|
|
490
567
|
* @summary: Get subscription customer detail
|
|
491
|
-
* @description: Get subscription customer detail.
|
|
568
|
+
* @description: Get subscription customer detail. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getCustomerDetail/).
|
|
492
569
|
*/
|
|
493
|
-
async getCustomerDetail(
|
|
494
|
-
|
|
570
|
+
async getCustomerDetail(
|
|
571
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
572
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
573
|
+
) {
|
|
574
|
+
const { error } = BillingPlatformValidator.getCustomerDetail().validate(
|
|
495
575
|
{},
|
|
496
576
|
{ abortEarly: false, allowUnknown: true }
|
|
497
577
|
);
|
|
@@ -500,16 +580,17 @@ class Billing {
|
|
|
500
580
|
}
|
|
501
581
|
|
|
502
582
|
// Showing warrnings if extra unknown parameters are found
|
|
503
|
-
const {
|
|
583
|
+
const {
|
|
584
|
+
error: warrning,
|
|
585
|
+
} = BillingPlatformValidator.getCustomerDetail().validate(
|
|
504
586
|
{},
|
|
505
587
|
{ abortEarly: false, allowUnknown: false }
|
|
506
588
|
);
|
|
507
589
|
if (warrning) {
|
|
508
590
|
Logger({
|
|
509
591
|
level: "WARN",
|
|
510
|
-
message:
|
|
592
|
+
message: `Parameter Validation warrnings for platform > Billing > getCustomerDetail \n ${warrning}`,
|
|
511
593
|
});
|
|
512
|
-
Logger({ level: "WARN", message: warrning });
|
|
513
594
|
}
|
|
514
595
|
|
|
515
596
|
const query_params = {};
|
|
@@ -522,12 +603,18 @@ class Billing {
|
|
|
522
603
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/customer-detail`,
|
|
523
604
|
query_params,
|
|
524
605
|
undefined,
|
|
525
|
-
xHeaders
|
|
606
|
+
{ ...xHeaders, ...requestHeaders },
|
|
607
|
+
{ responseHeaders }
|
|
526
608
|
);
|
|
527
609
|
|
|
610
|
+
let responseData = response;
|
|
611
|
+
if (responseHeaders) {
|
|
612
|
+
responseData = response[0];
|
|
613
|
+
}
|
|
614
|
+
|
|
528
615
|
const {
|
|
529
616
|
error: res_error,
|
|
530
|
-
} =
|
|
617
|
+
} = BillingPlatformModel.SubscriptionCustomer().validate(responseData, {
|
|
531
618
|
abortEarly: false,
|
|
532
619
|
allowUnknown: false,
|
|
533
620
|
});
|
|
@@ -535,22 +622,96 @@ class Billing {
|
|
|
535
622
|
if (res_error) {
|
|
536
623
|
Logger({
|
|
537
624
|
level: "WARN",
|
|
538
|
-
message:
|
|
625
|
+
message: `Response Validation Warnnings for platform > Billing > getCustomerDetail \n ${res_error}`,
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
return response;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* @param {BillingPlatformValidator.GetEnterprisePlansParam} arg - Arg object
|
|
634
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
635
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
636
|
+
* @returns {Promise<BillingPlatformModel.Plan[]>} - Success response
|
|
637
|
+
* @name getEnterprisePlans
|
|
638
|
+
* @summary: Get Enterprise Plans
|
|
639
|
+
* @description: Get Enterprise Plans.
|
|
640
|
+
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getEnterprisePlans/).
|
|
641
|
+
*/
|
|
642
|
+
async getEnterprisePlans(
|
|
643
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
644
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
645
|
+
) {
|
|
646
|
+
const { error } = BillingPlatformValidator.getEnterprisePlans().validate(
|
|
647
|
+
{},
|
|
648
|
+
{ abortEarly: false, allowUnknown: true }
|
|
649
|
+
);
|
|
650
|
+
if (error) {
|
|
651
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
// Showing warrnings if extra unknown parameters are found
|
|
655
|
+
const {
|
|
656
|
+
error: warrning,
|
|
657
|
+
} = BillingPlatformValidator.getEnterprisePlans().validate(
|
|
658
|
+
{},
|
|
659
|
+
{ abortEarly: false, allowUnknown: false }
|
|
660
|
+
);
|
|
661
|
+
if (warrning) {
|
|
662
|
+
Logger({
|
|
663
|
+
level: "WARN",
|
|
664
|
+
message: `Parameter Validation warrnings for platform > Billing > getEnterprisePlans \n ${warrning}`,
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
const query_params = {};
|
|
669
|
+
|
|
670
|
+
const xHeaders = {};
|
|
671
|
+
|
|
672
|
+
const response = await PlatformAPIClient.execute(
|
|
673
|
+
this.config,
|
|
674
|
+
"get",
|
|
675
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/plans`,
|
|
676
|
+
query_params,
|
|
677
|
+
undefined,
|
|
678
|
+
{ ...xHeaders, ...requestHeaders },
|
|
679
|
+
{ responseHeaders }
|
|
680
|
+
);
|
|
681
|
+
|
|
682
|
+
let responseData = response;
|
|
683
|
+
if (responseHeaders) {
|
|
684
|
+
responseData = response[0];
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
const { error: res_error } = Joi.array()
|
|
688
|
+
.items(BillingPlatformModel.Plan())
|
|
689
|
+
.validate(responseData, { abortEarly: false, allowUnknown: false });
|
|
690
|
+
|
|
691
|
+
if (res_error) {
|
|
692
|
+
Logger({
|
|
693
|
+
level: "WARN",
|
|
694
|
+
message: `Response Validation Warnnings for platform > Billing > getEnterprisePlans \n ${res_error}`,
|
|
539
695
|
});
|
|
540
|
-
Logger({ level: "WARN", message: res_error });
|
|
541
696
|
}
|
|
542
697
|
|
|
543
698
|
return response;
|
|
544
699
|
}
|
|
545
700
|
|
|
546
701
|
/**
|
|
547
|
-
* @param {
|
|
548
|
-
* @
|
|
702
|
+
* @param {BillingPlatformValidator.GetFeatureLimitConfigParam} arg - Arg object
|
|
703
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
704
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
705
|
+
* @returns {Promise<BillingPlatformModel.SubscriptionLimit>} - Success response
|
|
706
|
+
* @name getFeatureLimitConfig
|
|
549
707
|
* @summary: Get subscription subscription limits
|
|
550
|
-
* @description: Get subscription subscription limits.
|
|
708
|
+
* @description: Get subscription subscription limits. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getFeatureLimitConfig/).
|
|
551
709
|
*/
|
|
552
|
-
async getFeatureLimitConfig(
|
|
553
|
-
|
|
710
|
+
async getFeatureLimitConfig(
|
|
711
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
712
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
713
|
+
) {
|
|
714
|
+
const { error } = BillingPlatformValidator.getFeatureLimitConfig().validate(
|
|
554
715
|
{},
|
|
555
716
|
{ abortEarly: false, allowUnknown: true }
|
|
556
717
|
);
|
|
@@ -561,16 +722,15 @@ class Billing {
|
|
|
561
722
|
// Showing warrnings if extra unknown parameters are found
|
|
562
723
|
const {
|
|
563
724
|
error: warrning,
|
|
564
|
-
} =
|
|
725
|
+
} = BillingPlatformValidator.getFeatureLimitConfig().validate(
|
|
565
726
|
{},
|
|
566
727
|
{ abortEarly: false, allowUnknown: false }
|
|
567
728
|
);
|
|
568
729
|
if (warrning) {
|
|
569
730
|
Logger({
|
|
570
731
|
level: "WARN",
|
|
571
|
-
message:
|
|
732
|
+
message: `Parameter Validation warrnings for platform > Billing > getFeatureLimitConfig \n ${warrning}`,
|
|
572
733
|
});
|
|
573
|
-
Logger({ level: "WARN", message: warrning });
|
|
574
734
|
}
|
|
575
735
|
|
|
576
736
|
const query_params = {};
|
|
@@ -583,12 +743,18 @@ class Billing {
|
|
|
583
743
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/current-limit`,
|
|
584
744
|
query_params,
|
|
585
745
|
undefined,
|
|
586
|
-
xHeaders
|
|
746
|
+
{ ...xHeaders, ...requestHeaders },
|
|
747
|
+
{ responseHeaders }
|
|
587
748
|
);
|
|
588
749
|
|
|
750
|
+
let responseData = response;
|
|
751
|
+
if (responseHeaders) {
|
|
752
|
+
responseData = response[0];
|
|
753
|
+
}
|
|
754
|
+
|
|
589
755
|
const {
|
|
590
756
|
error: res_error,
|
|
591
|
-
} =
|
|
757
|
+
} = BillingPlatformModel.SubscriptionLimit().validate(responseData, {
|
|
592
758
|
abortEarly: false,
|
|
593
759
|
allowUnknown: false,
|
|
594
760
|
});
|
|
@@ -596,23 +762,27 @@ class Billing {
|
|
|
596
762
|
if (res_error) {
|
|
597
763
|
Logger({
|
|
598
764
|
level: "WARN",
|
|
599
|
-
message:
|
|
765
|
+
message: `Response Validation Warnnings for platform > Billing > getFeatureLimitConfig \n ${res_error}`,
|
|
600
766
|
});
|
|
601
|
-
Logger({ level: "WARN", message: res_error });
|
|
602
767
|
}
|
|
603
768
|
|
|
604
769
|
return response;
|
|
605
770
|
}
|
|
606
771
|
|
|
607
772
|
/**
|
|
608
|
-
* @param {
|
|
609
|
-
* @param {
|
|
610
|
-
* @
|
|
773
|
+
* @param {BillingPlatformValidator.GetInvoiceByIdParam} arg - Arg object
|
|
774
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
775
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
776
|
+
* @returns {Promise<BillingPlatformModel.Invoice>} - Success response
|
|
777
|
+
* @name getInvoiceById
|
|
611
778
|
* @summary: Get invoice by id
|
|
612
|
-
* @description: Get invoice by id.
|
|
779
|
+
* @description: Get invoice by id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getInvoiceById/).
|
|
613
780
|
*/
|
|
614
|
-
async getInvoiceById(
|
|
615
|
-
|
|
781
|
+
async getInvoiceById(
|
|
782
|
+
{ invoiceId, requestHeaders } = { requestHeaders: {} },
|
|
783
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
784
|
+
) {
|
|
785
|
+
const { error } = BillingPlatformValidator.getInvoiceById().validate(
|
|
616
786
|
{
|
|
617
787
|
invoiceId,
|
|
618
788
|
},
|
|
@@ -623,7 +793,9 @@ class Billing {
|
|
|
623
793
|
}
|
|
624
794
|
|
|
625
795
|
// Showing warrnings if extra unknown parameters are found
|
|
626
|
-
const {
|
|
796
|
+
const {
|
|
797
|
+
error: warrning,
|
|
798
|
+
} = BillingPlatformValidator.getInvoiceById().validate(
|
|
627
799
|
{
|
|
628
800
|
invoiceId,
|
|
629
801
|
},
|
|
@@ -632,9 +804,8 @@ class Billing {
|
|
|
632
804
|
if (warrning) {
|
|
633
805
|
Logger({
|
|
634
806
|
level: "WARN",
|
|
635
|
-
message:
|
|
807
|
+
message: `Parameter Validation warrnings for platform > Billing > getInvoiceById \n ${warrning}`,
|
|
636
808
|
});
|
|
637
|
-
Logger({ level: "WARN", message: warrning });
|
|
638
809
|
}
|
|
639
810
|
|
|
640
811
|
const query_params = {};
|
|
@@ -647,10 +818,18 @@ class Billing {
|
|
|
647
818
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/invoice/${invoiceId}`,
|
|
648
819
|
query_params,
|
|
649
820
|
undefined,
|
|
650
|
-
xHeaders
|
|
821
|
+
{ ...xHeaders, ...requestHeaders },
|
|
822
|
+
{ responseHeaders }
|
|
651
823
|
);
|
|
652
824
|
|
|
653
|
-
|
|
825
|
+
let responseData = response;
|
|
826
|
+
if (responseHeaders) {
|
|
827
|
+
responseData = response[0];
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
const {
|
|
831
|
+
error: res_error,
|
|
832
|
+
} = BillingPlatformModel.Invoice().validate(responseData, {
|
|
654
833
|
abortEarly: false,
|
|
655
834
|
allowUnknown: false,
|
|
656
835
|
});
|
|
@@ -658,22 +837,27 @@ class Billing {
|
|
|
658
837
|
if (res_error) {
|
|
659
838
|
Logger({
|
|
660
839
|
level: "WARN",
|
|
661
|
-
message:
|
|
840
|
+
message: `Response Validation Warnnings for platform > Billing > getInvoiceById \n ${res_error}`,
|
|
662
841
|
});
|
|
663
|
-
Logger({ level: "WARN", message: res_error });
|
|
664
842
|
}
|
|
665
843
|
|
|
666
844
|
return response;
|
|
667
845
|
}
|
|
668
846
|
|
|
669
847
|
/**
|
|
670
|
-
* @param {
|
|
671
|
-
* @
|
|
848
|
+
* @param {BillingPlatformValidator.GetInvoicesParam} arg - Arg object
|
|
849
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
850
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
851
|
+
* @returns {Promise<BillingPlatformModel.Invoices>} - Success response
|
|
852
|
+
* @name getInvoices
|
|
672
853
|
* @summary: Get invoices
|
|
673
|
-
* @description: Get invoices.
|
|
854
|
+
* @description: Get invoices. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getInvoices/).
|
|
674
855
|
*/
|
|
675
|
-
async getInvoices(
|
|
676
|
-
|
|
856
|
+
async getInvoices(
|
|
857
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
858
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
859
|
+
) {
|
|
860
|
+
const { error } = BillingPlatformValidator.getInvoices().validate(
|
|
677
861
|
{},
|
|
678
862
|
{ abortEarly: false, allowUnknown: true }
|
|
679
863
|
);
|
|
@@ -682,16 +866,15 @@ class Billing {
|
|
|
682
866
|
}
|
|
683
867
|
|
|
684
868
|
// Showing warrnings if extra unknown parameters are found
|
|
685
|
-
const { error: warrning } =
|
|
869
|
+
const { error: warrning } = BillingPlatformValidator.getInvoices().validate(
|
|
686
870
|
{},
|
|
687
871
|
{ abortEarly: false, allowUnknown: false }
|
|
688
872
|
);
|
|
689
873
|
if (warrning) {
|
|
690
874
|
Logger({
|
|
691
875
|
level: "WARN",
|
|
692
|
-
message:
|
|
876
|
+
message: `Parameter Validation warrnings for platform > Billing > getInvoices \n ${warrning}`,
|
|
693
877
|
});
|
|
694
|
-
Logger({ level: "WARN", message: warrning });
|
|
695
878
|
}
|
|
696
879
|
|
|
697
880
|
const query_params = {};
|
|
@@ -704,10 +887,18 @@ class Billing {
|
|
|
704
887
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/invoice/list`,
|
|
705
888
|
query_params,
|
|
706
889
|
undefined,
|
|
707
|
-
xHeaders
|
|
890
|
+
{ ...xHeaders, ...requestHeaders },
|
|
891
|
+
{ responseHeaders }
|
|
708
892
|
);
|
|
709
893
|
|
|
710
|
-
|
|
894
|
+
let responseData = response;
|
|
895
|
+
if (responseHeaders) {
|
|
896
|
+
responseData = response[0];
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
const {
|
|
900
|
+
error: res_error,
|
|
901
|
+
} = BillingPlatformModel.Invoices().validate(responseData, {
|
|
711
902
|
abortEarly: false,
|
|
712
903
|
allowUnknown: false,
|
|
713
904
|
});
|
|
@@ -715,22 +906,28 @@ class Billing {
|
|
|
715
906
|
if (res_error) {
|
|
716
907
|
Logger({
|
|
717
908
|
level: "WARN",
|
|
718
|
-
message:
|
|
909
|
+
message: `Response Validation Warnnings for platform > Billing > getInvoices \n ${res_error}`,
|
|
719
910
|
});
|
|
720
|
-
Logger({ level: "WARN", message: res_error });
|
|
721
911
|
}
|
|
722
912
|
|
|
723
913
|
return response;
|
|
724
914
|
}
|
|
725
915
|
|
|
726
916
|
/**
|
|
727
|
-
* @param {
|
|
728
|
-
* @
|
|
917
|
+
* @param {BillingPlatformValidator.GetSubscriptionParam} arg - Arg object
|
|
918
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
919
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
920
|
+
* @returns {Promise<BillingPlatformModel.SubscriptionStatus>} - Success response
|
|
921
|
+
* @name getSubscription
|
|
729
922
|
* @summary: Get current subscription detail
|
|
730
923
|
* @description: If subscription is active then it will return is_enabled true and return subscription object. If subscription is not active then is_enabled false and message.
|
|
924
|
+
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getSubscription/).
|
|
731
925
|
*/
|
|
732
|
-
async getSubscription(
|
|
733
|
-
|
|
926
|
+
async getSubscription(
|
|
927
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
928
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
929
|
+
) {
|
|
930
|
+
const { error } = BillingPlatformValidator.getSubscription().validate(
|
|
734
931
|
{},
|
|
735
932
|
{ abortEarly: false, allowUnknown: true }
|
|
736
933
|
);
|
|
@@ -739,16 +936,17 @@ class Billing {
|
|
|
739
936
|
}
|
|
740
937
|
|
|
741
938
|
// Showing warrnings if extra unknown parameters are found
|
|
742
|
-
const {
|
|
939
|
+
const {
|
|
940
|
+
error: warrning,
|
|
941
|
+
} = BillingPlatformValidator.getSubscription().validate(
|
|
743
942
|
{},
|
|
744
943
|
{ abortEarly: false, allowUnknown: false }
|
|
745
944
|
);
|
|
746
945
|
if (warrning) {
|
|
747
946
|
Logger({
|
|
748
947
|
level: "WARN",
|
|
749
|
-
message:
|
|
948
|
+
message: `Parameter Validation warrnings for platform > Billing > getSubscription \n ${warrning}`,
|
|
750
949
|
});
|
|
751
|
-
Logger({ level: "WARN", message: warrning });
|
|
752
950
|
}
|
|
753
951
|
|
|
754
952
|
const query_params = {};
|
|
@@ -761,12 +959,18 @@ class Billing {
|
|
|
761
959
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/current`,
|
|
762
960
|
query_params,
|
|
763
961
|
undefined,
|
|
764
|
-
xHeaders
|
|
962
|
+
{ ...xHeaders, ...requestHeaders },
|
|
963
|
+
{ responseHeaders }
|
|
765
964
|
);
|
|
766
965
|
|
|
966
|
+
let responseData = response;
|
|
967
|
+
if (responseHeaders) {
|
|
968
|
+
responseData = response[0];
|
|
969
|
+
}
|
|
970
|
+
|
|
767
971
|
const {
|
|
768
972
|
error: res_error,
|
|
769
|
-
} =
|
|
973
|
+
} = BillingPlatformModel.SubscriptionStatus().validate(responseData, {
|
|
770
974
|
abortEarly: false,
|
|
771
975
|
allowUnknown: false,
|
|
772
976
|
});
|
|
@@ -774,24 +978,27 @@ class Billing {
|
|
|
774
978
|
if (res_error) {
|
|
775
979
|
Logger({
|
|
776
980
|
level: "WARN",
|
|
777
|
-
message:
|
|
981
|
+
message: `Response Validation Warnnings for platform > Billing > getSubscription \n ${res_error}`,
|
|
778
982
|
});
|
|
779
|
-
Logger({ level: "WARN", message: res_error });
|
|
780
983
|
}
|
|
781
984
|
|
|
782
985
|
return response;
|
|
783
986
|
}
|
|
784
987
|
|
|
785
988
|
/**
|
|
786
|
-
* @param {
|
|
787
|
-
* @param {
|
|
788
|
-
* @param {
|
|
789
|
-
* @returns {Promise<EntitySubscription>} - Success response
|
|
989
|
+
* @param {BillingPlatformValidator.GetSubscriptionChargeParam} arg - Arg object
|
|
990
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
991
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
992
|
+
* @returns {Promise<BillingPlatformModel.EntitySubscription>} - Success response
|
|
993
|
+
* @name getSubscriptionCharge
|
|
790
994
|
* @summary: Get subscription charge details
|
|
791
|
-
* @description: Get created subscription charge details
|
|
995
|
+
* @description: Get created subscription charge details - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getSubscriptionCharge/).
|
|
792
996
|
*/
|
|
793
|
-
async getSubscriptionCharge(
|
|
794
|
-
|
|
997
|
+
async getSubscriptionCharge(
|
|
998
|
+
{ extensionId, subscriptionId, requestHeaders } = { requestHeaders: {} },
|
|
999
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1000
|
+
) {
|
|
1001
|
+
const { error } = BillingPlatformValidator.getSubscriptionCharge().validate(
|
|
795
1002
|
{
|
|
796
1003
|
extensionId,
|
|
797
1004
|
subscriptionId,
|
|
@@ -805,7 +1012,7 @@ class Billing {
|
|
|
805
1012
|
// Showing warrnings if extra unknown parameters are found
|
|
806
1013
|
const {
|
|
807
1014
|
error: warrning,
|
|
808
|
-
} =
|
|
1015
|
+
} = BillingPlatformValidator.getSubscriptionCharge().validate(
|
|
809
1016
|
{
|
|
810
1017
|
extensionId,
|
|
811
1018
|
subscriptionId,
|
|
@@ -815,9 +1022,8 @@ class Billing {
|
|
|
815
1022
|
if (warrning) {
|
|
816
1023
|
Logger({
|
|
817
1024
|
level: "WARN",
|
|
818
|
-
message:
|
|
1025
|
+
message: `Parameter Validation warrnings for platform > Billing > getSubscriptionCharge \n ${warrning}`,
|
|
819
1026
|
});
|
|
820
|
-
Logger({ level: "WARN", message: warrning });
|
|
821
1027
|
}
|
|
822
1028
|
|
|
823
1029
|
const query_params = {};
|
|
@@ -830,12 +1036,18 @@ class Billing {
|
|
|
830
1036
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscription/${subscriptionId}`,
|
|
831
1037
|
query_params,
|
|
832
1038
|
undefined,
|
|
833
|
-
xHeaders
|
|
1039
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1040
|
+
{ responseHeaders }
|
|
834
1041
|
);
|
|
835
1042
|
|
|
1043
|
+
let responseData = response;
|
|
1044
|
+
if (responseHeaders) {
|
|
1045
|
+
responseData = response[0];
|
|
1046
|
+
}
|
|
1047
|
+
|
|
836
1048
|
const {
|
|
837
1049
|
error: res_error,
|
|
838
|
-
} =
|
|
1050
|
+
} = BillingPlatformModel.EntitySubscription().validate(responseData, {
|
|
839
1051
|
abortEarly: false,
|
|
840
1052
|
allowUnknown: false,
|
|
841
1053
|
});
|
|
@@ -843,23 +1055,177 @@ class Billing {
|
|
|
843
1055
|
if (res_error) {
|
|
844
1056
|
Logger({
|
|
845
1057
|
level: "WARN",
|
|
846
|
-
message:
|
|
1058
|
+
message: `Response Validation Warnnings for platform > Billing > getSubscriptionCharge \n ${res_error}`,
|
|
847
1059
|
});
|
|
848
|
-
Logger({ level: "WARN", message: res_error });
|
|
849
1060
|
}
|
|
850
1061
|
|
|
851
1062
|
return response;
|
|
852
1063
|
}
|
|
853
1064
|
|
|
854
1065
|
/**
|
|
855
|
-
* @param {
|
|
856
|
-
* @param {
|
|
857
|
-
* @
|
|
1066
|
+
* @param {BillingPlatformValidator.PlanStatusUpdateParam} arg - Arg object
|
|
1067
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1068
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1069
|
+
* @returns {Promise<BillingPlatformModel.Plan>} - Success response
|
|
1070
|
+
* @name planStatusUpdate
|
|
1071
|
+
* @summary: Update Status of The plan
|
|
1072
|
+
* @description: It will update the status of the plan - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/planStatusUpdate/).
|
|
1073
|
+
*/
|
|
1074
|
+
async planStatusUpdate(
|
|
1075
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1076
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1077
|
+
) {
|
|
1078
|
+
const { error } = BillingPlatformValidator.planStatusUpdate().validate(
|
|
1079
|
+
{
|
|
1080
|
+
body,
|
|
1081
|
+
},
|
|
1082
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1083
|
+
);
|
|
1084
|
+
if (error) {
|
|
1085
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1089
|
+
const {
|
|
1090
|
+
error: warrning,
|
|
1091
|
+
} = BillingPlatformValidator.planStatusUpdate().validate(
|
|
1092
|
+
{
|
|
1093
|
+
body,
|
|
1094
|
+
},
|
|
1095
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1096
|
+
);
|
|
1097
|
+
if (warrning) {
|
|
1098
|
+
Logger({
|
|
1099
|
+
level: "WARN",
|
|
1100
|
+
message: `Parameter Validation warrnings for platform > Billing > planStatusUpdate \n ${warrning}`,
|
|
1101
|
+
});
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
const query_params = {};
|
|
1105
|
+
|
|
1106
|
+
const xHeaders = {};
|
|
1107
|
+
|
|
1108
|
+
const response = await PlatformAPIClient.execute(
|
|
1109
|
+
this.config,
|
|
1110
|
+
"patch",
|
|
1111
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/plan/status`,
|
|
1112
|
+
query_params,
|
|
1113
|
+
body,
|
|
1114
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1115
|
+
{ responseHeaders }
|
|
1116
|
+
);
|
|
1117
|
+
|
|
1118
|
+
let responseData = response;
|
|
1119
|
+
if (responseHeaders) {
|
|
1120
|
+
responseData = response[0];
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
const {
|
|
1124
|
+
error: res_error,
|
|
1125
|
+
} = BillingPlatformModel.Plan().validate(responseData, {
|
|
1126
|
+
abortEarly: false,
|
|
1127
|
+
allowUnknown: false,
|
|
1128
|
+
});
|
|
1129
|
+
|
|
1130
|
+
if (res_error) {
|
|
1131
|
+
Logger({
|
|
1132
|
+
level: "WARN",
|
|
1133
|
+
message: `Response Validation Warnnings for platform > Billing > planStatusUpdate \n ${res_error}`,
|
|
1134
|
+
});
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
return response;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
/**
|
|
1141
|
+
* @param {BillingPlatformValidator.SubscripePlanParam} arg - Arg object
|
|
1142
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1143
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1144
|
+
* @returns {Promise<BillingPlatformModel.SubscribePlanRes>} - Success response
|
|
1145
|
+
* @name subscripePlan
|
|
1146
|
+
* @summary: Subscribe plan.
|
|
1147
|
+
* @description: It will subscribe a plan. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/subscripePlan/).
|
|
1148
|
+
*/
|
|
1149
|
+
async subscripePlan(
|
|
1150
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1151
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1152
|
+
) {
|
|
1153
|
+
const { error } = BillingPlatformValidator.subscripePlan().validate(
|
|
1154
|
+
{
|
|
1155
|
+
body,
|
|
1156
|
+
},
|
|
1157
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1158
|
+
);
|
|
1159
|
+
if (error) {
|
|
1160
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1164
|
+
const {
|
|
1165
|
+
error: warrning,
|
|
1166
|
+
} = BillingPlatformValidator.subscripePlan().validate(
|
|
1167
|
+
{
|
|
1168
|
+
body,
|
|
1169
|
+
},
|
|
1170
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1171
|
+
);
|
|
1172
|
+
if (warrning) {
|
|
1173
|
+
Logger({
|
|
1174
|
+
level: "WARN",
|
|
1175
|
+
message: `Parameter Validation warrnings for platform > Billing > subscripePlan \n ${warrning}`,
|
|
1176
|
+
});
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
const query_params = {};
|
|
1180
|
+
|
|
1181
|
+
const xHeaders = {};
|
|
1182
|
+
|
|
1183
|
+
const response = await PlatformAPIClient.execute(
|
|
1184
|
+
this.config,
|
|
1185
|
+
"post",
|
|
1186
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/payment/initiate`,
|
|
1187
|
+
query_params,
|
|
1188
|
+
body,
|
|
1189
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1190
|
+
{ responseHeaders }
|
|
1191
|
+
);
|
|
1192
|
+
|
|
1193
|
+
let responseData = response;
|
|
1194
|
+
if (responseHeaders) {
|
|
1195
|
+
responseData = response[0];
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
const {
|
|
1199
|
+
error: res_error,
|
|
1200
|
+
} = BillingPlatformModel.SubscribePlanRes().validate(responseData, {
|
|
1201
|
+
abortEarly: false,
|
|
1202
|
+
allowUnknown: false,
|
|
1203
|
+
});
|
|
1204
|
+
|
|
1205
|
+
if (res_error) {
|
|
1206
|
+
Logger({
|
|
1207
|
+
level: "WARN",
|
|
1208
|
+
message: `Response Validation Warnnings for platform > Billing > subscripePlan \n ${res_error}`,
|
|
1209
|
+
});
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
return response;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
/**
|
|
1216
|
+
* @param {BillingPlatformValidator.UpsertCustomerDetailParam} arg - Arg object
|
|
1217
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1218
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1219
|
+
* @returns {Promise<BillingPlatformModel.SubscriptionCustomer>} - Success response
|
|
1220
|
+
* @name upsertCustomerDetail
|
|
858
1221
|
* @summary: Upsert subscription customer detail
|
|
859
|
-
* @description: Upsert subscription customer detail.
|
|
1222
|
+
* @description: Upsert subscription customer detail. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/upsertCustomerDetail/).
|
|
860
1223
|
*/
|
|
861
|
-
async upsertCustomerDetail(
|
|
862
|
-
|
|
1224
|
+
async upsertCustomerDetail(
|
|
1225
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1226
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1227
|
+
) {
|
|
1228
|
+
const { error } = BillingPlatformValidator.upsertCustomerDetail().validate(
|
|
863
1229
|
{
|
|
864
1230
|
body,
|
|
865
1231
|
},
|
|
@@ -872,7 +1238,7 @@ class Billing {
|
|
|
872
1238
|
// Showing warrnings if extra unknown parameters are found
|
|
873
1239
|
const {
|
|
874
1240
|
error: warrning,
|
|
875
|
-
} =
|
|
1241
|
+
} = BillingPlatformValidator.upsertCustomerDetail().validate(
|
|
876
1242
|
{
|
|
877
1243
|
body,
|
|
878
1244
|
},
|
|
@@ -881,9 +1247,8 @@ class Billing {
|
|
|
881
1247
|
if (warrning) {
|
|
882
1248
|
Logger({
|
|
883
1249
|
level: "WARN",
|
|
884
|
-
message:
|
|
1250
|
+
message: `Parameter Validation warrnings for platform > Billing > upsertCustomerDetail \n ${warrning}`,
|
|
885
1251
|
});
|
|
886
|
-
Logger({ level: "WARN", message: warrning });
|
|
887
1252
|
}
|
|
888
1253
|
|
|
889
1254
|
const query_params = {};
|
|
@@ -896,12 +1261,18 @@ class Billing {
|
|
|
896
1261
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/customer-detail`,
|
|
897
1262
|
query_params,
|
|
898
1263
|
body,
|
|
899
|
-
xHeaders
|
|
1264
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1265
|
+
{ responseHeaders }
|
|
900
1266
|
);
|
|
901
1267
|
|
|
1268
|
+
let responseData = response;
|
|
1269
|
+
if (responseHeaders) {
|
|
1270
|
+
responseData = response[0];
|
|
1271
|
+
}
|
|
1272
|
+
|
|
902
1273
|
const {
|
|
903
1274
|
error: res_error,
|
|
904
|
-
} =
|
|
1275
|
+
} = BillingPlatformModel.SubscriptionCustomer().validate(responseData, {
|
|
905
1276
|
abortEarly: false,
|
|
906
1277
|
allowUnknown: false,
|
|
907
1278
|
});
|
|
@@ -909,9 +1280,8 @@ class Billing {
|
|
|
909
1280
|
if (res_error) {
|
|
910
1281
|
Logger({
|
|
911
1282
|
level: "WARN",
|
|
912
|
-
message:
|
|
1283
|
+
message: `Response Validation Warnnings for platform > Billing > upsertCustomerDetail \n ${res_error}`,
|
|
913
1284
|
});
|
|
914
|
-
Logger({ level: "WARN", message: res_error });
|
|
915
1285
|
}
|
|
916
1286
|
|
|
917
1287
|
return response;
|