@frontegg/rest-api 6.0.1-alpha.4 → 7.28.0-alpha.0
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/BaseApiClient.d.ts +16 -0
- package/BaseApiClient.js +30 -0
- package/ContextHolder/index.d.ts +160 -0
- package/ContextHolder/index.js +278 -0
- package/ContextHolder/package.json +6 -0
- package/FetchClient.d.ts +42 -0
- package/FetchClient.js +260 -0
- package/account-settings/index.d.ts +21 -7
- package/account-settings/index.js +25 -6
- package/account-settings/interfaces.d.ts +9 -2
- package/applications/index.d.ts +51 -0
- package/applications/index.js +55 -0
- package/applications/interfaces.d.ts +49 -0
- package/applications/interfaces.js +5 -0
- package/applications/package.json +6 -0
- package/audits/index.d.ts +27 -15
- package/audits/index.js +29 -16
- package/audits/interfaces.d.ts +3 -2
- package/auth/constants.d.ts +5 -0
- package/auth/constants.js +5 -0
- package/auth/enums.d.ts +8 -1
- package/auth/enums.js +9 -4
- package/auth/index.d.ts +833 -428
- package/auth/index.js +768 -385
- package/auth/interfaces.d.ts +341 -39
- package/auth/interfaces.js +19 -9
- package/auth/secutiry-poilicy/index.d.ts +60 -41
- package/auth/secutiry-poilicy/index.js +99 -45
- package/auth/secutiry-poilicy/interfaces.d.ts +62 -2
- package/auth/secutiry-poilicy/interfaces.js +5 -1
- package/auth/utils.d.ts +10 -0
- package/auth/utils.js +35 -0
- package/connectivity/index.d.ts +126 -27
- package/connectivity/index.js +120 -114
- package/constants.d.ts +115 -0
- package/constants.js +122 -5
- package/directory/index.d.ts +32 -0
- package/directory/index.js +30 -0
- package/directory/interfaces.d.ts +30 -0
- package/directory/interfaces.js +7 -0
- package/directory/package.json +6 -0
- package/entitlements/index.d.ts +15 -0
- package/entitlements/index.js +20 -0
- package/entitlements/interfaces.d.ts +13 -0
- package/entitlements/interfaces.js +11 -0
- package/entitlements/package.json +6 -0
- package/error.js +0 -2
- package/feature-flags/index.d.ts +18 -0
- package/feature-flags/index.js +44 -0
- package/feature-flags/interfaces.d.ts +5 -0
- package/feature-flags/interfaces.js +1 -0
- package/feature-flags/package.json +6 -0
- package/groups/enums.d.ts +9 -0
- package/groups/enums.js +11 -0
- package/groups/index.d.ts +73 -0
- package/groups/index.js +62 -0
- package/groups/interfaces.d.ts +64 -0
- package/groups/interfaces.js +1 -0
- package/groups/package.json +6 -0
- package/impersonate/index.d.ts +17 -0
- package/impersonate/index.js +23 -0
- package/impersonate/interfaces.d.ts +12 -0
- package/impersonate/interfaces.js +1 -0
- package/impersonate/package.json +6 -0
- package/index.d.ts +148 -53
- package/index.js +103 -31
- package/interfaces.d.ts +82 -1
- package/interfaces.js +28 -1
- package/jwt.js +19 -20
- package/metadata/index.d.ts +68 -5
- package/metadata/index.js +53 -23
- package/metadata/interfaces.d.ts +10 -2
- package/node/BaseApiClient.js +37 -0
- package/node/ContextHolder/index.js +286 -0
- package/node/FetchClient.js +268 -0
- package/node/account-settings/index.js +26 -11
- package/node/applications/index.js +62 -0
- package/node/applications/interfaces.js +12 -0
- package/node/audits/index.js +32 -27
- package/node/auth/constants.js +13 -0
- package/node/auth/enums.js +11 -5
- package/node/auth/index.js +807 -644
- package/node/auth/interfaces.js +27 -13
- package/node/auth/secutiry-poilicy/index.js +100 -66
- package/node/auth/secutiry-poilicy/interfaces.js +8 -1
- package/node/auth/utils.js +44 -0
- package/node/connectivity/index.js +123 -197
- package/node/constants.js +124 -6
- package/node/directory/index.js +37 -0
- package/node/directory/interfaces.js +14 -0
- package/node/entitlements/index.js +27 -0
- package/node/entitlements/interfaces.js +18 -0
- package/node/error.js +0 -4
- package/node/feature-flags/index.js +54 -0
- package/node/feature-flags/interfaces.js +5 -0
- package/node/groups/enums.js +19 -0
- package/node/groups/index.js +70 -0
- package/node/groups/interfaces.js +5 -0
- package/node/impersonate/index.js +29 -0
- package/node/impersonate/interfaces.js +5 -0
- package/node/index.js +324 -94
- package/node/interfaces.js +34 -1
- package/node/jwt.js +19 -25
- package/node/metadata/index.js +57 -38
- package/node/notifications/index.js +34 -31
- package/node/reports/index.js +79 -83
- package/node/roles/index.js +55 -60
- package/node/roles/interfaces.js +9 -1
- package/node/routers.js +52 -6
- package/node/security-center/index.js +26 -0
- package/node/security-center/interfaces.js +74 -0
- package/node/sub-tenants/index.js +82 -29
- package/node/sub-tenants/interfaces.js +9 -1
- package/node/subscriptions/enums.js +13 -9
- package/node/subscriptions/index.js +64 -109
- package/node/subscriptions/interfaces.js +0 -2
- package/node/subscriptions/invoices.js +20 -21
- package/node/subscriptions/managedSubscriptions.js +28 -33
- package/node/subscriptions/paymentMethods.js +23 -27
- package/node/subscriptions/paymentProviders.js +11 -8
- package/node/subscriptions/plans.js +13 -12
- package/node/subscriptions/providers/stripe/index.js +22 -27
- package/node/subscriptions/subscriptions.js +28 -33
- package/node/subscriptions/summaries.js +11 -8
- package/node/subscriptions/tenantConfiguration.js +13 -12
- package/node/subscriptions/vendorPublicConfigurations.js +17 -0
- package/node/teams/index.js +108 -121
- package/node/teams/interfaces.js +8 -1
- package/node/tenants/index.js +63 -21
- package/node/tenants/interfaces.js +18 -1
- package/node/user-phone-numbers/index.js +38 -0
- package/node/user-phone-numbers/interfaces.js +5 -0
- package/node/users/index.js +64 -0
- package/node/users/interfaces.js +27 -0
- package/node/velo/index.js +75 -0
- package/node/velo/interfaces.js +5 -0
- package/node/vendor/index.js +16 -8
- package/notifications/index.d.ts +22 -16
- package/notifications/index.js +33 -22
- package/package.json +4 -2
- package/reports/index.d.ts +50 -44
- package/reports/index.js +77 -68
- package/reports/interfaces.d.ts +2 -2
- package/roles/index.d.ts +45 -34
- package/roles/index.js +52 -41
- package/roles/interfaces.d.ts +25 -9
- package/roles/interfaces.js +6 -1
- package/routers.d.ts +6 -1
- package/routers.js +45 -2
- package/security-center/index.d.ts +15 -0
- package/security-center/index.js +19 -0
- package/security-center/interfaces.d.ts +115 -0
- package/security-center/interfaces.js +63 -0
- package/security-center/package.json +6 -0
- package/sub-tenants/index.d.ts +57 -8
- package/sub-tenants/index.js +84 -19
- package/sub-tenants/interfaces.d.ts +68 -10
- package/sub-tenants/interfaces.js +6 -1
- package/subscriptions/enums.d.ts +7 -0
- package/subscriptions/enums.js +10 -8
- package/subscriptions/index.d.ts +55 -9
- package/subscriptions/index.js +56 -9
- package/subscriptions/interfaces.d.ts +7 -3
- package/subscriptions/interfaces.js +1 -1
- package/subscriptions/invoices.d.ts +16 -13
- package/subscriptions/invoices.js +19 -14
- package/subscriptions/managedSubscriptions.d.ts +18 -15
- package/subscriptions/managedSubscriptions.js +27 -22
- package/subscriptions/paymentMethods.d.ts +16 -13
- package/subscriptions/paymentMethods.js +22 -18
- package/subscriptions/paymentProviders.d.ts +8 -5
- package/subscriptions/paymentProviders.js +9 -4
- package/subscriptions/plans.d.ts +11 -8
- package/subscriptions/plans.js +11 -6
- package/subscriptions/providers/stripe/index.d.ts +24 -21
- package/subscriptions/providers/stripe/index.js +21 -16
- package/subscriptions/subscriptions.d.ts +24 -21
- package/subscriptions/subscriptions.js +27 -22
- package/subscriptions/summaries.d.ts +7 -4
- package/subscriptions/summaries.js +8 -3
- package/subscriptions/tenantConfiguration.d.ts +6 -3
- package/subscriptions/tenantConfiguration.js +12 -7
- package/subscriptions/vendorPublicConfigurations.d.ts +5 -0
- package/subscriptions/vendorPublicConfigurations.js +10 -0
- package/teams/index.d.ts +38 -115
- package/teams/index.js +105 -79
- package/teams/interfaces.d.ts +47 -42
- package/teams/interfaces.js +5 -1
- package/tenants/index.d.ts +25 -26
- package/tenants/index.js +61 -12
- package/tenants/interfaces.d.ts +85 -0
- package/tenants/interfaces.js +14 -1
- package/user-phone-numbers/index.d.ts +32 -0
- package/user-phone-numbers/index.js +31 -0
- package/user-phone-numbers/interfaces.d.ts +32 -0
- package/user-phone-numbers/interfaces.js +1 -0
- package/user-phone-numbers/package.json +6 -0
- package/users/index.d.ts +24 -0
- package/users/index.js +55 -0
- package/users/interfaces.d.ts +144 -0
- package/users/interfaces.js +18 -0
- package/users/package.json +6 -0
- package/velo/index.d.ts +46 -0
- package/velo/index.js +68 -0
- package/velo/interfaces.d.ts +108 -0
- package/velo/interfaces.js +1 -0
- package/velo/package.json +6 -0
- package/vendor/index.d.ts +12 -6
- package/vendor/index.js +15 -4
- package/ContextHolder.d.ts +0 -29
- package/ContextHolder.js +0 -80
- package/fetch.d.ts +0 -19
- package/fetch.js +0 -203
- package/node/ContextHolder.js +0 -90
- package/node/fetch.js +0 -234
- package/node/subscriptions/providers/index.js +0 -18
- package/subscriptions/providers/index.d.ts +0 -1
- package/subscriptions/providers/index.js +0 -1
package/node/constants.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.urls = void 0;
|
|
6
|
+
exports.urls = exports.GENERIC_ERROR_MESSAGE = void 0;
|
|
7
7
|
const urls = {
|
|
8
8
|
vendor: '/vendors',
|
|
9
9
|
identity: {
|
|
@@ -17,26 +17,71 @@ const urls = {
|
|
|
17
17
|
users: {
|
|
18
18
|
v1: '/identity/resources/users/v1',
|
|
19
19
|
v2: '/identity/resources/users/v2',
|
|
20
|
+
v3: '/identity/resources/users/v3',
|
|
21
|
+
roles: {
|
|
22
|
+
v3: '/identity/resources/users/v3/roles'
|
|
23
|
+
},
|
|
24
|
+
groups: {
|
|
25
|
+
v3: '/identity/resources/users/v3/groups'
|
|
26
|
+
},
|
|
27
|
+
tenants: {
|
|
28
|
+
me: {
|
|
29
|
+
v1: '/identity/resources/users/v1/me/tenants',
|
|
30
|
+
v3: '/identity/resources/users/v3/me/tenants'
|
|
31
|
+
}
|
|
32
|
+
},
|
|
20
33
|
apiTokens: {
|
|
21
34
|
v1: '/identity/resources/users/api-tokens/v1'
|
|
22
35
|
},
|
|
36
|
+
accessTokens: {
|
|
37
|
+
v1: '/identity/resources/users/access-tokens/v1'
|
|
38
|
+
},
|
|
23
39
|
sessions: {
|
|
40
|
+
v1: '/identity/resources/users/sessions/v1',
|
|
24
41
|
currentUser: {
|
|
25
42
|
v1: '/identity/resources/users/sessions/v1/me'
|
|
43
|
+
},
|
|
44
|
+
configurations: {
|
|
45
|
+
v1: '/identity/resources/configurations/sessions/v1'
|
|
26
46
|
}
|
|
27
47
|
},
|
|
28
48
|
invitation: {
|
|
29
49
|
resendAll: {
|
|
30
50
|
v1: '/identity/resources/users/v1/invitation/reset/all'
|
|
31
51
|
}
|
|
52
|
+
},
|
|
53
|
+
passwords: {
|
|
54
|
+
resetBreachedPasswords: {
|
|
55
|
+
v1: '/identity/resources/users/v1/passwords/breached/reset/bulk'
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
authorization: {
|
|
59
|
+
v1: '/identity/resources/users/v1/me/authorization'
|
|
60
|
+
},
|
|
61
|
+
temporary: {
|
|
62
|
+
v1: '/identity/resources/users/temporary/v1',
|
|
63
|
+
configuration: {
|
|
64
|
+
v1: '/identity/resources/users/temporary/v1/configuration'
|
|
65
|
+
}
|
|
32
66
|
}
|
|
33
67
|
},
|
|
34
68
|
configurations: {
|
|
35
69
|
v1: '/identity/resources/configurations/v1'
|
|
36
70
|
},
|
|
71
|
+
restrictions: {
|
|
72
|
+
emailDomain: {
|
|
73
|
+
v1: '/identity/resources/configurations/restrictions/v1/email-domain'
|
|
74
|
+
},
|
|
75
|
+
ip: {
|
|
76
|
+
v1: '/identity/resources/configurations/v1/restrictions/ip'
|
|
77
|
+
}
|
|
78
|
+
},
|
|
37
79
|
sso: {
|
|
38
80
|
v1: '/identity/resources/sso/v1',
|
|
39
|
-
v2: '/identity/resources/sso/v2'
|
|
81
|
+
v2: '/identity/resources/sso/v2',
|
|
82
|
+
custom: {
|
|
83
|
+
v1: '/identity/resources/sso/custom/v1'
|
|
84
|
+
}
|
|
40
85
|
},
|
|
41
86
|
permissions: {
|
|
42
87
|
v1: '/identity/resources/permissions/v1'
|
|
@@ -46,6 +91,9 @@ const urls = {
|
|
|
46
91
|
v1: '/identity/resources/tenants/api-tokens/v1',
|
|
47
92
|
v2: '/identity/resources/tenants/api-tokens/v2'
|
|
48
93
|
},
|
|
94
|
+
accessTokens: {
|
|
95
|
+
v1: '/identity/resources/tenants/access-tokens/v1'
|
|
96
|
+
},
|
|
49
97
|
invites: {
|
|
50
98
|
user: {
|
|
51
99
|
v1: '/identity/resources/tenants/invites/v1/user'
|
|
@@ -56,13 +104,36 @@ const urls = {
|
|
|
56
104
|
configuration: {
|
|
57
105
|
v1: '/identity/resources/tenants/invites/v1/configuration'
|
|
58
106
|
}
|
|
107
|
+
},
|
|
108
|
+
users: {
|
|
109
|
+
v1: '/identity/resources/tenants/users/v1'
|
|
59
110
|
}
|
|
60
111
|
},
|
|
61
112
|
roles: {
|
|
62
|
-
v1: '/identity/resources/roles/v1'
|
|
113
|
+
v1: '/identity/resources/roles/v1',
|
|
114
|
+
v2: '/identity/resources/roles/v2'
|
|
63
115
|
},
|
|
64
116
|
subTenants: {
|
|
65
|
-
v1: '/identity/resources/sub-tenants/users/v1'
|
|
117
|
+
v1: '/identity/resources/sub-tenants/users/v1',
|
|
118
|
+
v2: '/identity/resources/sub-tenants/users/v2'
|
|
119
|
+
},
|
|
120
|
+
impersonate: {
|
|
121
|
+
v1: '/identity/resources/impersonation/v1'
|
|
122
|
+
},
|
|
123
|
+
applications: {
|
|
124
|
+
v1: '/identity/resources/applications/v1'
|
|
125
|
+
},
|
|
126
|
+
groups: {
|
|
127
|
+
v1: '/identity/resources/groups/v1',
|
|
128
|
+
configurations: {
|
|
129
|
+
v1: '/identity/resources/groups/v1/config'
|
|
130
|
+
},
|
|
131
|
+
getByIds: {
|
|
132
|
+
v1: '/identity/resources/groups/v1/bulkGet'
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
phoneNumbers: {
|
|
136
|
+
v1: '/identity/resources/users/phone-numbers/v1'
|
|
66
137
|
}
|
|
67
138
|
},
|
|
68
139
|
team: {
|
|
@@ -80,9 +151,10 @@ const urls = {
|
|
|
80
151
|
v1: '/team/resources/stats/v1'
|
|
81
152
|
},
|
|
82
153
|
profile: {
|
|
83
|
-
v1: '/team/resources/profile'
|
|
154
|
+
v1: '/team/resources/profile' // no versioning in backend
|
|
84
155
|
}
|
|
85
156
|
},
|
|
157
|
+
|
|
86
158
|
tenants: {
|
|
87
159
|
accountSettings: {
|
|
88
160
|
v1: '/tenants/resources/account-settings/v1'
|
|
@@ -91,7 +163,17 @@ const urls = {
|
|
|
91
163
|
v1: '/tenants/resources/hierarchy/v1',
|
|
92
164
|
tree: {
|
|
93
165
|
v1: '/tenants/resources/hierarchy/v1/tree'
|
|
166
|
+
},
|
|
167
|
+
parents: {
|
|
168
|
+
v1: '/tenants/resources/hierarchy/v1/parents'
|
|
169
|
+
},
|
|
170
|
+
v2: '/tenants/resources/hierarchy/v2',
|
|
171
|
+
metadata: {
|
|
172
|
+
v2: '/tenants/resources/hierarchy/v2/metadata'
|
|
94
173
|
}
|
|
174
|
+
},
|
|
175
|
+
subTenants: {
|
|
176
|
+
v1: '/tenants/resources/sub-tenants/v1'
|
|
95
177
|
}
|
|
96
178
|
},
|
|
97
179
|
integrations: {
|
|
@@ -120,6 +202,11 @@ const urls = {
|
|
|
120
202
|
tenantConfiguration: {
|
|
121
203
|
v1: '/subscriptions/resources/billing/tenant-configurations/v1'
|
|
122
204
|
},
|
|
205
|
+
configurations: {
|
|
206
|
+
vendorPublicConfigurations: {
|
|
207
|
+
v1: '/subscriptions/resources/billing/configurations/vendor-public-configurations/v1'
|
|
208
|
+
}
|
|
209
|
+
},
|
|
123
210
|
paymentProviders: {
|
|
124
211
|
stripe: {
|
|
125
212
|
customers: {
|
|
@@ -169,6 +256,37 @@ const urls = {
|
|
|
169
256
|
},
|
|
170
257
|
oauth: {
|
|
171
258
|
v1: '/oauth'
|
|
259
|
+
},
|
|
260
|
+
featureFlags: {
|
|
261
|
+
v1: '/flags'
|
|
262
|
+
},
|
|
263
|
+
directory: {
|
|
264
|
+
v1: '/directory/resources/v1/configurations/scim2',
|
|
265
|
+
temp: '/directory/resources/scim/temp'
|
|
266
|
+
},
|
|
267
|
+
entitlements: {
|
|
268
|
+
v1: '/entitlements/api/v1/user-entitlements',
|
|
269
|
+
v2: '/entitlements/api/v2/user-entitlements'
|
|
270
|
+
},
|
|
271
|
+
securityCenter: {
|
|
272
|
+
recommendations: {
|
|
273
|
+
v1: '/security-center/resources/recommendations/v1'
|
|
274
|
+
},
|
|
275
|
+
insights: {
|
|
276
|
+
v1: '/security-center/resources/insights/v1'
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
applications: {
|
|
280
|
+
v1: '/applications/resources/applications/v1',
|
|
281
|
+
tenant: {
|
|
282
|
+
v1: '/applications/resources/applications/tenant-assignments/v1'
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
velo: {
|
|
286
|
+
// v1: '/nlp-execution-assistant/resources/velo/v1'
|
|
287
|
+
v1: 'http://localhost:3037/resources/velo/v1'
|
|
172
288
|
}
|
|
173
289
|
};
|
|
174
|
-
exports.urls = urls;
|
|
290
|
+
exports.urls = urls;
|
|
291
|
+
const GENERIC_ERROR_MESSAGE = `We're facing some difficulties, Please try again`;
|
|
292
|
+
exports.GENERIC_ERROR_MESSAGE = GENERIC_ERROR_MESSAGE;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.DirectoryApi = void 0;
|
|
7
|
+
var _constants = require("../constants");
|
|
8
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
9
|
+
class DirectoryApi extends _BaseApiClient.BaseApiClient {
|
|
10
|
+
constructor(appName) {
|
|
11
|
+
super(appName);
|
|
12
|
+
this.getConfigs = async () => {
|
|
13
|
+
return this.get(`${_constants.urls.directory.v1}`);
|
|
14
|
+
};
|
|
15
|
+
this.updateConfiguration = async (id, body) => {
|
|
16
|
+
return this.patch(`${_constants.urls.directory.v1}/${id}`, body);
|
|
17
|
+
};
|
|
18
|
+
this.createConfiguration = async body => {
|
|
19
|
+
return this.post(`${_constants.urls.directory.v1}`, body);
|
|
20
|
+
};
|
|
21
|
+
this.deleteConfiguration = async id => {
|
|
22
|
+
return this.delete(`${_constants.urls.directory.v1}/${id}`);
|
|
23
|
+
};
|
|
24
|
+
this.countConfigurationUsers = async id => {
|
|
25
|
+
return this.get(`${_constants.urls.directory.temp}/${id}/Users/count`);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Returns all SCIM2 configurations
|
|
31
|
+
*
|
|
32
|
+
* ``authorized user``
|
|
33
|
+
*/
|
|
34
|
+
}
|
|
35
|
+
exports.DirectoryApi = DirectoryApi;
|
|
36
|
+
var _default = new DirectoryApi('default');
|
|
37
|
+
exports.default = _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ScimConnectionSource = void 0;
|
|
7
|
+
let ScimConnectionSource;
|
|
8
|
+
exports.ScimConnectionSource = ScimConnectionSource;
|
|
9
|
+
(function (ScimConnectionSource) {
|
|
10
|
+
ScimConnectionSource["FRONTEGG"] = "frontegg";
|
|
11
|
+
ScimConnectionSource["OKTA"] = "okta";
|
|
12
|
+
ScimConnectionSource["AZURE_AD"] = "azure-ad";
|
|
13
|
+
ScimConnectionSource["OTHER"] = "other";
|
|
14
|
+
})(ScimConnectionSource || (exports.ScimConnectionSource = ScimConnectionSource = {}));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.EntitlementsApi = void 0;
|
|
7
|
+
var _constants = require("../constants");
|
|
8
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
9
|
+
class EntitlementsApi extends _BaseApiClient.BaseApiClient {
|
|
10
|
+
constructor(appName) {
|
|
11
|
+
super(appName);
|
|
12
|
+
this.loadEntitlementsV2 = async () => {
|
|
13
|
+
return this.get(_constants.urls.entitlements.v2);
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Load user entitlements data v2.
|
|
19
|
+
* Including all user permissions and features data.
|
|
20
|
+
* Now the final isEntitled response is not part of it, but includes the data needed to calculate it.
|
|
21
|
+
*
|
|
22
|
+
* `authorized user`
|
|
23
|
+
*/
|
|
24
|
+
}
|
|
25
|
+
exports.EntitlementsApi = EntitlementsApi;
|
|
26
|
+
var _default = new EntitlementsApi('default');
|
|
27
|
+
exports.default = _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.NotEntitledJustification = exports.ADMIN_PORTAL_ENTITLEMENTS_FF = void 0;
|
|
7
|
+
let NotEntitledJustification;
|
|
8
|
+
/**
|
|
9
|
+
* entitlements feature flag
|
|
10
|
+
*/
|
|
11
|
+
exports.NotEntitledJustification = NotEntitledJustification;
|
|
12
|
+
(function (NotEntitledJustification) {
|
|
13
|
+
NotEntitledJustification["MISSING_PERMISSION"] = "MISSING_PERMISSION";
|
|
14
|
+
NotEntitledJustification["MISSING_FEATURE"] = "MISSING_FEATURE";
|
|
15
|
+
NotEntitledJustification["BUNDLE_EXPIRED"] = "BUNDLE_EXPIRED";
|
|
16
|
+
})(NotEntitledJustification || (exports.NotEntitledJustification = NotEntitledJustification = {}));
|
|
17
|
+
const ADMIN_PORTAL_ENTITLEMENTS_FF = 'admin_portal_entitlements';
|
|
18
|
+
exports.ADMIN_PORTAL_ENTITLEMENTS_FF = ADMIN_PORTAL_ENTITLEMENTS_FF;
|
package/node/error.js
CHANGED
|
@@ -4,18 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.FronteggApiError = void 0;
|
|
7
|
-
|
|
8
7
|
class FronteggApiError extends Error {
|
|
9
8
|
constructor(message, statusCode) {
|
|
10
9
|
super(message);
|
|
11
10
|
this._statusCode = void 0;
|
|
12
11
|
this._statusCode = statusCode;
|
|
13
12
|
}
|
|
14
|
-
|
|
15
13
|
get statusCode() {
|
|
16
14
|
return this._statusCode;
|
|
17
15
|
}
|
|
18
|
-
|
|
19
16
|
}
|
|
20
|
-
|
|
21
17
|
exports.FronteggApiError = FronteggApiError;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.FeatureFlagsApi = exports.FeatureFlags = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _constants = require("../constants");
|
|
10
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
11
|
+
const defaultFeatureFlags = {
|
|
12
|
+
flags: {}
|
|
13
|
+
};
|
|
14
|
+
class FeatureFlags {
|
|
15
|
+
constructor() {
|
|
16
|
+
var _defaultFeatureFlags$;
|
|
17
|
+
this._flags = {};
|
|
18
|
+
this._flags = (_defaultFeatureFlags$ = defaultFeatureFlags.flags) != null ? _defaultFeatureFlags$ : {};
|
|
19
|
+
}
|
|
20
|
+
static getInstance(name = 'default') {
|
|
21
|
+
return this._instances[name];
|
|
22
|
+
}
|
|
23
|
+
static set(featureFlags, name = 'default') {
|
|
24
|
+
const featureFlagsInstance = new FeatureFlags();
|
|
25
|
+
featureFlagsInstance.set(featureFlags);
|
|
26
|
+
FeatureFlags._instances[name] = featureFlagsInstance;
|
|
27
|
+
return featureFlagsInstance;
|
|
28
|
+
}
|
|
29
|
+
static getFeatureFlags(flags, name) {
|
|
30
|
+
const featureFlagsInstance = this.getInstance(name);
|
|
31
|
+
return flags.map(flag => (featureFlagsInstance == null ? void 0 : featureFlagsInstance._flags[flag]) === 'on');
|
|
32
|
+
}
|
|
33
|
+
get flags() {
|
|
34
|
+
var _this$flags;
|
|
35
|
+
return (_this$flags = this.flags) != null ? _this$flags : {};
|
|
36
|
+
}
|
|
37
|
+
set(featureFlags) {
|
|
38
|
+
var _defaultFeatureFlags$2;
|
|
39
|
+
this._flags = (0, _extends2.default)({}, (_defaultFeatureFlags$2 = defaultFeatureFlags == null ? void 0 : defaultFeatureFlags.flags) != null ? _defaultFeatureFlags$2 : {}, featureFlags != null ? featureFlags : {});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.FeatureFlags = FeatureFlags;
|
|
43
|
+
FeatureFlags._instances = {};
|
|
44
|
+
class FeatureFlagsApi extends _BaseApiClient.BaseApiClient {
|
|
45
|
+
constructor(appName) {
|
|
46
|
+
super(appName);
|
|
47
|
+
this.loadFeatureFlags = async () => {
|
|
48
|
+
return this.get(_constants.urls.featureFlags.v1);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.FeatureFlagsApi = FeatureFlagsApi;
|
|
53
|
+
var _default = new FeatureFlagsApi('default');
|
|
54
|
+
exports.default = _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.GroupRelations = exports.GroupManagedByEnum = void 0;
|
|
7
|
+
let GroupRelations;
|
|
8
|
+
exports.GroupRelations = GroupRelations;
|
|
9
|
+
(function (GroupRelations) {
|
|
10
|
+
GroupRelations["roles"] = "roles";
|
|
11
|
+
GroupRelations["users"] = "users";
|
|
12
|
+
GroupRelations["rolesAndUsers"] = "rolesAndUsers";
|
|
13
|
+
})(GroupRelations || (exports.GroupRelations = GroupRelations = {}));
|
|
14
|
+
let GroupManagedByEnum;
|
|
15
|
+
exports.GroupManagedByEnum = GroupManagedByEnum;
|
|
16
|
+
(function (GroupManagedByEnum) {
|
|
17
|
+
GroupManagedByEnum["FRONTEGG"] = "frontegg";
|
|
18
|
+
GroupManagedByEnum["SCIM2"] = "scim2";
|
|
19
|
+
})(GroupManagedByEnum || (exports.GroupManagedByEnum = GroupManagedByEnum = {}));
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.GroupsApi = void 0;
|
|
8
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _constants = require("../constants");
|
|
11
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
12
|
+
const _excluded = ["groupId"];
|
|
13
|
+
class GroupsApi extends _BaseApiClient.BaseApiClient {
|
|
14
|
+
constructor(appName) {
|
|
15
|
+
super(appName);
|
|
16
|
+
this.getGroupById = async ({
|
|
17
|
+
groupId
|
|
18
|
+
}, query) => {
|
|
19
|
+
return this.get(`${_constants.urls.identity.groups.v1}/${groupId}`, (0, _extends2.default)({}, query));
|
|
20
|
+
};
|
|
21
|
+
this.getGroups = async query => {
|
|
22
|
+
return this.get(`${_constants.urls.identity.groups.v1}`, (0, _extends2.default)({}, query));
|
|
23
|
+
};
|
|
24
|
+
this.getGroupsByIds = async (body, params) => {
|
|
25
|
+
return this.post(`${_constants.urls.identity.groups.getByIds.v1}`, body, {
|
|
26
|
+
params
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
this.createGroup = async body => {
|
|
30
|
+
return this.post(`${_constants.urls.identity.groups.v1}`, body);
|
|
31
|
+
};
|
|
32
|
+
this.updateGroup = async _ref => {
|
|
33
|
+
let {
|
|
34
|
+
groupId
|
|
35
|
+
} = _ref,
|
|
36
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
37
|
+
return this.patch(`${_constants.urls.identity.groups.v1}/${groupId}`, body);
|
|
38
|
+
};
|
|
39
|
+
this.deleteGroup = async groupId => {
|
|
40
|
+
return this.delete(`${_constants.urls.identity.groups.v1}/${groupId}`);
|
|
41
|
+
};
|
|
42
|
+
this.addRolesToGroup = async (groupId, body) => {
|
|
43
|
+
return this.post(`${_constants.urls.identity.groups.v1}/${groupId}/roles`, body);
|
|
44
|
+
};
|
|
45
|
+
this.deleteRolesFromGroup = async (groupId, body) => {
|
|
46
|
+
return this.delete(`${_constants.urls.identity.groups.v1}/${groupId}/roles`, body);
|
|
47
|
+
};
|
|
48
|
+
this.addUsersToGroup = async (groupId, body) => {
|
|
49
|
+
return this.post(`${_constants.urls.identity.groups.v1}/${groupId}/users`, body);
|
|
50
|
+
};
|
|
51
|
+
this.deleteUsersFromGroup = async (groupId, body) => {
|
|
52
|
+
return this.delete(`${_constants.urls.identity.groups.v1}/${groupId}/users`, body);
|
|
53
|
+
};
|
|
54
|
+
this.getGroupConfiguration = async () => {
|
|
55
|
+
return this.get(`${_constants.urls.identity.groups.configurations.v1}`);
|
|
56
|
+
};
|
|
57
|
+
this.updateGroupConfiguration = async body => {
|
|
58
|
+
return this.post(`${_constants.urls.identity.groups.configurations.v1}`, body);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Get group by given id
|
|
64
|
+
* @param groupId - The ID of the group to retrieve
|
|
65
|
+
* @param query - Optional query parameters
|
|
66
|
+
*/
|
|
67
|
+
}
|
|
68
|
+
exports.GroupsApi = GroupsApi;
|
|
69
|
+
var _default = new GroupsApi('default');
|
|
70
|
+
exports.default = _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.ImpersonateApi = void 0;
|
|
7
|
+
var _constants = require("../constants");
|
|
8
|
+
var _BaseApiClient = require("../BaseApiClient");
|
|
9
|
+
/**
|
|
10
|
+
* UsersApi class provides methods for handling user and impersonation-related API requests.
|
|
11
|
+
*/
|
|
12
|
+
class ImpersonateApi extends _BaseApiClient.BaseApiClient {
|
|
13
|
+
constructor(appName) {
|
|
14
|
+
super(appName);
|
|
15
|
+
this.impersonate = async body => {
|
|
16
|
+
return this.post(`${_constants.urls.identity.impersonate.v1}`, body);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Impersonating user should be called after creating actor token that contains information about impersonation.
|
|
22
|
+
* `impersonate` should contain impersonated user info (userId, tenantId, and vendorId) and the actor token that was created for him to perform impersonation.
|
|
23
|
+
*
|
|
24
|
+
* @throws exception if impersonation failed
|
|
25
|
+
*/
|
|
26
|
+
}
|
|
27
|
+
exports.ImpersonateApi = ImpersonateApi;
|
|
28
|
+
var _default = new ImpersonateApi('default');
|
|
29
|
+
exports.default = _default;
|