@frontegg/rest-api 3.0.10 → 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.
@@ -277,12 +277,18 @@ export interface IAllowedToRememberMfaDevice {
277
277
  isAllowedToRemember: boolean;
278
278
  mfaDeviceExpiration: number;
279
279
  }
280
- export interface IPasswordlessPreLogin {
281
- email: string;
280
+ export interface IBasePasswordlessPreLogin {
282
281
  recaptchaToken?: string;
283
282
  type: AuthStrategyEnum;
284
283
  invitationToken?: string;
285
284
  }
285
+ export interface IEmailPasswordlessPreLogin extends IBasePasswordlessPreLogin {
286
+ email: string;
287
+ }
288
+ export interface IUserIDPasswordlessPreLogin extends IBasePasswordlessPreLogin {
289
+ userId: string;
290
+ }
291
+ export declare type IPasswordlessPreLogin = IEmailPasswordlessPreLogin | IUserIDPasswordlessPreLogin;
286
292
  export interface IPasswordlessPostLogin {
287
293
  token: string;
288
294
  recaptchaToken?: string;
@@ -367,10 +373,16 @@ interface WebAuthnLoginResponse {
367
373
  signature: string;
368
374
  userHandle?: string;
369
375
  }
370
- export interface IWebAuthnPreLogin {
371
- email: string;
376
+ export interface IBaseWebAuthnPreLogin {
372
377
  recaptchaToken?: string;
373
378
  }
379
+ export interface IEmailWebAuthnPreLogin extends IBaseWebAuthnPreLogin {
380
+ email: string;
381
+ }
382
+ export interface IUserIDWebAuthnPreLogin extends IBaseWebAuthnPreLogin {
383
+ userId: string;
384
+ }
385
+ export declare type IWebAuthnPreLogin = IEmailWebAuthnPreLogin | IUserIDWebAuthnPreLogin;
374
386
  interface AllowCredentials {
375
387
  type: string;
376
388
  id: string;
@@ -1,4 +1,4 @@
1
- import { ISaveSecurityPolicyMfa, ISaveSecurityPolicyLockout, ISecurityPolicyMfa, ISecurityPolicyLockout, ISecurityPolicyCaptcha, ISecurityPolicyPasswordHistory, ISaveSecurityPolicyPasswordHistory, ISecurityPolicyPasswordConfig, ISecurityPolicy } 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
  */
@@ -39,3 +39,51 @@ export declare function savePasswordHistoryPolicy(body: ISaveSecurityPolicyPassw
39
39
  * load vendor password configuration.
40
40
  */
41
41
  export declare function getPasswordConfigPolicy(): Promise<ISecurityPolicyPasswordConfig>;
42
+ /**
43
+ * Get domain restrictions for tenant
44
+ */
45
+ export declare function getDomainRestrictions(): Promise<{
46
+ items: DomainRestriction[];
47
+ }>;
48
+ /**
49
+ * Get domain restrictions config for tenant
50
+ */
51
+ export declare function getDomainRestrictionsConfig(): Promise<DomainRestrictionConfig>;
52
+ /**
53
+ * Create domain restriction for tenant
54
+ */
55
+ export declare function createDomainRestriction(body: CreateDomainRestriction): Promise<DomainRestriction>;
56
+ /**
57
+ * Update domain restrictions config for tenant
58
+ */
59
+ export declare function updateDomainRestrictionConfig(body: UpdateDomainRestrictionsConfig): Promise<DomainRestrictionConfig>;
60
+ /**
61
+ * Delete domain restriction for tenant by id
62
+ */
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>;
@@ -1,4 +1,4 @@
1
- import { Get, Patch, Post } from '../../fetch';
1
+ import { Delete, Get, Patch, Post } from '../../fetch';
2
2
  import { urls } from '../../constants';
3
3
  export async function getGlobalSecurityPolicy() {
4
4
  return Get(urls.identity.configurations.v1);
@@ -45,4 +45,37 @@ export async function savePasswordHistoryPolicy(body) {
45
45
  }
46
46
  export async function getPasswordConfigPolicy() {
47
47
  return Get(`${urls.identity.configurations.v1}/password`);
48
+ }
49
+ export async function getDomainRestrictions() {
50
+ return Get(`${urls.identity.restrictions.emailDomain.v1}`);
51
+ }
52
+ export async function getDomainRestrictionsConfig() {
53
+ return Get(`${urls.identity.restrictions.emailDomain.v1}/config`);
54
+ }
55
+ export async function createDomainRestriction(body) {
56
+ return Post(`${urls.identity.restrictions.emailDomain.v1}`, body);
57
+ }
58
+ export async function updateDomainRestrictionConfig(body) {
59
+ return Post(`${urls.identity.restrictions.emailDomain.v1}/config`, body);
60
+ }
61
+ export async function deleteDomainRestriction(id) {
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}`);
48
81
  }
@@ -68,3 +68,48 @@ export interface TestConfig {
68
68
  minOptionalTestsToPass: number;
69
69
  }
70
70
  export declare type ISecurityPolicyPasswordConfig = Partial<TestConfig>;
71
+ export declare enum RestrictionType {
72
+ ALLOW = "ALLOW",
73
+ BLOCK = "BLOCK"
74
+ }
75
+ export interface UpdateDomainRestrictionsConfig {
76
+ active: boolean;
77
+ blockPublicDomains?: boolean;
78
+ type?: RestrictionType;
79
+ }
80
+ export interface CreateDomainRestriction {
81
+ domain: string;
82
+ type: RestrictionType;
83
+ }
84
+ export interface DomainRestriction {
85
+ id: string;
86
+ domain: string;
87
+ type: RestrictionType;
88
+ }
89
+ export interface DomainRestrictionConfig {
90
+ active: boolean;
91
+ listType: RestrictionType;
92
+ blockPublicDomains: boolean;
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
+ }
@@ -1 +1,6 @@
1
- export {};
1
+ export let RestrictionType;
2
+
3
+ (function (RestrictionType) {
4
+ RestrictionType["ALLOW"] = "ALLOW";
5
+ RestrictionType["BLOCK"] = "BLOCK";
6
+ })(RestrictionType || (RestrictionType = {}));
package/constants.d.ts CHANGED
@@ -32,6 +32,14 @@ export declare const urls: {
32
32
  configurations: {
33
33
  v1: string;
34
34
  };
35
+ restrictions: {
36
+ emailDomain: {
37
+ v1: string;
38
+ };
39
+ ip: {
40
+ v1: string;
41
+ };
42
+ };
35
43
  sso: {
36
44
  v1: string;
37
45
  v2: string;
package/constants.js CHANGED
@@ -32,6 +32,14 @@ export const urls = {
32
32
  configurations: {
33
33
  v1: '/identity/resources/configurations/v1'
34
34
  },
35
+ restrictions: {
36
+ emailDomain: {
37
+ v1: "/identity/resources/configurations/restrictions/v1/email-domain"
38
+ },
39
+ ip: {
40
+ v1: "/identity/resources/configurations/restrictions/v1/email-domain"
41
+ }
42
+ },
35
43
  sso: {
36
44
  v1: '/identity/resources/sso/v1',
37
45
  v2: '/identity/resources/sso/v2'
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.10
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,8 +3,17 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.bulkCreateIPRestriction = bulkCreateIPRestriction;
7
+ exports.createDomainRestriction = createDomainRestriction;
8
+ exports.createIPRestriction = createIPRestriction;
9
+ exports.deleteDomainRestriction = deleteDomainRestriction;
10
+ exports.deleteIPRestriction = deleteIPRestriction;
6
11
  exports.getCaptchaPolicy = getCaptchaPolicy;
12
+ exports.getDomainRestrictions = getDomainRestrictions;
13
+ exports.getDomainRestrictionsConfig = getDomainRestrictionsConfig;
7
14
  exports.getGlobalSecurityPolicy = getGlobalSecurityPolicy;
15
+ exports.getIPRestrictions = getIPRestrictions;
16
+ exports.getIPRestrictionsConfig = getIPRestrictionsConfig;
8
17
  exports.getLockoutPolicy = getLockoutPolicy;
9
18
  exports.getMfaPolicy = getMfaPolicy;
10
19
  exports.getPasswordConfigPolicy = getPasswordConfigPolicy;
@@ -13,6 +22,8 @@ exports.getVendorMfaPolicy = getVendorMfaPolicy;
13
22
  exports.saveLockoutPolicy = saveLockoutPolicy;
14
23
  exports.saveMfaPolicy = saveMfaPolicy;
15
24
  exports.savePasswordHistoryPolicy = savePasswordHistoryPolicy;
25
+ exports.updateDomainRestrictionConfig = updateDomainRestrictionConfig;
26
+ exports.updateIPRestrictionConfig = updateIPRestrictionConfig;
16
27
 
17
28
  var _fetch = require("../../fetch");
18
29
 
@@ -72,4 +83,48 @@ async function savePasswordHistoryPolicy(body) {
72
83
 
73
84
  async function getPasswordConfigPolicy() {
74
85
  return (0, _fetch.Get)(`${_constants.urls.identity.configurations.v1}/password`);
86
+ }
87
+
88
+ async function getDomainRestrictions() {
89
+ return (0, _fetch.Get)(`${_constants.urls.identity.restrictions.emailDomain.v1}`);
90
+ }
91
+
92
+ async function getDomainRestrictionsConfig() {
93
+ return (0, _fetch.Get)(`${_constants.urls.identity.restrictions.emailDomain.v1}/config`);
94
+ }
95
+
96
+ async function createDomainRestriction(body) {
97
+ return (0, _fetch.Post)(`${_constants.urls.identity.restrictions.emailDomain.v1}`, body);
98
+ }
99
+
100
+ async function updateDomainRestrictionConfig(body) {
101
+ return (0, _fetch.Post)(`${_constants.urls.identity.restrictions.emailDomain.v1}/config`, body);
102
+ }
103
+
104
+ async function deleteDomainRestriction(id) {
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}`);
75
130
  }
@@ -2,4 +2,12 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
- });
5
+ });
6
+ exports.RestrictionType = void 0;
7
+ let RestrictionType;
8
+ exports.RestrictionType = RestrictionType;
9
+
10
+ (function (RestrictionType) {
11
+ RestrictionType["ALLOW"] = "ALLOW";
12
+ RestrictionType["BLOCK"] = "BLOCK";
13
+ })(RestrictionType || (exports.RestrictionType = RestrictionType = {}));
package/node/constants.js CHANGED
@@ -38,6 +38,14 @@ const urls = {
38
38
  configurations: {
39
39
  v1: '/identity/resources/configurations/v1'
40
40
  },
41
+ restrictions: {
42
+ emailDomain: {
43
+ v1: "/identity/resources/configurations/restrictions/v1/email-domain"
44
+ },
45
+ ip: {
46
+ v1: "/identity/resources/configurations/restrictions/v1/email-domain"
47
+ }
48
+ },
41
49
  sso: {
42
50
  v1: '/identity/resources/sso/v1',
43
51
  v2: '/identity/resources/sso/v2'
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.10
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.10",
3
+ "version": "3.0.13",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {