@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/dist/auth/index.js
DELETED
|
@@ -1,1042 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
22
|
-
var t = {};
|
|
23
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
24
|
-
t[p] = s[p];
|
|
25
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
26
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
27
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
28
|
-
t[p[i]] = s[p[i]];
|
|
29
|
-
}
|
|
30
|
-
return t;
|
|
31
|
-
};
|
|
32
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.updateTenantApiTokensData = exports.updateUserApiTokensData = exports.getTenantApiTokensData = exports.getUserApiTokensData = exports.deleteAllSessionsForUser = exports.deleteSessionForUser = exports.createOrUpdateSessionConfigrations = exports.getSessionConfigurations = exports.getCurrentUserSessions = exports.signUpUser = exports.getVendorConfig = exports.loginViaSocialLogin = exports.getSocialLoginProvidersV2 = exports.getSocialLoginProviders = exports.getSSOPublicConfiguration = exports.getOidcConfiguration = exports.deleteSamlGroup = exports.updateSamlGroup = exports.createSamlGroup = exports.updateSamlRoles = exports.getSamlRolesGroups = exports.getSamlRoles = exports.validateSamlDomain = exports.updateSamlVendorMetadata = exports.getSamlVendorConfiguration = exports.updateSamlConfiguration = exports.getSamlConfiguration = exports.disableMfa = exports.verifyMfa = exports.enrollMfa = exports.recoverMfaToken = exports.loadPasswordConfig = exports.resetPassword = exports.forgotPassword = exports.logout = exports.refreshTokenV2 = exports.refreshToken = exports.acceptInvitation = exports.resendActivationEmail = exports.getActivateAccountStrategy = exports.activateAccount = exports.loginWithMfa = exports.login = exports.oidcPostLogin = exports.postLogin = exports.preLoginWithIdpType = exports.preLogin = exports.generateLoginResponseFromOAuthResponse = exports.generateLoginResponseV2 = exports.generateLoginResponse = void 0;
|
|
34
|
-
exports.getVendorPublicAuthStrategiesConfig = exports.verifyNewDeviceSession = exports.webAuthnCreateNewDeviceSession = exports.webAuthnPostLogin = exports.webAuthnPreLogin = exports.changePhoneNumber = exports.verifyChangePhoneNumber = exports.changePhoneNumberWithVerification = exports.verifyResetPhoneNumber = exports.resetPhoneNumber = exports.exchangeOAuthTokens = exports.oidcPostLoginV2 = exports.preLoginV2 = exports.getSSOGroups = exports.deleteSSOGroup = exports.updateSSOGroup = exports.createSSOGroup = exports.setSSODefaultRoles = exports.getSSODefaultRoles = exports.validateSSODomain = exports.deleteSSODomain = exports.createSSODomain = exports.updateSSOConfigurationByMetadata = exports.createSSOConfigurationByMetadata = exports.deleteSSOConfiguration = exports.updateSSOConfiguration = exports.createSSOConfiguration = exports.getSSOConfigurations = exports.verifyInviteToken = exports.passwordlessPostLogin = exports.passwordlessPreLogin = exports.checkIfAllowToRememberMfaDevice = exports.getUserById = exports.deleteUserApiToken = exports.deleteTenantApiToken = void 0;
|
|
35
|
-
const tenants_1 = require("../tenants");
|
|
36
|
-
__exportStar(require("./secutiry-poilicy"), exports);
|
|
37
|
-
__exportStar(require("./enums"), exports);
|
|
38
|
-
const constants_1 = require("../constants");
|
|
39
|
-
const ContextHolder_1 = require("../ContextHolder");
|
|
40
|
-
const fetch_1 = require("../fetch");
|
|
41
|
-
const jwt_1 = require("../jwt");
|
|
42
|
-
/*****************************************
|
|
43
|
-
* Authentication
|
|
44
|
-
*****************************************/
|
|
45
|
-
function generateLoginResponse(loginResponse) {
|
|
46
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
if (!loginResponse.accessToken) {
|
|
48
|
-
return loginResponse;
|
|
49
|
-
}
|
|
50
|
-
ContextHolder_1.ContextHolder.setAccessToken(loginResponse.accessToken);
|
|
51
|
-
const me = yield fetch_1.Get(`${constants_1.urls.identity.users.v2}/me`);
|
|
52
|
-
const decodedContent = loginResponse.accessToken ? jwt_1.jwtDecode(loginResponse.accessToken) : {};
|
|
53
|
-
const user = Object.assign(Object.assign(Object.assign({}, loginResponse), decodedContent), me);
|
|
54
|
-
ContextHolder_1.ContextHolder.setUser(user);
|
|
55
|
-
return user;
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
exports.generateLoginResponse = generateLoginResponse;
|
|
59
|
-
function generateLoginResponseV2(loginResponse) {
|
|
60
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
-
if (!loginResponse.accessToken) {
|
|
62
|
-
return { user: loginResponse };
|
|
63
|
-
}
|
|
64
|
-
ContextHolder_1.ContextHolder.setAccessToken(loginResponse.accessToken);
|
|
65
|
-
const [me, tenants] = yield Promise.all([fetch_1.Get(`${constants_1.urls.identity.users.v2}/me`), tenants_1.getTenants()]);
|
|
66
|
-
const decodedContent = loginResponse.accessToken ? jwt_1.jwtDecode(loginResponse.accessToken) : {};
|
|
67
|
-
const user = Object.assign(Object.assign(Object.assign({}, loginResponse), decodedContent), me);
|
|
68
|
-
ContextHolder_1.ContextHolder.setUser(user);
|
|
69
|
-
return { user, tenants };
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
exports.generateLoginResponseV2 = generateLoginResponseV2;
|
|
73
|
-
function generateLoginResponseFromOAuthResponse(oauthResponse) {
|
|
74
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
ContextHolder_1.ContextHolder.setAccessToken(oauthResponse.id_token);
|
|
76
|
-
const me = yield fetch_1.Get(`${constants_1.urls.identity.users.v2}/me`);
|
|
77
|
-
const decodedContent = oauthResponse.id_token ? jwt_1.jwtDecode(oauthResponse.id_token) : {};
|
|
78
|
-
const user = Object.assign(Object.assign({ mfaRequired: false, accessToken: oauthResponse.id_token, refreshToken: oauthResponse.refresh_token }, decodedContent), me);
|
|
79
|
-
ContextHolder_1.ContextHolder.setUser(user);
|
|
80
|
-
return user;
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
exports.generateLoginResponseFromOAuthResponse = generateLoginResponseFromOAuthResponse;
|
|
84
|
-
/**
|
|
85
|
-
* Check if requested email address has sso configuration
|
|
86
|
-
* If true, this function will return the sso address to navigate to
|
|
87
|
-
* else, return null
|
|
88
|
-
*/
|
|
89
|
-
function preLogin(body) {
|
|
90
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
-
console.debug('preLogin()', body);
|
|
92
|
-
try {
|
|
93
|
-
const { address } = yield fetch_1.Post(`${constants_1.urls.identity.auth.v1}/user/saml/prelogin`, body);
|
|
94
|
-
return address;
|
|
95
|
-
}
|
|
96
|
-
catch (_a) {
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
exports.preLogin = preLogin;
|
|
102
|
-
/**
|
|
103
|
-
* Check if requested email address has sso configuration
|
|
104
|
-
* If true, this function will return the sso address and IdpType to navigate to
|
|
105
|
-
*/
|
|
106
|
-
function preLoginWithIdpType(body) {
|
|
107
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
-
console.debug('preLoginWithIdpType()', body);
|
|
109
|
-
return fetch_1.Post(`${constants_1.urls.identity.auth.v1}/user/saml/prelogin`, body);
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
exports.preLoginWithIdpType = preLoginWithIdpType;
|
|
113
|
-
/**
|
|
114
|
-
* After calling preLogin and navigated to SSO url, the IDP will redirect you to the ACS Url
|
|
115
|
-
* Which configured in the SSO configuraation
|
|
116
|
-
* else, return null
|
|
117
|
-
*/
|
|
118
|
-
function postLogin(body) {
|
|
119
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
-
console.debug('postLogin()');
|
|
121
|
-
const data = yield fetch_1.Post(`${constants_1.urls.identity.auth.v1}/user/saml/postlogin`, body);
|
|
122
|
-
return generateLoginResponse(data);
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
exports.postLogin = postLogin;
|
|
126
|
-
/**
|
|
127
|
-
* After calling preLogin and navigated to SSO url, the IDP will redirect you to the redirect url
|
|
128
|
-
* with code and state
|
|
129
|
-
*/
|
|
130
|
-
function oidcPostLogin(body) {
|
|
131
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
132
|
-
console.debug('oidcPostLogin()');
|
|
133
|
-
const data = yield fetch_1.Post(`${constants_1.urls.identity.auth.v1}/user/oidc/postlogin`, body);
|
|
134
|
-
return generateLoginResponse(data);
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
exports.oidcPostLogin = oidcPostLogin;
|
|
138
|
-
/**
|
|
139
|
-
* login with username and password.
|
|
140
|
-
* if the user has two factor authentication
|
|
141
|
-
* the server will return mfaToken with mfaRequired: true,
|
|
142
|
-
* and then ``loginWithMfa`` should be called with the mfaToken and and generated code
|
|
143
|
-
* else, the server will accessToken and refreshToken.
|
|
144
|
-
* the refresh should be used to renew your access token by calling ``refreshToken``
|
|
145
|
-
*
|
|
146
|
-
* @throw exception if login failed
|
|
147
|
-
*/
|
|
148
|
-
function login(body) {
|
|
149
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
150
|
-
console.debug('login()');
|
|
151
|
-
const data = yield fetch_1.Post(`${constants_1.urls.identity.auth.v1}/user`, body);
|
|
152
|
-
return generateLoginResponse(data);
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
exports.login = login;
|
|
156
|
-
/**
|
|
157
|
-
* after login succeeded with mfaRequired token response, this function should be called
|
|
158
|
-
* with the mfaToken and the generated code from your authenticator app.
|
|
159
|
-
*
|
|
160
|
-
* @throw exception if generated code or mfaToken are incorrect
|
|
161
|
-
*/
|
|
162
|
-
function loginWithMfa(body) {
|
|
163
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
164
|
-
console.debug('loginWithMfa()');
|
|
165
|
-
const data = yield fetch_1.Post(`${constants_1.urls.identity.auth.v1}/user/mfa/verify`, body);
|
|
166
|
-
return generateLoginResponse(data);
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
exports.loginWithMfa = loginWithMfa;
|
|
170
|
-
/**
|
|
171
|
-
* activating account should be called after registering new user of deactivate account
|
|
172
|
-
* ``activateAccount`` should contains userId and the token that has been sent to the user after activation requested.
|
|
173
|
-
*
|
|
174
|
-
* @throws exception if activation failed
|
|
175
|
-
*/
|
|
176
|
-
function activateAccount(body) {
|
|
177
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
178
|
-
console.debug('activateAccount()');
|
|
179
|
-
return fetch_1.Post(`${constants_1.urls.identity.users.v1}/activate`, body);
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
exports.activateAccount = activateAccount;
|
|
183
|
-
/**
|
|
184
|
-
* get account activation configuration.
|
|
185
|
-
*/
|
|
186
|
-
function getActivateAccountStrategy(params) {
|
|
187
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
188
|
-
console.debug('getActivateAccountStrategy()');
|
|
189
|
-
return fetch_1.Get(`${constants_1.urls.identity.users.v1}/activate/strategy`, params);
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
exports.getActivateAccountStrategy = getActivateAccountStrategy;
|
|
193
|
-
/**
|
|
194
|
-
* resend activation email should be called after a failed user activation.
|
|
195
|
-
* ``resend activation email`` should contain the user email.
|
|
196
|
-
*
|
|
197
|
-
* @throws exception if resend failed
|
|
198
|
-
*/
|
|
199
|
-
function resendActivationEmail(body) {
|
|
200
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
201
|
-
console.debug('resendActivationEmail()');
|
|
202
|
-
return fetch_1.Post(`${constants_1.urls.identity.users.v1}/activate/reset`, body);
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
exports.resendActivationEmail = resendActivationEmail;
|
|
206
|
-
/**
|
|
207
|
-
* activating account should be called after registering new user of deactivate account
|
|
208
|
-
* ``activateAccount`` should contains userId and the token that has been sent to the user after activation requested.
|
|
209
|
-
*
|
|
210
|
-
* @throws exception if activation failed
|
|
211
|
-
*/
|
|
212
|
-
function acceptInvitation(body) {
|
|
213
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
214
|
-
console.debug('acceptInvitation()');
|
|
215
|
-
return fetch_1.Post(`${constants_1.urls.identity.users.v1}/invitation/accept`, body);
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
exports.acceptInvitation = acceptInvitation;
|
|
219
|
-
/**
|
|
220
|
-
* refresh token called as authenticated use, access and refresh tokens resolved by the cookies.
|
|
221
|
-
* the server will return ILoginResponse with new access Token and refresh token and store it in the browser cookies.
|
|
222
|
-
*/
|
|
223
|
-
function refreshToken() {
|
|
224
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
225
|
-
console.debug('refreshToken()');
|
|
226
|
-
const data = yield fetch_1.Post(`${constants_1.urls.identity.auth.v1}/user/token/refresh`);
|
|
227
|
-
return generateLoginResponse(data);
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
exports.refreshToken = refreshToken;
|
|
231
|
-
/**
|
|
232
|
-
* refresh token called as authenticated use, access and refresh tokens resolved by the cookies.
|
|
233
|
-
* the server will return ILoginResponseV2 with new access Token and refresh token and store it in the browser cookies, as well as the tenants.
|
|
234
|
-
*/
|
|
235
|
-
function refreshTokenV2() {
|
|
236
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
237
|
-
console.debug('refreshTokenV2()');
|
|
238
|
-
const data = yield fetch_1.Post(`${constants_1.urls.identity.auth.v1}/user/token/refresh`);
|
|
239
|
-
return generateLoginResponseV2(data);
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
exports.refreshTokenV2 = refreshTokenV2;
|
|
243
|
-
/**
|
|
244
|
-
* logout from server, invalidate access and refresh token, remove it from cookies.
|
|
245
|
-
*/
|
|
246
|
-
function logout() {
|
|
247
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
248
|
-
console.debug('logout()');
|
|
249
|
-
return fetch_1.Post(`${constants_1.urls.identity.auth.v1}/logout`);
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
exports.logout = logout;
|
|
253
|
-
/**
|
|
254
|
-
* calling forgot password request will send email with link to reset user's password.
|
|
255
|
-
*
|
|
256
|
-
* @throws exception if the user not found
|
|
257
|
-
*/
|
|
258
|
-
function forgotPassword(body) {
|
|
259
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
260
|
-
console.debug('forgotPassword()', body);
|
|
261
|
-
return fetch_1.Post(`${constants_1.urls.identity.users.v1}/passwords/reset`, body);
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
exports.forgotPassword = forgotPassword;
|
|
265
|
-
/**
|
|
266
|
-
* reset password should be called after forget password request.
|
|
267
|
-
* userId, new password and the token has been sent to the user email.
|
|
268
|
-
*
|
|
269
|
-
* @throws exception if the user not found, password validation failed or invalid token.
|
|
270
|
-
*/
|
|
271
|
-
function resetPassword(body) {
|
|
272
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
273
|
-
console.debug('resetPassword()');
|
|
274
|
-
return fetch_1.Post(`${constants_1.urls.identity.users.v1}/passwords/reset/verify`, body);
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
exports.resetPassword = resetPassword;
|
|
278
|
-
/**
|
|
279
|
-
* load password configuration for user.
|
|
280
|
-
*/
|
|
281
|
-
function loadPasswordConfig(params) {
|
|
282
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
283
|
-
console.debug('loadPasswordConfig()');
|
|
284
|
-
return fetch_1.Get(`${constants_1.urls.identity.users.v1}/passwords/config`, params);
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
exports.loadPasswordConfig = loadPasswordConfig;
|
|
288
|
-
/**
|
|
289
|
-
* recover Multi-Factor authentication by providing the recoveryCode
|
|
290
|
-
* that has been received when activated it
|
|
291
|
-
*
|
|
292
|
-
* @throws exception if recovery code is not valid
|
|
293
|
-
*/
|
|
294
|
-
function recoverMfaToken(body) {
|
|
295
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
296
|
-
console.debug('recoverMfaToken()', body);
|
|
297
|
-
return fetch_1.Post(`${constants_1.urls.identity.auth.v1}/user/mfa/recover`, body);
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
exports.recoverMfaToken = recoverMfaToken;
|
|
301
|
-
/**
|
|
302
|
-
* Multi-Factor Settings
|
|
303
|
-
*/
|
|
304
|
-
/**
|
|
305
|
-
* enroll Multi-Factor Auth Code to use in 3rd party apps like Google Authenticator.
|
|
306
|
-
* the server returns qrCode as png image in base64 format
|
|
307
|
-
*
|
|
308
|
-
* @throws exception if the user already have mfa-enabled
|
|
309
|
-
* ``authorized user``
|
|
310
|
-
*/
|
|
311
|
-
function enrollMfa() {
|
|
312
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
313
|
-
console.debug('enrollMfa()');
|
|
314
|
-
return fetch_1.Post(`${constants_1.urls.identity.users.v1}/mfa/enroll`);
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
exports.enrollMfa = enrollMfa;
|
|
318
|
-
/**
|
|
319
|
-
* after enrolling MFA QR code, verify function should be called
|
|
320
|
-
* with the generated code in the Authenticator App
|
|
321
|
-
*
|
|
322
|
-
* @return recoveryCode to use to disable mfa if your device is lost, this code won't show it again.
|
|
323
|
-
* @throws exception if the generated token is invalid
|
|
324
|
-
* ``authorized user``
|
|
325
|
-
*/
|
|
326
|
-
function verifyMfa(body) {
|
|
327
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
328
|
-
console.debug('verifyMfa()', body);
|
|
329
|
-
return fetch_1.Post(`${constants_1.urls.identity.users.v1}/mfa/enroll/verify`, body);
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
exports.verifyMfa = verifyMfa;
|
|
333
|
-
/**
|
|
334
|
-
* disable MFA by either passing the recoveryCode or the generated code from the Authenticator App.
|
|
335
|
-
*
|
|
336
|
-
* @throws exception if the generated token or the recoveryCode are incorrect.
|
|
337
|
-
* * ``authorized user``
|
|
338
|
-
*/
|
|
339
|
-
function disableMfa(body) {
|
|
340
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
341
|
-
console.debug('disableMfa()', body);
|
|
342
|
-
return fetch_1.Post(`${constants_1.urls.identity.users.v1}/mfa/disable`, body);
|
|
343
|
-
});
|
|
344
|
-
}
|
|
345
|
-
exports.disableMfa = disableMfa;
|
|
346
|
-
/**
|
|
347
|
-
* SSO Configurations
|
|
348
|
-
*/
|
|
349
|
-
/**
|
|
350
|
-
* Retrieve SAML configurations from server by logged in user (tenantId, vendorId)
|
|
351
|
-
*
|
|
352
|
-
* @return {enabled: false} if no saml configuration found. else ISamlConfiguration
|
|
353
|
-
* * ``authorized user``
|
|
354
|
-
*/
|
|
355
|
-
function getSamlConfiguration() {
|
|
356
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
357
|
-
console.debug('getSamlConfiguration()');
|
|
358
|
-
return fetch_1.Get(`${constants_1.urls.team.sso.v1}/saml/configurations`);
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
exports.getSamlConfiguration = getSamlConfiguration;
|
|
362
|
-
/**
|
|
363
|
-
* Update SAML configuration by logged in user (tenantId, vendorId)
|
|
364
|
-
* * ``authorized user``
|
|
365
|
-
*/
|
|
366
|
-
function updateSamlConfiguration(body) {
|
|
367
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
368
|
-
console.debug('updateSamlConfiguration()', body);
|
|
369
|
-
return fetch_1.Post(`${constants_1.urls.team.sso.v1}/saml/configurations`, body);
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
exports.updateSamlConfiguration = updateSamlConfiguration;
|
|
373
|
-
/**
|
|
374
|
-
* Retrieve 'Vendor' Saml config from server by logged in user (tenantId, vendorId)
|
|
375
|
-
*
|
|
376
|
-
* @throws exception 'ACS url information not found' if no saml vendor configuration found.
|
|
377
|
-
* * ``authorized user``
|
|
378
|
-
*/
|
|
379
|
-
function getSamlVendorConfiguration() {
|
|
380
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
381
|
-
console.debug('getSamlVendorConfiguration()');
|
|
382
|
-
return fetch_1.Get(`${constants_1.urls.team.sso.v1}/saml/configurations/vendor-config`);
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
exports.getSamlVendorConfiguration = getSamlVendorConfiguration;
|
|
386
|
-
/**
|
|
387
|
-
* Update Vendor Saml metadata by logged in user (tenantId, vendorId)
|
|
388
|
-
*
|
|
389
|
-
* @return {enabled: false} if no saml configuration found. else ISamlConfiguration
|
|
390
|
-
* * ``authorized user``
|
|
391
|
-
*/
|
|
392
|
-
function updateSamlVendorMetadata(body) {
|
|
393
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
394
|
-
console.debug('updateSamlVendorMetadata()', body);
|
|
395
|
-
return fetch_1.Put(`${constants_1.urls.team.sso.v1}/saml/configurations/metadata`, body);
|
|
396
|
-
});
|
|
397
|
-
}
|
|
398
|
-
exports.updateSamlVendorMetadata = updateSamlVendorMetadata;
|
|
399
|
-
/**
|
|
400
|
-
* Validate Saml configuration's domain by logged in user (tenantId, vendorId)
|
|
401
|
-
*
|
|
402
|
-
* @return {enabled: false} if no saml configuration found. else ISamlConfiguration
|
|
403
|
-
* * ``authorized user``
|
|
404
|
-
*/
|
|
405
|
-
function validateSamlDomain() {
|
|
406
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
407
|
-
console.debug('validateSamlDomain()');
|
|
408
|
-
return fetch_1.Put(`${constants_1.urls.team.sso.v1}/saml/validations/domain`);
|
|
409
|
-
});
|
|
410
|
-
}
|
|
411
|
-
exports.validateSamlDomain = validateSamlDomain;
|
|
412
|
-
/**
|
|
413
|
-
* Get Saml roles for authorization
|
|
414
|
-
* @return array of role IDs
|
|
415
|
-
*/
|
|
416
|
-
function getSamlRoles() {
|
|
417
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
418
|
-
console.debug('getSamlRoles()');
|
|
419
|
-
return fetch_1.Get(`${constants_1.urls.team.sso.v1}/saml/configurations/roles/default`);
|
|
420
|
-
});
|
|
421
|
-
}
|
|
422
|
-
exports.getSamlRoles = getSamlRoles;
|
|
423
|
-
/**
|
|
424
|
-
* Get Saml roles groups
|
|
425
|
-
* @return array of groups and assigend role IDs
|
|
426
|
-
*/
|
|
427
|
-
function getSamlRolesGroups() {
|
|
428
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
429
|
-
console.debug('getSamlRoles()');
|
|
430
|
-
return fetch_1.Get(`${constants_1.urls.team.sso.v2}/saml/configurations/groups`);
|
|
431
|
-
});
|
|
432
|
-
}
|
|
433
|
-
exports.getSamlRolesGroups = getSamlRolesGroups;
|
|
434
|
-
/**
|
|
435
|
-
* Update Saml roles for authorization
|
|
436
|
-
*/
|
|
437
|
-
function updateSamlRoles({ roleIds }) {
|
|
438
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
439
|
-
console.debug('updateSamlRoles()');
|
|
440
|
-
return fetch_1.Post(`${constants_1.urls.team.sso.v1}/saml/configurations/roles/default`, { roleIds });
|
|
441
|
-
});
|
|
442
|
-
}
|
|
443
|
-
exports.updateSamlRoles = updateSamlRoles;
|
|
444
|
-
/**
|
|
445
|
-
* Create Saml group roles for authorization
|
|
446
|
-
*/
|
|
447
|
-
function createSamlGroup({ roleIds, group }) {
|
|
448
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
449
|
-
console.debug('createSamlGroup()');
|
|
450
|
-
return fetch_1.Post(`${constants_1.urls.team.sso.v2}/saml/configurations/groups`, { group, roleIds });
|
|
451
|
-
});
|
|
452
|
-
}
|
|
453
|
-
exports.createSamlGroup = createSamlGroup;
|
|
454
|
-
/**
|
|
455
|
-
* Update Saml group roles for authorization
|
|
456
|
-
*/
|
|
457
|
-
function updateSamlGroup({ roleIds, group, id }) {
|
|
458
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
459
|
-
console.debug('updateSamlGroup()');
|
|
460
|
-
return fetch_1.Patch(`${constants_1.urls.team.sso.v2}/saml/configurations/groups/${id}`, { group, roleIds });
|
|
461
|
-
});
|
|
462
|
-
}
|
|
463
|
-
exports.updateSamlGroup = updateSamlGroup;
|
|
464
|
-
/**
|
|
465
|
-
* Delete Saml group
|
|
466
|
-
*/
|
|
467
|
-
function deleteSamlGroup({ id }) {
|
|
468
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
469
|
-
console.debug('deleteSamlGroup()');
|
|
470
|
-
return fetch_1.Delete(`${constants_1.urls.team.sso.v2}/saml/configurations/groups/${id}`);
|
|
471
|
-
});
|
|
472
|
-
}
|
|
473
|
-
exports.deleteSamlGroup = deleteSamlGroup;
|
|
474
|
-
/**
|
|
475
|
-
* Retrieve OIDC configurations from server by logged in user (vendorId)
|
|
476
|
-
*
|
|
477
|
-
* @return {active: true} if no oidc configuration found. else IOidcConfiguration
|
|
478
|
-
* * ``authorized user``
|
|
479
|
-
*/
|
|
480
|
-
function getOidcConfiguration() {
|
|
481
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
482
|
-
console.debug('getOidcConfiguration()');
|
|
483
|
-
return fetch_1.Get(`${constants_1.urls.team.sso.v1}/oidc/configurations`);
|
|
484
|
-
});
|
|
485
|
-
}
|
|
486
|
-
exports.getOidcConfiguration = getOidcConfiguration;
|
|
487
|
-
/**
|
|
488
|
-
* Check if one or more saml/oidc configuration are active
|
|
489
|
-
*
|
|
490
|
-
** @return {isActive: true/false}
|
|
491
|
-
*/
|
|
492
|
-
function getSSOPublicConfiguration() {
|
|
493
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
494
|
-
console.debug('getSSOPublicConfiguration()');
|
|
495
|
-
return fetch_1.Get(`${constants_1.urls.team.sso.v2}/configurations/public`);
|
|
496
|
-
});
|
|
497
|
-
}
|
|
498
|
-
exports.getSSOPublicConfiguration = getSSOPublicConfiguration;
|
|
499
|
-
/**
|
|
500
|
-
* Get social logins providers configurations for vendor
|
|
501
|
-
* @return array of providers configurations
|
|
502
|
-
*/
|
|
503
|
-
function getSocialLoginProviders() {
|
|
504
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
505
|
-
console.debug('getSocialLoginProviders()');
|
|
506
|
-
return fetch_1.Get(constants_1.urls.identity.sso.v1);
|
|
507
|
-
});
|
|
508
|
-
}
|
|
509
|
-
exports.getSocialLoginProviders = getSocialLoginProviders;
|
|
510
|
-
/**
|
|
511
|
-
* Get social logins providers configurations V2 supports dev credentials as well
|
|
512
|
-
* @return array of providers configurations
|
|
513
|
-
*/
|
|
514
|
-
function getSocialLoginProvidersV2() {
|
|
515
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
516
|
-
console.debug('getSocialLoginProvidersV2()');
|
|
517
|
-
return fetch_1.Get(constants_1.urls.identity.sso.v2);
|
|
518
|
-
});
|
|
519
|
-
}
|
|
520
|
-
exports.getSocialLoginProvidersV2 = getSocialLoginProvidersV2;
|
|
521
|
-
/**
|
|
522
|
-
* Login using social login
|
|
523
|
-
* @return cookie with refresh token
|
|
524
|
-
*/
|
|
525
|
-
function loginViaSocialLogin({ provider, code, redirectUri, codeVerifier, metadata, invitationToken, state, }) {
|
|
526
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
527
|
-
console.debug('loginViaSocialLogin()');
|
|
528
|
-
const params = { code };
|
|
529
|
-
if (redirectUri) {
|
|
530
|
-
params.redirectUri = redirectUri;
|
|
531
|
-
}
|
|
532
|
-
if (codeVerifier) {
|
|
533
|
-
params.code_verifier = codeVerifier;
|
|
534
|
-
}
|
|
535
|
-
if (state) {
|
|
536
|
-
params.state = state;
|
|
537
|
-
}
|
|
538
|
-
return fetch_1.Post(`${constants_1.urls.identity.auth.v1}/user/sso/${provider}/postlogin`, { metadata, invitationToken }, { params });
|
|
539
|
-
});
|
|
540
|
-
}
|
|
541
|
-
exports.loginViaSocialLogin = loginViaSocialLogin;
|
|
542
|
-
/**
|
|
543
|
-
* Get vendor secure access configuration
|
|
544
|
-
*/
|
|
545
|
-
function getVendorConfig() {
|
|
546
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
547
|
-
console.debug('getVendorConfig()');
|
|
548
|
-
return fetch_1.Get(`${constants_1.urls.identity.configurations.v1}/public`);
|
|
549
|
-
});
|
|
550
|
-
}
|
|
551
|
-
exports.getVendorConfig = getVendorConfig;
|
|
552
|
-
/**
|
|
553
|
-
* Sign up new user
|
|
554
|
-
* create new user with a new tenant
|
|
555
|
-
*/
|
|
556
|
-
function signUpUser(body) {
|
|
557
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
558
|
-
console.debug('signUpUser()', body);
|
|
559
|
-
const { shouldActivate, authResponse, userId, tenantId } = yield fetch_1.Post(`${constants_1.urls.identity.users.v1}/signUp`, body);
|
|
560
|
-
const loginResponse = !shouldActivate && authResponse ? yield generateLoginResponse(authResponse) : undefined;
|
|
561
|
-
return { shouldActivate, user: loginResponse, userId, tenantId };
|
|
562
|
-
});
|
|
563
|
-
}
|
|
564
|
-
exports.signUpUser = signUpUser;
|
|
565
|
-
/**
|
|
566
|
-
* Get all current user active sessions
|
|
567
|
-
*/
|
|
568
|
-
function getCurrentUserSessions() {
|
|
569
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
570
|
-
console.debug('getCurrentUserSessions');
|
|
571
|
-
const sessions = yield fetch_1.Get(constants_1.urls.identity.users.sessions.currentUser.v1);
|
|
572
|
-
return sessions;
|
|
573
|
-
});
|
|
574
|
-
}
|
|
575
|
-
exports.getCurrentUserSessions = getCurrentUserSessions;
|
|
576
|
-
/**
|
|
577
|
-
* Get session configurations
|
|
578
|
-
*/
|
|
579
|
-
function getSessionConfigurations() {
|
|
580
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
581
|
-
console.debug('getSessionConfigurations');
|
|
582
|
-
const sessionsConfigurations = yield fetch_1.Get(constants_1.urls.identity.users.sessions.configurations.v1);
|
|
583
|
-
return sessionsConfigurations;
|
|
584
|
-
});
|
|
585
|
-
}
|
|
586
|
-
exports.getSessionConfigurations = getSessionConfigurations;
|
|
587
|
-
/**
|
|
588
|
-
* Create or update session configurations
|
|
589
|
-
*/
|
|
590
|
-
function createOrUpdateSessionConfigrations(body) {
|
|
591
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
592
|
-
console.debug('createOrUpdateSessionConfigrations');
|
|
593
|
-
yield fetch_1.Post(constants_1.urls.identity.users.sessions.configurations.v1, body);
|
|
594
|
-
});
|
|
595
|
-
}
|
|
596
|
-
exports.createOrUpdateSessionConfigrations = createOrUpdateSessionConfigrations;
|
|
597
|
-
/**
|
|
598
|
-
* Delete user session
|
|
599
|
-
*/
|
|
600
|
-
function deleteSessionForUser(id) {
|
|
601
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
602
|
-
console.debug('deleteSessionForUser', id);
|
|
603
|
-
yield fetch_1.Delete(`${constants_1.urls.identity.users.sessions.currentUser.v1}/${id}`);
|
|
604
|
-
});
|
|
605
|
-
}
|
|
606
|
-
exports.deleteSessionForUser = deleteSessionForUser;
|
|
607
|
-
/**
|
|
608
|
-
* Delete all user sessions
|
|
609
|
-
*/
|
|
610
|
-
function deleteAllSessionsForUser() {
|
|
611
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
612
|
-
console.debug('deleteAllSessionsForUser');
|
|
613
|
-
yield fetch_1.Delete(`${constants_1.urls.identity.users.sessions.currentUser.v1}/all`);
|
|
614
|
-
});
|
|
615
|
-
}
|
|
616
|
-
exports.deleteAllSessionsForUser = deleteAllSessionsForUser;
|
|
617
|
-
/**
|
|
618
|
-
* Api tokens Configurations
|
|
619
|
-
*/
|
|
620
|
-
/**
|
|
621
|
-
* Get user api tokens data
|
|
622
|
-
*/
|
|
623
|
-
function getUserApiTokensData() {
|
|
624
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
625
|
-
console.debug('getUserApiTokensData()');
|
|
626
|
-
return fetch_1.Get(constants_1.urls.identity.users.apiTokens.v1);
|
|
627
|
-
});
|
|
628
|
-
}
|
|
629
|
-
exports.getUserApiTokensData = getUserApiTokensData;
|
|
630
|
-
/**
|
|
631
|
-
* Get tenant api tokens data
|
|
632
|
-
*/
|
|
633
|
-
function getTenantApiTokensData() {
|
|
634
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
635
|
-
console.debug('geTenantApiTokensData()');
|
|
636
|
-
return fetch_1.Get(constants_1.urls.identity.tenants.apiTokens.v1);
|
|
637
|
-
});
|
|
638
|
-
}
|
|
639
|
-
exports.getTenantApiTokensData = getTenantApiTokensData;
|
|
640
|
-
/**
|
|
641
|
-
* Update User Api Tokens
|
|
642
|
-
*/
|
|
643
|
-
function updateUserApiTokensData(body) {
|
|
644
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
645
|
-
console.debug('updateUserApiTokensData()', body);
|
|
646
|
-
return fetch_1.Post(constants_1.urls.identity.users.apiTokens.v1, body);
|
|
647
|
-
});
|
|
648
|
-
}
|
|
649
|
-
exports.updateUserApiTokensData = updateUserApiTokensData;
|
|
650
|
-
/**
|
|
651
|
-
* Update Tenant Api Tokens
|
|
652
|
-
*/
|
|
653
|
-
function updateTenantApiTokensData(body) {
|
|
654
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
655
|
-
console.debug('updateTenantApiTokensData()', body);
|
|
656
|
-
return fetch_1.Post(constants_1.urls.identity.tenants.apiTokens.v2, body);
|
|
657
|
-
});
|
|
658
|
-
}
|
|
659
|
-
exports.updateTenantApiTokensData = updateTenantApiTokensData;
|
|
660
|
-
/**
|
|
661
|
-
* Delete Tenant Api Token
|
|
662
|
-
*/
|
|
663
|
-
function deleteTenantApiToken({ tokenId }) {
|
|
664
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
665
|
-
console.debug('deleteTenantApiToken()', tokenId);
|
|
666
|
-
return fetch_1.Delete(`${constants_1.urls.identity.tenants.apiTokens.v1}/${tokenId}`);
|
|
667
|
-
});
|
|
668
|
-
}
|
|
669
|
-
exports.deleteTenantApiToken = deleteTenantApiToken;
|
|
670
|
-
/**
|
|
671
|
-
* Delete Tenant Api Token
|
|
672
|
-
*/
|
|
673
|
-
function deleteUserApiToken({ tokenId }) {
|
|
674
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
675
|
-
console.debug('deleteUserApiToken()', tokenId);
|
|
676
|
-
return fetch_1.Delete(`${constants_1.urls.identity.users.apiTokens.v1}/${tokenId}`);
|
|
677
|
-
});
|
|
678
|
-
}
|
|
679
|
-
exports.deleteUserApiToken = deleteUserApiToken;
|
|
680
|
-
/**
|
|
681
|
-
* Get Tenant Api Token Creator User
|
|
682
|
-
*/
|
|
683
|
-
function getUserById({ userId }) {
|
|
684
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
685
|
-
console.debug('getUserById()');
|
|
686
|
-
return fetch_1.Get(`${constants_1.urls.identity.users.v1}/${userId}`);
|
|
687
|
-
});
|
|
688
|
-
}
|
|
689
|
-
exports.getUserById = getUserById;
|
|
690
|
-
/**
|
|
691
|
-
* Checks if remember MFA device is enabled for user.
|
|
692
|
-
*/
|
|
693
|
-
function checkIfAllowToRememberMfaDevice(mfaToken) {
|
|
694
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
695
|
-
console.debug('checkIfAllowToRememberMfaDevice()');
|
|
696
|
-
return fetch_1.Get(`${constants_1.urls.identity.configurations.v1}/mfa-policy/allow-remember-device`, { mfaToken });
|
|
697
|
-
});
|
|
698
|
-
}
|
|
699
|
-
exports.checkIfAllowToRememberMfaDevice = checkIfAllowToRememberMfaDevice;
|
|
700
|
-
/**
|
|
701
|
-
* Passwordless prelogin authentication
|
|
702
|
-
*/
|
|
703
|
-
function passwordlessPreLogin(_a) {
|
|
704
|
-
var { type } = _a, body = __rest(_a, ["type"]);
|
|
705
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
706
|
-
console.debug('passwordlessPrelogin()');
|
|
707
|
-
return fetch_1.Post(`${constants_1.urls.identity.auth.v1}/passwordless/${type.toLocaleLowerCase()}/prelogin`, body);
|
|
708
|
-
});
|
|
709
|
-
}
|
|
710
|
-
exports.passwordlessPreLogin = passwordlessPreLogin;
|
|
711
|
-
function passwordlessPostLogin(_a) {
|
|
712
|
-
var { type } = _a, body = __rest(_a, ["type"]);
|
|
713
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
714
|
-
console.debug('passwordlessPostLogin()');
|
|
715
|
-
return fetch_1.Post(`${constants_1.urls.identity.auth.v1}/passwordless/${type.toLocaleLowerCase()}/postlogin`, body);
|
|
716
|
-
});
|
|
717
|
-
}
|
|
718
|
-
exports.passwordlessPostLogin = passwordlessPostLogin;
|
|
719
|
-
/**
|
|
720
|
-
* Check if tenant invitation token is valid
|
|
721
|
-
* @param token - invitation token
|
|
722
|
-
* @returns tenant name
|
|
723
|
-
*/
|
|
724
|
-
function verifyInviteToken({ token }) {
|
|
725
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
726
|
-
console.debug('verifyInviteToken()');
|
|
727
|
-
return fetch_1.Post(constants_1.urls.identity.tenants.invites.verify.v1, { token });
|
|
728
|
-
});
|
|
729
|
-
}
|
|
730
|
-
exports.verifyInviteToken = verifyInviteToken;
|
|
731
|
-
/**
|
|
732
|
-
* SSO Configurations V1
|
|
733
|
-
*/
|
|
734
|
-
/**
|
|
735
|
-
* Retrieve SSO configurations from server by logged in user (tenantId, vendorId)
|
|
736
|
-
*
|
|
737
|
-
* @return ISSOConfiguration[]
|
|
738
|
-
* * ``authorized user``
|
|
739
|
-
*/
|
|
740
|
-
function getSSOConfigurations() {
|
|
741
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
742
|
-
console.debug('getSSOConfigurations()');
|
|
743
|
-
return fetch_1.Get(`${constants_1.urls.team.sso.v1}/configurations`);
|
|
744
|
-
});
|
|
745
|
-
}
|
|
746
|
-
exports.getSSOConfigurations = getSSOConfigurations;
|
|
747
|
-
/**
|
|
748
|
-
* Create SSO configuration by logged in user (tenantId, vendorId)
|
|
749
|
-
*
|
|
750
|
-
* @returns ISSOConfiguration
|
|
751
|
-
* * ``authorized user``
|
|
752
|
-
*/
|
|
753
|
-
function createSSOConfiguration(body) {
|
|
754
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
755
|
-
console.debug('createSSOConfiguration()', body);
|
|
756
|
-
return fetch_1.Post(`${constants_1.urls.team.sso.v1}/configurations`, body);
|
|
757
|
-
});
|
|
758
|
-
}
|
|
759
|
-
exports.createSSOConfiguration = createSSOConfiguration;
|
|
760
|
-
/**
|
|
761
|
-
* Update SSO configuration by logged in user (tenantId, vendorId)
|
|
762
|
-
*
|
|
763
|
-
* @returns ISSOConfiguration
|
|
764
|
-
* * ``authorized user``
|
|
765
|
-
*/
|
|
766
|
-
function updateSSOConfiguration(ssoConfigId, body) {
|
|
767
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
768
|
-
console.debug('updateSSOConfiguration()', { body, ssoConfigId });
|
|
769
|
-
return fetch_1.Patch(`${constants_1.urls.team.sso.v1}/configurations/${ssoConfigId}`, body);
|
|
770
|
-
});
|
|
771
|
-
}
|
|
772
|
-
exports.updateSSOConfiguration = updateSSOConfiguration;
|
|
773
|
-
/**
|
|
774
|
-
* Delete SSO configuration by logged in user (tenantId, vendorId)
|
|
775
|
-
* * ``authorized user``
|
|
776
|
-
*/
|
|
777
|
-
function deleteSSOConfiguration(ssoConfigId) {
|
|
778
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
779
|
-
console.debug('deleteSSOConfiguration()', { ssoConfigId });
|
|
780
|
-
return fetch_1.Delete(`${constants_1.urls.team.sso.v1}/configurations/${ssoConfigId}`);
|
|
781
|
-
});
|
|
782
|
-
}
|
|
783
|
-
exports.deleteSSOConfiguration = deleteSSOConfiguration;
|
|
784
|
-
/**
|
|
785
|
-
* Create SSO configuration by metadata by logged in user (tenantId, vendorId)
|
|
786
|
-
*
|
|
787
|
-
* @returns ISSOConfiguration
|
|
788
|
-
* * ``authorized user``
|
|
789
|
-
*/
|
|
790
|
-
function createSSOConfigurationByMetadata(body) {
|
|
791
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
792
|
-
console.debug('createSSOConfigurationByMetadata()', body);
|
|
793
|
-
return fetch_1.Post(`${constants_1.urls.team.sso.v1}/configurations/metadata`, body);
|
|
794
|
-
});
|
|
795
|
-
}
|
|
796
|
-
exports.createSSOConfigurationByMetadata = createSSOConfigurationByMetadata;
|
|
797
|
-
/**
|
|
798
|
-
* Update SSO configuration by metadata by logged in user (tenantId, vendorId)
|
|
799
|
-
*
|
|
800
|
-
* @returns ISSOConfiguration
|
|
801
|
-
* * ``authorized user``
|
|
802
|
-
*/
|
|
803
|
-
function updateSSOConfigurationByMetadata(ssoConfigId, body) {
|
|
804
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
805
|
-
console.debug('updateSSOConfigurationByMetadata()', { body, ssoConfigId });
|
|
806
|
-
return fetch_1.Put(`${constants_1.urls.team.sso.v1}/configurations/${ssoConfigId}/metadata`, body);
|
|
807
|
-
});
|
|
808
|
-
}
|
|
809
|
-
exports.updateSSOConfigurationByMetadata = updateSSOConfigurationByMetadata;
|
|
810
|
-
/**
|
|
811
|
-
* Create SSO configuration domain by logged in user (tenantId, vendorId)
|
|
812
|
-
*
|
|
813
|
-
* @returns ISSODomain
|
|
814
|
-
* * ``authorized user``
|
|
815
|
-
*/
|
|
816
|
-
function createSSODomain(ssoConfigId, body) {
|
|
817
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
818
|
-
console.debug('createSSODomain()', { body, ssoConfigId });
|
|
819
|
-
return fetch_1.Post(`${constants_1.urls.team.sso.v1}/configurations/${ssoConfigId}/domains`, body);
|
|
820
|
-
});
|
|
821
|
-
}
|
|
822
|
-
exports.createSSODomain = createSSODomain;
|
|
823
|
-
/**
|
|
824
|
-
* Create SSO configuration domain by logged in user (tenantId, vendorId)
|
|
825
|
-
* * ``authorized user``
|
|
826
|
-
*/
|
|
827
|
-
function deleteSSODomain(ssoConfigId, domainId) {
|
|
828
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
829
|
-
console.debug('deleteSSODomain()', { domainId, ssoConfigId });
|
|
830
|
-
return fetch_1.Delete(`${constants_1.urls.team.sso.v1}/configurations/${ssoConfigId}/domains/${domainId}`);
|
|
831
|
-
});
|
|
832
|
-
}
|
|
833
|
-
exports.deleteSSODomain = deleteSSODomain;
|
|
834
|
-
/**
|
|
835
|
-
* Validate SSO configuration domain by logged in user (tenantId, vendorId)
|
|
836
|
-
* * ``authorized user``
|
|
837
|
-
*/
|
|
838
|
-
function validateSSODomain(ssoConfigId, domainId) {
|
|
839
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
840
|
-
console.debug('validateSSODomain()', { domainId, ssoConfigId });
|
|
841
|
-
return fetch_1.Put(`${constants_1.urls.team.sso.v1}/configurations/${ssoConfigId}/domains/${domainId}/validate`);
|
|
842
|
-
});
|
|
843
|
-
}
|
|
844
|
-
exports.validateSSODomain = validateSSODomain;
|
|
845
|
-
/**
|
|
846
|
-
* Get SSO configuration default roles by logged in user (tenantId, vendorId)
|
|
847
|
-
* * ``authorized user``
|
|
848
|
-
*/
|
|
849
|
-
function getSSODefaultRoles(ssoConfigId) {
|
|
850
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
851
|
-
console.debug('getSSODefaultRoles()', { ssoConfigId });
|
|
852
|
-
return fetch_1.Get(`${constants_1.urls.team.sso.v1}/configurations/${ssoConfigId}/roles`);
|
|
853
|
-
});
|
|
854
|
-
}
|
|
855
|
-
exports.getSSODefaultRoles = getSSODefaultRoles;
|
|
856
|
-
/**
|
|
857
|
-
* Create SSO configuration default roles by logged in user (tenantId, vendorId)
|
|
858
|
-
* * ``authorized user``
|
|
859
|
-
*/
|
|
860
|
-
function setSSODefaultRoles(ssoConfigId, body) {
|
|
861
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
862
|
-
console.debug('setSSODefaultRoles()', { body, ssoConfigId });
|
|
863
|
-
return fetch_1.Put(`${constants_1.urls.team.sso.v1}/configurations/${ssoConfigId}/roles`, body);
|
|
864
|
-
});
|
|
865
|
-
}
|
|
866
|
-
exports.setSSODefaultRoles = setSSODefaultRoles;
|
|
867
|
-
/**
|
|
868
|
-
* Create SSO configuration group roles for authorization
|
|
869
|
-
*/
|
|
870
|
-
function createSSOGroup(ssoConfigId, body) {
|
|
871
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
872
|
-
console.debug('createSSOGroup()', { body, ssoConfigId });
|
|
873
|
-
return fetch_1.Post(`${constants_1.urls.team.sso.v1}/configurations/${ssoConfigId}/groups`, body);
|
|
874
|
-
});
|
|
875
|
-
}
|
|
876
|
-
exports.createSSOGroup = createSSOGroup;
|
|
877
|
-
/**
|
|
878
|
-
* Update SSO configuration group roles for authorization
|
|
879
|
-
*/
|
|
880
|
-
function updateSSOGroup(ssoConfigId, { roleIds, group, id }) {
|
|
881
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
882
|
-
console.debug('updateSSOGroup()', { ssoConfigId, roleIds, group });
|
|
883
|
-
return fetch_1.Patch(`${constants_1.urls.team.sso.v1}/configurations/${ssoConfigId}/groups/${id}`, { group, roleIds });
|
|
884
|
-
});
|
|
885
|
-
}
|
|
886
|
-
exports.updateSSOGroup = updateSSOGroup;
|
|
887
|
-
/**
|
|
888
|
-
* Delete SSO configuration group
|
|
889
|
-
*/
|
|
890
|
-
function deleteSSOGroup(ssoConfigId, groupId) {
|
|
891
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
892
|
-
console.debug('deleteSSOGroup()', { ssoConfigId, groupId });
|
|
893
|
-
return fetch_1.Delete(`${constants_1.urls.team.sso.v1}/configurations/${ssoConfigId}/groups/${groupId}`);
|
|
894
|
-
});
|
|
895
|
-
}
|
|
896
|
-
exports.deleteSSOGroup = deleteSSOGroup;
|
|
897
|
-
/**
|
|
898
|
-
* Get SSO configuration groups
|
|
899
|
-
*/
|
|
900
|
-
function getSSOGroups(ssoConfigId) {
|
|
901
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
902
|
-
console.debug('getSSOGroups()', { ssoConfigId });
|
|
903
|
-
return fetch_1.Get(`${constants_1.urls.team.sso.v1}/configurations/${ssoConfigId}/groups`);
|
|
904
|
-
});
|
|
905
|
-
}
|
|
906
|
-
exports.getSSOGroups = getSSOGroups;
|
|
907
|
-
/**
|
|
908
|
-
* Check if requested email address has sso configuration
|
|
909
|
-
* If true, this function will return the sso address to navigate to
|
|
910
|
-
* else, return null
|
|
911
|
-
*/
|
|
912
|
-
function preLoginV2(body) {
|
|
913
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
914
|
-
console.debug('preLoginV2()', body);
|
|
915
|
-
return fetch_1.Post(`${constants_1.urls.identity.auth.v2}/user/sso/prelogin`, body);
|
|
916
|
-
});
|
|
917
|
-
}
|
|
918
|
-
exports.preLoginV2 = preLoginV2;
|
|
919
|
-
/**
|
|
920
|
-
* After calling preLogin and navigated to SSO url, the IDP will redirect you to the redirect url
|
|
921
|
-
* with code and state
|
|
922
|
-
*/
|
|
923
|
-
function oidcPostLoginV2(body) {
|
|
924
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
925
|
-
console.debug('oidcPostLoginV2()');
|
|
926
|
-
const data = yield fetch_1.Post(`${constants_1.urls.identity.auth.v2}/user/oidc/postlogin`, body);
|
|
927
|
-
return generateLoginResponse(data);
|
|
928
|
-
});
|
|
929
|
-
}
|
|
930
|
-
exports.oidcPostLoginV2 = oidcPostLoginV2;
|
|
931
|
-
function exchangeOAuthTokens(body) {
|
|
932
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
933
|
-
console.debug('exchangeOauthTokens()');
|
|
934
|
-
const data = yield fetch_1.Post(`${constants_1.urls.oauth.v1}/token`, body);
|
|
935
|
-
return generateLoginResponseFromOAuthResponse(data);
|
|
936
|
-
});
|
|
937
|
-
}
|
|
938
|
-
exports.exchangeOAuthTokens = exchangeOAuthTokens;
|
|
939
|
-
/**
|
|
940
|
-
* reset phone should be called in case user want to reset his phone number
|
|
941
|
-
* when using sms authentication strategy. a 6-digits code will be send to the user email.
|
|
942
|
-
*/
|
|
943
|
-
function resetPhoneNumber(body) {
|
|
944
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
945
|
-
console.debug('resetPhoneNumber()', body);
|
|
946
|
-
return fetch_1.Post(`${constants_1.urls.identity.users.v1}/phone/reset`, body);
|
|
947
|
-
});
|
|
948
|
-
}
|
|
949
|
-
exports.resetPhoneNumber = resetPhoneNumber;
|
|
950
|
-
/**
|
|
951
|
-
* verify reset phone should be called after reset phone number request
|
|
952
|
-
* with the token received from the reset phone number request and a code that was sent to the user email
|
|
953
|
-
*/
|
|
954
|
-
function verifyResetPhoneNumber(body) {
|
|
955
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
956
|
-
console.debug('verifyResetPhoneNumber()', body);
|
|
957
|
-
return fetch_1.Post(`${constants_1.urls.identity.users.v1}/phone/reset/verify`, body);
|
|
958
|
-
});
|
|
959
|
-
}
|
|
960
|
-
exports.verifyResetPhoneNumber = verifyResetPhoneNumber;
|
|
961
|
-
/**
|
|
962
|
-
* change phone number with verification.
|
|
963
|
-
*/
|
|
964
|
-
function changePhoneNumberWithVerification(body) {
|
|
965
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
966
|
-
console.debug('changePhoneNumberWithVerification()', body);
|
|
967
|
-
return fetch_1.Post(`${constants_1.urls.identity.users.v1}/phone`, body);
|
|
968
|
-
});
|
|
969
|
-
}
|
|
970
|
-
exports.changePhoneNumberWithVerification = changePhoneNumberWithVerification;
|
|
971
|
-
/**
|
|
972
|
-
* verify new phone number.
|
|
973
|
-
*/
|
|
974
|
-
function verifyChangePhoneNumber(body) {
|
|
975
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
976
|
-
console.debug('verifyChangePhoneNumber()', body);
|
|
977
|
-
return fetch_1.Post(`${constants_1.urls.identity.users.v1}/phone/verify`, body);
|
|
978
|
-
});
|
|
979
|
-
}
|
|
980
|
-
exports.verifyChangePhoneNumber = verifyChangePhoneNumber;
|
|
981
|
-
/**
|
|
982
|
-
* change phone number should be called after verify reset phone number with the new phone number
|
|
983
|
-
*/
|
|
984
|
-
function changePhoneNumber(body) {
|
|
985
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
986
|
-
console.debug('changePhoneNumber()', body);
|
|
987
|
-
return fetch_1.Put(`${constants_1.urls.identity.users.v1}/phone/change`, body);
|
|
988
|
-
});
|
|
989
|
-
}
|
|
990
|
-
exports.changePhoneNumber = changePhoneNumber;
|
|
991
|
-
/**
|
|
992
|
-
* webauthn prelogin should be called when the user wants to be authenticated using his device/android/usb key
|
|
993
|
-
*/
|
|
994
|
-
function webAuthnPreLogin(body) {
|
|
995
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
996
|
-
console.debug('webAuthnPreLogin()', body);
|
|
997
|
-
return fetch_1.Post(`${constants_1.urls.identity.auth.v1}/webauthn/prelogin`, body);
|
|
998
|
-
});
|
|
999
|
-
}
|
|
1000
|
-
exports.webAuthnPreLogin = webAuthnPreLogin;
|
|
1001
|
-
/**
|
|
1002
|
-
* webauthn postlogin should be called after the user used his authenticator (device/android/usb key) in order to login
|
|
1003
|
-
*/
|
|
1004
|
-
function webAuthnPostLogin(body) {
|
|
1005
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1006
|
-
console.debug('webAuthnPostLogin()', body);
|
|
1007
|
-
return fetch_1.Post(`${constants_1.urls.identity.auth.v1}/webauthn/postlogin`, body);
|
|
1008
|
-
});
|
|
1009
|
-
}
|
|
1010
|
-
exports.webAuthnPostLogin = webAuthnPostLogin;
|
|
1011
|
-
/**
|
|
1012
|
-
* webauthn create new device should be called once the user wants to add new device as authenticator
|
|
1013
|
-
*/
|
|
1014
|
-
function webAuthnCreateNewDeviceSession() {
|
|
1015
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1016
|
-
console.debug('webAuthnCreateNewDeviceSession()');
|
|
1017
|
-
return fetch_1.Post(constants_1.urls.identity.webAuthnDevices.v1);
|
|
1018
|
-
});
|
|
1019
|
-
}
|
|
1020
|
-
exports.webAuthnCreateNewDeviceSession = webAuthnCreateNewDeviceSession;
|
|
1021
|
-
/**
|
|
1022
|
-
* webauthn verify new device should be called after the user used his authenticator in order to register the new device
|
|
1023
|
-
*/
|
|
1024
|
-
function verifyNewDeviceSession(body) {
|
|
1025
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1026
|
-
console.debug('verifyNewDeviceSession()', body);
|
|
1027
|
-
return fetch_1.Post(`${constants_1.urls.identity.webAuthnDevices.v1}/verify`, body);
|
|
1028
|
-
});
|
|
1029
|
-
}
|
|
1030
|
-
exports.verifyNewDeviceSession = verifyNewDeviceSession;
|
|
1031
|
-
/**
|
|
1032
|
-
* Get public vendor auth strategies public configuration
|
|
1033
|
-
*/
|
|
1034
|
-
function getVendorPublicAuthStrategiesConfig() {
|
|
1035
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1036
|
-
console.debug('getVendorPublicAuthStrategiesConfig()');
|
|
1037
|
-
return fetch_1.Get(`${constants_1.urls.identity.configurations.v1}/auth/strategies/public`);
|
|
1038
|
-
});
|
|
1039
|
-
}
|
|
1040
|
-
exports.getVendorPublicAuthStrategiesConfig = getVendorPublicAuthStrategiesConfig;
|
|
1041
|
-
;
|
|
1042
|
-
//# sourceMappingURL=index.js.map
|