@frontegg/rest-api 7.75.0 → 7.76.0-alpha.1

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/enums.d.ts CHANGED
@@ -27,3 +27,12 @@ export declare enum SignUpStrategyEnum {
27
27
  Email = "email",
28
28
  PhoneNumber = "phoneNumber"
29
29
  }
30
+ export declare enum EIdentifierType {
31
+ email = "email",
32
+ phoneNumber = "phoneNumber",
33
+ username = "username"
34
+ }
35
+ export declare enum PasswordRecoveryStrategyEnum {
36
+ Email = "email",
37
+ Sms = "sms"
38
+ }
package/auth/enums.js CHANGED
@@ -30,4 +30,15 @@ export let SignUpStrategyEnum;
30
30
  (function (SignUpStrategyEnum) {
31
31
  SignUpStrategyEnum["Email"] = "email";
32
32
  SignUpStrategyEnum["PhoneNumber"] = "phoneNumber";
33
- })(SignUpStrategyEnum || (SignUpStrategyEnum = {}));
33
+ })(SignUpStrategyEnum || (SignUpStrategyEnum = {}));
34
+ export let EIdentifierType;
35
+ (function (EIdentifierType) {
36
+ EIdentifierType["email"] = "email";
37
+ EIdentifierType["phoneNumber"] = "phoneNumber";
38
+ EIdentifierType["username"] = "username";
39
+ })(EIdentifierType || (EIdentifierType = {}));
40
+ export let PasswordRecoveryStrategyEnum;
41
+ (function (PasswordRecoveryStrategyEnum) {
42
+ PasswordRecoveryStrategyEnum["Email"] = "email";
43
+ PasswordRecoveryStrategyEnum["Sms"] = "sms";
44
+ })(PasswordRecoveryStrategyEnum || (PasswordRecoveryStrategyEnum = {}));
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 } 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 } 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,10 @@ 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
+ * Get the available password recovery strategies for the vendor.
162
+ */
163
+ getPasswordRecoveryStrategies: () => Promise<IPasswordRecoveryStrategy[]>;
160
164
  /**
161
165
  * load password configuration for user.
162
166
  */
package/auth/index.js CHANGED
@@ -17,6 +17,7 @@ import { BaseApiClient } from '../BaseApiClient';
17
17
  import { EntitlementsApi } from '../entitlements';
18
18
  import { ContextHolder } from '../ContextHolder';
19
19
  import { SecurityPolicyApi } from './secutiry-poilicy';
