@gofynd/fdk-client-javascript 1.6.4 → 3.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/sdk/application/ApplicationClient.d.ts +0 -2
- package/sdk/application/ApplicationClient.js +0 -2
- package/sdk/application/Cart/CartApplicationClient.d.ts +100 -80
- package/sdk/application/Cart/CartApplicationClient.js +257 -126
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +110 -110
- package/sdk/application/Catalog/CatalogApplicationClient.js +122 -138
- package/sdk/application/Common/CommonApplicationClient.d.ts +4 -4
- package/sdk/application/Common/CommonApplicationClient.js +3 -3
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +43 -3
- package/sdk/application/Communication/CommunicationApplicationClient.js +190 -3
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +71 -36
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +103 -29
- package/sdk/application/Content/ContentApplicationClient.d.ts +61 -21
- package/sdk/application/Content/ContentApplicationClient.js +250 -36
- package/sdk/application/Lead/LeadApplicationClient.d.ts +3 -3
- package/sdk/application/Lead/LeadApplicationClient.js +3 -3
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +106 -57
- package/sdk/application/Logistic/LogisticApplicationClient.js +326 -208
- package/sdk/application/Order/OrderApplicationClient.d.ts +44 -24
- package/sdk/application/Order/OrderApplicationClient.js +140 -21
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +211 -111
- package/sdk/application/Payment/PaymentApplicationClient.js +610 -109
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +13 -13
- package/sdk/application/Rewards/RewardsApplicationClient.js +7 -7
- package/sdk/application/Share/ShareApplicationClient.d.ts +7 -7
- package/sdk/application/Share/ShareApplicationClient.js +14 -14
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +23 -3
- package/sdk/application/Theme/ThemeApplicationClient.js +103 -5
- package/sdk/application/User/UserApplicationClient.d.ts +13 -23
- package/sdk/application/User/UserApplicationClient.js +9 -57
- package/sdk/application/Webhook/WebhookApplicationClient.d.ts +4 -4
- package/sdk/application/Webhook/WebhookApplicationClient.js +3 -3
- package/sdk/partner/Authorization/AuthorizationPartnerClient.d.ts +66 -0
- package/sdk/partner/Authorization/AuthorizationPartnerClient.js +431 -0
- package/sdk/partner/Authorization/AuthorizationPartnerModel.d.ts +231 -0
- package/sdk/partner/Authorization/AuthorizationPartnerModel.js +152 -0
- package/sdk/partner/Authorization/AuthorizationPartnerValidator.d.ts +8 -0
- package/sdk/partner/Authorization/AuthorizationPartnerValidator.js +39 -0
- package/sdk/partner/Catalog/CatalogPartnerClient.d.ts +26 -0
- package/sdk/partner/Catalog/CatalogPartnerClient.js +173 -0
- package/sdk/partner/Catalog/CatalogPartnerModel.d.ts +238 -0
- package/sdk/partner/Catalog/CatalogPartnerModel.js +248 -0
- package/sdk/partner/Catalog/CatalogPartnerValidator.d.ts +5 -0
- package/sdk/partner/Catalog/CatalogPartnerValidator.js +19 -0
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +0 -10
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +0 -75
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +1 -54
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +0 -43
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +0 -1
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +0 -6
- package/sdk/partner/Lead/LeadPartnerClient.d.ts +5 -5
- package/sdk/partner/Lead/LeadPartnerClient.js +4 -4
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +100 -49
- package/sdk/partner/Lead/LeadPartnerModel.js +100 -74
- package/sdk/partner/Lead/LeadPartnerValidator.js +1 -1
- package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +33 -160
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +66 -1180
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +288 -1685
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +226 -824
- package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +1 -13
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +14 -141
- package/sdk/partner/PartnerClient.d.ts +6 -0
- package/sdk/partner/PartnerClient.js +9 -0
- package/sdk/partner/Payment/PaymentPartnerClient.d.ts +116 -0
- package/sdk/partner/Payment/PaymentPartnerClient.js +857 -0
- package/sdk/partner/Payment/PaymentPartnerModel.d.ts +388 -0
- package/sdk/partner/Payment/PaymentPartnerModel.js +442 -0
- package/sdk/partner/Payment/PaymentPartnerValidator.d.ts +14 -0
- package/sdk/partner/Payment/PaymentPartnerValidator.js +74 -0
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +63 -21
- package/sdk/partner/Theme/ThemePartnerClient.js +396 -71
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +104 -72
- package/sdk/partner/Theme/ThemePartnerModel.js +101 -75
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +5 -1
- package/sdk/partner/Theme/ThemePartnerValidator.js +42 -12
- package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +18 -18
- package/sdk/partner/Webhook/WebhookPartnerClient.js +18 -18
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +191 -670
- package/sdk/partner/Webhook/WebhookPartnerModel.js +159 -268
- package/sdk/partner/Webhook/WebhookPartnerValidator.js +3 -3
- package/sdk/partner/index.d.ts +3 -0
- package/sdk/partner/index.js +6 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +1 -4
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +1 -1
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +5 -0
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +3 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +32 -2
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +243 -3
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +145 -49
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +171 -20
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +39 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +35 -0
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +12 -12
- package/sdk/platform/Billing/BillingPlatformClient.js +15 -15
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +388 -443
- package/sdk/platform/Billing/BillingPlatformModel.js +263 -280
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +18 -16
- package/sdk/platform/Billing/BillingPlatformValidator.js +9 -8
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +251 -172
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +639 -521
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +165 -165
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +108 -132
- package/sdk/platform/Cart/CartPlatformModel.d.ts +3150 -4468
- package/sdk/platform/Cart/CartPlatformModel.js +2858 -1867
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +976 -380
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +6475 -2015
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +1083 -162
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +884 -80
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +325 -568
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1162 -1562
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +6008 -7688
- package/sdk/platform/Catalog/CatalogPlatformModel.js +9522 -6892
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +234 -227
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +183 -177
- package/sdk/platform/Common/CommonPlatformClient.d.ts +5 -6
- package/sdk/platform/Common/CommonPlatformClient.js +5 -6
- package/sdk/platform/Common/CommonPlatformModel.d.ts +9 -9
- package/sdk/platform/Common/CommonPlatformModel.js +6 -6
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +374 -238
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +876 -588
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +170 -139
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +145 -126
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +56 -3
- package/sdk/platform/Communication/CommunicationPlatformClient.js +307 -4
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +506 -270
- package/sdk/platform/Communication/CommunicationPlatformModel.js +611 -313
- package/sdk/platform/Communication/CommunicationPlatformValidator.d.ts +62 -3
- package/sdk/platform/Communication/CommunicationPlatformValidator.js +48 -2
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +78 -77
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +97 -91
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +238 -256
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +222 -244
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +31 -20
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +25 -20
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +333 -118
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +1470 -409
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +158 -55
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +163 -41
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +151 -61
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +595 -101
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +1206 -459
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +1011 -320
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +80 -34
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +79 -24
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +255 -140
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1095 -464
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +221 -178
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +220 -157
- package/sdk/platform/Content/ContentPlatformClient.d.ts +124 -123
- package/sdk/platform/Content/ContentPlatformClient.js +459 -379
- package/sdk/platform/Content/ContentPlatformModel.d.ts +871 -1315
- package/sdk/platform/Content/ContentPlatformModel.js +940 -599
- package/sdk/platform/Content/ContentPlatformValidator.d.ts +140 -150
- package/sdk/platform/Content/ContentPlatformValidator.js +131 -135
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +60 -36
- package/sdk/platform/Discount/DiscountPlatformClient.js +85 -36
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +46 -47
- package/sdk/platform/Discount/DiscountPlatformModel.js +42 -46
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +2 -2
- package/sdk/platform/Discount/DiscountPlatformValidator.js +2 -2
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +18 -15
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +24 -22
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +4 -4
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +4 -4
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +8 -8
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +8 -8
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +75 -86
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +60 -74
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +6 -6
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +6 -6
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +320 -0
- package/sdk/platform/Finance/FinancePlatformClient.js +2333 -0
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +2895 -0
- package/sdk/platform/Finance/FinancePlatformModel.js +2150 -0
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +284 -0
- package/sdk/platform/Finance/FinancePlatformValidator.js +354 -0
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +17 -17
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +33 -33
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +19 -19
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +14 -14
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +4 -24
- package/sdk/platform/Lead/LeadPlatformClient.js +4 -160
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +142 -57
- package/sdk/platform/Lead/LeadPlatformModel.js +162 -79
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +3 -29
- package/sdk/platform/Lead/LeadPlatformValidator.js +2 -28
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +94 -25
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +600 -57
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +115 -115
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +120 -43
- package/sdk/platform/Order/OrderPlatformClient.d.ts +486 -277
- package/sdk/platform/Order/OrderPlatformClient.js +1491 -938
- package/sdk/platform/Order/OrderPlatformModel.d.ts +4560 -8636
- package/sdk/platform/Order/OrderPlatformModel.js +3604 -4056
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +445 -612
- package/sdk/platform/Order/OrderPlatformValidator.js +316 -326
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -6
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +7 -9
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +9 -9
- package/sdk/platform/Partner/PartnerPlatformModel.js +7 -7
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +382 -135
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +2453 -935
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +306 -93
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +305 -70
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +66 -56
- package/sdk/platform/Payment/PaymentPlatformClient.js +269 -124
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +3531 -1292
- package/sdk/platform/Payment/PaymentPlatformModel.js +3813 -1504
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +64 -35
- package/sdk/platform/Payment/PaymentPlatformValidator.js +60 -34
- package/sdk/platform/PlatformClient.d.ts +2 -0
- package/sdk/platform/PlatformClient.js +4 -0
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +2 -2
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +2 -2
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +2 -2
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +2 -2
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +14 -9
- package/sdk/platform/Rewards/RewardsPlatformModel.js +10 -8
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +344 -56
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +2188 -302
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +394 -54
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +342 -37
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +150 -212
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +589 -1238
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +3581 -2960
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +3730 -1779
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +230 -382
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +164 -287
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +4 -16
- package/sdk/platform/Share/SharePlatformApplicationClient.js +8 -86
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +6 -23
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +3 -16
- package/sdk/platform/Share/SharePlatformModel.d.ts +11 -50
- package/sdk/platform/Share/SharePlatformModel.js +5 -43
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +36 -16
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +201 -58
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +28 -17
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +33 -16
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +18 -8
- package/sdk/platform/Theme/ThemePlatformClient.js +85 -8
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +425 -17
- package/sdk/platform/Theme/ThemePlatformModel.js +329 -23
- package/sdk/platform/Theme/ThemePlatformValidator.d.ts +7 -3
- package/sdk/platform/Theme/ThemePlatformValidator.js +9 -2
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +18 -71
- package/sdk/platform/User/UserPlatformApplicationClient.js +27 -412
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +10 -114
- package/sdk/platform/User/UserPlatformApplicationValidator.js +7 -80
- package/sdk/platform/User/UserPlatformModel.d.ts +216 -264
- package/sdk/platform/User/UserPlatformModel.js +209 -216
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +78 -25
- package/sdk/platform/Webhook/WebhookPlatformClient.js +470 -75
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +428 -810
- package/sdk/platform/Webhook/WebhookPlatformModel.js +395 -444
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +55 -10
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +72 -12
- package/sdk/platform/index.d.ts +1 -0
- package/sdk/platform/index.js +2 -0
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +14 -4
- package/sdk/public/Configuration/ConfigurationPublicClient.js +97 -9
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +102 -40
- package/sdk/public/Configuration/ConfigurationPublicModel.js +111 -29
- package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +11 -1
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +12 -0
- package/sdk/public/Content/ContentPublicClient.d.ts +22 -0
- package/sdk/public/Content/ContentPublicClient.js +183 -0
- package/sdk/public/Content/ContentPublicModel.d.ts +38 -1
- package/sdk/public/Content/ContentPublicModel.js +47 -1
- package/sdk/public/Content/ContentPublicValidator.d.ts +17 -1
- package/sdk/public/Content/ContentPublicValidator.js +19 -0
- package/sdk/public/PublicClient.d.ts +0 -2
- package/sdk/public/PublicClient.js +0 -4
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +8 -8
- package/sdk/public/Webhook/WebhookPublicClient.js +8 -8
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +67 -215
- package/sdk/public/Webhook/WebhookPublicModel.js +61 -66
- package/sdk/public/Webhook/WebhookPublicValidator.d.ts +4 -4
- package/sdk/public/Webhook/WebhookPublicValidator.js +4 -4
- package/sdk/public/index.d.ts +0 -1
- package/sdk/public/index.js +0 -2
- package/sdk/application/Finance/FinanceApplicationClient.d.ts +0 -29
- package/sdk/application/Finance/FinanceApplicationClient.js +0 -126
- package/sdk/public/Catalog/CatalogPublicClient.d.ts +0 -22
- package/sdk/public/Catalog/CatalogPublicClient.js +0 -138
- package/sdk/public/Catalog/CatalogPublicModel.d.ts +0 -155
- package/sdk/public/Catalog/CatalogPublicModel.js +0 -116
- package/sdk/public/Catalog/CatalogPublicValidator.d.ts +0 -55
- package/sdk/public/Catalog/CatalogPublicValidator.js +0 -35
|
@@ -3,41 +3,96 @@ const Joi = require("joi");
|
|
|
3
3
|
/**
|
|
4
4
|
* @typedef SubscriptionChargeRes
|
|
5
5
|
* @property {string} [_id] - Unique identifier for the subscription charge
|
|
6
|
-
* @property {string} [product_suit_id] -
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* @property {string} [
|
|
10
|
-
* @property {string} [
|
|
11
|
-
*
|
|
12
|
-
* @property {
|
|
13
|
-
* @property {string} [status] - Current status of the extension subscription
|
|
14
|
-
* @property {number} [trial_days] - The number of days allocated for the trial period
|
|
6
|
+
* @property {string} [product_suit_id] - ID of the product suit associated with
|
|
7
|
+
* the charge
|
|
8
|
+
* @property {string} [entity_id] - Unique identifier for the entity
|
|
9
|
+
* @property {string} [entity_type] - Type of entity (e.g., subscription, extension)
|
|
10
|
+
* @property {string} [name] - Name of the subscription charge
|
|
11
|
+
* @property {string} [status] - Current status of the subscription charge
|
|
12
|
+
* @property {number} [trial_days] - Number of trial days provided
|
|
15
13
|
* @property {string} [activated_on] - Date when the charge was activated
|
|
16
14
|
* @property {string} [cancelled_on] - Date when the charge was cancelled
|
|
17
|
-
* @property {boolean} [is_test] - Indicates
|
|
18
|
-
* a test mode.
|
|
15
|
+
* @property {boolean} [is_test] - Indicates if the charge is for testing purposes
|
|
19
16
|
* @property {string} [created_at] - Timestamp when the charge was created
|
|
20
17
|
* @property {string} [modified_at] - Timestamp when the charge was last modified
|
|
21
|
-
* @property {string} [company_id] -
|
|
18
|
+
* @property {string} [company_id] - Company id
|
|
22
19
|
* @property {Object[]} [line_items] - List of line items associated with the charge
|
|
23
20
|
*/
|
|
24
21
|
|
|
25
22
|
/**
|
|
26
|
-
* @typedef
|
|
27
|
-
* @property {string} [
|
|
23
|
+
* @typedef ChargeDetails
|
|
24
|
+
* @property {string} [_id] - Unique identifier for the charge.
|
|
25
|
+
* @property {string} [entity_type] - The type of entity associated with the
|
|
26
|
+
* charge (e.g., 'extension', 'subscription').
|
|
27
|
+
* @property {string} [entity_id] - Unique identifier for the entity associated
|
|
28
|
+
* with the charge.
|
|
29
|
+
* @property {string} [name] - The name of the charge.
|
|
30
|
+
* @property {string} [term] - Description of the charge term.
|
|
31
|
+
* @property {string} [charge_type] - The type of charge (e.g., 'standalone',
|
|
32
|
+
* 'recurring').
|
|
33
|
+
* @property {string} [pricing_type] - The pricing model for the charge (e.g.,
|
|
34
|
+
* 'one_time', 'recurring').
|
|
35
|
+
* @property {EntityChargePrice} [price]
|
|
36
|
+
* @property {ChargeRecurring} [recurring]
|
|
37
|
+
* @property {string} [status] - Current status of the charge.
|
|
38
|
+
* @property {number} [capped_amount] - Maximum amount that can be charged, if applicable.
|
|
39
|
+
* @property {string} [activated_on] - Date and time when the charge was activated.
|
|
40
|
+
* @property {string} [cancelled_on] - Date and time when the charge was cancelled.
|
|
41
|
+
* @property {string} [billing_date] - Date and time when the charge was billed.
|
|
42
|
+
* @property {SubscriptionTrialPeriod} [current_period]
|
|
43
|
+
* @property {string} [modified_at] - Date and time when the charge details were
|
|
44
|
+
* last modified.
|
|
45
|
+
* @property {string} [created_at] - Date and time when the charge was created.
|
|
46
|
+
* @property {boolean} [is_test] - Indicates whether the charge is for testing purposes.
|
|
47
|
+
* @property {string} [company_id] - Company id.
|
|
48
|
+
* @property {Object} [meta] - Additional metadata associated with the charge.
|
|
49
|
+
* @property {number} [__v] - Internal version key for the charge record.
|
|
28
50
|
*/
|
|
29
51
|
|
|
30
52
|
/**
|
|
31
53
|
* @typedef ResourceNotFound
|
|
32
54
|
* @property {string} [message] - Resource not found with {id}
|
|
33
|
-
* @property {
|
|
34
|
-
* @property {
|
|
55
|
+
* @property {Object} [code]
|
|
56
|
+
* @property {Object} [success]
|
|
35
57
|
*/
|
|
36
58
|
|
|
37
59
|
/**
|
|
38
|
-
* @typedef
|
|
39
|
-
* @property {string} [
|
|
40
|
-
* @property {
|
|
60
|
+
* @typedef CreateOneTimeCharge
|
|
61
|
+
* @property {string} [name] - The name of the one-time charge to be created.
|
|
62
|
+
* @property {OneTimeChargeItem} [charge]
|
|
63
|
+
* @property {boolean} [is_test] - Indicates whether the charge creation is for
|
|
64
|
+
* testing purposes.
|
|
65
|
+
* @property {string} [return_url] - URL to which the user will be redirected
|
|
66
|
+
* after creating the charge.
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @typedef CreateOneTimeChargeResponse
|
|
71
|
+
* @property {Charge} [charge]
|
|
72
|
+
* @property {string} [confirm_url] - URL to which users are redirected to
|
|
73
|
+
* confirm or complete the payment or subscription process.
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @typedef BadRequest
|
|
78
|
+
* @property {string} [message] - Failure message.
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @typedef CreateSubscriptionCharge
|
|
83
|
+
* @property {string} name - The name of the charge.
|
|
84
|
+
* @property {number} [trial_days]
|
|
85
|
+
* @property {ChargeLineItem[]} line_items
|
|
86
|
+
* @property {boolean} [is_test] - Indicates whether the charge is for testing purposes.
|
|
87
|
+
* @property {string} return_url - The URL passed in request which extension
|
|
88
|
+
* expects in return.
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @typedef CreateSubscriptionResponse
|
|
93
|
+
* @property {EntitySubscription} [subscription]
|
|
94
|
+
* @property {string} [confirm_url] - URL to which users are redirected to
|
|
95
|
+
* confirm or complete the payment or subscription process.
|
|
41
96
|
*/
|
|
42
97
|
|
|
43
98
|
/**
|
|
@@ -46,6 +101,23 @@ const Joi = require("joi");
|
|
|
46
101
|
* @property {string} [currency_code] - The currency code for the price
|
|
47
102
|
*/
|
|
48
103
|
|
|
104
|
+
/**
|
|
105
|
+
* @typedef ChargeRecurring
|
|
106
|
+
* @property {string} [interval]
|
|
107
|
+
* @property {number} [interval_time]
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @typedef SubscriptionTrialPeriod
|
|
112
|
+
* @property {string} [start_date] - The start date and time of the trial period.
|
|
113
|
+
* @property {string} [end_date] - The end date and time of the trial period.
|
|
114
|
+
*/
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @typedef Charge
|
|
118
|
+
* @property {OneTimeChargeEntity} [final_charge]
|
|
119
|
+
*/
|
|
120
|
+
|
|
49
121
|
/**
|
|
50
122
|
* @typedef OneTimeChargeItem
|
|
51
123
|
* @property {string} [name] - The name of the one-time charge item.
|
|
@@ -53,59 +125,43 @@ const Joi = require("joi");
|
|
|
53
125
|
* @property {string} [pricing_type] - The type of pricing for the charge item.
|
|
54
126
|
* @property {EntityChargePrice} [price]
|
|
55
127
|
* @property {number} [capped_amount] - The maximum amount that can be charged
|
|
56
|
-
* for
|
|
57
|
-
* @property {boolean} [is_test] - Indicates whether the
|
|
58
|
-
*
|
|
128
|
+
* for this item, if applicable.
|
|
129
|
+
* @property {boolean} [is_test] - Indicates whether the charge item is for
|
|
130
|
+
* testing purposes.
|
|
59
131
|
* @property {Object} [metadata] - Additional metadata associated with the charge item.
|
|
60
132
|
*/
|
|
61
133
|
|
|
62
134
|
/**
|
|
63
|
-
* @typedef
|
|
64
|
-
* @property {string}
|
|
65
|
-
* @property {
|
|
66
|
-
* @property {
|
|
67
|
-
*
|
|
68
|
-
* @property {
|
|
69
|
-
*
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
* @
|
|
74
|
-
* @property {string} [interval] - The interval at which the recurring charge is
|
|
75
|
-
* applied. Examples include "month", "year", etc.
|
|
76
|
-
* @property {number} [interval_time]
|
|
135
|
+
* @typedef ChargeLineItem
|
|
136
|
+
* @property {string} name - Its name of the extension plan.
|
|
137
|
+
* @property {string} term - It indicates how it will be charged.
|
|
138
|
+
* @property {string} pricing_type - It indicates the extension subscription
|
|
139
|
+
* will be auto renewed timely.
|
|
140
|
+
* @property {EntityChargePrice} price
|
|
141
|
+
* @property {EntityChargeRecurring} [recurring]
|
|
142
|
+
* @property {number} [capped_amount]
|
|
143
|
+
* @property {number} [trial_days]
|
|
144
|
+
* @property {boolean} [is_test]
|
|
145
|
+
* @property {Object} [metadata]
|
|
77
146
|
*/
|
|
78
147
|
|
|
79
148
|
/**
|
|
80
|
-
* @typedef
|
|
81
|
-
* @property {string} [_id] - Unique identifier for the charge
|
|
82
|
-
* @property {string} [
|
|
83
|
-
* the
|
|
84
|
-
* @property {string} [entity_id] - Unique identifier for the entity
|
|
85
|
-
* @property {string} [
|
|
86
|
-
* @property {string} [
|
|
87
|
-
* @property {string} [
|
|
88
|
-
*
|
|
89
|
-
* @property {
|
|
90
|
-
*
|
|
91
|
-
* @property {
|
|
92
|
-
* @property {
|
|
93
|
-
* @property {
|
|
94
|
-
* @property {
|
|
95
|
-
*
|
|
96
|
-
* @property {string} [activated_on] - Date and time when the charge was activated.
|
|
97
|
-
* @property {string} [cancelled_on] - Date and time when the charge was cancelled.
|
|
98
|
-
* @property {string} [billing_date] - The date when the billing occurred. This
|
|
99
|
-
* field is optional and may be null if the billing date is not specified.
|
|
100
|
-
* @property {SubscriptionTrialPeriod} [current_period]
|
|
101
|
-
* @property {string} [modified_at] - Date and time when the charge details were
|
|
102
|
-
* last modified.
|
|
103
|
-
* @property {string} [created_at] - Date and time when the charge was created.
|
|
104
|
-
* @property {boolean} [is_test] - Indicates whether the operation or data is in
|
|
105
|
-
* a test mode.
|
|
106
|
-
* @property {string} [company_id] - The unique identifier of the company.
|
|
107
|
-
* @property {Object} [meta] - Additional metadata associated with the charge.
|
|
108
|
-
* @property {number} [__v] - Internal version key for the charge record.
|
|
149
|
+
* @typedef EntitySubscription
|
|
150
|
+
* @property {string} [_id] - Unique identifier for the subscription charge
|
|
151
|
+
* @property {string} [product_suit_id] - ID of the product suit associated with
|
|
152
|
+
* the charge
|
|
153
|
+
* @property {string} [entity_id] - Unique identifier for the entity
|
|
154
|
+
* @property {string} [entity_type] - Type of entity (e.g., subscription, extension)
|
|
155
|
+
* @property {string} [name] - Name of the subscription charge
|
|
156
|
+
* @property {string} [status] - Current status of the subscription charge
|
|
157
|
+
* @property {number} [trial_days] - Number of trial days provided
|
|
158
|
+
* @property {boolean} [is_test] - Indicates if the charge is for testing purposes
|
|
159
|
+
* @property {string} [created_at] - Timestamp when the charge was created
|
|
160
|
+
* @property {string} [modified_at] - Timestamp when the charge was last modified
|
|
161
|
+
* @property {string} [subscriber_id] - Unique Identifier of the company
|
|
162
|
+
* @property {EntityChargeDetails[]} [line_items]
|
|
163
|
+
* @property {string} [return_url] - The URL passed in request which extension
|
|
164
|
+
* expects in return.
|
|
109
165
|
*/
|
|
110
166
|
|
|
111
167
|
/**
|
|
@@ -113,93 +169,53 @@ const Joi = require("joi");
|
|
|
113
169
|
* @property {string} [term] - Description of the charge term or usage.
|
|
114
170
|
* @property {string} [charge_type] - Type of the charge (e.g., 'subscription',
|
|
115
171
|
* 'extension').
|
|
116
|
-
* @property {number} [capped_amount] -
|
|
117
|
-
*
|
|
118
|
-
* @property {string} [billing_date] -
|
|
119
|
-
*
|
|
172
|
+
* @property {number} [capped_amount] - Maximum amount that can be charged. If
|
|
173
|
+
* no cap, the value should be 0.
|
|
174
|
+
* @property {string} [billing_date] - Date when the charge was billed. Null if
|
|
175
|
+
* not yet billed.
|
|
120
176
|
* @property {string} [created_at] - Date and time when the charge entity was created.
|
|
121
177
|
* @property {string} [modified_at] - Date and time when the charge entity was
|
|
122
178
|
* last modified.
|
|
123
179
|
* @property {number} [__v] - Internal version key for the charge record.
|
|
124
180
|
* @property {string} [_id] - Unique identifier for the charge entity.
|
|
125
181
|
* @property {string} [name] - The name of the one-time charge.
|
|
126
|
-
* @property {string} [status] - Current status of the charge (e.g., 'pending'
|
|
182
|
+
* @property {string} [status] - Current status of the charge (e.g., 'pending',
|
|
183
|
+
* 'completed').
|
|
127
184
|
* @property {string} [activated_on] - Date and time when the charge was
|
|
128
185
|
* activated. Null if not yet activated.
|
|
129
186
|
* @property {string} [cancelled_on] - Date and time when the charge was
|
|
130
187
|
* cancelled. Null if not cancelled.
|
|
131
188
|
* @property {Object} [metadata] - Additional metadata associated with the charge.
|
|
132
189
|
* @property {string} [return_url] - URL to redirect to after processing the charge.
|
|
133
|
-
* @property {boolean} [is_test] - Indicates whether the
|
|
134
|
-
* a test mode.
|
|
190
|
+
* @property {boolean} [is_test] - Indicates whether the charge is for testing purposes.
|
|
135
191
|
* @property {string} [pricing_type] - Pricing model for the charge (e.g., 'one_time').
|
|
136
|
-
* @property {string} [subscriber_id] -
|
|
137
|
-
* the
|
|
138
|
-
* @property {string} [entity_type] -
|
|
139
|
-
*
|
|
140
|
-
* @property {string} [entity_id] - Unique identifier for the entity
|
|
192
|
+
* @property {string} [subscriber_id] - Unique identifier for the subscriber
|
|
193
|
+
* associated with the charge.
|
|
194
|
+
* @property {string} [entity_type] - Type of the entity related to the charge
|
|
195
|
+
* (e.g., 'subscription', 'user').
|
|
196
|
+
* @property {string} [entity_id] - Unique identifier for the entity associated
|
|
197
|
+
* with the charge.
|
|
141
198
|
* @property {Object} [meta] - Additional metadata associated with the charge.
|
|
142
199
|
* @property {EntityChargePrice} [price]
|
|
143
200
|
*/
|
|
144
201
|
|
|
145
|
-
/**
|
|
146
|
-
* @typedef CreateOneTimeChargeResponseSchemas
|
|
147
|
-
* @property {Charge} [charge]
|
|
148
|
-
* @property {string} [confirm_url] - URL to which users are redirected to
|
|
149
|
-
* confirm or complete the payment or subscription process.
|
|
150
|
-
*/
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* @typedef Charge
|
|
154
|
-
* @property {OneTimeChargeEntity} [final_charge]
|
|
155
|
-
*/
|
|
156
|
-
|
|
157
202
|
/**
|
|
158
203
|
* @typedef EntityChargeRecurring
|
|
159
|
-
* @property {string} interval - The interval
|
|
160
|
-
* applied. Examples include "month", "year", etc.
|
|
161
|
-
*/
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* @typedef ChargeLineItem
|
|
165
|
-
* @property {string} name - Its name of the extension plan.
|
|
166
|
-
* @property {string} term - It indicates how it will be charged.
|
|
167
|
-
* @property {string} pricing_type - Specifies the type of pricing for the
|
|
168
|
-
* extension subscription. It indicates whether the subscription will be
|
|
169
|
-
* automatically renewed, charged once, or based on usage.
|
|
170
|
-
* @property {EntityChargePrice} price
|
|
171
|
-
* @property {EntityChargeRecurring} [recurring]
|
|
172
|
-
* @property {number} [capped_amount] - The maximum amount that can be charged
|
|
173
|
-
* for a particular service or item
|
|
174
|
-
* @property {number} [trial_days] - The number of days allocated for the trial period
|
|
175
|
-
* @property {boolean} [is_test] - Indicates whether the operation or data is in
|
|
176
|
-
* a test mode.
|
|
177
|
-
* @property {Object} [metadata]
|
|
178
|
-
*/
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* @typedef CreateSubscriptionCharge
|
|
182
|
-
* @property {string} name - The name of the extension plan
|
|
183
|
-
* @property {number} [trial_days] - The number of days allocated for the trial period
|
|
184
|
-
* @property {ChargeLineItem[]} line_items
|
|
185
|
-
* @property {boolean} [is_test] - Indicates whether the operation or data is in
|
|
186
|
-
* a test mode.
|
|
187
|
-
* @property {string} return_url - The URL to which the user will be redirected
|
|
188
|
-
* after the subscription process is complete.
|
|
204
|
+
* @property {string} interval - The interval of the subscription.
|
|
189
205
|
*/
|
|
190
206
|
|
|
191
207
|
/**
|
|
192
208
|
* @typedef EntityChargeDetails
|
|
193
|
-
* @property {string} [_id] -
|
|
194
|
-
* @property {string} [subscription_id] -
|
|
195
|
-
* @property {string} [subscriber_id] -
|
|
196
|
-
*
|
|
197
|
-
* @property {string} [entity_type] -
|
|
198
|
-
*
|
|
199
|
-
* @property {string} [entity_id] - Unique identifier for the entity
|
|
200
|
-
*
|
|
201
|
-
* @property {string} [
|
|
202
|
-
*
|
|
209
|
+
* @property {string} [_id] - Unique identifier for the charge.
|
|
210
|
+
* @property {string} [subscription_id] - Unique identifier of the extension subscription.
|
|
211
|
+
* @property {string} [subscriber_id] - Unique identifier of the
|
|
212
|
+
* subscriber/company who installed extension subscription.
|
|
213
|
+
* @property {string} [entity_type] - The type of entity associated with the
|
|
214
|
+
* charge (e.g., 'extension', 'subscription').
|
|
215
|
+
* @property {string} [entity_id] - Unique identifier for the entity associated
|
|
216
|
+
* with the charge.
|
|
217
|
+
* @property {string} [name] - The name of the charge.
|
|
218
|
+
* @property {string} [term] - Description of the charge term.
|
|
203
219
|
* @property {string} [charge_type] - The type of charge (e.g., 'standalone',
|
|
204
220
|
* 'recurring').
|
|
205
221
|
* @property {string} [pricing_type] - The pricing model for the charge (e.g.,
|
|
@@ -207,53 +223,20 @@ const Joi = require("joi");
|
|
|
207
223
|
* @property {EntityChargePrice} [price]
|
|
208
224
|
* @property {ChargeRecurring} [recurring]
|
|
209
225
|
* @property {string} [status] - Current status of the charge.
|
|
210
|
-
* @property {number} [capped_amount] -
|
|
211
|
-
* for a particular service or item
|
|
226
|
+
* @property {number} [capped_amount] - Maximum amount that can be charged, if applicable.
|
|
212
227
|
* @property {string} [activated_on] - Date and time when the charge was activated.
|
|
213
228
|
* @property {string} [cancelled_on] - Date and time when the charge was cancelled.
|
|
214
|
-
* @property {string} [billing_date] -
|
|
215
|
-
* field is optional and may be null if the billing date is not specified.
|
|
229
|
+
* @property {string} [billing_date] - Date and time when the charge was billed.
|
|
216
230
|
* @property {SubscriptionTrialPeriod} [current_period]
|
|
217
231
|
* @property {string} [modified_at] - Date and time when the charge details were
|
|
218
232
|
* last modified.
|
|
219
233
|
* @property {string} [created_at] - Date and time when the charge was created.
|
|
220
|
-
* @property {boolean} [is_test] - Indicates whether the
|
|
221
|
-
*
|
|
222
|
-
* @property {string} [company_id] - The unique identifier of the company.
|
|
234
|
+
* @property {boolean} [is_test] - Indicates whether the charge is for testing purposes.
|
|
235
|
+
* @property {string} [company_id] - Company id.
|
|
223
236
|
* @property {Object} [meta] - Additional metadata associated with the charge.
|
|
224
237
|
* @property {number} [__v] - Internal version key for the charge record.
|
|
225
238
|
*/
|
|
226
239
|
|
|
227
|
-
/**
|
|
228
|
-
* @typedef EntitySubscription
|
|
229
|
-
* @property {string} [_id] - Unique identifier for the subscription charge
|
|
230
|
-
* @property {string} [product_suit_id] - A unique identifier for a product
|
|
231
|
-
* suite, which represents a specific collection or group of products within
|
|
232
|
-
* the system.
|
|
233
|
-
* @property {string} [entity_id] - Unique identifier for the entity (eg. extension)
|
|
234
|
-
* @property {string} [entity_type] - Specifies the type of entity related to
|
|
235
|
-
* the operation, such as 'extension' or 'subscription'
|
|
236
|
-
* @property {string} [name] - The name of the extension plan
|
|
237
|
-
* @property {string} [status] - Current status of the subscription charge
|
|
238
|
-
* @property {number} [trial_days] - The number of days allocated for the trial period
|
|
239
|
-
* @property {boolean} [is_test] - Indicates whether the operation or data is in
|
|
240
|
-
* a test mode.
|
|
241
|
-
* @property {string} [created_at] - Timestamp when the charge was created
|
|
242
|
-
* @property {string} [modified_at] - Timestamp when the charge was last modified
|
|
243
|
-
* @property {string} [subscriber_id] - The unique identifier for the company in
|
|
244
|
-
* the system.
|
|
245
|
-
* @property {EntityChargeDetails[]} [line_items]
|
|
246
|
-
* @property {string} [return_url] - The URL passed in request which extension
|
|
247
|
-
* expects in return.
|
|
248
|
-
*/
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* @typedef CreateSubscription
|
|
252
|
-
* @property {EntitySubscription} [subscription]
|
|
253
|
-
* @property {string} [confirm_url] - URL to which users are redirected to post
|
|
254
|
-
* initiation of extension installation.
|
|
255
|
-
*/
|
|
256
|
-
|
|
257
240
|
class BillingPlatformModel {
|
|
258
241
|
/** @returns {SubscriptionChargeRes} */
|
|
259
242
|
static SubscriptionChargeRes() {
|
|
@@ -275,10 +258,30 @@ class BillingPlatformModel {
|
|
|
275
258
|
});
|
|
276
259
|
}
|
|
277
260
|
|
|
278
|
-
/** @returns {
|
|
279
|
-
static
|
|
261
|
+
/** @returns {ChargeDetails} */
|
|
262
|
+
static ChargeDetails() {
|
|
280
263
|
return Joi.object({
|
|
281
|
-
|
|
264
|
+
_id: Joi.string().allow(""),
|
|
265
|
+
entity_type: Joi.string().allow(""),
|
|
266
|
+
entity_id: Joi.string().allow(""),
|
|
267
|
+
name: Joi.string().allow(""),
|
|
268
|
+
term: Joi.string().allow(""),
|
|
269
|
+
charge_type: Joi.string().allow(""),
|
|
270
|
+
pricing_type: Joi.string().allow(""),
|
|
271
|
+
price: BillingPlatformModel.EntityChargePrice(),
|
|
272
|
+
recurring: BillingPlatformModel.ChargeRecurring(),
|
|
273
|
+
status: Joi.string().allow(""),
|
|
274
|
+
capped_amount: Joi.number(),
|
|
275
|
+
activated_on: Joi.string().allow(""),
|
|
276
|
+
cancelled_on: Joi.string().allow(""),
|
|
277
|
+
billing_date: Joi.string().allow(""),
|
|
278
|
+
current_period: BillingPlatformModel.SubscriptionTrialPeriod(),
|
|
279
|
+
modified_at: Joi.string().allow(""),
|
|
280
|
+
created_at: Joi.string().allow(""),
|
|
281
|
+
is_test: Joi.boolean(),
|
|
282
|
+
company_id: Joi.string().allow(""),
|
|
283
|
+
meta: Joi.any(),
|
|
284
|
+
__v: Joi.number(),
|
|
282
285
|
});
|
|
283
286
|
}
|
|
284
287
|
|
|
@@ -286,16 +289,54 @@ class BillingPlatformModel {
|
|
|
286
289
|
static ResourceNotFound() {
|
|
287
290
|
return Joi.object({
|
|
288
291
|
message: Joi.string().allow(""),
|
|
289
|
-
code: Joi.
|
|
290
|
-
success: Joi.
|
|
292
|
+
code: Joi.any(),
|
|
293
|
+
success: Joi.any(),
|
|
291
294
|
});
|
|
292
295
|
}
|
|
293
296
|
|
|
294
|
-
/** @returns {
|
|
295
|
-
static
|
|
297
|
+
/** @returns {CreateOneTimeCharge} */
|
|
298
|
+
static CreateOneTimeCharge() {
|
|
296
299
|
return Joi.object({
|
|
297
|
-
|
|
298
|
-
|
|
300
|
+
name: Joi.string().allow(""),
|
|
301
|
+
charge: BillingPlatformModel.OneTimeChargeItem(),
|
|
302
|
+
is_test: Joi.boolean(),
|
|
303
|
+
return_url: Joi.string().allow(""),
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/** @returns {CreateOneTimeChargeResponse} */
|
|
308
|
+
static CreateOneTimeChargeResponse() {
|
|
309
|
+
return Joi.object({
|
|
310
|
+
charge: BillingPlatformModel.Charge(),
|
|
311
|
+
confirm_url: Joi.string().allow(""),
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/** @returns {BadRequest} */
|
|
316
|
+
static BadRequest() {
|
|
317
|
+
return Joi.object({
|
|
318
|
+
message: Joi.string().allow(""),
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/** @returns {CreateSubscriptionCharge} */
|
|
323
|
+
static CreateSubscriptionCharge() {
|
|
324
|
+
return Joi.object({
|
|
325
|
+
name: Joi.string().allow("").required(),
|
|
326
|
+
trial_days: Joi.number(),
|
|
327
|
+
line_items: Joi.array()
|
|
328
|
+
.items(BillingPlatformModel.ChargeLineItem())
|
|
329
|
+
.required(),
|
|
330
|
+
is_test: Joi.boolean(),
|
|
331
|
+
return_url: Joi.string().allow("").required(),
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/** @returns {CreateSubscriptionResponse} */
|
|
336
|
+
static CreateSubscriptionResponse() {
|
|
337
|
+
return Joi.object({
|
|
338
|
+
subscription: BillingPlatformModel.EntitySubscription(),
|
|
339
|
+
confirm_url: Joi.string().allow(""),
|
|
299
340
|
});
|
|
300
341
|
}
|
|
301
342
|
|
|
@@ -307,6 +348,29 @@ class BillingPlatformModel {
|
|
|
307
348
|
});
|
|
308
349
|
}
|
|
309
350
|
|
|
351
|
+
/** @returns {ChargeRecurring} */
|
|
352
|
+
static ChargeRecurring() {
|
|
353
|
+
return Joi.object({
|
|
354
|
+
interval: Joi.string().allow(""),
|
|
355
|
+
interval_time: Joi.number(),
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/** @returns {SubscriptionTrialPeriod} */
|
|
360
|
+
static SubscriptionTrialPeriod() {
|
|
361
|
+
return Joi.object({
|
|
362
|
+
start_date: Joi.string().allow(""),
|
|
363
|
+
end_date: Joi.string().allow(""),
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/** @returns {Charge} */
|
|
368
|
+
static Charge() {
|
|
369
|
+
return Joi.object({
|
|
370
|
+
final_charge: BillingPlatformModel.OneTimeChargeEntity(),
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
|
|
310
374
|
/** @returns {OneTimeChargeItem} */
|
|
311
375
|
static OneTimeChargeItem() {
|
|
312
376
|
return Joi.object({
|
|
@@ -316,52 +380,41 @@ class BillingPlatformModel {
|
|
|
316
380
|
price: BillingPlatformModel.EntityChargePrice(),
|
|
317
381
|
capped_amount: Joi.number(),
|
|
318
382
|
is_test: Joi.boolean(),
|
|
319
|
-
metadata: Joi.
|
|
383
|
+
metadata: Joi.any(),
|
|
320
384
|
});
|
|
321
385
|
}
|
|
322
386
|
|
|
323
|
-
/** @returns {
|
|
324
|
-
static
|
|
387
|
+
/** @returns {ChargeLineItem} */
|
|
388
|
+
static ChargeLineItem() {
|
|
325
389
|
return Joi.object({
|
|
326
|
-
name: Joi.string().allow(""),
|
|
327
|
-
|
|
390
|
+
name: Joi.string().allow("").required(),
|
|
391
|
+
term: Joi.string().allow("").required(),
|
|
392
|
+
pricing_type: Joi.string().allow("").required(),
|
|
393
|
+
price: BillingPlatformModel.EntityChargePrice().required(),
|
|
394
|
+
recurring: BillingPlatformModel.EntityChargeRecurring(),
|
|
395
|
+
capped_amount: Joi.number(),
|
|
396
|
+
trial_days: Joi.number(),
|
|
328
397
|
is_test: Joi.boolean(),
|
|
329
|
-
|
|
398
|
+
metadata: Joi.any(),
|
|
330
399
|
});
|
|
331
400
|
}
|
|
332
401
|
|
|
333
|
-
/** @returns {
|
|
334
|
-
static
|
|
335
|
-
return Joi.object({
|
|
336
|
-
interval: Joi.string().allow(""),
|
|
337
|
-
interval_time: Joi.number(),
|
|
338
|
-
});
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
/** @returns {ChargeDetails} */
|
|
342
|
-
static ChargeDetails() {
|
|
402
|
+
/** @returns {EntitySubscription} */
|
|
403
|
+
static EntitySubscription() {
|
|
343
404
|
return Joi.object({
|
|
344
405
|
_id: Joi.string().allow(""),
|
|
345
|
-
|
|
406
|
+
product_suit_id: Joi.string().allow(""),
|
|
346
407
|
entity_id: Joi.string().allow(""),
|
|
408
|
+
entity_type: Joi.string().allow(""),
|
|
347
409
|
name: Joi.string().allow(""),
|
|
348
|
-
term: Joi.string().allow(""),
|
|
349
|
-
charge_type: Joi.string().allow(""),
|
|
350
|
-
pricing_type: Joi.string().allow(""),
|
|
351
|
-
price: BillingPlatformModel.EntityChargePrice(),
|
|
352
|
-
recurring: BillingPlatformModel.ChargeRecurring(),
|
|
353
410
|
status: Joi.string().allow(""),
|
|
354
|
-
|
|
355
|
-
activated_on: Joi.string().allow(""),
|
|
356
|
-
cancelled_on: Joi.string().allow(""),
|
|
357
|
-
billing_date: Joi.string().allow(""),
|
|
358
|
-
current_period: BillingPlatformModel.SubscriptionTrialPeriod(),
|
|
359
|
-
modified_at: Joi.string().allow(""),
|
|
360
|
-
created_at: Joi.string().allow(""),
|
|
411
|
+
trial_days: Joi.number(),
|
|
361
412
|
is_test: Joi.boolean(),
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
413
|
+
created_at: Joi.string().allow(""),
|
|
414
|
+
modified_at: Joi.string().allow(""),
|
|
415
|
+
subscriber_id: Joi.string().allow(""),
|
|
416
|
+
line_items: Joi.array().items(BillingPlatformModel.EntityChargeDetails()),
|
|
417
|
+
return_url: Joi.string().allow(""),
|
|
365
418
|
});
|
|
366
419
|
}
|
|
367
420
|
|
|
@@ -380,33 +433,18 @@ class BillingPlatformModel {
|
|
|
380
433
|
status: Joi.string().allow(""),
|
|
381
434
|
activated_on: Joi.string().allow("").allow(null),
|
|
382
435
|
cancelled_on: Joi.string().allow("").allow(null),
|
|
383
|
-
metadata: Joi.
|
|
436
|
+
metadata: Joi.any(),
|
|
384
437
|
return_url: Joi.string().allow(""),
|
|
385
438
|
is_test: Joi.boolean(),
|
|
386
439
|
pricing_type: Joi.string().allow(""),
|
|
387
440
|
subscriber_id: Joi.string().allow(""),
|
|
388
441
|
entity_type: Joi.string().allow(""),
|
|
389
442
|
entity_id: Joi.string().allow(""),
|
|
390
|
-
meta: Joi.
|
|
443
|
+
meta: Joi.any(),
|
|
391
444
|
price: BillingPlatformModel.EntityChargePrice(),
|
|
392
445
|
});
|
|
393
446
|
}
|
|
394
447
|
|
|
395
|
-
/** @returns {CreateOneTimeChargeResponseSchemas} */
|
|
396
|
-
static CreateOneTimeChargeResponseSchemas() {
|
|
397
|
-
return Joi.object({
|
|
398
|
-
charge: BillingPlatformModel.Charge(),
|
|
399
|
-
confirm_url: Joi.string().allow(""),
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
/** @returns {Charge} */
|
|
404
|
-
static Charge() {
|
|
405
|
-
return Joi.object({
|
|
406
|
-
final_charge: BillingPlatformModel.OneTimeChargeEntity(),
|
|
407
|
-
});
|
|
408
|
-
}
|
|
409
|
-
|
|
410
448
|
/** @returns {EntityChargeRecurring} */
|
|
411
449
|
static EntityChargeRecurring() {
|
|
412
450
|
return Joi.object({
|
|
@@ -414,34 +452,6 @@ class BillingPlatformModel {
|
|
|
414
452
|
});
|
|
415
453
|
}
|
|
416
454
|
|
|
417
|
-
/** @returns {ChargeLineItem} */
|
|
418
|
-
static ChargeLineItem() {
|
|
419
|
-
return Joi.object({
|
|
420
|
-
name: Joi.string().allow("").required(),
|
|
421
|
-
term: Joi.string().allow("").required(),
|
|
422
|
-
pricing_type: Joi.string().allow("").required(),
|
|
423
|
-
price: BillingPlatformModel.EntityChargePrice().required(),
|
|
424
|
-
recurring: BillingPlatformModel.EntityChargeRecurring(),
|
|
425
|
-
capped_amount: Joi.number(),
|
|
426
|
-
trial_days: Joi.number(),
|
|
427
|
-
is_test: Joi.boolean(),
|
|
428
|
-
metadata: Joi.object().pattern(/\S/, Joi.any()),
|
|
429
|
-
});
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
/** @returns {CreateSubscriptionCharge} */
|
|
433
|
-
static CreateSubscriptionCharge() {
|
|
434
|
-
return Joi.object({
|
|
435
|
-
name: Joi.string().allow("").required(),
|
|
436
|
-
trial_days: Joi.number(),
|
|
437
|
-
line_items: Joi.array()
|
|
438
|
-
.items(BillingPlatformModel.ChargeLineItem())
|
|
439
|
-
.required(),
|
|
440
|
-
is_test: Joi.boolean(),
|
|
441
|
-
return_url: Joi.string().allow("").required(),
|
|
442
|
-
});
|
|
443
|
-
}
|
|
444
|
-
|
|
445
455
|
/** @returns {EntityChargeDetails} */
|
|
446
456
|
static EntityChargeDetails() {
|
|
447
457
|
return Joi.object({
|
|
@@ -466,36 +476,9 @@ class BillingPlatformModel {
|
|
|
466
476
|
created_at: Joi.string().allow(""),
|
|
467
477
|
is_test: Joi.boolean(),
|
|
468
478
|
company_id: Joi.string().allow(""),
|
|
469
|
-
meta: Joi.
|
|
479
|
+
meta: Joi.any(),
|
|
470
480
|
__v: Joi.number(),
|
|
471
481
|
});
|
|
472
482
|
}
|
|
473
|
-
|
|
474
|
-
/** @returns {EntitySubscription} */
|
|
475
|
-
static EntitySubscription() {
|
|
476
|
-
return Joi.object({
|
|
477
|
-
_id: Joi.string().allow(""),
|
|
478
|
-
product_suit_id: Joi.string().allow(""),
|
|
479
|
-
entity_id: Joi.string().allow(""),
|
|
480
|
-
entity_type: Joi.string().allow(""),
|
|
481
|
-
name: Joi.string().allow(""),
|
|
482
|
-
status: Joi.string().allow(""),
|
|
483
|
-
trial_days: Joi.number(),
|
|
484
|
-
is_test: Joi.boolean(),
|
|
485
|
-
created_at: Joi.string().allow(""),
|
|
486
|
-
modified_at: Joi.string().allow(""),
|
|
487
|
-
subscriber_id: Joi.string().allow(""),
|
|
488
|
-
line_items: Joi.array().items(BillingPlatformModel.EntityChargeDetails()),
|
|
489
|
-
return_url: Joi.string().allow(""),
|
|
490
|
-
});
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
/** @returns {CreateSubscription} */
|
|
494
|
-
static CreateSubscription() {
|
|
495
|
-
return Joi.object({
|
|
496
|
-
subscription: BillingPlatformModel.EntitySubscription(),
|
|
497
|
-
confirm_url: Joi.string().allow(""),
|
|
498
|
-
});
|
|
499
|
-
}
|
|
500
483
|
}
|
|
501
484
|
module.exports = BillingPlatformModel;
|