@frontegg/rest-api 3.0.123 → 3.0.125

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/auth/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export * from "./secutiry-poilicy";
2
2
  export * from "./enums";
3
3
  import { ISamlRolesGroup } from "../teams/interfaces";
4
- 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 } from './interfaces';
4
+ 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 } from './interfaces';
5
5
  /*****************************************
6
6
  * Authentication
7
7
  *****************************************/
@@ -244,6 +244,16 @@ export declare function enrollMFAAuthenticatorAppForLogin(body: IEnrollMFAAuthen
244
244
  * with the selected authenticator app id, mfaToken and the generated code from your authenticator app.
245
245
  */
246
246
  export declare function verifyMFAAuthenticatorAppForLogin(deviceId: string, body: IVerifyMFAAuthenticatorApp): Promise<ILoginResponse>;
247
+ /**
248
+ * pre verify Multi-Factor Email Code
249
+ * the server returns otcToken that should be sent to the verify function with the code that was sent to
250
+ */
251
+ export declare function preVerifyMFAEmailCode(body: IPreVerifyMFA): Promise<IPreVerifyMFAEmailCodeResponse>;
252
+ /**
253
+ * after pre verify with Email Code, verify Email Code function should be called
254
+ * with the otcToken and the code that has been sent to the email
255
+ */
256
+ export declare function verifyMFAEmailCode(body: IVerifyMFAEmailCode): Promise<ILoginResponse>;
247
257
  /**
248
258
  * pre enroll Multi-Factor to use with SMS
249
259
  * the server returns otcToken that should be sent to the enroll function with the code that was sent to
package/auth/index.js CHANGED
@@ -207,6 +207,12 @@ export async function enrollMFAAuthenticatorAppForLogin(body) {
207
207
  export async function verifyMFAAuthenticatorAppForLogin(deviceId, body) {
208
208
  return Post(`${urls.identity.auth.v1}/user/mfa/authenticator/${deviceId}/verify`, body);
209
209
  }
210
+ export async function preVerifyMFAEmailCode(body) {
211
+ return Post(`${urls.identity.auth.v1}/user/mfa/emailcode`, body);
212
+ }
213
+ export async function verifyMFAEmailCode(body) {
214
+ return Post(`${urls.identity.auth.v1}/user/mfa/emailcode/verify`, body);
215
+ }
210
216
  export async function preEnrollMFASMSForLogin(body) {
211
217
  return Post(`${urls.identity.auth.v1}/user/mfa/sms/enroll`, body);
212
218
  }
@@ -43,6 +43,7 @@ export declare type ILoginResponse = IUserProfile & {
43
43
  userEmail?: string;
44
44
  mfaStrategies?: MFAStrategyEnum[];
45
45
  mfaDevices?: UserMFADevicesResponse;
46
+ isBreachedPassword?: boolean;
46
47
  };
47
48
  export declare type ILoginResponseV2 = {
48
49
  user: ILoginResponse;
@@ -569,16 +570,25 @@ export interface IVerifyMFA {
569
570
  mfaToken: string;
570
571
  rememberDevice?: boolean;
571
572
  }
573
+ export interface IPreVerifyCode {
574
+ otcToken: string;
575
+ }
576
+ export interface IVerifyCode extends IVerifyMFA {
577
+ otcToken: string;
578
+ code: string;
579
+ }
572
580
  export interface IVerifyMFAAuthenticatorApp extends IVerifyMFA {
573
581
  value: string;
574
582
  }
575
- export interface IPreVerifyMFASMSResponse {
576
- otcToken: string;
583
+ export interface IPreVerifyMFASMSResponse extends IPreVerifyCode {
577
584
  phoneNumber: string;
578
585
  }
579
- export interface IVerifyMFASMS extends IVerifyMFA {
586
+ export interface IVerifyMFASMS extends IVerifyCode {
587
+ }
588
+ export interface IPreVerifyMFAEmailCodeResponse {
580
589
  otcToken: string;
581
- code: string;
590
+ }
591
+ export interface IVerifyMFAEmailCode extends IVerifyCode {
582
592
  }
583
593
  export interface IPreVerifyMFAWebAuthnResponse {
584
594
  webauthnToken: string;
@@ -592,7 +602,8 @@ export declare enum MFAStrategyEnum {
592
602
  AuthenticatorApp = "AuthenticatorApp",
593
603
  WebAuthnPlatform = "WebAuthnPlatform",
594
604
  WebAuthnCrossPlatform = "WebAuthnCrossPlatform",
595
- SMS = "SMS"
605
+ SMS = "SMS",
606
+ EmailCode = "EmailCode"
596
607
  }
597
608
  export interface UserMFAWebAuthnDevice {
598
609
  id: string;
@@ -22,4 +22,5 @@ export let MFAStrategyEnum;
22
22
  MFAStrategyEnum["WebAuthnPlatform"] = "WebAuthnPlatform";
23
23
  MFAStrategyEnum["WebAuthnCrossPlatform"] = "WebAuthnCrossPlatform";
24
24
  MFAStrategyEnum["SMS"] = "SMS";
25
+ MFAStrategyEnum["EmailCode"] = "EmailCode";
25
26
  })(MFAStrategyEnum || (MFAStrategyEnum = {}));
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.123
1
+ /** @license Frontegg v3.0.125
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -48,6 +48,8 @@ var _exportNames = {
48
48
  preEnrollMFAAuthenticatorAppForLogin: true,
49
49
  enrollMFAAuthenticatorAppForLogin: true,
50
50
  verifyMFAAuthenticatorAppForLogin: true,
51
+ preVerifyMFAEmailCode: true,
52
+ verifyMFAEmailCode: true,
51
53
  preEnrollMFASMSForLogin: true,
52
54
  enrollMFASMSForLogin: true,
53
55
  preVerifyMFASMSForLogin: true,
@@ -221,6 +223,7 @@ exports.preEnrollMFAWebAuthnForLogin = preEnrollMFAWebAuthnForLogin;
221
223
  exports.preLogin = preLogin;
222
224
  exports.preLoginV2 = preLoginV2;
223
225
  exports.preLoginWithIdpType = preLoginWithIdpType;
226
+ exports.preVerifyMFAEmailCode = preVerifyMFAEmailCode;
224
227
  exports.preVerifyMFASMSForLogin = preVerifyMFASMSForLogin;
225
228
  exports.preVerifyMFAWebAuthnForLogin = preVerifyMFAWebAuthnForLogin;
226
229
  exports.recoverMfaToken = recoverMfaToken;
@@ -249,6 +252,7 @@ exports.validateSamlDomain = validateSamlDomain;
249
252
  exports.verifyChangePhoneNumber = verifyChangePhoneNumber;
250
253
  exports.verifyInviteToken = verifyInviteToken;
251
254
  exports.verifyMFAAuthenticatorAppForLogin = verifyMFAAuthenticatorAppForLogin;
255
+ exports.verifyMFAEmailCode = verifyMFAEmailCode;
252
256
  exports.verifyMFASMSForLogin = verifyMFASMSForLogin;
253
257
  exports.verifyMFAWebAuthnForLogin = verifyMFAWebAuthnForLogin;
254
258
  exports.verifyMfa = verifyMfa;
@@ -548,6 +552,14 @@ async function verifyMFAAuthenticatorAppForLogin(deviceId, body) {
548
552
  return (0, _fetch.Post)(`${_constants.urls.identity.auth.v1}/user/mfa/authenticator/${deviceId}/verify`, body);
549
553
  }
550
554
 
555
+ async function preVerifyMFAEmailCode(body) {
556
+ return (0, _fetch.Post)(`${_constants.urls.identity.auth.v1}/user/mfa/emailcode`, body);
557
+ }
558
+
559
+ async function verifyMFAEmailCode(body) {
560
+ return (0, _fetch.Post)(`${_constants.urls.identity.auth.v1}/user/mfa/emailcode/verify`, body);
561
+ }
562
+
551
563
  async function preEnrollMFASMSForLogin(body) {
552
564
  return (0, _fetch.Post)(`${_constants.urls.identity.auth.v1}/user/mfa/sms/enroll`, body);
553
565
  }
@@ -49,4 +49,5 @@ exports.MFAStrategyEnum = MFAStrategyEnum;
49
49
  MFAStrategyEnum["WebAuthnPlatform"] = "WebAuthnPlatform";
50
50
  MFAStrategyEnum["WebAuthnCrossPlatform"] = "WebAuthnCrossPlatform";
51
51
  MFAStrategyEnum["SMS"] = "SMS";
52
+ MFAStrategyEnum["EmailCode"] = "EmailCode";
52
53
  })(MFAStrategyEnum || (exports.MFAStrategyEnum = MFAStrategyEnum = {}));
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.123
1
+ /** @license Frontegg v3.0.125
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
- "version": "3.0.123",
3
+ "version": "3.0.125",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {