@frontegg/rest-api 3.1.73 → 3.1.74-alpha.9436935127

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.
Files changed (125) hide show
  1. package/BaseApiClient.d.ts +16 -0
  2. package/BaseApiClient.js +39 -0
  3. package/ContextHolder/index.d.ts +82 -24
  4. package/ContextHolder/index.js +56 -43
  5. package/FetchClient.d.ts +42 -0
  6. package/FetchClient.js +308 -0
  7. package/account-settings/index.d.ts +19 -7
  8. package/account-settings/index.js +23 -13
  9. package/applications/index.d.ts +49 -44
  10. package/applications/index.js +51 -37
  11. package/audits/index.d.ts +27 -15
  12. package/audits/index.js +27 -17
  13. package/auth/index.d.ts +764 -768
  14. package/auth/index.js +875 -721
  15. package/auth/secutiry-poilicy/index.d.ts +58 -102
  16. package/auth/secutiry-poilicy/index.js +122 -90
  17. package/auth/utils.d.ts +2 -2
  18. package/auth/utils.js +10 -9
  19. package/connectivity/index.d.ts +125 -26
  20. package/connectivity/index.js +147 -114
  21. package/directory/index.d.ts +31 -22
  22. package/directory/index.js +27 -15
  23. package/entitlements/index.d.ts +14 -8
  24. package/entitlements/index.js +12 -4
  25. package/feature-flags/index.d.ts +8 -2
  26. package/feature-flags/index.js +16 -8
  27. package/groups/index.d.ts +73 -49
  28. package/groups/index.js +64 -45
  29. package/impersonate/index.d.ts +15 -6
  30. package/impersonate/index.js +13 -5
  31. package/index.d.ts +153 -108
  32. package/index.js +108 -79
  33. package/interfaces.d.ts +10 -0
  34. package/metadata/index.d.ts +67 -7
  35. package/metadata/index.js +52 -32
  36. package/node/BaseApiClient.js +49 -0
  37. package/node/ContextHolder/index.js +60 -44
  38. package/node/FetchClient.js +326 -0
  39. package/node/account-settings/index.js +27 -16
  40. package/node/applications/index.js +51 -44
  41. package/node/audits/index.js +31 -20
  42. package/node/auth/index.js +746 -1036
  43. package/node/auth/secutiry-poilicy/index.js +125 -136
  44. package/node/auth/utils.js +9 -7
  45. package/node/connectivity/index.js +148 -187
  46. package/node/directory/index.js +29 -20
  47. package/node/entitlements/index.js +18 -5
  48. package/node/feature-flags/index.js +21 -9
  49. package/node/groups/index.js +65 -63
  50. package/node/impersonate/index.js +18 -5
  51. package/node/index.js +134 -71
  52. package/node/metadata/index.js +61 -52
  53. package/node/notifications/index.js +37 -27
  54. package/node/reports/index.js +78 -70
  55. package/node/roles/index.js +56 -51
  56. package/node/security-center/index.js +21 -9
  57. package/node/sub-tenants/index.js +83 -73
  58. package/node/sub-tenants/interfaces.js +10 -1
  59. package/node/subscriptions/index.js +79 -107
  60. package/node/subscriptions/invoices.js +25 -17
  61. package/node/subscriptions/managedSubscriptions.js +32 -27
  62. package/node/subscriptions/paymentMethods.js +27 -20
  63. package/node/subscriptions/paymentProviders.js +15 -6
  64. package/node/subscriptions/plans.js +17 -9
  65. package/node/subscriptions/providers/stripe/index.js +26 -21
  66. package/node/subscriptions/subscriptions.js +32 -27
  67. package/node/subscriptions/summaries.js +15 -6
  68. package/node/subscriptions/tenantConfiguration.js +17 -9
  69. package/node/subscriptions/vendorPublicConfigurations.js +15 -6
  70. package/node/teams/index.js +130 -138
  71. package/node/tenants/index.js +65 -60
  72. package/node/user-phone-numbers/index.js +32 -24
  73. package/node/users/index.js +58 -53
  74. package/node/vendor/index.js +17 -6
  75. package/notifications/index.d.ts +22 -16
  76. package/notifications/index.js +33 -22
  77. package/package.json +1 -1
  78. package/reports/index.d.ts +50 -44
  79. package/reports/index.js +75 -62
  80. package/roles/index.d.ts +44 -38
  81. package/roles/index.js +57 -41
  82. package/security-center/index.d.ts +14 -2
  83. package/security-center/index.js +15 -6
  84. package/sub-tenants/index.d.ts +57 -14
  85. package/sub-tenants/index.js +88 -61
  86. package/sub-tenants/interfaces.d.ts +8 -0
  87. package/sub-tenants/interfaces.js +7 -1
  88. package/subscriptions/index.d.ts +56 -11
  89. package/subscriptions/index.js +68 -11
  90. package/subscriptions/invoices.d.ts +16 -13
  91. package/subscriptions/invoices.js +24 -14
  92. package/subscriptions/managedSubscriptions.d.ts +18 -15
  93. package/subscriptions/managedSubscriptions.js +33 -22
  94. package/subscriptions/paymentMethods.d.ts +16 -13
  95. package/subscriptions/paymentMethods.js +26 -17
  96. package/subscriptions/paymentProviders.d.ts +8 -5
  97. package/subscriptions/paymentProviders.js +11 -4
  98. package/subscriptions/plans.d.ts +11 -8
  99. package/subscriptions/plans.js +14 -6
  100. package/subscriptions/providers/stripe/index.d.ts +24 -21
  101. package/subscriptions/providers/stripe/index.js +27 -16
  102. package/subscriptions/subscriptions.d.ts +24 -21
  103. package/subscriptions/subscriptions.js +33 -22
  104. package/subscriptions/summaries.d.ts +7 -4
  105. package/subscriptions/summaries.js +10 -3
  106. package/subscriptions/tenantConfiguration.d.ts +6 -3
  107. package/subscriptions/tenantConfiguration.js +15 -7
  108. package/subscriptions/vendorPublicConfigurations.d.ts +5 -2
  109. package/subscriptions/vendorPublicConfigurations.js +11 -4
  110. package/teams/index.d.ts +35 -131
  111. package/teams/index.js +122 -93
  112. package/tenants/index.d.ts +25 -37
  113. package/tenants/index.js +63 -47
  114. package/user-phone-numbers/index.d.ts +32 -26
  115. package/user-phone-numbers/index.js +32 -19
  116. package/users/index.d.ts +21 -15
  117. package/users/index.js +60 -44
  118. package/vendor/index.d.ts +12 -6
  119. package/vendor/index.js +11 -4
  120. package/fetch.d.ts +0 -24
  121. package/fetch.js +0 -265
  122. package/node/fetch.js +0 -306
  123. package/node/subscriptions/providers/index.js +0 -18
  124. package/subscriptions/providers/index.d.ts +0 -1
  125. package/subscriptions/providers/index.js +0 -1
package/auth/index.d.ts CHANGED
@@ -1,774 +1,770 @@
1
1
  export * from "./secutiry-poilicy";
2
2
  export * from "./enums";
3
+ export { FRONTEGG_SEPARATE_TABS_BY_TENANT } from "./constants";
3
4
  export { setTabTenantInSessionStorage, getTabTenantFromSessionStorage, getCurrentUserTenantsFunction, removeTabTenantFromSessionStorage } from './utils';
4
5
  import { ISamlRolesGroup } from "../teams/interfaces";
5
6
  import { IAcceptInvitation, IActivateAccount, IAllowedToRememberMfaDevice, ICreateSamlGroup, IDeleteApiToken, IDisableMfa, IEnrollMfaResponse, IForgotPassword, IGetActivateAccountStrategy, IGetActivateAccountStrategyResponse, IGetUserById, IGetUserPasswordConfig, ILogin, ILoginResponse, ILoginViaSocialLogin, ILoginViaSocialLoginResponse, ILoginWithMfa, IOidcPostLogin, IOidcConfiguration, IPostLogin, IPreLogin, IRecoverMFAToken, IResendActivationEmail, IResetPassword, ISamlConfiguration, ISamlVendorConfigResponse, ISignUpResponse, ISignUpUser, ISocialLoginProviderConfiguration, ITenantApiTokensData, IUpdateSamlConfiguration, IUpdateSamlGroup, IUpdateSamlRoles, IUpdateSamlVendorMetadata, IUpdateTenantApiTokensData, IUpdateUserApiTokensData, IUserApiTokensData, IUserIdResponse, IVendorConfig, IVerifyMfa, IVerifyMfaResponse, TestConfig, ISSOPublicConfiguration, IPreLoginWithIdpTypeResponse, IPasswordlessPreLogin, IPasswordlessPostLogin, ICreateSSODomain, IVerifyInviteToken, ISSODomain, ISSOConfigurationDefaultRoles, ISSOConfiguration, IUpdateSSOConfiguration, IOidcPostLoginV2, IExchangeOAuthTokens, IOAuthTokenResponse, ISocialLoginProviderConfigurationV2, ILoginResponseV2, IResetPhoneNumber, IVerifyResetPhoneNumber, IChangePhoneNumber, IVerifyResetPhoneNumberResponse, IResetPhoneNumberResponse, IWebAuthnPreLogin, IWebAuthnPostLogin, IVerifyNewWebAuthnDevice, IWebAuthnPreLoginResponse, ICreateNewDeviceSessionResponse, IAuthStrategiesConfig, ISessionResponse, IChangePhoneNumberWithVerification, IChangePhoneNumberWithVerificationResponse, IVerifyChangePhoneNumber, ISessionConfigurations, IResendInvitationEmail, IPreEnrollMFA, IEnrollMFAAuthenticatorApp, IPreEnrollMFASMS, IEnrollMFASMS, IEnrollMFAWebAuthn, IPreEnrollMFAAuthenticatorAppResponse, IPreEnrollMFAWebAuthnResponse, IVerifyMFAAuthenticatorApp, IPreVerifyMFA, IPreVerifyMFASMSResponse, IVerifyMFASMS, IPreVerifyMFAWebAuthnResponse, IVerifyMFAWebAuthn, IPreEnrollMFASMSResponse, IPreDisableMFASMSResponse, IDisableMFASMS, IDisableMFAWebAuthn, IPreDisableMFAWebAuthnResponse, UserMFADevicesResponse, WithoutMFAToken, IMFAStrategiesResponse, IOAuthLogout, IGetUserAccessTokens, IGetTenantAccessTokens, IDeleteAccessToken, ICreateTenantAccessTokenData, ICreateUserAccessTokenData, IWebAuthnDevices, ICustomSocialLoginProviderConfigurationV1, ILoginResponseV3, IPreVerifyMFAEmailCodeResponse, IVerifyMFAEmailCode, ICreateOrUpdateSSOConfigurationByMetadataUrl, GenerateStepUpRequest, GenerateStepUpResponse } from './interfaces';
