@frontegg/rest-api 7.105.0-alpha.0 → 7.105.0-alpha.2

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
@@ -882,6 +882,14 @@ export declare class AuthenticationApi extends BaseApiClient {
882
882
  testCurrentIp: () => Promise<import("./interfaces").IPValidResponse>;
883
883
  /** @deprecated use api.auth.securityPolicy.testCurrentIpInAllowList() or api.securityPolicy.testCurrentIpInAllowList() instead */
884
884
  testCurrentIpInAllowList: () => Promise<import("./interfaces").IPValidResponse>;
885
+ /** @deprecated use api.auth.securityPolicy.getCountryRestrictionsConfig() or api.securityPolicy.getCountryRestrictionsConfig() instead */
886
+ getCountryRestrictionsConfig: () => Promise<import("./interfaces").CountryRestrictionConfig>;
887
+ /** @deprecated use api.auth.securityPolicy.updateCountryRestrictionsConfig() or api.securityPolicy.updateCountryRestrictionsConfig() instead */
888
+ updateCountryRestrictionsConfig: (body: import("./interfaces").UpdateCountryRestrictionConfig) => Promise<void>;
889
+ /** @deprecated use api.auth.securityPolicy.getCountryRestrictions() or api.securityPolicy.getCountryRestrictions() instead */
890
+ getCountryRestrictions: () => Promise<import("./interfaces").CountryRestrictionRule[]>;
891
+ /** @deprecated use api.auth.securityPolicy.updateCountryRestrictions() or api.securityPolicy.updateCountryRestrictions() instead */
892
+ updateCountryRestrictions: (body: import("./interfaces").UpdateCountryRestrictionRules) => Promise<void>;
885
893
  }
886
894
  declare const _default: AuthenticationApi;
887
895
  export default _default;
package/auth/index.js CHANGED
@@ -808,6 +808,10 @@ export class AuthenticationApi extends BaseApiClient {
808
808
  this.deleteIPRestriction = this.securityPolicy.deleteIPRestriction.bind(this.securityPolicy);
809
809
  this.testCurrentIp = this.securityPolicy.testCurrentIp.bind(this.securityPolicy);
810
810
  this.testCurrentIpInAllowList = this.securityPolicy.testCurrentIpInAllowList.bind(this.securityPolicy);
811
+ this.getCountryRestrictionsConfig = this.securityPolicy.getCountryRestrictionsConfig.bind(this.securityPolicy);
812
+ this.updateCountryRestrictionsConfig = this.securityPolicy.updateCountryRestrictionsConfig.bind(this.securityPolicy);
813
+ this.getCountryRestrictions = this.securityPolicy.getCountryRestrictions.bind(this.securityPolicy);
814
+ this.updateCountryRestrictions = this.securityPolicy.updateCountryRestrictions.bind(this.securityPolicy);
811
815
  }
812
816
  /**
813
817
  * @returns true if entitlements load should be done
@@ -1,6 +1,6 @@
1
1
  import { BaseApiClient } from '../../BaseApiClient';
2
2
  import { FronteggPaginationResult } from '../../interfaces';
3
- import { BulkCreateIpRestriction, CreateDomainRestriction, CreateIpRestriction, DomainRestriction, DomainRestrictionConfig, GetIPRestrictionsParams, IpRestriction, IPRestrictionsConfig, IPValidResponse, ISaveSecurityPolicyLockout, ISaveSecurityPolicyMfa, ISaveSecurityPolicyPasswordHistory, ISecurityPolicy, ISecurityPolicyCaptcha, ISecurityPolicyLockout, ISecurityPolicyMfa, ISecurityPolicyPasswordConfig, ISecurityPolicyPasswordHistory, ISecurityPolicyPasswordRotationConfig, UpdateDomainRestrictionsConfig } from './interfaces';
3
+ import { BulkCreateIpRestriction, CountryRestrictionConfig, CountryRestrictionRule, CreateDomainRestriction, CreateIpRestriction, DomainRestriction, DomainRestrictionConfig, GetIPRestrictionsParams, IpRestriction, IPRestrictionsConfig, IPValidResponse, ISaveSecurityPolicyLockout, ISaveSecurityPolicyMfa, ISaveSecurityPolicyPasswordHistory, ISecurityPolicy, ISecurityPolicyCaptcha, ISecurityPolicyLockout, ISecurityPolicyMfa, ISecurityPolicyPasswordConfig, ISecurityPolicyPasswordHistory, ISecurityPolicyPasswordRotationConfig, UpdateDomainRestrictionsConfig, UpdateCountryRestrictionConfig, UpdateCountryRestrictionRules } from './interfaces';
4
4
  export declare class SecurityPolicyApi extends BaseApiClient {
5
5
  constructor(appName: string);
6
6
  /** Get global secure access configuration */
@@ -61,6 +61,14 @@ export declare class SecurityPolicyApi extends BaseApiClient {
61
61
  testCurrentIp: () => Promise<IPValidResponse>;
62
62
  /** Test current user IP restriction is in allow list */
63
63
  testCurrentIpInAllowList: () => Promise<IPValidResponse>;
64
+ /** Get country restrictions config for tenant */
65
+ getCountryRestrictionsConfig: () => Promise<CountryRestrictionConfig>;
66
+ /** Update country restrictions config for tenant */
67
+ updateCountryRestrictionsConfig: (body: UpdateCountryRestrictionConfig) => Promise<void>;
68
+ /** Get country restriction rules for tenant */
69
+ getCountryRestrictions: () => Promise<CountryRestrictionRule[]>;
70
+ /** Create or update country restriction rules for tenant */
71
+ updateCountryRestrictions: (body: UpdateCountryRestrictionRules) => Promise<void>;
64
72
  }
