@frontegg/rest-api 2.10.89 → 3.0.2
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 +78 -0
- package/{dist/account-settings → account-settings}/index.d.ts +0 -0
- package/account-settings/index.js +8 -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 +21 -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/es2015/auth → auth}/index.d.ts +1 -1
- package/auth/index.js +409 -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 +48 -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 +120 -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} +12 -12
- package/{dist/error.d.ts → error.d.ts} +0 -0
- package/{src/error.ts → error.js} +4 -5
- package/fetch.d.ts +19 -0
- package/fetch.js +197 -0
- package/{dist/es2015/index.d.ts → index.d.ts} +0 -0
- package/{dist/es2015/index.js → index.js} +31 -27
- 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 +79 -0
- package/{dist/es2015/metadata → metadata}/index.d.ts +0 -0
- package/metadata/index.js +24 -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 +90 -0
- package/node/account-settings/index.js +19 -0
- package/node/account-settings/interfaces.js +5 -0
- package/node/audits/index.js +37 -0
- package/node/audits/interfaces.js +5 -0
- package/node/auth/enums.js +26 -0
- package/node/auth/index.js +709 -0
- package/node/auth/interfaces.js +39 -0
- package/node/auth/secutiry-poilicy/index.js +75 -0
- package/node/auth/secutiry-poilicy/interfaces.js +5 -0
- package/node/connectivity/index.js +208 -0
- package/node/connectivity/interfaces.js +5 -0
- package/node/constants.js +177 -0
- package/node/error.js +21 -0
- package/node/fetch.js +234 -0
- package/node/index.js +357 -0
- package/node/interfaces.js +5 -0
- package/node/jwt.js +93 -0
- package/node/metadata/index.js +44 -0
- package/node/metadata/interfaces.js +5 -0
- package/node/notifications/index.js +39 -0
- package/node/notifications/interfaces.js +5 -0
- package/node/reports/index.js +96 -0
- package/node/reports/interfaces.js +5 -0
- package/node/roles/index.js +71 -0
- package/node/roles/interfaces.js +5 -0
- package/node/routers.js +13 -0
- package/node/sub-tenants/index.js +39 -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 +28 -0
- package/node/subscriptions/managedSubscriptions.js +40 -0
- package/node/subscriptions/paymentMethods.js +37 -0
- package/node/subscriptions/paymentProviders.js +14 -0
- package/node/subscriptions/plans.js +19 -0
- package/node/subscriptions/providers/index.js +18 -0
- package/node/subscriptions/providers/stripe/index.js +34 -0
- package/node/subscriptions/providers/stripe/interfaces.js +5 -0
- package/node/subscriptions/subscriptions.js +40 -0
- package/node/subscriptions/summaries.js +14 -0
- package/node/subscriptions/tenantConfiguration.js +19 -0
- package/node/teams/index.js +129 -0
- package/node/teams/interfaces.js +5 -0
- package/node/tenants/index.js +29 -0
- package/node/tenants/interfaces.js +5 -0
- package/node/vendor/index.js +16 -0
- package/node/vendor/interfaces.js +5 -0
- package/{dist/es2015/notifications → notifications}/index.d.ts +0 -0
- package/notifications/index.js +24 -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 +75 -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 +47 -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 +20 -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 +15 -0
- package/{dist/es2015/subscriptions → subscriptions}/managedSubscriptions.d.ts +0 -0
- package/subscriptions/managedSubscriptions.js +23 -0
- package/subscriptions/package.json +6 -0
- package/{dist/es2015/subscriptions → subscriptions}/paymentMethods.d.ts +0 -0
- package/subscriptions/paymentMethods.js +21 -0
- package/{dist/es2015/subscriptions → subscriptions}/paymentProviders.d.ts +0 -0
- package/subscriptions/paymentProviders.js +5 -0
- package/{dist/es2015/subscriptions → subscriptions}/plans.d.ts +0 -0
- package/subscriptions/plans.js +8 -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 +17 -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 +23 -0
- package/{dist/es2015/subscriptions → subscriptions}/summaries.d.ts +0 -0
- package/subscriptions/summaries.js +5 -0
- package/{dist/es2015/subscriptions → subscriptions}/tenantConfiguration.d.ts +0 -0
- package/subscriptions/tenantConfiguration.js +8 -0
- package/{dist/es2015/teams → teams}/index.d.ts +0 -0
- package/teams/index.js +79 -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 +14 -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 +6 -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 -209
- 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.d.ts +0 -447
- 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.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/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
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import { urls } from '../constants';
|
|
2
|
-
import { Get, Patch, Post, Delete, Put } from '../fetch';
|
|
3
|
-
import {
|
|
4
|
-
IWebhookTest,
|
|
5
|
-
IWebhooksSaveData,
|
|
6
|
-
ISlackSubscription,
|
|
7
|
-
IEmailSMSConfigResponse,
|
|
8
|
-
IEmailSMSSubscriptionResponse,
|
|
9
|
-
} from './interfaces';
|
|
10
|
-
|
|
11
|
-
export const getSlackConfiguration = () => {
|
|
12
|
-
console.debug('getSlackConfiguration()');
|
|
13
|
-
return Get(`${urls.integrations.configurations.v1}/slack`);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const getSlackScope = () => {
|
|
17
|
-
console.debug('getSlackScope()');
|
|
18
|
-
return Get(`${urls.integrations.configurations.v1}/slack/applications`);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const getSlackChannels = () => {
|
|
22
|
-
console.debug('getSlackChannels()');
|
|
23
|
-
return Get(`${urls.integrations.configurations.v1}/slack/channels`);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const postSlackConfiguration = (data: ISlackSubscription) => {
|
|
27
|
-
console.debug('postSlackConfiguration()', data);
|
|
28
|
-
if (data.id) {
|
|
29
|
-
return Patch(`${urls.integrations.configurations.v1}/slack/subscription/${data.id}`, data);
|
|
30
|
-
}
|
|
31
|
-
return Post(`${urls.integrations.configurations.v1}/slack/subscriptions`, data);
|
|
32
|
-
};
|
|
33
|
-
export const deleteSlackConfiguration = (data: Required<ISlackSubscription>) => {
|
|
34
|
-
console.debug('deleteSlackConfiguration()', data);
|
|
35
|
-
return Delete(`${urls.integrations.configurations.v1}/slack/subscriptions/${data.id}`);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const postSlackCode = (code: string) => {
|
|
39
|
-
console.debug('postSlackCode()', { code });
|
|
40
|
-
return Post(`${urls.integrations.configurations.v1}/slack/applications/registrations`, { code });
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export const getEmailConfiguration = (): Promise<IEmailSMSConfigResponse[]> => {
|
|
44
|
-
console.debug('getEmailConfiguration()');
|
|
45
|
-
return Get(`${urls.integrations.configurations.v1}/emails`);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const postEmailConfiguration = ({ eventKey, ...data }: IEmailSMSConfigResponse): Promise<null> => {
|
|
49
|
-
console.debug('postEmailConfiguration()', { ...data, eventKey });
|
|
50
|
-
return Post(`${urls.integrations.configurations.v1}/emails/${eventKey}`, data);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const patchEmailConfiguration = ({
|
|
54
|
-
eventKey,
|
|
55
|
-
enabled,
|
|
56
|
-
}: Pick<IEmailSMSConfigResponse, 'eventKey' | 'enabled'>): Promise<null> => {
|
|
57
|
-
console.debug('patchEmailConfiguration()', { eventKey, enabled });
|
|
58
|
-
return Patch(`${urls.integrations.configurations.v1}/emails/${eventKey}`, { enabled });
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export const deleteEmailSubscriptions = (eventKey: string, subscriptionId: string): Promise<null> => {
|
|
62
|
-
console.debug('deleteEmailSubscriptions()', { eventKey, subscriptionId });
|
|
63
|
-
return Delete(`${urls.integrations.configurations.v1}/emails/${eventKey}/subscriptions/${subscriptionId}`);
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const putEmailSubscriptions = (
|
|
67
|
-
subscriptionId: string,
|
|
68
|
-
eventKey: string,
|
|
69
|
-
data: IEmailSMSSubscriptionResponse
|
|
70
|
-
): Promise<null> => {
|
|
71
|
-
console.debug('putEmailSubscriptions()', { ...data, subscriptionId, eventKey });
|
|
72
|
-
return Put(`${urls.integrations.configurations.v1}/emails/${eventKey}/subscriptions/${subscriptionId}`, data);
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export const deleteEmailConfiguration = (eventKey: string): Promise<null> => {
|
|
76
|
-
console.debug('deleteEmailConfiguration()', { eventKey });
|
|
77
|
-
return Delete(`${urls.integrations.configurations.v1}/emails/${eventKey}`);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export const getSMSConfiguration = (): Promise<IEmailSMSConfigResponse[]> => {
|
|
81
|
-
console.debug('getSMSConfiguration()');
|
|
82
|
-
return Get(`${urls.integrations.configurations.v2}/sms`);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
export const postSMSConfiguration = ({ eventKey, ...data }: IEmailSMSConfigResponse) => {
|
|
86
|
-
console.debug('postSMSConfiguration()', { ...data, eventKey });
|
|
87
|
-
return Post(`${urls.integrations.configurations.v2}/sms/${eventKey}`, data);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
export const patchSMSConfiguration = ({
|
|
91
|
-
eventKey,
|
|
92
|
-
enabled,
|
|
93
|
-
}: Pick<IEmailSMSConfigResponse, 'eventKey' | 'enabled'>): Promise<null> => {
|
|
94
|
-
console.debug('patchSMSConfiguration()', { eventKey, enabled });
|
|
95
|
-
return Patch(`${urls.integrations.configurations.v2}/sms/${eventKey}`, { enabled });
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
export const deleteSMSSubscriptions = (eventKey: string, subscriptionId: string): Promise<null> => {
|
|
99
|
-
console.debug('deleteSMSSubscriptions()', { eventKey, subscriptionId });
|
|
100
|
-
return Delete(`${urls.integrations.configurations.v2}/sms/${eventKey}/subscriptions/${subscriptionId}`);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export const putSMSSubscriptions = (
|
|
104
|
-
subscriptionId: string,
|
|
105
|
-
eventKey: string,
|
|
106
|
-
data: IEmailSMSSubscriptionResponse
|
|
107
|
-
): Promise<null> => {
|
|
108
|
-
console.debug('putSMSSubscriptions()', { ...data, subscriptionId, eventKey });
|
|
109
|
-
return Put(`${urls.integrations.configurations.v2}/sms/${eventKey}/subscriptions/${subscriptionId}`, data);
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
export const deleteSMSConfiguration = (eventKey: string): Promise<null> => {
|
|
113
|
-
console.debug('deleteSMSConfiguration()', { eventKey });
|
|
114
|
-
return Delete(`${urls.integrations.configurations.v2}/sms/${eventKey}`);
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export const getWebhooksConfigurations = () => {
|
|
118
|
-
console.debug('getWebhooksConfigurations()');
|
|
119
|
-
return Get(urls.webhooks.v1);
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
export const postWebhooksConfiguration = (data: IWebhooksSaveData) => {
|
|
123
|
-
console.debug('postWebhooksConfiguration()', data);
|
|
124
|
-
if (data._id) {
|
|
125
|
-
return Patch(`${urls.webhooks.v1}/${data._id}`, data);
|
|
126
|
-
} else {
|
|
127
|
-
return Post(`${urls.webhooks.v1}/custom`, data);
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
export const deleteWebhooksConfiguration = (id: string): Promise<null> => {
|
|
132
|
-
console.debug('deleteWebhooksConfiguration()', id);
|
|
133
|
-
return Delete(`${urls.webhooks.v1}/${id}`);
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
export const getWebhookLog = (id: string, offset: number = 0, limit: number = 10) => {
|
|
137
|
-
console.debug('getWebhookLog()', id);
|
|
138
|
-
const query = new URLSearchParams({ id, offset: `${offset}`, limit: `${limit}` });
|
|
139
|
-
return Get(`${urls.webhooks.v1}/logs/?${query.toString()}`);
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
export const postWebhookTest = (data: IWebhookTest) => {
|
|
143
|
-
console.debug('postWebhookTest', data);
|
|
144
|
-
return Post(`${urls.webhooks.v1}/test`, data);
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
export const postWebhookRetry = (id: string) => {
|
|
148
|
-
console.debug('postWebhookRetry', id);
|
|
149
|
-
return Post(`${urls.webhooks.v1}/logs/${id}/retries`);
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
export const getCategories = () => {
|
|
153
|
-
console.debug('getCategories()');
|
|
154
|
-
return Get(`${urls.events.configurations.v1}/categories`);
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
export const getChannelMaps = (channels: string) => {
|
|
158
|
-
console.debug('getChannelMaps()', channels);
|
|
159
|
-
return Get(urls.events.configurations.v1, { channels });
|
|
160
|
-
};
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
export interface ISlackConfigurations {
|
|
2
|
-
id: string;
|
|
3
|
-
slackSubscriptions: ISlackSubscription[];
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export interface ISlackSubscription {
|
|
7
|
-
id?: string;
|
|
8
|
-
isActive: boolean;
|
|
9
|
-
slackEvents: ISlackEvent[];
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface ISlackEvent {
|
|
13
|
-
eventKey: string;
|
|
14
|
-
channelIds: string[];
|
|
15
|
-
title?: string;
|
|
16
|
-
message?: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface IEmailSMSConfigResponse {
|
|
20
|
-
eventKey: string;
|
|
21
|
-
enabled: boolean;
|
|
22
|
-
subscriptions: IEmailSMSSubscriptionResponse[];
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface IEmailSMSSubscriptionResponse {
|
|
26
|
-
id?: string;
|
|
27
|
-
name: string;
|
|
28
|
-
enabled: boolean;
|
|
29
|
-
recipients: string[];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface IWebhookTest {
|
|
33
|
-
url: string;
|
|
34
|
-
secret: string | null;
|
|
35
|
-
payload?: object;
|
|
36
|
-
}
|
|
37
|
-
export interface IWebhooksSaveData extends IWebhookTest {
|
|
38
|
-
_id?: string;
|
|
39
|
-
displayName: string;
|
|
40
|
-
description: string;
|
|
41
|
-
eventKeys: string[];
|
|
42
|
-
isActive: boolean;
|
|
43
|
-
}
|
|
44
|
-
export interface IWebhooksConfigurations extends Omit<IWebhooksSaveData, '_id'> {
|
|
45
|
-
_id: string;
|
|
46
|
-
invocations: number;
|
|
47
|
-
createdAt: string;
|
|
48
|
-
updatedAt: string;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface IMainField {
|
|
52
|
-
id: string;
|
|
53
|
-
createdAt: string;
|
|
54
|
-
updatedAt: string;
|
|
55
|
-
vendorId: string;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface IEvent extends IMainField {
|
|
59
|
-
key: string;
|
|
60
|
-
displayName: string;
|
|
61
|
-
description?: string;
|
|
62
|
-
category?: string;
|
|
63
|
-
categoryId?: string;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface ICategory extends IMainField {
|
|
67
|
-
name: string;
|
|
68
|
-
events?: IEvent[];
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export interface ISlackChannel {
|
|
72
|
-
id: string;
|
|
73
|
-
name: string;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export interface IChannelsMap {
|
|
77
|
-
id: string;
|
|
78
|
-
key: string;
|
|
79
|
-
categoryId: string;
|
|
80
|
-
vendorId: string;
|
|
81
|
-
displayName: string;
|
|
82
|
-
description: string;
|
|
83
|
-
createdAt: string;
|
|
84
|
-
updatedAt: string;
|
|
85
|
-
category: {
|
|
86
|
-
id: string;
|
|
87
|
-
vendorId: string;
|
|
88
|
-
name: string;
|
|
89
|
-
createdAt: string;
|
|
90
|
-
updatedAt: string;
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export interface IWebhookLogsResponse {
|
|
95
|
-
count: number;
|
|
96
|
-
rows: IWebhookLog[];
|
|
97
|
-
}
|
|
98
|
-
export interface IWebhookLog {
|
|
99
|
-
body: string;
|
|
100
|
-
createdAt: string;
|
|
101
|
-
id: string;
|
|
102
|
-
statusCode: string;
|
|
103
|
-
tenantId: string;
|
|
104
|
-
vendorId: string;
|
|
105
|
-
webhookId: string;
|
|
106
|
-
}
|
package/src/fetch.ts
DELETED
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { ContextHolder } from './ContextHolder';
|
|
2
|
-
import { ContextOptions, KeyValuePair } from './interfaces';
|
|
3
|
-
import { FronteggApiError } from './error';
|
|
4
|
-
|
|
5
|
-
interface RequestOptions {
|
|
6
|
-
url: string;
|
|
7
|
-
method: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
|
|
8
|
-
body?: any;
|
|
9
|
-
params?: any;
|
|
10
|
-
contentType?: string;
|
|
11
|
-
responseType?: 'json' | 'plain' | 'blob';
|
|
12
|
-
headers?: Record<string, string>;
|
|
13
|
-
credentials?: RequestCredentials;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function getBaseUrl(context: ContextOptions, url: string): string {
|
|
17
|
-
let baseUrl;
|
|
18
|
-
if (typeof context.baseUrl === 'function') {
|
|
19
|
-
baseUrl = context.baseUrl(url);
|
|
20
|
-
} else {
|
|
21
|
-
baseUrl = context.baseUrl;
|
|
22
|
-
}
|
|
23
|
-
const prefix = context.urlPrefix || 'frontegg';
|
|
24
|
-
if (!baseUrl.endsWith('/')) {
|
|
25
|
-
baseUrl += '/';
|
|
26
|
-
}
|
|
27
|
-
if (!baseUrl.endsWith(prefix)) {
|
|
28
|
-
baseUrl += prefix;
|
|
29
|
-
}
|
|
30
|
-
return baseUrl;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
async function prepareUrl(context: ContextOptions, url: string, params?: any): Promise<string> {
|
|
34
|
-
const baseUrl = getBaseUrl(context, url);
|
|
35
|
-
const paramsToSend = await buildQueryParams(context, params);
|
|
36
|
-
|
|
37
|
-
let finalUrl = url.startsWith('http') ? url : `${baseUrl}${url}`;
|
|
38
|
-
const hasKeys = Object.keys(paramsToSend).length > 0;
|
|
39
|
-
if (paramsToSend && hasKeys) {
|
|
40
|
-
const urlParams = new URLSearchParams(paramsToSend);
|
|
41
|
-
finalUrl += `?${urlParams}`;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return finalUrl;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
async function buildRequestHeaders(
|
|
48
|
-
context: ContextOptions,
|
|
49
|
-
contentType: string | undefined
|
|
50
|
-
): Promise<Record<string, string>> {
|
|
51
|
-
const authToken = await (context?.tokenResolver ?? ContextHolder.getAccessToken)();
|
|
52
|
-
const headers: Record<string, string> = {};
|
|
53
|
-
if (authToken) {
|
|
54
|
-
headers.Authorization = `Bearer ${authToken}`;
|
|
55
|
-
}
|
|
56
|
-
if (contentType) {
|
|
57
|
-
headers['Content-Type'] = contentType;
|
|
58
|
-
}
|
|
59
|
-
for (const additionalHeader of await getAdditionalHeaders(context)) {
|
|
60
|
-
headers[`${additionalHeader.key}`] = `${additionalHeader.value}`;
|
|
61
|
-
}
|
|
62
|
-
headers['x-frontegg-source'] = 'frontegg-react';
|
|
63
|
-
return headers;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
async function buildQueryParams(context: ContextOptions, params?: any) {
|
|
67
|
-
if (!params) {
|
|
68
|
-
params = {};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const additionalQueryParams = await getAdditionalQueryParams(context);
|
|
72
|
-
for (const queryParam of additionalQueryParams) {
|
|
73
|
-
params[queryParam.key] = queryParam.value;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const keys = Object.keys(params);
|
|
77
|
-
for (const key of keys) {
|
|
78
|
-
const value = params[key];
|
|
79
|
-
params[key] = typeof value === 'object' ? JSON.stringify(value) : value;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return params;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
async function getAdditionalQueryParams(context: ContextOptions): Promise<KeyValuePair[]> {
|
|
86
|
-
let output: KeyValuePair[] = [];
|
|
87
|
-
if (context.additionalQueryParamsResolver) {
|
|
88
|
-
output = await context.additionalQueryParamsResolver();
|
|
89
|
-
}
|
|
90
|
-
return output;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
async function getAdditionalHeaders(context: ContextOptions): Promise<KeyValuePair[]> {
|
|
94
|
-
let output: KeyValuePair[] = [];
|
|
95
|
-
if (context.additionalHeadersResolver) {
|
|
96
|
-
output = await context.additionalHeadersResolver();
|
|
97
|
-
}
|
|
98
|
-
return output;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const sendRequest = async (opts: RequestOptions) => {
|
|
102
|
-
const context = ContextHolder.getContext();
|
|
103
|
-
const headers = await buildRequestHeaders(context, opts.contentType);
|
|
104
|
-
const url = await prepareUrl(context, opts.url, opts.params);
|
|
105
|
-
|
|
106
|
-
const response = await fetch(url, {
|
|
107
|
-
body: opts.body ? (opts.contentType === 'application/json' ? JSON.stringify(opts.body) : opts.body) : null,
|
|
108
|
-
method: opts.method ?? 'GET',
|
|
109
|
-
headers: {
|
|
110
|
-
...headers,
|
|
111
|
-
...opts.headers,
|
|
112
|
-
},
|
|
113
|
-
credentials: opts.credentials ?? context.requestCredentials ?? 'same-origin',
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
if (response.status === 302) {
|
|
117
|
-
window.location.href = await response.text();
|
|
118
|
-
return new Promise(() => {
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
if (!response.ok) {
|
|
122
|
-
if (response.status === 413) {
|
|
123
|
-
throw new FronteggApiError('Error request is too large', response.status);
|
|
124
|
-
}
|
|
125
|
-
let errorMessage;
|
|
126
|
-
try {
|
|
127
|
-
errorMessage = await response.text();
|
|
128
|
-
errorMessage = JSON.parse(errorMessage);
|
|
129
|
-
} catch (e) {
|
|
130
|
-
}
|
|
131
|
-
if (errorMessage.errors) {
|
|
132
|
-
errorMessage = errorMessage.errors.join(', ');
|
|
133
|
-
} else if (typeof errorMessage !== 'string') {
|
|
134
|
-
errorMessage = `Error ${response.status} - ${response.statusText}`;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
if (response.status >= 400 && response.status < 500 && [ 'warn' ].includes(context.logLevel ?? ''))
|
|
138
|
-
console.warn(errorMessage);
|
|
139
|
-
else if (response.status === 500 && [ 'warn', 'error' ].includes(context.logLevel ?? '')) console.error(errorMessage);
|
|
140
|
-
|
|
141
|
-
throw new FronteggApiError(errorMessage, response.status);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (!opts.responseType || opts.responseType === 'json') {
|
|
145
|
-
try {
|
|
146
|
-
return await response.json();
|
|
147
|
-
} catch (e) {
|
|
148
|
-
return {};
|
|
149
|
-
}
|
|
150
|
-
} else if (opts.responseType === 'blob') {
|
|
151
|
-
const { outputFileName } = opts.params;
|
|
152
|
-
return await response
|
|
153
|
-
.blob()
|
|
154
|
-
.then((blob) => URL.createObjectURL(blob))
|
|
155
|
-
.then((url) => {
|
|
156
|
-
const tempLink = document.createElement('a');
|
|
157
|
-
tempLink.href = url;
|
|
158
|
-
tempLink.setAttribute('download', outputFileName || 'output');
|
|
159
|
-
tempLink.click();
|
|
160
|
-
});
|
|
161
|
-
} else {
|
|
162
|
-
return await response.text();
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
export const Get = async (url: string, params?: any, opts?: Omit<RequestOptions, 'method' | 'url'>) =>
|
|
167
|
-
sendRequest({
|
|
168
|
-
url,
|
|
169
|
-
method: 'GET',
|
|
170
|
-
contentType: 'application/json',
|
|
171
|
-
params,
|
|
172
|
-
...opts,
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
export const Post = async (url: string, body?: any, opts?: Omit<RequestOptions, 'method' | 'url'>) =>
|
|
176
|
-
sendRequest({
|
|
177
|
-
url,
|
|
178
|
-
method: 'POST',
|
|
179
|
-
contentType: 'application/json',
|
|
180
|
-
body,
|
|
181
|
-
...opts,
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
export const Patch = async (url: string, body?: any, opts?: Omit<RequestOptions, 'method' | 'url'>) =>
|
|
185
|
-
sendRequest({
|
|
186
|
-
url,
|
|
187
|
-
method: 'PATCH',
|
|
188
|
-
contentType: 'application/json',
|
|
189
|
-
body,
|
|
190
|
-
...opts,
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
export const Put = async (url: string, body?: any, opts?: Omit<RequestOptions, 'method' | 'url'>) =>
|
|
194
|
-
sendRequest({
|
|
195
|
-
url,
|
|
196
|
-
method: 'PUT',
|
|
197
|
-
contentType: 'application/json',
|
|
198
|
-
body,
|
|
199
|
-
...opts,
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
export const Delete = async (url: string, body?: any, opts?: Omit<RequestOptions, 'method' | 'url'>) =>
|
|
203
|
-
sendRequest({
|
|
204
|
-
url,
|
|
205
|
-
method: 'DELETE',
|
|
206
|
-
contentType: 'application/json',
|
|
207
|
-
body,
|
|
208
|
-
...opts,
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
export const PostDownload = async (url: string, body?: any, params?: any, opts?: any) =>
|
|
212
|
-
sendRequest({
|
|
213
|
-
url,
|
|
214
|
-
method: 'POST',
|
|
215
|
-
contentType: 'application/json',
|
|
216
|
-
responseType: 'blob',
|
|
217
|
-
body,
|
|
218
|
-
params,
|
|
219
|
-
...opts,
|
|
220
|
-
});
|
package/src/index.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import * as auth from './auth';
|
|
2
|
-
import * as teams from './teams';
|
|
3
|
-
import * as metadata from './metadata';
|
|
4
|
-
import * as reports from './reports';
|
|
5
|
-
import * as notifications from './notifications';
|
|
6
|
-
import * as audits from './audits';
|
|
7
|
-
import * as fetch from './fetch';
|
|
8
|
-
import * as connectivity from './connectivity';
|
|
9
|
-
import * as tenants from './tenants';
|
|
10
|
-
import * as accountSettings from './account-settings';
|
|
11
|
-
import * as roles from './roles';
|
|
12
|
-
import * as subscriptions from './subscriptions';
|
|
13
|
-
import {FronteggApiError} from './error';
|
|
14
|
-
import * as vendor from './vendor';
|
|
15
|
-
import * as subTenants from './sub-tenants';
|
|
16
|
-
|
|
17
|
-
import {ContextHolder, FronteggContext} from './ContextHolder';
|
|
18
|
-
|
|
19
|
-
export * from './interfaces';
|
|
20
|
-
export * from './auth/interfaces';
|
|
21
|
-
export * from './teams/interfaces';
|
|
22
|
-
export * from './metadata/interfaces';
|
|
23
|
-
export * from './reports/interfaces';
|
|
24
|
-
export * from './connectivity/interfaces';
|
|
25
|
-
export * from './notifications/interfaces';
|
|
26
|
-
export * from './audits/interfaces';
|
|
27
|
-
export * from './tenants/interfaces';
|
|
28
|
-
export * from './account-settings/interfaces';
|
|
29
|
-
export * from './roles/interfaces';
|
|
30
|
-
export * from './subscriptions/interfaces';
|
|
31
|
-
export * from './vendor/interfaces';
|
|
32
|
-
export * from './sub-tenants/interfaces';
|
|
33
|
-
export * from './routers';
|
|
34
|
-
|
|
35
|
-
import {AuthStrategyEnum, SocialLoginProviders} from './auth'
|
|
36
|
-
import {
|
|
37
|
-
ISubscriptionCancellationPolicy,
|
|
38
|
-
ISubscriptionStatus,
|
|
39
|
-
PaymentMethodType,
|
|
40
|
-
ProviderType
|
|
41
|
-
} from './subscriptions'
|
|
42
|
-
|
|
43
|
-
const api = {
|
|
44
|
-
auth,
|
|
45
|
-
teams,
|
|
46
|
-
metadata,
|
|
47
|
-
reports,
|
|
48
|
-
connectivity,
|
|
49
|
-
notifications,
|
|
50
|
-
audits,
|
|
51
|
-
tenants,
|
|
52
|
-
accountSettings,
|
|
53
|
-
roles,
|
|
54
|
-
subscriptions,
|
|
55
|
-
vendor,
|
|
56
|
-
subTenants
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export {
|
|
60
|
-
fetch,
|
|
61
|
-
ContextHolder,
|
|
62
|
-
FronteggContext,
|
|
63
|
-
api,
|
|
64
|
-
FronteggApiError,
|
|
65
|
-
AuthStrategyEnum,
|
|
66
|
-
SocialLoginProviders,
|
|
67
|
-
ISubscriptionCancellationPolicy,
|
|
68
|
-
ISubscriptionStatus,
|
|
69
|
-
PaymentMethodType,
|
|
70
|
-
ProviderType,
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export default {
|
|
74
|
-
fetch,
|
|
75
|
-
ContextHolder,
|
|
76
|
-
FronteggContext,
|
|
77
|
-
api,
|
|
78
|
-
FronteggApiError,
|
|
79
|
-
AuthStrategyEnum,
|
|
80
|
-
SocialLoginProviders,
|
|
81
|
-
ISubscriptionCancellationPolicy,
|
|
82
|
-
ISubscriptionStatus,
|
|
83
|
-
PaymentMethodType,
|
|
84
|
-
ProviderType,
|
|
85
|
-
};
|
|
86
|
-
|
package/src/interfaces.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
export interface IFronteggRecord {
|
|
2
|
-
__frontegg__loader?: boolean;
|
|
3
|
-
__frontegg__error?: boolean;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export interface PaginationResult<T> {
|
|
7
|
-
totalPages: number;
|
|
8
|
-
items: T[];
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface KeyValuePair {
|
|
12
|
-
key: string;
|
|
13
|
-
value: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export type LogLevel = 'warn' | 'error';
|
|
17
|
-
|
|
18
|
-
export interface ContextOptions {
|
|
19
|
-
baseUrl: string | ((url: string) => string);
|
|
20
|
-
clientId?: string;
|
|
21
|
-
tokenResolver?: () => Promise<string> | string; // custom resolve Authorization Header value
|
|
22
|
-
additionalQueryParamsResolver?: () => Promise<KeyValuePair[]> | KeyValuePair[];
|
|
23
|
-
additionalHeadersResolver?: () => Promise<KeyValuePair[]> | KeyValuePair[];
|
|
24
|
-
currentUserRoles?: string[];
|
|
25
|
-
requestCredentials?: RequestCredentials;
|
|
26
|
-
urlPrefix?: string;
|
|
27
|
-
logLevel?: LogLevel;
|
|
28
|
-
auditsOptions?: {
|
|
29
|
-
virtualScroll?: boolean;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface QuerySort {
|
|
34
|
-
id: string;
|
|
35
|
-
desc?: boolean;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface QueryFilter {
|
|
39
|
-
id: string;
|
|
40
|
-
value: any;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface RedirectOptions {
|
|
44
|
-
refresh?: boolean;
|
|
45
|
-
replace?: boolean;
|
|
46
|
-
preserveQueryParams?: boolean;
|
|
47
|
-
}
|
package/src/jwt.ts
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The code was extracted from:
|
|
3
|
-
* https://github.com/davidchambers/Base64.js
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
7
|
-
|
|
8
|
-
export class InvalidCharacterError extends Error {
|
|
9
|
-
constructor(message: string) {
|
|
10
|
-
super(message);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function polyfill(input: string) {
|
|
15
|
-
const str = String(input).replace(/=+$/, '');
|
|
16
|
-
if (str.length % 4 === 1) {
|
|
17
|
-
throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded.");
|
|
18
|
-
}
|
|
19
|
-
let output = '';
|
|
20
|
-
// noinspection JSAssignmentUsedAsCondition,JSUnusedAssignment,CommaExpressionJS
|
|
21
|
-
for (
|
|
22
|
-
// initialize result and counters
|
|
23
|
-
let bc = 0, bs: number, buffer, idx = 0;
|
|
24
|
-
// get next character
|
|
25
|
-
// tslint:disable-next-line:no-conditional-assignment
|
|
26
|
-
(buffer = str.charAt(idx++));
|
|
27
|
-
// character found in table? initialize bit storage and add its ascii value;
|
|
28
|
-
// tslint:disable-next-line:no-conditional-assignment
|
|
29
|
-
~buffer &&
|
|
30
|
-
((bs = bc % 4 ? bs! * 64 + buffer : buffer),
|
|
31
|
-
// and if not first of each 4 characters,
|
|
32
|
-
// convert the first 8 bits to one ascii character
|
|
33
|
-
bc++ % 4)
|
|
34
|
-
? (output += String.fromCharCode(255 & (bs >> ((-2 * bc) & 6))))
|
|
35
|
-
: 0
|
|
36
|
-
) {
|
|
37
|
-
// try to find character in table (0-63, not found => -1)
|
|
38
|
-
buffer = chars.indexOf(buffer);
|
|
39
|
-
}
|
|
40
|
-
return output;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const atob = (typeof window !== 'undefined' && window.atob && window.atob.bind(window)) || polyfill;
|
|
44
|
-
|
|
45
|
-
function b64DecodeUnicode(str: string) {
|
|
46
|
-
return decodeURIComponent(
|
|
47
|
-
atob(str).replace(/(.)/g, (m, p) => {
|
|
48
|
-
let code = p.charCodeAt(0).toString(16).toUpperCase();
|
|
49
|
-
if (code.length < 2) {
|
|
50
|
-
code = '0' + code;
|
|
51
|
-
}
|
|
52
|
-
return '%' + code;
|
|
53
|
-
})
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const base64UrlDecode = (str: string) => {
|
|
58
|
-
let output = str.replace(/-/g, '+').replace(/_/g, '/');
|
|
59
|
-
switch (output.length % 4) {
|
|
60
|
-
case 0:
|
|
61
|
-
break;
|
|
62
|
-
case 2:
|
|
63
|
-
output += '==';
|
|
64
|
-
break;
|
|
65
|
-
case 3:
|
|
66
|
-
output += '=';
|
|
67
|
-
break;
|
|
68
|
-
default:
|
|
69
|
-
throw new Error('Illegal base64url string!');
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
try {
|
|
73
|
-
return b64DecodeUnicode(output);
|
|
74
|
-
} catch (err) {
|
|
75
|
-
return atob(output);
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export class InvalidTokenError extends Error {
|
|
80
|
-
constructor(message: string) {
|
|
81
|
-
super(message);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export const jwtDecode = (token: string, options: { header?: boolean } = {}) => {
|
|
86
|
-
const pos = !!options.header ? 0 : 1;
|
|
87
|
-
try {
|
|
88
|
-
return JSON.parse(base64UrlDecode(token.split('.')[pos]));
|
|
89
|
-
} catch (e) {
|
|
90
|
-
throw new InvalidTokenError('Invalid token specified: ' + (e as Error).message);
|
|
91
|
-
}
|
|
92
|
-
};
|