6
7
  import { IGetUserAuthorizationResponse, IUserProfile } from "../users/interfaces";
7
- /*****************************************
8
- * Authentication
9
- *****************************************/
10
- export declare function generateLoginResponse(loginResponse: ILoginResponse): Promise<ILoginResponse>;
11
- export declare function generateLoginResponseV2(loginResponse: ILoginResponse): Promise<ILoginResponseV2>;
12
- export declare function generateLoginResponseV3(loginResponse: ILoginResponse): Promise<ILoginResponseV3>;
13
- export declare function generateLoginResponseFromOAuthResponse(oauthResponse: IOAuthTokenResponse): Promise<ILoginResponse>;
14
- export declare function generateLoginResponseFromOAuthResponseV2(oauthResponse: IOAuthTokenResponse): Promise<ILoginResponseV3>;
15
- /**
16
- * Check if requested email address has sso configuration
17
- * If true, this function will return the sso address to navigate to
18
- * else, return null
19
- */
20
- export declare function preLogin(body: IPreLogin): Promise<string | null>;
21
- /**
22
- * Check if requested email address has sso configuration
23
- * If true, this function will return the sso address and IdpType to navigate to
24
- */
25
- export declare function preLoginWithIdpType(body: IPreLogin): Promise<IPreLoginWithIdpTypeResponse | null>;
26
- /**
27
- * After calling preLogin and navigated to SSO url, the IDP will redirect you to the ACS Url
28
- * Which configured in the SSO configuraation
29
- * else, return null
30
- */
31
- export declare function postLogin(body: IPostLogin): Promise<ILoginResponse>;
32
- /**
33
- * After calling preLogin and navigated to SSO url, the IDP will redirect you to the redirect url
34
- * with code and state
35
- */
36
- export declare function oidcPostLogin(body: IOidcPostLogin): Promise<ILoginResponse>;
37
- /**
38
- * login with username and password.
39
- * if the user has two factor authentication
40
- * the server will return mfaToken with mfaRequired: true,
41
- * and then ``loginWithMfa`` should be called with the mfaToken and and generated code
42
- * else, the server will accessToken and refreshToken.
43
- * the refresh should be used to renew your access token by calling ``refreshToken``
44
- *
45
- * @throw exception if login failed
46
- */
47
- export declare function login(body: ILogin): Promise<ILoginResponse>;
48
- /**
49
- * login with username and password.
50
- * if the user has two factor authentication
51
- * the server will return mfaToken with mfaRequired: true,
52
- * and then ``loginWithMfa`` should be called with the mfaToken and and generated code
53
- * else, the server will accessToken and refreshToken.
54
- * the refresh should be used to renew your access token by calling ``refreshToken``
55
- *
56
- * @throw exception if login failed
57
- */
58
- export declare function loginv2(body: ILogin): Promise<ILoginResponseV3>;
59
- /**
60
- * after login succeeded with mfaRequired token response, this function should be called
61
- * with the mfaToken and the generated code from your authenticator app.
62
- *
63
- * @throw exception if generated code or mfaToken are incorrect
64
- */
65
- export declare function loginWithMfa(body: ILoginWithMfa): Promise<ILoginResponse>;
66
- /**
67
- * after login succeeded with mfaRequired token response, this function should be called
68
- * with the mfaToken and the generated code from your authenticator app.
69
- *
70
- * @throw exception if generated code or mfaToken are incorrect
71
- */
72
- export declare function loginWithMfaV2(body: ILoginWithMfa): Promise<ILoginResponseV3>;
73
- /**
74
- * activating account should be called after registering new user of deactivate account
75
- * ``activateAccount`` should contains userId and the token that has been sent to the user after activation requested.
76
- *
77
- * @throws exception if activation failed
78
- */
79
- export declare function activateAccount(body: IActivateAccount): Promise<void>;
80
- /**
81
- * activating account should be called after registering new user of deactivate account
82
- * ``activateAccount`` should contains userId and the token that has been sent to the user after activation requested.
83
- *
84
- * @throws exception if activation failed
85
- */
86
- export declare function activateAccountV2(body: IActivateAccount): Promise<ILoginResponseV3>;
87
- /**
88
- * get account activation configuration.
89
- */
90
- export declare function getActivateAccountStrategy(params: IGetActivateAccountStrategy): Promise<IGetActivateAccountStrategyResponse>;
91
- /**
92
- * resend activation email should be called after a failed user activation.
93
- * ``resend activation email`` should contain the user email.
94
- *
95
- * @throws exception if resend failed
96
- */
97
- export declare function resendActivationEmail(body: IResendActivationEmail): Promise<void>;
98
- /**
99
- * resend invitation email should be called after a failed user invitation.
100
- * ``resend invitation email`` should contain the user email.
101
- *
102
- * @throws exception if resend failed
103
- */
104
- export declare function resendInvitationEmail(body: IResendInvitationEmail): Promise<void>;
105
- /**
106
- * activating account should be called after registering new user of deactivate account
107
- * ``activateAccount`` should contains userId and the token that has been sent to the user after activation requested.
108
- *
109
- * @throws exception if activation failed
110
- */
111
- export declare function acceptInvitation(body: IAcceptInvitation): Promise<void>;
112
- /**
113
- * refresh token called as authenticated use, access and refresh tokens resolved by the cookies.
114
- * the server will return ILoginResponse with new access Token and refresh token and store it in the browser cookies.
115
- */
116
- export declare function refreshToken(): Promise<ILoginResponse>;
117
- /**
118
- * refresh token called as authenticated use, access and refresh tokens resolved by the cookies.
119
- * the server will return ILoginResponseV2 with new access Token and refresh token and store it in the browser cookies, as well as the tenants.
120
- */
121
- export declare function refreshTokenV2(): Promise<ILoginResponseV2>;
122
- /**
123
- * refresh token called as authenticated use, access and refresh tokens resolved by the cookies.
124
- * the server will return ILoginResponseV3 with new access Token and refresh token and store it in the browser cookies, as well as the tenants and the active tenant.
125
- */
126
- export declare function refreshTokenV3(): Promise<ILoginResponseV3>;
127
- /**
128
- * logout from server, invalidate access and refresh token, remove it from cookies.
129
- */
130
- export declare function logout(): Promise<void>;
131
- /**
132
- * logout from server on Hosted Login, invalidate access and refresh token, remove it from cookies.
133
- */
134
- export declare function OAuthLogout(params?: IOAuthLogout): Promise<void>;
135
- /**
136
- * calling forgot password request will send email with link to reset user's password.
137
- *
138
- * @throws exception if the user not found
139
- */
140
- export declare function forgotPassword(body: IForgotPassword): Promise<void>;
141
- /**
142
- * reset password should be called after forget password request.
143
- * userId, new password and the token has been sent to the user email.
144
- *
145
- * @throws exception if the user not found, password validation failed or invalid token.
146
- */
147
- export declare function resetPassword(body: IResetPassword): Promise<void>;
148
- /**
149
- * load password configuration for user.
150
- */
151
- export declare function loadPasswordConfig(params?: IGetUserPasswordConfig): Promise<Partial<TestConfig> | null>;
152
- /**
153
- * recover Multi-Factor authentication by providing the recoveryCode
154
- * that has been received when activated it
155
- *
156
- * @throws exception if recovery code is not valid
157
- */
158
- export declare function recoverMfaToken(body: IRecoverMFAToken): Promise<void>;
159
- /**
160
- * Multi-Factor Settings
161
- */
162
- /**
163
- * enroll Multi-Factor Auth Code to use in 3rd party apps like Google Authenticator.
164
- * the server returns qrCode as png image in base64 format
165
- *
166
- * @throws exception if the user already have mfa-enabled
167
- * ``authorized user``
168
- */
169
- export declare function enrollMfa(): Promise<IEnrollMfaResponse>;
170
- /**
171
- * pre enroll Multi-Factor Auth Code to use in 3rd party apps like Google Authenticator.
172
- * the server returns qrCode as png image in base64 format
173
- *
174
- * @throws exception if the user already have mfa-enabled
175
- * ``authorized user``
176
- */
177
- export declare function preEnrollMFAAuthenticatorApp(): Promise<IPreEnrollMFAAuthenticatorAppResponse>;
178
- /**
179
- * enroll Multi-Factor Auth Code to use in 3rd party apps like Google Authenticator.
180
- */
181
- export declare function enrollMFAAuthenticatorApp(body: WithoutMFAToken<IEnrollMFAAuthenticatorApp>): Promise<void>;
182
- /**
183
- * pre enroll Multi-Factor SMS
184
- * the server returns otcToken that should be sent to the enroll function with the code that was sent to
185
- */
186
- export declare function preEnrollMFASMS(body: WithoutMFAToken<IPreEnrollMFASMS>): Promise<IPreEnrollMFASMSResponse>;
187
- /**
188
- * after pre enroll with SMS, enroll SMS function should be called
189
- * with the otcToken and the code that has been sent to the phone number that was requested
190
- */
191
- export declare function enrollMFASMS(body: WithoutMFAToken<IEnrollMFASMS>): Promise<void>;
192
- /**
193
- * pre enroll Multi-Factor to use with WebAuthn
194
- * the server returns attestation object
195
- * the request phone number
196
- */
197
- export declare function preEnrollMFAWebAuthn(): Promise<IPreEnrollMFAWebAuthnResponse>;
198
- /**
199
- * after pre enroll with WebAuthn, enroll WebAuthn function should be called
200
- * with the webauthnToken and the attestation object response
201
- */
202
- export declare function enrollMFAWebAuthn(body: WithoutMFAToken<IEnrollMFAWebAuthn>): Promise<void>;
203
- /**
204
- * after enrolling MFA QR code, verify function should be called
205
- * with the generated code in the Authenticator App
206
- *
207
- * @return recoveryCode to use to disable mfa if your device is lost, this code won't show it again.
208
- * @throws exception if the generated token is invalid
209
- * ``authorized user``
210
- */
211
- export declare function verifyMfa(body: IVerifyMfa): Promise<IVerifyMfaResponse>;
212
- /**
213
- * disable MFA by either passing the recoveryCode or the generated code from the Authenticator App.
214
- *
215
- * @throws exception if the generated token or the recoveryCode are incorrect.
216
- * * ``authorized user``
217
- */
218
- export declare function disableMfa(body: IDisableMfa): Promise<void>;
219
- /**
220
- * disable MFA Authenticator App.
221
- *
222
- * @throws exception if the generated token is incorrect.
223
- * * ``authorized user``
224
- */
225
- export declare function disableMFAAuthenticatorApp(deviceId: string, body: IDisableMfa): Promise<void>;
226
- /**
227
- * pre disable MFA SMS, should be called if user has just one mfa device
228
- *
229
- * @throws exception if pre disable is not required for disable
230
- * * ``authorized user``
231
- */
232
- export declare function preDisableMFASMS(deviceId: string): Promise<IPreDisableMFASMSResponse>;
233
- /**
234
- * after pre disable MFA SMS, disable MFA SMS should be called. can also be called without pre disable if
235
- * user has more than one mfa device
236
- *
237
- * @throws exception if pre disable is not required for disable
238
- * * ``authorized user``
239
- */
240
- export declare function disableMFASMS(deviceId: string, body: IDisableMFASMS): Promise<void>;
241
- /**
242
- * pre disable MFA WebAuthn, should be called if user has just one mfa device
243
- *
244
- * @throws exception if pre disable is not required for disable
245
- * * ``authorized user``
246
- */
247
- export declare function preDisableMFAWebAuthn(deviceId: string): Promise<IPreDisableMFAWebAuthnResponse>;
248
- /**
249
- * after pre disable MFA WebAuthn, disable MFA WebAuthn should be called. can also be called without pre disable if
250
- * user has more than one mfa device
251
- *
252
- * @throws exception if pre disable is not required for disable
253
- * * ``authorized user``
254
- */
255
- export declare function disableMFAWebAuthn(deviceId: string, body: IDisableMFAWebAuthn): Promise<void>;
256
- /**
257
- * returns user mfa devices list splitted into 3 arrays. webauthn, phones and authenticators.
258
- */
259
- export declare function getMFADevices(): Promise<UserMFADevicesResponse>;
260
- /**
261
- * pre enroll Multi-Factor Auth Code to use in 3rd party apps like Google Authenticator.
262
- * the server returns qrCode as png image in base64 format
263
- */
264
- export declare function preEnrollMFAAuthenticatorAppForLogin(body: IPreEnrollMFA): Promise<IPreEnrollMFAAuthenticatorAppResponse>;
265
- /**
266
- * after pre enroll with authenticator app, enroll authenticator app function should be called
267
- * with the generated code in the Authenticator App
268
- */
269
- export declare function enrollMFAAuthenticatorAppForLogin(body: IEnrollMFAAuthenticatorApp): Promise<ILoginResponse>;
270
- /**
271
- * after pre enroll with authenticator app, enroll authenticator app function should be called
272
- * with the generated code in the Authenticator App
273
- */
274
- export declare function enrollMFAAuthenticatorAppForLoginV2(body: IEnrollMFAAuthenticatorApp): Promise<ILoginResponseV3>;
275
- /**
276
- * after login succeeded with mfaRequired token response, this function should be called
277
- * with the selected authenticator app id, mfaToken and the generated code from your authenticator app.
278
- */
279
- export declare function verifyMFAAuthenticatorAppForLogin(deviceId: string, body: IVerifyMFAAuthenticatorApp): Promise<ILoginResponse>;
280
- /**
281
- * pre verify Multi-Factor Email Code
282
- * the server returns otcToken that should be sent to the verify function with the code that was sent to
283
- */
284
- export declare function preVerifyMFAEmailCode(body: IPreVerifyMFA): Promise<IPreVerifyMFAEmailCodeResponse>;
285
- /**
286
- * after pre verify with Email Code, verify Email Code function should be called
287
- * with the otcToken and the code that has been sent to the email
288
- */
289
- export declare function verifyMFAEmailCode(body: IVerifyMFAEmailCode): Promise<ILoginResponse>;
290
- /**
291
- * after pre verify with Email Code, verify Email Code function should be called
292
- * with the otcToken and the code that has been sent to the email
293
- */
294
- export declare function verifyMFAEmailCodeV2(body: IVerifyMFAEmailCode): Promise<ILoginResponseV3>;
295
- /**
296
- * pre enroll Multi-Factor to use with SMS
297
- * the server returns otcToken that should be sent to the enroll function with the code that was sent to
298
- * the request phone number
299
- */
300
- export declare function preEnrollMFASMSForLogin(body: IPreEnrollMFASMS): Promise<IPreEnrollMFASMSResponse>;
301
- /**
302
- * after pre enroll with SMS, enroll SMS function should be called
303
- * with the otcToken and the code that has been sent to the phone number that was requested
304
- */
305
- export declare function enrollMFASMSForLogin(body: IEnrollMFASMS): Promise<ILoginResponse>;
306
- /**
307
- * after pre enroll with SMS, enroll SMS function should be called
308
- * with the otcToken and the code that has been sent to the phone number that was requested
309
- */
310
- export declare function enrollMFASMSForLoginV2(body: IEnrollMFASMS): Promise<ILoginResponseV3>;
311
- /**
312
- * after login succeeded with mfaRequired token response, if the user asked to use SMS as MFA
313
- * this function should be called with the selected device id and mfaToken
314
- */
315
- export declare function preVerifyMFASMSForLogin(deviceId: string, body: IPreVerifyMFA): Promise<IPreVerifyMFASMSResponse>;
316
- /**
317
- * after pre verify with SMS, this function should be called with otcToken, mfaToken and the code
318
- * that has been sent to the selected device.
319
- */
320
- export declare function verifyMFASMSForLogin(deviceId: string, body: IVerifyMFASMS): Promise<ILoginResponse>;
321
- /**
322
- * after pre verify with SMS, this function should be called with otcToken, mfaToken and the code
323
- * that has been sent to the selected device.
324
- */
325
- export declare function verifyMFASMSForLoginV2(deviceId: string, body: IVerifyMFASMS): Promise<ILoginResponseV3>;
326
- /**
327
- * pre enroll Multi-Factor to use with WebAuthn
328
- * the server returns attestation object
329
- * the request phone number
330
- */
331
- export declare function preEnrollMFAWebAuthnForLogin(body: IPreEnrollMFA): Promise<IPreEnrollMFAWebAuthnResponse>;
332
- /**
333
- * after pre enroll with WebAuthn, enroll WebAuthn function should be called
334
- * with the webauthnToken and the attestation object response
335
- */
336
- export declare function enrollMFAWebAuthnForLogin(body: IEnrollMFAWebAuthn): Promise<ILoginResponse>;
337
- /**
338
- * after pre enroll with WebAuthn, enroll WebAuthn function should be called
339
- * with the webauthnToken and the attestation object response
340
- */
341
- export declare function enrollMFAWebAuthnForLoginV2(body: IEnrollMFAWebAuthn): Promise<ILoginResponseV3>;
342
- /**
343
- * after login succeeded with mfaRequired token response, if the user asked to use WebAuthn as MFA
344
- * this function should be called with the selected device id and mfaToken.
345
- */
346
- export declare function preVerifyMFAWebAuthnForLogin(deviceId: string, body: IPreVerifyMFA): Promise<IPreVerifyMFAWebAuthnResponse>;
347
- /**
348
- * after pre verify with WebAuthn, this function should be called with webauthnTokenToken, mfaToken
349
- * and the assertion response.
350
- */
351
- export declare function verifyMFAWebAuthnForLogin(deviceId: string, body: IVerifyMFAWebAuthn): Promise<ILoginResponse>;
352
- /**
353
- * after pre verify with WebAuthn, this function should be called with webauthnTokenToken, mfaToken
354
- * and the assertion response.
355
- */
356
- export declare function verifyMFAWebAuthnForLoginV2(deviceId: string, body: IVerifyMFAWebAuthn): Promise<ILoginResponseV3>;
357
- /**
358
- * SSO Configurations
359
- */
360
- /**
361
- * Retrieve SAML configurations from server by logged in user (tenantId, vendorId)
362
- *
363
- * @return {enabled: false} if no saml configuration found. else ISamlConfiguration
364
- * * ``authorized user``
365
- */
366
- export declare function getSamlConfiguration(): Promise<ISamlConfiguration>;
367
- /**
368
- * Update SAML configuration by logged in user (tenantId, vendorId)
369
- * * ``authorized user``
370
- */
371
- export declare function updateSamlConfiguration(body: IUpdateSamlConfiguration): Promise<ISamlConfiguration>;
372
- /**
373
- * Retrieve 'Vendor' Saml config from server by logged in user (tenantId, vendorId)
374
- *
375
- * @throws exception 'ACS url information not found' if no saml vendor configuration found.
376
- * * ``authorized user``
377
- */
378
- export declare function getSamlVendorConfiguration(): Promise<ISamlVendorConfigResponse>;
379
- /**
380
- * Update Vendor Saml metadata by logged in user (tenantId, vendorId)
381
- *
382
- * @return {enabled: false} if no saml configuration found. else ISamlConfiguration
383
- * * ``authorized user``
384
- */
385
- export declare function updateSamlVendorMetadata(body: IUpdateSamlVendorMetadata): Promise<ISamlConfiguration>;
386
- /**
387
- * Validate Saml configuration's domain by logged in user (tenantId, vendorId)
388
- *
389
- * @return {enabled: false} if no saml configuration found. else ISamlConfiguration
390
- * * ``authorized user``
391
- */
392
- export declare function validateSamlDomain(): Promise<ISamlConfiguration>;
393
- /**
394
- * Get Saml roles for authorization
395
- * @return array of role IDs
396
- */
397
- export declare function getSamlRoles(): Promise<string[]>;
398
- /**
399
- * Get Saml roles groups
400
- * @return array of groups and assigend role IDs
401
- */
402
- export declare function getSamlRolesGroups(): Promise<ISamlRolesGroup[]>;
403
- /**
404
- * Update Saml roles for authorization
405
- */
406
- export declare function updateSamlRoles({ roleIds, }: IUpdateSamlRoles): Promise<void>;
407
- /**
408
- * Create Saml group roles for authorization
409
- */
410
- export declare function createSamlGroup({ roleIds, group, }: ICreateSamlGroup): Promise<void>;
411
- /**
412
- * Update Saml group roles for authorization
413
- */
414
- export declare function updateSamlGroup({ roleIds, group, id, }: IUpdateSamlGroup): Promise<void>;
415
- /**
416
- * Delete Saml group
417
- */
418
- export declare function deleteSamlGroup({ id }: {
419
- id: string;
420
- }): Promise<void>;
421
- /**
422
- * Retrieve OIDC configurations from server by logged in user (vendorId)
423
- *
424
- * @return {active: true} if no oidc configuration found. else IOidcConfiguration
425
- * * ``authorized user``
426
- */
427
- export declare function getOidcConfiguration(): Promise<IOidcConfiguration>;
428
- /**
429
- * Check if one or more saml/oidc configuration are active
430
- *
431
- ** @return {isActive: true/false}
432
- */
433
- export declare function getSSOPublicConfiguration(): Promise<ISSOPublicConfiguration>;
434
- /**
435
- * Get social logins providers configurations for vendor
436
- * @return array of providers configurations
437
- */
438
- export declare function getSocialLoginProviders(): Promise<ISocialLoginProviderConfiguration[]>;
439
- /**
440
- * ##### Public route
441
- * Get social logins providers configurations V2 supports dev credentials as well
442
- * @return array of providers configurations
443
- */
444
- export declare function getSocialLoginProvidersV2(): Promise<ISocialLoginProviderConfigurationV2[]>;
445
- /**
446
- * ##### Authenticated route
447
- * Get social logins providers configurations V2 supports dev credentials as well
448
- * @return array of providers configurations
449
- */
450
- export declare function getSocialLoginProvidersV2ForAuthenticatedUser(): Promise<ISocialLoginProviderConfigurationV2[]>;
451
- /**
452
- * Get social logins custom providers configurations
453
- * @return array of custom providers configurations
454
- */
455
- export declare function getCustomSocialLoginProvidersV1(): Promise<ICustomSocialLoginProviderConfigurationV1>;
456
- /**
457
- * Login using social login
458
- * @return cookie with refresh token
459
- */
460
- export declare function loginViaSocialLogin({ provider, code, idToken, redirectUri, codeVerifier, metadata, invitationToken, state, }: ILoginViaSocialLogin): Promise<ILoginViaSocialLoginResponse>;
461
- /**
462
- * Get vendor secure access configuration
463
- */
464
- export declare function getVendorConfig(): Promise<IVendorConfig>;
465
- /**
466
- * Sign up new user
467
- * create new user with a new tenant
468
- */
469
- export declare function signUpUser(body: ISignUpUser): Promise<ISignUpResponse>;
470
- /**
471
- * Get all current user active sessions
472
- */
473
- export declare function getCurrentUserSessions(): Promise<ISessionResponse[]>;
474
- /**
475
- * Get current user session
476
- */
477
- export declare function getCurrentUserSession(): Promise<ISessionResponse>;
478
- /**
479
- * Revoke sessions for user
480
- */
481
- export declare function revokeSessionsForUser(userId: string): Promise<void>;
482
- /**
483
- * Get session configurations
484
- */
485
- export declare function getSessionConfigurations(): Promise<ISessionConfigurations>;
486
- /**
487
- * Create or update session configurations
488
- */
489
- export declare function createOrUpdateSessionConfigrations(body: ISessionConfigurations): Promise<void>;
490
- /**
491
- * Delete user session
492
- */
493
- export declare function deleteSessionForUser(id: string): Promise<void>;
494
- /**
495
- * Delete all user sessions
496
- */
497
- export declare function deleteAllSessionsForUser(): Promise<void>;
498
- /**
499
- * Access tokens Configurations
500
- */
501
- /**
502
- * Get user access tokens data
503
- */
504
- export declare function getUserAccessTokensData(): Promise<IGetUserAccessTokens>;
505
- /**
506
- * Get tenant access tokens data
507
- */
508
- export declare function getTenantAccessTokensData(): Promise<IGetTenantAccessTokens>;
509
- /**
510
- * Delete Tenant access Token
511
- */
512
- export declare function deleteTenantAccessToken({ id, }: IDeleteAccessToken): Promise<void>;
513
- /**
514
- * Delete Tenant access Token
515
- */
516
- export declare function deleteUserAccessToken({ id, }: IDeleteAccessToken): Promise<void>;
517
- /**
518
- * Create User Access Token.
519
- */
520
- export declare function createUserAccessToken(body: ICreateUserAccessTokenData): Promise<IUserApiTokensData>;
521
- /**
522
- * Create Tenant Access Token
523
- */
524
- export declare function createTenantAccessToken(body: ICreateTenantAccessTokenData): Promise<ITenantApiTokensData>;
525
- /**
526
- * Api tokens Configurations
527
- */
528
- /**
529
- * Get user api tokens data
530
- */
531
- export declare function getUserApiTokensData(): Promise<IUserApiTokensData[]>;
532
- /**
533
- * Get tenant api tokens data
534
- */
535
- export declare function getTenantApiTokensData(): Promise<ITenantApiTokensData[]>;
536
- /**
537
- * Update User Api Tokens
538
- */
539
- export declare function updateUserApiTokensData(body: IUpdateUserApiTokensData): Promise<IUserApiTokensData>;
540
- /**
541
- * Update Tenant Api Tokens
542
- */
543
- export declare function updateTenantApiTokensData(body: IUpdateTenantApiTokensData): Promise<ITenantApiTokensData>;
544
- /**
545
- * Delete Tenant Api Token
546
- */
547
- export declare function deleteTenantApiToken({ tokenId, }: IDeleteApiToken): Promise<void>;
548
- /**
549
- * Delete Tenant Api Token
550
- */
551
- export declare function deleteUserApiToken({ tokenId, }: IDeleteApiToken): Promise<void>;
552
- /**
553
- * Get Tenant Api Token Creator User
554
- */
555
- export declare function getUserById({ userId, }: IGetUserById): Promise<IUserIdResponse>;
556
- /**
557
- * Checks if remember MFA device is enabled for user.
558
- */
559
- export declare function checkIfAllowToRememberMfaDevice(mfaToken: string): Promise<IAllowedToRememberMfaDevice>;
560
- /**
561
- * Passwordless prelogin authentication
562
- */
563
- export declare function passwordlessPreLogin({ type, ...body }: IPasswordlessPreLogin): Promise<void>;
564
- export declare function passwordlessPostLoginV2({ type, ...body }: IPasswordlessPostLogin): Promise<ILoginResponseV3>;
565
- export declare function passwordlessPostLogin({ type, ...body }: IPasswordlessPostLogin): Promise<ILoginResponse>;
566
- /**
567
- * Check if tenant invitation token is valid
568
- * @param token - invitation token
569
- * @returns tenant name
570
- */
571
- export declare function verifyInviteToken({ token, }: IVerifyInviteToken): Promise<string>;
572
- /**
573
- * SSO Configurations V1
574
- */
575
- /**
576
- * Retrieve SSO configurations from server by logged in user (tenantId, vendorId)
577
- *
578
- * @return ISSOConfiguration[]
579
- * * ``authorized user``
580
- */
581
- export declare function getSSOConfigurations(): Promise<ISSOConfiguration[]>;
582
- /**
583
- * Create SSO configuration by logged in user (tenantId, vendorId)
584
- *
585
- * @returns ISSOConfiguration
586
- * * ``authorized user``
587
- */
588
- export declare function createSSOConfiguration(body: IUpdateSSOConfiguration): Promise<ISSOConfiguration>;
589
- /**
590
- * Update SSO configuration by logged in user (tenantId, vendorId)
591
- *
592
- * @returns ISSOConfiguration
593
- * * ``authorized user``
594
- */
595
- export declare function updateSSOConfiguration(ssoConfigId: string, body: IUpdateSSOConfiguration): Promise<ISSOConfiguration>;
596
- /**
597
- * Delete SSO configuration by logged in user (tenantId, vendorId)
598
- * * ``authorized user``
599
- */
600
- export declare function deleteSSOConfiguration(ssoConfigId: string): Promise<void>;
601
- /**
602
- * Create SSO configuration by metadata by logged in user (tenantId, vendorId)
603
- *
604
- * @returns ISSOConfiguration
605
- * * ``authorized user``
606
- */
607
- export declare function createSSOConfigurationByMetadata(body: IUpdateSamlVendorMetadata): Promise<ISSOConfiguration>;
608
- /**
609
- * Update SSO configuration by metadata by logged in user (tenantId, vendorId)
610
- *
611
- * @returns ISSOConfiguration
612
- * * ``authorized user``
613
- */
614
- export declare function updateSSOConfigurationByMetadata(ssoConfigId: string, body: IUpdateSamlVendorMetadata): Promise<ISSOConfiguration>;
615
- /**
616
- * Create SSO configuration by metadata url by logged in user (tenantId, vendorId)
617
- *
618
- * @returns ISSOConfiguration
619
- * * ``authorized user``
620
- */
621
- export declare function createSSOConfigurationByMetadataUrl(body: ICreateOrUpdateSSOConfigurationByMetadataUrl): Promise<ISSOConfiguration>;
622
- /**
623
- * Update SSO configuration by metadata url by logged in user (tenantId, vendorId)
624
- *
625
- * @returns ISSOConfiguration
626
- * * ``authorized user``
627
- */
628
- export declare function updateSSOConfigurationByMetadataUrl(ssoConfigId: string, body: ICreateOrUpdateSSOConfigurationByMetadataUrl): Promise<ISSOConfiguration>;
629
- /**
630
- * Create SSO configuration domain by logged in user (tenantId, vendorId)
631
- *
632
- * @returns ISSODomain
633
- * * ``authorized user``
634
- */
635
- export declare function createSSODomain(ssoConfigId: string, body: ICreateSSODomain): Promise<ISSODomain>;
636
- /**
637
- * Create SSO configuration domain by logged in user (tenantId, vendorId)
638
- * * ``authorized user``
639
- */
640
- export declare function deleteSSODomain(ssoConfigId: string, domainId: string): Promise<void>;
641
- /**
642
- * Validate SSO configuration domain by logged in user (tenantId, vendorId)
643
- * * ``authorized user``
644
- * @deprecated(Use validateSSODomainV2 instead)
645
- */
646
- export declare function validateSSODomain(ssoConfigId: string, domainId: string): Promise<void>;
647
- /**
648
- * Validate SSO configuration domain by logged in user (tenantId, vendorId)
649
- * * ``authorized user``
650
- */
651
- export declare function validateSSODomainV2(ssoConfigId: string, domainId: string): Promise<void>;
652
- /**
653
- * Get SSO configuration default roles by logged in user (tenantId, vendorId)
654
- * * ``authorized user``
655
- */
656
- export declare function getSSODefaultRoles(ssoConfigId: string): Promise<ISSOConfigurationDefaultRoles>;
657
- /**
658
- * Create SSO configuration default roles by logged in user (tenantId, vendorId)
659
- * * ``authorized user``
660
- */
661
- export declare function setSSODefaultRoles(ssoConfigId: string, body: IUpdateSamlRoles): Promise<void>;
662
- /**
663
- * Create SSO configuration group roles for authorization
664
- */
665
- export declare function createSSOGroup(ssoConfigId: string, body: ICreateSamlGroup): Promise<void>;
666
- /**
667
- * Update SSO configuration group roles for authorization
668
- */
669
- export declare function updateSSOGroup(ssoConfigId: string, { roleIds, group, id }: IUpdateSamlGroup): Promise<void>;
670
- /**
671
- * Delete SSO configuration group
672
- */
673
- export declare function deleteSSOGroup(ssoConfigId: string, groupId: string): Promise<void>;
674
- /**
675
- * Get SSO configuration groups
676
- */
677
- export declare function getSSOGroups(ssoConfigId: string): Promise<ISamlRolesGroup[]>;
678
- /**
679
- * Check if requested email address has sso configuration
680
- * If true, this function will return the sso address to navigate to
681
- * else, return null
682
- */
683
- export declare function preLoginV2(body: IPreLogin): Promise<IPreLoginWithIdpTypeResponse | null>;
684
- /**
685
- * After calling preLogin and navigated to SSO url, the IDP will redirect you to the redirect url
686
- * with code and state
687
- */
688
- export declare function oidcPostLoginV2(body: IOidcPostLoginV2): Promise<ILoginResponse>;
689
- export declare function exchangeOAuthTokensV2(body: IExchangeOAuthTokens): Promise<ILoginResponseV3>;
690
- export declare function silentOAuthRefreshTokenV2(): Promise<ILoginResponseV3>;
691
- export declare function exchangeOAuthTokens(body: IExchangeOAuthTokens): Promise<ILoginResponse>;
692
- export declare function silentOAuthRefreshToken(): Promise<ILoginResponse>;
693
- /**
694
- * reset phone should be called in case user want to reset his phone number
695
- * when using sms authentication strategy. a 6-digits code will be send to the user email.
696
- */
697
- export declare function resetPhoneNumber(body: IResetPhoneNumber): Promise<IResetPhoneNumberResponse>;
698
- /**
699
- * verify reset phone should be called after reset phone number request
700
- * with the token received from the reset phone number request and a code that was sent to the user email
701
- */
702
- export declare function verifyResetPhoneNumber(body: IVerifyResetPhoneNumber): Promise<IVerifyResetPhoneNumberResponse>;
703
- /**
704
- * change phone number with verification.
705
- */
706
- export declare function changePhoneNumberWithVerification(body: IChangePhoneNumberWithVerification): Promise<IChangePhoneNumberWithVerificationResponse>;
707
- /**
708
- * verify new phone number.
709
- */
710
- export declare function verifyChangePhoneNumber(body: IVerifyChangePhoneNumber): Promise<void>;
711
- /**
712
- * change phone number should be called after verify reset phone number with the new phone number
713
- */
714
- export declare function changePhoneNumber(body: IChangePhoneNumber): Promise<void>;
715
- /**
716
- * webauthn prelogin should be called when the user wants to be authenticated using his device/android/usb key
717
- */
718
- export declare function webAuthnPreLogin(body: IWebAuthnPreLogin): Promise<IWebAuthnPreLoginResponse>;
719
- /**
720
- * webauthn postlogin should be called after the user used his authenticator (device/android/usb key) in order to login
721
- */
722
- export declare function webAuthnPostLogin(body: IWebAuthnPostLogin): Promise<ILoginResponse>;
723
- /**
724
- * webauthn postlogin should be called after the user used his authenticator (device/android/usb key) in order to login
725
- */
726
- export declare function webAuthnPostLoginV2(body: IWebAuthnPostLogin): Promise<ILoginResponseV3>;
727
- /**
728
- * webauthn create new device should be called once the user wants to add new device as authenticator
729
- */
730
- export declare function webAuthnCreateNewDeviceSession(): Promise<ICreateNewDeviceSessionResponse>;
731
- /**
732
- * get webauthn devices should be called in order to get user's webAuthn devices
733
- */
734
- export declare function getWebAuthnDevices(): Promise<IWebAuthnDevices>;
735
- /**
736
- * delete webauthn device should be called in order to delete user's webAuthn device
737
- */
738
- export declare function deleteWebAuthnDevice(deviceId: string): Promise<void>;
739
- /**
740
- * webauthn verify new device should be called after the user used his authenticator in order to register the new device
741
- */
742
- export declare function verifyNewDeviceSession(body: IVerifyNewWebAuthnDevice): Promise<void>;
743
- /**
744
- * ##### Public route
745
- * Get public vendor auth strategies public configuration
746
- */
747
- export declare function getVendorPublicAuthStrategiesConfig(): Promise<IAuthStrategiesConfig>;
748
- /**
749
- * ##### Authenticated route
750
- * Get public vendor auth strategies public configuration
751
- */
752
- export declare function getPublicAuthStrategiesConfigForAuthenticatedUser(): Promise<IAuthStrategiesConfig>;
753
- /**
754
- * Get vendor mfa strategies configuration
755
- */
756
- export declare function getMFAStrategiesConfig(): Promise<IMFAStrategiesResponse>;
757
- /**
758
- * Get user permissions and roles
759
- */
760
- export declare function getUserAuthorization(): Promise<IGetUserAuthorizationResponse>;
761
- /**
762
- * Get user profile
763
- */
764
- export declare function getMeV2(): Promise<IUserProfile>;
765
- /**
766
- * @returns me and authorization response with entitlements inside user.entitlements
767
- * Me request will be executed, and me authorization and entitlements will be executed according to FF and configuration.
768
- */
769
- export declare function getMeAndEntitlements(): Promise<IUserProfile>;
770
- /**
771
- * generate step-up session
772
- * this request returns the step up details to continue step up, or the generated login response when stepped up jwt received from the BE
773
- */
774
- export declare function generateStepupSession(body: GenerateStepUpRequest): Promise<GenerateStepUpResponse | ILoginResponseV3>;
8
+ import { BaseApiClient } from '../BaseApiClient';
9
+ export declare class AuthenticationApi extends BaseApiClient {
10
+ private tenantsApi;
11
+ private entitlementsApi;
12
+ constructor(appName: string);
13
+ generateLoginResponse: (loginResponse: ILoginResponse) => Promise<ILoginResponse>;
14
+ generateLoginResponseV2: (loginResponse: ILoginResponse) => Promise<ILoginResponseV2>;
15
+ /**
16
+ * @returns true if entitlements load should be done
17
+ */
18
+ shouldLoadEntitlements(): boolean;
19
+ /**
20
+ * @returns true if me authorization load should be done
21
+ */
22
+ shouldLoadMeAuthorization(): boolean;
23
+ generateLoginResponseV3: (loginResponse: ILoginResponse) => Promise<ILoginResponseV3>;
24
+ generateLoginResponseFromOAuthResponse: (oauthResponse: IOAuthTokenResponse) => Promise<ILoginResponse>;
25
+ generateLoginResponseFromOAuthResponseV2: (oauthResponse: IOAuthTokenResponse) => Promise<ILoginResponseV3>;
26
+ /**
27
+ * Check if requested email address has SSO configuration.
28
+ * If true, this function will return the SSO address to navigate to, else return null.
29
+ */
30
+ preLogin: (body: IPreLogin) => Promise<string | null>;
31
+ /**
32
+ * Check if requested email address has SSO configuration.
33
+ * If true, this function will return the SSO address and IdpType to navigate to.
34
+ */
35
+ preLoginWithIdpType: (body: IPreLogin) => Promise<IPreLoginWithIdpTypeResponse | null>;
36
+ /**
37
+ * After calling preLogin and navigating to the SSO URL, the IDP will redirect you to the ACS URL.
38
+ * Which is configured in the SSO configuration.
39
+ */
40
+ postLogin: (body: IPostLogin) => Promise<ILoginResponse>;
41
+ /**
42
+ * After calling preLogin and navigating to the SSO URL, the IDP will redirect you to the redirect URL
43
+ * with code and state.
44
+ */
45
+ oidcPostLogin: (body: IOidcPostLogin) => Promise<ILoginResponse>;
46
+ /**
47
+ * Login with username and password.
48
+ * If the user has two-factor authentication, the server will return mfaToken with mfaRequired: true,
49
+ * and then `loginWithMfa` should be called with the mfaToken and generated code.
50
+ * Otherwise, the server will accessToken and refreshToken.
51
+ * The refresh token should be used to renew your access token by calling `refreshToken`.
52
+ * @throw exception if login failed
53
+ */
54
+ login: (body: ILogin) => Promise<ILoginResponse>;
55
+ /**
56
+ * Login with username and password.
57
+ * If the user has two-factor authentication, the server will return mfaToken with mfaRequired: true,
58
+ * and then `loginWithMfa` should be called with the mfaToken and generated code.
59
+ * Otherwise, the server will accessToken and refreshToken.
60
+ * The refresh token should be used to renew your access token by calling `refreshToken`.
61
+ * @throw exception if login failed
62
+ */
63
+ loginv2: (body: ILogin) => Promise<ILoginResponseV3>;
64
+ /**
65
+ * After login succeeds with an mfaRequired token response, this function should be called
66
+ * with the mfaToken and the generated code from your authenticator app.
67
+ * @throw exception if generated code or mfaToken are incorrect
68
+ */
69
+ loginWithMfa: (body: ILoginWithMfa) => Promise<ILoginResponse>;
70
+ /**
71
+ * After login succeeds with an mfaRequired token response, this function should be called
72
+ * with the mfaToken and the generated code from your authenticator app.
73
+ * @throw exception if generated code or mfaToken are incorrect
74
+ */
75
+ loginWithMfaV2: (body: ILoginWithMfa) => Promise<ILoginResponseV3>;
76
+ /**
77
+ * activating account should be called after registering new user or deactivating account
78
+ * ``activateAccount`` should contains userId and the token that has been sent to the user after activation requested.
79
+ * @throws exception if activation failed
80
+ */
81
+ activateAccount: (body: IActivateAccount) => Promise<void>;
82
+ /**
83
+ * activating account should be called after registering new user or deactivating account
84
+ * ``activateAccount`` should contains userId and the token that has been sent to the user after activation requested.
85
+ * @throws exception if activation failed
86
+ */
87
+ activateAccountV2: (body: IActivateAccount) => Promise<ILoginResponseV3>;
88
+ /**
89
+ * get account activation configuration.
90
+ */
91
+ getActivateAccountStrategy: (params: IGetActivateAccountStrategy) => Promise<IGetActivateAccountStrategyResponse>;
92
+ /**
93
+ * resend activation email should be called after a failed user activation.
94
+ * ``resend activation email`` should contain the user email.
95
+ * @throws exception if resend failed
96
+ */
97
+ resendActivationEmail: (body: IResendActivationEmail) => Promise<void>;
98
+ /**
99
+ * resend invitation email should be called after a failed user invitation.
100
+ * ``resend invitation email`` should contain the user email.
101
+ * @throws exception if resend failed
102
+ */
103
+ resendInvitationEmail: (body: IResendInvitationEmail) => Promise<void>;
104
+ /**
105
+ * activating account should be called after registering new user or deactivating account
106
+ * ``activateAccount`` should contains userId and the token that has been sent to the user after activation requested.
107
+ * @throws exception if activation failed
108
+ */
109
+ acceptInvitation: (body: IAcceptInvitation) => Promise<void>;
110
+ /**
111
+ * refresh token called as authenticated use, access and refresh tokens resolved by the cookies.
112
+ * the server will return ILoginResponse with new access Token and refresh token and store it in the browser cookies.
113
+ */
114
+ refreshToken: () => Promise<ILoginResponse>;
115
+ /**
116
+ * refresh token called as authenticated use, access and refresh tokens resolved by the cookies.
117
+ * the server will return ILoginResponseV2 with new access Token and refresh token and store it in the browser cookies, as well as the tenants.
118
+ */
119
+ refreshTokenV2: () => Promise<ILoginResponseV2>;
120
+ /**
121
+ * refresh token called as authenticated use, access and refresh tokens resolved by the cookies.
122
+ * the server will return ILoginResponseV3 with new access Token and refresh token and store it in the browser cookies, as well as the tenants and the active tenant.
123
+ */
124
+ refreshTokenV3: () => Promise<ILoginResponseV3>;
125
+ /**
126
+ * logout from server, invalidate access and refresh token, remove it from cookies.
127
+ */
128
+ logout: () => Promise<void>;
129
+ /**
130
+ * logout from server on Hosted Login, invalidate access and refresh token, remove it from cookies.
131
+ */
132
+ OAuthLogout: (params?: IOAuthLogout | undefined) => Promise<void>;
133
+ /**
134
+ * calling forgot password request will send email with link to reset user's password.
135
+ * @throws exception if the user not found
136
+ */
137
+ forgotPassword: (body: IForgotPassword) => Promise<void>;
138
+ /**
139
+ * reset password should be called after forget password request.
140
+ * userId, new password and the token has been sent to the user email.
141
+ * @throws exception if the user not found, password validation failed or invalid token.
142
+ */
143
+ resetPassword: (body: IResetPassword) => Promise<void>;
144
+ /**
145
+ * load password configuration for user.
146
+ */
147
+ loadPasswordConfig: (params?: IGetUserPasswordConfig | undefined) => Promise<Partial<TestConfig> | null>;
148
+ /**
149
+ * recover Multi-Factor authentication by providing the recoveryCode
150
+ * that has been received when activated it
151
+ * @throws exception if recovery code is not valid
152
+ */
153
+ recoverMfaToken: (body: IRecoverMFAToken) => Promise<void>;
154
+ /**
155
+ * enroll Multi-Factor Auth Code to use in 3rd party apps like Google Authenticator.
156
+ * the server returns qrCode as png image in base64 format
157
+ * @throws exception if the user already have mfa-enabled
158
+ * ``authorized user``
159
+ */
160
+ enrollMfa: () => Promise<IEnrollMfaResponse>;
161
+ /**
162
+ * pre enroll Multi-Factor Auth Code to use in 3rd party apps like Google Authenticator.
163
+ * the server returns qrCode as png image in base64 format
164
+ * @throws exception if the user already have mfa-enabled
165
+ * ``authorized user``
166
+ */
167
+ preEnrollMFAAuthenticatorApp: () => Promise<IPreEnrollMFAAuthenticatorAppResponse>;
168
+ /**
169
+ * enroll Multi-Factor Auth Code to use in 3rd party apps like Google Authenticator.
170
+ */
171
+ enrollMFAAuthenticatorApp: (body: WithoutMFAToken<IEnrollMFAAuthenticatorApp>) => Promise<void>;
172
+ /**
173
+ * pre enroll Multi-Factor SMS
174
+ * the server returns otcToken that should be sent to the enroll function with the code that was sent to
175
+ */
176
+ preEnrollMFASMS: (body: WithoutMFAToken<IPreEnrollMFASMS>) => Promise<IPreEnrollMFASMSResponse>;
177
+ /**
178
+ * After pre-enrolling with SMS, this function should be called
179
+ * with the otcToken and the code sent to the requested phone number.
180
+ */
181
+ enrollMFASMS: (body: WithoutMFAToken<IEnrollMFASMS>) => Promise<void>;
182
+ /**
183
+ * Pre-enroll Multi-Factor to use with WebAuthn. The server returns an attestation object.
184
+ */
185
+ preEnrollMFAWebAuthn: () => Promise<IPreEnrollMFAWebAuthnResponse>;
186
+ /**
187
+ * After pre-enrolling with WebAuthn, this function should be called
188
+ * with the webauthnToken and the attestation object response.
189
+ */
190
+ enrollMFAWebAuthn: (body: WithoutMFAToken<IEnrollMFAWebAuthn>) => Promise<void>;
191
+ /**
192
+ * After enrolling MFA QR code, verify function should be called
193
+ * with the generated code in the Authenticator App.
194
+ *
195
+ * @return Recovery code to use to disable MFA if your device is lost. This code won't be shown again.
196
+ * @throws Exception if the generated token is invalid. "authorized user"
197
+ */
198
+ verifyMfa: (body: IVerifyMfa) => Promise<IVerifyMfaResponse>;
199
+ /**
200
+ * Disable MFA by either passing the recoveryCode or the generated code from the Authenticator App.
201
+ *
202
+ * @throws Exception if the generated token or the recoveryCode are incorrect. "authorized user"
203
+ */
204
+ disableMfa: (body: IDisableMfa) => Promise<void>;
205
+ /**
206
+ * Disable MFA Authenticator App.
207
+ *
208
+ * @throws Exception if the generated token is incorrect. "authorized user"
209
+ */
210
+ disableMFAAuthenticatorApp: (deviceId: string, body: IDisableMfa) => Promise<void>;
211
+ /**
212
+ * Pre-disable MFA SMS, should be called if user has just one MFA device.
213
+ *
214
+ * @throws Exception if pre-disable is not required for disable. "authorized user"
215
+ */
216
+ preDisableMFASMS: (deviceId: string) => Promise<IPreDisableMFASMSResponse>;
217
+ /**
218
+ * After pre-disable MFA SMS, this function should be called. Can also be called without pre-disable if
219
+ * the user has more than one MFA device.
220
+ *
221
+ * @throws Exception if pre-disable is not required for disable. "authorized user"
222
+ */
223
+ disableMFASMS: (deviceId: string, body: IDisableMFASMS) => Promise<void>;
224
+ /**
225
+ * Pre-disable MFA WebAuthn, should be called if user has just one MFA device.
226
+ *
227
+ * @throws Exception if pre-disable is not required for disable. "authorized user"
228
+ */
229
+ preDisableMFAWebAuthn: (deviceId: string) => Promise<IPreDisableMFAWebAuthnResponse>;
230
+ /**
231
+ * After pre-disable MFA WebAuthn, disable MFA WebAuthn should be called. Can also be called without pre-disable if
232
+ * the user has more than one MFA device.
233
+ *
234
+ * @throws Exception if pre-disable is not required for disable. "authorized user"
235
+ */
236
+ disableMFAWebAuthn: (deviceId: string, body: IDisableMFAWebAuthn) => Promise<void>;
237
+ /**
238
+ * Returns user MFA devices list split into 3 arrays: webauthn, phones, and authenticators.
239
+ */
240
+ getMFADevices: () => Promise<UserMFADevicesResponse>;
241
+ /**
242
+ * Pre-enroll Multi-Factor Auth Code to use in 3rd party apps like Google Authenticator.
243
+ * The server returns a qrCode as a PNG image in base64 format.
244
+ */
245
+ preEnrollMFAAuthenticatorAppForLogin: (body: IPreEnrollMFA) => Promise<IPreEnrollMFAAuthenticatorAppResponse>;
246
+ /**
247
+ * After pre-enrolling with the authenticator app, this function should be called
248
+ * with the generated code in the Authenticator App.
249
+ */
250
+ enrollMFAAuthenticatorAppForLogin: (body: IEnrollMFAAuthenticatorApp) => Promise<ILoginResponse>;
251
+ /**
252
+ * After pre-enrolling with the authenticator app, this function should be called
253
+ * with the generated code in the Authenticator App.
254
+ */
255
+ enrollMFAAuthenticatorAppForLoginV2: (body: IEnrollMFAAuthenticatorApp) => Promise<ILoginResponseV3>;
256
+ /**
257
+ * After login succeeded with mfaRequired token response, this function should be called
258
+ * with the selected authenticator app ID, mfaToken, and the generated code from your authenticator app.
259
+ */
260
+ verifyMFAAuthenticatorAppForLogin: (deviceId: string, body: IVerifyMFAAuthenticatorApp) => Promise<ILoginResponse>;
261
+ /**
262
+ * Pre-verify Multi-Factor Email Code. The server returns an otcToken that should be sent
263
+ * to the verify function with the code that was sent to the email.
264
+ */
265
+ preVerifyMFAEmailCode: (body: IPreVerifyMFA) => Promise<IPreVerifyMFAEmailCodeResponse>;
266
+ /**
267
+ * After pre-verifying with Email Code, this function should be called
268
+ * with the otcToken and the code that has been sent to the email.
269
+ */
270
+ verifyMFAEmailCode: (body: IVerifyMFAEmailCode) => Promise<ILoginResponse>;
271
+ /**
272
+ * After pre-verifying with Email Code, this function should be called
273
+ * with the otcToken and the code that has been sent to the email.
274
+ */
275
+ verifyMFAEmailCodeV2: (body: IVerifyMFAEmailCode) => Promise<ILoginResponseV3>;
276
+ /**
277
+ * Pre-enroll Multi-Factor to use with SMS.
278
+ * The server returns an otcToken that should be sent to the enroll function with the code sent to
279
+ * the requested phone number.
280
+ */
281
+ preEnrollMFASMSForLogin: (body: IPreEnrollMFASMS) => Promise<IPreEnrollMFASMSResponse>;
282
+ /**
283
+ * After pre-enrolling with SMS, this function should be called
284
+ * with the otcToken and the code sent to the requested phone number.
285
+ */
286
+ enrollMFASMSForLogin: (body: IEnrollMFASMS) => Promise<ILoginResponse>;
287
+ /**
288
+ * After pre-enrolling with SMS, this function should be called
289
+ * with the otcToken and the code sent to the requested phone number.
290
+ */
291
+ enrollMFASMSForLoginV2: (body: IEnrollMFASMS) => Promise<ILoginResponseV3>;
292
+ /**
293
+ * After login succeeded with mfaRequired token response, if the user asked to use SMS as MFA
294
+ * this function should be called with the selected device ID and mfaToken.
295
+ */
296
+ preVerifyMFASMSForLogin: (deviceId: string, body: IPreVerifyMFA) => Promise<IPreVerifyMFASMSResponse>;
297
+ /**
298
+ * After pre-verifying with SMS, this function should be called with otcToken, mfaToken, and the code
299
+ * that has been sent to the selected device.
300
+ */
301
+ verifyMFASMSForLogin: (deviceId: string, body: IVerifyMFASMS) => Promise<ILoginResponse>;
302
+ /**
303
+ * After pre-verifying with SMS, this function should be called with otcToken, mfaToken, and the code
304
+ * that has been sent to the selected device.
305
+ */
306
+ verifyMFASMSForLoginV2: (deviceId: string, body: IVerifyMFASMS) => Promise<ILoginResponseV3>;
307
+ /**
308
+ * Pre-enroll Multi-Factor Authentication using WebAuthn for login.
309
+ * The server returns an attestation object.
310
+ * @param body - The request phone number
311
+ */
312
+ preEnrollMFAWebAuthnForLogin: (body: IPreEnrollMFA) => Promise<IPreEnrollMFAWebAuthnResponse>;
313
+ /**
314
+ * After pre-enrollment with WebAuthn, enrollment should be completed with the WebAuthn token and attestation response.
315
+ * @param body - The enrollment data
316
+ */
317
+ enrollMFAWebAuthnForLogin: (body: IEnrollMFAWebAuthn) => Promise<ILoginResponse>;
318
+ /**
319
+ * After pre-enrollment with WebAuthn, enrollment should be completed with the WebAuthn token and attestation response.
320
+ * @param body - The enrollment data
321
+ */
322
+ enrollMFAWebAuthnForLoginV2: (body: IEnrollMFAWebAuthn) => Promise<ILoginResponseV3>;
323
+ /**
324
+ * After successful login with mfaRequired token response, use WebAuthn as MFA.
325
+ * @param deviceId - The device ID
326
+ * @param body - The verification data
327
+ */
328
+ preVerifyMFAWebAuthnForLogin: (deviceId: string, body: IPreVerifyMFA) => Promise<IPreVerifyMFAWebAuthnResponse>;
329
+ /**
330
+ * After pre-verification with WebAuthn, verify with WebAuthn token and assertion response.
331
+ * @param deviceId - The device ID
332
+ * @param body - The verification data
333
+ */
334
+ verifyMFAWebAuthnForLogin: (deviceId: string, body: IVerifyMFAWebAuthn) => Promise<ILoginResponse>;
335
+ /**
336
+ * After pre-verification with WebAuthn, verify with WebAuthn token and assertion response.
337
+ * @param deviceId - The device ID
338
+ * @param body - The verification data
339
+ */
340
+ verifyMFAWebAuthnForLoginV2: (deviceId: string, body: IVerifyMFAWebAuthn) => Promise<ILoginResponseV3>;
341
+ /**
342
+ * Retrieve SAML configurations from the server by the logged-in user (tenantId, vendorId).
343
+ *
344
+ * @returns {enabled: false} if no SAML configuration is found. Otherwise, returns ISamlConfiguration.
345
+ */
346
+ getSamlConfiguration: () => Promise<ISamlConfiguration>;
347
+ /**
348
+ * Update SAML configuration by the logged-in user (tenantId, vendorId).
349
+ * @param body - The SAML configuration data
350
+ */
351
+ updateSamlConfiguration: (body: IUpdateSamlConfiguration) => Promise<ISamlConfiguration>;
352
+ /**
353
+ * Retrieve vendor SAML config from the server by the logged-in user (tenantId, vendorId).
354
+ *
355
+ * @throws - Exception 'ACS url information not found' if no SAML vendor configuration is found.
356
+ */
357
+ getSamlVendorConfiguration: () => Promise<ISamlVendorConfigResponse>;
358
+ /**
359
+ * Update Vendor SAML metadata by the logged-in user (tenantId, vendorId).
360
+ *
361
+ * @returns {enabled: false} if no SAML configuration is found. Otherwise, returns ISamlConfiguration.
362
+ */
363
+ updateSamlVendorMetadata: (body: IUpdateSamlVendorMetadata) => Promise<ISamlConfiguration>;
364
+ /**
365
+ * Validate SAML configuration's domain by the logged-in user (tenantId, vendorId).
366
+ *
367
+ * @returns {enabled: false} if no SAML configuration is found. Otherwise, returns ISamlConfiguration.
368
+ */
369
+ validateSamlDomain: () => Promise<ISamlConfiguration>;
370
+ /**
371
+ * Get SAML roles for authorization.
372
+ *
373
+ * @returns An array of role IDs.
374
+ */
375
+ getSamlRoles: () => Promise<string[]>;
376
+ /**
377
+ * Get SAML roles groups.
378
+ *
379
+ * @returns An array of groups and assigned role IDs.
380
+ */
381
+ getSamlRolesGroups: () => Promise<ISamlRolesGroup[]>;
382
+ /**
383
+ * Update SAML roles for authorization.
384
+ * @param params - Role IDs data
385
+ */
386
+ updateSamlRoles: ({ roleIds }: IUpdateSamlRoles) => Promise<void>;
387
+ /**
388
+ * Create SAML group roles for authorization.
389
+ * @param params - Group roles data
390
+ */
391
+ createSamlGroup: ({ roleIds, group }: ICreateSamlGroup) => Promise<void>;
392
+ /**
393
+ * Update SAML group roles for authorization.
394
+ * @param params - Group roles data
395
+ */
396
+ updateSamlGroup: ({ roleIds, group, id }: IUpdateSamlGroup) => Promise<void>;
397
+ /**
398
+ * Delete SAML group.
399
+ * @param params - The group ID
400
+ */
401
+ deleteSamlGroup: ({ id }: {
402
+ id: string;
403
+ }) => Promise<void>;
404
+ /**
405
+ * Retrieve OIDC configurations from the server by the logged-in user (vendorId).
406
+ *
407
+ * @returns {active: true} if no OIDC configuration is found. Otherwise, returns IOidcConfiguration.
408
+ */
409
+ getOidcConfiguration: () => Promise<IOidcConfiguration>;
410
+ /**
411
+ * Check if one or more SAML/OIDC configurations are active.
412
+ *
413
+ * @returns {isActive: true/false}
414
+ */
415
+ getSSOPublicConfiguration: () => Promise<ISSOPublicConfiguration>;
416
+ /**
417
+ * Get social login providers configurations for the vendor.
418
+ *
419
+ * @returns An array of providers configurations.
420
+ */
421
+ getSocialLoginProviders: () => Promise<ISocialLoginProviderConfiguration[]>;
422
+ /**
423
+ * Public route: Get social login providers configurations V2 supports dev credentials as well.
424
+ *
425
+ * @returns An array of providers configurations.
426
+ */
427
+ getSocialLoginProvidersV2: () => Promise<ISocialLoginProviderConfigurationV2[]>;
428
+ /**
429
+ * Authenticated route: Get social login providers configurations V2 supports dev credentials as well.
430
+ *
431
+ * @returns An array of providers configurations.
432
+ */
433
+ getSocialLoginProvidersV2ForAuthenticatedUser: () => Promise<ISocialLoginProviderConfigurationV2[]>;
434
+ /**
435
+ * Get custom social login providers configurations.
436
+ *
437
+ * @returns An array of custom providers configurations.
438
+ */
439
+ getCustomSocialLoginProvidersV1: () => Promise<ICustomSocialLoginProviderConfigurationV1>;
440
+ /**
441
+ * Login using social login.
442
+ *
443
+ * @param params - Social login parameters
444
+ * @returns A cookie with the refresh token.
445
+ */
446
+ loginViaSocialLogin: (params: ILoginViaSocialLogin) => Promise<ILoginViaSocialLoginResponse>;
447
+ /**
448
+ * Get vendor secure access configuration.
449
+ */
450
+ getVendorConfig: () => Promise<IVendorConfig>;
451
+ /**
452
+ * Sign up a new user and create a new tenant.
453
+ *
454
+ * @param body - The sign-up data
455
+ */
456
+ signUpUser: (body: ISignUpUser) => Promise<ISignUpResponse>;
457
+ /**
458
+ * Get all current user active sessions.
459
+ */
460
+ getCurrentUserSessions: () => Promise<ISessionResponse[]>;
461
+ /**
462
+ * Get current user session.
463
+ */
464
+ getCurrentUserSession: () => Promise<ISessionResponse>;
465
+ /**
466
+ * Revoke sessions for a user.
467
+ *
468
+ * @param userId - The user ID
469
+ */
470
+ revokeSessionsForUser: (userId: string) => Promise<void>;
471
+ /**
472
+ * Get session configurations.
473
+ */
474
+ getSessionConfigurations: () => Promise<ISessionConfigurations>;
475
+ /**
476
+ * Create or update session configurations.
477
+ *
478
+ * @param body - The session configuration data
479
+ */
480
+ createOrUpdateSessionConfigrations: (body: ISessionConfigurations) => Promise<void>;
481
+ /**
482
+ * Delete user session
483
+ */
484
+ deleteSessionForUser: (id: string) => Promise<void>;
485
+ /**
486
+ * Delete all user sessions
487
+ */
488
+ deleteAllSessionsForUser: () => Promise<void>;
489
+ /**
490
+ * Access tokens Configurations
491
+ */
492
+ /**
493
+ * Get user access tokens data
494
+ */
495
+ getUserAccessTokensData: () => Promise<IGetUserAccessTokens>;
496
+ /**
497
+ * Get tenant access tokens data
498
+ */
499
+ getTenantAccessTokensData: () => Promise<IGetTenantAccessTokens>;
500
+ /**
501
+ * Delete Tenant access Token
502
+ */
503
+ deleteTenantAccessToken: ({ id, }: IDeleteAccessToken) => Promise<void>;
504
+ /**
505
+ * Delete User access Token
506
+ */
507
+ deleteUserAccessToken: ({ id, }: IDeleteAccessToken) => Promise<void>;
508
+ /**
509
+ * Create User Access Token.
510
+ */
511
+ createUserAccessToken: (body: ICreateUserAccessTokenData) => Promise<IUserApiTokensData>;
512
+ /**
513
+ * Create Tenant Access Token
514
+ */
515
+ createTenantAccessToken: (body: ICreateTenantAccessTokenData) => Promise<ITenantApiTokensData>;
516
+ /**
517
+ * Api tokens Configurations
518
+ */
519
+ /**
520
+ * Get user api tokens data
521
+ */
522
+ getUserApiTokensData: () => Promise<IUserApiTokensData[]>;
523
+ /**
524
+ * Get tenant api tokens data
525
+ */
526
+ getTenantApiTokensData: () => Promise<ITenantApiTokensData[]>;
527
+ /**
528
+ * Update User Api Tokens
529
+ */
530
+ updateUserApiTokensData: (body: IUpdateUserApiTokensData) => Promise<IUserApiTokensData>;
531
+ /**
532
+ * Update Tenant Api Tokens
533
+ */
534
+ updateTenantApiTokensData: (body: IUpdateTenantApiTokensData) => Promise<ITenantApiTokensData>;
535
+ /**
536
+ * Delete Tenant Api Token
537
+ */
538
+ deleteTenantApiToken: ({ tokenId, }: IDeleteApiToken) => Promise<void>;
539
+ /**
540
+ * Delete User Api Token
541
+ */
542
+ deleteUserApiToken: ({ tokenId, }: IDeleteApiToken) => Promise<void>;
543
+ /**
544
+ * Get Tenant Api Token Creator User
545
+ */
546
+ getUserById: ({ userId, }: IGetUserById) => Promise<IUserIdResponse>;
547
+ /**
548
+ * Checks if remember MFA device is enabled for user.
549
+ */
550
+ checkIfAllowToRememberMfaDevice: (mfaToken: string) => Promise<IAllowedToRememberMfaDevice>;
551
+ /**
552
+ * Passwordless pre-login authentication
553
+ */
554
+ passwordlessPreLogin: ({ type, ...body }: IPasswordlessPreLogin) => Promise<void>;
555
+ passwordlessPostLoginV2: ({ type, ...body }: IPasswordlessPostLogin) => Promise<ILoginResponseV3>;
556
+ passwordlessPostLogin: ({ type, ...body }: IPasswordlessPostLogin) => Promise<ILoginResponse>;
557
+ /**
558
+ * Check if tenant invitation token is valid
559
+ * @param token - invitation token
560
+ * @returns tenant name
561
+ */
562
+ verifyInviteToken: ({ token, }: IVerifyInviteToken) => Promise<string>;
563
+ /**
564
+ * SSO Configurations V1
565
+ */
566
+ /**
567
+ * Retrieve SSO configurations from server by logged in user (tenantId, vendorId)
568
+ * @return ISSOConfiguration[]
569
+ * ``authorized user``
570
+ */
571
+ getSSOConfigurations: () => Promise<ISSOConfiguration[]>;
572
+ /**
573
+ * Create SSO configuration by logged in user (tenantId, vendorId)
574
+ * @returns ISSOConfiguration
575
+ * ``authorized user``
576
+ */
577
+ createSSOConfiguration: (body: IUpdateSSOConfiguration) => Promise<ISSOConfiguration>;
578
+ /**
579
+ * Update SSO configuration by logged in user (tenantId, vendorId)
580
+ * @returns ISSOConfiguration
581
+ * ``authorized user``
582
+ */
583
+ updateSSOConfiguration: (ssoConfigId: string, body: IUpdateSSOConfiguration) => Promise<ISSOConfiguration>;
584
+ /**
585
+ * Delete SSO configuration by logged in user (tenantId, vendorId)
586
+ * ``authorized user``
587
+ */
588
+ deleteSSOConfiguration: (ssoConfigId: string) => Promise<void>;
589
+ /**
590
+ * Create SSO configuration by metadata by logged in user (tenantId, vendorId)
591
+ * @returns ISSOConfiguration
592
+ * ``authorized user``
593
+ */
594
+ createSSOConfigurationByMetadata: (body: IUpdateSamlVendorMetadata) => Promise<ISSOConfiguration>;
595
+ /**
596
+ * Update SSO configuration by metadata by logged in user (tenantId, vendorId)
597
+ * @returns ISSOConfiguration
598
+ * ``authorized user``
599
+ */
600
+ updateSSOConfigurationByMetadata: (ssoConfigId: string, body: IUpdateSamlVendorMetadata) => Promise<ISSOConfiguration>;
601
+ /**
602
+ * Create SSO configuration by metadata url by logged in user (tenantId, vendorId)
603
+ * @returns ISSOConfiguration
604
+ * ``authorized user``
605
+ */
606
+ createSSOConfigurationByMetadataUrl: (body: ICreateOrUpdateSSOConfigurationByMetadataUrl) => Promise<ISSOConfiguration>;
607
+ /**
608
+ * Update SSO configuration by metadata url by logged in user (tenantId, vendorId)
609
+ * @returns ISSOConfiguration
610
+ * ``authorized user``
611
+ */
612
+ updateSSOConfigurationByMetadataUrl: (ssoConfigId: string, body: ICreateOrUpdateSSOConfigurationByMetadataUrl) => Promise<ISSOConfiguration>;
613
+ /**
614
+ * Create SSO configuration domain by logged in user (tenantId, vendorId)
615
+ * @returns ISSODomain
616
+ * ``authorized user``
617
+ */
618
+ createSSODomain: (ssoConfigId: string, body: ICreateSSODomain) => Promise<ISSODomain>;
619
+ /**
620
+ * Create SSO configuration domain by logged in user (tenantId, vendorId)
621
+ *
622
+ * `authorized user`
623
+ */
624
+ deleteSSODomain: (ssoConfigId: string, domainId: string) => Promise<void>;
625
+ /**
626
+ * Validate SSO configuration domain by logged in user (tenantId, vendorId)
627
+ *
628
+ * `authorized user`
629
+ * @deprecated(Use validateSSODomainV2 instead)
630
+ */
631
+ validateSSODomain: (ssoConfigId: string, domainId: string) => Promise<void>;
632
+ /**
633
+ * Validate SSO configuration domain by logged in user (tenantId, vendorId)
634
+ *
635
+ * `authorized user`
636
+ */
637
+ validateSSODomainV2: (ssoConfigId: string, domainId: string) => Promise<void>;
638
+ /**
639
+ * Get SSO configuration default roles by logged in user (tenantId, vendorId)
640
+ *
641
+ * `authorized user`
642
+ */
643
+ getSSODefaultRoles: (ssoConfigId: string) => Promise<ISSOConfigurationDefaultRoles>;
644
+ /**
645
+ * Create SSO configuration default roles by logged in user (tenantId, vendorId)
646
+ *
647
+ * `authorized user`
648
+ */
649
+ setSSODefaultRoles: (ssoConfigId: string, body: IUpdateSamlRoles) => Promise<void>;
650
+ /**
651
+ * Create SSO configuration group roles for authorization
652
+ */
653
+ createSSOGroup: (ssoConfigId: string, body: ICreateSamlGroup) => Promise<void>;
654
+ /**
655
+ * Update SSO configuration group roles for authorization
656
+ */
657
+ updateSSOGroup: (ssoConfigId: string, { roleIds, group, id }: IUpdateSamlGroup) => Promise<void>;
658
+ /**
659
+ * Delete SSO configuration group
660
+ */
661
+ deleteSSOGroup: (ssoConfigId: string, groupId: string) => Promise<void>;
662
+ /**
663
+ * Get SSO configuration groups
664
+ */
665
+ getSSOGroups: (ssoConfigId: string) => Promise<ISamlRolesGroup[]>;
666
+ /**
667
+ * Check if requested email address has sso configuration
668
+ * If true, this function will return the sso address to navigate to
669
+ * else, return null
670
+ */
671
+ preLoginV2: (body: IPreLogin) => Promise<IPreLoginWithIdpTypeResponse | null>;
672
+ /**
673
+ * After calling preLogin and navigated to SSO url, the IDP will redirect you to the redirect url
674
+ * with code and state
675
+ */
676
+ oidcPostLoginV2: (body: IOidcPostLoginV2) => Promise<ILoginResponse>;
677
+ exchangeOAuthTokensV2: (body: IExchangeOAuthTokens) => Promise<ILoginResponseV3>;
678
+ silentOAuthRefreshTokenV2: () => Promise<ILoginResponseV3>;
679
+ exchangeOAuthTokens: (body: IExchangeOAuthTokens) => Promise<ILoginResponse>;
680
+ silentOAuthRefreshToken: () => Promise<ILoginResponse>;
681
+ /**
682
+ * Reset phone should be called in case user want to reset his phone number
683
+ * when using sms authentication strategy. A 6-digits code will be sent to the user email.
684
+ */
685
+ resetPhoneNumber: (body: IResetPhoneNumber) => Promise<IResetPhoneNumberResponse>;
686
+ /**
687
+ * Verify reset phone should be called after reset phone number request
688
+ * with the token received from the reset phone number request and a code that was sent to the user email
689
+ */
690
+ verifyResetPhoneNumber: (body: IVerifyResetPhoneNumber) => Promise<IVerifyResetPhoneNumberResponse>;
691
+ /**
692
+ * Change phone number with verification.
693
+ */
694
+ changePhoneNumberWithVerification: (body: IChangePhoneNumberWithVerification) => Promise<IChangePhoneNumberWithVerificationResponse>;
695
+ /**
696
+ * Verify new phone number.
697
+ */
698
+ verifyChangePhoneNumber: (body: IVerifyChangePhoneNumber) => Promise<void>;
699
+ /**
700
+ * Change phone number should be called after verify reset phone number with the new phone number
701
+ */
702
+ changePhoneNumber: (body: IChangePhoneNumber) => Promise<void>;
703
+ /**
704
+ * WebAuthn prelogin should be called when the user wants to be authenticated using his device/android/usb key
705
+ */
706
+ webAuthnPreLogin: (body: IWebAuthnPreLogin) => Promise<IWebAuthnPreLoginResponse>;
707
+ /**
708
+ * WebAuthn postlogin should be called after the user used his authenticator (device/android/usb key) in order to login
709
+ */
710
+ webAuthnPostLogin: (body: IWebAuthnPostLogin) => Promise<ILoginResponse>;
711
+ /**
712
+ * WebAuthn postlogin should be called after the user used his authenticator (device/android/usb key) in order to login
713
+ */
714
+ webAuthnPostLoginV2: (body: IWebAuthnPostLogin) => Promise<ILoginResponseV3>;
715
+ /**
716
+ * WebAuthn create new device should be called once the user wants to add new device as authenticator
717
+ */
718
+ webAuthnCreateNewDeviceSession: () => Promise<ICreateNewDeviceSessionResponse>;
719
+ /**
720
+ * Get WebAuthn devices should be called in order to get user's WebAuthn devices
721
+ */
722
+ getWebAuthnDevices: () => Promise<IWebAuthnDevices>;
723
+ /**
724
+ * Delete WebAuthn device should be called in order to delete user's WebAuthn device
725
+ */
726
+ deleteWebAuthnDevice: (deviceId: string) => Promise<void>;
727
+ /**
728
+ * WebAuthn verify new device should be called after the user used his authenticator in order to register the new device
729
+ */
730
+ verifyNewDeviceSession: (body: IVerifyNewWebAuthnDevice) => Promise<void>;
731
+ /**
732
+ * ##### Public route
733
+ * Get public vendor auth strategies public configuration
734
+ */
735
+ getVendorPublicAuthStrategiesConfig: () => Promise<IAuthStrategiesConfig>;
736
+ /**
737
+ * ##### Authenticated route
738
+ * Get public vendor auth strategies public configuration
739
+ */
740
+ getPublicAuthStrategiesConfigForAuthenticatedUser: () => Promise<IAuthStrategiesConfig>;
741
+ /**
742
+ * Get vendor MFA strategies configuration
743
+ */
744
+ getMFAStrategiesConfig: () => Promise<IMFAStrategiesResponse>;
745
+ /**
746
+ * Get user permissions and roles
747
+ */
748
+ getUserAuthorization: () => Promise<IGetUserAuthorizationResponse>;
749
+ /**
750
+ * Get user profile
751
+ */
752
+ getMeV2: () => Promise<IUserProfile>;
753
+ /**
754
+ * A load entitlements function that catches errors and return undefined if failed to load
755
+ * @returns the loaded entitlements object or undefined if failed to load
756
+ */
757
+ private noThrowLoadEntitlements;
758
+ /**
759
+ * @returns me and authorization response with entitlements inside user.entitlements
760
+ * Me request will be executed, and me authorization and entitlements will be executed according to FF and configuration.
761
+ */
762
+ getMeAndEntitlements: () => Promise<IUserProfile>;
763
+ /**
764
+ * Generate step-up session
765
+ * This request returns the step up details to continue step up, or the generated login response when stepped up JWT received from the BE
766
+ */
767
+ generateStepupSession: (body: GenerateStepUpRequest) => Promise<GenerateStepUpResponse | ILoginResponseV3>;
768
+ }
769
+ declare const _default: AuthenticationApi;
770
+ export default _default;