65
73
  declare const _default: SecurityPolicyApi;
66
74
  export default _default;
@@ -111,6 +111,18 @@ export class SecurityPolicyApi extends BaseApiClient {
111
111
  this.testCurrentIpInAllowList = async () => {
112
112
  return this.post(`${urls.identity.restrictions.ip.v1}/verify/allow`);
113
113
  };
114
+ this.getCountryRestrictionsConfig = async () => {
115
+ return this.get(urls.securityEngines.countryRestriction.v1);
116
+ };
117
+ this.updateCountryRestrictionsConfig = async body => {
118
+ return this.post(urls.securityEngines.countryRestriction.v1, body);
119
+ };
120
+ this.getCountryRestrictions = async () => {
121
+ return this.get(`${urls.securityEngines.countryRestriction.v1}/countries`);
122
+ };
123
+ this.updateCountryRestrictions = async body => {
124
+ return this.post(`${urls.securityEngines.countryRestriction.v1}/countries`, body);
125
+ };
114
126
  }
115
127
 
116
128
  /** Get global secure access configuration */
@@ -121,6 +121,23 @@ export interface GetIPRestrictionsParams {
121
121
  export interface IPValidResponse {
122
122
  valid: boolean;
123
123
  }
124
+ export interface CountryRestrictionConfig {
125
+ id?: string;
126
+ enabled: boolean;
127
+ action: RestrictionType;
128
+ failStrategy: RestrictionType;
129
+ shouldSendRestrictionEmail: boolean;
130
+ }
131
+ export interface CountryRestrictionRule {
132
+ id: string;
133
+ countryCode: string;
134
+ }
135
+ export type UpdateCountryRestrictionConfig = Omit<CountryRestrictionConfig, 'id'>;
136
+ export interface UpdateCountryRestrictionRules {
137
+ countries: {
138
+ countryCode: string;
139
+ }[];
140
+ }
124
141
  export interface CreateIpRestriction {
125
142
  ip: string;
126
143
  strategy?: RestrictionType;
package/constants.d.ts CHANGED
@@ -288,6 +288,11 @@ export declare const urls: {
288
288
  v1: string;
289
289
  };
290
290
  };
291
+ securityEngines: {
292
+ countryRestriction: {
293
+ v1: string;
294
+ };
295
+ };
291
296
  applications: {
292
297
  v1: string;
293
298
  tenant: {
package/constants.js CHANGED
@@ -289,6 +289,11 @@ export const urls = {
289
289
  v1: '/security-center/resources/insights/v1'
290
290
  }
291
291
  },
292
+ securityEngines: {
293
+ countryRestriction: {
294
+ v1: '/security-engines/resources/policies/v1/country-restriction'
295
+ }
296
+ },
292
297
  applications: {
293
298
  v1: '/applications/resources/applications/v1',
294
299
  tenant: {
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.105.0-alpha.0
1
+ /** @license Frontegg v7.105.0-alpha.2
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.
@@ -873,6 +873,10 @@ class AuthenticationApi extends _BaseApiClient.BaseApiClient {
873
873
  this.deleteIPRestriction = this.securityPolicy.deleteIPRestriction.bind(this.securityPolicy);
874
874
  this.testCurrentIp = this.securityPolicy.testCurrentIp.bind(this.securityPolicy);
875
875
  this.testCurrentIpInAllowList = this.securityPolicy.testCurrentIpInAllowList.bind(this.securityPolicy);
876
+ this.getCountryRestrictionsConfig = this.securityPolicy.getCountryRestrictionsConfig.bind(this.securityPolicy);
877
+ this.updateCountryRestrictionsConfig = this.securityPolicy.updateCountryRestrictionsConfig.bind(this.securityPolicy);
878
+ this.getCountryRestrictions = this.securityPolicy.getCountryRestrictions.bind(this.securityPolicy);
879
+ this.updateCountryRestrictions = this.securityPolicy.updateCountryRestrictions.bind(this.securityPolicy);
876
880
  }
877
881
  /**
878
882
  * @returns true if entitlements load should be done
@@ -117,6 +117,18 @@ class SecurityPolicyApi extends _BaseApiClient.BaseApiClient {
117
117
  this.testCurrentIpInAllowList = async () => {
118
118
  return this.post(`${_constants.urls.identity.restrictions.ip.v1}/verify/allow`);
119
119
  };
120
+ this.getCountryRestrictionsConfig = async () => {
121
+ return this.get(_constants.urls.securityEngines.countryRestriction.v1);
122
+ };
123
+ this.updateCountryRestrictionsConfig = async body => {
124
+ return this.post(_constants.urls.securityEngines.countryRestriction.v1, body);
125
+ };
126
+ this.getCountryRestrictions = async () => {
127
+ return this.get(`${_constants.urls.securityEngines.countryRestriction.v1}/countries`);
128
+ };
129
+ this.updateCountryRestrictions = async body => {
130
+ return this.post(`${_constants.urls.securityEngines.countryRestriction.v1}/countries`, body);
131
+ };
120
132
  }
121
133
 
122
134
  /** Get global secure access configuration */
package/node/constants.js CHANGED
@@ -295,6 +295,11 @@ const urls = {
295
295
  v1: '/security-center/resources/insights/v1'
296
296
  }
297
297
  },
298
+ securityEngines: {
299
+ countryRestriction: {
300
+ v1: '/security-engines/resources/policies/v1/country-restriction'
301
+ }
302
+ },
298
303
  applications: {
299
304
  v1: '/applications/resources/applications/v1',
300
305
  tenant: {
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.105.0-alpha.0
1
+ /** @license Frontegg v7.105.0-alpha.2
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": "7.105.0-alpha.0",
3
+ "version": "7.105.0-alpha.2",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "author": "Frontegg LTD",