20
+ import { AuthStrategyEnum } from './enums';
20
21
  export class AuthenticationApi extends BaseApiClient {
21
22
  constructor(appName) {
22
23
  super(appName);
@@ -209,6 +210,9 @@ export class AuthenticationApi extends BaseApiClient {
209
210
  this.resetPassword = async body => {
210
211
  return this.post(`${urls.identity.users.v1}/passwords/reset/verify`, body);
211
212
  };
213
+ this.getPasswordRecoveryStrategies = async () => {
214
+ return this.get(`${urls.identity.configurations.v1}/password-recovery/strategies`);
215
+ };
212
216
  this.loadPasswordConfig = async params => {
213
217
  return this.get(`${urls.identity.users.v1}/passwords/config`, params);
214
218
  };
@@ -562,11 +566,19 @@ export class AuthenticationApi extends BaseApiClient {
562
566
  });
563
567
  };
564
568
  this.passwordlessPreLogin = async _ref => {
569
+ var _usernameToTypeMapper;
565
570
  let {
566
571
  type
567
572
  } = _ref,
568
573
  body = _objectWithoutPropertiesLoose(_ref, _excluded);
569
- return this.post(`${urls.identity.auth.v1}/passwordless/${type.toLocaleLowerCase()}/prelogin`, body);
574
+ const usernameToTypeMapper = {
575
+ [AuthStrategyEnum.UsernameAndCode]: AuthStrategyEnum.Code,
576
+ [AuthStrategyEnum.UsernameAndMagicLink]: AuthStrategyEnum.MagicLink,
577
+ [AuthStrategyEnum.UsernameAndSms]: AuthStrategyEnum.SmsCode,
578
+ [AuthStrategyEnum.UsernameAndPassword]: AuthStrategyEnum.EmailAndPassword
579
+ };
580
+ const mappedType = ((_usernameToTypeMapper = usernameToTypeMapper[type]) == null ? void 0 : _usernameToTypeMapper.toLowerCase()) || type.toLowerCase();
581
+ return this.post(`${urls.identity.auth.v1}/passwordless/${mappedType}/prelogin`, body);
570
582
  };
571
583
  this.passwordlessPostLoginV2 = async _ref2 => {
572
584
  let {
@@ -1,10 +1,11 @@
1
1
  import { UserEntitlementsContext as UserEntitlementsResponseV2 } from '@frontegg/entitlements-javascript-commons';
2
2
  import { ITenantsResponse, IUserProfile } from '..';
3
- import { AuthStrategyEnum, MachineToMachineAuthStrategy, SignUpStrategyEnum, SocialLoginProviders } from './enums';
3
+ import { AuthStrategyEnum, 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 = {
7
- email: string;
7
+ email?: string;
8
+ username?: string;
8
9
  tenantId?: string;
9
10
  };
10
11
  export type IPostLogin = {
@@ -26,7 +27,8 @@ export type IOidcPostLoginV2 = {
26
27
  redirectUri?: string;
27
28
  };
28
29
  export type ILogin = {
29
- email: string;
30
+ email?: string;
31
+ username?: string;
30
32
  password: string;
31
33
  recaptchaToken?: string;
32
34
  invitationToken?: string;
@@ -391,13 +393,16 @@ export interface IBasePasswordlessPreLogin {
391
393
  export interface IEmailPasswordlessPreLogin extends IBasePasswordlessPreLogin {
392
394
  email: string;
393
395
  }
396
+ export interface IUsernamePasswordlessPreLogin extends IBasePasswordlessPreLogin {
397
+ username: string;
398
+ }
394
399
  export interface IUserIDPasswordlessPreLogin extends IBasePasswordlessPreLogin {
395
400
  userId: string;
396
401
  }
397
402
  export interface IPhoneNumberPasswordlessPreLogin extends IBasePasswordlessPreLogin {
398
403
  phoneNumber: string;
399
404
  }
400
- export type IPasswordlessPreLogin = IEmailPasswordlessPreLogin | IUserIDPasswordlessPreLogin | IPhoneNumberPasswordlessPreLogin;
405
+ export type IPasswordlessPreLogin = IEmailPasswordlessPreLogin | IUserIDPasswordlessPreLogin | IUsernamePasswordlessPreLogin | IPhoneNumberPasswordlessPreLogin;
401
406
  export interface IPasswordlessPostLogin {
402
407
  token: string;
403
408
  recaptchaToken?: string;
@@ -718,3 +723,7 @@ export type TSignupStrategy = {
718
723
  isRequired: boolean;
719
724
  };
720
725
  export type TSignupStrategyResponse = Array<TSignupStrategy>;
726
+ export interface IPasswordRecoveryStrategy {
727
+ strategy: PasswordRecoveryStrategyEnum;
728
+ isActive: boolean;
729
+ }
package/constants.d.ts CHANGED
@@ -134,6 +134,9 @@ export declare const urls: {
134
134
  phoneNumbers: {
135
135
  v1: string;
136
136
  };
137
+ usernames: {
138
+ v1: string;
139
+ };
137
140
  };
138
141
  team: {
139
142
  sso: {
package/constants.js CHANGED
@@ -133,6 +133,9 @@ export const urls = {
133
133
  },
134
134
  phoneNumbers: {
135
135
  v1: '/identity/resources/users/phone-numbers/v1'
136
+ },
137
+ usernames: {
138
+ v1: '/identity/resources/usernames/v1'
136
139
  }
137
140
  },
138
141
  team: {
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AuthStrategyEnum, MachineToMachineAuthStrategy, SocialLoginProviders } from './auth';
1
+ import { AuthStrategyEnum, EIdentifierType, MachineToMachineAuthStrategy, SocialLoginProviders } from './auth';
2
2
  import { ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType } from './subscriptions';
3
3
  import { FronteggApiError } from './error';
4
4
  import fetch, { FetchClient } from './FetchClient';
@@ -27,6 +27,7 @@ import { SecurityCenterApi } from './security-center';
27
27
  import { PhoneNumbersApi } from './user-phone-numbers';
28
28
  import { ApplicationsApi } from './applications';
29
29
  import { VeloApi } from './velo';
30
+ import { UsernamesApi } from './usernames';
30
31
  import { UserEmailPolicyApi } from './users-emails-policy';
31
32
  export * from './interfaces';
32
33
  export * from './auth/interfaces';
@@ -90,6 +91,7 @@ declare const api: {
90
91
  userPhoneNumbers: PhoneNumbersApi;
91
92
  applications: ApplicationsApi;
92
93
  velo: VeloApi;
94
+ usernames: UsernamesApi;
93
95
  userEmailPolicy: UserEmailPolicyApi;
94
96
  };
95
97
  export type FronteggApiClient = {
@@ -117,10 +119,11 @@ export type FronteggApiClient = {
117
119
  userPhoneNumbers: PhoneNumbersApi;
118
120
  applications: ApplicationsApi;
119
121
  velo: VeloApi;
122
+ usernames: UsernamesApi;
120
123
  userEmailPolicy: UserEmailPolicyApi;
121
124
  };
122
125
  declare const createApiClient: (appName: string) => FronteggApiClient;
123
- export { fetch, FetchClient, ContextHolder, FronteggContext, api, createApiClient, FronteggApiError, AuthStrategyEnum, SocialLoginProviders, ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType, MachineToMachineAuthStrategy, };
126
+ export { fetch, FetchClient, ContextHolder, FronteggContext, api, createApiClient, FronteggApiError, AuthStrategyEnum, SocialLoginProviders, ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType, MachineToMachineAuthStrategy, EIdentifierType, };
124
127
  declare const _default: {
125
128
  fetch: FetchClient;
126
129
  FetchClient: typeof FetchClient;
@@ -169,6 +172,7 @@ declare const _default: {
169
172
  userPhoneNumbers: PhoneNumbersApi;
170
173
  applications: ApplicationsApi;
171
174
  velo: VeloApi;
175
+ usernames: UsernamesApi;
172
176
  userEmailPolicy: UserEmailPolicyApi;
173
177
  };
174
178
  createApiClient: (appName: string) => FronteggApiClient;
@@ -180,5 +184,6 @@ declare const _default: {
180
184
  ISubscriptionStatus: typeof ISubscriptionStatus;
181
185
  PaymentMethodType: typeof PaymentMethodType;
182
186
  ProviderType: typeof ProviderType;
187
+ EIdentifierType: typeof EIdentifierType;
183
188
  };
184
189
  export default _default;
package/index.js CHANGED
@@ -1,9 +1,9 @@
1
- /** @license Frontegg v7.75.0
1
+ /** @license Frontegg v7.76.0-alpha.1
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.
5
5
  */
6
- import { AuthStrategyEnum, MachineToMachineAuthStrategy, SocialLoginProviders } from './auth';
6
+ import { AuthStrategyEnum, EIdentifierType, MachineToMachineAuthStrategy, SocialLoginProviders } from './auth';
7
7
  import { ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType } from './subscriptions';
8
8
  import { FronteggApiError } from './error';
9
9
  import fetch, { FetchClient } from './FetchClient';
@@ -32,6 +32,7 @@ import DefaultSecurityCenterApi, { SecurityCenterApi } from './security-center';
32
32
  import DefaultPhoneNumbersApi, { PhoneNumbersApi } from './user-phone-numbers';
33
33
  import DefaultApplicationsApi, { ApplicationsApi } from './applications';
34
34
  import DefaultVeloApi, { VeloApi } from './velo';
35
+ import DefaultUsernamesApi, { UsernamesApi } from './usernames';
35
36
  import DefaultUserEmailPolicyApi, { UserEmailPolicyApi } from './users-emails-policy';
36
37
  export * from './interfaces';
37
38
  export * from './auth/interfaces';
@@ -95,6 +96,7 @@ const api = {
95
96
  userPhoneNumbers: DefaultPhoneNumbersApi,
96
97
  applications: DefaultApplicationsApi,
97
98
  velo: DefaultVeloApi,
99
+ usernames: DefaultUsernamesApi,
98
100
  userEmailPolicy: DefaultUserEmailPolicyApi
99
101
  };
100
102
  const createApiClient = appName => ({
@@ -122,9 +124,10 @@ const createApiClient = appName => ({
122
124
  userPhoneNumbers: new PhoneNumbersApi(appName),
123
125
  applications: new ApplicationsApi(appName),
124
126
  velo: new VeloApi(appName),
127
+ usernames: new UsernamesApi(appName),
125
128
  userEmailPolicy: new UserEmailPolicyApi(appName)
126
129
  });
127
- export { fetch, FetchClient, ContextHolder, FronteggContext, api, createApiClient, FronteggApiError, AuthStrategyEnum, SocialLoginProviders, ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType, MachineToMachineAuthStrategy };
130
+ export { fetch, FetchClient, ContextHolder, FronteggContext, api, createApiClient, FronteggApiError, AuthStrategyEnum, SocialLoginProviders, ISubscriptionCancellationPolicy, ISubscriptionStatus, PaymentMethodType, ProviderType, MachineToMachineAuthStrategy, EIdentifierType };
128
131
  export default {
129
132
  fetch,
130
133
  FetchClient,
@@ -139,5 +142,6 @@ export default {
139
142
  ISubscriptionCancellationPolicy,
140
143
  ISubscriptionStatus,
141
144
  PaymentMethodType,
142
- ProviderType
145
+ ProviderType,
146
+ EIdentifierType
143
147
  };
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SocialLoginProviders = exports.SignUpStrategyEnum = exports.MachineToMachineAuthStrategy = exports.AuthStrategyEnum = void 0;
6
+ exports.SocialLoginProviders = exports.SignUpStrategyEnum = exports.PasswordRecoveryStrategyEnum = exports.MachineToMachineAuthStrategy = exports.EIdentifierType = exports.AuthStrategyEnum = void 0;
7
7
  let SocialLoginProviders;
8
8
  exports.SocialLoginProviders = SocialLoginProviders;
9
9
  (function (SocialLoginProviders) {
@@ -40,4 +40,17 @@ exports.SignUpStrategyEnum = SignUpStrategyEnum;
40
40
  (function (SignUpStrategyEnum) {
41
41
  SignUpStrategyEnum["Email"] = "email";
42
42
  SignUpStrategyEnum["PhoneNumber"] = "phoneNumber";
43
- })(SignUpStrategyEnum || (exports.SignUpStrategyEnum = SignUpStrategyEnum = {}));
43
+ })(SignUpStrategyEnum || (exports.SignUpStrategyEnum = SignUpStrategyEnum = {}));
44
+ let EIdentifierType;
45
+ exports.EIdentifierType = EIdentifierType;
46
+ (function (EIdentifierType) {
47
+ EIdentifierType["email"] = "email";
48
+ EIdentifierType["phoneNumber"] = "phoneNumber";
49
+ EIdentifierType["username"] = "username";
50
+ })(EIdentifierType || (exports.EIdentifierType = EIdentifierType = {}));
51
+ let PasswordRecoveryStrategyEnum;
52
+ exports.PasswordRecoveryStrategyEnum = PasswordRecoveryStrategyEnum;
53
+ (function (PasswordRecoveryStrategyEnum) {
54
+ PasswordRecoveryStrategyEnum["Email"] = "email";
55
+ PasswordRecoveryStrategyEnum["Sms"] = "sms";
56
+ })(PasswordRecoveryStrategyEnum || (exports.PasswordRecoveryStrategyEnum = PasswordRecoveryStrategyEnum = {}));
@@ -275,6 +275,9 @@ 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.getPasswordRecoveryStrategies = async () => {
279
+ return this.get(`${_constants2.urls.identity.configurations.v1}/password-recovery/strategies`);
280
+ };
278
281
  this.loadPasswordConfig = async params => {
279
282
  return this.get(`${_constants2.urls.identity.users.v1}/passwords/config`, params);
280
283
  };
@@ -628,11 +631,19 @@ class AuthenticationApi extends _BaseApiClient.BaseApiClient {
628
631
  });
629
632
  };
630
633
  this.passwordlessPreLogin = async _ref => {
634
+ var _usernameToTypeMapper;
631
635
  let {
632
636
  type
633
637
  } = _ref,
634
638
  body = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
635
- return this.post(`${_constants2.urls.identity.auth.v1}/passwordless/${type.toLocaleLowerCase()}/prelogin`, body);
639
+ const usernameToTypeMapper = {
640
+ [_enums.AuthStrategyEnum.UsernameAndCode]: _enums.AuthStrategyEnum.Code,
641
+ [_enums.AuthStrategyEnum.UsernameAndMagicLink]: _enums.AuthStrategyEnum.MagicLink,
642
+ [_enums.AuthStrategyEnum.UsernameAndSms]: _enums.AuthStrategyEnum.SmsCode,
643
+ [_enums.AuthStrategyEnum.UsernameAndPassword]: _enums.AuthStrategyEnum.EmailAndPassword
644
+ };
645
+ const mappedType = ((_usernameToTypeMapper = usernameToTypeMapper[type]) == null ? void 0 : _usernameToTypeMapper.toLowerCase()) || type.toLowerCase();
646
+ return this.post(`${_constants2.urls.identity.auth.v1}/passwordless/${mappedType}/prelogin`, body);
636
647
  };
637
648
  this.passwordlessPostLoginV2 = async _ref2 => {
638
649
  let {
package/node/constants.js CHANGED
@@ -139,6 +139,9 @@ const urls = {
139
139
  },
140
140
  phoneNumbers: {
141
141
  v1: '/identity/resources/users/phone-numbers/v1'
142
+ },
143
+ usernames: {
144
+ v1: '/identity/resources/usernames/v1'
142
145
  }
143
146
  },
144
147
  team: {
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.75.0
1
+ /** @license Frontegg v7.76.0-alpha.1
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.
@@ -12,6 +12,7 @@ var _exportNames = {
12
12
  api: true,
13
13
  createApiClient: true,
14
14
  AuthStrategyEnum: true,
15
+ EIdentifierType: true,
15
16
  MachineToMachineAuthStrategy: true,
16
17
  SocialLoginProviders: true,
17
18
  setTabTenantInSessionStorage: true,
@@ -43,6 +44,12 @@ Object.defineProperty(exports, "ContextHolder", {
43
44
  return _ContextHolder.ContextHolder;
44
45
  }
45
46
  });
47
+ Object.defineProperty(exports, "EIdentifierType", {
48
+ enumerable: true,
49
+ get: function () {
50
+ return _auth.EIdentifierType;
51
+ }
52
+ });
46
53
  Object.defineProperty(exports, "FRONTEGG_SEPARATE_TABS_BY_TENANT", {
47
54
  enumerable: true,
48
55
  get: function () {
@@ -173,6 +180,7 @@ var _securityCenter = _interopRequireWildcard(require("./security-center"));
173
180
  var _userPhoneNumbers = _interopRequireWildcard(require("./user-phone-numbers"));
174
181
  var _applications = _interopRequireWildcard(require("./applications"));
175
182
  var _velo = _interopRequireWildcard(require("./velo"));
183
+ var _usernames = _interopRequireWildcard(require("./usernames"));
176
184
  var _usersEmailsPolicy = _interopRequireWildcard(require("./users-emails-policy"));
177
185
  var _interfaces = require("./interfaces");
178
186
  Object.keys(_interfaces).forEach(function (key) {
@@ -567,6 +575,7 @@ const api = {
567
575
  userPhoneNumbers: _userPhoneNumbers.default,
568
576
  applications: _applications.default,
569
577
  velo: _velo.default,
578
+ usernames: _usernames.default,
570
579
  userEmailPolicy: _usersEmailsPolicy.default
571
580
  };
572
581
  exports.api = api;
@@ -595,6 +604,7 @@ const createApiClient = appName => ({
595
604
  userPhoneNumbers: new _userPhoneNumbers.PhoneNumbersApi(appName),
596
605
  applications: new _applications.ApplicationsApi(appName),
597
606
  velo: new _velo.VeloApi(appName),
607
+ usernames: new _usernames.UsernamesApi(appName),
598
608
  userEmailPolicy: new _usersEmailsPolicy.UserEmailPolicyApi(appName)
599
609
  });
600
610
  exports.createApiClient = createApiClient;
@@ -612,6 +622,7 @@ var _default = {
612
622
  ISubscriptionCancellationPolicy: _subscriptions.ISubscriptionCancellationPolicy,
613
623
  ISubscriptionStatus: _subscriptions.ISubscriptionStatus,
614
624
  PaymentMethodType: _subscriptions.PaymentMethodType,
615
- ProviderType: _subscriptions.ProviderType
625
+ ProviderType: _subscriptions.ProviderType,
626
+ EIdentifierType: _auth.EIdentifierType
616
627
  };
617
628
  exports.default = _default;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.UsernamesApi = void 0;
7
+ var _BaseApiClient = require("../BaseApiClient");
8
+ var _constants = require("../constants");
9
+ class UsernamesApi extends _BaseApiClient.BaseApiClient {
10
+ constructor(appName) {
11
+ super(appName);
12
+ this.getUserOwnUsername = async () => {
13
+ return this.get(`${_constants.urls.identity.usernames.v1}/me`);
14
+ };
15
+ this.createUsername = async body => {
16
+ return this.post(`${_constants.urls.identity.usernames.v1}`, body);
17
+ };
18
+ this.deleteUsername = async username => {
19
+ return this.delete(`${_constants.urls.identity.usernames.v1}/${username}`);
20
+ };
21
+ }
22
+
23
+ /**
24
+ * Get own username of user
25
+ */
26
+ }
27
+ exports.UsernamesApi = UsernamesApi;
28
+ var _default = new UsernamesApi('default');
29
+ exports.default = _default;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
- "version": "7.75.0",
3
+ "version": "7.76.0-alpha.1",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "author": "Frontegg LTD",
@@ -0,0 +1,19 @@
1
+ import { BaseApiClient } from '../BaseApiClient';
2
+ import { ICreateUsername, IGetUserOwnUsernameResponse } from './interfaces';
3
+ export declare class UsernamesApi extends BaseApiClient {
4
+ constructor(appName: string);
5
+ /**
6
+ * Get own username of user
7
+ */
8
+ getUserOwnUsername: () => Promise<IGetUserOwnUsernameResponse>;
9
+ /**
10
+ * Create new username for user
11
+ */
12
+ createUsername: (body: ICreateUsername) => Promise<void>;
13
+ /**
14
+ * Delete existing username for user
15
+ */
16
+ deleteUsername: (username: string) => Promise<void>;
17
+ }
18
+ declare const _default: UsernamesApi;
19
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import { BaseApiClient } from '../BaseApiClient';
2
+ import { urls } from '../constants';
3
+ export class UsernamesApi extends BaseApiClient {
4
+ constructor(appName) {
5
+ super(appName);
6
+ this.getUserOwnUsername = async () => {
7
+ return this.get(`${urls.identity.usernames.v1}/me`);
8
+ };
9
+ this.createUsername = async body => {
10
+ return this.post(`${urls.identity.usernames.v1}`, body);
11
+ };
12
+ this.deleteUsername = async username => {
13
+ return this.delete(`${urls.identity.usernames.v1}/${username}`);
14
+ };
15
+ }
16
+
17
+ /**
18
+ * Get own username of user
19
+ */
20
+ }
21
+
22
+ export default new UsernamesApi('default');
@@ -0,0 +1,7 @@
1
+ export type ICreateUsername = {
2
+ username: string;
3
+ };
4
+ export type IGetUserOwnUsernameResponse = {
5
+ username: string;
6
+ userId: string;
7
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "main": "../node/usernames/index.js",
5
+ "types": "./index.d.ts"
6
+ }