@gofynd/fdk-client-javascript 1.0.2 → 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 +557 -1279
- 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 +14453 -17192
- 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 +3438 -4172
- 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 +3400 -5361
- 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/Cart/CartApplicationClient.d.ts +243 -243
- package/sdk/application/Cart/CartApplicationClient.js +567 -567
- 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 +1036 -1036
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
- package/sdk/application/Catalog/CatalogApplicationModel.js +677 -1243
- 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 +38 -38
- 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 +26 -26
- 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 +330 -330
- 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 +191 -191
- package/sdk/application/Content/ContentApplicationModel.d.ts +76 -76
- package/sdk/application/Content/ContentApplicationModel.js +467 -884
- 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 +59 -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 +100 -100
- 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 +110 -43
- 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 +85 -85
- package/sdk/application/Order/OrderApplicationClient.js +232 -232
- package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
- package/sdk/application/Order/OrderApplicationModel.js +352 -656
- 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 +739 -739
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
- package/sdk/application/Payment/PaymentApplicationModel.js +570 -1038
- 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 +617 -617
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +64 -63
- package/sdk/application/PosCart/PosCartApplicationModel.js +475 -871
- 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 +112 -112
- 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 +84 -84
- 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 +31 -31
- 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 +581 -581
- 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 +51 -51
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +179 -179
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +20 -20
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +10 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +41 -41
- 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 +60 -60
- package/sdk/platform/Billing/BillingPlatformClient.js +181 -181
- 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 +168 -168
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +553 -553
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +11 -11
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +63 -63
- package/sdk/platform/Cart/CartPlatformModel.d.ts +84 -83
- package/sdk/platform/Cart/CartPlatformModel.js +671 -1205
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +632 -632
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1525 -1525
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +174 -174
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +682 -682
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1557 -1557
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +291 -291
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2127 -3904
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -66
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +229 -229
- package/sdk/platform/Common/CommonPlatformClient.d.ts +12 -12
- package/sdk/platform/Common/CommonPlatformClient.js +41 -41
- 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 +326 -326
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +943 -943
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +87 -87
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
- package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +55 -55
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +212 -212
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +27 -27
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +279 -542
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +24 -24
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +163 -153
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +615 -552
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +69 -63
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +125 -125
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +342 -342
- 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 +534 -534
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1324 -1324
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +50 -50
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +156 -156
- package/sdk/platform/Content/ContentPlatformModel.d.ts +78 -78
- package/sdk/platform/Content/ContentPlatformModel.js +484 -907
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +65 -65
- package/sdk/platform/Discount/DiscountPlatformClient.js +216 -216
- 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 +24 -24
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +58 -58
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +8 -8
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +52 -52
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +123 -123
- 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 +63 -63
- package/sdk/platform/Inventory/InventoryPlatformClient.js +228 -228
- 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 +73 -73
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +200 -200
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +28 -28
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +80 -80
- package/sdk/platform/Lead/LeadPlatformClient.js +212 -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/Order/OrderPlatformApplicationClient.d.ts +10 -10
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +65 -65
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -6
- package/sdk/platform/Order/OrderPlatformClient.d.ts +357 -357
- package/sdk/platform/Order/OrderPlatformClient.js +1035 -1035
- package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -196
- package/sdk/platform/Order/OrderPlatformModel.js +1574 -2861
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
- package/sdk/platform/Order/OrderPlatformValidator.js +160 -160
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
- package/sdk/platform/Partner/PartnerPlatformModel.js +10 -26
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +57 -57
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +167 -167
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +23 -23
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +42 -42
- package/sdk/platform/Payment/PaymentPlatformClient.js +153 -153
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
- package/sdk/platform/Payment/PaymentPlatformModel.js +222 -410
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
- package/sdk/platform/Payment/PaymentPlatformValidator.js +21 -21
- package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10325
- package/sdk/platform/PlatformApplicationClient.js +1584 -13899
- package/sdk/platform/PlatformClient.d.ts +7965 -7885
- package/sdk/platform/PlatformClient.js +8672 -10105
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +83 -83
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +275 -275
- 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 +10 -10
- package/sdk/platform/Share/SharePlatformApplicationClient.js +59 -59
- 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 +132 -132
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +310 -310
- 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 +136 -69
- package/sdk/platform/User/UserPlatformApplicationClient.js +505 -166
- 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 +31 -31
- package/sdk/platform/Webhook/WebhookPlatformClient.js +88 -88
- 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 +38 -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 +113 -113
- 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/WebhookPublicModel.d.ts +7 -7
- package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
- package/tests/application/catalog.spec.js +7 -0
|
@@ -12,17 +12,15 @@ class Billing {
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @param {Object} arg - Arg object.
|
|
15
|
-
* @param {
|
|
16
|
-
* @
|
|
17
|
-
* @
|
|
18
|
-
* @
|
|
19
|
-
* @description: Check coupon validity.
|
|
15
|
+
* @param {SubscriptionActivateReq} arg.body
|
|
16
|
+
* @returns {Promise<SubscriptionActivateRes>} - Success response
|
|
17
|
+
* @summary: Activate subscription
|
|
18
|
+
* @description: It will activate subscription plan for customer
|
|
20
19
|
*/
|
|
21
|
-
async
|
|
22
|
-
const { error } = BillingValidator.
|
|
20
|
+
async activateSubscriptionPlan({ body } = {}) {
|
|
21
|
+
const { error } = BillingValidator.activateSubscriptionPlan().validate(
|
|
23
22
|
{
|
|
24
|
-
|
|
25
|
-
couponCode,
|
|
23
|
+
body,
|
|
26
24
|
},
|
|
27
25
|
{ abortEarly: false, allowUnknown: true }
|
|
28
26
|
);
|
|
@@ -31,39 +29,38 @@ class Billing {
|
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
// Showing warrnings if extra unknown parameters are found
|
|
34
|
-
const {
|
|
32
|
+
const {
|
|
33
|
+
error: warrning,
|
|
34
|
+
} = BillingValidator.activateSubscriptionPlan().validate(
|
|
35
35
|
{
|
|
36
|
-
|
|
37
|
-
couponCode,
|
|
36
|
+
body,
|
|
38
37
|
},
|
|
39
38
|
{ abortEarly: false, allowUnknown: false }
|
|
40
39
|
);
|
|
41
40
|
if (warrning) {
|
|
42
41
|
Logger({
|
|
43
42
|
level: "WARN",
|
|
44
|
-
message: "Parameter Validation warrnings for
|
|
43
|
+
message: "Parameter Validation warrnings for activateSubscriptionPlan",
|
|
45
44
|
});
|
|
46
45
|
Logger({ level: "WARN", message: warrning });
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
const query_params = {};
|
|
50
|
-
query_params["plan"] = plan;
|
|
51
|
-
query_params["coupon_code"] = couponCode;
|
|
52
49
|
|
|
53
50
|
const xHeaders = {};
|
|
54
51
|
|
|
55
52
|
const response = await PlatformAPIClient.execute(
|
|
56
53
|
this.config,
|
|
57
|
-
"
|
|
58
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/
|
|
54
|
+
"post",
|
|
55
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/activate`,
|
|
59
56
|
query_params,
|
|
60
|
-
|
|
57
|
+
body,
|
|
61
58
|
xHeaders
|
|
62
59
|
);
|
|
63
60
|
|
|
64
61
|
const {
|
|
65
62
|
error: res_error,
|
|
66
|
-
} = BillingModel.
|
|
63
|
+
} = BillingModel.SubscriptionActivateRes().validate(response, {
|
|
67
64
|
abortEarly: false,
|
|
68
65
|
allowUnknown: false,
|
|
69
66
|
});
|
|
@@ -71,7 +68,7 @@ class Billing {
|
|
|
71
68
|
if (res_error) {
|
|
72
69
|
Logger({
|
|
73
70
|
level: "WARN",
|
|
74
|
-
message: "Response Validation Warnnings for
|
|
71
|
+
message: "Response Validation Warnnings for activateSubscriptionPlan",
|
|
75
72
|
});
|
|
76
73
|
Logger({ level: "WARN", message: res_error });
|
|
77
74
|
}
|
|
@@ -82,16 +79,16 @@ class Billing {
|
|
|
82
79
|
/**
|
|
83
80
|
* @param {Object} arg - Arg object.
|
|
84
81
|
* @param {string} arg.extensionId - Extension _id
|
|
85
|
-
* @param {
|
|
86
|
-
* @returns {Promise<
|
|
87
|
-
* @summary:
|
|
88
|
-
* @description:
|
|
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.
|
|
89
86
|
*/
|
|
90
|
-
async
|
|
91
|
-
const { error } = BillingValidator.
|
|
87
|
+
async cancelSubscriptionCharge({ extensionId, subscriptionId } = {}) {
|
|
88
|
+
const { error } = BillingValidator.cancelSubscriptionCharge().validate(
|
|
92
89
|
{
|
|
93
90
|
extensionId,
|
|
94
|
-
|
|
91
|
+
subscriptionId,
|
|
95
92
|
},
|
|
96
93
|
{ abortEarly: false, allowUnknown: true }
|
|
97
94
|
);
|
|
@@ -102,17 +99,17 @@ class Billing {
|
|
|
102
99
|
// Showing warrnings if extra unknown parameters are found
|
|
103
100
|
const {
|
|
104
101
|
error: warrning,
|
|
105
|
-
} = BillingValidator.
|
|
102
|
+
} = BillingValidator.cancelSubscriptionCharge().validate(
|
|
106
103
|
{
|
|
107
104
|
extensionId,
|
|
108
|
-
|
|
105
|
+
subscriptionId,
|
|
109
106
|
},
|
|
110
107
|
{ abortEarly: false, allowUnknown: false }
|
|
111
108
|
);
|
|
112
109
|
if (warrning) {
|
|
113
110
|
Logger({
|
|
114
111
|
level: "WARN",
|
|
115
|
-
message: "Parameter Validation warrnings for
|
|
112
|
+
message: "Parameter Validation warrnings for cancelSubscriptionCharge",
|
|
116
113
|
});
|
|
117
114
|
Logger({ level: "WARN", message: warrning });
|
|
118
115
|
}
|
|
@@ -124,15 +121,15 @@ class Billing {
|
|
|
124
121
|
const response = await PlatformAPIClient.execute(
|
|
125
122
|
this.config,
|
|
126
123
|
"post",
|
|
127
|
-
`/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`,
|
|
128
125
|
query_params,
|
|
129
|
-
|
|
126
|
+
undefined,
|
|
130
127
|
xHeaders
|
|
131
128
|
);
|
|
132
129
|
|
|
133
130
|
const {
|
|
134
131
|
error: res_error,
|
|
135
|
-
} = BillingModel.
|
|
132
|
+
} = BillingModel.EntitySubscription().validate(response, {
|
|
136
133
|
abortEarly: false,
|
|
137
134
|
allowUnknown: false,
|
|
138
135
|
});
|
|
@@ -140,7 +137,7 @@ class Billing {
|
|
|
140
137
|
if (res_error) {
|
|
141
138
|
Logger({
|
|
142
139
|
level: "WARN",
|
|
143
|
-
message: "Response Validation Warnnings for
|
|
140
|
+
message: "Response Validation Warnnings for cancelSubscriptionCharge",
|
|
144
141
|
});
|
|
145
142
|
Logger({ level: "WARN", message: res_error });
|
|
146
143
|
}
|
|
@@ -150,17 +147,15 @@ class Billing {
|
|
|
150
147
|
|
|
151
148
|
/**
|
|
152
149
|
* @param {Object} arg - Arg object.
|
|
153
|
-
* @param {
|
|
154
|
-
* @
|
|
155
|
-
* @
|
|
156
|
-
* @
|
|
157
|
-
* @description: Get created subscription charge details
|
|
150
|
+
* @param {CancelSubscriptionReq} arg.body
|
|
151
|
+
* @returns {Promise<CancelSubscriptionRes>} - Success response
|
|
152
|
+
* @summary: Cancel subscription
|
|
153
|
+
* @description: It will cancel current active subscription.
|
|
158
154
|
*/
|
|
159
|
-
async
|
|
160
|
-
const { error } = BillingValidator.
|
|
155
|
+
async cancelSubscriptionPlan({ body } = {}) {
|
|
156
|
+
const { error } = BillingValidator.cancelSubscriptionPlan().validate(
|
|
161
157
|
{
|
|
162
|
-
|
|
163
|
-
subscriptionId,
|
|
158
|
+
body,
|
|
164
159
|
},
|
|
165
160
|
{ abortEarly: false, allowUnknown: true }
|
|
166
161
|
);
|
|
@@ -171,17 +166,16 @@ class Billing {
|
|
|
171
166
|
// Showing warrnings if extra unknown parameters are found
|
|
172
167
|
const {
|
|
173
168
|
error: warrning,
|
|
174
|
-
} = BillingValidator.
|
|
169
|
+
} = BillingValidator.cancelSubscriptionPlan().validate(
|
|
175
170
|
{
|
|
176
|
-
|
|
177
|
-
subscriptionId,
|
|
171
|
+
body,
|
|
178
172
|
},
|
|
179
173
|
{ abortEarly: false, allowUnknown: false }
|
|
180
174
|
);
|
|
181
175
|
if (warrning) {
|
|
182
176
|
Logger({
|
|
183
177
|
level: "WARN",
|
|
184
|
-
message: "Parameter Validation warrnings for
|
|
178
|
+
message: "Parameter Validation warrnings for cancelSubscriptionPlan",
|
|
185
179
|
});
|
|
186
180
|
Logger({ level: "WARN", message: warrning });
|
|
187
181
|
}
|
|
@@ -192,16 +186,16 @@ class Billing {
|
|
|
192
186
|
|
|
193
187
|
const response = await PlatformAPIClient.execute(
|
|
194
188
|
this.config,
|
|
195
|
-
"
|
|
196
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/
|
|
189
|
+
"post",
|
|
190
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/cancel`,
|
|
197
191
|
query_params,
|
|
198
|
-
|
|
192
|
+
body,
|
|
199
193
|
xHeaders
|
|
200
194
|
);
|
|
201
195
|
|
|
202
196
|
const {
|
|
203
197
|
error: res_error,
|
|
204
|
-
} = BillingModel.
|
|
198
|
+
} = BillingModel.CancelSubscriptionRes().validate(response, {
|
|
205
199
|
abortEarly: false,
|
|
206
200
|
allowUnknown: false,
|
|
207
201
|
});
|
|
@@ -209,7 +203,7 @@ class Billing {
|
|
|
209
203
|
if (res_error) {
|
|
210
204
|
Logger({
|
|
211
205
|
level: "WARN",
|
|
212
|
-
message: "Response Validation Warnnings for
|
|
206
|
+
message: "Response Validation Warnnings for cancelSubscriptionPlan",
|
|
213
207
|
});
|
|
214
208
|
Logger({ level: "WARN", message: res_error });
|
|
215
209
|
}
|
|
@@ -219,17 +213,17 @@ class Billing {
|
|
|
219
213
|
|
|
220
214
|
/**
|
|
221
215
|
* @param {Object} arg - Arg object.
|
|
222
|
-
* @param {string} arg.
|
|
223
|
-
* @param {string} arg.
|
|
224
|
-
* @returns {Promise<
|
|
225
|
-
* @summary:
|
|
226
|
-
* @description:
|
|
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.
|
|
227
221
|
*/
|
|
228
|
-
async
|
|
229
|
-
const { error } = BillingValidator.
|
|
222
|
+
async checkCouponValidity({ plan, couponCode } = {}) {
|
|
223
|
+
const { error } = BillingValidator.checkCouponValidity().validate(
|
|
230
224
|
{
|
|
231
|
-
|
|
232
|
-
|
|
225
|
+
plan,
|
|
226
|
+
couponCode,
|
|
233
227
|
},
|
|
234
228
|
{ abortEarly: false, allowUnknown: true }
|
|
235
229
|
);
|
|
@@ -238,31 +232,31 @@ class Billing {
|
|
|
238
232
|
}
|
|
239
233
|
|
|
240
234
|
// Showing warrnings if extra unknown parameters are found
|
|
241
|
-
const {
|
|
242
|
-
error: warrning,
|
|
243
|
-
} = BillingValidator.cancelSubscriptionCharge().validate(
|
|
235
|
+
const { error: warrning } = BillingValidator.checkCouponValidity().validate(
|
|
244
236
|
{
|
|
245
|
-
|
|
246
|
-
|
|
237
|
+
plan,
|
|
238
|
+
couponCode,
|
|
247
239
|
},
|
|
248
240
|
{ abortEarly: false, allowUnknown: false }
|
|
249
241
|
);
|
|
250
242
|
if (warrning) {
|
|
251
243
|
Logger({
|
|
252
244
|
level: "WARN",
|
|
253
|
-
message: "Parameter Validation warrnings for
|
|
245
|
+
message: "Parameter Validation warrnings for checkCouponValidity",
|
|
254
246
|
});
|
|
255
247
|
Logger({ level: "WARN", message: warrning });
|
|
256
248
|
}
|
|
257
249
|
|
|
258
250
|
const query_params = {};
|
|
251
|
+
query_params["plan"] = plan;
|
|
252
|
+
query_params["coupon_code"] = couponCode;
|
|
259
253
|
|
|
260
254
|
const xHeaders = {};
|
|
261
255
|
|
|
262
256
|
const response = await PlatformAPIClient.execute(
|
|
263
257
|
this.config,
|
|
264
|
-
"
|
|
265
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/
|
|
258
|
+
"get",
|
|
259
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/coupon/check-validity`,
|
|
266
260
|
query_params,
|
|
267
261
|
undefined,
|
|
268
262
|
xHeaders
|
|
@@ -270,7 +264,7 @@ class Billing {
|
|
|
270
264
|
|
|
271
265
|
const {
|
|
272
266
|
error: res_error,
|
|
273
|
-
} = BillingModel.
|
|
267
|
+
} = BillingModel.CheckValidityResponse().validate(response, {
|
|
274
268
|
abortEarly: false,
|
|
275
269
|
allowUnknown: false,
|
|
276
270
|
});
|
|
@@ -278,7 +272,7 @@ class Billing {
|
|
|
278
272
|
if (res_error) {
|
|
279
273
|
Logger({
|
|
280
274
|
level: "WARN",
|
|
281
|
-
message: "Response Validation Warnnings for
|
|
275
|
+
message: "Response Validation Warnnings for checkCouponValidity",
|
|
282
276
|
});
|
|
283
277
|
Logger({ level: "WARN", message: res_error });
|
|
284
278
|
}
|
|
@@ -288,13 +282,18 @@ class Billing {
|
|
|
288
282
|
|
|
289
283
|
/**
|
|
290
284
|
* @param {Object} arg - Arg object.
|
|
291
|
-
* @
|
|
292
|
-
* @
|
|
293
|
-
* @
|
|
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.
|
|
294
290
|
*/
|
|
295
|
-
async
|
|
296
|
-
const { error } = BillingValidator.
|
|
297
|
-
{
|
|
291
|
+
async createSubscriptionCharge({ extensionId, body } = {}) {
|
|
292
|
+
const { error } = BillingValidator.createSubscriptionCharge().validate(
|
|
293
|
+
{
|
|
294
|
+
extensionId,
|
|
295
|
+
body,
|
|
296
|
+
},
|
|
298
297
|
{ abortEarly: false, allowUnknown: true }
|
|
299
298
|
);
|
|
300
299
|
if (error) {
|
|
@@ -302,14 +301,19 @@ class Billing {
|
|
|
302
301
|
}
|
|
303
302
|
|
|
304
303
|
// Showing warrnings if extra unknown parameters are found
|
|
305
|
-
const {
|
|
306
|
-
|
|
304
|
+
const {
|
|
305
|
+
error: warrning,
|
|
306
|
+
} = BillingValidator.createSubscriptionCharge().validate(
|
|
307
|
+
{
|
|
308
|
+
extensionId,
|
|
309
|
+
body,
|
|
310
|
+
},
|
|
307
311
|
{ abortEarly: false, allowUnknown: false }
|
|
308
312
|
);
|
|
309
313
|
if (warrning) {
|
|
310
314
|
Logger({
|
|
311
315
|
level: "WARN",
|
|
312
|
-
message: "Parameter Validation warrnings for
|
|
316
|
+
message: "Parameter Validation warrnings for createSubscriptionCharge",
|
|
313
317
|
});
|
|
314
318
|
Logger({ level: "WARN", message: warrning });
|
|
315
319
|
}
|
|
@@ -320,14 +324,16 @@ class Billing {
|
|
|
320
324
|
|
|
321
325
|
const response = await PlatformAPIClient.execute(
|
|
322
326
|
this.config,
|
|
323
|
-
"
|
|
324
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/
|
|
327
|
+
"post",
|
|
328
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscription`,
|
|
325
329
|
query_params,
|
|
326
|
-
|
|
330
|
+
body,
|
|
327
331
|
xHeaders
|
|
328
332
|
);
|
|
329
333
|
|
|
330
|
-
const {
|
|
334
|
+
const {
|
|
335
|
+
error: res_error,
|
|
336
|
+
} = BillingModel.CreateSubscriptionResponse().validate(response, {
|
|
331
337
|
abortEarly: false,
|
|
332
338
|
allowUnknown: false,
|
|
333
339
|
});
|
|
@@ -335,7 +341,7 @@ class Billing {
|
|
|
335
341
|
if (res_error) {
|
|
336
342
|
Logger({
|
|
337
343
|
level: "WARN",
|
|
338
|
-
message: "Response Validation Warnnings for
|
|
344
|
+
message: "Response Validation Warnnings for createSubscriptionCharge",
|
|
339
345
|
});
|
|
340
346
|
Logger({ level: "WARN", message: res_error });
|
|
341
347
|
}
|
|
@@ -345,16 +351,13 @@ class Billing {
|
|
|
345
351
|
|
|
346
352
|
/**
|
|
347
353
|
* @param {Object} arg - Arg object.
|
|
348
|
-
* @
|
|
349
|
-
* @
|
|
350
|
-
* @
|
|
351
|
-
* @description: Get invoice by id.
|
|
354
|
+
* @returns {Promise<SubscriptionCustomer>} - Success response
|
|
355
|
+
* @summary: Get subscription customer detail
|
|
356
|
+
* @description: Get subscription customer detail.
|
|
352
357
|
*/
|
|
353
|
-
async
|
|
354
|
-
const { error } = BillingValidator.
|
|
355
|
-
{
|
|
356
|
-
invoiceId,
|
|
357
|
-
},
|
|
358
|
+
async getCustomerDetail({} = {}) {
|
|
359
|
+
const { error } = BillingValidator.getCustomerDetail().validate(
|
|
360
|
+
{},
|
|
358
361
|
{ abortEarly: false, allowUnknown: true }
|
|
359
362
|
);
|
|
360
363
|
if (error) {
|
|
@@ -362,16 +365,14 @@ class Billing {
|
|
|
362
365
|
}
|
|
363
366
|
|
|
364
367
|
// Showing warrnings if extra unknown parameters are found
|
|
365
|
-
const { error: warrning } = BillingValidator.
|
|
366
|
-
{
|
|
367
|
-
invoiceId,
|
|
368
|
-
},
|
|
368
|
+
const { error: warrning } = BillingValidator.getCustomerDetail().validate(
|
|
369
|
+
{},
|
|
369
370
|
{ abortEarly: false, allowUnknown: false }
|
|
370
371
|
);
|
|
371
372
|
if (warrning) {
|
|
372
373
|
Logger({
|
|
373
374
|
level: "WARN",
|
|
374
|
-
message: "Parameter Validation warrnings for
|
|
375
|
+
message: "Parameter Validation warrnings for getCustomerDetail",
|
|
375
376
|
});
|
|
376
377
|
Logger({ level: "WARN", message: warrning });
|
|
377
378
|
}
|
|
@@ -383,13 +384,15 @@ class Billing {
|
|
|
383
384
|
const response = await PlatformAPIClient.execute(
|
|
384
385
|
this.config,
|
|
385
386
|
"get",
|
|
386
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/
|
|
387
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/customer-detail`,
|
|
387
388
|
query_params,
|
|
388
389
|
undefined,
|
|
389
390
|
xHeaders
|
|
390
391
|
);
|
|
391
392
|
|
|
392
|
-
const {
|
|
393
|
+
const {
|
|
394
|
+
error: res_error,
|
|
395
|
+
} = BillingModel.SubscriptionCustomer().validate(response, {
|
|
393
396
|
abortEarly: false,
|
|
394
397
|
allowUnknown: false,
|
|
395
398
|
});
|
|
@@ -397,7 +400,7 @@ class Billing {
|
|
|
397
400
|
if (res_error) {
|
|
398
401
|
Logger({
|
|
399
402
|
level: "WARN",
|
|
400
|
-
message: "Response Validation Warnnings for
|
|
403
|
+
message: "Response Validation Warnnings for getCustomerDetail",
|
|
401
404
|
});
|
|
402
405
|
Logger({ level: "WARN", message: res_error });
|
|
403
406
|
}
|
|
@@ -407,12 +410,12 @@ class Billing {
|
|
|
407
410
|
|
|
408
411
|
/**
|
|
409
412
|
* @param {Object} arg - Arg object.
|
|
410
|
-
* @returns {Promise<
|
|
411
|
-
* @summary: Get subscription
|
|
412
|
-
* @description: Get subscription
|
|
413
|
+
* @returns {Promise<SubscriptionLimit>} - Success response
|
|
414
|
+
* @summary: Get subscription subscription limits
|
|
415
|
+
* @description: Get subscription subscription limits.
|
|
413
416
|
*/
|
|
414
|
-
async
|
|
415
|
-
const { error } = BillingValidator.
|
|
417
|
+
async getFeatureLimitConfig({} = {}) {
|
|
418
|
+
const { error } = BillingValidator.getFeatureLimitConfig().validate(
|
|
416
419
|
{},
|
|
417
420
|
{ abortEarly: false, allowUnknown: true }
|
|
418
421
|
);
|
|
@@ -421,14 +424,16 @@ class Billing {
|
|
|
421
424
|
}
|
|
422
425
|
|
|
423
426
|
// Showing warrnings if extra unknown parameters are found
|
|
424
|
-
const {
|
|
427
|
+
const {
|
|
428
|
+
error: warrning,
|
|
429
|
+
} = BillingValidator.getFeatureLimitConfig().validate(
|
|
425
430
|
{},
|
|
426
431
|
{ abortEarly: false, allowUnknown: false }
|
|
427
432
|
);
|
|
428
433
|
if (warrning) {
|
|
429
434
|
Logger({
|
|
430
435
|
level: "WARN",
|
|
431
|
-
message: "Parameter Validation warrnings for
|
|
436
|
+
message: "Parameter Validation warrnings for getFeatureLimitConfig",
|
|
432
437
|
});
|
|
433
438
|
Logger({ level: "WARN", message: warrning });
|
|
434
439
|
}
|
|
@@ -440,7 +445,7 @@ class Billing {
|
|
|
440
445
|
const response = await PlatformAPIClient.execute(
|
|
441
446
|
this.config,
|
|
442
447
|
"get",
|
|
443
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/
|
|
448
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/current-limit`,
|
|
444
449
|
query_params,
|
|
445
450
|
undefined,
|
|
446
451
|
xHeaders
|
|
@@ -448,7 +453,7 @@ class Billing {
|
|
|
448
453
|
|
|
449
454
|
const {
|
|
450
455
|
error: res_error,
|
|
451
|
-
} = BillingModel.
|
|
456
|
+
} = BillingModel.SubscriptionLimit().validate(response, {
|
|
452
457
|
abortEarly: false,
|
|
453
458
|
allowUnknown: false,
|
|
454
459
|
});
|
|
@@ -456,7 +461,7 @@ class Billing {
|
|
|
456
461
|
if (res_error) {
|
|
457
462
|
Logger({
|
|
458
463
|
level: "WARN",
|
|
459
|
-
message: "Response Validation Warnnings for
|
|
464
|
+
message: "Response Validation Warnnings for getFeatureLimitConfig",
|
|
460
465
|
});
|
|
461
466
|
Logger({ level: "WARN", message: res_error });
|
|
462
467
|
}
|
|
@@ -466,15 +471,15 @@ class Billing {
|
|
|
466
471
|
|
|
467
472
|
/**
|
|
468
473
|
* @param {Object} arg - Arg object.
|
|
469
|
-
* @param {
|
|
470
|
-
* @returns {Promise<
|
|
471
|
-
* @summary:
|
|
472
|
-
* @description:
|
|
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.
|
|
473
478
|
*/
|
|
474
|
-
async
|
|
475
|
-
const { error } = BillingValidator.
|
|
479
|
+
async getInvoiceById({ invoiceId } = {}) {
|
|
480
|
+
const { error } = BillingValidator.getInvoiceById().validate(
|
|
476
481
|
{
|
|
477
|
-
|
|
482
|
+
invoiceId,
|
|
478
483
|
},
|
|
479
484
|
{ abortEarly: false, allowUnknown: true }
|
|
480
485
|
);
|
|
@@ -483,18 +488,16 @@ class Billing {
|
|
|
483
488
|
}
|
|
484
489
|
|
|
485
490
|
// Showing warrnings if extra unknown parameters are found
|
|
486
|
-
const {
|
|
487
|
-
error: warrning,
|
|
488
|
-
} = BillingValidator.upsertCustomerDetail().validate(
|
|
491
|
+
const { error: warrning } = BillingValidator.getInvoiceById().validate(
|
|
489
492
|
{
|
|
490
|
-
|
|
493
|
+
invoiceId,
|
|
491
494
|
},
|
|
492
495
|
{ abortEarly: false, allowUnknown: false }
|
|
493
496
|
);
|
|
494
497
|
if (warrning) {
|
|
495
498
|
Logger({
|
|
496
499
|
level: "WARN",
|
|
497
|
-
message: "Parameter Validation warrnings for
|
|
500
|
+
message: "Parameter Validation warrnings for getInvoiceById",
|
|
498
501
|
});
|
|
499
502
|
Logger({ level: "WARN", message: warrning });
|
|
500
503
|
}
|
|
@@ -505,16 +508,14 @@ class Billing {
|
|
|
505
508
|
|
|
506
509
|
const response = await PlatformAPIClient.execute(
|
|
507
510
|
this.config,
|
|
508
|
-
"
|
|
509
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/
|
|
511
|
+
"get",
|
|
512
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/invoice/${invoiceId}`,
|
|
510
513
|
query_params,
|
|
511
|
-
|
|
514
|
+
undefined,
|
|
512
515
|
xHeaders
|
|
513
516
|
);
|
|
514
517
|
|
|
515
|
-
const {
|
|
516
|
-
error: res_error,
|
|
517
|
-
} = BillingModel.SubscriptionCustomer().validate(response, {
|
|
518
|
+
const { error: res_error } = BillingModel.Invoice().validate(response, {
|
|
518
519
|
abortEarly: false,
|
|
519
520
|
allowUnknown: false,
|
|
520
521
|
});
|
|
@@ -522,7 +523,7 @@ class Billing {
|
|
|
522
523
|
if (res_error) {
|
|
523
524
|
Logger({
|
|
524
525
|
level: "WARN",
|
|
525
|
-
message: "Response Validation Warnnings for
|
|
526
|
+
message: "Response Validation Warnnings for getInvoiceById",
|
|
526
527
|
});
|
|
527
528
|
Logger({ level: "WARN", message: res_error });
|
|
528
529
|
}
|
|
@@ -532,12 +533,12 @@ class Billing {
|
|
|
532
533
|
|
|
533
534
|
/**
|
|
534
535
|
* @param {Object} arg - Arg object.
|
|
535
|
-
* @returns {Promise<
|
|
536
|
-
* @summary: Get
|
|
537
|
-
* @description:
|
|
536
|
+
* @returns {Promise<Invoices>} - Success response
|
|
537
|
+
* @summary: Get invoices
|
|
538
|
+
* @description: Get invoices.
|
|
538
539
|
*/
|
|
539
|
-
async
|
|
540
|
-
const { error } = BillingValidator.
|
|
540
|
+
async getInvoices({} = {}) {
|
|
541
|
+
const { error } = BillingValidator.getInvoices().validate(
|
|
541
542
|
{},
|
|
542
543
|
{ abortEarly: false, allowUnknown: true }
|
|
543
544
|
);
|
|
@@ -546,14 +547,14 @@ class Billing {
|
|
|
546
547
|
}
|
|
547
548
|
|
|
548
549
|
// Showing warrnings if extra unknown parameters are found
|
|
549
|
-
const { error: warrning } = BillingValidator.
|
|
550
|
+
const { error: warrning } = BillingValidator.getInvoices().validate(
|
|
550
551
|
{},
|
|
551
552
|
{ abortEarly: false, allowUnknown: false }
|
|
552
553
|
);
|
|
553
554
|
if (warrning) {
|
|
554
555
|
Logger({
|
|
555
556
|
level: "WARN",
|
|
556
|
-
message: "Parameter Validation warrnings for
|
|
557
|
+
message: "Parameter Validation warrnings for getInvoices",
|
|
557
558
|
});
|
|
558
559
|
Logger({ level: "WARN", message: warrning });
|
|
559
560
|
}
|
|
@@ -565,15 +566,13 @@ class Billing {
|
|
|
565
566
|
const response = await PlatformAPIClient.execute(
|
|
566
567
|
this.config,
|
|
567
568
|
"get",
|
|
568
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/
|
|
569
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/invoice/list`,
|
|
569
570
|
query_params,
|
|
570
571
|
undefined,
|
|
571
572
|
xHeaders
|
|
572
573
|
);
|
|
573
574
|
|
|
574
|
-
const {
|
|
575
|
-
error: res_error,
|
|
576
|
-
} = BillingModel.SubscriptionStatus().validate(response, {
|
|
575
|
+
const { error: res_error } = BillingModel.Invoices().validate(response, {
|
|
577
576
|
abortEarly: false,
|
|
578
577
|
allowUnknown: false,
|
|
579
578
|
});
|
|
@@ -581,7 +580,7 @@ class Billing {
|
|
|
581
580
|
if (res_error) {
|
|
582
581
|
Logger({
|
|
583
582
|
level: "WARN",
|
|
584
|
-
message: "Response Validation Warnnings for
|
|
583
|
+
message: "Response Validation Warnnings for getInvoices",
|
|
585
584
|
});
|
|
586
585
|
Logger({ level: "WARN", message: res_error });
|
|
587
586
|
}
|
|
@@ -591,12 +590,12 @@ class Billing {
|
|
|
591
590
|
|
|
592
591
|
/**
|
|
593
592
|
* @param {Object} arg - Arg object.
|
|
594
|
-
* @returns {Promise<
|
|
595
|
-
* @summary: Get
|
|
596
|
-
* @description:
|
|
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.
|
|
597
596
|
*/
|
|
598
|
-
async
|
|
599
|
-
const { error } = BillingValidator.
|
|
597
|
+
async getSubscription({} = {}) {
|
|
598
|
+
const { error } = BillingValidator.getSubscription().validate(
|
|
600
599
|
{},
|
|
601
600
|
{ abortEarly: false, allowUnknown: true }
|
|
602
601
|
);
|
|
@@ -605,16 +604,14 @@ class Billing {
|
|
|
605
604
|
}
|
|
606
605
|
|
|
607
606
|
// Showing warrnings if extra unknown parameters are found
|
|
608
|
-
const {
|
|
609
|
-
error: warrning,
|
|
610
|
-
} = BillingValidator.getFeatureLimitConfig().validate(
|
|
607
|
+
const { error: warrning } = BillingValidator.getSubscription().validate(
|
|
611
608
|
{},
|
|
612
609
|
{ abortEarly: false, allowUnknown: false }
|
|
613
610
|
);
|
|
614
611
|
if (warrning) {
|
|
615
612
|
Logger({
|
|
616
613
|
level: "WARN",
|
|
617
|
-
message: "Parameter Validation warrnings for
|
|
614
|
+
message: "Parameter Validation warrnings for getSubscription",
|
|
618
615
|
});
|
|
619
616
|
Logger({ level: "WARN", message: warrning });
|
|
620
617
|
}
|
|
@@ -626,7 +623,7 @@ class Billing {
|
|
|
626
623
|
const response = await PlatformAPIClient.execute(
|
|
627
624
|
this.config,
|
|
628
625
|
"get",
|
|
629
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/current
|
|
626
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/current`,
|
|
630
627
|
query_params,
|
|
631
628
|
undefined,
|
|
632
629
|
xHeaders
|
|
@@ -634,7 +631,7 @@ class Billing {
|
|
|
634
631
|
|
|
635
632
|
const {
|
|
636
633
|
error: res_error,
|
|
637
|
-
} = BillingModel.
|
|
634
|
+
} = BillingModel.SubscriptionStatus().validate(response, {
|
|
638
635
|
abortEarly: false,
|
|
639
636
|
allowUnknown: false,
|
|
640
637
|
});
|
|
@@ -642,7 +639,7 @@ class Billing {
|
|
|
642
639
|
if (res_error) {
|
|
643
640
|
Logger({
|
|
644
641
|
level: "WARN",
|
|
645
|
-
message: "Response Validation Warnnings for
|
|
642
|
+
message: "Response Validation Warnnings for getSubscription",
|
|
646
643
|
});
|
|
647
644
|
Logger({ level: "WARN", message: res_error });
|
|
648
645
|
}
|
|
@@ -652,15 +649,17 @@ class Billing {
|
|
|
652
649
|
|
|
653
650
|
/**
|
|
654
651
|
* @param {Object} arg - Arg object.
|
|
655
|
-
* @param {
|
|
656
|
-
* @
|
|
657
|
-
* @
|
|
658
|
-
* @
|
|
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
|
|
659
657
|
*/
|
|
660
|
-
async
|
|
661
|
-
const { error } = BillingValidator.
|
|
658
|
+
async getSubscriptionCharge({ extensionId, subscriptionId } = {}) {
|
|
659
|
+
const { error } = BillingValidator.getSubscriptionCharge().validate(
|
|
662
660
|
{
|
|
663
|
-
|
|
661
|
+
extensionId,
|
|
662
|
+
subscriptionId,
|
|
664
663
|
},
|
|
665
664
|
{ abortEarly: false, allowUnknown: true }
|
|
666
665
|
);
|
|
@@ -671,16 +670,17 @@ class Billing {
|
|
|
671
670
|
// Showing warrnings if extra unknown parameters are found
|
|
672
671
|
const {
|
|
673
672
|
error: warrning,
|
|
674
|
-
} = BillingValidator.
|
|
673
|
+
} = BillingValidator.getSubscriptionCharge().validate(
|
|
675
674
|
{
|
|
676
|
-
|
|
675
|
+
extensionId,
|
|
676
|
+
subscriptionId,
|
|
677
677
|
},
|
|
678
678
|
{ abortEarly: false, allowUnknown: false }
|
|
679
679
|
);
|
|
680
680
|
if (warrning) {
|
|
681
681
|
Logger({
|
|
682
682
|
level: "WARN",
|
|
683
|
-
message: "Parameter Validation warrnings for
|
|
683
|
+
message: "Parameter Validation warrnings for getSubscriptionCharge",
|
|
684
684
|
});
|
|
685
685
|
Logger({ level: "WARN", message: warrning });
|
|
686
686
|
}
|
|
@@ -691,16 +691,16 @@ class Billing {
|
|
|
691
691
|
|
|
692
692
|
const response = await PlatformAPIClient.execute(
|
|
693
693
|
this.config,
|
|
694
|
-
"
|
|
695
|
-
`/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}`,
|
|
696
696
|
query_params,
|
|
697
|
-
|
|
697
|
+
undefined,
|
|
698
698
|
xHeaders
|
|
699
699
|
);
|
|
700
700
|
|
|
701
701
|
const {
|
|
702
702
|
error: res_error,
|
|
703
|
-
} = BillingModel.
|
|
703
|
+
} = BillingModel.EntitySubscription().validate(response, {
|
|
704
704
|
abortEarly: false,
|
|
705
705
|
allowUnknown: false,
|
|
706
706
|
});
|
|
@@ -708,7 +708,7 @@ class Billing {
|
|
|
708
708
|
if (res_error) {
|
|
709
709
|
Logger({
|
|
710
710
|
level: "WARN",
|
|
711
|
-
message: "Response Validation Warnnings for
|
|
711
|
+
message: "Response Validation Warnnings for getSubscriptionCharge",
|
|
712
712
|
});
|
|
713
713
|
Logger({ level: "WARN", message: res_error });
|
|
714
714
|
}
|
|
@@ -718,13 +718,13 @@ class Billing {
|
|
|
718
718
|
|
|
719
719
|
/**
|
|
720
720
|
* @param {Object} arg - Arg object.
|
|
721
|
-
* @param {
|
|
722
|
-
* @returns {Promise<
|
|
723
|
-
* @summary:
|
|
724
|
-
* @description:
|
|
721
|
+
* @param {SubscriptionCustomerCreate} arg.body
|
|
722
|
+
* @returns {Promise<SubscriptionCustomer>} - Success response
|
|
723
|
+
* @summary: Upsert subscription customer detail
|
|
724
|
+
* @description: Upsert subscription customer detail.
|
|
725
725
|
*/
|
|
726
|
-
async
|
|
727
|
-
const { error } = BillingValidator.
|
|
726
|
+
async upsertCustomerDetail({ body } = {}) {
|
|
727
|
+
const { error } = BillingValidator.upsertCustomerDetail().validate(
|
|
728
728
|
{
|
|
729
729
|
body,
|
|
730
730
|
},
|
|
@@ -737,7 +737,7 @@ class Billing {
|
|
|
737
737
|
// Showing warrnings if extra unknown parameters are found
|
|
738
738
|
const {
|
|
739
739
|
error: warrning,
|
|
740
|
-
} = BillingValidator.
|
|
740
|
+
} = BillingValidator.upsertCustomerDetail().validate(
|
|
741
741
|
{
|
|
742
742
|
body,
|
|
743
743
|
},
|
|
@@ -746,7 +746,7 @@ class Billing {
|
|
|
746
746
|
if (warrning) {
|
|
747
747
|
Logger({
|
|
748
748
|
level: "WARN",
|
|
749
|
-
message: "Parameter Validation warrnings for
|
|
749
|
+
message: "Parameter Validation warrnings for upsertCustomerDetail",
|
|
750
750
|
});
|
|
751
751
|
Logger({ level: "WARN", message: warrning });
|
|
752
752
|
}
|
|
@@ -758,7 +758,7 @@ class Billing {
|
|
|
758
758
|
const response = await PlatformAPIClient.execute(
|
|
759
759
|
this.config,
|
|
760
760
|
"post",
|
|
761
|
-
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/
|
|
761
|
+
`/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/customer-detail`,
|
|
762
762
|
query_params,
|
|
763
763
|
body,
|
|
764
764
|
xHeaders
|
|
@@ -766,7 +766,7 @@ class Billing {
|
|
|
766
766
|
|
|
767
767
|
const {
|
|
768
768
|
error: res_error,
|
|
769
|
-
} = BillingModel.
|
|
769
|
+
} = BillingModel.SubscriptionCustomer().validate(response, {
|
|
770
770
|
abortEarly: false,
|
|
771
771
|
allowUnknown: false,
|
|
772
772
|
});
|
|
@@ -774,7 +774,7 @@ class Billing {
|
|
|
774
774
|
if (res_error) {
|
|
775
775
|
Logger({
|
|
776
776
|
level: "WARN",
|
|
777
|
-
message: "Response Validation Warnnings for
|
|
777
|
+
message: "Response Validation Warnnings for upsertCustomerDetail",
|
|
778
778
|
});
|
|
779
779
|
Logger({ level: "WARN", message: res_error });
|
|
780
780
|
}
|