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