@frontegg/rest-api 3.0.5 → 3.0.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.
package/auth/index.d.ts CHANGED
@@ -247,6 +247,10 @@ export declare function getCurrentUserSessions(): Promise<ISessionResponse[]>;
247
247
  * Get current user session
248
248
  */
249
249
  export declare function getCurrentUserSession(): Promise<ISessionResponse>;
250
+ /**
251
+ * Revoke sessions for user
252
+ */
253
+ export declare function revokeSessionsForUser(userId: string): Promise<void>;
250
254
  /**
251
255
  * Get session configurations
252
256
  */
package/auth/index.js CHANGED
@@ -249,6 +249,11 @@ export async function getCurrentUserSessions() {
249
249
  export async function getCurrentUserSession() {
250
250
  return Get(`${urls.identity.users.sessions.currentUser.v1}/current`);
251
251
  }
252
+ export async function revokeSessionsForUser(userId) {
253
+ return Post(`${urls.identity.users.sessions.v1}/revoke`, {
254
+ userId
255
+ });
256
+ }
252
257
  export async function getSessionConfigurations() {
253
258
  return Get(urls.identity.users.sessions.configurations.v1);
254
259
  }
package/constants.d.ts CHANGED
@@ -15,6 +15,7 @@ export declare const urls: {
15
15
  v1: string;
16
16
  };
17
17
  sessions: {
18
+ v1: string;
18
19
  currentUser: {
19
20
  v1: string;
20
21
  };
package/constants.js CHANGED
@@ -15,6 +15,7 @@ export const urls = {
15
15
  v1: '/identity/resources/users/api-tokens/v1'
16
16
  },
17
17
  sessions: {
18
+ v1: '/identity/resources/users/sessions/v1',
18
19
  currentUser: {
19
20
  v1: '/identity/resources/users/sessions/v1/me'
20
21
  },
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.5
1
+ /** @license Frontegg v3.0.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.
@@ -49,6 +49,7 @@ var _exportNames = {
49
49
  signUpUser: true,
50
50
  getCurrentUserSessions: true,
51
51
  getCurrentUserSession: true,
52
+ revokeSessionsForUser: true,
52
53
  getSessionConfigurations: true,
53
54
  createOrUpdateSessionConfigrations: true,
54
55
  deleteSessionForUser: true,
@@ -158,6 +159,7 @@ exports.refreshTokenV2 = refreshTokenV2;
158
159
  exports.resendActivationEmail = resendActivationEmail;
159
160
  exports.resetPassword = resetPassword;
160
161
  exports.resetPhoneNumber = resetPhoneNumber;
162
+ exports.revokeSessionsForUser = revokeSessionsForUser;
161
163
  exports.setSSODefaultRoles = setSSODefaultRoles;
162
164
  exports.signUpUser = signUpUser;
163
165
  exports.updateSSOConfiguration = updateSSOConfiguration;
@@ -511,6 +513,12 @@ async function getCurrentUserSession() {
511
513
  return (0, _fetch.Get)(`${_constants.urls.identity.users.sessions.currentUser.v1}/current`);
512
514
  }
513
515
 
516
+ async function revokeSessionsForUser(userId) {
517
+ return (0, _fetch.Post)(`${_constants.urls.identity.users.sessions.v1}/revoke`, {
518
+ userId
519
+ });
520
+ }
521
+
514
522
  async function getSessionConfigurations() {
515
523
  return (0, _fetch.Get)(_constants.urls.identity.users.sessions.configurations.v1);
516
524
  }
package/node/constants.js CHANGED
@@ -21,6 +21,7 @@ const urls = {
21
21
  v1: '/identity/resources/users/api-tokens/v1'
22
22
  },
23
23
  sessions: {
24
+ v1: '/identity/resources/users/sessions/v1',
24
25
  currentUser: {
25
26
  v1: '/identity/resources/users/sessions/v1/me'
26
27
  },
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.5
1
+ /** @license Frontegg v3.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
- "version": "3.0.5",
3
+ "version": "3.0.6",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {