@frontegg/rest-api 3.0.74 → 3.0.75
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/interfaces.d.ts +2 -1
- package/auth/interfaces.js +1 -0
- package/constants.d.ts +12 -0
- package/constants.js +12 -0
- package/groups/index.d.ts +45 -0
- package/groups/index.js +44 -0
- package/groups/interfaces.d.ts +59 -0
- package/groups/interfaces.js +1 -0
- package/groups/package.json +6 -0
- package/index.js +1 -1
- package/node/auth/interfaces.js +1 -0
- package/node/constants.js +12 -0
- package/node/groups/index.js +76 -0
- package/node/groups/interfaces.js +5 -0
- package/node/index.js +1 -1
- package/package.json +1 -1
package/auth/interfaces.d.ts
CHANGED
|
@@ -482,7 +482,8 @@ export interface IVerifyNewWebAuthnDevice {
|
|
|
482
482
|
export declare enum SecondaryAuthStrategy {
|
|
483
483
|
WebAuthnPlatform = "WebAuthnPlatform",
|
|
484
484
|
WebAuthnCrossPlatform = "WebAuthnCrossPlatform",
|
|
485
|
-
SmsCode = "SmsCode"
|
|
485
|
+
SmsCode = "SmsCode",
|
|
486
|
+
Passkeys = "Passkeys"
|
|
486
487
|
}
|
|
487
488
|
export interface IAuthStrategyConfig {
|
|
488
489
|
strategy: SecondaryAuthStrategy;
|
package/auth/interfaces.js
CHANGED
|
@@ -5,6 +5,7 @@ export let SecondaryAuthStrategy;
|
|
|
5
5
|
SecondaryAuthStrategy["WebAuthnPlatform"] = "WebAuthnPlatform";
|
|
6
6
|
SecondaryAuthStrategy["WebAuthnCrossPlatform"] = "WebAuthnCrossPlatform";
|
|
7
7
|
SecondaryAuthStrategy["SmsCode"] = "SmsCode";
|
|
8
|
+
SecondaryAuthStrategy["Passkeys"] = "Passkeys";
|
|
8
9
|
})(SecondaryAuthStrategy || (SecondaryAuthStrategy = {}));
|
|
9
10
|
|
|
10
11
|
export let WebAuthnDeviceType;
|
package/constants.d.ts
CHANGED
package/constants.js
CHANGED
|
@@ -78,6 +78,18 @@ export const urls = {
|
|
|
78
78
|
},
|
|
79
79
|
impersonate: {
|
|
80
80
|
v1: '/identity/resources/impersonation/v1'
|
|
81
|
+
},
|
|
82
|
+
groups: {
|
|
83
|
+
configurations: {
|
|
84
|
+
v1: '/identity/resources/groups/v1/config'
|
|
85
|
+
},
|
|
86
|
+
v1: '/identity/resources/groups/v1',
|
|
87
|
+
roles: {
|
|
88
|
+
v1: '/identity/resources/groups/v1/roles'
|
|
89
|
+
},
|
|
90
|
+
users: {
|
|
91
|
+
v1: '/identity/resources/groups/v1/users'
|
|
92
|
+
}
|
|
81
93
|
}
|
|
82
94
|
},
|
|
83
95
|
team: {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ICreateGroup, ICreateGroupResponse, IGetGroup, IGroupConfigResponse, IGroupResponse, IUpdateGroup, IUpdateGroupConfig, IUpdateGroupRoles, IUpdateGroupUsers } from "./interfaces";
|
|
2
|
+
/**
|
|
3
|
+
* Get group by given id
|
|
4
|
+
*/
|
|
5
|
+
export declare function getGroupById({ groupId, }: IGetGroup): Promise<IGroupResponse>;
|
|
6
|
+
/**
|
|
7
|
+
* Get all tenant groups
|
|
8
|
+
*/
|
|
9
|
+
export declare function getGroups(): Promise<IGroupResponse[]>;
|
|
10
|
+
/**
|
|
11
|
+
* Create new group
|
|
12
|
+
*/
|
|
13
|
+
export declare function createGroup(body: ICreateGroup): Promise<ICreateGroupResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* Update existing group by Id
|
|
16
|
+
*/
|
|
17
|
+
export declare function updateGroup({ groupId, ...body }: IUpdateGroup): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Delete existing group by Id
|
|
20
|
+
*/
|
|
21
|
+
export declare function deleteGroup(groupId: string): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Add roles to existing group
|
|
24
|
+
*/
|
|
25
|
+
export declare function addRolesToGroup(body: IUpdateGroupRoles): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Delete roles from existing group
|
|
28
|
+
*/
|
|
29
|
+
export declare function deleteRolesFromGroup(body: IUpdateGroupRoles): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Add users to existing group
|
|
32
|
+
*/
|
|
33
|
+
export declare function addUsersToGroup(body: IUpdateGroupUsers): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Delete users from existing group
|
|
36
|
+
*/
|
|
37
|
+
export declare function deleteUsersFromGroup(body: IUpdateGroupUsers): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Get or create default groups configuration
|
|
40
|
+
*/
|
|
41
|
+
export declare function getGroupConfiguration(): Promise<IGroupConfigResponse>;
|
|
42
|
+
/**
|
|
43
|
+
* Create or update groups configuration
|
|
44
|
+
*/
|
|
45
|
+
export declare function updateGroupConfiguration(body: IUpdateGroupConfig): Promise<IGroupConfigResponse>;
|
package/groups/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
+
const _excluded = ["groupId"];
|
|
3
|
+
import { urls } from "../constants";
|
|
4
|
+
import { Delete, Get, Patch, Post } from "../fetch";
|
|
5
|
+
export async function getGroupById({
|
|
6
|
+
groupId
|
|
7
|
+
}) {
|
|
8
|
+
return Get(`${urls.identity.groups.v1}/${groupId}`);
|
|
9
|
+
}
|
|
10
|
+
export async function getGroups() {
|
|
11
|
+
return Get(`${urls.identity.groups.v1}`);
|
|
12
|
+
}
|
|
13
|
+
export async function createGroup(body) {
|
|
14
|
+
return Post(`${urls.identity.groups.v1}`, body);
|
|
15
|
+
}
|
|
16
|
+
export async function updateGroup(_ref) {
|
|
17
|
+
let {
|
|
18
|
+
groupId
|
|
19
|
+
} = _ref,
|
|
20
|
+
body = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
21
|
+
|
|
22
|
+
return Patch(`${urls.identity.groups.v1}/${groupId}`, body);
|
|
23
|
+
}
|
|
24
|
+
export async function deleteGroup(groupId) {
|
|
25
|
+
return Delete(`${urls.identity.groups.v1}/${groupId}`);
|
|
26
|
+
}
|
|
27
|
+
export async function addRolesToGroup(body) {
|
|
28
|
+
return Post(`${urls.identity.groups.roles.v1}`, body);
|
|
29
|
+
}
|
|
30
|
+
export async function deleteRolesFromGroup(body) {
|
|
31
|
+
return Delete(`${urls.identity.groups.roles.v1}`, body);
|
|
32
|
+
}
|
|
33
|
+
export async function addUsersToGroup(body) {
|
|
34
|
+
return Post(`${urls.identity.groups.users.v1}`, body);
|
|
35
|
+
}
|
|
36
|
+
export async function deleteUsersFromGroup(body) {
|
|
37
|
+
return Delete(`${urls.identity.groups.users.v1}`, body);
|
|
38
|
+
}
|
|
39
|
+
export async function getGroupConfiguration() {
|
|
40
|
+
return Get(`${urls.identity.groups.configurations.v1}`);
|
|
41
|
+
}
|
|
42
|
+
export async function updateGroupConfiguration(body) {
|
|
43
|
+
return Post(`${urls.identity.groups.configurations.v1}`, body);
|
|
44
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { IRole } from "../roles/interfaces";
|
|
2
|
+
export declare type IGetGroup = {
|
|
3
|
+
groupId: string;
|
|
4
|
+
};
|
|
5
|
+
export declare type IGroupUser = {
|
|
6
|
+
id: string;
|
|
7
|
+
email: string;
|
|
8
|
+
name: string;
|
|
9
|
+
phoneNumber?: string;
|
|
10
|
+
profileImage?: string;
|
|
11
|
+
profilePictureUrl: string | null;
|
|
12
|
+
tenantId: string;
|
|
13
|
+
tenantIds: string[];
|
|
14
|
+
activatedForTenant?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare type IGroupResponse = {
|
|
17
|
+
name: string;
|
|
18
|
+
color?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
metadata?: string;
|
|
21
|
+
roles?: IRole[];
|
|
22
|
+
users?: IGroupUser[];
|
|
23
|
+
};
|
|
24
|
+
export declare type ICreateGroup = {
|
|
25
|
+
name: string;
|
|
26
|
+
color?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
metadata?: string;
|
|
29
|
+
};
|
|
30
|
+
export declare type ICreateGroupResponse = {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
color?: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
metadata?: string;
|
|
36
|
+
};
|
|
37
|
+
export declare type IUpdateGroup = {
|
|
38
|
+
groupId: string;
|
|
39
|
+
name?: string;
|
|
40
|
+
color?: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
metadata?: string;
|
|
43
|
+
};
|
|
44
|
+
export declare type IUpdateGroupConfig = {
|
|
45
|
+
enabled?: boolean;
|
|
46
|
+
rolesEnabled?: boolean;
|
|
47
|
+
};
|
|
48
|
+
export declare type IGroupConfigResponse = {
|
|
49
|
+
enabled: boolean;
|
|
50
|
+
rolesEnabled: boolean;
|
|
51
|
+
};
|
|
52
|
+
export declare type IUpdateGroupRoles = {
|
|
53
|
+
groupId: string;
|
|
54
|
+
roleIds: string[];
|
|
55
|
+
};
|
|
56
|
+
export declare type IUpdateGroupUsers = {
|
|
57
|
+
groupId: string;
|
|
58
|
+
userIds: string[];
|
|
59
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/index.js
CHANGED
package/node/auth/interfaces.js
CHANGED
|
@@ -30,6 +30,7 @@ exports.SecondaryAuthStrategy = SecondaryAuthStrategy;
|
|
|
30
30
|
SecondaryAuthStrategy["WebAuthnPlatform"] = "WebAuthnPlatform";
|
|
31
31
|
SecondaryAuthStrategy["WebAuthnCrossPlatform"] = "WebAuthnCrossPlatform";
|
|
32
32
|
SecondaryAuthStrategy["SmsCode"] = "SmsCode";
|
|
33
|
+
SecondaryAuthStrategy["Passkeys"] = "Passkeys";
|
|
33
34
|
})(SecondaryAuthStrategy || (exports.SecondaryAuthStrategy = SecondaryAuthStrategy = {}));
|
|
34
35
|
|
|
35
36
|
let WebAuthnDeviceType;
|
package/node/constants.js
CHANGED
|
@@ -84,6 +84,18 @@ const urls = {
|
|
|
84
84
|
},
|
|
85
85
|
impersonate: {
|
|
86
86
|
v1: '/identity/resources/impersonation/v1'
|
|
87
|
+
},
|
|
88
|
+
groups: {
|
|
89
|
+
configurations: {
|
|
90
|
+
v1: '/identity/resources/groups/v1/config'
|
|
91
|
+
},
|
|
92
|
+
v1: '/identity/resources/groups/v1',
|
|
93
|
+
roles: {
|
|
94
|
+
v1: '/identity/resources/groups/v1/roles'
|
|
95
|
+
},
|
|
96
|
+
users: {
|
|
97
|
+
v1: '/identity/resources/groups/v1/users'
|
|
98
|
+
}
|
|
87
99
|
}
|
|
88
100
|
},
|
|
89
101
|
team: {
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.addRolesToGroup = addRolesToGroup;
|
|
9
|
+
exports.addUsersToGroup = addUsersToGroup;
|
|
10
|
+
exports.createGroup = createGroup;
|
|
11
|
+
exports.deleteGroup = deleteGroup;
|
|
12
|
+
exports.deleteRolesFromGroup = deleteRolesFromGroup;
|
|
13
|
+
exports.deleteUsersFromGroup = deleteUsersFromGroup;
|
|
14
|
+
exports.getGroupById = getGroupById;
|
|
15
|
+
exports.getGroupConfiguration = getGroupConfiguration;
|
|
16
|
+
exports.getGroups = getGroups;
|
|
17
|
+
exports.updateGroup = updateGroup;
|
|
18
|
+
exports.updateGroupConfiguration = updateGroupConfiguration;
|
|
19
|
+
|
|
20
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
21
|
+
|
|
22
|
+
var _constants = require("../constants");
|
|
23
|
+
|
|
24
|
+
var _fetch = require("../fetch");
|
|
25
|
+
|
|
26
|
+
const _excluded = ["groupId"];
|
|
27
|
+
|
|
28
|
+
async function getGroupById({
|
|
29
|
+
groupId
|
|
30
|
+
}) {
|
|
31
|
+
return (0, _fetch.Get)(`${_constants.urls.identity.groups.v1}/${groupId}`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async function getGroups() {
|
|
35
|
+
return (0, _fetch.Get)(`${_constants.urls.identity.groups.v1}`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async function createGroup(body) {
|
|
39
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.groups.v1}`, body);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async function updateGroup(_ref) {
|
|
43
|
+
let {
|
|
44
|
+
groupId
|
|
45
|
+
} = _ref,
|
|
46
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
47
|
+
return (0, _fetch.Patch)(`${_constants.urls.identity.groups.v1}/${groupId}`, body);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function deleteGroup(groupId) {
|
|
51
|
+
return (0, _fetch.Delete)(`${_constants.urls.identity.groups.v1}/${groupId}`);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function addRolesToGroup(body) {
|
|
55
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.groups.roles.v1}`, body);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function deleteRolesFromGroup(body) {
|
|
59
|
+
return (0, _fetch.Delete)(`${_constants.urls.identity.groups.roles.v1}`, body);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function addUsersToGroup(body) {
|
|
63
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.groups.users.v1}`, body);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async function deleteUsersFromGroup(body) {
|
|
67
|
+
return (0, _fetch.Delete)(`${_constants.urls.identity.groups.users.v1}`, body);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async function getGroupConfiguration() {
|
|
71
|
+
return (0, _fetch.Get)(`${_constants.urls.identity.groups.configurations.v1}`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async function updateGroupConfiguration(body) {
|
|
75
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.groups.configurations.v1}`, body);
|
|
76
|
+
}
|
package/node/index.js
CHANGED