@gofynd/fdk-client-javascript 1.1.6 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/index.js +0 -3
- package/package.json +1 -1
- package/sdk/application/ApplicationAPIClient.d.ts +15 -1
- package/sdk/application/ApplicationAPIClient.js +8 -1
- package/sdk/application/ApplicationClient.d.ts +37 -6
- package/sdk/application/ApplicationClient.js +31 -0
- package/sdk/application/ApplicationConfig.d.ts +52 -12
- package/sdk/application/ApplicationConfig.js +37 -2
- package/sdk/application/ApplicationModels.d.ts +46 -1
- package/sdk/application/ApplicationModels.js +18 -0
- package/sdk/application/Cart/CartApplicationClient.d.ts +172 -357
- package/sdk/application/Cart/CartApplicationClient.js +620 -483
- package/sdk/application/Cart/CartApplicationModel.d.ts +2054 -96
- package/sdk/application/Cart/CartApplicationModel.js +1224 -93
- package/sdk/application/Cart/CartApplicationValidator.d.ts +508 -30
- package/sdk/application/Cart/CartApplicationValidator.js +270 -15
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +234 -413
- package/sdk/application/Catalog/CatalogApplicationClient.js +777 -630
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +2218 -117
- package/sdk/application/Catalog/CatalogApplicationModel.js +1499 -170
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +798 -31
- package/sdk/application/Catalog/CatalogApplicationValidator.js +318 -3
- package/sdk/application/Common/CommonApplicationClient.d.ts +14 -21
- package/sdk/application/Common/CommonApplicationClient.js +50 -33
- package/sdk/application/Common/CommonApplicationModel.d.ts +448 -19
- package/sdk/application/Common/CommonApplicationModel.js +224 -16
- package/sdk/application/Common/CommonApplicationValidator.d.ts +42 -4
- package/sdk/application/Common/CommonApplicationValidator.js +21 -3
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +25 -18
- package/sdk/application/Communication/CommunicationApplicationClient.js +74 -47
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +190 -14
- package/sdk/application/Communication/CommunicationApplicationModel.js +124 -7
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +27 -4
- package/sdk/application/Communication/CommunicationApplicationValidator.js +21 -5
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +113 -112
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +381 -260
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +2453 -110
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +1254 -108
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +160 -8
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +88 -4
- package/sdk/application/Content/ContentApplicationClient.d.ts +120 -138
- package/sdk/application/Content/ContentApplicationClient.js +409 -277
- package/sdk/application/Content/ContentApplicationModel.d.ts +1627 -105
- package/sdk/application/Content/ContentApplicationModel.js +1202 -109
- package/sdk/application/Content/ContentApplicationValidator.d.ts +214 -12
- package/sdk/application/Content/ContentApplicationValidator.js +113 -3
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +20 -29
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +68 -47
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +299 -20
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +209 -16
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +55 -5
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +33 -6
- package/sdk/application/Lead/LeadApplicationClient.d.ts +50 -53
- package/sdk/application/Lead/LeadApplicationClient.js +169 -103
- package/sdk/application/Lead/LeadApplicationModel.d.ts +1405 -54
- package/sdk/application/Lead/LeadApplicationModel.js +619 -73
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +91 -9
- package/sdk/application/Lead/LeadApplicationValidator.js +51 -6
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +34 -33
- package/sdk/application/Logistic/LogisticApplicationClient.js +110 -73
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +399 -28
- package/sdk/application/Logistic/LogisticApplicationModel.js +293 -24
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +48 -6
- package/sdk/application/Logistic/LogisticApplicationValidator.js +34 -6
- package/sdk/application/Order/OrderApplicationClient.d.ts +81 -133
- package/sdk/application/Order/OrderApplicationClient.js +297 -217
- package/sdk/application/Order/OrderApplicationModel.d.ts +1101 -66
- package/sdk/application/Order/OrderApplicationModel.js +776 -57
- package/sdk/application/Order/OrderApplicationValidator.d.ts +249 -14
- package/sdk/application/Order/OrderApplicationValidator.js +114 -5
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +341 -356
- package/sdk/application/Payment/PaymentApplicationClient.js +1077 -703
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +3125 -99
- package/sdk/application/Payment/PaymentApplicationModel.js +1158 -62
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +494 -41
- package/sdk/application/Payment/PaymentApplicationValidator.js +297 -25
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +178 -350
- package/sdk/application/PosCart/PosCartApplicationClient.js +636 -491
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1823 -89
- package/sdk/application/PosCart/PosCartApplicationModel.js +1117 -85
- package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +480 -29
- package/sdk/application/PosCart/PosCartApplicationValidator.js +262 -15
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +49 -47
- package/sdk/application/Rewards/RewardsApplicationClient.js +160 -102
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +343 -22
- package/sdk/application/Rewards/RewardsApplicationModel.js +230 -15
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +70 -7
- package/sdk/application/Rewards/RewardsApplicationValidator.js +45 -6
- package/sdk/application/Share/ShareApplicationClient.d.ts +44 -50
- package/sdk/application/Share/ShareApplicationClient.js +165 -97
- package/sdk/application/Share/ShareApplicationModel.d.ts +230 -15
- package/sdk/application/Share/ShareApplicationModel.js +154 -16
- package/sdk/application/Share/ShareApplicationValidator.d.ts +86 -8
- package/sdk/application/Share/ShareApplicationValidator.js +48 -4
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +25 -27
- package/sdk/application/Theme/ThemeApplicationClient.js +83 -54
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +621 -48
- package/sdk/application/Theme/ThemeApplicationModel.js +464 -40
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +49 -5
- package/sdk/application/Theme/ThemeApplicationValidator.js +26 -3
- package/sdk/application/User/UserApplicationClient.d.ts +219 -303
- package/sdk/application/User/UserApplicationClient.js +819 -522
- package/sdk/application/User/UserApplicationModel.d.ts +1390 -101
- package/sdk/application/User/UserApplicationModel.js +983 -44
- package/sdk/application/User/UserApplicationValidator.d.ts +457 -33
- package/sdk/application/User/UserApplicationValidator.js +265 -31
- package/sdk/common/AxiosHelper.js +8 -2
- package/sdk/common/Paginator.d.ts +27 -12
- package/sdk/common/Paginator.js +15 -0
- package/sdk/common/RequestSigner.js +0 -1
- package/sdk/partner/PartnerAPIClient.d.ts +15 -1
- package/sdk/partner/PartnerAPIClient.js +8 -1
- package/sdk/partner/PartnerClient.d.ts +20 -3
- package/sdk/partner/PartnerClient.js +17 -0
- package/sdk/partner/PartnerConfig.d.ts +40 -14
- package/sdk/partner/PartnerConfig.js +31 -6
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +26 -25
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +82 -53
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +202 -17
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +139 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +42 -5
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +26 -4
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +88 -97
- package/sdk/platform/Billing/BillingPlatformClient.js +310 -191
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +1211 -68
- package/sdk/platform/Billing/BillingPlatformModel.js +824 -59
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +153 -12
- package/sdk/platform/Billing/BillingPlatformValidator.js +87 -8
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +392 -634
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +1480 -957
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +827 -57
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +492 -34
- package/sdk/platform/Cart/CartPlatformModel.d.ts +3639 -175
- package/sdk/platform/Cart/CartPlatformModel.js +2368 -212
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +438 -615
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1449 -984
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +1081 -49
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +482 -23
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +573 -824
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1773 -1264
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +6871 -326
- package/sdk/platform/Catalog/CatalogPlatformModel.js +4215 -349
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +1331 -71
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +611 -30
- package/sdk/platform/Common/CommonPlatformClient.d.ts +14 -21
- package/sdk/platform/Common/CommonPlatformClient.js +48 -33
- package/sdk/platform/Common/CommonPlatformModel.d.ts +448 -19
- package/sdk/platform/Common/CommonPlatformModel.js +224 -16
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +42 -4
- package/sdk/platform/Common/CommonPlatformValidator.js +21 -3
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +457 -279
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1423 -553
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +581 -42
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +294 -22
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +18 -5
- package/sdk/platform/Communication/CommunicationPlatformClient.js +58 -19
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1630 -102
- package/sdk/platform/Communication/CommunicationPlatformModel.js +1150 -85
- package/sdk/platform/Communication/CommunicationPlatformValidator.d.ts +16 -3
- package/sdk/platform/Communication/CommunicationPlatformValidator.js +11 -3
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +102 -111
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +321 -225
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +830 -43
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +612 -78
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +180 -13
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +98 -10
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +232 -212
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +737 -438
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +293 -22
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +184 -17
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +166 -178
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +519 -310
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +4504 -188
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2242 -204
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +332 -19
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +153 -10
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +495 -560
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1777 -987
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +872 -62
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +487 -35
- package/sdk/platform/Content/ContentPlatformModel.d.ts +1661 -108
- package/sdk/platform/Content/ContentPlatformModel.js +1217 -113
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +67 -101
- package/sdk/platform/Discount/DiscountPlatformClient.js +240 -176
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +242 -15
- package/sdk/platform/Discount/DiscountPlatformModel.js +162 -10
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +185 -13
- package/sdk/platform/Discount/DiscountPlatformValidator.js +88 -8
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +32 -41
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +106 -74
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +77 -6
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +41 -6
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +39 -54
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +124 -99
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +299 -20
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +207 -16
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +98 -8
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +54 -7
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +85 -91
- package/sdk/platform/Finance/FinancePlatformClient.js +272 -180
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +619 -50
- package/sdk/platform/Finance/FinancePlatformModel.js +458 -30
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +123 -15
- package/sdk/platform/Finance/FinancePlatformValidator.js +95 -16
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +99 -97
- package/sdk/platform/Inventory/InventoryPlatformClient.js +288 -199
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +1354 -61
- package/sdk/platform/Inventory/InventoryPlatformModel.js +916 -83
- package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +168 -12
- package/sdk/platform/Inventory/InventoryPlatformValidator.js +82 -6
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +86 -106
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +326 -186
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +180 -14
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +94 -9
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +75 -101
- package/sdk/platform/Lead/LeadPlatformClient.js +240 -174
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +1403 -54
- package/sdk/platform/Lead/LeadPlatformModel.js +618 -73
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +173 -12
- package/sdk/platform/Lead/LeadPlatformValidator.js +85 -8
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +18 -14
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +56 -29
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +26 -4
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +16 -3
- package/sdk/platform/Order/OrderPlatformClient.d.ts +343 -556
- package/sdk/platform/Order/OrderPlatformClient.js +969 -762
- package/sdk/platform/Order/OrderPlatformModel.d.ts +4967 -247
- package/sdk/platform/Order/OrderPlatformModel.js +3249 -259
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +758 -37
- package/sdk/platform/Order/OrderPlatformValidator.js +351 -22
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +28 -36
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +103 -59
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +66 -6
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +32 -4
- package/sdk/platform/Partner/PartnerPlatformClient.d.ts +68 -107
- package/sdk/platform/Partner/PartnerPlatformClient.js +253 -174
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +767 -45
- package/sdk/platform/Partner/PartnerPlatformModel.js +524 -41
- package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +207 -13
- package/sdk/platform/Partner/PartnerPlatformValidator.js +87 -5
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +255 -260
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +860 -504
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +348 -30
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +221 -19
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +73 -73
- package/sdk/platform/Payment/PaymentPlatformClient.js +238 -154
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2658 -93
- package/sdk/platform/Payment/PaymentPlatformModel.js +1035 -36
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +111 -11
- package/sdk/platform/Payment/PaymentPlatformValidator.js +68 -7
- package/sdk/platform/PlatformAPIClient.d.ts +16 -1
- package/sdk/platform/PlatformAPIClient.js +9 -1
- package/sdk/platform/PlatformApplicationClient.d.ts +22 -1798
- package/sdk/platform/PlatformApplicationClient.js +17 -1899
- package/sdk/platform/PlatformClient.d.ts +29 -12579
- package/sdk/platform/PlatformClient.js +26 -15085
- package/sdk/platform/PlatformConfig.d.ts +37 -11
- package/sdk/platform/PlatformConfig.js +32 -6
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +80 -92
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +307 -177
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +149 -12
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +82 -8
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +371 -23
- package/sdk/platform/Rewards/RewardsPlatformModel.js +246 -16
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +120 -89
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +349 -201
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +128 -12
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +85 -11
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +148 -178
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +454 -329
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1399 -96
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1022 -71
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +280 -18
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +134 -11
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +38 -47
- package/sdk/platform/Share/SharePlatformApplicationClient.js +137 -73
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +87 -7
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +42 -5
- package/sdk/platform/Share/SharePlatformModel.d.ts +250 -16
- package/sdk/platform/Share/SharePlatformModel.js +165 -17
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +149 -183
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +579 -330
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +308 -24
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +162 -10
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +621 -48
- package/sdk/platform/Theme/ThemePlatformModel.js +464 -40
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +119 -151
- package/sdk/platform/User/UserPlatformApplicationClient.js +411 -244
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +235 -18
- package/sdk/platform/User/UserPlatformApplicationValidator.js +126 -12
- package/sdk/platform/User/UserPlatformModel.d.ts +1390 -101
- package/sdk/platform/User/UserPlatformModel.js +983 -44
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +38 -47
- package/sdk/platform/Webhook/WebhookPlatformClient.js +137 -87
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +242 -16
- package/sdk/platform/Webhook/WebhookPlatformModel.js +167 -18
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +83 -7
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +43 -5
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +14 -21
- package/sdk/public/Configuration/ConfigurationPublicClient.js +46 -33
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +473 -19
- package/sdk/public/Configuration/ConfigurationPublicModel.js +224 -16
- package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +42 -4
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +21 -3
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +48 -48
- package/sdk/public/Inventory/InventoryPublicClient.js +146 -98
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +392 -21
- package/sdk/public/Inventory/InventoryPublicModel.js +267 -27
- package/sdk/public/Inventory/InventoryPublicValidator.d.ts +90 -8
- package/sdk/public/Inventory/InventoryPublicValidator.js +44 -4
- package/sdk/public/PublicClient.d.ts +19 -3
- package/sdk/public/PublicClient.js +16 -0
- package/sdk/public/PublicConfig.d.ts +27 -6
- package/sdk/public/PublicConfig.js +17 -1
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +13 -11
- package/sdk/public/Webhook/WebhookPublicClient.js +42 -27
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +242 -16
- package/sdk/public/Webhook/WebhookPublicModel.js +167 -18
- package/sdk/public/Webhook/WebhookPublicValidator.d.ts +18 -3
- package/sdk/public/Webhook/WebhookPublicValidator.js +14 -4
|
@@ -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,20 @@ class Billing {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* @param {
|
|
16
|
-
* @param {
|
|
17
|
-
* @returns {Promise<SubscriptionActivateRes>} - Success response
|
|
15
|
+
* @param {BillingPlatformValidator.ActivateSubscriptionPlanParam} arg - Arg object
|
|
16
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
17
|
+
* @returns {Promise<BillingPlatformModel.SubscriptionActivateRes>} - Success response
|
|
18
|
+
* @name activateSubscriptionPlan
|
|
18
19
|
* @summary: Activate subscription
|
|
19
|
-
* @description: It will activate subscription plan for customer
|
|
20
|
+
* @description: It will activate subscription plan for customer - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/activateSubscriptionPlan/).
|
|
20
21
|
*/
|
|
21
|
-
async activateSubscriptionPlan(
|
|
22
|
-
|
|
22
|
+
async activateSubscriptionPlan(
|
|
23
|
+
{ body } = {},
|
|
24
|
+
{ headers } = { headers: false }
|
|
25
|
+
) {
|
|
26
|
+
const {
|
|
27
|
+
error,
|
|
28
|
+
} = BillingPlatformValidator.activateSubscriptionPlan().validate(
|
|
23
29
|
{
|
|
24
30
|
body,
|
|
25
31
|
},
|
|
@@ -32,7 +38,7 @@ class Billing {
|
|
|
32
38
|
// Showing warrnings if extra unknown parameters are found
|
|
33
39
|
const {
|
|
34
40
|
error: warrning,
|
|
35
|
-
} =
|
|
41
|
+
} = BillingPlatformValidator.activateSubscriptionPlan().validate(
|
|
36
42
|
{
|
|
37
43
|
body,
|
|
38
44
|
},
|
|
@@ -41,9 +47,8 @@ class Billing {
|
|
|
41
47
|
if (warrning) {
|
|
42
48
|
Logger({
|
|
43
49
|
level: "WARN",
|
|
44
|
-
message:
|
|
50
|
+
message: `Parameter Validation warrnings for platform > Billing > activateSubscriptionPlan \n ${warrning}`,
|
|
45
51
|
});
|
|
46
|
-
Logger({ level: "WARN", message: warrning });
|
|
47
52
|
}
|
|
48
53
|
|
|
49
54
|
const query_params = {};
|
|
@@ -56,12 +61,18 @@ class Billing {
|
|
|
56
61
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/activate`,
|
|
57
62
|
query_params,
|
|
58
63
|
body,
|
|
59
|
-
xHeaders
|
|
64
|
+
xHeaders,
|
|
65
|
+
{ headers }
|
|
60
66
|
);
|
|
61
67
|
|
|
68
|
+
let responseData = response;
|
|
69
|
+
if (headers) {
|
|
70
|
+
responseData = response[0];
|
|
71
|
+
}
|
|
72
|
+
|
|
62
73
|
const {
|
|
63
74
|
error: res_error,
|
|
64
|
-
} =
|
|
75
|
+
} = BillingPlatformModel.SubscriptionActivateRes().validate(responseData, {
|
|
65
76
|
abortEarly: false,
|
|
66
77
|
allowUnknown: false,
|
|
67
78
|
});
|
|
@@ -69,24 +80,28 @@ class Billing {
|
|
|
69
80
|
if (res_error) {
|
|
70
81
|
Logger({
|
|
71
82
|
level: "WARN",
|
|
72
|
-
message:
|
|
83
|
+
message: `Response Validation Warnnings for platform > Billing > activateSubscriptionPlan \n ${res_error}`,
|
|
73
84
|
});
|
|
74
|
-
Logger({ level: "WARN", message: res_error });
|
|
75
85
|
}
|
|
76
86
|
|
|
77
87
|
return response;
|
|
78
88
|
}
|
|
79
89
|
|
|
80
90
|
/**
|
|
81
|
-
* @param {
|
|
82
|
-
* @param {
|
|
83
|
-
* @
|
|
84
|
-
* @
|
|
91
|
+
* @param {BillingPlatformValidator.CancelSubscriptionChargeParam} arg - Arg object
|
|
92
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
93
|
+
* @returns {Promise<BillingPlatformModel.EntitySubscription>} - Success response
|
|
94
|
+
* @name cancelSubscriptionCharge
|
|
85
95
|
* @summary: Cancel subscription charge
|
|
86
|
-
* @description: Cancel subscription and attached charges.
|
|
96
|
+
* @description: Cancel subscription and attached charges. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/cancelSubscriptionCharge/).
|
|
87
97
|
*/
|
|
88
|
-
async cancelSubscriptionCharge(
|
|
89
|
-
|
|
98
|
+
async cancelSubscriptionCharge(
|
|
99
|
+
{ extensionId, subscriptionId } = {},
|
|
100
|
+
{ headers } = { headers: false }
|
|
101
|
+
) {
|
|
102
|
+
const {
|
|
103
|
+
error,
|
|
104
|
+
} = BillingPlatformValidator.cancelSubscriptionCharge().validate(
|
|
90
105
|
{
|
|
91
106
|
extensionId,
|
|
92
107
|
subscriptionId,
|
|
@@ -100,7 +115,7 @@ class Billing {
|
|
|
100
115
|
// Showing warrnings if extra unknown parameters are found
|
|
101
116
|
const {
|
|
102
117
|
error: warrning,
|
|
103
|
-
} =
|
|
118
|
+
} = BillingPlatformValidator.cancelSubscriptionCharge().validate(
|
|
104
119
|
{
|
|
105
120
|
extensionId,
|
|
106
121
|
subscriptionId,
|
|
@@ -110,9 +125,8 @@ class Billing {
|
|
|
110
125
|
if (warrning) {
|
|
111
126
|
Logger({
|
|
112
127
|
level: "WARN",
|
|
113
|
-
message:
|
|
128
|
+
message: `Parameter Validation warrnings for platform > Billing > cancelSubscriptionCharge \n ${warrning}`,
|
|
114
129
|
});
|
|
115
|
-
Logger({ level: "WARN", message: warrning });
|
|
116
130
|
}
|
|
117
131
|
|
|
118
132
|
const query_params = {};
|
|
@@ -125,12 +139,18 @@ class Billing {
|
|
|
125
139
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscription/${subscriptionId}/cancel`,
|
|
126
140
|
query_params,
|
|
127
141
|
undefined,
|
|
128
|
-
xHeaders
|
|
142
|
+
xHeaders,
|
|
143
|
+
{ headers }
|
|
129
144
|
);
|
|
130
145
|
|
|
146
|
+
let responseData = response;
|
|
147
|
+
if (headers) {
|
|
148
|
+
responseData = response[0];
|
|
149
|
+
}
|
|
150
|
+
|
|
131
151
|
const {
|
|
132
152
|
error: res_error,
|
|
133
|
-
} =
|
|
153
|
+
} = BillingPlatformModel.EntitySubscription().validate(responseData, {
|
|
134
154
|
abortEarly: false,
|
|
135
155
|
allowUnknown: false,
|
|
136
156
|
});
|
|
@@ -138,23 +158,28 @@ class Billing {
|
|
|
138
158
|
if (res_error) {
|
|
139
159
|
Logger({
|
|
140
160
|
level: "WARN",
|
|
141
|
-
message:
|
|
161
|
+
message: `Response Validation Warnnings for platform > Billing > cancelSubscriptionCharge \n ${res_error}`,
|
|
142
162
|
});
|
|
143
|
-
Logger({ level: "WARN", message: res_error });
|
|
144
163
|
}
|
|
145
164
|
|
|
146
165
|
return response;
|
|
147
166
|
}
|
|
148
167
|
|
|
149
168
|
/**
|
|
150
|
-
* @param {
|
|
151
|
-
* @param {
|
|
152
|
-
* @returns {Promise<CancelSubscriptionRes>} - Success response
|
|
169
|
+
* @param {BillingPlatformValidator.CancelSubscriptionPlanParam} arg - Arg object
|
|
170
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
171
|
+
* @returns {Promise<BillingPlatformModel.CancelSubscriptionRes>} - Success response
|
|
172
|
+
* @name cancelSubscriptionPlan
|
|
153
173
|
* @summary: Cancel subscription
|
|
154
|
-
* @description: It will cancel current active subscription.
|
|
174
|
+
* @description: It will cancel current active subscription. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/cancelSubscriptionPlan/).
|
|
155
175
|
*/
|
|
156
|
-
async cancelSubscriptionPlan(
|
|
157
|
-
|
|
176
|
+
async cancelSubscriptionPlan(
|
|
177
|
+
{ body } = {},
|
|
178
|
+
{ headers } = { headers: false }
|
|
179
|
+
) {
|
|
180
|
+
const {
|
|
181
|
+
error,
|
|
182
|
+
} = BillingPlatformValidator.cancelSubscriptionPlan().validate(
|
|
158
183
|
{
|
|
159
184
|
body,
|
|
160
185
|
},
|
|
@@ -167,7 +192,7 @@ class Billing {
|
|
|
167
192
|
// Showing warrnings if extra unknown parameters are found
|
|
168
193
|
const {
|
|
169
194
|
error: warrning,
|
|
170
|
-
} =
|
|
195
|
+
} = BillingPlatformValidator.cancelSubscriptionPlan().validate(
|
|
171
196
|
{
|
|
172
197
|
body,
|
|
173
198
|
},
|
|
@@ -176,9 +201,8 @@ class Billing {
|
|
|
176
201
|
if (warrning) {
|
|
177
202
|
Logger({
|
|
178
203
|
level: "WARN",
|
|
179
|
-
message:
|
|
204
|
+
message: `Parameter Validation warrnings for platform > Billing > cancelSubscriptionPlan \n ${warrning}`,
|
|
180
205
|
});
|
|
181
|
-
Logger({ level: "WARN", message: warrning });
|
|
182
206
|
}
|
|
183
207
|
|
|
184
208
|
const query_params = {};
|
|
@@ -191,12 +215,18 @@ class Billing {
|
|
|
191
215
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/cancel`,
|
|
192
216
|
query_params,
|
|
193
217
|
body,
|
|
194
|
-
xHeaders
|
|
218
|
+
xHeaders,
|
|
219
|
+
{ headers }
|
|
195
220
|
);
|
|
196
221
|
|
|
222
|
+
let responseData = response;
|
|
223
|
+
if (headers) {
|
|
224
|
+
responseData = response[0];
|
|
225
|
+
}
|
|
226
|
+
|
|
197
227
|
const {
|
|
198
228
|
error: res_error,
|
|
199
|
-
} =
|
|
229
|
+
} = BillingPlatformModel.CancelSubscriptionRes().validate(responseData, {
|
|
200
230
|
abortEarly: false,
|
|
201
231
|
allowUnknown: false,
|
|
202
232
|
});
|
|
@@ -204,24 +234,26 @@ class Billing {
|
|
|
204
234
|
if (res_error) {
|
|
205
235
|
Logger({
|
|
206
236
|
level: "WARN",
|
|
207
|
-
message:
|
|
237
|
+
message: `Response Validation Warnnings for platform > Billing > cancelSubscriptionPlan \n ${res_error}`,
|
|
208
238
|
});
|
|
209
|
-
Logger({ level: "WARN", message: res_error });
|
|
210
239
|
}
|
|
211
240
|
|
|
212
241
|
return response;
|
|
213
242
|
}
|
|
214
243
|
|
|
215
244
|
/**
|
|
216
|
-
* @param {
|
|
217
|
-
* @param {
|
|
218
|
-
* @
|
|
219
|
-
* @
|
|
245
|
+
* @param {BillingPlatformValidator.CheckCouponValidityParam} arg - Arg object
|
|
246
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
247
|
+
* @returns {Promise<BillingPlatformModel.CheckValidityResponse>} - Success response
|
|
248
|
+
* @name checkCouponValidity
|
|
220
249
|
* @summary: Check coupon validity
|
|
221
|
-
* @description: Check coupon validity.
|
|
250
|
+
* @description: Check coupon validity. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/checkCouponValidity/).
|
|
222
251
|
*/
|
|
223
|
-
async checkCouponValidity(
|
|
224
|
-
|
|
252
|
+
async checkCouponValidity(
|
|
253
|
+
{ plan, couponCode } = {},
|
|
254
|
+
{ headers } = { headers: false }
|
|
255
|
+
) {
|
|
256
|
+
const { error } = BillingPlatformValidator.checkCouponValidity().validate(
|
|
225
257
|
{
|
|
226
258
|
plan,
|
|
227
259
|
couponCode,
|
|
@@ -233,7 +265,9 @@ class Billing {
|
|
|
233
265
|
}
|
|
234
266
|
|
|
235
267
|
// Showing warrnings if extra unknown parameters are found
|
|
236
|
-
const {
|
|
268
|
+
const {
|
|
269
|
+
error: warrning,
|
|
270
|
+
} = BillingPlatformValidator.checkCouponValidity().validate(
|
|
237
271
|
{
|
|
238
272
|
plan,
|
|
239
273
|
couponCode,
|
|
@@ -243,9 +277,8 @@ class Billing {
|
|
|
243
277
|
if (warrning) {
|
|
244
278
|
Logger({
|
|
245
279
|
level: "WARN",
|
|
246
|
-
message:
|
|
280
|
+
message: `Parameter Validation warrnings for platform > Billing > checkCouponValidity \n ${warrning}`,
|
|
247
281
|
});
|
|
248
|
-
Logger({ level: "WARN", message: warrning });
|
|
249
282
|
}
|
|
250
283
|
|
|
251
284
|
const query_params = {};
|
|
@@ -260,12 +293,18 @@ class Billing {
|
|
|
260
293
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/coupon/check-validity`,
|
|
261
294
|
query_params,
|
|
262
295
|
undefined,
|
|
263
|
-
xHeaders
|
|
296
|
+
xHeaders,
|
|
297
|
+
{ headers }
|
|
264
298
|
);
|
|
265
299
|
|
|
300
|
+
let responseData = response;
|
|
301
|
+
if (headers) {
|
|
302
|
+
responseData = response[0];
|
|
303
|
+
}
|
|
304
|
+
|
|
266
305
|
const {
|
|
267
306
|
error: res_error,
|
|
268
|
-
} =
|
|
307
|
+
} = BillingPlatformModel.CheckValidityResponse().validate(responseData, {
|
|
269
308
|
abortEarly: false,
|
|
270
309
|
allowUnknown: false,
|
|
271
310
|
});
|
|
@@ -273,24 +312,27 @@ class Billing {
|
|
|
273
312
|
if (res_error) {
|
|
274
313
|
Logger({
|
|
275
314
|
level: "WARN",
|
|
276
|
-
message:
|
|
315
|
+
message: `Response Validation Warnnings for platform > Billing > checkCouponValidity \n ${res_error}`,
|
|
277
316
|
});
|
|
278
|
-
Logger({ level: "WARN", message: res_error });
|
|
279
317
|
}
|
|
280
318
|
|
|
281
319
|
return response;
|
|
282
320
|
}
|
|
283
321
|
|
|
284
322
|
/**
|
|
285
|
-
* @param {
|
|
286
|
-
* @param {
|
|
287
|
-
* @
|
|
288
|
-
*
|
|
323
|
+
* @param {BillingPlatformValidator.CreateOneTimeChargeParam} arg - Arg object
|
|
324
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
325
|
+
* @returns {Promise<BillingPlatformModel.CreateOneTimeChargeResponse>} -
|
|
326
|
+
* Success response
|
|
327
|
+
* @name createOneTimeCharge
|
|
289
328
|
* @summary: Create one time subscription charge
|
|
290
|
-
* @description: Register one time subscription charge for a seller of your extension.
|
|
329
|
+
* @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
330
|
*/
|
|
292
|
-
async createOneTimeCharge(
|
|
293
|
-
|
|
331
|
+
async createOneTimeCharge(
|
|
332
|
+
{ extensionId, body } = {},
|
|
333
|
+
{ headers } = { headers: false }
|
|
334
|
+
) {
|
|
335
|
+
const { error } = BillingPlatformValidator.createOneTimeCharge().validate(
|
|
294
336
|
{
|
|
295
337
|
extensionId,
|
|
296
338
|
body,
|
|
@@ -302,7 +344,9 @@ class Billing {
|
|
|
302
344
|
}
|
|
303
345
|
|
|
304
346
|
// Showing warrnings if extra unknown parameters are found
|
|
305
|
-
const {
|
|
347
|
+
const {
|
|
348
|
+
error: warrning,
|
|
349
|
+
} = BillingPlatformValidator.createOneTimeCharge().validate(
|
|
306
350
|
{
|
|
307
351
|
extensionId,
|
|
308
352
|
body,
|
|
@@ -312,9 +356,8 @@ class Billing {
|
|
|
312
356
|
if (warrning) {
|
|
313
357
|
Logger({
|
|
314
358
|
level: "WARN",
|
|
315
|
-
message:
|
|
359
|
+
message: `Parameter Validation warrnings for platform > Billing > createOneTimeCharge \n ${warrning}`,
|
|
316
360
|
});
|
|
317
|
-
Logger({ level: "WARN", message: warrning });
|
|
318
361
|
}
|
|
319
362
|
|
|
320
363
|
const query_params = {};
|
|
@@ -327,37 +370,48 @@ class Billing {
|
|
|
327
370
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/one_time_charge`,
|
|
328
371
|
query_params,
|
|
329
372
|
body,
|
|
330
|
-
xHeaders
|
|
373
|
+
xHeaders,
|
|
374
|
+
{ headers }
|
|
331
375
|
);
|
|
332
376
|
|
|
377
|
+
let responseData = response;
|
|
378
|
+
if (headers) {
|
|
379
|
+
responseData = response[0];
|
|
380
|
+
}
|
|
381
|
+
|
|
333
382
|
const {
|
|
334
383
|
error: res_error,
|
|
335
|
-
} =
|
|
336
|
-
|
|
337
|
-
allowUnknown: false
|
|
338
|
-
|
|
384
|
+
} = BillingPlatformModel.CreateOneTimeChargeResponse().validate(
|
|
385
|
+
responseData,
|
|
386
|
+
{ abortEarly: false, allowUnknown: false }
|
|
387
|
+
);
|
|
339
388
|
|
|
340
389
|
if (res_error) {
|
|
341
390
|
Logger({
|
|
342
391
|
level: "WARN",
|
|
343
|
-
message:
|
|
392
|
+
message: `Response Validation Warnnings for platform > Billing > createOneTimeCharge \n ${res_error}`,
|
|
344
393
|
});
|
|
345
|
-
Logger({ level: "WARN", message: res_error });
|
|
346
394
|
}
|
|
347
395
|
|
|
348
396
|
return response;
|
|
349
397
|
}
|
|
350
398
|
|
|
351
399
|
/**
|
|
352
|
-
* @param {
|
|
353
|
-
* @param {
|
|
354
|
-
* @
|
|
355
|
-
*
|
|
400
|
+
* @param {BillingPlatformValidator.CreateSubscriptionChargeParam} arg - Arg object
|
|
401
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
402
|
+
* @returns {Promise<BillingPlatformModel.CreateSubscriptionResponse>} -
|
|
403
|
+
* Success response
|
|
404
|
+
* @name createSubscriptionCharge
|
|
356
405
|
* @summary: Create subscription charge
|
|
357
|
-
* @description: Register subscription charge for a seller of your extension.
|
|
406
|
+
* @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
407
|
*/
|
|
359
|
-
async createSubscriptionCharge(
|
|
360
|
-
|
|
408
|
+
async createSubscriptionCharge(
|
|
409
|
+
{ extensionId, body } = {},
|
|
410
|
+
{ headers } = { headers: false }
|
|
411
|
+
) {
|
|
412
|
+
const {
|
|
413
|
+
error,
|
|
414
|
+
} = BillingPlatformValidator.createSubscriptionCharge().validate(
|
|
361
415
|
{
|
|
362
416
|
extensionId,
|
|
363
417
|
body,
|
|
@@ -371,7 +425,7 @@ class Billing {
|
|
|
371
425
|
// Showing warrnings if extra unknown parameters are found
|
|
372
426
|
const {
|
|
373
427
|
error: warrning,
|
|
374
|
-
} =
|
|
428
|
+
} = BillingPlatformValidator.createSubscriptionCharge().validate(
|
|
375
429
|
{
|
|
376
430
|
extensionId,
|
|
377
431
|
body,
|
|
@@ -381,9 +435,8 @@ class Billing {
|
|
|
381
435
|
if (warrning) {
|
|
382
436
|
Logger({
|
|
383
437
|
level: "WARN",
|
|
384
|
-
message:
|
|
438
|
+
message: `Parameter Validation warrnings for platform > Billing > createSubscriptionCharge \n ${warrning}`,
|
|
385
439
|
});
|
|
386
|
-
Logger({ level: "WARN", message: warrning });
|
|
387
440
|
}
|
|
388
441
|
|
|
389
442
|
const query_params = {};
|
|
@@ -396,37 +449,45 @@ class Billing {
|
|
|
396
449
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscription`,
|
|
397
450
|
query_params,
|
|
398
451
|
body,
|
|
399
|
-
xHeaders
|
|
452
|
+
xHeaders,
|
|
453
|
+
{ headers }
|
|
400
454
|
);
|
|
401
455
|
|
|
456
|
+
let responseData = response;
|
|
457
|
+
if (headers) {
|
|
458
|
+
responseData = response[0];
|
|
459
|
+
}
|
|
460
|
+
|
|
402
461
|
const {
|
|
403
462
|
error: res_error,
|
|
404
|
-
} =
|
|
405
|
-
|
|
406
|
-
allowUnknown: false
|
|
407
|
-
|
|
463
|
+
} = BillingPlatformModel.CreateSubscriptionResponse().validate(
|
|
464
|
+
responseData,
|
|
465
|
+
{ abortEarly: false, allowUnknown: false }
|
|
466
|
+
);
|
|
408
467
|
|
|
409
468
|
if (res_error) {
|
|
410
469
|
Logger({
|
|
411
470
|
level: "WARN",
|
|
412
|
-
message:
|
|
471
|
+
message: `Response Validation Warnnings for platform > Billing > createSubscriptionCharge \n ${res_error}`,
|
|
413
472
|
});
|
|
414
|
-
Logger({ level: "WARN", message: res_error });
|
|
415
473
|
}
|
|
416
474
|
|
|
417
475
|
return response;
|
|
418
476
|
}
|
|
419
477
|
|
|
420
478
|
/**
|
|
421
|
-
* @param {
|
|
422
|
-
* @param {
|
|
423
|
-
* @
|
|
424
|
-
* @
|
|
479
|
+
* @param {BillingPlatformValidator.GetChargeDetailsParam} arg - Arg object
|
|
480
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
481
|
+
* @returns {Promise<BillingPlatformModel.OneTimeChargeEntity>} - Success response
|
|
482
|
+
* @name getChargeDetails
|
|
425
483
|
* @summary: Get subscription charge details
|
|
426
|
-
* @description: Get created subscription charge details
|
|
484
|
+
* @description: Get created subscription charge details - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getChargeDetails/).
|
|
427
485
|
*/
|
|
428
|
-
async getChargeDetails(
|
|
429
|
-
|
|
486
|
+
async getChargeDetails(
|
|
487
|
+
{ extensionId, chargeId } = {},
|
|
488
|
+
{ headers } = { headers: false }
|
|
489
|
+
) {
|
|
490
|
+
const { error } = BillingPlatformValidator.getChargeDetails().validate(
|
|
430
491
|
{
|
|
431
492
|
extensionId,
|
|
432
493
|
chargeId,
|
|
@@ -438,7 +499,9 @@ class Billing {
|
|
|
438
499
|
}
|
|
439
500
|
|
|
440
501
|
// Showing warrnings if extra unknown parameters are found
|
|
441
|
-
const {
|
|
502
|
+
const {
|
|
503
|
+
error: warrning,
|
|
504
|
+
} = BillingPlatformValidator.getChargeDetails().validate(
|
|
442
505
|
{
|
|
443
506
|
extensionId,
|
|
444
507
|
chargeId,
|
|
@@ -448,9 +511,8 @@ class Billing {
|
|
|
448
511
|
if (warrning) {
|
|
449
512
|
Logger({
|
|
450
513
|
level: "WARN",
|
|
451
|
-
message:
|
|
514
|
+
message: `Parameter Validation warrnings for platform > Billing > getChargeDetails \n ${warrning}`,
|
|
452
515
|
});
|
|
453
|
-
Logger({ level: "WARN", message: warrning });
|
|
454
516
|
}
|
|
455
517
|
|
|
456
518
|
const query_params = {};
|
|
@@ -463,12 +525,18 @@ class Billing {
|
|
|
463
525
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/charge/${chargeId}`,
|
|
464
526
|
query_params,
|
|
465
527
|
undefined,
|
|
466
|
-
xHeaders
|
|
528
|
+
xHeaders,
|
|
529
|
+
{ headers }
|
|
467
530
|
);
|
|
468
531
|
|
|
532
|
+
let responseData = response;
|
|
533
|
+
if (headers) {
|
|
534
|
+
responseData = response[0];
|
|
535
|
+
}
|
|
536
|
+
|
|
469
537
|
const {
|
|
470
538
|
error: res_error,
|
|
471
|
-
} =
|
|
539
|
+
} = BillingPlatformModel.OneTimeChargeEntity().validate(responseData, {
|
|
472
540
|
abortEarly: false,
|
|
473
541
|
allowUnknown: false,
|
|
474
542
|
});
|
|
@@ -476,22 +544,23 @@ class Billing {
|
|
|
476
544
|
if (res_error) {
|
|
477
545
|
Logger({
|
|
478
546
|
level: "WARN",
|
|
479
|
-
message:
|
|
547
|
+
message: `Response Validation Warnnings for platform > Billing > getChargeDetails \n ${res_error}`,
|
|
480
548
|
});
|
|
481
|
-
Logger({ level: "WARN", message: res_error });
|
|
482
549
|
}
|
|
483
550
|
|
|
484
551
|
return response;
|
|
485
552
|
}
|
|
486
553
|
|
|
487
554
|
/**
|
|
488
|
-
* @param {
|
|
489
|
-
* @
|
|
555
|
+
* @param {BillingPlatformValidator.GetCustomerDetailParam} arg - Arg object
|
|
556
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
557
|
+
* @returns {Promise<BillingPlatformModel.SubscriptionCustomer>} - Success response
|
|
558
|
+
* @name getCustomerDetail
|
|
490
559
|
* @summary: Get subscription customer detail
|
|
491
|
-
* @description: Get subscription customer detail.
|
|
560
|
+
* @description: Get subscription customer detail. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getCustomerDetail/).
|
|
492
561
|
*/
|
|
493
|
-
async getCustomerDetail({} = {}) {
|
|
494
|
-
const { error } =
|
|
562
|
+
async getCustomerDetail({ headers } = { headers: false }) {
|
|
563
|
+
const { error } = BillingPlatformValidator.getCustomerDetail().validate(
|
|
495
564
|
{},
|
|
496
565
|
{ abortEarly: false, allowUnknown: true }
|
|
497
566
|
);
|
|
@@ -500,16 +569,17 @@ class Billing {
|
|
|
500
569
|
}
|
|
501
570
|
|
|
502
571
|
// Showing warrnings if extra unknown parameters are found
|
|
503
|
-
const {
|
|
572
|
+
const {
|
|
573
|
+
error: warrning,
|
|
574
|
+
} = BillingPlatformValidator.getCustomerDetail().validate(
|
|
504
575
|
{},
|
|
505
576
|
{ abortEarly: false, allowUnknown: false }
|
|
506
577
|
);
|
|
507
578
|
if (warrning) {
|
|
508
579
|
Logger({
|
|
509
580
|
level: "WARN",
|
|
510
|
-
message:
|
|
581
|
+
message: `Parameter Validation warrnings for platform > Billing > getCustomerDetail \n ${warrning}`,
|
|
511
582
|
});
|
|
512
|
-
Logger({ level: "WARN", message: warrning });
|
|
513
583
|
}
|
|
514
584
|
|
|
515
585
|
const query_params = {};
|
|
@@ -522,12 +592,18 @@ class Billing {
|
|
|
522
592
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/customer-detail`,
|
|
523
593
|
query_params,
|
|
524
594
|
undefined,
|
|
525
|
-
xHeaders
|
|
595
|
+
xHeaders,
|
|
596
|
+
{ headers }
|
|
526
597
|
);
|
|
527
598
|
|
|
599
|
+
let responseData = response;
|
|
600
|
+
if (headers) {
|
|
601
|
+
responseData = response[0];
|
|
602
|
+
}
|
|
603
|
+
|
|
528
604
|
const {
|
|
529
605
|
error: res_error,
|
|
530
|
-
} =
|
|
606
|
+
} = BillingPlatformModel.SubscriptionCustomer().validate(responseData, {
|
|
531
607
|
abortEarly: false,
|
|
532
608
|
allowUnknown: false,
|
|
533
609
|
});
|
|
@@ -535,22 +611,23 @@ class Billing {
|
|
|
535
611
|
if (res_error) {
|
|
536
612
|
Logger({
|
|
537
613
|
level: "WARN",
|
|
538
|
-
message:
|
|
614
|
+
message: `Response Validation Warnnings for platform > Billing > getCustomerDetail \n ${res_error}`,
|
|
539
615
|
});
|
|
540
|
-
Logger({ level: "WARN", message: res_error });
|
|
541
616
|
}
|
|
542
617
|
|
|
543
618
|
return response;
|
|
544
619
|
}
|
|
545
620
|
|
|
546
621
|
/**
|
|
547
|
-
* @param {
|
|
548
|
-
* @
|
|
622
|
+
* @param {BillingPlatformValidator.GetFeatureLimitConfigParam} arg - Arg object
|
|
623
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
624
|
+
* @returns {Promise<BillingPlatformModel.SubscriptionLimit>} - Success response
|
|
625
|
+
* @name getFeatureLimitConfig
|
|
549
626
|
* @summary: Get subscription subscription limits
|
|
550
|
-
* @description: Get subscription subscription limits.
|
|
627
|
+
* @description: Get subscription subscription limits. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getFeatureLimitConfig/).
|
|
551
628
|
*/
|
|
552
|
-
async getFeatureLimitConfig({} = {}) {
|
|
553
|
-
const { error } =
|
|
629
|
+
async getFeatureLimitConfig({ headers } = { headers: false }) {
|
|
630
|
+
const { error } = BillingPlatformValidator.getFeatureLimitConfig().validate(
|
|
554
631
|
{},
|
|
555
632
|
{ abortEarly: false, allowUnknown: true }
|
|
556
633
|
);
|
|
@@ -561,16 +638,15 @@ class Billing {
|
|
|
561
638
|
// Showing warrnings if extra unknown parameters are found
|
|
562
639
|
const {
|
|
563
640
|
error: warrning,
|
|
564
|
-
} =
|
|
641
|
+
} = BillingPlatformValidator.getFeatureLimitConfig().validate(
|
|
565
642
|
{},
|
|
566
643
|
{ abortEarly: false, allowUnknown: false }
|
|
567
644
|
);
|
|
568
645
|
if (warrning) {
|
|
569
646
|
Logger({
|
|
570
647
|
level: "WARN",
|
|
571
|
-
message:
|
|
648
|
+
message: `Parameter Validation warrnings for platform > Billing > getFeatureLimitConfig \n ${warrning}`,
|
|
572
649
|
});
|
|
573
|
-
Logger({ level: "WARN", message: warrning });
|
|
574
650
|
}
|
|
575
651
|
|
|
576
652
|
const query_params = {};
|
|
@@ -583,12 +659,18 @@ class Billing {
|
|
|
583
659
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/current-limit`,
|
|
584
660
|
query_params,
|
|
585
661
|
undefined,
|
|
586
|
-
xHeaders
|
|
662
|
+
xHeaders,
|
|
663
|
+
{ headers }
|
|
587
664
|
);
|
|
588
665
|
|
|
666
|
+
let responseData = response;
|
|
667
|
+
if (headers) {
|
|
668
|
+
responseData = response[0];
|
|
669
|
+
}
|
|
670
|
+
|
|
589
671
|
const {
|
|
590
672
|
error: res_error,
|
|
591
|
-
} =
|
|
673
|
+
} = BillingPlatformModel.SubscriptionLimit().validate(responseData, {
|
|
592
674
|
abortEarly: false,
|
|
593
675
|
allowUnknown: false,
|
|
594
676
|
});
|
|
@@ -596,23 +678,23 @@ class Billing {
|
|
|
596
678
|
if (res_error) {
|
|
597
679
|
Logger({
|
|
598
680
|
level: "WARN",
|
|
599
|
-
message:
|
|
681
|
+
message: `Response Validation Warnnings for platform > Billing > getFeatureLimitConfig \n ${res_error}`,
|
|
600
682
|
});
|
|
601
|
-
Logger({ level: "WARN", message: res_error });
|
|
602
683
|
}
|
|
603
684
|
|
|
604
685
|
return response;
|
|
605
686
|
}
|
|
606
687
|
|
|
607
688
|
/**
|
|
608
|
-
* @param {
|
|
609
|
-
* @param {
|
|
610
|
-
* @returns {Promise<Invoice>} - Success response
|
|
689
|
+
* @param {BillingPlatformValidator.GetInvoiceByIdParam} arg - Arg object
|
|
690
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
691
|
+
* @returns {Promise<BillingPlatformModel.Invoice>} - Success response
|
|
692
|
+
* @name getInvoiceById
|
|
611
693
|
* @summary: Get invoice by id
|
|
612
|
-
* @description: Get invoice by id.
|
|
694
|
+
* @description: Get invoice by id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getInvoiceById/).
|
|
613
695
|
*/
|
|
614
|
-
async getInvoiceById({ invoiceId } = {}) {
|
|
615
|
-
const { error } =
|
|
696
|
+
async getInvoiceById({ invoiceId } = {}, { headers } = { headers: false }) {
|
|
697
|
+
const { error } = BillingPlatformValidator.getInvoiceById().validate(
|
|
616
698
|
{
|
|
617
699
|
invoiceId,
|
|
618
700
|
},
|
|
@@ -623,7 +705,9 @@ class Billing {
|
|
|
623
705
|
}
|
|
624
706
|
|
|
625
707
|
// Showing warrnings if extra unknown parameters are found
|
|
626
|
-
const {
|
|
708
|
+
const {
|
|
709
|
+
error: warrning,
|
|
710
|
+
} = BillingPlatformValidator.getInvoiceById().validate(
|
|
627
711
|
{
|
|
628
712
|
invoiceId,
|
|
629
713
|
},
|
|
@@ -632,9 +716,8 @@ class Billing {
|
|
|
632
716
|
if (warrning) {
|
|
633
717
|
Logger({
|
|
634
718
|
level: "WARN",
|
|
635
|
-
message:
|
|
719
|
+
message: `Parameter Validation warrnings for platform > Billing > getInvoiceById \n ${warrning}`,
|
|
636
720
|
});
|
|
637
|
-
Logger({ level: "WARN", message: warrning });
|
|
638
721
|
}
|
|
639
722
|
|
|
640
723
|
const query_params = {};
|
|
@@ -647,10 +730,18 @@ class Billing {
|
|
|
647
730
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/invoice/${invoiceId}`,
|
|
648
731
|
query_params,
|
|
649
732
|
undefined,
|
|
650
|
-
xHeaders
|
|
733
|
+
xHeaders,
|
|
734
|
+
{ headers }
|
|
651
735
|
);
|
|
652
736
|
|
|
653
|
-
|
|
737
|
+
let responseData = response;
|
|
738
|
+
if (headers) {
|
|
739
|
+
responseData = response[0];
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
const {
|
|
743
|
+
error: res_error,
|
|
744
|
+
} = BillingPlatformModel.Invoice().validate(responseData, {
|
|
654
745
|
abortEarly: false,
|
|
655
746
|
allowUnknown: false,
|
|
656
747
|
});
|
|
@@ -658,22 +749,23 @@ class Billing {
|
|
|
658
749
|
if (res_error) {
|
|
659
750
|
Logger({
|
|
660
751
|
level: "WARN",
|
|
661
|
-
message:
|
|
752
|
+
message: `Response Validation Warnnings for platform > Billing > getInvoiceById \n ${res_error}`,
|
|
662
753
|
});
|
|
663
|
-
Logger({ level: "WARN", message: res_error });
|
|
664
754
|
}
|
|
665
755
|
|
|
666
756
|
return response;
|
|
667
757
|
}
|
|
668
758
|
|
|
669
759
|
/**
|
|
670
|
-
* @param {
|
|
671
|
-
* @
|
|
760
|
+
* @param {BillingPlatformValidator.GetInvoicesParam} arg - Arg object
|
|
761
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
762
|
+
* @returns {Promise<BillingPlatformModel.Invoices>} - Success response
|
|
763
|
+
* @name getInvoices
|
|
672
764
|
* @summary: Get invoices
|
|
673
|
-
* @description: Get invoices.
|
|
765
|
+
* @description: Get invoices. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getInvoices/).
|
|
674
766
|
*/
|
|
675
|
-
async getInvoices({} = {}) {
|
|
676
|
-
const { error } =
|
|
767
|
+
async getInvoices({ headers } = { headers: false }) {
|
|
768
|
+
const { error } = BillingPlatformValidator.getInvoices().validate(
|
|
677
769
|
{},
|
|
678
770
|
{ abortEarly: false, allowUnknown: true }
|
|
679
771
|
);
|
|
@@ -682,16 +774,15 @@ class Billing {
|
|
|
682
774
|
}
|
|
683
775
|
|
|
684
776
|
// Showing warrnings if extra unknown parameters are found
|
|
685
|
-
const { error: warrning } =
|
|
777
|
+
const { error: warrning } = BillingPlatformValidator.getInvoices().validate(
|
|
686
778
|
{},
|
|
687
779
|
{ abortEarly: false, allowUnknown: false }
|
|
688
780
|
);
|
|
689
781
|
if (warrning) {
|
|
690
782
|
Logger({
|
|
691
783
|
level: "WARN",
|
|
692
|
-
message:
|
|
784
|
+
message: `Parameter Validation warrnings for platform > Billing > getInvoices \n ${warrning}`,
|
|
693
785
|
});
|
|
694
|
-
Logger({ level: "WARN", message: warrning });
|
|
695
786
|
}
|
|
696
787
|
|
|
697
788
|
const query_params = {};
|
|
@@ -704,10 +795,18 @@ class Billing {
|
|
|
704
795
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/invoice/list`,
|
|
705
796
|
query_params,
|
|
706
797
|
undefined,
|
|
707
|
-
xHeaders
|
|
798
|
+
xHeaders,
|
|
799
|
+
{ headers }
|
|
708
800
|
);
|
|
709
801
|
|
|
710
|
-
|
|
802
|
+
let responseData = response;
|
|
803
|
+
if (headers) {
|
|
804
|
+
responseData = response[0];
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
const {
|
|
808
|
+
error: res_error,
|
|
809
|
+
} = BillingPlatformModel.Invoices().validate(responseData, {
|
|
711
810
|
abortEarly: false,
|
|
712
811
|
allowUnknown: false,
|
|
713
812
|
});
|
|
@@ -715,22 +814,24 @@ class Billing {
|
|
|
715
814
|
if (res_error) {
|
|
716
815
|
Logger({
|
|
717
816
|
level: "WARN",
|
|
718
|
-
message:
|
|
817
|
+
message: `Response Validation Warnnings for platform > Billing > getInvoices \n ${res_error}`,
|
|
719
818
|
});
|
|
720
|
-
Logger({ level: "WARN", message: res_error });
|
|
721
819
|
}
|
|
722
820
|
|
|
723
821
|
return response;
|
|
724
822
|
}
|
|
725
823
|
|
|
726
824
|
/**
|
|
727
|
-
* @param {
|
|
728
|
-
* @
|
|
825
|
+
* @param {BillingPlatformValidator.GetSubscriptionParam} arg - Arg object
|
|
826
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
827
|
+
* @returns {Promise<BillingPlatformModel.SubscriptionStatus>} - Success response
|
|
828
|
+
* @name getSubscription
|
|
729
829
|
* @summary: Get current subscription detail
|
|
730
830
|
* @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.
|
|
831
|
+
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getSubscription/).
|
|
731
832
|
*/
|
|
732
|
-
async getSubscription({} = {}) {
|
|
733
|
-
const { error } =
|
|
833
|
+
async getSubscription({ headers } = { headers: false }) {
|
|
834
|
+
const { error } = BillingPlatformValidator.getSubscription().validate(
|
|
734
835
|
{},
|
|
735
836
|
{ abortEarly: false, allowUnknown: true }
|
|
736
837
|
);
|
|
@@ -739,16 +840,17 @@ class Billing {
|
|
|
739
840
|
}
|
|
740
841
|
|
|
741
842
|
// Showing warrnings if extra unknown parameters are found
|
|
742
|
-
const {
|
|
843
|
+
const {
|
|
844
|
+
error: warrning,
|
|
845
|
+
} = BillingPlatformValidator.getSubscription().validate(
|
|
743
846
|
{},
|
|
744
847
|
{ abortEarly: false, allowUnknown: false }
|
|
745
848
|
);
|
|
746
849
|
if (warrning) {
|
|
747
850
|
Logger({
|
|
748
851
|
level: "WARN",
|
|
749
|
-
message:
|
|
852
|
+
message: `Parameter Validation warrnings for platform > Billing > getSubscription \n ${warrning}`,
|
|
750
853
|
});
|
|
751
|
-
Logger({ level: "WARN", message: warrning });
|
|
752
854
|
}
|
|
753
855
|
|
|
754
856
|
const query_params = {};
|
|
@@ -761,12 +863,18 @@ class Billing {
|
|
|
761
863
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/current`,
|
|
762
864
|
query_params,
|
|
763
865
|
undefined,
|
|
764
|
-
xHeaders
|
|
866
|
+
xHeaders,
|
|
867
|
+
{ headers }
|
|
765
868
|
);
|
|
766
869
|
|
|
870
|
+
let responseData = response;
|
|
871
|
+
if (headers) {
|
|
872
|
+
responseData = response[0];
|
|
873
|
+
}
|
|
874
|
+
|
|
767
875
|
const {
|
|
768
876
|
error: res_error,
|
|
769
|
-
} =
|
|
877
|
+
} = BillingPlatformModel.SubscriptionStatus().validate(responseData, {
|
|
770
878
|
abortEarly: false,
|
|
771
879
|
allowUnknown: false,
|
|
772
880
|
});
|
|
@@ -774,24 +882,26 @@ class Billing {
|
|
|
774
882
|
if (res_error) {
|
|
775
883
|
Logger({
|
|
776
884
|
level: "WARN",
|
|
777
|
-
message:
|
|
885
|
+
message: `Response Validation Warnnings for platform > Billing > getSubscription \n ${res_error}`,
|
|
778
886
|
});
|
|
779
|
-
Logger({ level: "WARN", message: res_error });
|
|
780
887
|
}
|
|
781
888
|
|
|
782
889
|
return response;
|
|
783
890
|
}
|
|
784
891
|
|
|
785
892
|
/**
|
|
786
|
-
* @param {
|
|
787
|
-
* @param {
|
|
788
|
-
* @
|
|
789
|
-
* @
|
|
893
|
+
* @param {BillingPlatformValidator.GetSubscriptionChargeParam} arg - Arg object
|
|
894
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
895
|
+
* @returns {Promise<BillingPlatformModel.EntitySubscription>} - Success response
|
|
896
|
+
* @name getSubscriptionCharge
|
|
790
897
|
* @summary: Get subscription charge details
|
|
791
|
-
* @description: Get created subscription charge details
|
|
898
|
+
* @description: Get created subscription charge details - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/getSubscriptionCharge/).
|
|
792
899
|
*/
|
|
793
|
-
async getSubscriptionCharge(
|
|
794
|
-
|
|
900
|
+
async getSubscriptionCharge(
|
|
901
|
+
{ extensionId, subscriptionId } = {},
|
|
902
|
+
{ headers } = { headers: false }
|
|
903
|
+
) {
|
|
904
|
+
const { error } = BillingPlatformValidator.getSubscriptionCharge().validate(
|
|
795
905
|
{
|
|
796
906
|
extensionId,
|
|
797
907
|
subscriptionId,
|
|
@@ -805,7 +915,7 @@ class Billing {
|
|
|
805
915
|
// Showing warrnings if extra unknown parameters are found
|
|
806
916
|
const {
|
|
807
917
|
error: warrning,
|
|
808
|
-
} =
|
|
918
|
+
} = BillingPlatformValidator.getSubscriptionCharge().validate(
|
|
809
919
|
{
|
|
810
920
|
extensionId,
|
|
811
921
|
subscriptionId,
|
|
@@ -815,9 +925,8 @@ class Billing {
|
|
|
815
925
|
if (warrning) {
|
|
816
926
|
Logger({
|
|
817
927
|
level: "WARN",
|
|
818
|
-
message:
|
|
928
|
+
message: `Parameter Validation warrnings for platform > Billing > getSubscriptionCharge \n ${warrning}`,
|
|
819
929
|
});
|
|
820
|
-
Logger({ level: "WARN", message: warrning });
|
|
821
930
|
}
|
|
822
931
|
|
|
823
932
|
const query_params = {};
|
|
@@ -830,12 +939,18 @@ class Billing {
|
|
|
830
939
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscription/${subscriptionId}`,
|
|
831
940
|
query_params,
|
|
832
941
|
undefined,
|
|
833
|
-
xHeaders
|
|
942
|
+
xHeaders,
|
|
943
|
+
{ headers }
|
|
834
944
|
);
|
|
835
945
|
|
|
946
|
+
let responseData = response;
|
|
947
|
+
if (headers) {
|
|
948
|
+
responseData = response[0];
|
|
949
|
+
}
|
|
950
|
+
|
|
836
951
|
const {
|
|
837
952
|
error: res_error,
|
|
838
|
-
} =
|
|
953
|
+
} = BillingPlatformModel.EntitySubscription().validate(responseData, {
|
|
839
954
|
abortEarly: false,
|
|
840
955
|
allowUnknown: false,
|
|
841
956
|
});
|
|
@@ -843,23 +958,23 @@ class Billing {
|
|
|
843
958
|
if (res_error) {
|
|
844
959
|
Logger({
|
|
845
960
|
level: "WARN",
|
|
846
|
-
message:
|
|
961
|
+
message: `Response Validation Warnnings for platform > Billing > getSubscriptionCharge \n ${res_error}`,
|
|
847
962
|
});
|
|
848
|
-
Logger({ level: "WARN", message: res_error });
|
|
849
963
|
}
|
|
850
964
|
|
|
851
965
|
return response;
|
|
852
966
|
}
|
|
853
967
|
|
|
854
968
|
/**
|
|
855
|
-
* @param {
|
|
856
|
-
* @param {
|
|
857
|
-
* @returns {Promise<SubscriptionCustomer>} - Success response
|
|
969
|
+
* @param {BillingPlatformValidator.UpsertCustomerDetailParam} arg - Arg object
|
|
970
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
971
|
+
* @returns {Promise<BillingPlatformModel.SubscriptionCustomer>} - Success response
|
|
972
|
+
* @name upsertCustomerDetail
|
|
858
973
|
* @summary: Upsert subscription customer detail
|
|
859
|
-
* @description: Upsert subscription customer detail.
|
|
974
|
+
* @description: Upsert subscription customer detail. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/billing/upsertCustomerDetail/).
|
|
860
975
|
*/
|
|
861
|
-
async upsertCustomerDetail({ body } = {}) {
|
|
862
|
-
const { error } =
|
|
976
|
+
async upsertCustomerDetail({ body } = {}, { headers } = { headers: false }) {
|
|
977
|
+
const { error } = BillingPlatformValidator.upsertCustomerDetail().validate(
|
|
863
978
|
{
|
|
864
979
|
body,
|
|
865
980
|
},
|
|
@@ -872,7 +987,7 @@ class Billing {
|
|
|
872
987
|
// Showing warrnings if extra unknown parameters are found
|
|
873
988
|
const {
|
|
874
989
|
error: warrning,
|
|
875
|
-
} =
|
|
990
|
+
} = BillingPlatformValidator.upsertCustomerDetail().validate(
|
|
876
991
|
{
|
|
877
992
|
body,
|
|
878
993
|
},
|
|
@@ -881,9 +996,8 @@ class Billing {
|
|
|
881
996
|
if (warrning) {
|
|
882
997
|
Logger({
|
|
883
998
|
level: "WARN",
|
|
884
|
-
message:
|
|
999
|
+
message: `Parameter Validation warrnings for platform > Billing > upsertCustomerDetail \n ${warrning}`,
|
|
885
1000
|
});
|
|
886
|
-
Logger({ level: "WARN", message: warrning });
|
|
887
1001
|
}
|
|
888
1002
|
|
|
889
1003
|
const query_params = {};
|
|
@@ -896,12 +1010,18 @@ class Billing {
|
|
|
896
1010
|
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/customer-detail`,
|
|
897
1011
|
query_params,
|
|
898
1012
|
body,
|
|
899
|
-
xHeaders
|
|
1013
|
+
xHeaders,
|
|
1014
|
+
{ headers }
|
|
900
1015
|
);
|
|
901
1016
|
|
|
1017
|
+
let responseData = response;
|
|
1018
|
+
if (headers) {
|
|
1019
|
+
responseData = response[0];
|
|
1020
|
+
}
|
|
1021
|
+
|
|
902
1022
|
const {
|
|
903
1023
|
error: res_error,
|
|
904
|
-
} =
|
|
1024
|
+
} = BillingPlatformModel.SubscriptionCustomer().validate(responseData, {
|
|
905
1025
|
abortEarly: false,
|
|
906
1026
|
allowUnknown: false,
|
|
907
1027
|
});
|
|
@@ -909,9 +1029,8 @@ class Billing {
|
|
|
909
1029
|
if (res_error) {
|
|
910
1030
|
Logger({
|
|
911
1031
|
level: "WARN",
|
|
912
|
-
message:
|
|
1032
|
+
message: `Response Validation Warnnings for platform > Billing > upsertCustomerDetail \n ${res_error}`,
|
|
913
1033
|
});
|
|
914
|
-
Logger({ level: "WARN", message: res_error });
|
|
915
1034
|
}
|
|
916
1035
|
|
|
917
1036
|
return response;
|