@frontegg/rest-api 3.0.12 → 3.0.13

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 } from './interfaces';
1
+ import { ISaveSecurityPolicyMfa, ISaveSecurityPolicyLockout, ISecurityPolicyMfa, ISecurityPolicyLockout, ISecurityPolicyCaptcha, ISecurityPolicyPasswordHistory, ISaveSecurityPolicyPasswordHistory, ISecurityPolicyPasswordConfig, ISecurityPolicy, DomainRestriction, DomainRestrictionConfig, CreateDomainRestriction, UpdateDomainRestrictionsConfig, IpRestriction, IPRestrictionsConfig, BulkCreateIpRestriction, CreateIpRestriction } from './interfaces';
2
2
  /**
3
3
  * Get global secure access configuration
4
4
  */
@@ -61,3 +61,29 @@ export declare function updateDomainRestrictionConfig(body: UpdateDomainRestrict
61
61
  * Delete domain restriction for tenant by id
62
62
  */
63
63
  export declare function deleteDomainRestriction(id: string): Promise<void>;
64
+ /**
65
+ * Get ip restrictions for tenant
66
+ */
67
+ export declare function getIPRestrictions(): Promise<{
68
+ items: IpRestriction[];
69
+ }>;
70
+ /**
71
+ * Get ip restrictions config for tenant
72
+ */
73
+ export declare function getIPRestrictionsConfig(): Promise<IPRestrictionsConfig>;
74
+ /**
75
+ * Create ip restriction for tenant
76
+ */
77
+ export declare function createIPRestriction(body: CreateIpRestriction): Promise<void>;
78
+ /**
79
+ * Create bulk ip restrictions for tenant
80
+ */
81
+ export declare function bulkCreateIPRestriction(body: BulkCreateIpRestriction): Promise<void>;
82
+ /**
83
+ * Update ip restrictions config for tenant
84
+ */
85
+ export declare function updateIPRestrictionConfig(body: IPRestrictionsConfig): Promise<void>;
86
+ /**
87
+ * Delete ip restriction for tenant by id
88
+ */
89
+ export declare function deleteIPRestriction(id: string): Promise<void>;
@@ -60,4 +60,22 @@ export async function updateDomainRestrictionConfig(body) {
60
60
  }
61
61
  export async function deleteDomainRestriction(id) {
62
62
  return Delete(`${urls.identity.restrictions.emailDomain.v1}/${id}`);
63
+ }
64
+ export async function getIPRestrictions() {
65
+ return Get(`${urls.identity.restrictions.emailDomain.v1}`);
66
+ }
67
+ export async function getIPRestrictionsConfig() {
68
+ return Get(`${urls.identity.restrictions.ip.v1}/config`);
69
+ }
70
+ export async function createIPRestriction(body) {
71
+ return Post(`${urls.identity.restrictions.ip.v1}`, body);
72
+ }
73
+ export async function bulkCreateIPRestriction(body) {
74
+ return Post(`${urls.identity.restrictions.ip.v1}/bulk`, body);
75
+ }
76
+ export async function updateIPRestrictionConfig(body) {
77
+ return Post(`${urls.identity.restrictions.ip.v1}/config`, body);
78
+ }
79
+ export async function deleteIPRestriction(id) {
80
+ return Delete(`${urls.identity.restrictions.ip.v1}/${id}`);
63
81
  }
@@ -91,3 +91,25 @@ export interface DomainRestrictionConfig {
91
91
  listType: RestrictionType;
92
92
  blockPublicDomains: boolean;
93
93
  }
94
+ export interface IPRestrictionsConfig {
95
+ isActive: boolean;
96
+ strategy?: RestrictionType;
97
+ }
98
+ export interface CreateIpRestriction {
99
+ ip: string;
100
+ strategy: RestrictionType;
101
+ isActive: boolean;
102
+ description?: string;
103
+ }
104
+ export interface BulkCreateIpRestriction {
105
+ ips: CreateIpRestriction[];
106
+ }
107
+ export interface IpRestriction {
108
+ id: string;
109
+ ip: string;
110
+ strategy: RestrictionType;
111
+ isActive: boolean;
112
+ description?: string;
113
+ createdAt: Date;
114
+ updatedAt: Date;
115
+ }
package/constants.d.ts CHANGED
@@ -36,6 +36,9 @@ export declare const urls: {
36
36
  emailDomain: {
37
37
  v1: string;
38
38
  };
39
+ ip: {
40
+ v1: string;
41
+ };
39
42
  };
40
43
  sso: {
41
44
  v1: string;
package/constants.js CHANGED
@@ -35,6 +35,9 @@ export const urls = {
35
35
  restrictions: {
36
36
  emailDomain: {
37
37
  v1: "/identity/resources/configurations/restrictions/v1/email-domain"
38
+ },
39
+ ip: {
40
+ v1: "/identity/resources/configurations/restrictions/v1/email-domain"
38
41
  }
39
42
  },
40
43
  sso: {
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.12
1
+ /** @license Frontegg v3.0.13
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,12 +3,17 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.bulkCreateIPRestriction = bulkCreateIPRestriction;
6
7
  exports.createDomainRestriction = createDomainRestriction;
8
+ exports.createIPRestriction = createIPRestriction;
7
9
  exports.deleteDomainRestriction = deleteDomainRestriction;
10
+ exports.deleteIPRestriction = deleteIPRestriction;
8
11
  exports.getCaptchaPolicy = getCaptchaPolicy;
9
12
  exports.getDomainRestrictions = getDomainRestrictions;
10
13
  exports.getDomainRestrictionsConfig = getDomainRestrictionsConfig;
11
14
  exports.getGlobalSecurityPolicy = getGlobalSecurityPolicy;
15
+ exports.getIPRestrictions = getIPRestrictions;
16
+ exports.getIPRestrictionsConfig = getIPRestrictionsConfig;
12
17
  exports.getLockoutPolicy = getLockoutPolicy;
13
18
  exports.getMfaPolicy = getMfaPolicy;
14
19
  exports.getPasswordConfigPolicy = getPasswordConfigPolicy;
@@ -18,6 +23,7 @@ exports.saveLockoutPolicy = saveLockoutPolicy;
18
23
  exports.saveMfaPolicy = saveMfaPolicy;
19
24
  exports.savePasswordHistoryPolicy = savePasswordHistoryPolicy;
20
25
  exports.updateDomainRestrictionConfig = updateDomainRestrictionConfig;
26
+ exports.updateIPRestrictionConfig = updateIPRestrictionConfig;
21
27
 
22
28
  var _fetch = require("../../fetch");
23
29
 
@@ -97,4 +103,28 @@ async function updateDomainRestrictionConfig(body) {
97
103
 
98
104
  async function deleteDomainRestriction(id) {
99
105
  return (0, _fetch.Delete)(`${_constants.urls.identity.restrictions.emailDomain.v1}/${id}`);
106
+ }
107
+
108
+ async function getIPRestrictions() {
109
+ return (0, _fetch.Get)(`${_constants.urls.identity.restrictions.emailDomain.v1}`);
110
+ }
111
+
112
+ async function getIPRestrictionsConfig() {
113
+ return (0, _fetch.Get)(`${_constants.urls.identity.restrictions.ip.v1}/config`);
114
+ }
115
+
116
+ async function createIPRestriction(body) {
117
+ return (0, _fetch.Post)(`${_constants.urls.identity.restrictions.ip.v1}`, body);
118
+ }
119
+
120
+ async function bulkCreateIPRestriction(body) {
121
+ return (0, _fetch.Post)(`${_constants.urls.identity.restrictions.ip.v1}/bulk`, body);
122
+ }
123
+
124
+ async function updateIPRestrictionConfig(body) {
125
+ return (0, _fetch.Post)(`${_constants.urls.identity.restrictions.ip.v1}/config`, body);
126
+ }
127
+
128
+ async function deleteIPRestriction(id) {
129
+ return (0, _fetch.Delete)(`${_constants.urls.identity.restrictions.ip.v1}/${id}`);
100
130
  }
package/node/constants.js CHANGED
@@ -41,6 +41,9 @@ const urls = {
41
41
  restrictions: {
42
42
  emailDomain: {
43
43
  v1: "/identity/resources/configurations/restrictions/v1/email-domain"
44
+ },
45
+ ip: {
46
+ v1: "/identity/resources/configurations/restrictions/v1/email-domain"
44
47
  }
45
48
  },
46
49
  sso: {
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.12
1
+ /** @license Frontegg v3.0.13
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.12",
3
+ "version": "3.0.13",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {