@frontegg/rest-api 7.76.0-alpha.2 → 7.76.0
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 +14 -1
- package/auth/index.js +9 -0
- package/auth/interfaces.d.ts +16 -1
- package/auth/interfaces.js +2 -0
- package/index.js +1 -1
- package/node/auth/index.js +9 -0
- package/node/auth/interfaces.js +2 -0
- package/node/index.js +1 -1
- package/package.json +1 -1
package/auth/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export * from './enums';
|
|
|
3
3
|
export { FRONTEGG_SEPARATE_TABS_BY_TENANT } from './constants';
|
|
4
4
|
export { setTabTenantInSessionStorage, getTabTenantFromSessionStorage, getCurrentUserTenantsFunction, removeTabTenantFromSessionStorage, } from './utils';
|
|
5
5
|
import { ISamlRolesGroup } from '../teams/interfaces';
|
|
6
|
-
import { IAcceptInvitation, IAcceptInvitationWithOTC, IActivateAccount, IActivateAccountWithOTC, 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, TSignupStrategyResponse, IPasswordRecoveryStrategy } from './interfaces';
|
|
6
|
+
import { IAcceptInvitation, IAcceptInvitationWithOTC, IActivateAccount, IActivateAccountWithOTC, 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, TSignupStrategyResponse, IPasswordRecoveryStrategy, IForgotPasswordV2, IResetPasswordViaSmsResponse, IVerifyPasswordViaSmsRequest, IVerifyPasswordViaSmsResponse } from './interfaces';
|
|
7
7
|
import { IGetUserAuthorizationResponse, IUserProfile } from '../users/interfaces';
|
|
8
8
|
import { BaseApiClient } from '../BaseApiClient';
|
|
9
9
|
import { SecurityPolicyApi } from './secutiry-poilicy';
|
|
@@ -157,6 +157,19 @@ export declare class AuthenticationApi extends BaseApiClient {
|
|
|
157
157
|
* @throws exception if the user not found, password validation failed or invalid token.
|
|
158
158
|
*/
|
|
159
159
|
resetPassword: (body: IResetPassword) => Promise<void>;
|
|
160
|
+
/**
|
|
161
|
+
* calling reset password via email will send an email with a link to reset user's password.
|
|
162
|
+
* @throws exception if the user not found
|
|
163
|
+
*/
|
|
164
|
+
resetPasswordViaEmail: (body: IForgotPasswordV2) => Promise<void>;
|
|
165
|
+
/**
|
|
166
|
+
* calling reset password via sms will send an sms with an otc token.
|
|
167
|
+
*/
|
|
168
|
+
resetPasswordViaSms: (body: IForgotPasswordV2) => Promise<IResetPasswordViaSmsResponse>;
|
|
169
|
+
/**
|
|
170
|
+
* calling verify password via sms will verify the otc token and return the user id and token.
|
|
171
|
+
*/
|
|
172
|
+
verifyPasswordViaSms: (body: IVerifyPasswordViaSmsRequest) => Promise<IVerifyPasswordViaSmsResponse>;
|
|
160
173
|
/**
|
|
161
174
|
* Get the available password recovery strategies for the vendor.
|
|
162
175
|
*/
|
package/auth/index.js
CHANGED
|
@@ -210,6 +210,15 @@ export class AuthenticationApi extends BaseApiClient {
|
|
|
210
210
|
this.resetPassword = async body => {
|
|
211
211
|
return this.post(`${urls.identity.users.v1}/passwords/reset/verify`, body);
|
|
212
212
|
};
|
|
213
|
+
this.resetPasswordViaEmail = async body => {
|
|
214
|
+
return this.post(`${urls.identity.users.v2}/passwords/reset/email`, body);
|
|
215
|
+
};
|
|
216
|
+
this.resetPasswordViaSms = async body => {
|
|
217
|
+
return this.post(`${urls.identity.users.v2}/passwords/reset/sms`, body);
|
|
218
|
+
};
|
|
219
|
+
this.verifyPasswordViaSms = async body => {
|
|
220
|
+
return this.post(`${urls.identity.users.v2}/passwords/reset/sms/verify`, body);
|
|
221
|
+
};
|
|
213
222
|
this.getPasswordRecoveryStrategies = async () => {
|
|
214
223
|
return this.get(`${urls.identity.configurations.v1}/password-recovery/strategies`);
|
|
215
224
|
};
|
package/auth/interfaces.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UserEntitlementsContext as UserEntitlementsResponseV2 } from '@frontegg/entitlements-javascript-commons';
|
|
2
2
|
import { ITenantsResponse, IUserProfile } from '..';
|
|
3
|
-
import { AuthStrategyEnum, MachineToMachineAuthStrategy, PasswordRecoveryStrategyEnum, SignUpStrategyEnum, SocialLoginProviders } from './enums';
|
|
3
|
+
import { AuthStrategyEnum, EIdentifierType, MachineToMachineAuthStrategy, PasswordRecoveryStrategyEnum, SignUpStrategyEnum, SocialLoginProviders } from './enums';
|
|
4
4
|
import { ISamlRolesGroup } from '../teams/interfaces';
|
|
5
5
|
export * from './secutiry-poilicy/interfaces';
|
|
6
6
|
export type IPreLogin = {
|
|
@@ -103,6 +103,21 @@ export type IResendInvitationEmail = {
|
|
|
103
103
|
export type IForgotPassword = {
|
|
104
104
|
email: string;
|
|
105
105
|
};
|
|
106
|
+
export type IForgotPasswordV2 = {
|
|
107
|
+
identifier: string;
|
|
108
|
+
identifierType: EIdentifierType;
|
|
109
|
+
};
|
|
110
|
+
export type IResetPasswordViaSmsResponse = {
|
|
111
|
+
sessionId: string;
|
|
112
|
+
};
|
|
113
|
+
export type IVerifyPasswordViaSmsRequest = {
|
|
114
|
+
otcToken: string;
|
|
115
|
+
sessionId: string;
|
|
116
|
+
};
|
|
117
|
+
export type IVerifyPasswordViaSmsResponse = {
|
|
118
|
+
userId: string;
|
|
119
|
+
token: string;
|
|
120
|
+
};
|
|
106
121
|
export type IResetPassword = {
|
|
107
122
|
token: string;
|
|
108
123
|
userId: string;
|
package/auth/interfaces.js
CHANGED
package/index.js
CHANGED
package/node/auth/index.js
CHANGED
|
@@ -275,6 +275,15 @@ class AuthenticationApi extends _BaseApiClient.BaseApiClient {
|
|
|
275
275
|
this.resetPassword = async body => {
|
|
276
276
|
return this.post(`${_constants2.urls.identity.users.v1}/passwords/reset/verify`, body);
|
|
277
277
|
};
|
|
278
|
+
this.resetPasswordViaEmail = async body => {
|
|
279
|
+
return this.post(`${_constants2.urls.identity.users.v2}/passwords/reset/email`, body);
|
|
280
|
+
};
|
|
281
|
+
this.resetPasswordViaSms = async body => {
|
|
282
|
+
return this.post(`${_constants2.urls.identity.users.v2}/passwords/reset/sms`, body);
|
|
283
|
+
};
|
|
284
|
+
this.verifyPasswordViaSms = async body => {
|
|
285
|
+
return this.post(`${_constants2.urls.identity.users.v2}/passwords/reset/sms/verify`, body);
|
|
286
|
+
};
|
|
278
287
|
this.getPasswordRecoveryStrategies = async () => {
|
|
279
288
|
return this.get(`${_constants2.urls.identity.configurations.v1}/password-recovery/strategies`);
|
|
280
289
|
};
|
package/node/auth/interfaces.js
CHANGED
|
@@ -10,6 +10,7 @@ var _exportNames = {
|
|
|
10
10
|
LOAD_AUTHORIZATION_FF: true
|
|
11
11
|
};
|
|
12
12
|
exports.WebAuthnDeviceType = exports.SecondaryAuthStrategy = exports.MFAStrategyEnum = exports.LOAD_AUTHORIZATION_FF = void 0;
|
|
13
|
+
var _enums = require("./enums");
|
|
13
14
|
var _interfaces = require("./secutiry-poilicy/interfaces");
|
|
14
15
|
Object.keys(_interfaces).forEach(function (key) {
|
|
15
16
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -22,6 +23,7 @@ Object.keys(_interfaces).forEach(function (key) {
|
|
|
22
23
|
}
|
|
23
24
|
});
|
|
24
25
|
});
|
|
26
|
+
_enums.EIdentifierType;
|
|
25
27
|
// SmsCode is for speedy login, SmsCodeV2 is for login with SMS
|
|
26
28
|
let SecondaryAuthStrategy;
|
|
27
29
|
exports.SecondaryAuthStrategy = SecondaryAuthStrategy;
|
package/node/index.js
CHANGED