@gofynd/fdk-client-javascript 1.1.6 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -3
- package/index.js +0 -3
- package/package.json +1 -2
- package/sdk/application/ApplicationAPIClient.d.ts +15 -1
- package/sdk/application/ApplicationAPIClient.js +12 -3
- package/sdk/application/ApplicationClient.d.ts +36 -6
- package/sdk/application/ApplicationClient.js +30 -43
- package/sdk/application/ApplicationConfig.d.ts +92 -12
- package/sdk/application/ApplicationConfig.js +48 -14
- package/sdk/application/Cart/CartApplicationClient.d.ts +200 -357
- package/sdk/application/Cart/CartApplicationClient.js +711 -483
- package/sdk/application/Cart/CartApplicationModel.d.ts +2054 -96
- package/sdk/application/Cart/CartApplicationModel.js +1224 -93
- package/sdk/application/Cart/CartApplicationValidator.d.ts +508 -30
- package/sdk/application/Cart/CartApplicationValidator.js +270 -15
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +274 -422
- package/sdk/application/Catalog/CatalogApplicationClient.js +865 -630
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +2320 -117
- package/sdk/application/Catalog/CatalogApplicationModel.js +1566 -172
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +798 -31
- package/sdk/application/Catalog/CatalogApplicationValidator.js +318 -3
- package/sdk/application/Common/CommonApplicationClient.d.ts +16 -21
- package/sdk/application/Common/CommonApplicationClient.js +52 -33
- package/sdk/application/Common/CommonApplicationModel.d.ts +368 -19
- package/sdk/application/Common/CommonApplicationModel.js +192 -40
- package/sdk/application/Common/CommonApplicationValidator.d.ts +42 -4
- package/sdk/application/Common/CommonApplicationValidator.js +21 -3
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +31 -18
- package/sdk/application/Communication/CommunicationApplicationClient.js +86 -47
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +157 -14
- package/sdk/application/Communication/CommunicationApplicationModel.js +104 -23
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +27 -4
- package/sdk/application/Communication/CommunicationApplicationValidator.js +21 -5
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +149 -118
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +457 -260
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +2235 -110
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +1113 -193
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +160 -8
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +88 -4
- package/sdk/application/Content/ContentApplicationClient.d.ts +149 -139
- package/sdk/application/Content/ContentApplicationClient.js +489 -278
- package/sdk/application/Content/ContentApplicationModel.d.ts +1010 -105
- package/sdk/application/Content/ContentApplicationModel.js +737 -396
- package/sdk/application/Content/ContentApplicationValidator.d.ts +214 -12
- package/sdk/application/Content/ContentApplicationValidator.js +113 -3
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +23 -29
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +74 -47
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +148 -20
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +100 -87
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +55 -5
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +33 -6
- package/sdk/application/Lead/LeadApplicationClient.d.ts +57 -53
- package/sdk/application/Lead/LeadApplicationClient.js +188 -103
- package/sdk/application/Lead/LeadApplicationModel.d.ts +686 -54
- package/sdk/application/Lead/LeadApplicationModel.js +330 -244
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +91 -9
- package/sdk/application/Lead/LeadApplicationValidator.js +51 -6
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +40 -33
- package/sdk/application/Logistic/LogisticApplicationClient.js +131 -73
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +399 -28
- package/sdk/application/Logistic/LogisticApplicationModel.js +293 -24
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +48 -6
- package/sdk/application/Logistic/LogisticApplicationValidator.js +34 -6
- package/sdk/application/Order/OrderApplicationClient.d.ts +93 -133
- package/sdk/application/Order/OrderApplicationClient.js +329 -217
- package/sdk/application/Order/OrderApplicationModel.d.ts +1101 -66
- package/sdk/application/Order/OrderApplicationModel.js +776 -57
- package/sdk/application/Order/OrderApplicationValidator.d.ts +249 -14
- package/sdk/application/Order/OrderApplicationValidator.js +114 -5
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +400 -366
- package/sdk/application/Payment/PaymentApplicationClient.js +1176 -703
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +3125 -99
- package/sdk/application/Payment/PaymentApplicationModel.js +1158 -62
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +494 -41
- package/sdk/application/Payment/PaymentApplicationValidator.js +297 -25
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +205 -350
- package/sdk/application/PosCart/PosCartApplicationClient.js +720 -491
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1823 -89
- package/sdk/application/PosCart/PosCartApplicationModel.js +1117 -85
- package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +480 -29
- package/sdk/application/PosCart/PosCartApplicationValidator.js +262 -15
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +58 -47
- package/sdk/application/Rewards/RewardsApplicationClient.js +187 -102
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +343 -22
- package/sdk/application/Rewards/RewardsApplicationModel.js +230 -15
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +70 -7
- package/sdk/application/Rewards/RewardsApplicationValidator.js +45 -6
- package/sdk/application/Share/ShareApplicationClient.d.ts +52 -50
- package/sdk/application/Share/ShareApplicationClient.js +185 -97
- package/sdk/application/Share/ShareApplicationModel.d.ts +198 -15
- package/sdk/application/Share/ShareApplicationModel.js +131 -31
- package/sdk/application/Share/ShareApplicationValidator.d.ts +86 -8
- package/sdk/application/Share/ShareApplicationValidator.js +48 -4
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +30 -27
- package/sdk/application/Theme/ThemeApplicationClient.js +102 -56
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +1291 -48
- package/sdk/application/Theme/ThemeApplicationModel.js +895 -134
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +49 -5
- package/sdk/application/Theme/ThemeApplicationValidator.js +26 -3
- package/sdk/application/User/UserApplicationClient.d.ts +260 -305
- package/sdk/application/User/UserApplicationClient.js +910 -522
- package/sdk/application/User/UserApplicationModel.d.ts +992 -101
- package/sdk/application/User/UserApplicationModel.js +699 -248
- package/sdk/application/User/UserApplicationValidator.d.ts +457 -33
- package/sdk/application/User/UserApplicationValidator.js +265 -31
- package/sdk/common/AxiosHelper.js +7 -2
- package/sdk/common/FDKError.d.ts +3 -0
- package/sdk/common/FDKError.js +8 -0
- package/sdk/common/Paginator.d.ts +27 -12
- package/sdk/common/Paginator.js +15 -0
- package/sdk/common/RequestSigner.js +0 -1
- package/sdk/common/utils.d.ts +3 -0
- package/sdk/common/utils.js +29 -0
- package/sdk/partner/PartnerAPIClient.d.ts +16 -1
- package/sdk/partner/PartnerAPIClient.js +12 -2
- package/sdk/partner/PartnerClient.d.ts +22 -3
- package/sdk/partner/PartnerClient.js +20 -0
- package/sdk/partner/PartnerConfig.d.ts +40 -14
- package/sdk/partner/PartnerConfig.js +31 -6
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +299 -0
- package/sdk/partner/Theme/ThemePartnerClient.js +768 -0
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +1706 -0
- package/sdk/partner/Theme/ThemePartnerModel.js +1409 -0
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +22 -0
- package/sdk/partner/Theme/ThemePartnerValidator.js +157 -0
- package/sdk/partner/index.d.ts +3 -1
- package/sdk/partner/index.js +3 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +30 -25
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +104 -53
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +190 -17
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +132 -15
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +52 -5
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +30 -4
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +133 -97
- package/sdk/platform/Billing/BillingPlatformClient.js +561 -191
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +1071 -68
- package/sdk/platform/Billing/BillingPlatformModel.js +762 -151
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +175 -12
- package/sdk/platform/Billing/BillingPlatformValidator.js +118 -8
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +454 -635
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +1646 -957
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +827 -57
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +492 -34
- package/sdk/platform/Cart/CartPlatformModel.d.ts +3839 -175
- package/sdk/platform/Cart/CartPlatformModel.js +2423 -217
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +528 -638
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1600 -984
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +1081 -49
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +482 -23
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +652 -826
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1979 -1264
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +6869 -326
- package/sdk/platform/Catalog/CatalogPlatformModel.js +4215 -351
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +1361 -71
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +624 -30
- package/sdk/platform/Common/CommonPlatformClient.d.ts +16 -21
- package/sdk/platform/Common/CommonPlatformClient.js +50 -33
- package/sdk/platform/Common/CommonPlatformModel.d.ts +423 -19
- package/sdk/platform/Common/CommonPlatformModel.js +214 -40
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +37 -4
- package/sdk/platform/Common/CommonPlatformValidator.js +20 -3
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +731 -303
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +3095 -785
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +699 -41
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +463 -27
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +19 -5
- package/sdk/platform/Communication/CommunicationPlatformClient.js +59 -19
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1708 -102
- package/sdk/platform/Communication/CommunicationPlatformModel.js +1360 -235
- package/sdk/platform/Communication/CommunicationPlatformValidator.d.ts +16 -3
- package/sdk/platform/Communication/CommunicationPlatformValidator.js +11 -3
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +127 -111
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +435 -225
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +882 -43
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +666 -78
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +184 -13
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +105 -10
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +327 -240
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +922 -438
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +297 -22
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +191 -17
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +184 -178
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +555 -311
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +4337 -188
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2178 -248
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +332 -19
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +153 -10
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +605 -578
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1996 -987
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +872 -62
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +487 -35
- package/sdk/platform/Content/ContentPlatformModel.d.ts +1472 -108
- package/sdk/platform/Content/ContentPlatformModel.js +1085 -204
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +85 -82
- package/sdk/platform/Discount/DiscountPlatformClient.js +333 -175
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +281 -15
- package/sdk/platform/Discount/DiscountPlatformModel.js +189 -10
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +185 -13
- package/sdk/platform/Discount/DiscountPlatformValidator.js +88 -8
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +109 -52
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +570 -105
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +141 -6
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +118 -7
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +43 -63
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +153 -135
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +426 -20
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +379 -40
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +106 -8
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +60 -8
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +260 -129
- package/sdk/platform/Finance/FinancePlatformClient.js +1182 -194
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +1267 -50
- package/sdk/platform/Finance/FinancePlatformModel.js +1252 -38
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +233 -15
- package/sdk/platform/Finance/FinancePlatformValidator.js +229 -16
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +111 -97
- package/sdk/platform/Inventory/InventoryPlatformClient.js +330 -199
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +1354 -61
- package/sdk/platform/Inventory/InventoryPlatformModel.js +916 -83
- package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +168 -12
- package/sdk/platform/Inventory/InventoryPlatformValidator.js +82 -6
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +100 -106
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +372 -186
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +180 -14
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +94 -9
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +89 -104
- package/sdk/platform/Lead/LeadPlatformClient.js +305 -180
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +1045 -54
- package/sdk/platform/Lead/LeadPlatformModel.js +504 -142
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +173 -12
- package/sdk/platform/Lead/LeadPlatformValidator.js +92 -15
- package/sdk/platform/OAuthClient.js +6 -2
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +20 -14
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +58 -29
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +26 -4
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +16 -3
- package/sdk/platform/Order/OrderPlatformClient.d.ts +437 -556
- package/sdk/platform/Order/OrderPlatformClient.js +1500 -760
- package/sdk/platform/Order/OrderPlatformModel.d.ts +5225 -247
- package/sdk/platform/Order/OrderPlatformModel.js +3473 -260
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +859 -37
- package/sdk/platform/Order/OrderPlatformValidator.js +435 -23
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +16 -42
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -155
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +37 -6
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +19 -17
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +78 -45
- package/sdk/platform/Partner/PartnerPlatformModel.js +43 -369
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +418 -288
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +1509 -505
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +438 -30
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +312 -19
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +83 -73
- package/sdk/platform/Payment/PaymentPlatformClient.js +259 -154
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +3200 -93
- package/sdk/platform/Payment/PaymentPlatformModel.js +1334 -36
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +111 -11
- package/sdk/platform/Payment/PaymentPlatformValidator.js +68 -7
- package/sdk/platform/PlatformAPIClient.d.ts +16 -1
- package/sdk/platform/PlatformAPIClient.js +9 -1
- package/sdk/platform/PlatformApplicationClient.d.ts +22 -1798
- package/sdk/platform/PlatformApplicationClient.js +17 -1899
- package/sdk/platform/PlatformClient.d.ts +31 -12581
- package/sdk/platform/PlatformClient.js +30 -15089
- package/sdk/platform/PlatformConfig.d.ts +37 -11
- package/sdk/platform/PlatformConfig.js +32 -6
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +96 -92
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +344 -177
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +149 -12
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +82 -8
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +360 -23
- package/sdk/platform/Rewards/RewardsPlatformModel.js +238 -22
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +159 -92
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +473 -208
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +138 -13
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +100 -14
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +166 -178
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +518 -329
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1408 -96
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1034 -71
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +280 -18
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +134 -11
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +41 -66
- package/sdk/platform/Share/SharePlatformApplicationClient.js +149 -116
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +87 -7
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +42 -5
- package/sdk/platform/Share/SharePlatformModel.d.ts +250 -16
- package/sdk/platform/Share/SharePlatformModel.js +167 -19
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +229 -193
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +976 -352
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +345 -24
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +206 -14
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +37 -0
- package/sdk/platform/Theme/ThemePlatformClient.js +235 -0
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +1527 -48
- package/sdk/platform/Theme/ThemePlatformModel.js +1099 -118
- package/sdk/platform/Theme/ThemePlatformValidator.d.ts +32 -0
- package/sdk/platform/Theme/ThemePlatformValidator.js +38 -0
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +138 -152
- package/sdk/platform/User/UserPlatformApplicationClient.js +470 -244
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +242 -18
- package/sdk/platform/User/UserPlatformApplicationValidator.js +129 -12
- package/sdk/platform/User/UserPlatformModel.d.ts +653 -101
- package/sdk/platform/User/UserPlatformModel.js +467 -424
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +153 -49
- package/sdk/platform/Webhook/WebhookPlatformClient.js +896 -88
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +632 -16
- package/sdk/platform/Webhook/WebhookPlatformModel.js +502 -54
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +170 -7
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +157 -7
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +16 -21
- package/sdk/public/Configuration/ConfigurationPublicClient.js +48 -33
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +370 -19
- package/sdk/public/Configuration/ConfigurationPublicModel.js +191 -40
- package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +42 -4
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +21 -3
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +54 -48
- package/sdk/public/Inventory/InventoryPublicClient.js +161 -98
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +392 -21
- package/sdk/public/Inventory/InventoryPublicModel.js +267 -27
- package/sdk/public/Inventory/InventoryPublicValidator.d.ts +90 -8
- package/sdk/public/Inventory/InventoryPublicValidator.js +44 -4
- package/sdk/public/Partner/PartnerPublicClient.d.ts +22 -0
- package/sdk/public/Partner/PartnerPublicClient.js +110 -0
- package/sdk/public/Partner/PartnerPublicModel.d.ts +240 -0
- package/sdk/public/Partner/PartnerPublicModel.js +280 -0
- package/sdk/public/Partner/PartnerPublicValidator.d.ts +18 -0
- package/sdk/public/Partner/PartnerPublicValidator.js +19 -0
- package/sdk/public/PublicAPIClient.d.ts +14 -1
- package/sdk/public/PublicAPIClient.js +7 -1
- package/sdk/public/PublicClient.d.ts +21 -3
- package/sdk/public/PublicClient.js +20 -0
- package/sdk/public/PublicConfig.d.ts +27 -6
- package/sdk/public/PublicConfig.js +17 -1
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +16 -11
- package/sdk/public/Webhook/WebhookPublicClient.js +48 -27
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +52 -16
- package/sdk/public/Webhook/WebhookPublicModel.js +33 -113
- package/sdk/public/Webhook/WebhookPublicValidator.d.ts +18 -3
- package/sdk/public/Webhook/WebhookPublicValidator.js +14 -4
- package/sdk/public/index.d.ts +1 -0
- package/sdk/public/index.js +2 -0
- package/sdk/application/ApplicationModels.d.ts +0 -3
- package/sdk/application/ApplicationModels.js +0 -20
- package/sdk/platform/Partner/PartnerPlatformClient.d.ts +0 -145
- package/sdk/platform/Partner/PartnerPlatformClient.js +0 -799
- package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +0 -14
- package/sdk/platform/Partner/PartnerPlatformValidator.js +0 -87
|
@@ -1,11 +1,568 @@
|
|
|
1
1
|
const Joi = require("joi");
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @typedef BadRequest
|
|
5
|
+
* @property {string} [message] - Failure message.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @typedef CancelSubscriptionReq
|
|
10
|
+
* @property {string} [product_suite]
|
|
11
|
+
* @property {string} [subscription_id]
|
|
12
|
+
* @property {string} [type]
|
|
13
|
+
* @property {string} [unique_id]
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @typedef CancelSubscriptionRes
|
|
18
|
+
* @property {Subscription} [data]
|
|
19
|
+
* @property {boolean} [success]
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @typedef ChargeLineItem
|
|
24
|
+
* @property {number} [capped_amount]
|
|
25
|
+
* @property {boolean} [is_test]
|
|
26
|
+
* @property {Object} [metadata]
|
|
27
|
+
* @property {string} name
|
|
28
|
+
* @property {EntityChargePrice} price
|
|
29
|
+
* @property {string} pricing_type
|
|
30
|
+
* @property {EntityChargeRecurring} [recurring]
|
|
31
|
+
* @property {string} term
|
|
32
|
+
* @property {number} [trial_days]
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @typedef CheckValidityResponse
|
|
37
|
+
* @property {number} [discount_amount]
|
|
38
|
+
* @property {boolean} [is_valid]
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @typedef CreateOneTimeCharge
|
|
43
|
+
* @property {OneTimeChargeItem} charge
|
|
44
|
+
* @property {boolean} [is_test]
|
|
45
|
+
* @property {string} name
|
|
46
|
+
* @property {string} return_url
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @typedef CreateOneTimeChargeResponse
|
|
51
|
+
* @property {OneTimeChargeEntity} [charge]
|
|
52
|
+
* @property {string} [confirm_url]
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @typedef CreateSubscriptionCharge
|
|
57
|
+
* @property {boolean} [is_test]
|
|
58
|
+
* @property {ChargeLineItem[]} line_items
|
|
59
|
+
* @property {string} name
|
|
60
|
+
* @property {string} return_url
|
|
61
|
+
* @property {number} [trial_days]
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @typedef CreateSubscriptionResponse
|
|
66
|
+
* @property {string} [confirm_url]
|
|
67
|
+
* @property {EntitySubscription} [subscription]
|
|
68
|
+
*/
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @typedef CurrentPeriod
|
|
72
|
+
* @property {string} [end_date]
|
|
73
|
+
* @property {string} [start_date]
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @typedef EntityChargePrice
|
|
78
|
+
* @property {number} amount - Amount for price. Minimum value 1
|
|
79
|
+
* @property {string} currency_code
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @typedef EntityChargeRecurring
|
|
84
|
+
* @property {string} interval
|
|
85
|
+
*/
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @typedef EntitySubscription
|
|
89
|
+
* @property {string} [_id]
|
|
90
|
+
* @property {string} [activated_on]
|
|
91
|
+
* @property {string} [cancelled_on]
|
|
92
|
+
* @property {number} [company_id]
|
|
93
|
+
* @property {SubscriptionCharge[]} [line_items]
|
|
94
|
+
* @property {Object} [metadata]
|
|
95
|
+
* @property {string} [name]
|
|
96
|
+
* @property {string} [status]
|
|
97
|
+
* @property {number} [trial_days]
|
|
98
|
+
* @property {SubscriptionTrialPeriod} [trial_period]
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @typedef InternalServerError
|
|
103
|
+
* @property {string} [code] - Error code
|
|
104
|
+
* @property {string} [message] - Internal server Server error
|
|
105
|
+
*/
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @typedef Invoice
|
|
109
|
+
* @property {InvoiceDetails} [invoice]
|
|
110
|
+
* @property {InvoiceItems[]} [invoice_items]
|
|
111
|
+
*/
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @typedef InvoiceDetails
|
|
115
|
+
* @property {string} [_id]
|
|
116
|
+
* @property {number} [attemp]
|
|
117
|
+
* @property {boolean} [auto_advance]
|
|
118
|
+
* @property {InvoiceDetailsClient} [client]
|
|
119
|
+
* @property {string} [collection_method]
|
|
120
|
+
* @property {string} [created_at]
|
|
121
|
+
* @property {string} [currency]
|
|
122
|
+
* @property {string} [current_status]
|
|
123
|
+
* @property {string} [hash_identifier]
|
|
124
|
+
* @property {string} [invoice_url]
|
|
125
|
+
* @property {string} [modified_at]
|
|
126
|
+
* @property {string} [next_action_time]
|
|
127
|
+
* @property {string} [number]
|
|
128
|
+
* @property {boolean} [paid]
|
|
129
|
+
* @property {InvoicePaymentMethod} [payment_method]
|
|
130
|
+
* @property {InvoiceDetailsPeriod} [period]
|
|
131
|
+
* @property {Object} [pg_data]
|
|
132
|
+
* @property {string} [receipt_number]
|
|
133
|
+
* @property {string} [statement_descriptor]
|
|
134
|
+
* @property {InvoiceDetailsStatusTrail[]} [status_trail]
|
|
135
|
+
* @property {string} [subscriber_id]
|
|
136
|
+
* @property {string} [subscription]
|
|
137
|
+
* @property {number} [subtotal]
|
|
138
|
+
* @property {number} [total]
|
|
139
|
+
*/
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @typedef InvoiceDetailsClient
|
|
143
|
+
* @property {string[]} [address_lines]
|
|
144
|
+
* @property {string} [email]
|
|
145
|
+
* @property {string} [name]
|
|
146
|
+
* @property {string} [phone]
|
|
147
|
+
*/
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* @typedef InvoiceDetailsPeriod
|
|
151
|
+
* @property {string} [end]
|
|
152
|
+
* @property {string} [start]
|
|
153
|
+
*/
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @typedef InvoiceDetailsStatusTrail
|
|
157
|
+
* @property {string} [_id]
|
|
158
|
+
* @property {string} [timestamp]
|
|
159
|
+
* @property {string} [value]
|
|
160
|
+
*/
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* @typedef InvoiceItems
|
|
164
|
+
* @property {string} [_id]
|
|
165
|
+
* @property {number} [amount]
|
|
166
|
+
* @property {string} [created_at]
|
|
167
|
+
* @property {string} [currency]
|
|
168
|
+
* @property {string} [description]
|
|
169
|
+
* @property {string} [invoice_id]
|
|
170
|
+
* @property {string} [modified_at]
|
|
171
|
+
* @property {string} [name]
|
|
172
|
+
* @property {InvoiceItemsPeriod} [period]
|
|
173
|
+
* @property {InvoiceItemsPlan} [plan]
|
|
174
|
+
* @property {number} [quantity]
|
|
175
|
+
* @property {string} [type]
|
|
176
|
+
* @property {number} [unit_amount]
|
|
177
|
+
*/
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @typedef InvoiceItemsPeriod
|
|
181
|
+
* @property {string} [end]
|
|
182
|
+
* @property {string} [start]
|
|
183
|
+
*/
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* @typedef InvoiceItemsPlan
|
|
187
|
+
* @property {string} [_id]
|
|
188
|
+
* @property {string[]} [addons]
|
|
189
|
+
* @property {number} [amount]
|
|
190
|
+
* @property {string} [country]
|
|
191
|
+
* @property {string} [created_at]
|
|
192
|
+
* @property {string} [currency]
|
|
193
|
+
* @property {string} [description]
|
|
194
|
+
* @property {boolean} [is_active]
|
|
195
|
+
* @property {boolean} [is_trial_plan]
|
|
196
|
+
* @property {boolean} [is_visible]
|
|
197
|
+
* @property {string} [modified_at]
|
|
198
|
+
* @property {string} [name]
|
|
199
|
+
* @property {string} [plan_group]
|
|
200
|
+
* @property {string} [product_suite_id]
|
|
201
|
+
* @property {InvoiceItemsPlanRecurring} [recurring]
|
|
202
|
+
* @property {string[]} [tag_lines]
|
|
203
|
+
* @property {string[]} [tags]
|
|
204
|
+
* @property {number} [trial_period]
|
|
205
|
+
* @property {string} [type]
|
|
206
|
+
*/
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* @typedef InvoiceItemsPlanRecurring
|
|
210
|
+
* @property {string} [interval]
|
|
211
|
+
* @property {number} [interval_count]
|
|
212
|
+
*/
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* @typedef InvoicePaymentMethod
|
|
216
|
+
* @property {string} [pg_payment_method_id]
|
|
217
|
+
*/
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* @typedef Invoices
|
|
221
|
+
* @property {InvoicesData[]} [data]
|
|
222
|
+
* @property {number} [end]
|
|
223
|
+
* @property {number} [limit]
|
|
224
|
+
* @property {number} [page]
|
|
225
|
+
* @property {number} [start]
|
|
226
|
+
* @property {number} [total]
|
|
227
|
+
*/
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* @typedef InvoicesData
|
|
231
|
+
* @property {string} [_id]
|
|
232
|
+
* @property {number} [attemp]
|
|
233
|
+
* @property {boolean} [auto_advance]
|
|
234
|
+
* @property {InvoicesDataClient} [client]
|
|
235
|
+
* @property {string} [collection_method]
|
|
236
|
+
* @property {string} [created_at]
|
|
237
|
+
* @property {string} [currency]
|
|
238
|
+
* @property {string} [current_status]
|
|
239
|
+
* @property {string} [hash_identifier]
|
|
240
|
+
* @property {InvoiceItems[]} [invoice_items]
|
|
241
|
+
* @property {string} [invoice_url]
|
|
242
|
+
* @property {string} [modified_at]
|
|
243
|
+
* @property {string} [next_action_time]
|
|
244
|
+
* @property {string} [number]
|
|
245
|
+
* @property {boolean} [paid]
|
|
246
|
+
* @property {InvoicesDataPaymentMethod} [payment_method]
|
|
247
|
+
* @property {InvoicesDataPeriod} [period]
|
|
248
|
+
* @property {Object} [pg_data]
|
|
249
|
+
* @property {string} [receipt_number]
|
|
250
|
+
* @property {string} [statement_descriptor]
|
|
251
|
+
* @property {InvoiceDetailsStatusTrail[]} [status_trail]
|
|
252
|
+
* @property {string} [subscriber_id]
|
|
253
|
+
* @property {string} [subscription]
|
|
254
|
+
* @property {number} [subtotal]
|
|
255
|
+
* @property {number} [total]
|
|
256
|
+
*/
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* @typedef InvoicesDataClient
|
|
260
|
+
* @property {string[]} [address_lines]
|
|
261
|
+
* @property {string} [email]
|
|
262
|
+
* @property {string} [name]
|
|
263
|
+
* @property {string} [phone]
|
|
264
|
+
*/
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* @typedef InvoicesDataPaymentMethod
|
|
268
|
+
* @property {string} [pg_payment_method_id]
|
|
269
|
+
*/
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* @typedef InvoicesDataPeriod
|
|
273
|
+
* @property {string} [end]
|
|
274
|
+
* @property {string} [start]
|
|
275
|
+
*/
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* @typedef Meta
|
|
279
|
+
* @property {boolean} [is_custom_plan]
|
|
280
|
+
* @property {boolean} [is_plan_upgrade]
|
|
281
|
+
* @property {boolean} [subscribe]
|
|
282
|
+
*/
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* @typedef OneTimeChargeEntity
|
|
286
|
+
* @property {string} [_id]
|
|
287
|
+
* @property {string} [activated_on]
|
|
288
|
+
* @property {string} [cancelled_on]
|
|
289
|
+
* @property {string} [entity_id]
|
|
290
|
+
* @property {string} [entity_type]
|
|
291
|
+
* @property {boolean} [is_test]
|
|
292
|
+
* @property {Object} [meta]
|
|
293
|
+
* @property {Object} [metadata]
|
|
294
|
+
* @property {string} [name]
|
|
295
|
+
* @property {EntityChargePrice} [price]
|
|
296
|
+
* @property {string} [pricing_type]
|
|
297
|
+
* @property {string} [return_url]
|
|
298
|
+
* @property {string} [status]
|
|
299
|
+
* @property {string} [subscriber_id]
|
|
300
|
+
*/
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* @typedef OneTimeChargeItem
|
|
304
|
+
* @property {number} [capped_amount]
|
|
305
|
+
* @property {boolean} [is_test]
|
|
306
|
+
* @property {Object} [metadata]
|
|
307
|
+
* @property {string} name
|
|
308
|
+
* @property {EntityChargePrice} price
|
|
309
|
+
* @property {string} pricing_type
|
|
310
|
+
* @property {string} [term]
|
|
311
|
+
*/
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* @typedef Phone
|
|
315
|
+
* @property {string} [phone_country_code]
|
|
316
|
+
* @property {string} [phone_number]
|
|
317
|
+
*/
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* @typedef Plan
|
|
321
|
+
* @property {string} [_id]
|
|
322
|
+
* @property {string[]} [addons]
|
|
323
|
+
* @property {number} [amount]
|
|
324
|
+
* @property {string} [country]
|
|
325
|
+
* @property {string} [created_at]
|
|
326
|
+
* @property {string} [currency]
|
|
327
|
+
* @property {string} [description]
|
|
328
|
+
* @property {boolean} [is_active]
|
|
329
|
+
* @property {boolean} [is_trial_plan]
|
|
330
|
+
* @property {boolean} [is_visible]
|
|
331
|
+
* @property {string} [modified_at]
|
|
332
|
+
* @property {string} [name]
|
|
333
|
+
* @property {string} [plan_group]
|
|
334
|
+
* @property {string} [product_suite_id]
|
|
335
|
+
* @property {PlanRecurring} [recurring]
|
|
336
|
+
* @property {string[]} [tag_lines]
|
|
337
|
+
* @property {string[]} [tags]
|
|
338
|
+
* @property {number} [trial_period]
|
|
339
|
+
* @property {string} [type]
|
|
340
|
+
*/
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* @typedef PlanRecurring
|
|
344
|
+
* @property {string} [interval]
|
|
345
|
+
* @property {number} [interval_count]
|
|
346
|
+
*/
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* @typedef PlanStatusUpdateReq
|
|
350
|
+
* @property {string} [plan_id]
|
|
351
|
+
* @property {string} [reason]
|
|
352
|
+
* @property {string} [seller_status]
|
|
353
|
+
*/
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* @typedef ResourceNotFound
|
|
357
|
+
* @property {string} [message] - Resource not found with {id}
|
|
358
|
+
*/
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* @typedef SubscribePlanRes
|
|
362
|
+
* @property {string} [current_status]
|
|
363
|
+
* @property {Meta} [meta]
|
|
364
|
+
* @property {string} [redirect_url]
|
|
365
|
+
* @property {string} [transaction_id]
|
|
366
|
+
*/
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* @typedef Subscription
|
|
370
|
+
* @property {string} [_id]
|
|
371
|
+
* @property {boolean} [cancel_at_period_end]
|
|
372
|
+
* @property {string} [channel_type]
|
|
373
|
+
* @property {string} [collection_method]
|
|
374
|
+
* @property {string} [created_at]
|
|
375
|
+
* @property {SubscriptionCurrentPeriod} [current_period]
|
|
376
|
+
* @property {string} [current_status]
|
|
377
|
+
* @property {SubscriptionInvoiceSettings} [invoice_settings]
|
|
378
|
+
* @property {boolean} [is_active]
|
|
379
|
+
* @property {string} [latest_invoice]
|
|
380
|
+
* @property {string} [modified_at]
|
|
381
|
+
* @property {SubscriptionPauseCollection} [pause_collection]
|
|
382
|
+
* @property {Plan} [plan_data]
|
|
383
|
+
* @property {string} [plan_id]
|
|
384
|
+
* @property {string} [product_suite_id]
|
|
385
|
+
* @property {string} [subscriber_id]
|
|
386
|
+
* @property {SubscriptionTrial} [trial]
|
|
387
|
+
*/
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* @typedef SubscriptionActivateReq
|
|
391
|
+
* @property {string} [payment_method]
|
|
392
|
+
* @property {string} [plan_id]
|
|
393
|
+
* @property {string} [product_suite]
|
|
394
|
+
* @property {string} [type]
|
|
395
|
+
* @property {string} [unique_id]
|
|
396
|
+
*/
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* @typedef SubscriptionActivateRes
|
|
400
|
+
* @property {Subscription} [data]
|
|
401
|
+
* @property {boolean} [success]
|
|
402
|
+
*/
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* @typedef SubscriptionBillingAddress
|
|
406
|
+
* @property {string} [city]
|
|
407
|
+
* @property {string} [country]
|
|
408
|
+
* @property {string} [line1]
|
|
409
|
+
* @property {string} [line2]
|
|
410
|
+
* @property {string} [postal_code]
|
|
411
|
+
* @property {string} [state]
|
|
412
|
+
*/
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* @typedef SubscriptionCharge
|
|
416
|
+
* @property {string} [_id]
|
|
417
|
+
* @property {string} [activated_on]
|
|
418
|
+
* @property {string} [billing_date]
|
|
419
|
+
* @property {string} [cancelled_on]
|
|
420
|
+
* @property {number} [capped_amount]
|
|
421
|
+
* @property {CurrentPeriod} [current_period]
|
|
422
|
+
* @property {boolean} [is_test]
|
|
423
|
+
* @property {Object} [metadata]
|
|
424
|
+
* @property {string} [name]
|
|
425
|
+
* @property {EntityChargePrice} [price]
|
|
426
|
+
* @property {string} [pricing_type]
|
|
427
|
+
* @property {EntityChargeRecurring} [recurring]
|
|
428
|
+
* @property {string} [status]
|
|
429
|
+
* @property {string} [term] - Brief description for a charge
|
|
430
|
+
*/
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* @typedef SubscriptionCurrentPeriod
|
|
434
|
+
* @property {string} [end]
|
|
435
|
+
* @property {string} [start]
|
|
436
|
+
*/
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* @typedef SubscriptionCustomer
|
|
440
|
+
* @property {string} [_id]
|
|
441
|
+
* @property {SubscriptionBillingAddress} [billing_address]
|
|
442
|
+
* @property {string} [created_at]
|
|
443
|
+
* @property {Object} [data]
|
|
444
|
+
* @property {string} [email]
|
|
445
|
+
* @property {string} [modified_at]
|
|
446
|
+
* @property {string} [name]
|
|
447
|
+
* @property {Phone} [phone]
|
|
448
|
+
* @property {string} [type]
|
|
449
|
+
* @property {string} [unique_id]
|
|
450
|
+
*/
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* @typedef SubscriptionCustomerCreate
|
|
454
|
+
* @property {SubscriptionBillingAddress} [billing_address]
|
|
455
|
+
* @property {string} [email]
|
|
456
|
+
* @property {string} [name]
|
|
457
|
+
* @property {Phone} [phone]
|
|
458
|
+
* @property {string} [type]
|
|
459
|
+
* @property {string} [unique_id]
|
|
460
|
+
*/
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* @typedef SubscriptionInvoiceSettings
|
|
464
|
+
* @property {boolean} [charging]
|
|
465
|
+
* @property {boolean} [generation]
|
|
466
|
+
*/
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* @typedef SubscriptionLimit
|
|
470
|
+
* @property {SubscriptionLimitApplication} [application]
|
|
471
|
+
* @property {SubscriptionLimitExtensions} [extensions]
|
|
472
|
+
* @property {SubscriptionLimitIntegrations} [integrations]
|
|
473
|
+
* @property {boolean} [is_trial_plan]
|
|
474
|
+
* @property {SubscriptionLimitMarketplace} [marketplace]
|
|
475
|
+
* @property {SubscriptionLimitOtherPlatform} [other_platform]
|
|
476
|
+
* @property {SubscriptionLimitProducts} [products]
|
|
477
|
+
* @property {SubscriptionLimitTeam} [team]
|
|
478
|
+
*/
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* @typedef SubscriptionLimitApplication
|
|
482
|
+
* @property {boolean} [enabled]
|
|
483
|
+
* @property {number} [hard_limit]
|
|
484
|
+
* @property {number} [soft_limit]
|
|
485
|
+
*/
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* @typedef SubscriptionLimitExtensions
|
|
489
|
+
* @property {boolean} [enabled]
|
|
490
|
+
* @property {number} [limit]
|
|
491
|
+
*/
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* @typedef SubscriptionLimitIntegrations
|
|
495
|
+
* @property {boolean} [enabled]
|
|
496
|
+
* @property {number} [limit]
|
|
497
|
+
*/
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* @typedef SubscriptionLimitMarketplace
|
|
501
|
+
* @property {boolean} [enabled]
|
|
502
|
+
*/
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* @typedef SubscriptionLimitOtherPlatform
|
|
506
|
+
* @property {boolean} [enabled]
|
|
507
|
+
*/
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* @typedef SubscriptionLimitProducts
|
|
511
|
+
* @property {boolean} [bulk]
|
|
512
|
+
* @property {number} [limit]
|
|
513
|
+
*/
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* @typedef SubscriptionLimitTeam
|
|
517
|
+
* @property {number} [limit]
|
|
518
|
+
*/
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* @typedef SubscriptionPauseCollection
|
|
522
|
+
* @property {string} [behavior]
|
|
523
|
+
* @property {string} [resume_at]
|
|
524
|
+
*/
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* @typedef SubscriptionStatus
|
|
528
|
+
* @property {Subscription[]} [current_subscriptions]
|
|
529
|
+
* @property {boolean} [is_enabled]
|
|
530
|
+
* @property {InvoicesData} [latest_invoice]
|
|
531
|
+
* @property {string} [mandate_amount]
|
|
532
|
+
* @property {Plan} [next_plan]
|
|
533
|
+
* @property {Subscription} [subscription]
|
|
534
|
+
*/
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* @typedef SubscriptionTrial
|
|
538
|
+
* @property {string} [end]
|
|
539
|
+
* @property {string} [start]
|
|
540
|
+
*/
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* @typedef SubscriptionTrialPeriod
|
|
544
|
+
* @property {string} [end_date]
|
|
545
|
+
* @property {string} [start_date]
|
|
546
|
+
*/
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* @typedef SunscribePlan
|
|
550
|
+
* @property {string} [callback_url]
|
|
551
|
+
* @property {string} [collection_type]
|
|
552
|
+
* @property {string} [entity_type]
|
|
553
|
+
* @property {Meta} [meta]
|
|
554
|
+
* @property {string} [plan_id]
|
|
555
|
+
*/
|
|
556
|
+
|
|
557
|
+
class BillingPlatformModel {
|
|
558
|
+
/** @returns {BadRequest} */
|
|
4
559
|
static BadRequest() {
|
|
5
560
|
return Joi.object({
|
|
6
561
|
message: Joi.string().allow(""),
|
|
7
562
|
});
|
|
8
563
|
}
|
|
564
|
+
|
|
565
|
+
/** @returns {CancelSubscriptionReq} */
|
|
9
566
|
static CancelSubscriptionReq() {
|
|
10
567
|
return Joi.object({
|
|
11
568
|
product_suite: Joi.string().allow(""),
|
|
@@ -14,146 +571,139 @@ class BillingModel {
|
|
|
14
571
|
unique_id: Joi.string().allow(""),
|
|
15
572
|
});
|
|
16
573
|
}
|
|
574
|
+
|
|
575
|
+
/** @returns {CancelSubscriptionRes} */
|
|
17
576
|
static CancelSubscriptionRes() {
|
|
18
577
|
return Joi.object({
|
|
19
|
-
data:
|
|
578
|
+
data: BillingPlatformModel.Subscription(),
|
|
20
579
|
success: Joi.boolean(),
|
|
21
580
|
});
|
|
22
581
|
}
|
|
582
|
+
|
|
583
|
+
/** @returns {ChargeLineItem} */
|
|
23
584
|
static ChargeLineItem() {
|
|
24
585
|
return Joi.object({
|
|
25
586
|
capped_amount: Joi.number(),
|
|
26
587
|
is_test: Joi.boolean(),
|
|
27
588
|
metadata: Joi.any(),
|
|
28
589
|
name: Joi.string().allow("").required(),
|
|
29
|
-
price:
|
|
590
|
+
price: BillingPlatformModel.EntityChargePrice().required(),
|
|
30
591
|
pricing_type: Joi.string().allow("").required(),
|
|
31
|
-
recurring:
|
|
592
|
+
recurring: BillingPlatformModel.EntityChargeRecurring(),
|
|
32
593
|
term: Joi.string().allow("").required(),
|
|
33
594
|
trial_days: Joi.number(),
|
|
34
595
|
});
|
|
35
596
|
}
|
|
597
|
+
|
|
598
|
+
/** @returns {CheckValidityResponse} */
|
|
36
599
|
static CheckValidityResponse() {
|
|
37
600
|
return Joi.object({
|
|
38
601
|
discount_amount: Joi.number(),
|
|
39
602
|
is_valid: Joi.boolean(),
|
|
40
603
|
});
|
|
41
604
|
}
|
|
605
|
+
|
|
606
|
+
/** @returns {CreateOneTimeCharge} */
|
|
42
607
|
static CreateOneTimeCharge() {
|
|
43
608
|
return Joi.object({
|
|
44
|
-
charge:
|
|
609
|
+
charge: BillingPlatformModel.OneTimeChargeItem().required(),
|
|
45
610
|
is_test: Joi.boolean(),
|
|
46
611
|
name: Joi.string().allow("").required(),
|
|
47
612
|
return_url: Joi.string().allow("").required(),
|
|
48
613
|
});
|
|
49
614
|
}
|
|
615
|
+
|
|
616
|
+
/** @returns {CreateOneTimeChargeResponse} */
|
|
50
617
|
static CreateOneTimeChargeResponse() {
|
|
51
618
|
return Joi.object({
|
|
52
|
-
charge:
|
|
619
|
+
charge: BillingPlatformModel.OneTimeChargeEntity(),
|
|
53
620
|
confirm_url: Joi.string().allow(""),
|
|
54
621
|
});
|
|
55
622
|
}
|
|
623
|
+
|
|
624
|
+
/** @returns {CreateSubscriptionCharge} */
|
|
56
625
|
static CreateSubscriptionCharge() {
|
|
57
626
|
return Joi.object({
|
|
58
627
|
is_test: Joi.boolean(),
|
|
59
|
-
line_items: Joi.array()
|
|
628
|
+
line_items: Joi.array()
|
|
629
|
+
.items(BillingPlatformModel.ChargeLineItem())
|
|
630
|
+
.required(),
|
|
60
631
|
name: Joi.string().allow("").required(),
|
|
61
632
|
return_url: Joi.string().allow("").required(),
|
|
62
633
|
trial_days: Joi.number(),
|
|
63
634
|
});
|
|
64
635
|
}
|
|
636
|
+
|
|
637
|
+
/** @returns {CreateSubscriptionResponse} */
|
|
65
638
|
static CreateSubscriptionResponse() {
|
|
66
639
|
return Joi.object({
|
|
67
640
|
confirm_url: Joi.string().allow(""),
|
|
68
|
-
subscription:
|
|
641
|
+
subscription: BillingPlatformModel.EntitySubscription(),
|
|
69
642
|
});
|
|
70
643
|
}
|
|
644
|
+
|
|
645
|
+
/** @returns {CurrentPeriod} */
|
|
71
646
|
static CurrentPeriod() {
|
|
72
647
|
return Joi.object({
|
|
73
648
|
end_date: Joi.string().allow(""),
|
|
74
649
|
start_date: Joi.string().allow(""),
|
|
75
650
|
});
|
|
76
651
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
_id: Joi.string().allow(""),
|
|
80
|
-
addons: Joi.array().items(Joi.string().allow("")),
|
|
81
|
-
amount: Joi.number(),
|
|
82
|
-
components: Joi.array().items(BillingModel.DetailedPlanComponents()),
|
|
83
|
-
country: Joi.string().allow(""),
|
|
84
|
-
created_at: Joi.string().allow(""),
|
|
85
|
-
currency: Joi.string().allow(""),
|
|
86
|
-
description: Joi.string().allow(""),
|
|
87
|
-
is_active: Joi.boolean(),
|
|
88
|
-
is_trial_plan: Joi.boolean(),
|
|
89
|
-
is_visible: Joi.boolean(),
|
|
90
|
-
modified_at: Joi.string().allow(""),
|
|
91
|
-
name: Joi.string().allow(""),
|
|
92
|
-
plan_group: Joi.string().allow(""),
|
|
93
|
-
product_suite_id: Joi.string().allow(""),
|
|
94
|
-
recurring: BillingModel.PlanRecurring(),
|
|
95
|
-
tag_lines: Joi.array().items(Joi.string().allow("")),
|
|
96
|
-
tags: Joi.array().items(Joi.string().allow("")),
|
|
97
|
-
trial_period: Joi.number(),
|
|
98
|
-
type: Joi.string().allow(""),
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
static DetailedPlanComponents() {
|
|
102
|
-
return Joi.object({
|
|
103
|
-
config: Joi.any(),
|
|
104
|
-
description: Joi.string().allow(""),
|
|
105
|
-
display_text: Joi.string().allow(""),
|
|
106
|
-
enabled: Joi.boolean(),
|
|
107
|
-
group: Joi.string().allow(""),
|
|
108
|
-
icon: Joi.string().allow(""),
|
|
109
|
-
links: Joi.any(),
|
|
110
|
-
name: Joi.string().allow(""),
|
|
111
|
-
slug: Joi.string().allow(""),
|
|
112
|
-
});
|
|
113
|
-
}
|
|
652
|
+
|
|
653
|
+
/** @returns {EntityChargePrice} */
|
|
114
654
|
static EntityChargePrice() {
|
|
115
655
|
return Joi.object({
|
|
116
656
|
amount: Joi.number().required(),
|
|
117
657
|
currency_code: Joi.string().allow("").required(),
|
|
118
658
|
});
|
|
119
659
|
}
|
|
660
|
+
|
|
661
|
+
/** @returns {EntityChargeRecurring} */
|
|
120
662
|
static EntityChargeRecurring() {
|
|
121
663
|
return Joi.object({
|
|
122
664
|
interval: Joi.string().allow("").required(),
|
|
123
665
|
});
|
|
124
666
|
}
|
|
667
|
+
|
|
668
|
+
/** @returns {EntitySubscription} */
|
|
125
669
|
static EntitySubscription() {
|
|
126
670
|
return Joi.object({
|
|
127
671
|
_id: Joi.string().allow(""),
|
|
128
672
|
activated_on: Joi.string().allow(""),
|
|
129
673
|
cancelled_on: Joi.string().allow(""),
|
|
130
674
|
company_id: Joi.number(),
|
|
131
|
-
line_items: Joi.array().items(
|
|
675
|
+
line_items: Joi.array().items(BillingPlatformModel.SubscriptionCharge()),
|
|
132
676
|
metadata: Joi.any(),
|
|
133
677
|
name: Joi.string().allow(""),
|
|
134
678
|
status: Joi.string().allow(""),
|
|
135
679
|
trial_days: Joi.number(),
|
|
136
|
-
trial_period:
|
|
680
|
+
trial_period: BillingPlatformModel.SubscriptionTrialPeriod(),
|
|
137
681
|
});
|
|
138
682
|
}
|
|
683
|
+
|
|
684
|
+
/** @returns {InternalServerError} */
|
|
139
685
|
static InternalServerError() {
|
|
140
686
|
return Joi.object({
|
|
141
687
|
code: Joi.string().allow(""),
|
|
142
688
|
message: Joi.string().allow(""),
|
|
143
689
|
});
|
|
144
690
|
}
|
|
691
|
+
|
|
692
|
+
/** @returns {Invoice} */
|
|
145
693
|
static Invoice() {
|
|
146
694
|
return Joi.object({
|
|
147
|
-
invoice:
|
|
148
|
-
invoice_items: Joi.array().items(
|
|
695
|
+
invoice: BillingPlatformModel.InvoiceDetails(),
|
|
696
|
+
invoice_items: Joi.array().items(BillingPlatformModel.InvoiceItems()),
|
|
149
697
|
});
|
|
150
698
|
}
|
|
699
|
+
|
|
700
|
+
/** @returns {InvoiceDetails} */
|
|
151
701
|
static InvoiceDetails() {
|
|
152
702
|
return Joi.object({
|
|
153
703
|
_id: Joi.string().allow(""),
|
|
154
704
|
attemp: Joi.number(),
|
|
155
705
|
auto_advance: Joi.boolean(),
|
|
156
|
-
client:
|
|
706
|
+
client: BillingPlatformModel.InvoiceDetailsClient(),
|
|
157
707
|
collection_method: Joi.string().allow(""),
|
|
158
708
|
created_at: Joi.string().allow(""),
|
|
159
709
|
currency: Joi.string().allow(""),
|
|
@@ -164,18 +714,22 @@ class BillingModel {
|
|
|
164
714
|
next_action_time: Joi.string().allow(""),
|
|
165
715
|
number: Joi.string().allow(""),
|
|
166
716
|
paid: Joi.boolean(),
|
|
167
|
-
payment_method:
|
|
168
|
-
period:
|
|
717
|
+
payment_method: BillingPlatformModel.InvoicePaymentMethod(),
|
|
718
|
+
period: BillingPlatformModel.InvoiceDetailsPeriod(),
|
|
169
719
|
pg_data: Joi.any(),
|
|
170
720
|
receipt_number: Joi.string().allow(""),
|
|
171
721
|
statement_descriptor: Joi.string().allow(""),
|
|
172
|
-
status_trail: Joi.array().items(
|
|
722
|
+
status_trail: Joi.array().items(
|
|
723
|
+
BillingPlatformModel.InvoiceDetailsStatusTrail()
|
|
724
|
+
),
|
|
173
725
|
subscriber_id: Joi.string().allow(""),
|
|
174
726
|
subscription: Joi.string().allow(""),
|
|
175
727
|
subtotal: Joi.number(),
|
|
176
728
|
total: Joi.number(),
|
|
177
729
|
});
|
|
178
730
|
}
|
|
731
|
+
|
|
732
|
+
/** @returns {InvoiceDetailsClient} */
|
|
179
733
|
static InvoiceDetailsClient() {
|
|
180
734
|
return Joi.object({
|
|
181
735
|
address_lines: Joi.array().items(Joi.string().allow("")),
|
|
@@ -184,55 +738,16 @@ class BillingModel {
|
|
|
184
738
|
phone: Joi.string().allow(""),
|
|
185
739
|
});
|
|
186
740
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
data: BillingModel.InvoiceDetailsPaymentMethodsData(),
|
|
190
|
-
id: Joi.number(),
|
|
191
|
-
is_default: Joi.boolean(),
|
|
192
|
-
pg_payment_method_id: Joi.string().allow(""),
|
|
193
|
-
type: Joi.string().allow(""),
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
static InvoiceDetailsPaymentMethodsData() {
|
|
197
|
-
return Joi.object({
|
|
198
|
-
brand: Joi.string().allow(""),
|
|
199
|
-
checks: BillingModel.InvoiceDetailsPaymentMethodsDataChecks(),
|
|
200
|
-
country: Joi.string().allow(""),
|
|
201
|
-
exp_month: Joi.number(),
|
|
202
|
-
exp_year: Joi.number(),
|
|
203
|
-
fingerprint: Joi.string().allow(""),
|
|
204
|
-
funding: Joi.string().allow(""),
|
|
205
|
-
generated_from: Joi.string().allow(""),
|
|
206
|
-
last4: Joi.string().allow(""),
|
|
207
|
-
networks: BillingModel.InvoiceDetailsPaymentMethodsDataNetworks(),
|
|
208
|
-
three_d_secure_usage: BillingModel.InvoiceDetailsPaymentMethodsDataThreeDSecureUsage(),
|
|
209
|
-
wallet: Joi.string().allow(""),
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
static InvoiceDetailsPaymentMethodsDataChecks() {
|
|
213
|
-
return Joi.object({
|
|
214
|
-
address_line1_check: Joi.string().allow(""),
|
|
215
|
-
address_postal_code_check: Joi.string().allow(""),
|
|
216
|
-
cvc_check: Joi.string().allow(""),
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
static InvoiceDetailsPaymentMethodsDataNetworks() {
|
|
220
|
-
return Joi.object({
|
|
221
|
-
available: Joi.array().items(Joi.string().allow("")),
|
|
222
|
-
preferred: Joi.string().allow(""),
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
static InvoiceDetailsPaymentMethodsDataThreeDSecureUsage() {
|
|
226
|
-
return Joi.object({
|
|
227
|
-
supported: Joi.boolean(),
|
|
228
|
-
});
|
|
229
|
-
}
|
|
741
|
+
|
|
742
|
+
/** @returns {InvoiceDetailsPeriod} */
|
|
230
743
|
static InvoiceDetailsPeriod() {
|
|
231
744
|
return Joi.object({
|
|
232
745
|
end: Joi.string().allow(""),
|
|
233
746
|
start: Joi.string().allow(""),
|
|
234
747
|
});
|
|
235
748
|
}
|
|
749
|
+
|
|
750
|
+
/** @returns {InvoiceDetailsStatusTrail} */
|
|
236
751
|
static InvoiceDetailsStatusTrail() {
|
|
237
752
|
return Joi.object({
|
|
238
753
|
_id: Joi.string().allow(""),
|
|
@@ -240,6 +755,8 @@ class BillingModel {
|
|
|
240
755
|
value: Joi.string().allow(""),
|
|
241
756
|
});
|
|
242
757
|
}
|
|
758
|
+
|
|
759
|
+
/** @returns {InvoiceItems} */
|
|
243
760
|
static InvoiceItems() {
|
|
244
761
|
return Joi.object({
|
|
245
762
|
_id: Joi.string().allow(""),
|
|
@@ -250,19 +767,23 @@ class BillingModel {
|
|
|
250
767
|
invoice_id: Joi.string().allow(""),
|
|
251
768
|
modified_at: Joi.string().allow(""),
|
|
252
769
|
name: Joi.string().allow(""),
|
|
253
|
-
period:
|
|
254
|
-
plan:
|
|
770
|
+
period: BillingPlatformModel.InvoiceItemsPeriod(),
|
|
771
|
+
plan: BillingPlatformModel.InvoiceItemsPlan(),
|
|
255
772
|
quantity: Joi.number(),
|
|
256
773
|
type: Joi.string().allow(""),
|
|
257
774
|
unit_amount: Joi.number(),
|
|
258
775
|
});
|
|
259
776
|
}
|
|
777
|
+
|
|
778
|
+
/** @returns {InvoiceItemsPeriod} */
|
|
260
779
|
static InvoiceItemsPeriod() {
|
|
261
780
|
return Joi.object({
|
|
262
781
|
end: Joi.string().allow(""),
|
|
263
782
|
start: Joi.string().allow(""),
|
|
264
783
|
});
|
|
265
784
|
}
|
|
785
|
+
|
|
786
|
+
/** @returns {InvoiceItemsPlan} */
|
|
266
787
|
static InvoiceItemsPlan() {
|
|
267
788
|
return Joi.object({
|
|
268
789
|
_id: Joi.string().allow(""),
|
|
@@ -279,27 +800,33 @@ class BillingModel {
|
|
|
279
800
|
name: Joi.string().allow(""),
|
|
280
801
|
plan_group: Joi.string().allow(""),
|
|
281
802
|
product_suite_id: Joi.string().allow(""),
|
|
282
|
-
recurring:
|
|
803
|
+
recurring: BillingPlatformModel.InvoiceItemsPlanRecurring(),
|
|
283
804
|
tag_lines: Joi.array().items(Joi.string().allow("")),
|
|
284
805
|
tags: Joi.array().items(Joi.string().allow("")),
|
|
285
806
|
trial_period: Joi.number(),
|
|
286
807
|
type: Joi.string().allow(""),
|
|
287
808
|
});
|
|
288
809
|
}
|
|
810
|
+
|
|
811
|
+
/** @returns {InvoiceItemsPlanRecurring} */
|
|
289
812
|
static InvoiceItemsPlanRecurring() {
|
|
290
813
|
return Joi.object({
|
|
291
814
|
interval: Joi.string().allow(""),
|
|
292
815
|
interval_count: Joi.number(),
|
|
293
816
|
});
|
|
294
817
|
}
|
|
818
|
+
|
|
819
|
+
/** @returns {InvoicePaymentMethod} */
|
|
295
820
|
static InvoicePaymentMethod() {
|
|
296
821
|
return Joi.object({
|
|
297
822
|
pg_payment_method_id: Joi.string().allow(""),
|
|
298
823
|
});
|
|
299
824
|
}
|
|
825
|
+
|
|
826
|
+
/** @returns {Invoices} */
|
|
300
827
|
static Invoices() {
|
|
301
828
|
return Joi.object({
|
|
302
|
-
data: Joi.array().items(
|
|
829
|
+
data: Joi.array().items(BillingPlatformModel.InvoicesData()),
|
|
303
830
|
end: Joi.number(),
|
|
304
831
|
limit: Joi.number(),
|
|
305
832
|
page: Joi.number(),
|
|
@@ -307,35 +834,41 @@ class BillingModel {
|
|
|
307
834
|
total: Joi.number(),
|
|
308
835
|
});
|
|
309
836
|
}
|
|
837
|
+
|
|
838
|
+
/** @returns {InvoicesData} */
|
|
310
839
|
static InvoicesData() {
|
|
311
840
|
return Joi.object({
|
|
312
841
|
_id: Joi.string().allow(""),
|
|
313
842
|
attemp: Joi.number(),
|
|
314
843
|
auto_advance: Joi.boolean(),
|
|
315
|
-
client:
|
|
844
|
+
client: BillingPlatformModel.InvoicesDataClient(),
|
|
316
845
|
collection_method: Joi.string().allow(""),
|
|
317
846
|
created_at: Joi.string().allow(""),
|
|
318
847
|
currency: Joi.string().allow(""),
|
|
319
848
|
current_status: Joi.string().allow(""),
|
|
320
849
|
hash_identifier: Joi.string().allow(""),
|
|
321
|
-
invoice_items: Joi.array().items(
|
|
850
|
+
invoice_items: Joi.array().items(BillingPlatformModel.InvoiceItems()),
|
|
322
851
|
invoice_url: Joi.string().allow(""),
|
|
323
852
|
modified_at: Joi.string().allow(""),
|
|
324
853
|
next_action_time: Joi.string().allow(""),
|
|
325
854
|
number: Joi.string().allow(""),
|
|
326
855
|
paid: Joi.boolean(),
|
|
327
|
-
payment_method:
|
|
328
|
-
period:
|
|
856
|
+
payment_method: BillingPlatformModel.InvoicesDataPaymentMethod(),
|
|
857
|
+
period: BillingPlatformModel.InvoicesDataPeriod(),
|
|
329
858
|
pg_data: Joi.any(),
|
|
330
859
|
receipt_number: Joi.string().allow(""),
|
|
331
860
|
statement_descriptor: Joi.string().allow(""),
|
|
332
|
-
status_trail: Joi.array().items(
|
|
861
|
+
status_trail: Joi.array().items(
|
|
862
|
+
BillingPlatformModel.InvoiceDetailsStatusTrail()
|
|
863
|
+
),
|
|
333
864
|
subscriber_id: Joi.string().allow(""),
|
|
334
865
|
subscription: Joi.string().allow(""),
|
|
335
866
|
subtotal: Joi.number(),
|
|
336
867
|
total: Joi.number(),
|
|
337
868
|
});
|
|
338
869
|
}
|
|
870
|
+
|
|
871
|
+
/** @returns {InvoicesDataClient} */
|
|
339
872
|
static InvoicesDataClient() {
|
|
340
873
|
return Joi.object({
|
|
341
874
|
address_lines: Joi.array().items(Joi.string().allow("")),
|
|
@@ -344,17 +877,32 @@ class BillingModel {
|
|
|
344
877
|
phone: Joi.string().allow(""),
|
|
345
878
|
});
|
|
346
879
|
}
|
|
880
|
+
|
|
881
|
+
/** @returns {InvoicesDataPaymentMethod} */
|
|
347
882
|
static InvoicesDataPaymentMethod() {
|
|
348
883
|
return Joi.object({
|
|
349
884
|
pg_payment_method_id: Joi.string().allow(""),
|
|
350
885
|
});
|
|
351
886
|
}
|
|
887
|
+
|
|
888
|
+
/** @returns {InvoicesDataPeriod} */
|
|
352
889
|
static InvoicesDataPeriod() {
|
|
353
890
|
return Joi.object({
|
|
354
891
|
end: Joi.string().allow(""),
|
|
355
892
|
start: Joi.string().allow(""),
|
|
356
893
|
});
|
|
357
894
|
}
|
|
895
|
+
|
|
896
|
+
/** @returns {Meta} */
|
|
897
|
+
static Meta() {
|
|
898
|
+
return Joi.object({
|
|
899
|
+
is_custom_plan: Joi.boolean(),
|
|
900
|
+
is_plan_upgrade: Joi.boolean(),
|
|
901
|
+
subscribe: Joi.boolean(),
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
/** @returns {OneTimeChargeEntity} */
|
|
358
906
|
static OneTimeChargeEntity() {
|
|
359
907
|
return Joi.object({
|
|
360
908
|
_id: Joi.string().allow(""),
|
|
@@ -366,41 +914,36 @@ class BillingModel {
|
|
|
366
914
|
meta: Joi.any(),
|
|
367
915
|
metadata: Joi.any(),
|
|
368
916
|
name: Joi.string().allow(""),
|
|
369
|
-
price:
|
|
917
|
+
price: BillingPlatformModel.EntityChargePrice(),
|
|
370
918
|
pricing_type: Joi.string().allow(""),
|
|
371
919
|
return_url: Joi.string().allow(""),
|
|
372
920
|
status: Joi.string().allow(""),
|
|
373
921
|
subscriber_id: Joi.string().allow(""),
|
|
374
922
|
});
|
|
375
923
|
}
|
|
924
|
+
|
|
925
|
+
/** @returns {OneTimeChargeItem} */
|
|
376
926
|
static OneTimeChargeItem() {
|
|
377
927
|
return Joi.object({
|
|
378
928
|
capped_amount: Joi.number(),
|
|
379
929
|
is_test: Joi.boolean(),
|
|
380
930
|
metadata: Joi.any(),
|
|
381
931
|
name: Joi.string().allow("").required(),
|
|
382
|
-
price:
|
|
932
|
+
price: BillingPlatformModel.EntityChargePrice().required(),
|
|
383
933
|
pricing_type: Joi.string().allow("").required(),
|
|
384
934
|
term: Joi.string().allow(""),
|
|
385
935
|
});
|
|
386
936
|
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
current: Joi.number(),
|
|
390
|
-
has_next: Joi.boolean(),
|
|
391
|
-
has_previous: Joi.boolean(),
|
|
392
|
-
item_total: Joi.number(),
|
|
393
|
-
next_id: Joi.string().allow(""),
|
|
394
|
-
size: Joi.number(),
|
|
395
|
-
type: Joi.string().allow("").required(),
|
|
396
|
-
});
|
|
397
|
-
}
|
|
937
|
+
|
|
938
|
+
/** @returns {Phone} */
|
|
398
939
|
static Phone() {
|
|
399
940
|
return Joi.object({
|
|
400
941
|
phone_country_code: Joi.string().allow(""),
|
|
401
942
|
phone_number: Joi.string().allow(""),
|
|
402
943
|
});
|
|
403
944
|
}
|
|
945
|
+
|
|
946
|
+
/** @returns {Plan} */
|
|
404
947
|
static Plan() {
|
|
405
948
|
return Joi.object({
|
|
406
949
|
_id: Joi.string().allow(""),
|
|
@@ -417,24 +960,49 @@ class BillingModel {
|
|
|
417
960
|
name: Joi.string().allow(""),
|
|
418
961
|
plan_group: Joi.string().allow(""),
|
|
419
962
|
product_suite_id: Joi.string().allow(""),
|
|
420
|
-
recurring:
|
|
963
|
+
recurring: BillingPlatformModel.PlanRecurring(),
|
|
421
964
|
tag_lines: Joi.array().items(Joi.string().allow("")),
|
|
422
965
|
tags: Joi.array().items(Joi.string().allow("")),
|
|
423
966
|
trial_period: Joi.number(),
|
|
424
967
|
type: Joi.string().allow(""),
|
|
425
968
|
});
|
|
426
969
|
}
|
|
970
|
+
|
|
971
|
+
/** @returns {PlanRecurring} */
|
|
427
972
|
static PlanRecurring() {
|
|
428
973
|
return Joi.object({
|
|
429
974
|
interval: Joi.string().allow(""),
|
|
430
975
|
interval_count: Joi.number(),
|
|
431
976
|
});
|
|
432
977
|
}
|
|
978
|
+
|
|
979
|
+
/** @returns {PlanStatusUpdateReq} */
|
|
980
|
+
static PlanStatusUpdateReq() {
|
|
981
|
+
return Joi.object({
|
|
982
|
+
plan_id: Joi.string().allow(""),
|
|
983
|
+
reason: Joi.string().allow(""),
|
|
984
|
+
seller_status: Joi.string().allow(""),
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
/** @returns {ResourceNotFound} */
|
|
433
989
|
static ResourceNotFound() {
|
|
434
990
|
return Joi.object({
|
|
435
991
|
message: Joi.string().allow(""),
|
|
436
992
|
});
|
|
437
993
|
}
|
|
994
|
+
|
|
995
|
+
/** @returns {SubscribePlanRes} */
|
|
996
|
+
static SubscribePlanRes() {
|
|
997
|
+
return Joi.object({
|
|
998
|
+
current_status: Joi.string().allow(""),
|
|
999
|
+
meta: BillingPlatformModel.Meta(),
|
|
1000
|
+
redirect_url: Joi.string().allow(""),
|
|
1001
|
+
transaction_id: Joi.string().allow(""),
|
|
1002
|
+
});
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
/** @returns {Subscription} */
|
|
438
1006
|
static Subscription() {
|
|
439
1007
|
return Joi.object({
|
|
440
1008
|
_id: Joi.string().allow(""),
|
|
@@ -442,20 +1010,22 @@ class BillingModel {
|
|
|
442
1010
|
channel_type: Joi.string().allow(""),
|
|
443
1011
|
collection_method: Joi.string().allow(""),
|
|
444
1012
|
created_at: Joi.string().allow(""),
|
|
445
|
-
current_period:
|
|
1013
|
+
current_period: BillingPlatformModel.SubscriptionCurrentPeriod(),
|
|
446
1014
|
current_status: Joi.string().allow(""),
|
|
447
|
-
invoice_settings:
|
|
1015
|
+
invoice_settings: BillingPlatformModel.SubscriptionInvoiceSettings(),
|
|
448
1016
|
is_active: Joi.boolean(),
|
|
449
1017
|
latest_invoice: Joi.string().allow(""),
|
|
450
1018
|
modified_at: Joi.string().allow(""),
|
|
451
|
-
pause_collection:
|
|
452
|
-
plan_data:
|
|
1019
|
+
pause_collection: BillingPlatformModel.SubscriptionPauseCollection(),
|
|
1020
|
+
plan_data: BillingPlatformModel.Plan(),
|
|
453
1021
|
plan_id: Joi.string().allow(""),
|
|
454
1022
|
product_suite_id: Joi.string().allow(""),
|
|
455
1023
|
subscriber_id: Joi.string().allow(""),
|
|
456
|
-
trial:
|
|
1024
|
+
trial: BillingPlatformModel.SubscriptionTrial(),
|
|
457
1025
|
});
|
|
458
1026
|
}
|
|
1027
|
+
|
|
1028
|
+
/** @returns {SubscriptionActivateReq} */
|
|
459
1029
|
static SubscriptionActivateReq() {
|
|
460
1030
|
return Joi.object({
|
|
461
1031
|
payment_method: Joi.string().allow(""),
|
|
@@ -465,12 +1035,16 @@ class BillingModel {
|
|
|
465
1035
|
unique_id: Joi.string().allow(""),
|
|
466
1036
|
});
|
|
467
1037
|
}
|
|
1038
|
+
|
|
1039
|
+
/** @returns {SubscriptionActivateRes} */
|
|
468
1040
|
static SubscriptionActivateRes() {
|
|
469
1041
|
return Joi.object({
|
|
470
|
-
data:
|
|
1042
|
+
data: BillingPlatformModel.Subscription(),
|
|
471
1043
|
success: Joi.boolean(),
|
|
472
1044
|
});
|
|
473
1045
|
}
|
|
1046
|
+
|
|
1047
|
+
/** @returns {SubscriptionBillingAddress} */
|
|
474
1048
|
static SubscriptionBillingAddress() {
|
|
475
1049
|
return Joi.object({
|
|
476
1050
|
city: Joi.string().allow(""),
|
|
@@ -481,6 +1055,8 @@ class BillingModel {
|
|
|
481
1055
|
state: Joi.string().allow(""),
|
|
482
1056
|
});
|
|
483
1057
|
}
|
|
1058
|
+
|
|
1059
|
+
/** @returns {SubscriptionCharge} */
|
|
484
1060
|
static SubscriptionCharge() {
|
|
485
1061
|
return Joi.object({
|
|
486
1062
|
_id: Joi.string().allow(""),
|
|
@@ -488,65 +1064,77 @@ class BillingModel {
|
|
|
488
1064
|
billing_date: Joi.string().allow(""),
|
|
489
1065
|
cancelled_on: Joi.string().allow(""),
|
|
490
1066
|
capped_amount: Joi.number(),
|
|
491
|
-
current_period:
|
|
1067
|
+
current_period: BillingPlatformModel.CurrentPeriod(),
|
|
492
1068
|
is_test: Joi.boolean(),
|
|
493
1069
|
metadata: Joi.any(),
|
|
494
1070
|
name: Joi.string().allow(""),
|
|
495
|
-
price:
|
|
1071
|
+
price: BillingPlatformModel.EntityChargePrice(),
|
|
496
1072
|
pricing_type: Joi.string().allow(""),
|
|
497
|
-
recurring:
|
|
1073
|
+
recurring: BillingPlatformModel.EntityChargeRecurring(),
|
|
498
1074
|
status: Joi.string().allow(""),
|
|
499
1075
|
term: Joi.string().allow(""),
|
|
500
1076
|
});
|
|
501
1077
|
}
|
|
1078
|
+
|
|
1079
|
+
/** @returns {SubscriptionCurrentPeriod} */
|
|
502
1080
|
static SubscriptionCurrentPeriod() {
|
|
503
1081
|
return Joi.object({
|
|
504
1082
|
end: Joi.string().allow(""),
|
|
505
1083
|
start: Joi.string().allow(""),
|
|
506
1084
|
});
|
|
507
1085
|
}
|
|
1086
|
+
|
|
1087
|
+
/** @returns {SubscriptionCustomer} */
|
|
508
1088
|
static SubscriptionCustomer() {
|
|
509
1089
|
return Joi.object({
|
|
510
1090
|
_id: Joi.string().allow(""),
|
|
511
|
-
billing_address:
|
|
1091
|
+
billing_address: BillingPlatformModel.SubscriptionBillingAddress(),
|
|
512
1092
|
created_at: Joi.string().allow(""),
|
|
513
1093
|
data: Joi.any(),
|
|
514
1094
|
email: Joi.string().allow(""),
|
|
515
1095
|
modified_at: Joi.string().allow(""),
|
|
516
1096
|
name: Joi.string().allow(""),
|
|
517
|
-
phone:
|
|
1097
|
+
phone: BillingPlatformModel.Phone(),
|
|
518
1098
|
type: Joi.string().allow(""),
|
|
519
1099
|
unique_id: Joi.string().allow(""),
|
|
520
1100
|
});
|
|
521
1101
|
}
|
|
1102
|
+
|
|
1103
|
+
/** @returns {SubscriptionCustomerCreate} */
|
|
522
1104
|
static SubscriptionCustomerCreate() {
|
|
523
1105
|
return Joi.object({
|
|
524
|
-
billing_address:
|
|
1106
|
+
billing_address: BillingPlatformModel.SubscriptionBillingAddress(),
|
|
525
1107
|
email: Joi.string().allow(""),
|
|
526
1108
|
name: Joi.string().allow(""),
|
|
527
|
-
phone:
|
|
1109
|
+
phone: BillingPlatformModel.Phone(),
|
|
528
1110
|
type: Joi.string().allow(""),
|
|
529
1111
|
unique_id: Joi.string().allow(""),
|
|
530
1112
|
});
|
|
531
1113
|
}
|
|
1114
|
+
|
|
1115
|
+
/** @returns {SubscriptionInvoiceSettings} */
|
|
532
1116
|
static SubscriptionInvoiceSettings() {
|
|
533
1117
|
return Joi.object({
|
|
534
1118
|
charging: Joi.boolean(),
|
|
535
1119
|
generation: Joi.boolean(),
|
|
536
1120
|
});
|
|
537
1121
|
}
|
|
1122
|
+
|
|
1123
|
+
/** @returns {SubscriptionLimit} */
|
|
538
1124
|
static SubscriptionLimit() {
|
|
539
1125
|
return Joi.object({
|
|
540
|
-
application:
|
|
541
|
-
extensions:
|
|
542
|
-
integrations:
|
|
1126
|
+
application: BillingPlatformModel.SubscriptionLimitApplication(),
|
|
1127
|
+
extensions: BillingPlatformModel.SubscriptionLimitExtensions(),
|
|
1128
|
+
integrations: BillingPlatformModel.SubscriptionLimitIntegrations(),
|
|
543
1129
|
is_trial_plan: Joi.boolean(),
|
|
544
|
-
marketplace:
|
|
545
|
-
other_platform:
|
|
546
|
-
products:
|
|
547
|
-
team:
|
|
1130
|
+
marketplace: BillingPlatformModel.SubscriptionLimitMarketplace(),
|
|
1131
|
+
other_platform: BillingPlatformModel.SubscriptionLimitOtherPlatform(),
|
|
1132
|
+
products: BillingPlatformModel.SubscriptionLimitProducts(),
|
|
1133
|
+
team: BillingPlatformModel.SubscriptionLimitTeam(),
|
|
548
1134
|
});
|
|
549
1135
|
}
|
|
1136
|
+
|
|
1137
|
+
/** @returns {SubscriptionLimitApplication} */
|
|
550
1138
|
static SubscriptionLimitApplication() {
|
|
551
1139
|
return Joi.object({
|
|
552
1140
|
enabled: Joi.boolean(),
|
|
@@ -554,76 +1142,99 @@ class BillingModel {
|
|
|
554
1142
|
soft_limit: Joi.number(),
|
|
555
1143
|
});
|
|
556
1144
|
}
|
|
1145
|
+
|
|
1146
|
+
/** @returns {SubscriptionLimitExtensions} */
|
|
557
1147
|
static SubscriptionLimitExtensions() {
|
|
558
1148
|
return Joi.object({
|
|
559
1149
|
enabled: Joi.boolean(),
|
|
560
1150
|
limit: Joi.number(),
|
|
561
1151
|
});
|
|
562
1152
|
}
|
|
1153
|
+
|
|
1154
|
+
/** @returns {SubscriptionLimitIntegrations} */
|
|
563
1155
|
static SubscriptionLimitIntegrations() {
|
|
564
1156
|
return Joi.object({
|
|
565
1157
|
enabled: Joi.boolean(),
|
|
566
1158
|
limit: Joi.number(),
|
|
567
1159
|
});
|
|
568
1160
|
}
|
|
1161
|
+
|
|
1162
|
+
/** @returns {SubscriptionLimitMarketplace} */
|
|
569
1163
|
static SubscriptionLimitMarketplace() {
|
|
570
1164
|
return Joi.object({
|
|
571
1165
|
enabled: Joi.boolean(),
|
|
572
1166
|
});
|
|
573
1167
|
}
|
|
1168
|
+
|
|
1169
|
+
/** @returns {SubscriptionLimitOtherPlatform} */
|
|
574
1170
|
static SubscriptionLimitOtherPlatform() {
|
|
575
1171
|
return Joi.object({
|
|
576
1172
|
enabled: Joi.boolean(),
|
|
577
1173
|
});
|
|
578
1174
|
}
|
|
1175
|
+
|
|
1176
|
+
/** @returns {SubscriptionLimitProducts} */
|
|
579
1177
|
static SubscriptionLimitProducts() {
|
|
580
1178
|
return Joi.object({
|
|
581
1179
|
bulk: Joi.boolean(),
|
|
582
1180
|
limit: Joi.number(),
|
|
583
1181
|
});
|
|
584
1182
|
}
|
|
1183
|
+
|
|
1184
|
+
/** @returns {SubscriptionLimitTeam} */
|
|
585
1185
|
static SubscriptionLimitTeam() {
|
|
586
1186
|
return Joi.object({
|
|
587
1187
|
limit: Joi.number(),
|
|
588
1188
|
});
|
|
589
1189
|
}
|
|
1190
|
+
|
|
1191
|
+
/** @returns {SubscriptionPauseCollection} */
|
|
590
1192
|
static SubscriptionPauseCollection() {
|
|
591
1193
|
return Joi.object({
|
|
592
1194
|
behavior: Joi.string().allow(""),
|
|
593
1195
|
resume_at: Joi.string().allow(""),
|
|
594
1196
|
});
|
|
595
1197
|
}
|
|
1198
|
+
|
|
1199
|
+
/** @returns {SubscriptionStatus} */
|
|
596
1200
|
static SubscriptionStatus() {
|
|
597
1201
|
return Joi.object({
|
|
598
|
-
current_subscriptions: Joi.array().items(
|
|
1202
|
+
current_subscriptions: Joi.array().items(
|
|
1203
|
+
BillingPlatformModel.Subscription()
|
|
1204
|
+
),
|
|
599
1205
|
is_enabled: Joi.boolean(),
|
|
600
|
-
latest_invoice:
|
|
1206
|
+
latest_invoice: BillingPlatformModel.InvoicesData(),
|
|
601
1207
|
mandate_amount: Joi.string().allow(""),
|
|
602
|
-
next_plan:
|
|
603
|
-
subscription:
|
|
1208
|
+
next_plan: BillingPlatformModel.Plan(),
|
|
1209
|
+
subscription: BillingPlatformModel.Subscription(),
|
|
604
1210
|
});
|
|
605
1211
|
}
|
|
1212
|
+
|
|
1213
|
+
/** @returns {SubscriptionTrial} */
|
|
606
1214
|
static SubscriptionTrial() {
|
|
607
1215
|
return Joi.object({
|
|
608
1216
|
end: Joi.string().allow(""),
|
|
609
1217
|
start: Joi.string().allow(""),
|
|
610
1218
|
});
|
|
611
1219
|
}
|
|
1220
|
+
|
|
1221
|
+
/** @returns {SubscriptionTrialPeriod} */
|
|
612
1222
|
static SubscriptionTrialPeriod() {
|
|
613
1223
|
return Joi.object({
|
|
614
1224
|
end_date: Joi.string().allow(""),
|
|
615
1225
|
start_date: Joi.string().allow(""),
|
|
616
1226
|
});
|
|
617
1227
|
}
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
});
|
|
622
|
-
}
|
|
623
|
-
static UnauthenticatedUser() {
|
|
1228
|
+
|
|
1229
|
+
/** @returns {SunscribePlan} */
|
|
1230
|
+
static SunscribePlan() {
|
|
624
1231
|
return Joi.object({
|
|
625
|
-
|
|
1232
|
+
callback_url: Joi.string().allow(""),
|
|
1233
|
+
collection_type: Joi.string().allow(""),
|
|
1234
|
+
entity_type: Joi.string().allow(""),
|
|
1235
|
+
meta: BillingPlatformModel.Meta(),
|
|
1236
|
+
plan_id: Joi.string().allow(""),
|
|
626
1237
|
});
|
|
627
1238
|
}
|
|
628
1239
|
}
|
|
629
|
-
module.exports =
|
|
1240
|
+
module.exports = BillingPlatformModel;
|