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