@frontegg/rest-api 2.10.90 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{dist/ContextHolder.d.ts → ContextHolder.d.ts} +0 -0
- package/ContextHolder.js +114 -0
- package/{dist/account-settings → account-settings}/index.d.ts +0 -0
- package/account-settings/index.js +47 -0
- package/{dist/account-settings → account-settings}/interfaces.d.ts +0 -0
- package/account-settings/interfaces.js +1 -0
- package/account-settings/package.json +6 -0
- package/{dist/audits → audits}/index.d.ts +0 -0
- package/audits/index.js +74 -0
- package/{dist/audits → audits}/interfaces.d.ts +0 -0
- package/audits/interfaces.js +1 -0
- package/audits/package.json +6 -0
- package/{dist/auth → auth}/enums.d.ts +0 -0
- package/auth/enums.js +18 -0
- package/{dist/auth → auth}/index.d.ts +0 -0
- package/auth/index.js +2102 -0
- package/{dist/auth → auth}/interfaces.d.ts +0 -0
- package/auth/interfaces.js +16 -0
- package/auth/package.json +6 -0
- package/{dist/auth → auth}/secutiry-poilicy/index.d.ts +0 -0
- package/auth/secutiry-poilicy/index.js +257 -0
- package/{dist/auth → auth}/secutiry-poilicy/interfaces.d.ts +0 -0
- package/auth/secutiry-poilicy/interfaces.js +1 -0
- package/{dist/connectivity → connectivity}/index.d.ts +0 -0
- package/connectivity/index.js +114 -0
- package/{dist/connectivity → connectivity}/interfaces.d.ts +0 -0
- package/connectivity/interfaces.js +1 -0
- package/connectivity/package.json +6 -0
- package/{dist/constants.d.ts → constants.d.ts} +0 -0
- package/{src/constants.ts → constants.js} +13 -13
- package/{dist/error.d.ts → error.d.ts} +0 -0
- package/error.js +36 -0
- package/fetch.d.ts +19 -0
- package/fetch.js +557 -0
- package/{dist/es2015/index.d.ts → index.d.ts} +0 -0
- package/{dist/es2015/index.js → index.js} +32 -28
- package/{dist/es2015/interfaces.d.ts → interfaces.d.ts} +0 -0
- package/interfaces.js +1 -0
- package/{dist/es2015/jwt.d.ts → jwt.d.ts} +0 -0
- package/jwt.js +105 -0
- package/{dist/es2015/metadata → metadata}/index.d.ts +0 -0
- package/metadata/index.js +166 -0
- package/{dist/es2015/metadata → metadata}/interfaces.d.ts +0 -0
- package/metadata/interfaces.js +1 -0
- package/metadata/package.json +6 -0
- package/node/ContextHolder.js +126 -0
- package/node/account-settings/index.js +61 -0
- package/node/account-settings/interfaces.js +5 -0
- package/node/audits/index.js +90 -0
- package/node/audits/interfaces.js +5 -0
- package/node/auth/enums.js +26 -0
- package/node/auth/index.js +2327 -0
- package/node/auth/interfaces.js +39 -0
- package/node/auth/secutiry-poilicy/index.js +279 -0
- package/node/auth/secutiry-poilicy/interfaces.js +5 -0
- package/node/connectivity/index.js +201 -0
- package/node/connectivity/interfaces.js +5 -0
- package/node/constants.js +177 -0
- package/node/error.js +50 -0
- package/node/fetch.js +589 -0
- package/node/index.js +359 -0
- package/node/interfaces.js +5 -0
- package/node/jwt.js +125 -0
- package/node/metadata/index.js +188 -0
- package/node/metadata/interfaces.js +5 -0
- package/node/notifications/index.js +115 -0
- package/node/notifications/interfaces.js +5 -0
- package/node/reports/index.js +205 -0
- package/node/reports/interfaces.js +5 -0
- package/node/roles/index.js +209 -0
- package/node/roles/interfaces.js +5 -0
- package/node/routers.js +13 -0
- package/node/sub-tenants/index.js +153 -0
- package/node/sub-tenants/interfaces.js +5 -0
- package/node/subscriptions/enums.js +39 -0
- package/node/subscriptions/index.js +135 -0
- package/node/subscriptions/interfaces.js +18 -0
- package/node/subscriptions/invoices.js +88 -0
- package/node/subscriptions/managedSubscriptions.js +135 -0
- package/node/subscriptions/paymentMethods.js +91 -0
- package/node/subscriptions/paymentProviders.js +38 -0
- package/node/subscriptions/plans.js +61 -0
- package/node/subscriptions/providers/index.js +18 -0
- package/node/subscriptions/providers/stripe/index.js +130 -0
- package/node/subscriptions/providers/stripe/interfaces.js +5 -0
- package/node/subscriptions/subscriptions.js +135 -0
- package/node/subscriptions/summaries.js +38 -0
- package/node/subscriptions/tenantConfiguration.js +61 -0
- package/node/teams/index.js +478 -0
- package/node/teams/interfaces.js +5 -0
- package/node/tenants/index.js +107 -0
- package/node/tenants/interfaces.js +5 -0
- package/node/vendor/index.js +40 -0
- package/node/vendor/interfaces.js +5 -0
- package/{dist/es2015/notifications → notifications}/index.d.ts +0 -0
- package/notifications/index.js +99 -0
- package/{dist/es2015/notifications → notifications}/interfaces.d.ts +0 -0
- package/notifications/interfaces.js +1 -0
- package/notifications/package.json +6 -0
- package/package.json +9 -32
- package/{dist/es2015/reports → reports}/index.d.ts +0 -0
- package/reports/index.js +185 -0
- package/{dist/es2015/reports → reports}/interfaces.d.ts +0 -0
- package/reports/interfaces.js +1 -0
- package/reports/package.json +6 -0
- package/{dist/es2015/roles → roles}/index.d.ts +0 -0
- package/roles/index.js +188 -0
- package/{dist/es2015/roles → roles}/interfaces.d.ts +0 -0
- package/roles/interfaces.js +1 -0
- package/roles/package.json +6 -0
- package/{dist/es2015/routers.d.ts → routers.d.ts} +0 -0
- package/routers.js +3 -0
- package/{dist/es2015/sub-tenants → sub-tenants}/index.d.ts +0 -0
- package/sub-tenants/index.js +135 -0
- package/{dist/es2015/sub-tenants → sub-tenants}/interfaces.d.ts +0 -0
- package/sub-tenants/interfaces.js +1 -0
- package/sub-tenants/package.json +6 -0
- package/{dist/es2015/subscriptions → subscriptions}/enums.d.ts +0 -0
- package/subscriptions/enums.js +29 -0
- package/{dist/es2015/subscriptions → subscriptions}/index.d.ts +0 -0
- package/{dist/subscriptions/index.d.ts → subscriptions/index.js} +1 -1
- package/{dist/es2015/subscriptions → subscriptions}/interfaces.d.ts +0 -0
- package/{dist/es2015/subscriptions → subscriptions}/interfaces.js +1 -1
- package/{dist/es2015/subscriptions → subscriptions}/invoices.d.ts +0 -0
- package/subscriptions/invoices.js +73 -0
- package/{dist/es2015/subscriptions → subscriptions}/managedSubscriptions.d.ts +0 -0
- package/subscriptions/managedSubscriptions.js +118 -0
- package/subscriptions/package.json +6 -0
- package/{dist/es2015/subscriptions → subscriptions}/paymentMethods.d.ts +0 -0
- package/subscriptions/paymentMethods.js +75 -0
- package/{dist/es2015/subscriptions → subscriptions}/paymentProviders.d.ts +0 -0
- package/subscriptions/paymentProviders.js +25 -0
- package/{dist/es2015/subscriptions → subscriptions}/plans.d.ts +0 -0
- package/subscriptions/plans.js +47 -0
- package/{dist/es2015/subscriptions → subscriptions}/providers/index.d.ts +0 -0
- package/subscriptions/providers/index.js +1 -0
- package/{dist/es2015/subscriptions → subscriptions}/providers/stripe/index.d.ts +0 -0
- package/subscriptions/providers/stripe/index.js +113 -0
- package/{dist/es2015/subscriptions → subscriptions}/providers/stripe/interfaces.d.ts +0 -0
- package/subscriptions/providers/stripe/interfaces.js +1 -0
- package/{dist/es2015/subscriptions → subscriptions}/subscriptions.d.ts +0 -0
- package/subscriptions/subscriptions.js +118 -0
- package/{dist/es2015/subscriptions → subscriptions}/summaries.d.ts +0 -0
- package/subscriptions/summaries.js +25 -0
- package/{dist/es2015/subscriptions → subscriptions}/tenantConfiguration.d.ts +0 -0
- package/subscriptions/tenantConfiguration.js +47 -0
- package/{dist/es2015/teams → teams}/index.d.ts +0 -0
- package/teams/index.js +445 -0
- package/{dist/es2015/teams → teams}/interfaces.d.ts +0 -0
- package/teams/interfaces.js +1 -0
- package/teams/package.json +6 -0
- package/{dist/es2015/tenants → tenants}/index.d.ts +0 -0
- package/tenants/index.js +91 -0
- package/{dist/es2015/tenants → tenants}/interfaces.d.ts +0 -0
- package/tenants/interfaces.js +1 -0
- package/tenants/package.json +6 -0
- package/{dist/es2015/vendor → vendor}/index.d.ts +0 -0
- package/vendor/index.js +27 -0
- package/{dist/es2015/vendor → vendor}/interfaces.d.ts +0 -0
- package/vendor/interfaces.js +1 -0
- package/vendor/package.json +6 -0
- package/CHANGELOG.md +0 -211
- package/README.md +0 -139
- package/SECURITY.md +0 -13
- package/dist/ContextHolder.js +0 -69
- package/dist/ContextHolder.js.map +0 -1
- package/dist/account-settings/index.js +0 -33
- package/dist/account-settings/index.js.map +0 -1
- package/dist/account-settings/interfaces.js +0 -3
- package/dist/account-settings/interfaces.js.map +0 -1
- package/dist/audits/index.js +0 -59
- package/dist/audits/index.js.map +0 -1
- package/dist/audits/interfaces.js +0 -3
- package/dist/audits/interfaces.js.map +0 -1
- package/dist/auth/enums.js +0 -19
- package/dist/auth/enums.js.map +0 -1
- package/dist/auth/index.js +0 -1042
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/interfaces.js +0 -29
- package/dist/auth/interfaces.js.map +0 -1
- package/dist/auth/secutiry-poilicy/index.js +0 -134
- package/dist/auth/secutiry-poilicy/index.js.map +0 -1
- package/dist/auth/secutiry-poilicy/interfaces.js +0 -3
- package/dist/auth/secutiry-poilicy/interfaces.js.map +0 -1
- package/dist/connectivity/index.js +0 -158
- package/dist/connectivity/index.js.map +0 -1
- package/dist/connectivity/interfaces.js +0 -3
- package/dist/connectivity/interfaces.js.map +0 -1
- package/dist/constants.js +0 -174
- package/dist/constants.js.map +0 -1
- package/dist/error.js +0 -14
- package/dist/error.js.map +0 -1
- package/dist/es2015/ContextHolder.d.ts +0 -29
- package/dist/es2015/ContextHolder.js +0 -65
- package/dist/es2015/ContextHolder.js.map +0 -1
- package/dist/es2015/account-settings/index.d.ts +0 -7
- package/dist/es2015/account-settings/index.js +0 -28
- package/dist/es2015/account-settings/index.js.map +0 -1
- package/dist/es2015/account-settings/interfaces.d.ts +0 -9
- package/dist/es2015/account-settings/interfaces.js +0 -2
- package/dist/es2015/account-settings/interfaces.js.map +0 -1
- package/dist/es2015/audits/index.d.ts +0 -16
- package/dist/es2015/audits/index.js +0 -53
- package/dist/es2015/audits/index.js.map +0 -1
- package/dist/es2015/audits/interfaces.d.ts +0 -61
- package/dist/es2015/audits/interfaces.js +0 -2
- package/dist/es2015/audits/interfaces.js.map +0 -1
- package/dist/es2015/auth/enums.d.ts +0 -13
- package/dist/es2015/auth/enums.js +0 -16
- package/dist/es2015/auth/enums.js.map +0 -1
- package/dist/es2015/auth/index.d.ts +0 -447
- package/dist/es2015/auth/index.js +0 -943
- package/dist/es2015/auth/index.js.map +0 -1
- package/dist/es2015/auth/interfaces.d.ts +0 -430
- package/dist/es2015/auth/interfaces.js +0 -16
- package/dist/es2015/auth/interfaces.js.map +0 -1
- package/dist/es2015/auth/secutiry-poilicy/index.d.ts +0 -41
- package/dist/es2015/auth/secutiry-poilicy/index.js +0 -121
- package/dist/es2015/auth/secutiry-poilicy/index.js.map +0 -1
- package/dist/es2015/auth/secutiry-poilicy/interfaces.d.ts +0 -70
- package/dist/es2015/auth/secutiry-poilicy/interfaces.js +0 -2
- package/dist/es2015/auth/secutiry-poilicy/interfaces.js.map +0 -1
- package/dist/es2015/connectivity/index.d.ts +0 -27
- package/dist/es2015/connectivity/index.js +0 -129
- package/dist/es2015/connectivity/index.js.map +0 -1
- package/dist/es2015/connectivity/interfaces.d.ts +0 -95
- package/dist/es2015/connectivity/interfaces.js +0 -2
- package/dist/es2015/connectivity/interfaces.js.map +0 -1
- package/dist/es2015/constants.d.ts +0 -170
- package/dist/es2015/constants.js +0 -171
- package/dist/es2015/constants.js.map +0 -1
- package/dist/es2015/error.d.ts +0 -5
- package/dist/es2015/error.js +0 -10
- package/dist/es2015/error.js.map +0 -1
- package/dist/es2015/fetch.d.ts +0 -19
- package/dist/es2015/fetch.js +0 -177
- package/dist/es2015/fetch.js.map +0 -1
- package/dist/es2015/index.js.map +0 -1
- package/dist/es2015/interfaces.js +0 -2
- package/dist/es2015/interfaces.js.map +0 -1
- package/dist/es2015/jwt.js +0 -83
- package/dist/es2015/jwt.js.map +0 -1
- package/dist/es2015/metadata/index.js +0 -32
- package/dist/es2015/metadata/index.js.map +0 -1
- package/dist/es2015/metadata/interfaces.js +0 -2
- package/dist/es2015/metadata/interfaces.js.map +0 -1
- package/dist/es2015/notifications/index.js +0 -49
- package/dist/es2015/notifications/index.js.map +0 -1
- package/dist/es2015/notifications/interfaces.js +0 -2
- package/dist/es2015/notifications/interfaces.js.map +0 -1
- package/dist/es2015/reports/index.js +0 -118
- package/dist/es2015/reports/index.js.map +0 -1
- package/dist/es2015/reports/interfaces.js +0 -2
- package/dist/es2015/reports/interfaces.js.map +0 -1
- package/dist/es2015/roles/index.js +0 -99
- package/dist/es2015/roles/index.js.map +0 -1
- package/dist/es2015/roles/interfaces.js +0 -2
- package/dist/es2015/roles/interfaces.js.map +0 -1
- package/dist/es2015/routers.js +0 -17
- package/dist/es2015/routers.js.map +0 -1
- package/dist/es2015/sub-tenants/index.js +0 -42
- package/dist/es2015/sub-tenants/index.js.map +0 -1
- package/dist/es2015/sub-tenants/interfaces.js +0 -2
- package/dist/es2015/sub-tenants/interfaces.js.map +0 -1
- package/dist/es2015/subscriptions/enums.js +0 -23
- package/dist/es2015/subscriptions/enums.js.map +0 -1
- package/dist/es2015/subscriptions/index.js +0 -11
- package/dist/es2015/subscriptions/index.js.map +0 -1
- package/dist/es2015/subscriptions/interfaces.js.map +0 -1
- package/dist/es2015/subscriptions/invoices.js +0 -43
- package/dist/es2015/subscriptions/invoices.js.map +0 -1
- package/dist/es2015/subscriptions/managedSubscriptions.js +0 -51
- package/dist/es2015/subscriptions/managedSubscriptions.js.map +0 -1
- package/dist/es2015/subscriptions/paymentMethods.js +0 -55
- package/dist/es2015/subscriptions/paymentMethods.js.map +0 -1
- package/dist/es2015/subscriptions/paymentProviders.js +0 -21
- package/dist/es2015/subscriptions/paymentProviders.js.map +0 -1
- package/dist/es2015/subscriptions/plans.js +0 -30
- package/dist/es2015/subscriptions/plans.js.map +0 -1
- package/dist/es2015/subscriptions/providers/index.js +0 -2
- package/dist/es2015/subscriptions/providers/index.js.map +0 -1
- package/dist/es2015/subscriptions/providers/stripe/index.js +0 -57
- package/dist/es2015/subscriptions/providers/stripe/index.js.map +0 -1
- package/dist/es2015/subscriptions/providers/stripe/interfaces.js +0 -2
- package/dist/es2015/subscriptions/providers/stripe/interfaces.js.map +0 -1
- package/dist/es2015/subscriptions/subscriptions.js +0 -57
- package/dist/es2015/subscriptions/subscriptions.js.map +0 -1
- package/dist/es2015/subscriptions/summaries.js +0 -21
- package/dist/es2015/subscriptions/summaries.js.map +0 -1
- package/dist/es2015/subscriptions/tenantConfiguration.js +0 -24
- package/dist/es2015/subscriptions/tenantConfiguration.js.map +0 -1
- package/dist/es2015/teams/index.js +0 -228
- package/dist/es2015/teams/index.js.map +0 -1
- package/dist/es2015/teams/interfaces.js +0 -2
- package/dist/es2015/teams/interfaces.js.map +0 -1
- package/dist/es2015/tenants/index.js +0 -57
- package/dist/es2015/tenants/index.js.map +0 -1
- package/dist/es2015/tenants/interfaces.js +0 -2
- package/dist/es2015/tenants/interfaces.js.map +0 -1
- package/dist/es2015/vendor/index.js +0 -23
- package/dist/es2015/vendor/index.js.map +0 -1
- package/dist/es2015/vendor/interfaces.js +0 -2
- package/dist/es2015/vendor/interfaces.js.map +0 -1
- package/dist/fetch.d.ts +0 -19
- package/dist/fetch.js +0 -187
- package/dist/fetch.js.map +0 -1
- package/dist/index.d.ts +0 -83
- package/dist/index.js +0 -98
- package/dist/index.js.map +0 -1
- package/dist/interfaces.d.ts +0 -40
- package/dist/interfaces.js +0 -3
- package/dist/interfaces.js.map +0 -1
- package/dist/jwt.d.ts +0 -13
- package/dist/jwt.js +0 -89
- package/dist/jwt.js.map +0 -1
- package/dist/metadata/index.d.ts +0 -5
- package/dist/metadata/index.js +0 -39
- package/dist/metadata/index.js.map +0 -1
- package/dist/metadata/interfaces.d.ts +0 -46
- package/dist/metadata/interfaces.js +0 -3
- package/dist/metadata/interfaces.js.map +0 -1
- package/dist/notifications/index.d.ts +0 -17
- package/dist/notifications/index.js +0 -56
- package/dist/notifications/index.js.map +0 -1
- package/dist/notifications/interfaces.d.ts +0 -40
- package/dist/notifications/interfaces.js +0 -3
- package/dist/notifications/interfaces.js.map +0 -1
- package/dist/reports/index.d.ts +0 -45
- package/dist/reports/index.js +0 -127
- package/dist/reports/index.js.map +0 -1
- package/dist/reports/interfaces.d.ts +0 -146
- package/dist/reports/interfaces.js +0 -3
- package/dist/reports/interfaces.js.map +0 -1
- package/dist/roles/index.d.ts +0 -34
- package/dist/roles/index.js +0 -110
- package/dist/roles/index.js.map +0 -1
- package/dist/roles/interfaces.d.ts +0 -58
- package/dist/roles/interfaces.js +0 -3
- package/dist/roles/interfaces.js.map +0 -1
- package/dist/routers.d.ts +0 -2
- package/dist/routers.js +0 -20
- package/dist/routers.js.map +0 -1
- package/dist/sub-tenants/index.d.ts +0 -8
- package/dist/sub-tenants/index.js +0 -51
- package/dist/sub-tenants/index.js.map +0 -1
- package/dist/sub-tenants/interfaces.d.ts +0 -87
- package/dist/sub-tenants/interfaces.js +0 -3
- package/dist/sub-tenants/interfaces.js.map +0 -1
- package/dist/subscriptions/enums.d.ts +0 -18
- package/dist/subscriptions/enums.js +0 -26
- package/dist/subscriptions/enums.js.map +0 -1
- package/dist/subscriptions/index.js +0 -23
- package/dist/subscriptions/index.js.map +0 -1
- package/dist/subscriptions/interfaces.d.ts +0 -117
- package/dist/subscriptions/interfaces.js +0 -14
- package/dist/subscriptions/interfaces.js.map +0 -1
- package/dist/subscriptions/invoices.d.ts +0 -13
- package/dist/subscriptions/invoices.js +0 -49
- package/dist/subscriptions/invoices.js.map +0 -1
- package/dist/subscriptions/managedSubscriptions.d.ts +0 -15
- package/dist/subscriptions/managedSubscriptions.js +0 -59
- package/dist/subscriptions/managedSubscriptions.js.map +0 -1
- package/dist/subscriptions/paymentMethods.d.ts +0 -13
- package/dist/subscriptions/paymentMethods.js +0 -61
- package/dist/subscriptions/paymentMethods.js.map +0 -1
- package/dist/subscriptions/paymentProviders.d.ts +0 -5
- package/dist/subscriptions/paymentProviders.js +0 -25
- package/dist/subscriptions/paymentProviders.js.map +0 -1
- package/dist/subscriptions/plans.d.ts +0 -9
- package/dist/subscriptions/plans.js +0 -35
- package/dist/subscriptions/plans.js.map +0 -1
- package/dist/subscriptions/providers/index.d.ts +0 -1
- package/dist/subscriptions/providers/index.js +0 -14
- package/dist/subscriptions/providers/index.js.map +0 -1
- package/dist/subscriptions/providers/stripe/index.d.ts +0 -21
- package/dist/subscriptions/providers/stripe/index.js +0 -65
- package/dist/subscriptions/providers/stripe/index.js.map +0 -1
- package/dist/subscriptions/providers/stripe/interfaces.d.ts +0 -32
- package/dist/subscriptions/providers/stripe/interfaces.js +0 -3
- package/dist/subscriptions/providers/stripe/interfaces.js.map +0 -1
- package/dist/subscriptions/subscriptions.d.ts +0 -21
- package/dist/subscriptions/subscriptions.js +0 -65
- package/dist/subscriptions/subscriptions.js.map +0 -1
- package/dist/subscriptions/summaries.d.ts +0 -5
- package/dist/subscriptions/summaries.js +0 -25
- package/dist/subscriptions/summaries.js.map +0 -1
- package/dist/subscriptions/tenantConfiguration.d.ts +0 -3
- package/dist/subscriptions/tenantConfiguration.js +0 -29
- package/dist/subscriptions/tenantConfiguration.js.map +0 -1
- package/dist/teams/index.d.ts +0 -116
- package/dist/teams/index.js +0 -250
- package/dist/teams/index.js.map +0 -1
- package/dist/teams/interfaces.d.ts +0 -136
- package/dist/teams/interfaces.js +0 -3
- package/dist/teams/interfaces.js.map +0 -1
- package/dist/tenants/index.d.ts +0 -26
- package/dist/tenants/index.js +0 -64
- package/dist/tenants/index.js.map +0 -1
- package/dist/tenants/interfaces.d.ts +0 -30
- package/dist/tenants/interfaces.js +0 -3
- package/dist/tenants/interfaces.js.map +0 -1
- package/dist/umd/index.js +0 -2891
- package/dist/vendor/index.d.ts +0 -6
- package/dist/vendor/index.js +0 -27
- package/dist/vendor/index.js.map +0 -1
- package/dist/vendor/interfaces.d.ts +0 -6
- package/dist/vendor/interfaces.js +0 -3
- package/dist/vendor/interfaces.js.map +0 -1
- package/src/ContextHolder.ts +0 -81
- package/src/account-settings/index.ts +0 -18
- package/src/account-settings/interfaces.ts +0 -10
- package/src/audits/index.ts +0 -35
- package/src/audits/interfaces.ts +0 -70
- package/src/auth/enums.ts +0 -17
- package/src/auth/index.ts +0 -935
- package/src/auth/interfaces.ts +0 -488
- package/src/auth/secutiry-poilicy/index.ts +0 -109
- package/src/auth/secutiry-poilicy/interfaces.ts +0 -81
- package/src/connectivity/index.ts +0 -160
- package/src/connectivity/interfaces.ts +0 -106
- package/src/error.ts +0 -13
- package/src/fetch.ts +0 -220
- package/src/index.ts +0 -86
- package/src/interfaces.ts +0 -47
- package/src/jwt.ts +0 -92
- package/src/metadata/index.ts +0 -24
- package/src/metadata/interfaces.ts +0 -51
- package/src/notifications/index.ts +0 -40
- package/src/notifications/interfaces.ts +0 -45
- package/src/reports/index.ts +0 -116
- package/src/reports/interfaces.ts +0 -167
- package/src/roles/index.ts +0 -80
- package/src/roles/interfaces.ts +0 -64
- package/src/routers.ts +0 -18
- package/src/sub-tenants/index.ts +0 -49
- package/src/sub-tenants/interfaces.ts +0 -100
- package/src/subscriptions/enums.ts +0 -22
- package/src/subscriptions/index.ts +0 -10
- package/src/subscriptions/interfaces.ts +0 -144
- package/src/subscriptions/invoices.ts +0 -42
- package/src/subscriptions/managedSubscriptions.ts +0 -53
- package/src/subscriptions/paymentMethods.ts +0 -47
- package/src/subscriptions/paymentProviders.ts +0 -13
- package/src/subscriptions/plans.ts +0 -19
- package/src/subscriptions/providers/index.ts +0 -1
- package/src/subscriptions/providers/stripe/index.ts +0 -56
- package/src/subscriptions/providers/stripe/interfaces.ts +0 -39
- package/src/subscriptions/subscriptions.ts +0 -63
- package/src/subscriptions/summaries.ts +0 -11
- package/src/subscriptions/tenantConfiguration.ts +0 -23
- package/src/teams/index.ts +0 -224
- package/src/teams/interfaces.ts +0 -163
- package/src/tenants/index.ts +0 -46
- package/src/tenants/interfaces.ts +0 -33
- package/src/vendor/index.ts +0 -12
- package/src/vendor/interfaces.ts +0 -6
- package/yarn-error.log +0 -518
package/src/sub-tenants/index.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { PaginationResult } from "../interfaces";
|
|
2
|
-
import { Delete, Get, Patch, Post } from "../fetch";
|
|
3
|
-
import { urls } from "../constants";
|
|
4
|
-
import {
|
|
5
|
-
AddUserToSubTenantsRequest,
|
|
6
|
-
ILoadAllUsers,
|
|
7
|
-
ISubTenantUser,
|
|
8
|
-
RemoveUserFromSubTenantsRequest,
|
|
9
|
-
UpdateUserRolesForSubTenantsRequestDto,
|
|
10
|
-
} from "./interfaces";
|
|
11
|
-
|
|
12
|
-
export async function loadAllUsers(
|
|
13
|
-
params: ILoadAllUsers
|
|
14
|
-
): Promise<PaginationResult<ISubTenantUser>> {
|
|
15
|
-
return Get(urls.identity.subTenants.v1, params);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export async function addUserToTenantAndSubTenants(
|
|
19
|
-
body: AddUserToSubTenantsRequest
|
|
20
|
-
): Promise<void> {
|
|
21
|
-
return Post(urls.identity.subTenants.v1, body);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export async function removeUserFromTenantAndSubTenants(
|
|
25
|
-
body: RemoveUserFromSubTenantsRequest
|
|
26
|
-
): Promise<void> {
|
|
27
|
-
return Delete(urls.identity.subTenants.v1, body);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export async function addUserRolesForSubTenants(
|
|
31
|
-
userId: string,
|
|
32
|
-
body: UpdateUserRolesForSubTenantsRequestDto
|
|
33
|
-
): Promise<void> {
|
|
34
|
-
return Post(`${urls.identity.subTenants.v1}/${userId}/roles`, body);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export async function removeUserRolesFromSubTenants(
|
|
38
|
-
userId: string,
|
|
39
|
-
body: UpdateUserRolesForSubTenantsRequestDto
|
|
40
|
-
): Promise<void> {
|
|
41
|
-
return Delete(`${urls.identity.subTenants.v1}/${userId}/roles`, body);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export async function setUserRolesForSubTenants(
|
|
45
|
-
userId: string,
|
|
46
|
-
body: UpdateUserRolesForSubTenantsRequestDto
|
|
47
|
-
): Promise<void> {
|
|
48
|
-
return Patch(`${urls.identity.subTenants.v1}/${userId}/roles`, body);
|
|
49
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { QueryFilter, QuerySort } from "../interfaces";
|
|
2
|
-
|
|
3
|
-
export type ILoadAllUsers = {
|
|
4
|
-
_offset: number;
|
|
5
|
-
_limit: number;
|
|
6
|
-
_filter: string;
|
|
7
|
-
_sortBy: string;
|
|
8
|
-
_order: "ASC" | "DESC";
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export type ISubTenantUserRole = {
|
|
12
|
-
id: string;
|
|
13
|
-
vendorId: string;
|
|
14
|
-
tenantId: string;
|
|
15
|
-
key: string;
|
|
16
|
-
name: string;
|
|
17
|
-
description: string;
|
|
18
|
-
isDefault: boolean;
|
|
19
|
-
firstUserRole: boolean;
|
|
20
|
-
level: number;
|
|
21
|
-
createdAt: Date;
|
|
22
|
-
updatedAt: Date;
|
|
23
|
-
permissions: string[];
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export type ISubTenantUserPermission = {
|
|
27
|
-
id: string;
|
|
28
|
-
key: string;
|
|
29
|
-
name: string;
|
|
30
|
-
description: string;
|
|
31
|
-
createdAt: Date;
|
|
32
|
-
updatedAt: Date;
|
|
33
|
-
roleIds: string[];
|
|
34
|
-
categoryId: string;
|
|
35
|
-
fePermission: boolean;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export type ISubTenantUserTenant = {
|
|
39
|
-
tenantId: string;
|
|
40
|
-
roles: ISubTenantUserRole[];
|
|
41
|
-
permissions: ISubTenantUserPermission[];
|
|
42
|
-
activated: boolean;
|
|
43
|
-
lastLogin: Date;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export type ISubTenantUser = {
|
|
47
|
-
id: string;
|
|
48
|
-
sub: string;
|
|
49
|
-
email: string;
|
|
50
|
-
verified: boolean;
|
|
51
|
-
mfaEnrolled: boolean;
|
|
52
|
-
mfaBypass?: boolean;
|
|
53
|
-
name?: string;
|
|
54
|
-
phoneNumber?: string;
|
|
55
|
-
profilePictureUrl?: string;
|
|
56
|
-
provider: string; // 'local' | 'saml' | 'google' | 'facebook';
|
|
57
|
-
tenantId: string;
|
|
58
|
-
tenantIds: string[];
|
|
59
|
-
isLocked?: boolean;
|
|
60
|
-
tenants: ISubTenantUserTenant[];
|
|
61
|
-
invisible?: true;
|
|
62
|
-
superUser?: true;
|
|
63
|
-
metadata: string;
|
|
64
|
-
createdAt: Date;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export interface AddUserToSubTenantsRequestUserDto {
|
|
68
|
-
email: string;
|
|
69
|
-
name?: string;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export interface AddUserToSubTenantsRequestTenantDto {
|
|
73
|
-
tenantId: string;
|
|
74
|
-
roleIds?: string[];
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export interface AddUserToSubTenantsRequest {
|
|
78
|
-
user: AddUserToSubTenantsRequestUserDto;
|
|
79
|
-
subTenants: AddUserToSubTenantsRequestTenantDto[];
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export interface RemoveUserFromSubTenantsRequestTenantDto {
|
|
83
|
-
tenantId: string;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export interface RemoveUserFromSubTenantsRequest {
|
|
87
|
-
userId: string;
|
|
88
|
-
subTenants: RemoveUserFromSubTenantsRequestTenantDto[];
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export interface UpdateUserRolesForSubTenantRequestDto {
|
|
92
|
-
tenantId: string;
|
|
93
|
-
roleIds: string[];
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export interface UpdateUserRolesForSubTenantsRequestDto {
|
|
97
|
-
subTenantsRoles: UpdateUserRolesForSubTenantRequestDto[];
|
|
98
|
-
ipAddress?: string;
|
|
99
|
-
userAgent?: string;
|
|
100
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export enum ISubscriptionStatus {
|
|
2
|
-
ACTIVE = "active",
|
|
3
|
-
CANCELED = "canceled",
|
|
4
|
-
INCOMPLETE = "incomplete",
|
|
5
|
-
EXPIRED = "expired",
|
|
6
|
-
TRIALING = "trialing",
|
|
7
|
-
TRIAL_ENDED = "trialEnded",
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export enum PaymentMethodType {
|
|
12
|
-
UNKNWON = "unknown",
|
|
13
|
-
CARD = "card",
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export enum ISubscriptionCancellationPolicy {
|
|
17
|
-
AT_PERIOD_END = "atPeriodEnd",
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export enum ProviderType {
|
|
21
|
-
Stripe = "Stripe",
|
|
22
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from './subscriptions';
|
|
2
|
-
export * from './managedSubscriptions';
|
|
3
|
-
export * from './plans';
|
|
4
|
-
export * from './invoices';
|
|
5
|
-
export * from './paymentMethods';
|
|
6
|
-
export * from './providers';
|
|
7
|
-
export * from './summaries';
|
|
8
|
-
export * from './tenantConfiguration';
|
|
9
|
-
export * from './paymentProviders';
|
|
10
|
-
export * from './enums';
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ISubscriptionCancellationPolicy,
|
|
3
|
-
ISubscriptionStatus,
|
|
4
|
-
PaymentMethodType,
|
|
5
|
-
ProviderType,
|
|
6
|
-
} from "./enums";
|
|
7
|
-
|
|
8
|
-
export * from "./providers/stripe/interfaces";
|
|
9
|
-
|
|
10
|
-
export interface IPlanResponse {
|
|
11
|
-
id: string;
|
|
12
|
-
externalId: string;
|
|
13
|
-
name: string;
|
|
14
|
-
description: string;
|
|
15
|
-
price: IPlanResponsePriceResponse;
|
|
16
|
-
slug: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface IPlanResponsePriceResponse {
|
|
20
|
-
id: string;
|
|
21
|
-
externalId: string;
|
|
22
|
-
currency: string;
|
|
23
|
-
amount: number;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface ISubscriptionResponse {
|
|
27
|
-
id: string;
|
|
28
|
-
externalId: string;
|
|
29
|
-
externallyManaged: boolean;
|
|
30
|
-
startDate: string;
|
|
31
|
-
currentPeriodStart: string;
|
|
32
|
-
currentPeriodEnd: string;
|
|
33
|
-
status: ISubscriptionStatus;
|
|
34
|
-
cancellation: ISubscriptionCancellationResponse | null;
|
|
35
|
-
trialEnd?: string;
|
|
36
|
-
plan: ISubscriptionPlanResponse;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface ISubscriptionPlanResponse {
|
|
40
|
-
slug: string;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface ISubscriptionCancellationResponse {
|
|
44
|
-
policy: ISubscriptionCancellationPolicy;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface ISubscriptionInvoiceResponse {
|
|
48
|
-
id: string;
|
|
49
|
-
externalId: string;
|
|
50
|
-
subscriptionId: string;
|
|
51
|
-
paymentDate: string;
|
|
52
|
-
totalAmount: number;
|
|
53
|
-
currency: string;
|
|
54
|
-
paid: boolean;
|
|
55
|
-
receiptNumber: string;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export type ISubscriptionPaymentMethodResponse =
|
|
59
|
-
| ISubscriptionPaymentMethodDefaultResponse
|
|
60
|
-
| ISubscriptionPaymentMethodCardResponse;
|
|
61
|
-
|
|
62
|
-
export interface ISubscriptionPaymentMethodDefaultResponse {
|
|
63
|
-
id: string;
|
|
64
|
-
externalId: string;
|
|
65
|
-
type: PaymentMethodType.UNKNWON;
|
|
66
|
-
isDefault: boolean;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface ISubscriptionPaymentMethodCardResponse {
|
|
70
|
-
id: string;
|
|
71
|
-
externalId: string;
|
|
72
|
-
type: PaymentMethodType.CARD;
|
|
73
|
-
isDefault: boolean;
|
|
74
|
-
last4: string;
|
|
75
|
-
expMonth: number;
|
|
76
|
-
expYear: number;
|
|
77
|
-
brand: string;
|
|
78
|
-
billingDetails: BillingDetailsResponse;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export interface ISubscriptionSummariesResponse {
|
|
82
|
-
tenantConfigurationId: string;
|
|
83
|
-
providerType: ProviderType;
|
|
84
|
-
subscriptionId: string;
|
|
85
|
-
externallyManaged: boolean;
|
|
86
|
-
currentPlanId: string;
|
|
87
|
-
paymentMethodId: string;
|
|
88
|
-
defaultPlanId: string;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export interface BillingDetailsResponse {
|
|
92
|
-
name: string;
|
|
93
|
-
email?: string;
|
|
94
|
-
address?: BillingDetailsAddress;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export interface BillingDetailsAddress {
|
|
98
|
-
addressLine1?: string;
|
|
99
|
-
addressLine2?: string;
|
|
100
|
-
city?: string;
|
|
101
|
-
state?: string;
|
|
102
|
-
postalCode?: string;
|
|
103
|
-
country?: string;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export interface ISubscriptionUpdatePaymentMethodBillingDetails {
|
|
107
|
-
email?: string;
|
|
108
|
-
address?: BillingDetailsAddress;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export interface ITenantConfigurationResponse {
|
|
112
|
-
id: string;
|
|
113
|
-
vendorId: string;
|
|
114
|
-
tenantId: string;
|
|
115
|
-
externallyManaged: string;
|
|
116
|
-
paymentProviderType: ProviderType;
|
|
117
|
-
mappingId: string;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export interface ICreateTenantConfigurationRequest {
|
|
121
|
-
tenantId: string;
|
|
122
|
-
externallyManaged?: string;
|
|
123
|
-
providerType: ProviderType;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export interface ICreateTenantConfigurationResponse {
|
|
127
|
-
id: string;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export interface IPaymentProviderResponse {
|
|
131
|
-
providerType: ProviderType;
|
|
132
|
-
name: string;
|
|
133
|
-
status: string;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export interface IUpdateSubscriptionRequest {
|
|
137
|
-
paymentMethodId: string;
|
|
138
|
-
planId: string;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export interface IUpdateManagedSubscriptionRequest {
|
|
142
|
-
paymentMethodId: string;
|
|
143
|
-
planId: string;
|
|
144
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { ISubscriptionInvoiceResponse } from "./interfaces";
|
|
2
|
-
import { Get } from "../fetch";
|
|
3
|
-
import { urls } from "../constants";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Get subscription invoices
|
|
7
|
-
*/
|
|
8
|
-
export async function getSubscriptionInvoices(): Promise<
|
|
9
|
-
ISubscriptionInvoiceResponse[]
|
|
10
|
-
> {
|
|
11
|
-
console.debug("getSubscriptionInvoices()");
|
|
12
|
-
return Get(urls.subscriptions.billing.invoices.v1);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Get subscription invoice
|
|
17
|
-
*/
|
|
18
|
-
export async function getSubscriptionInvoice(
|
|
19
|
-
invoiceId: string
|
|
20
|
-
): Promise<ISubscriptionInvoiceResponse> {
|
|
21
|
-
console.debug("getSubscriptionInvoice()", { invoiceId });
|
|
22
|
-
return Get(`${urls.subscriptions.billing.invoices.v1}/${invoiceId}`);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Get subscription invoice pdf file
|
|
27
|
-
*/
|
|
28
|
-
export async function getSubscriptionInvoicePdf(
|
|
29
|
-
invoiceId: string,
|
|
30
|
-
outputFileName?: string
|
|
31
|
-
): Promise<void> {
|
|
32
|
-
console.debug("getSubscriptionInvoicePdf()", { invoiceId });
|
|
33
|
-
return Get(
|
|
34
|
-
`${urls.subscriptions.billing.invoices.v1}/${invoiceId}/pdf`,
|
|
35
|
-
{
|
|
36
|
-
outputFileName,
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
responseType: "blob",
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { ISubscriptionResponse, IUpdateManagedSubscriptionRequest } from "./interfaces";
|
|
2
|
-
import { Get, Put } from "../fetch";
|
|
3
|
-
import { urls } from "../constants";
|
|
4
|
-
|
|
5
|
-
export async function getManagedSubscription(subscriptionId: string): Promise<ISubscriptionResponse> {
|
|
6
|
-
console.debug('getManagedSubscription()', {subscriptionId});
|
|
7
|
-
return Get(`${urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}`)
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export async function getManagedSubscriptions(): Promise<ISubscriptionResponse[]> {
|
|
11
|
-
console.debug('getManagedSubscriptions()');
|
|
12
|
-
return Get(`${urls.subscriptions.managedSubscriptions.v1}`)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Cancel tenant subscription
|
|
17
|
-
*/
|
|
18
|
-
export async function cancelManagedSubscription(
|
|
19
|
-
subscriptionId: string
|
|
20
|
-
): Promise<void> {
|
|
21
|
-
console.debug("cancelManagedSubscription()", { subscriptionId });
|
|
22
|
-
return Put(
|
|
23
|
-
`${urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}/cancellations/`,
|
|
24
|
-
{}
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Renew tenant subscription
|
|
30
|
-
*/
|
|
31
|
-
export async function renewManagedSubscription(
|
|
32
|
-
subscriptionId: string
|
|
33
|
-
): Promise<void> {
|
|
34
|
-
console.debug("renewManagedSubscription()", { subscriptionId });
|
|
35
|
-
return Put(
|
|
36
|
-
`${urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}/renewals/`,
|
|
37
|
-
{}
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Upgrade/Downgrade tenant subscription plan
|
|
43
|
-
*/
|
|
44
|
-
export async function updateManagedSubscription(
|
|
45
|
-
subscriptionId: string,
|
|
46
|
-
{ paymentMethodId, planId }: IUpdateManagedSubscriptionRequest
|
|
47
|
-
): Promise<void> {
|
|
48
|
-
console.debug("updateManagedSubscription()", { subscriptionId });
|
|
49
|
-
return Put(
|
|
50
|
-
`${urls.subscriptions.managedSubscriptions.v1}/${subscriptionId}`,
|
|
51
|
-
{ paymentMethodId, planId }
|
|
52
|
-
);
|
|
53
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BillingDetailsAddress,
|
|
3
|
-
ISubscriptionPaymentMethodResponse,
|
|
4
|
-
ISubscriptionUpdatePaymentMethodBillingDetails,
|
|
5
|
-
} from "./interfaces";
|
|
6
|
-
import { Get, Patch } from "../fetch";
|
|
7
|
-
import { urls } from "../constants";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Get payment methods
|
|
11
|
-
*/
|
|
12
|
-
export async function getPaymentMethods(): Promise<
|
|
13
|
-
ISubscriptionPaymentMethodResponse[]
|
|
14
|
-
> {
|
|
15
|
-
console.debug("getPaymentMethods()");
|
|
16
|
-
return Get(urls.subscriptions.billing.paymentMethods.v1);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Get payment method
|
|
21
|
-
*/
|
|
22
|
-
export async function getPaymentMethod(
|
|
23
|
-
paymentMethodId: string
|
|
24
|
-
): Promise<ISubscriptionPaymentMethodResponse> {
|
|
25
|
-
console.debug("getPaymentMethod()", { paymentMethodId });
|
|
26
|
-
return Get(
|
|
27
|
-
`${urls.subscriptions.billing.paymentMethods.v1}/${paymentMethodId}`
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Update payment method billing details
|
|
33
|
-
*/
|
|
34
|
-
export async function updatePaymentMethodBillingDetails(
|
|
35
|
-
paymentMethodId: string,
|
|
36
|
-
{ email, ...address }: ISubscriptionUpdatePaymentMethodBillingDetails
|
|
37
|
-
): Promise<ISubscriptionUpdatePaymentMethodBillingDetails> {
|
|
38
|
-
console.debug("updatePaymentMethodBillingDetails()", {
|
|
39
|
-
paymentMethodId,
|
|
40
|
-
email,
|
|
41
|
-
address,
|
|
42
|
-
});
|
|
43
|
-
return Patch(
|
|
44
|
-
`${urls.subscriptions.billing.paymentMethods.v1}/${paymentMethodId}/billing-details`,
|
|
45
|
-
{ email, address }
|
|
46
|
-
);
|
|
47
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { IPaymentProviderResponse } from "./interfaces";
|
|
2
|
-
import { Get } from "../fetch";
|
|
3
|
-
import { urls } from "../constants";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Gets payment providers for vendor
|
|
7
|
-
*/
|
|
8
|
-
export async function getPaymentProviders(): Promise<
|
|
9
|
-
IPaymentProviderResponse[]
|
|
10
|
-
> {
|
|
11
|
-
console.debug("getPaymentProviders()");
|
|
12
|
-
return Get(urls.subscriptions.paymentProviders.v1);
|
|
13
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {IPlanResponse} from './interfaces';
|
|
2
|
-
import {Get} from '../fetch';
|
|
3
|
-
import {urls} from '../constants';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Gets subscription plans
|
|
7
|
-
*/
|
|
8
|
-
export async function getSubscriptionPlans(): Promise<IPlanResponse[]> {
|
|
9
|
-
console.debug('getSubscriptionPlans()');
|
|
10
|
-
return Get(urls.subscriptions.billing.plans.v1);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Gets subscription plan singular
|
|
15
|
-
*/
|
|
16
|
-
export async function getSubscriptionPlan(planId: string): Promise<IPlanResponse[]> {
|
|
17
|
-
console.debug('getSubscriptionPlan()');
|
|
18
|
-
return Get(`${urls.subscriptions.billing.plans.v1}/${planId}`);
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './stripe';
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ICreateStripeCustomerRequest, ICreateStripeCustomerResponse,
|
|
3
|
-
ICreateStripeSubscriptionRequest,
|
|
4
|
-
ICreateSubscriptionResponse,
|
|
5
|
-
IStripeCustomerResponse, IStripePaymentProviderConfigurationResponse, ICreateStripePaymentMethodSetupRequest, ICreateStripePaymentMethodSetupResponse
|
|
6
|
-
} from "./interfaces";
|
|
7
|
-
import {Get, Post} from "../../../fetch";
|
|
8
|
-
import {urls} from "../../../constants";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Creates new stripe subscription
|
|
12
|
-
* @param request
|
|
13
|
-
*/
|
|
14
|
-
export async function createSubscription(
|
|
15
|
-
request: ICreateStripeSubscriptionRequest
|
|
16
|
-
): Promise<ICreateSubscriptionResponse> {
|
|
17
|
-
console.debug('createSubscription()');
|
|
18
|
-
return Post(urls.subscriptions.billing.paymentProviders.stripe.subscriptions.v1, request);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Fetch tenant mapping external stripe customer object
|
|
24
|
-
*/
|
|
25
|
-
export async function getStripeCustomer(tenantId: string): Promise<IStripeCustomerResponse> {
|
|
26
|
-
console.debug('getStripeCustomer()');
|
|
27
|
-
return Get(`${urls.subscriptions.billing.paymentProviders.stripe.customers.v1}/${tenantId}`);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Create tenant mapping external stripe customer object
|
|
32
|
-
* @param request
|
|
33
|
-
*/
|
|
34
|
-
export async function createStripeCustomer(
|
|
35
|
-
request: ICreateStripeCustomerRequest
|
|
36
|
-
): Promise<ICreateStripeCustomerResponse> {
|
|
37
|
-
console.debug('createStripeCustomer()');
|
|
38
|
-
return Post(`${urls.subscriptions.billing.paymentProviders.stripe.customers.v1}`, request);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
export async function getStripePaymentProviderConfiguration(): Promise<IStripePaymentProviderConfigurationResponse> {
|
|
43
|
-
console.debug('getStripePaymentProviderConfiguration()');
|
|
44
|
-
return Get(`${urls.subscriptions.billing.paymentProviders.stripe.publicConfigurations.v1}`);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Create payment method intent secret
|
|
49
|
-
* @param request
|
|
50
|
-
*/
|
|
51
|
-
export async function createStripePaymentMethodSetupIntentSecret(
|
|
52
|
-
request: ICreateStripePaymentMethodSetupRequest
|
|
53
|
-
): Promise<ICreateStripePaymentMethodSetupResponse> {
|
|
54
|
-
console.debug('createStripePaymentMethodSetupIntentSecret()');
|
|
55
|
-
return Post(`${urls.subscriptions.billing.paymentProviders.stripe.setupIntents.v1}`, request);
|
|
56
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export interface ICreateStripePaymentMethodSetupResponse {
|
|
2
|
-
id: string
|
|
3
|
-
paymentMethodId: string
|
|
4
|
-
setupIntentSecret: string
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface ICreateStripePaymentMethodSetupRequest {
|
|
8
|
-
paymentMethodId?: string
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface IStripePaymentProviderConfigurationResponse {
|
|
12
|
-
id: string;
|
|
13
|
-
name: string;
|
|
14
|
-
active: boolean;
|
|
15
|
-
publishableKey: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface IStripeCustomerResponse {
|
|
19
|
-
stripeCustomerId: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface ICreateStripeCustomerRequest {
|
|
23
|
-
name: string;
|
|
24
|
-
email: string;
|
|
25
|
-
tenantName?: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface ICreateStripeCustomerResponse {
|
|
29
|
-
stripeCustomerId: string;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface ICreateStripeSubscriptionRequest {
|
|
33
|
-
stripePlanId: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface ICreateSubscriptionResponse {
|
|
37
|
-
subscriptionId: string;
|
|
38
|
-
subscriptionSecret: string;
|
|
39
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { ISubscriptionResponse, IUpdateSubscriptionRequest } from "./interfaces";
|
|
2
|
-
import { Get, Put } from "../fetch";
|
|
3
|
-
import { urls } from "../constants";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Get tenant subscriptions
|
|
7
|
-
*/
|
|
8
|
-
export async function getSubscriptions(): Promise<ISubscriptionResponse[]> {
|
|
9
|
-
console.debug("getSubscriptions()");
|
|
10
|
-
return Get(urls.subscriptions.billing.subscriptions.v1);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Get tenant subscription
|
|
15
|
-
*/
|
|
16
|
-
export async function getSubscription(
|
|
17
|
-
subscriptionId: string
|
|
18
|
-
): Promise<ISubscriptionResponse> {
|
|
19
|
-
console.debug("getSubscription()", { subscriptionId });
|
|
20
|
-
return Get(
|
|
21
|
-
`${urls.subscriptions.billing.subscriptions.v1}/${subscriptionId}`
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Cancel tenant subscription
|
|
27
|
-
*/
|
|
28
|
-
export async function cancelSubscription(
|
|
29
|
-
subscriptionId: string
|
|
30
|
-
): Promise<void> {
|
|
31
|
-
console.debug("cancelSubscription()", { subscriptionId });
|
|
32
|
-
return Put(
|
|
33
|
-
`${urls.subscriptions.billing.subscriptions.v1}/${subscriptionId}/cancellations/`,
|
|
34
|
-
{}
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Renew tenant subscription
|
|
40
|
-
*/
|
|
41
|
-
export async function renewSubscription(
|
|
42
|
-
subscriptionId: string
|
|
43
|
-
): Promise<void> {
|
|
44
|
-
console.debug("renewSubscription()", { subscriptionId });
|
|
45
|
-
return Put(
|
|
46
|
-
`${urls.subscriptions.billing.subscriptions.v1}/${subscriptionId}/renewals/`,
|
|
47
|
-
{}
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Upgrade/Downgrade tenant subscription plan
|
|
53
|
-
*/
|
|
54
|
-
export async function updateSubscription(
|
|
55
|
-
subscriptionId: string,
|
|
56
|
-
{ paymentMethodId, planId }: IUpdateSubscriptionRequest
|
|
57
|
-
): Promise<void> {
|
|
58
|
-
console.debug("updateSubscription()", { subscriptionId });
|
|
59
|
-
return Put(
|
|
60
|
-
`${urls.subscriptions.billing.subscriptions.v1}/${subscriptionId}`,
|
|
61
|
-
{ paymentMethodId, planId }
|
|
62
|
-
);
|
|
63
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ISubscriptionSummariesResponse } from './interfaces';
|
|
2
|
-
import { Get } from '../fetch';
|
|
3
|
-
import { urls } from '../constants';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Gets subscription summaries
|
|
7
|
-
*/
|
|
8
|
-
export async function getSubscriptionSummaries(tenantId: string): Promise<ISubscriptionSummariesResponse> {
|
|
9
|
-
console.debug('getSubscriptionSummaries()');
|
|
10
|
-
return Get(`${urls.subscriptions.billing.summaries.v1}/${tenantId}`);
|
|
11
|
-
}
|