@frontegg/rest-api 3.0.21 → 3.0.24

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,4 +1,4 @@
1
- import { ISaveSecurityPolicyMfa, ISaveSecurityPolicyLockout, ISecurityPolicyMfa, ISecurityPolicyLockout, ISecurityPolicyCaptcha, ISecurityPolicyPasswordHistory, ISaveSecurityPolicyPasswordHistory, ISecurityPolicyPasswordConfig, ISecurityPolicy, DomainRestriction, DomainRestrictionConfig, CreateDomainRestriction, UpdateDomainRestrictionsConfig, IpRestriction, IPRestrictionsConfig, BulkCreateIpRestriction, CreateIpRestriction, GetIPRestrictionsParams } from './interfaces';
1
+ import { ISaveSecurityPolicyMfa, ISaveSecurityPolicyLockout, ISecurityPolicyMfa, ISecurityPolicyLockout, ISecurityPolicyCaptcha, ISecurityPolicyPasswordHistory, ISaveSecurityPolicyPasswordHistory, ISecurityPolicyPasswordConfig, ISecurityPolicy, DomainRestriction, DomainRestrictionConfig, CreateDomainRestriction, UpdateDomainRestrictionsConfig, IpRestriction, IPRestrictionsConfig, BulkCreateIpRestriction, CreateIpRestriction, GetIPRestrictionsParams, IPValidResponse } from './interfaces';
2
2
  import { FronteggPaginationResult } from '../../interfaces';
3
3
  /**
4
4
  * Get global secure access configuration
@@ -86,3 +86,7 @@ export declare function updateIPRestrictionConfig(body: IPRestrictionsConfig): P
86
86
  * Delete ip restriction for tenant by id
87
87
  */
88
88
  export declare function deleteIPRestriction(id: string): Promise<void>;
89
+ /**
90
+ * Test current user ip restriction
91
+ */
92
+ export declare function testCurrentIp(): Promise<IPValidResponse>;
@@ -78,4 +78,7 @@ export async function updateIPRestrictionConfig(body) {
78
78
  }
79
79
  export async function deleteIPRestriction(id) {
80
80
  return Delete(`${urls.identity.restrictions.ip.v1}/${id}`);
81
+ }
82
+ export async function testCurrentIp() {
83
+ return Post(`${urls.identity.restrictions.ip.v1}/verify`);
81
84
  }
@@ -98,7 +98,10 @@ export interface IPRestrictionsConfig {
98
98
  export interface GetIPRestrictionsParams {
99
99
  _offset: number;
100
100
  _limit: number;
101
- _filter: RestrictionType;
101
+ _filter: string;
102
+ }
103
+ export interface IPValidResponse {
104
+ valid: boolean;
102
105
  }
103
106
  export interface CreateIpRestriction {
104
107
  ip: string;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.21
1
+ /** @license Frontegg v3.0.24
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.
@@ -1,4 +1,5 @@
1
1
  import { IAuditsMetadata, IMetadataIp, INotificationMetadata, ISamlMetadata } from './interfaces';
2
+ export declare function getCurrentUserIpMetadata(): Promise<IMetadataIp>;
2
3
  export declare const getNotificationsMetadata: () => Promise<INotificationMetadata>;
3
4
  export declare const getSamlMetadata: () => Promise<ISamlMetadata>;
4
5
  export declare const getAuditsMetadata: () => Promise<IAuditsMetadata>;
package/metadata/index.js CHANGED
@@ -14,6 +14,11 @@ async function getIpMetadata(ip) {
14
14
  throw new Error(`ip metadata not found`);
15
15
  }
16
16
 
17
+ export async function getCurrentUserIpMetadata() {
18
+ const data = await Get(`/metadata/ipme`);
19
+ if (data) return data;
20
+ throw new Error(`ip metadata not found`);
21
+ }
17
22
  export const getNotificationsMetadata = async () => getMetadata({
18
23
  entityName: 'notifications'
19
24
  });
@@ -34,6 +34,7 @@ export interface IAuditsMetadata extends IBaseMetadata {
34
34
  export interface IMetadataIp {
35
35
  latitude: number;
36
36
  longitude: number;
37
+ ip: string;
37
38
  city: string | null;
38
39
  country_name: string | null;
39
40
  country_code: string | null;
@@ -22,6 +22,7 @@ exports.getVendorMfaPolicy = getVendorMfaPolicy;
22
22
  exports.saveLockoutPolicy = saveLockoutPolicy;
23
23
  exports.saveMfaPolicy = saveMfaPolicy;
24
24
  exports.savePasswordHistoryPolicy = savePasswordHistoryPolicy;
25
+ exports.testCurrentIp = testCurrentIp;
25
26
  exports.updateDomainRestrictionConfig = updateDomainRestrictionConfig;
26
27
  exports.updateIPRestrictionConfig = updateIPRestrictionConfig;
27
28
 
@@ -127,4 +128,8 @@ async function updateIPRestrictionConfig(body) {
127
128
 
128
129
  async function deleteIPRestriction(id) {
129
130
  return (0, _fetch.Delete)(`${_constants.urls.identity.restrictions.ip.v1}/${id}`);
131
+ }
132
+
133
+ async function testCurrentIp() {
134
+ return (0, _fetch.Post)(`${_constants.urls.identity.restrictions.ip.v1}/verify`);
130
135
  }
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.21
1
+ /** @license Frontegg v3.0.24
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.
@@ -3,7 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getSamlMetadata = exports.getNotificationsMetadata = exports.getIpAdressMetadata = exports.getAuditsMetadata = void 0;
6
+ exports.getAuditsMetadata = void 0;
7
+ exports.getCurrentUserIpMetadata = getCurrentUserIpMetadata;
8
+ exports.getSamlMetadata = exports.getNotificationsMetadata = exports.getIpAdressMetadata = void 0;
7
9
 
8
10
  var _fetch = require("../fetch");
9
11
 
@@ -21,6 +23,12 @@ async function getIpMetadata(ip) {
21
23
  throw new Error(`ip metadata not found`);
22
24
  }
23
25
 
26
+ async function getCurrentUserIpMetadata() {
27
+ const data = await (0, _fetch.Get)(`/metadata/ipme`);
28
+ if (data) return data;
29
+ throw new Error(`ip metadata not found`);
30
+ }
31
+
24
32
  const getNotificationsMetadata = async () => getMetadata({
25
33
  entityName: 'notifications'
26
34
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
- "version": "3.0.21",
3
+ "version": "3.0.24",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {