@frontegg/rest-api 3.1.48 → 3.1.50

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
@@ -763,5 +763,6 @@ export declare function getMeV2(): Promise<IUserProfile>;
763
763
  export declare function getMeAndEntitlements(): Promise<IUserProfile>;
764
764
  /**
765
765
  * generate step-up session
766
+ * this request returns the step up details to continue step up, or the generated login response when stepped up jwt received from the BE
766
767
  */
767
- export declare function generateStepupSession(body: GenerateStepUpRequest): Promise<GenerateStepUpResponse>;
768
+ export declare function generateStepupSession(body: GenerateStepUpRequest): Promise<GenerateStepUpResponse | ILoginResponseV3>;
package/auth/index.js CHANGED
@@ -749,5 +749,11 @@ export async function getMeAndEntitlements() {
749
749
  });
750
750
  }
751
751
  export async function generateStepupSession(body) {
752
- return Post(`${urls.identity.auth.v1}/user/step-up/generate`, body);
752
+ const data = await Post(`${urls.identity.auth.v1}/user/step-up/generate`, body);
753
+
754
+ if (!data.accessToken) {
755
+ return data;
756
+ }
757
+
758
+ return generateLoginResponseV3(data);
753
759
  }
@@ -48,6 +48,9 @@ export declare type ILoginResponse = IUserProfile & {
48
48
  mfaDevices?: UserMFADevicesResponse;
49
49
  isBreachedPassword?: boolean;
50
50
  entitlements?: UserEntitlementsResponse | UserEntitlementsResponseV2;
51
+ amr?: string[];
52
+ acr?: string;
53
+ auth_time?: number;
51
54
  };
52
55
  export declare type ILoginResponseV2 = {
53
56
  user: ILoginResponse;
package/constants.d.ts CHANGED
@@ -52,6 +52,12 @@ export declare const urls: {
52
52
  authorization: {
53
53
  v1: string;
54
54
  };
55
+ temporary: {
56
+ v1: string;
57
+ configuration: {
58
+ v1: string;
59
+ };
60
+ };
55
61
  };
56
62
  configurations: {
57
63
  v1: string;
package/constants.js CHANGED
@@ -51,6 +51,12 @@ export const urls = {
51
51
  },
52
52
  authorization: {
53
53
  v1: '/identity/resources/users/v1/me/authorization'
54
+ },
55
+ temporary: {
56
+ v1: '/identity/users/temporary/v1',
57
+ configuration: {
58
+ v1: '/identity/users/temporary/v1/configuration'
59
+ }
54
60
  }
55
61
  },
56
62
  configurations: {
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.1.48
1
+ /** @license Frontegg v3.1.50
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.
@@ -1269,5 +1269,11 @@ async function getMeAndEntitlements() {
1269
1269
  }
1270
1270
 
1271
1271
  async function generateStepupSession(body) {
1272
- return (0, _fetch.Post)(`${_constants.urls.identity.auth.v1}/user/step-up/generate`, body);
1272
+ const data = await (0, _fetch.Post)(`${_constants.urls.identity.auth.v1}/user/step-up/generate`, body);
1273
+
1274
+ if (!data.accessToken) {
1275
+ return data;
1276
+ }
1277
+
1278
+ return generateLoginResponseV3(data);
1273
1279
  }
package/node/constants.js CHANGED
@@ -57,6 +57,12 @@ const urls = {
57
57
  },
58
58
  authorization: {
59
59
  v1: '/identity/resources/users/v1/me/authorization'
60
+ },
61
+ temporary: {
62
+ v1: '/identity/users/temporary/v1',
63
+ configuration: {
64
+ v1: '/identity/users/temporary/v1/configuration'
65
+ }
60
66
  }
61
67
  },
62
68
  configurations: {
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.1.48
1
+ /** @license Frontegg v3.1.50
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.
@@ -13,6 +13,7 @@ exports.deleteUser = deleteUser;
13
13
  exports.getInviteLinkConfiguration = getInviteLinkConfiguration;
14
14
  exports.getInviteUserLink = getInviteUserLink;
15
15
  exports.getProfile = getProfile;
16
+ exports.getTemporaryUserConfiguration = getTemporaryUserConfiguration;
16
17
  exports.loadAvailablePermissions = loadAvailablePermissions;
17
18
  exports.loadAvailableRoles = loadAvailableRoles;
18
19
  exports.loadStats = loadStats;
@@ -24,6 +25,7 @@ exports.updateInviteUserLink = updateInviteUserLink;
24
25
  exports.updateProfile = updateProfile;
25
26
  exports.updateProfileImage = updateProfileImage;
26
27
  exports.updateUser = updateUser;
28
+ exports.updateUserExpirationTime = updateUserExpirationTime;
27
29
 
28
30
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
29
31
 
@@ -82,6 +84,20 @@ async function updateUser(body) {
82
84
  return (0, _fetch.Put)(_constants.urls.team.members.v1, body);
83
85
  }
84
86
 
87
+ async function updateUserExpirationTime(body) {
88
+ const {
89
+ userId,
90
+ expirationInSeconds
91
+ } = body;
92
+ return (0, _fetch.Put)(`${_constants.urls.identity.users.temporary.v1}/${userId}`, {
93
+ expirationInSeconds
94
+ });
95
+ }
96
+
97
+ async function getTemporaryUserConfiguration() {
98
+ return (0, _fetch.Get)(_constants.urls.identity.users.temporary.configuration.v1);
99
+ }
100
+
85
101
  async function createInviteUserLink(body) {
86
102
  return (0, _fetch.Post)(_constants.urls.identity.tenants.invites.user.v1, (0, _extends2.default)({}, body));
87
103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
- "version": "3.1.48",
3
+ "version": "3.1.50",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
package/teams/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IAddUser, IChangePassword, ILoadUsers, IResendActivationLink, ITeamUserRole, ITeamStats, ITeamUser, IUpdateProfile, IUpdateUser, IDeleteUser, ITeamUserPermission, IResendInvitationLink, IInviteUserLinkResponse, ICreateOrUpdateInviteUserLink, IInviteLinkConfiguration } from './interfaces';
1
+ import { IAddUser, IChangePassword, ILoadUsers, IResendActivationLink, ITeamUserRole, ITeamStats, ITeamUser, IUpdateProfile, IUpdateUser, IDeleteUser, ITeamUserPermission, IResendInvitationLink, IInviteUserLinkResponse, ICreateOrUpdateInviteUserLink, IInviteLinkConfiguration, IUpdateUserExpiration, ITemporaryUserConfiguration } from './interfaces';
2
2
  import { PaginationResult } from '../interfaces';
3
3
  import { IUserProfile } from "../users/interfaces";
4
4
  /****************************************s*
@@ -57,6 +57,16 @@ export declare function deleteUser(body: IDeleteUser): Promise<ITeamUser>;
57
57
  * ``authorized user``
58
58
  */
59
59
  export declare function updateUser(body: IUpdateUser): Promise<ITeamUser>;
60
+ /**
61
+ * update user expiration time
62
+ *
63
+ * ``authorized user``
64
+ */
65
+ export declare function updateUserExpirationTime(body: IUpdateUserExpiration): Promise<void>;
66
+ /**
67
+ * get temporary user configuration
68
+ */
69
+ export declare function getTemporaryUserConfiguration(): Promise<ITemporaryUserConfiguration>;
60
70
  /**
61
71
  * create link to invite user
62
72
  *
package/teams/index.js CHANGED
@@ -44,6 +44,18 @@ export async function deleteUser(body) {
44
44
  export async function updateUser(body) {
45
45
  return Put(urls.team.members.v1, body);
46
46
  }
47
+ export async function updateUserExpirationTime(body) {
48
+ const {
49
+ userId,
50
+ expirationInSeconds
51
+ } = body;
52
+ return Put(`${urls.identity.users.temporary.v1}/${userId}`, {
53
+ expirationInSeconds
54
+ });
55
+ }
56
+ export async function getTemporaryUserConfiguration() {
57
+ return Get(urls.identity.users.temporary.configuration.v1);
58
+ }
47
59
  export async function createInviteUserLink(body) {
48
60
  return Post(urls.identity.tenants.invites.user.v1, _extends({}, body));
49
61
  }
@@ -27,6 +27,7 @@ export declare type ITeamUser = {
27
27
  tenants?: ITeamUserTenant;
28
28
  verified?: boolean;
29
29
  managedBy?: UserManagedByEnum;
30
+ expirationInSeconds?: number;
30
31
  };
31
32
  export declare type ITeamUserRole = {
32
33
  id: string;
@@ -84,6 +85,7 @@ export declare type IAddUser = {
84
85
  email: string;
85
86
  phone?: string;
86
87
  roleIds: string[];
88
+ expirationInSeconds?: number;
87
89
  };
88
90
  export declare type IDeleteUser = {
89
91
  userId: string;
@@ -121,3 +123,16 @@ export declare type IInviteLinkConfiguration = {
121
123
  tenantInvitationsAllowed: boolean;
122
124
  emailsEnabled: boolean;
123
125
  };
126
+ /**
127
+ * user expiration config
128
+ */
129
+ export declare type IUpdateUserExpiration = {
130
+ userId: string;
131
+ expirationInSeconds: number;
132
+ };
133
+ /**
134
+ * vendor config
135
+ */
136
+ export declare type ITemporaryUserConfiguration = {
137
+ enabled: boolean;
138
+ };