@gofynd/fdk-client-javascript 1.0.1 → 1.0.3
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/documentation/application/CART.md +5934 -4502
- package/documentation/application/CATALOG.md +6338 -7245
- package/documentation/application/COMMON.md +95 -222
- package/documentation/application/COMMUNICATION.md +106 -186
- package/documentation/application/CONFIGURATION.md +903 -1597
- package/documentation/application/CONTENT.md +562 -1270
- package/documentation/application/FILESTORAGE.md +84 -220
- package/documentation/application/LEAD.md +314 -660
- package/documentation/application/LOGISTIC.md +229 -305
- package/documentation/application/ORDER.md +642 -1137
- package/documentation/application/PAYMENT.md +2285 -3031
- package/documentation/application/POSCART.md +6079 -4642
- package/documentation/application/REWARDS.md +94 -248
- package/documentation/application/SHARE.md +152 -250
- package/documentation/application/THEME.md +952 -1235
- package/documentation/application/USER.md +1228 -1765
- package/documentation/platform/ANALYTICS.md +207 -349
- package/documentation/platform/AUDITTRAIL.md +121 -204
- package/documentation/platform/BILLING.md +865 -1376
- package/documentation/platform/CART.md +2814 -3662
- package/documentation/platform/CATALOG.md +15266 -17619
- package/documentation/platform/COMMON.md +95 -222
- package/documentation/platform/COMMUNICATION.md +1632 -2380
- package/documentation/platform/COMPANYPROFILE.md +572 -957
- package/documentation/platform/CONFIGURATION.md +3050 -4073
- package/documentation/platform/CONTENT.md +3509 -4121
- package/documentation/platform/DISCOUNT.md +140 -236
- package/documentation/platform/FILESTORAGE.md +187 -323
- package/documentation/platform/INVENTORY.md +268 -911
- package/documentation/platform/LEAD.md +2195 -2541
- package/documentation/platform/ORDER.md +3750 -5636
- package/documentation/platform/PARTNER.md +9 -36
- package/documentation/platform/PAYMENT.md +903 -1213
- package/documentation/platform/REWARDS.md +183 -347
- package/documentation/platform/SHARE.md +120 -213
- package/documentation/platform/THEME.md +12956 -13239
- package/documentation/platform/USER.md +975 -1120
- package/documentation/platform/WEBHOOK.md +78 -184
- package/documentation/public/CONFIGURATION.md +95 -222
- package/documentation/public/INVENTORY.md +100 -282
- package/documentation/public/WEBHOOK.md +27 -133
- package/package.json +1 -1
- package/sdk/application/ApplicationConfig.js +1 -1
- package/sdk/application/Cart/CartApplicationClient.d.ts +243 -243
- package/sdk/application/Cart/CartApplicationClient.js +1058 -547
- package/sdk/application/Cart/CartApplicationModel.d.ts +64 -63
- package/sdk/application/Cart/CartApplicationModel.js +489 -886
- package/sdk/application/Cart/CartApplicationValidator.d.ts +17 -17
- package/sdk/application/Cart/CartApplicationValidator.js +98 -98
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +358 -358
- package/sdk/application/Catalog/CatalogApplicationClient.js +1545 -949
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
- package/sdk/application/Catalog/CatalogApplicationModel.js +692 -1258
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +19 -19
- package/sdk/application/Catalog/CatalogApplicationValidator.js +110 -110
- package/sdk/application/Common/CommonApplicationClient.d.ts +13 -13
- package/sdk/application/Common/CommonApplicationClient.js +76 -36
- package/sdk/application/Common/CommonApplicationModel.d.ts +12 -12
- package/sdk/application/Common/CommonApplicationModel.js +83 -160
- package/sdk/application/Common/CommonApplicationValidator.d.ts +1 -1
- package/sdk/application/Common/CommonApplicationValidator.js +6 -6
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +11 -11
- package/sdk/application/Communication/CommunicationApplicationClient.js +92 -31
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +6 -6
- package/sdk/application/Communication/CommunicationApplicationModel.js +38 -83
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +1 -1
- package/sdk/application/Communication/CommunicationApplicationValidator.js +4 -4
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +116 -116
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +638 -312
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +85 -85
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +480 -851
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +8 -8
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +33 -33
- package/sdk/application/Content/ContentApplicationClient.d.ts +67 -67
- package/sdk/application/Content/ContentApplicationClient.js +581 -213
- package/sdk/application/Content/ContentApplicationModel.d.ts +76 -75
- package/sdk/application/Content/ContentApplicationModel.js +468 -875
- package/sdk/application/Content/ContentApplicationValidator.d.ts +5 -5
- package/sdk/application/Content/ContentApplicationValidator.js +24 -24
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +25 -25
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +121 -59
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +13 -13
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +86 -169
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +1 -1
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +7 -7
- package/sdk/application/Lead/LeadApplicationClient.d.ts +24 -24
- package/sdk/application/Lead/LeadApplicationClient.js +230 -96
- package/sdk/application/Lead/LeadApplicationModel.d.ts +35 -35
- package/sdk/application/Lead/LeadApplicationModel.js +267 -474
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +2 -2
- package/sdk/application/Lead/LeadApplicationValidator.js +11 -11
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +30 -19
- package/sdk/application/Logistic/LogisticApplicationClient.js +196 -47
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +17 -14
- package/sdk/application/Logistic/LogisticApplicationModel.js +133 -201
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +3 -2
- package/sdk/application/Logistic/LogisticApplicationValidator.js +14 -8
- package/sdk/application/Order/OrderApplicationClient.d.ts +86 -86
- package/sdk/application/Order/OrderApplicationClient.js +448 -215
- package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
- package/sdk/application/Order/OrderApplicationModel.js +357 -661
- package/sdk/application/Order/OrderApplicationValidator.d.ts +7 -7
- package/sdk/application/Order/OrderApplicationValidator.js +28 -28
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +318 -318
- package/sdk/application/Payment/PaymentApplicationClient.js +1525 -750
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
- package/sdk/application/Payment/PaymentApplicationModel.js +565 -1033
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +28 -28
- package/sdk/application/Payment/PaymentApplicationValidator.js +107 -107
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +254 -254
- package/sdk/application/PosCart/PosCartApplicationClient.js +1137 -606
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +61 -60
- package/sdk/application/PosCart/PosCartApplicationModel.js +477 -873
- package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +18 -18
- package/sdk/application/PosCart/PosCartApplicationValidator.js +103 -103
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +27 -27
- package/sdk/application/Rewards/RewardsApplicationClient.js +253 -113
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +14 -14
- package/sdk/application/Rewards/RewardsApplicationModel.js +96 -191
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +3 -3
- package/sdk/application/Rewards/RewardsApplicationValidator.js +12 -12
- package/sdk/application/Share/ShareApplicationClient.d.ts +37 -37
- package/sdk/application/Share/ShareApplicationClient.js +221 -96
- package/sdk/application/Share/ShareApplicationModel.d.ts +8 -8
- package/sdk/application/Share/ShareApplicationModel.js +63 -123
- package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -4
- package/sdk/application/Share/ShareApplicationValidator.js +12 -12
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -8
- package/sdk/application/Theme/ThemeApplicationClient.js +115 -37
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +34 -34
- package/sdk/application/Theme/ThemeApplicationModel.js +190 -336
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +1 -1
- package/sdk/application/Theme/ThemeApplicationValidator.js +4 -4
- package/sdk/application/User/UserApplicationClient.d.ts +280 -280
- package/sdk/application/User/UserApplicationClient.js +1201 -543
- package/sdk/application/User/UserApplicationModel.d.ts +79 -72
- package/sdk/application/User/UserApplicationModel.js +440 -689
- package/sdk/application/User/UserApplicationValidator.d.ts +24 -24
- package/sdk/application/User/UserApplicationValidator.js +89 -89
- package/sdk/common/AxiosHelper.js +1 -1
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +55 -47
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +308 -151
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +20 -20
- package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
- package/sdk/platform/Analytics/AnalyticsPlatformClient.js +103 -16
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +16 -12
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +131 -44
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +10 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +50 -89
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +6 -6
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +68 -56
- package/sdk/platform/Billing/BillingPlatformClient.js +416 -171
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +40 -40
- package/sdk/platform/Billing/BillingPlatformModel.js +342 -668
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +8 -8
- package/sdk/platform/Billing/BillingPlatformValidator.js +25 -25
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +176 -159
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +837 -500
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +11 -11
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +63 -63
- package/sdk/platform/Cart/CartPlatformModel.d.ts +86 -85
- package/sdk/platform/Cart/CartPlatformModel.js +677 -1211
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +582 -529
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2642 -1533
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +175 -175
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +708 -590
- package/sdk/platform/Catalog/CatalogPlatformClient.js +3103 -1362
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +293 -284
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2149 -3660
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -64
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +235 -216
- package/sdk/platform/Common/CommonPlatformClient.d.ts +14 -12
- package/sdk/platform/Common/CommonPlatformClient.js +80 -37
- package/sdk/platform/Common/CommonPlatformModel.d.ts +12 -12
- package/sdk/platform/Common/CommonPlatformModel.js +83 -160
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +1 -1
- package/sdk/platform/Common/CommonPlatformValidator.js +6 -6
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +333 -293
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1687 -855
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +87 -87
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +28 -4
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
- package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +70 -57
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +463 -182
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +28 -28
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +294 -557
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +24 -24
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +175 -137
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +1168 -521
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +69 -63
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +137 -119
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +691 -316
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +148 -146
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +854 -1508
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -9
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +38 -38
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +542 -461
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +2600 -1160
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +50 -49
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +159 -152
- package/sdk/platform/Content/ContentPlatformModel.d.ts +79 -75
- package/sdk/platform/Content/ContentPlatformModel.js +486 -867
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +72 -61
- package/sdk/platform/Discount/DiscountPlatformClient.js +424 -198
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +7 -7
- package/sdk/platform/Discount/DiscountPlatformModel.js +60 -121
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +6 -6
- package/sdk/platform/Discount/DiscountPlatformValidator.js +29 -29
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +26 -22
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +145 -59
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +8 -8
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +58 -52
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +240 -114
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +13 -13
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +86 -169
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +3 -3
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -11
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +76 -63
- package/sdk/platform/Inventory/InventoryPlatformClient.js +461 -197
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +30 -30
- package/sdk/platform/Inventory/InventoryPlatformModel.js +497 -964
- package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +7 -7
- package/sdk/platform/Inventory/InventoryPlatformValidator.js +28 -28
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +84 -71
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +441 -182
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +28 -28
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +86 -75
- package/sdk/platform/Lead/LeadPlatformClient.js +434 -212
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +35 -35
- package/sdk/platform/Lead/LeadPlatformModel.js +267 -474
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +6 -6
- package/sdk/platform/Lead/LeadPlatformValidator.js +24 -24
- package/sdk/platform/OAuthClient.js +8 -8
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +14 -11
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +113 -49
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -6
- package/sdk/platform/Order/OrderPlatformClient.d.ts +367 -315
- package/sdk/platform/Order/OrderPlatformClient.js +1775 -893
- package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -192
- package/sdk/platform/Order/OrderPlatformModel.js +1591 -2822
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
- package/sdk/platform/Order/OrderPlatformValidator.js +160 -155
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -8
- package/sdk/platform/Partner/PartnerPlatformModel.js +6 -22
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +65 -54
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +395 -164
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +23 -23
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +55 -45
- package/sdk/platform/Payment/PaymentPlatformClient.js +362 -147
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
- package/sdk/platform/Payment/PaymentPlatformModel.js +220 -408
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
- package/sdk/platform/Payment/PaymentPlatformValidator.js +21 -21
- package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10153
- package/sdk/platform/PlatformApplicationClient.js +1584 -13691
- package/sdk/platform/PlatformClient.d.ts +7918 -7666
- package/sdk/platform/PlatformClient.js +8701 -9926
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +91 -78
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +507 -253
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +8 -8
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +34 -34
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +15 -15
- package/sdk/platform/Rewards/RewardsPlatformModel.js +92 -194
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +16 -12
- package/sdk/platform/Share/SharePlatformApplicationClient.js +130 -52
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +6 -6
- package/sdk/platform/Share/SharePlatformModel.d.ts +8 -8
- package/sdk/platform/Share/SharePlatformModel.js +60 -118
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +148 -124
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +770 -295
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +15 -15
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +44 -44
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +34 -34
- package/sdk/platform/Theme/ThemePlatformModel.js +190 -336
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +146 -67
- package/sdk/platform/User/UserPlatformApplicationClient.js +742 -155
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +12 -7
- package/sdk/platform/User/UserPlatformApplicationValidator.js +61 -23
- package/sdk/platform/User/UserPlatformModel.d.ts +79 -72
- package/sdk/platform/User/UserPlatformModel.js +440 -689
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +35 -29
- package/sdk/platform/Webhook/WebhookPlatformClient.js +218 -91
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +7 -7
- package/sdk/platform/Webhook/WebhookPlatformModel.js +68 -136
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +3 -3
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +14 -14
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +13 -13
- package/sdk/public/Configuration/ConfigurationPublicClient.js +81 -38
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +12 -12
- package/sdk/public/Configuration/ConfigurationPublicModel.js +85 -162
- package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +1 -1
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +6 -6
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +34 -34
- package/sdk/public/Inventory/InventoryPublicClient.js +228 -105
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +10 -10
- package/sdk/public/Inventory/InventoryPublicModel.js +119 -245
- package/sdk/public/Inventory/InventoryPublicValidator.d.ts +3 -3
- package/sdk/public/Inventory/InventoryPublicValidator.js +15 -15
- package/sdk/public/Webhook/WebhookPublicClient.js +51 -10
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
- package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
- package/tests/application/catalog.spec.js +7 -0
|
@@ -2,6 +2,9 @@ const Paginator = require("../../common/Paginator");
|
|
|
2
2
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
3
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
4
4
|
const BillingValidator = require("./BillingPlatformValidator");
|
|
5
|
+
const BillingModel = require("./BillingPlatformModel");
|
|
6
|
+
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
|
|
5
8
|
class Billing {
|
|
6
9
|
constructor(config) {
|
|
7
10
|
this.config = config;
|
|
@@ -9,16 +12,15 @@ class Billing {
|
|
|
9
12
|
|
|
10
13
|
/**
|
|
11
14
|
* @param {Object} arg - Arg object.
|
|
12
|
-
* @param {
|
|
13
|
-
* @
|
|
14
|
-
* @summary:
|
|
15
|
-
* @description:
|
|
15
|
+
* @param {SubscriptionActivateReq} arg.body
|
|
16
|
+
* @returns {Promise<SubscriptionActivateRes>} - Success response
|
|
17
|
+
* @summary: Activate subscription
|
|
18
|
+
* @description: It will activate subscription plan for customer
|
|
16
19
|
*/
|
|
17
|
-
|
|
18
|
-
const { error } = BillingValidator.
|
|
20
|
+
async activateSubscriptionPlan({ body } = {}) {
|
|
21
|
+
const { error } = BillingValidator.activateSubscriptionPlan().validate(
|
|
19
22
|
{
|
|
20
|
-
|
|
21
|
-
couponCode,
|
|
23
|
+
body,
|
|
22
24
|
},
|
|
23
25
|
{ abortEarly: false, allowUnknown: true }
|
|
24
26
|
);
|
|
@@ -27,46 +29,66 @@ class Billing {
|
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
// Showing warrnings if extra unknown parameters are found
|
|
30
|
-
const {
|
|
32
|
+
const {
|
|
33
|
+
error: warrning,
|
|
34
|
+
} = BillingValidator.activateSubscriptionPlan().validate(
|
|
31
35
|
{
|
|
32
|
-
|
|
33
|
-
couponCode,
|
|
36
|
+
body,
|
|
34
37
|
},
|
|
35
38
|
{ abortEarly: false, allowUnknown: false }
|
|
36
39
|
);
|
|
37
40
|
if (warrning) {
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
Logger({
|
|
42
|
+
level: "WARN",
|
|
43
|
+
message: "Parameter Validation warrnings for activateSubscriptionPlan",
|
|
44
|
+
});
|
|
45
|
+
Logger({ level: "WARN", message: warrning });
|
|
40
46
|
}
|
|
41
47
|
|
|
42
48
|
const query_params = {};
|
|
43
|
-
query_params["plan"] = plan;
|
|
44
|
-
query_params["coupon_code"] = couponCode;
|
|
45
49
|
|
|
46
50
|
const xHeaders = {};
|
|
47
51
|
|
|
48
|
-
|
|
52
|
+
const response = await PlatformAPIClient.execute(
|
|
49
53
|
this.config,
|
|
50
|
-
"
|
|
51
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/
|
|
54
|
+
"post",
|
|
55
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/activate`,
|
|
52
56
|
query_params,
|
|
53
|
-
|
|
57
|
+
body,
|
|
54
58
|
xHeaders
|
|
55
59
|
);
|
|
60
|
+
|
|
61
|
+
const {
|
|
62
|
+
error: res_error,
|
|
63
|
+
} = BillingModel.SubscriptionActivateRes().validate(response, {
|
|
64
|
+
abortEarly: false,
|
|
65
|
+
allowUnknown: false,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
if (res_error) {
|
|
69
|
+
Logger({
|
|
70
|
+
level: "WARN",
|
|
71
|
+
message: "Response Validation Warnnings for activateSubscriptionPlan",
|
|
72
|
+
});
|
|
73
|
+
Logger({ level: "WARN", message: res_error });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return response;
|
|
56
77
|
}
|
|
57
78
|
|
|
58
79
|
/**
|
|
59
80
|
* @param {Object} arg - Arg object.
|
|
60
81
|
* @param {string} arg.extensionId - Extension _id
|
|
61
|
-
* @param {
|
|
62
|
-
* @
|
|
63
|
-
* @
|
|
82
|
+
* @param {string} arg.subscriptionId - Subscription charge _id
|
|
83
|
+
* @returns {Promise<EntitySubscription>} - Success response
|
|
84
|
+
* @summary: Cancel subscription charge
|
|
85
|
+
* @description: Cancel subscription and attached charges.
|
|
64
86
|
*/
|
|
65
|
-
|
|
66
|
-
const { error } = BillingValidator.
|
|
87
|
+
async cancelSubscriptionCharge({ extensionId, subscriptionId } = {}) {
|
|
88
|
+
const { error } = BillingValidator.cancelSubscriptionCharge().validate(
|
|
67
89
|
{
|
|
68
90
|
extensionId,
|
|
69
|
-
|
|
91
|
+
subscriptionId,
|
|
70
92
|
},
|
|
71
93
|
{ abortEarly: false, allowUnknown: true }
|
|
72
94
|
);
|
|
@@ -77,46 +99,63 @@ class Billing {
|
|
|
77
99
|
// Showing warrnings if extra unknown parameters are found
|
|
78
100
|
const {
|
|
79
101
|
error: warrning,
|
|
80
|
-
} = BillingValidator.
|
|
102
|
+
} = BillingValidator.cancelSubscriptionCharge().validate(
|
|
81
103
|
{
|
|
82
104
|
extensionId,
|
|
83
|
-
|
|
105
|
+
subscriptionId,
|
|
84
106
|
},
|
|
85
107
|
{ abortEarly: false, allowUnknown: false }
|
|
86
108
|
);
|
|
87
109
|
if (warrning) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
110
|
+
Logger({
|
|
111
|
+
level: "WARN",
|
|
112
|
+
message: "Parameter Validation warrnings for cancelSubscriptionCharge",
|
|
113
|
+
});
|
|
114
|
+
Logger({ level: "WARN", message: warrning });
|
|
92
115
|
}
|
|
93
116
|
|
|
94
117
|
const query_params = {};
|
|
95
118
|
|
|
96
119
|
const xHeaders = {};
|
|
97
120
|
|
|
98
|
-
|
|
121
|
+
const response = await PlatformAPIClient.execute(
|
|
99
122
|
this.config,
|
|
100
123
|
"post",
|
|
101
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscription`,
|
|
124
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscription/${subscriptionId}/cancel`,
|
|
102
125
|
query_params,
|
|
103
|
-
|
|
126
|
+
undefined,
|
|
104
127
|
xHeaders
|
|
105
128
|
);
|
|
129
|
+
|
|
130
|
+
const {
|
|
131
|
+
error: res_error,
|
|
132
|
+
} = BillingModel.EntitySubscription().validate(response, {
|
|
133
|
+
abortEarly: false,
|
|
134
|
+
allowUnknown: false,
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
if (res_error) {
|
|
138
|
+
Logger({
|
|
139
|
+
level: "WARN",
|
|
140
|
+
message: "Response Validation Warnnings for cancelSubscriptionCharge",
|
|
141
|
+
});
|
|
142
|
+
Logger({ level: "WARN", message: res_error });
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return response;
|
|
106
146
|
}
|
|
107
147
|
|
|
108
148
|
/**
|
|
109
149
|
* @param {Object} arg - Arg object.
|
|
110
|
-
* @param {
|
|
111
|
-
* @
|
|
112
|
-
* @summary:
|
|
113
|
-
* @description:
|
|
150
|
+
* @param {CancelSubscriptionReq} arg.body
|
|
151
|
+
* @returns {Promise<CancelSubscriptionRes>} - Success response
|
|
152
|
+
* @summary: Cancel subscription
|
|
153
|
+
* @description: It will cancel current active subscription.
|
|
114
154
|
*/
|
|
115
|
-
|
|
116
|
-
const { error } = BillingValidator.
|
|
155
|
+
async cancelSubscriptionPlan({ body } = {}) {
|
|
156
|
+
const { error } = BillingValidator.cancelSubscriptionPlan().validate(
|
|
117
157
|
{
|
|
118
|
-
|
|
119
|
-
subscriptionId,
|
|
158
|
+
body,
|
|
120
159
|
},
|
|
121
160
|
{ abortEarly: false, allowUnknown: true }
|
|
122
161
|
);
|
|
@@ -127,44 +166,64 @@ class Billing {
|
|
|
127
166
|
// Showing warrnings if extra unknown parameters are found
|
|
128
167
|
const {
|
|
129
168
|
error: warrning,
|
|
130
|
-
} = BillingValidator.
|
|
169
|
+
} = BillingValidator.cancelSubscriptionPlan().validate(
|
|
131
170
|
{
|
|
132
|
-
|
|
133
|
-
subscriptionId,
|
|
171
|
+
body,
|
|
134
172
|
},
|
|
135
173
|
{ abortEarly: false, allowUnknown: false }
|
|
136
174
|
);
|
|
137
175
|
if (warrning) {
|
|
138
|
-
|
|
139
|
-
|
|
176
|
+
Logger({
|
|
177
|
+
level: "WARN",
|
|
178
|
+
message: "Parameter Validation warrnings for cancelSubscriptionPlan",
|
|
179
|
+
});
|
|
180
|
+
Logger({ level: "WARN", message: warrning });
|
|
140
181
|
}
|
|
141
182
|
|
|
142
183
|
const query_params = {};
|
|
143
184
|
|
|
144
185
|
const xHeaders = {};
|
|
145
186
|
|
|
146
|
-
|
|
187
|
+
const response = await PlatformAPIClient.execute(
|
|
147
188
|
this.config,
|
|
148
|
-
"
|
|
149
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/
|
|
189
|
+
"post",
|
|
190
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/cancel`,
|
|
150
191
|
query_params,
|
|
151
|
-
|
|
192
|
+
body,
|
|
152
193
|
xHeaders
|
|
153
194
|
);
|
|
195
|
+
|
|
196
|
+
const {
|
|
197
|
+
error: res_error,
|
|
198
|
+
} = BillingModel.CancelSubscriptionRes().validate(response, {
|
|
199
|
+
abortEarly: false,
|
|
200
|
+
allowUnknown: false,
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
if (res_error) {
|
|
204
|
+
Logger({
|
|
205
|
+
level: "WARN",
|
|
206
|
+
message: "Response Validation Warnnings for cancelSubscriptionPlan",
|
|
207
|
+
});
|
|
208
|
+
Logger({ level: "WARN", message: res_error });
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return response;
|
|
154
212
|
}
|
|
155
213
|
|
|
156
214
|
/**
|
|
157
215
|
* @param {Object} arg - Arg object.
|
|
158
|
-
* @param {string} arg.
|
|
159
|
-
* @param {string} arg.
|
|
160
|
-
* @
|
|
161
|
-
* @
|
|
216
|
+
* @param {string} arg.plan - ID of the plan.
|
|
217
|
+
* @param {string} arg.couponCode - Coupon code.
|
|
218
|
+
* @returns {Promise<CheckValidityResponse>} - Success response
|
|
219
|
+
* @summary: Check coupon validity
|
|
220
|
+
* @description: Check coupon validity.
|
|
162
221
|
*/
|
|
163
|
-
|
|
164
|
-
const { error } = BillingValidator.
|
|
222
|
+
async checkCouponValidity({ plan, couponCode } = {}) {
|
|
223
|
+
const { error } = BillingValidator.checkCouponValidity().validate(
|
|
165
224
|
{
|
|
166
|
-
|
|
167
|
-
|
|
225
|
+
plan,
|
|
226
|
+
couponCode,
|
|
168
227
|
},
|
|
169
228
|
{ abortEarly: false, allowUnknown: true }
|
|
170
229
|
);
|
|
@@ -173,44 +232,68 @@ class Billing {
|
|
|
173
232
|
}
|
|
174
233
|
|
|
175
234
|
// Showing warrnings if extra unknown parameters are found
|
|
176
|
-
const {
|
|
177
|
-
error: warrning,
|
|
178
|
-
} = BillingValidator.cancelSubscriptionCharge().validate(
|
|
235
|
+
const { error: warrning } = BillingValidator.checkCouponValidity().validate(
|
|
179
236
|
{
|
|
180
|
-
|
|
181
|
-
|
|
237
|
+
plan,
|
|
238
|
+
couponCode,
|
|
182
239
|
},
|
|
183
240
|
{ abortEarly: false, allowUnknown: false }
|
|
184
241
|
);
|
|
185
242
|
if (warrning) {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
243
|
+
Logger({
|
|
244
|
+
level: "WARN",
|
|
245
|
+
message: "Parameter Validation warrnings for checkCouponValidity",
|
|
246
|
+
});
|
|
247
|
+
Logger({ level: "WARN", message: warrning });
|
|
190
248
|
}
|
|
191
249
|
|
|
192
250
|
const query_params = {};
|
|
251
|
+
query_params["plan"] = plan;
|
|
252
|
+
query_params["coupon_code"] = couponCode;
|
|
193
253
|
|
|
194
254
|
const xHeaders = {};
|
|
195
255
|
|
|
196
|
-
|
|
256
|
+
const response = await PlatformAPIClient.execute(
|
|
197
257
|
this.config,
|
|
198
|
-
"
|
|
199
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/
|
|
258
|
+
"get",
|
|
259
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/coupon/check-validity`,
|
|
200
260
|
query_params,
|
|
201
261
|
undefined,
|
|
202
262
|
xHeaders
|
|
203
263
|
);
|
|
264
|
+
|
|
265
|
+
const {
|
|
266
|
+
error: res_error,
|
|
267
|
+
} = BillingModel.CheckValidityResponse().validate(response, {
|
|
268
|
+
abortEarly: false,
|
|
269
|
+
allowUnknown: false,
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
if (res_error) {
|
|
273
|
+
Logger({
|
|
274
|
+
level: "WARN",
|
|
275
|
+
message: "Response Validation Warnnings for checkCouponValidity",
|
|
276
|
+
});
|
|
277
|
+
Logger({ level: "WARN", message: res_error });
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
return response;
|
|
204
281
|
}
|
|
205
282
|
|
|
206
283
|
/**
|
|
207
284
|
* @param {Object} arg - Arg object.
|
|
208
|
-
* @
|
|
209
|
-
* @
|
|
285
|
+
* @param {string} arg.extensionId - Extension _id
|
|
286
|
+
* @param {CreateSubscriptionCharge} arg.body
|
|
287
|
+
* @returns {Promise<CreateSubscriptionResponse>} - Success response
|
|
288
|
+
* @summary: Create subscription charge
|
|
289
|
+
* @description: Register subscription charge for a seller of your extension.
|
|
210
290
|
*/
|
|
211
|
-
|
|
212
|
-
const { error } = BillingValidator.
|
|
213
|
-
{
|
|
291
|
+
async createSubscriptionCharge({ extensionId, body } = {}) {
|
|
292
|
+
const { error } = BillingValidator.createSubscriptionCharge().validate(
|
|
293
|
+
{
|
|
294
|
+
extensionId,
|
|
295
|
+
body,
|
|
296
|
+
},
|
|
214
297
|
{ abortEarly: false, allowUnknown: true }
|
|
215
298
|
);
|
|
216
299
|
if (error) {
|
|
@@ -218,40 +301,63 @@ class Billing {
|
|
|
218
301
|
}
|
|
219
302
|
|
|
220
303
|
// Showing warrnings if extra unknown parameters are found
|
|
221
|
-
const {
|
|
222
|
-
|
|
304
|
+
const {
|
|
305
|
+
error: warrning,
|
|
306
|
+
} = BillingValidator.createSubscriptionCharge().validate(
|
|
307
|
+
{
|
|
308
|
+
extensionId,
|
|
309
|
+
body,
|
|
310
|
+
},
|
|
223
311
|
{ abortEarly: false, allowUnknown: false }
|
|
224
312
|
);
|
|
225
313
|
if (warrning) {
|
|
226
|
-
|
|
227
|
-
|
|
314
|
+
Logger({
|
|
315
|
+
level: "WARN",
|
|
316
|
+
message: "Parameter Validation warrnings for createSubscriptionCharge",
|
|
317
|
+
});
|
|
318
|
+
Logger({ level: "WARN", message: warrning });
|
|
228
319
|
}
|
|
229
320
|
|
|
230
321
|
const query_params = {};
|
|
231
322
|
|
|
232
323
|
const xHeaders = {};
|
|
233
324
|
|
|
234
|
-
|
|
325
|
+
const response = await PlatformAPIClient.execute(
|
|
235
326
|
this.config,
|
|
236
|
-
"
|
|
237
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/
|
|
327
|
+
"post",
|
|
328
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscription`,
|
|
238
329
|
query_params,
|
|
239
|
-
|
|
330
|
+
body,
|
|
240
331
|
xHeaders
|
|
241
332
|
);
|
|
333
|
+
|
|
334
|
+
const {
|
|
335
|
+
error: res_error,
|
|
336
|
+
} = BillingModel.CreateSubscriptionResponse().validate(response, {
|
|
337
|
+
abortEarly: false,
|
|
338
|
+
allowUnknown: false,
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
if (res_error) {
|
|
342
|
+
Logger({
|
|
343
|
+
level: "WARN",
|
|
344
|
+
message: "Response Validation Warnnings for createSubscriptionCharge",
|
|
345
|
+
});
|
|
346
|
+
Logger({ level: "WARN", message: res_error });
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
return response;
|
|
242
350
|
}
|
|
243
351
|
|
|
244
352
|
/**
|
|
245
353
|
* @param {Object} arg - Arg object.
|
|
246
|
-
* @
|
|
247
|
-
* @summary: Get
|
|
248
|
-
* @description: Get
|
|
354
|
+
* @returns {Promise<SubscriptionCustomer>} - Success response
|
|
355
|
+
* @summary: Get subscription customer detail
|
|
356
|
+
* @description: Get subscription customer detail.
|
|
249
357
|
*/
|
|
250
|
-
|
|
251
|
-
const { error } = BillingValidator.
|
|
252
|
-
{
|
|
253
|
-
invoiceId,
|
|
254
|
-
},
|
|
358
|
+
async getCustomerDetail({} = {}) {
|
|
359
|
+
const { error } = BillingValidator.getCustomerDetail().validate(
|
|
360
|
+
{},
|
|
255
361
|
{ abortEarly: false, allowUnknown: true }
|
|
256
362
|
);
|
|
257
363
|
if (error) {
|
|
@@ -259,38 +365,57 @@ class Billing {
|
|
|
259
365
|
}
|
|
260
366
|
|
|
261
367
|
// Showing warrnings if extra unknown parameters are found
|
|
262
|
-
const { error: warrning } = BillingValidator.
|
|
263
|
-
{
|
|
264
|
-
invoiceId,
|
|
265
|
-
},
|
|
368
|
+
const { error: warrning } = BillingValidator.getCustomerDetail().validate(
|
|
369
|
+
{},
|
|
266
370
|
{ abortEarly: false, allowUnknown: false }
|
|
267
371
|
);
|
|
268
372
|
if (warrning) {
|
|
269
|
-
|
|
270
|
-
|
|
373
|
+
Logger({
|
|
374
|
+
level: "WARN",
|
|
375
|
+
message: "Parameter Validation warrnings for getCustomerDetail",
|
|
376
|
+
});
|
|
377
|
+
Logger({ level: "WARN", message: warrning });
|
|
271
378
|
}
|
|
272
379
|
|
|
273
380
|
const query_params = {};
|
|
274
381
|
|
|
275
382
|
const xHeaders = {};
|
|
276
383
|
|
|
277
|
-
|
|
384
|
+
const response = await PlatformAPIClient.execute(
|
|
278
385
|
this.config,
|
|
279
386
|
"get",
|
|
280
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/
|
|
387
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/customer-detail`,
|
|
281
388
|
query_params,
|
|
282
389
|
undefined,
|
|
283
390
|
xHeaders
|
|
284
391
|
);
|
|
392
|
+
|
|
393
|
+
const {
|
|
394
|
+
error: res_error,
|
|
395
|
+
} = BillingModel.SubscriptionCustomer().validate(response, {
|
|
396
|
+
abortEarly: false,
|
|
397
|
+
allowUnknown: false,
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
if (res_error) {
|
|
401
|
+
Logger({
|
|
402
|
+
level: "WARN",
|
|
403
|
+
message: "Response Validation Warnnings for getCustomerDetail",
|
|
404
|
+
});
|
|
405
|
+
Logger({ level: "WARN", message: res_error });
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
return response;
|
|
285
409
|
}
|
|
286
410
|
|
|
287
411
|
/**
|
|
288
412
|
* @param {Object} arg - Arg object.
|
|
289
|
-
* @
|
|
290
|
-
* @
|
|
413
|
+
* @returns {Promise<SubscriptionLimit>} - Success response
|
|
414
|
+
* @summary: Get subscription subscription limits
|
|
415
|
+
* @description: Get subscription subscription limits.
|
|
291
416
|
*/
|
|
292
|
-
|
|
293
|
-
const { error } = BillingValidator.
|
|
417
|
+
async getFeatureLimitConfig({} = {}) {
|
|
418
|
+
const { error } = BillingValidator.getFeatureLimitConfig().validate(
|
|
294
419
|
{},
|
|
295
420
|
{ abortEarly: false, allowUnknown: true }
|
|
296
421
|
);
|
|
@@ -299,39 +424,62 @@ class Billing {
|
|
|
299
424
|
}
|
|
300
425
|
|
|
301
426
|
// Showing warrnings if extra unknown parameters are found
|
|
302
|
-
const {
|
|
427
|
+
const {
|
|
428
|
+
error: warrning,
|
|
429
|
+
} = BillingValidator.getFeatureLimitConfig().validate(
|
|
303
430
|
{},
|
|
304
431
|
{ abortEarly: false, allowUnknown: false }
|
|
305
432
|
);
|
|
306
433
|
if (warrning) {
|
|
307
|
-
|
|
308
|
-
|
|
434
|
+
Logger({
|
|
435
|
+
level: "WARN",
|
|
436
|
+
message: "Parameter Validation warrnings for getFeatureLimitConfig",
|
|
437
|
+
});
|
|
438
|
+
Logger({ level: "WARN", message: warrning });
|
|
309
439
|
}
|
|
310
440
|
|
|
311
441
|
const query_params = {};
|
|
312
442
|
|
|
313
443
|
const xHeaders = {};
|
|
314
444
|
|
|
315
|
-
|
|
445
|
+
const response = await PlatformAPIClient.execute(
|
|
316
446
|
this.config,
|
|
317
447
|
"get",
|
|
318
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/
|
|
448
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/current-limit`,
|
|
319
449
|
query_params,
|
|
320
450
|
undefined,
|
|
321
451
|
xHeaders
|
|
322
452
|
);
|
|
453
|
+
|
|
454
|
+
const {
|
|
455
|
+
error: res_error,
|
|
456
|
+
} = BillingModel.SubscriptionLimit().validate(response, {
|
|
457
|
+
abortEarly: false,
|
|
458
|
+
allowUnknown: false,
|
|
459
|
+
});
|
|
460
|
+
|
|
461
|
+
if (res_error) {
|
|
462
|
+
Logger({
|
|
463
|
+
level: "WARN",
|
|
464
|
+
message: "Response Validation Warnnings for getFeatureLimitConfig",
|
|
465
|
+
});
|
|
466
|
+
Logger({ level: "WARN", message: res_error });
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
return response;
|
|
323
470
|
}
|
|
324
471
|
|
|
325
472
|
/**
|
|
326
473
|
* @param {Object} arg - Arg object.
|
|
327
|
-
* @param {
|
|
328
|
-
* @
|
|
329
|
-
* @
|
|
474
|
+
* @param {string} arg.invoiceId - Invoice id
|
|
475
|
+
* @returns {Promise<Invoice>} - Success response
|
|
476
|
+
* @summary: Get invoice by id
|
|
477
|
+
* @description: Get invoice by id.
|
|
330
478
|
*/
|
|
331
|
-
|
|
332
|
-
const { error } = BillingValidator.
|
|
479
|
+
async getInvoiceById({ invoiceId } = {}) {
|
|
480
|
+
const { error } = BillingValidator.getInvoiceById().validate(
|
|
333
481
|
{
|
|
334
|
-
|
|
482
|
+
invoiceId,
|
|
335
483
|
},
|
|
336
484
|
{ abortEarly: false, allowUnknown: true }
|
|
337
485
|
);
|
|
@@ -340,40 +488,57 @@ class Billing {
|
|
|
340
488
|
}
|
|
341
489
|
|
|
342
490
|
// Showing warrnings if extra unknown parameters are found
|
|
343
|
-
const {
|
|
344
|
-
error: warrning,
|
|
345
|
-
} = BillingValidator.upsertCustomerDetail().validate(
|
|
491
|
+
const { error: warrning } = BillingValidator.getInvoiceById().validate(
|
|
346
492
|
{
|
|
347
|
-
|
|
493
|
+
invoiceId,
|
|
348
494
|
},
|
|
349
495
|
{ abortEarly: false, allowUnknown: false }
|
|
350
496
|
);
|
|
351
497
|
if (warrning) {
|
|
352
|
-
|
|
353
|
-
|
|
498
|
+
Logger({
|
|
499
|
+
level: "WARN",
|
|
500
|
+
message: "Parameter Validation warrnings for getInvoiceById",
|
|
501
|
+
});
|
|
502
|
+
Logger({ level: "WARN", message: warrning });
|
|
354
503
|
}
|
|
355
504
|
|
|
356
505
|
const query_params = {};
|
|
357
506
|
|
|
358
507
|
const xHeaders = {};
|
|
359
508
|
|
|
360
|
-
|
|
509
|
+
const response = await PlatformAPIClient.execute(
|
|
361
510
|
this.config,
|
|
362
|
-
"
|
|
363
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/
|
|
511
|
+
"get",
|
|
512
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/invoice/${invoiceId}`,
|
|
364
513
|
query_params,
|
|
365
|
-
|
|
514
|
+
undefined,
|
|
366
515
|
xHeaders
|
|
367
516
|
);
|
|
517
|
+
|
|
518
|
+
const { error: res_error } = BillingModel.Invoice().validate(response, {
|
|
519
|
+
abortEarly: false,
|
|
520
|
+
allowUnknown: false,
|
|
521
|
+
});
|
|
522
|
+
|
|
523
|
+
if (res_error) {
|
|
524
|
+
Logger({
|
|
525
|
+
level: "WARN",
|
|
526
|
+
message: "Response Validation Warnnings for getInvoiceById",
|
|
527
|
+
});
|
|
528
|
+
Logger({ level: "WARN", message: res_error });
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
return response;
|
|
368
532
|
}
|
|
369
533
|
|
|
370
534
|
/**
|
|
371
535
|
* @param {Object} arg - Arg object.
|
|
372
|
-
* @
|
|
373
|
-
* @
|
|
536
|
+
* @returns {Promise<Invoices>} - Success response
|
|
537
|
+
* @summary: Get invoices
|
|
538
|
+
* @description: Get invoices.
|
|
374
539
|
*/
|
|
375
|
-
|
|
376
|
-
const { error } = BillingValidator.
|
|
540
|
+
async getInvoices({} = {}) {
|
|
541
|
+
const { error } = BillingValidator.getInvoices().validate(
|
|
377
542
|
{},
|
|
378
543
|
{ abortEarly: false, allowUnknown: true }
|
|
379
544
|
);
|
|
@@ -382,36 +547,55 @@ class Billing {
|
|
|
382
547
|
}
|
|
383
548
|
|
|
384
549
|
// Showing warrnings if extra unknown parameters are found
|
|
385
|
-
const { error: warrning } = BillingValidator.
|
|
550
|
+
const { error: warrning } = BillingValidator.getInvoices().validate(
|
|
386
551
|
{},
|
|
387
552
|
{ abortEarly: false, allowUnknown: false }
|
|
388
553
|
);
|
|
389
554
|
if (warrning) {
|
|
390
|
-
|
|
391
|
-
|
|
555
|
+
Logger({
|
|
556
|
+
level: "WARN",
|
|
557
|
+
message: "Parameter Validation warrnings for getInvoices",
|
|
558
|
+
});
|
|
559
|
+
Logger({ level: "WARN", message: warrning });
|
|
392
560
|
}
|
|
393
561
|
|
|
394
562
|
const query_params = {};
|
|
395
563
|
|
|
396
564
|
const xHeaders = {};
|
|
397
565
|
|
|
398
|
-
|
|
566
|
+
const response = await PlatformAPIClient.execute(
|
|
399
567
|
this.config,
|
|
400
568
|
"get",
|
|
401
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/
|
|
569
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/invoice/list`,
|
|
402
570
|
query_params,
|
|
403
571
|
undefined,
|
|
404
572
|
xHeaders
|
|
405
573
|
);
|
|
574
|
+
|
|
575
|
+
const { error: res_error } = BillingModel.Invoices().validate(response, {
|
|
576
|
+
abortEarly: false,
|
|
577
|
+
allowUnknown: false,
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
if (res_error) {
|
|
581
|
+
Logger({
|
|
582
|
+
level: "WARN",
|
|
583
|
+
message: "Response Validation Warnnings for getInvoices",
|
|
584
|
+
});
|
|
585
|
+
Logger({ level: "WARN", message: res_error });
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
return response;
|
|
406
589
|
}
|
|
407
590
|
|
|
408
591
|
/**
|
|
409
592
|
* @param {Object} arg - Arg object.
|
|
410
|
-
* @
|
|
411
|
-
* @
|
|
593
|
+
* @returns {Promise<SubscriptionStatus>} - Success response
|
|
594
|
+
* @summary: Get current subscription detail
|
|
595
|
+
* @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.
|
|
412
596
|
*/
|
|
413
|
-
|
|
414
|
-
const { error } = BillingValidator.
|
|
597
|
+
async getSubscription({} = {}) {
|
|
598
|
+
const { error } = BillingValidator.getSubscription().validate(
|
|
415
599
|
{},
|
|
416
600
|
{ abortEarly: false, allowUnknown: true }
|
|
417
601
|
);
|
|
@@ -420,41 +604,62 @@ class Billing {
|
|
|
420
604
|
}
|
|
421
605
|
|
|
422
606
|
// Showing warrnings if extra unknown parameters are found
|
|
423
|
-
const {
|
|
424
|
-
error: warrning,
|
|
425
|
-
} = BillingValidator.getFeatureLimitConfig().validate(
|
|
607
|
+
const { error: warrning } = BillingValidator.getSubscription().validate(
|
|
426
608
|
{},
|
|
427
609
|
{ abortEarly: false, allowUnknown: false }
|
|
428
610
|
);
|
|
429
611
|
if (warrning) {
|
|
430
|
-
|
|
431
|
-
|
|
612
|
+
Logger({
|
|
613
|
+
level: "WARN",
|
|
614
|
+
message: "Parameter Validation warrnings for getSubscription",
|
|
615
|
+
});
|
|
616
|
+
Logger({ level: "WARN", message: warrning });
|
|
432
617
|
}
|
|
433
618
|
|
|
434
619
|
const query_params = {};
|
|
435
620
|
|
|
436
621
|
const xHeaders = {};
|
|
437
622
|
|
|
438
|
-
|
|
623
|
+
const response = await PlatformAPIClient.execute(
|
|
439
624
|
this.config,
|
|
440
625
|
"get",
|
|
441
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/current
|
|
626
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/current`,
|
|
442
627
|
query_params,
|
|
443
628
|
undefined,
|
|
444
629
|
xHeaders
|
|
445
630
|
);
|
|
631
|
+
|
|
632
|
+
const {
|
|
633
|
+
error: res_error,
|
|
634
|
+
} = BillingModel.SubscriptionStatus().validate(response, {
|
|
635
|
+
abortEarly: false,
|
|
636
|
+
allowUnknown: false,
|
|
637
|
+
});
|
|
638
|
+
|
|
639
|
+
if (res_error) {
|
|
640
|
+
Logger({
|
|
641
|
+
level: "WARN",
|
|
642
|
+
message: "Response Validation Warnnings for getSubscription",
|
|
643
|
+
});
|
|
644
|
+
Logger({ level: "WARN", message: res_error });
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
return response;
|
|
446
648
|
}
|
|
447
649
|
|
|
448
650
|
/**
|
|
449
651
|
* @param {Object} arg - Arg object.
|
|
450
|
-
* @param {
|
|
451
|
-
* @
|
|
452
|
-
* @
|
|
652
|
+
* @param {string} arg.extensionId - Extension _id
|
|
653
|
+
* @param {string} arg.subscriptionId - Subscription charge _id
|
|
654
|
+
* @returns {Promise<EntitySubscription>} - Success response
|
|
655
|
+
* @summary: Get subscription charge details
|
|
656
|
+
* @description: Get created subscription charge details
|
|
453
657
|
*/
|
|
454
|
-
|
|
455
|
-
const { error } = BillingValidator.
|
|
658
|
+
async getSubscriptionCharge({ extensionId, subscriptionId } = {}) {
|
|
659
|
+
const { error } = BillingValidator.getSubscriptionCharge().validate(
|
|
456
660
|
{
|
|
457
|
-
|
|
661
|
+
extensionId,
|
|
662
|
+
subscriptionId,
|
|
458
663
|
},
|
|
459
664
|
{ abortEarly: false, allowUnknown: true }
|
|
460
665
|
);
|
|
@@ -465,41 +670,61 @@ class Billing {
|
|
|
465
670
|
// Showing warrnings if extra unknown parameters are found
|
|
466
671
|
const {
|
|
467
672
|
error: warrning,
|
|
468
|
-
} = BillingValidator.
|
|
673
|
+
} = BillingValidator.getSubscriptionCharge().validate(
|
|
469
674
|
{
|
|
470
|
-
|
|
675
|
+
extensionId,
|
|
676
|
+
subscriptionId,
|
|
471
677
|
},
|
|
472
678
|
{ abortEarly: false, allowUnknown: false }
|
|
473
679
|
);
|
|
474
680
|
if (warrning) {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
681
|
+
Logger({
|
|
682
|
+
level: "WARN",
|
|
683
|
+
message: "Parameter Validation warrnings for getSubscriptionCharge",
|
|
684
|
+
});
|
|
685
|
+
Logger({ level: "WARN", message: warrning });
|
|
479
686
|
}
|
|
480
687
|
|
|
481
688
|
const query_params = {};
|
|
482
689
|
|
|
483
690
|
const xHeaders = {};
|
|
484
691
|
|
|
485
|
-
|
|
692
|
+
const response = await PlatformAPIClient.execute(
|
|
486
693
|
this.config,
|
|
487
|
-
"
|
|
488
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription
|
|
694
|
+
"get",
|
|
695
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscription/${subscriptionId}`,
|
|
489
696
|
query_params,
|
|
490
|
-
|
|
697
|
+
undefined,
|
|
491
698
|
xHeaders
|
|
492
699
|
);
|
|
700
|
+
|
|
701
|
+
const {
|
|
702
|
+
error: res_error,
|
|
703
|
+
} = BillingModel.EntitySubscription().validate(response, {
|
|
704
|
+
abortEarly: false,
|
|
705
|
+
allowUnknown: false,
|
|
706
|
+
});
|
|
707
|
+
|
|
708
|
+
if (res_error) {
|
|
709
|
+
Logger({
|
|
710
|
+
level: "WARN",
|
|
711
|
+
message: "Response Validation Warnnings for getSubscriptionCharge",
|
|
712
|
+
});
|
|
713
|
+
Logger({ level: "WARN", message: res_error });
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
return response;
|
|
493
717
|
}
|
|
494
718
|
|
|
495
719
|
/**
|
|
496
720
|
* @param {Object} arg - Arg object.
|
|
497
|
-
* @param {
|
|
498
|
-
* @
|
|
499
|
-
* @
|
|
721
|
+
* @param {SubscriptionCustomerCreate} arg.body
|
|
722
|
+
* @returns {Promise<SubscriptionCustomer>} - Success response
|
|
723
|
+
* @summary: Upsert subscription customer detail
|
|
724
|
+
* @description: Upsert subscription customer detail.
|
|
500
725
|
*/
|
|
501
|
-
|
|
502
|
-
const { error } = BillingValidator.
|
|
726
|
+
async upsertCustomerDetail({ body } = {}) {
|
|
727
|
+
const { error } = BillingValidator.upsertCustomerDetail().validate(
|
|
503
728
|
{
|
|
504
729
|
body,
|
|
505
730
|
},
|
|
@@ -512,29 +737,49 @@ class Billing {
|
|
|
512
737
|
// Showing warrnings if extra unknown parameters are found
|
|
513
738
|
const {
|
|
514
739
|
error: warrning,
|
|
515
|
-
} = BillingValidator.
|
|
740
|
+
} = BillingValidator.upsertCustomerDetail().validate(
|
|
516
741
|
{
|
|
517
742
|
body,
|
|
518
743
|
},
|
|
519
744
|
{ abortEarly: false, allowUnknown: false }
|
|
520
745
|
);
|
|
521
746
|
if (warrning) {
|
|
522
|
-
|
|
523
|
-
|
|
747
|
+
Logger({
|
|
748
|
+
level: "WARN",
|
|
749
|
+
message: "Parameter Validation warrnings for upsertCustomerDetail",
|
|
750
|
+
});
|
|
751
|
+
Logger({ level: "WARN", message: warrning });
|
|
524
752
|
}
|
|
525
753
|
|
|
526
754
|
const query_params = {};
|
|
527
755
|
|
|
528
756
|
const xHeaders = {};
|
|
529
757
|
|
|
530
|
-
|
|
758
|
+
const response = await PlatformAPIClient.execute(
|
|
531
759
|
this.config,
|
|
532
760
|
"post",
|
|
533
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/
|
|
761
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/customer-detail`,
|
|
534
762
|
query_params,
|
|
535
763
|
body,
|
|
536
764
|
xHeaders
|
|
537
765
|
);
|
|
766
|
+
|
|
767
|
+
const {
|
|
768
|
+
error: res_error,
|
|
769
|
+
} = BillingModel.SubscriptionCustomer().validate(response, {
|
|
770
|
+
abortEarly: false,
|
|
771
|
+
allowUnknown: false,
|
|
772
|
+
});
|
|
773
|
+
|
|
774
|
+
if (res_error) {
|
|
775
|
+
Logger({
|
|
776
|
+
level: "WARN",
|
|
777
|
+
message: "Response Validation Warnnings for upsertCustomerDetail",
|
|
778
|
+
});
|
|
779
|
+
Logger({ level: "WARN", message: res_error });
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
return response;
|
|
538
783
|
}
|
|
539
784
|
}
|
|
540
785
|
|