@frontegg/rest-api 3.1.4 → 3.1.6

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.
@@ -1,5 +1,5 @@
1
1
  import { ContextOptions, RedirectOptions, RequestSource } from '../interfaces';
2
- import { IUserDTO } from "../users/interfaces";
2
+ import { IUserProfile } from "../users/interfaces";
3
3
  /**
4
4
  * Entitlements config from frontegg provider
5
5
  */
@@ -20,7 +20,7 @@ export declare class ContextHolder {
20
20
  static getInstance(): ContextHolder;
21
21
  static setContext(context: ContextOptions): void;
22
22
  static setAccessToken(accessToken: string | null): void;
23
- static setUser(user: IUserDTO | null): void;
23
+ static setUser(user: IUserProfile | null): void;
24
24
  static setRequestSource(requestSource: RequestSource | null): void;
25
25
  static setOnRedirectTo(onRedirectTo: (path: string, opts?: RedirectOptions) => void): void;
26
26
  static setLogout(logout: (callback?: () => void) => void, logoutUrl: string): void;
@@ -36,7 +36,7 @@ export declare class ContextHolder {
36
36
  static getContext(): ContextOptions;
37
37
  static getAccessToken(): string | null;
38
38
  static getRequestSource(): RequestSource | null;
39
- static getUser(): IUserDTO | null;
39
+ static getUser(): IUserProfile | null;
40
40
  static onRedirectTo(path: string, opts?: RedirectOptions): void;
41
41
  static logout(callback?: () => void): void;
42
42
  /**
@@ -51,7 +51,7 @@ export declare class ContextHolder {
51
51
  export declare const FronteggContext: {
52
52
  getContext: () => ContextOptions;
53
53
  getAccessToken: () => string | null;
54
- getUser: () => IUserDTO | null;
54
+ getUser: () => IUserProfile | null;
55
55
  onRedirectTo: (path: string, opts: RedirectOptions) => void;
56
56
  logout: (callback?: (() => void) | undefined) => void;
57
57
  };
package/auth/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export * from "./secutiry-poilicy";
2
2
  export * from "./enums";
3
3
  import { ISamlRolesGroup } from "../teams/interfaces";
4
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
- import { IUserDTO } from "../users/interfaces";
5
+ import { IUserProfile } from "../users/interfaces";
6
6
  /*****************************************
7
7
  * Authentication
8
8
  *****************************************/
@@ -736,4 +736,4 @@ export declare function getMFAStrategiesConfig(): Promise<IMFAStrategiesResponse
736
736
  /**
737
737
  * @returns me response with entitlements inside user.entitlements
738
738
  */
739
- export declare function getMeAndEntitlements(): Promise<IUserDTO>;
739
+ export declare function getMeAndEntitlements(): Promise<IUserProfile>;
@@ -1,4 +1,4 @@
1
- import { ITenantsResponse, IUserDTO, UserEntitlementsResponse } from "..";
1
+ import { ITenantsResponse, IUserProfile, UserEntitlementsResponse } from "..";
2
2
  import { AuthStrategyEnum, MachineToMachineAuthStrategy, SocialLoginProviders } from "./enums";
3
3
  import { ISamlRolesGroup } from "../teams/interfaces";
4
4
  export * from "./secutiry-poilicy/interfaces";
@@ -30,7 +30,7 @@ export declare type ILogin = {
30
30
  recaptchaToken?: string;
31
31
  invitationToken?: string;
32
32
  };
33
- export declare type ILoginResponse = IUserDTO & {
33
+ export declare type ILoginResponse = IUserProfile & {
34
34
  mfaRequired: boolean;
35
35
  accessToken: string;
36
36
  refreshToken: string;
package/index.d.ts CHANGED
@@ -77,7 +77,7 @@ declare const _default: {
77
77
  FronteggContext: {
78
78
  getContext: () => import("./interfaces").ContextOptions;
79
79
  getAccessToken: () => string | null;
80
- getUser: () => import("./users/interfaces").IUserDTO | null;
80
+ getUser: () => import("./users/interfaces").IGetUsersV2Response | null;
81
81
  onRedirectTo: (path: string, opts: import("./interfaces").RedirectOptions) => void;
82
82
  logout: (callback?: (() => void) | undefined) => void;
83
83
  };
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.1.4
1
+ /** @license Frontegg v3.1.6
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/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.1.4
1
+ /** @license Frontegg v3.1.6
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.
@@ -81,5 +81,6 @@ exports.SecurityCategory = SecurityCategory;
81
81
  SecurityCategory["SESSIONS"] = "SESSIONS";
82
82
  SecurityCategory["PASSWORD"] = "PASSWORD";
83
83
  SecurityCategory["INACTIVITY"] = "INACTIVITY";
84
- SecurityCategory["RESTRICTIONS"] = "RESTRICTIONS";
84
+ SecurityCategory["IP"] = "IP";
85
+ SecurityCategory["DOMAIN"] = "DOMAIN";
85
86
  })(SecurityCategory || (exports.SecurityCategory = SecurityCategory = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
- "version": "3.1.4",
3
+ "version": "3.1.6",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -96,7 +96,8 @@ export declare enum SecurityCategory {
96
96
  SESSIONS = "SESSIONS",
97
97
  PASSWORD = "PASSWORD",
98
98
  INACTIVITY = "INACTIVITY",
99
- RESTRICTIONS = "RESTRICTIONS"
99
+ IP = "IP",
100
+ DOMAIN = "DOMAIN"
100
101
  }
101
102
  export interface ScoringResponse {
102
103
  score: number;
@@ -70,5 +70,6 @@ export let SecurityCategory;
70
70
  SecurityCategory["SESSIONS"] = "SESSIONS";
71
71
  SecurityCategory["PASSWORD"] = "PASSWORD";
72
72
  SecurityCategory["INACTIVITY"] = "INACTIVITY";
73
- SecurityCategory["RESTRICTIONS"] = "RESTRICTIONS";
73
+ SecurityCategory["IP"] = "IP";
74
+ SecurityCategory["DOMAIN"] = "DOMAIN";
74
75
  })(SecurityCategory || (SecurityCategory = {}));
package/teams/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { IAddUser, IChangePassword, ILoadUsers, IResendActivationLink, ITeamUserRole, ITeamStats, ITeamUser, IUpdateProfile, IUpdateUser, IDeleteUser, ITeamUserPermission, IResendInvitationLink, IInviteUserLinkResponse, ICreateOrUpdateInviteUserLink, IInviteLinkConfiguration, IUserProfile } from './interfaces';
1
+ import { IAddUser, IChangePassword, ILoadUsers, IResendActivationLink, ITeamUserRole, ITeamStats, ITeamUser, IUpdateProfile, IUpdateUser, IDeleteUser, ITeamUserPermission, IResendInvitationLink, IInviteUserLinkResponse, ICreateOrUpdateInviteUserLink, IInviteLinkConfiguration } from './interfaces';
2
2
  import { PaginationResult } from '../interfaces';
3
- import { IUserDTO } from "../users/interfaces";
4
- /*****************************************
3
+ import { IUserProfile } from "../users/interfaces";
4
+ /****************************************s*
5
5
  * Profile Api
6
6
  *****************************************/
7
7
  /**
@@ -10,7 +10,7 @@ import { IUserDTO } from "../users/interfaces";
10
10
  * @throws exception if the current password incorrect or new password validation failed.
11
11
  * ``authorized user``
12
12
  */
13
- export declare function getProfile(params?: object): Promise<IUserDTO>;
13
+ export declare function getProfile(params?: object): Promise<IUserProfile>;
14
14
  /**
15
15
  * update user profile by providing updated fields.
16
16
  * ``authorized user``
@@ -1,29 +1,9 @@
1
1
  import { QueryFilter, QuerySort } from "../interfaces";
2
- import { IRole, IRolePermission } from "../roles/interfaces";
2
+ import { IRole } from "../roles/interfaces";
3
3
  export declare enum UserManagedByEnum {
4
4
  FRONTEGG = "frontegg",
5
5
  SCIM2 = "scim2"
6
6
  }
7
- export declare type IUserProfile = {
8
- id: string;
9
- email: string;
10
- mfaEnrolled: boolean;
11
- name: string;
12
- phoneNumber?: string;
13
- profileImage?: string;
14
- profilePictureUrl: string | null;
15
- roles: IRole[];
16
- permissions: IRolePermission[];
17
- tenantId: string;
18
- tenantIds: string[];
19
- activatedForTenant?: boolean;
20
- metadata: any;
21
- roleIds?: string[];
22
- verified?: boolean;
23
- superUser?: boolean;
24
- managedBy?: UserManagedByEnum;
25
- provider?: string;
26
- };
27
7
  export declare type ITeamUserTenant = {
28
8
  tenantId: string;
29
9
  roles: IRole[];
package/users/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { GetCurrentUserTenantsResponse, GetUserGroupsParams, GetUserGroupsResponse, GetUserJwtRequestDto, GetUserJwtResponseDto, GetUserRolesResponse, GetUsersRolesParams, IGetUsersV2Response, ISearchUserQueryParamsV2, ISearchUserQueryParamsV3, IUpdateUserDto, IUserDTO, IUsersV3Data } from './interfaces';
1
+ import { GetCurrentUserTenantsResponse, GetUserGroupsParams, GetUserGroupsResponse, GetUserJwtRequestDto, GetUserJwtResponseDto, GetUserRolesResponse, GetUsersRolesParams, IGetUsersV2Response, ISearchUserQueryParamsV2, ISearchUserQueryParamsV3, IUpdateUserDto, IUserProfile, IUsersV3Data } from './interfaces';
2
2
  import { FronteggPaginationWrapper, UserJwtOptions } from '../interfaces';
3
3
  export declare function GetUserJwt(body: GetUserJwtRequestDto): Promise<GetUserJwtResponseDto>;
4
4
  export declare function getUsersV2(queryParams: ISearchUserQueryParamsV2, options?: UserJwtOptions): Promise<FronteggPaginationWrapper<IGetUsersV2Response>>;
@@ -7,4 +7,4 @@ export declare function getUsersRoles(queryParams: GetUsersRolesParams, options?
7
7
  export declare function getUsersGroups(queryParams: GetUserGroupsParams, options?: UserJwtOptions): Promise<GetUserGroupsResponse[]>;
8
8
  export declare function getCurrentUserTenantsV3(options?: UserJwtOptions): Promise<GetCurrentUserTenantsResponse>;
9
9
  export declare function sendResetBreachedPasswordEmails(): Promise<void>;
10
- export declare function updateUserProfileV2(body: Partial<IUpdateUserDto>): Promise<IUserDTO>;
10
+ export declare function updateUserProfileV2(body: Partial<IUpdateUserDto>): Promise<IUserProfile>;
@@ -3,6 +3,7 @@ import { ITenantsResponse } from '../tenants/interfaces';
3
3
  import { IRole } from '../roles/interfaces';
4
4
  import { ITeamUserPermission, UserManagedByEnum } from '../teams/interfaces';
5
5
  import { IGroupResponse } from '../groups/interfaces';
6
+ import { UserEntitlementsResponse } from "../entitlements/interfaces";
6
7
  export declare enum SortByEnum {
7
8
  createdAt = "createdAt",
8
9
  name = "name",
@@ -38,16 +39,21 @@ export interface ISearchUserQueryParamsV3 extends IGetUserQueryParams {
38
39
  _tenantId?: string;
39
40
  _includeSubTenants?: boolean;
40
41
  }
41
- export interface IBaseUserData {
42
- id: string;
43
- email: string;
44
- name?: string;
45
- profilePictureUrl?: string;
46
- }
47
42
  export interface IUserTenantData {
48
43
  tenantId: string;
49
44
  roles: IRole[];
50
45
  }
46
+ export interface IBaseUserData {
47
+ id: string;
48
+ email: string;
49
+ name: string;
50
+ /**
51
+ * @deprecated
52
+ * use profilePictureUrl instead
53
+ */
54
+ profileImage?: string;
55
+ profilePictureUrl?: string | null;
56
+ }
51
57
  export interface IBaseGetUserResponse extends IBaseUserData {
52
58
  sub: string;
53
59
  verified: boolean;
@@ -56,7 +62,7 @@ export interface IBaseGetUserResponse extends IBaseUserData {
56
62
  phoneNumber?: string;
57
63
  provider?: string;
58
64
  tenantId: string;
59
- tenantIds?: string[];
65
+ tenantIds: string[];
60
66
  activatedForTenant?: boolean;
61
67
  isLocked?: boolean;
62
68
  tenants: IUserTenantData[];
@@ -67,10 +73,16 @@ export interface IBaseGetUserResponse extends IBaseUserData {
67
73
  createdAt?: Date;
68
74
  lastLogin?: Date;
69
75
  subAccountAccessAllowed?: boolean;
76
+ entitlements?: UserEntitlementsResponse;
70
77
  }
71
- export declare type IGetUsersV2Response = IUserDTO;
72
- export interface IUserDTO extends IBaseGetUserResponse {
78
+ export declare type IUserProfile = IGetUsersV2Response;
79
+ export interface IGetUsersV2Response extends IBaseGetUserResponse {
73
80
  roles: IRole[];
81
+ /**
82
+ * @deprecated
83
+ * use roles instead
84
+ */
85
+ rolesIds?: string[];
74
86
  permissions: ITeamUserPermission[];
75
87
  groups?: Pick<IGroupResponse, 'id' | 'roles'>[];
76
88
  }