@frontegg/rest-api 3.1.74 → 3.1.76-alpha.9502349697

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