@frontegg/rest-api 3.1.76-alpha.9502349697 → 3.1.76-alpha.9762981322
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/ContextHolder/index.d.ts +30 -108
- package/ContextHolder/index.js +57 -153
- package/account-settings/index.d.ts +7 -19
- package/account-settings/index.js +13 -23
- package/applications/index.d.ts +44 -49
- package/applications/index.js +37 -51
- package/audits/index.d.ts +15 -27
- package/audits/index.js +17 -27
- package/auth/index.d.ts +768 -817
- package/auth/index.js +721 -902
- package/auth/secutiry-poilicy/index.d.ts +102 -58
- package/auth/secutiry-poilicy/index.js +90 -122
- package/auth/utils.d.ts +2 -2
- package/auth/utils.js +8 -9
- package/connectivity/index.d.ts +27 -126
- package/connectivity/index.js +114 -147
- package/directory/index.d.ts +22 -31
- package/directory/index.js +15 -27
- package/entitlements/index.d.ts +8 -14
- package/entitlements/index.js +4 -12
- package/feature-flags/index.d.ts +2 -8
- package/feature-flags/index.js +8 -16
- package/fetch.d.ts +24 -0
- package/fetch.js +265 -0
- package/groups/index.d.ts +49 -73
- package/groups/index.js +45 -64
- package/impersonate/index.d.ts +6 -15
- package/impersonate/index.js +5 -13
- package/index.d.ts +108 -154
- package/index.js +78 -109
- package/interfaces.d.ts +0 -10
- package/metadata/index.d.ts +7 -67
- package/metadata/index.js +32 -52
- package/node/ContextHolder/index.js +57 -153
- package/node/account-settings/index.js +16 -27
- package/node/applications/index.js +44 -51
- package/node/audits/index.js +20 -31
- package/node/auth/index.js +1035 -768
- package/node/auth/secutiry-poilicy/index.js +136 -125
- package/node/auth/utils.js +7 -9
- package/node/connectivity/index.js +187 -148
- package/node/directory/index.js +20 -29
- package/node/entitlements/index.js +5 -18
- package/node/feature-flags/index.js +9 -21
- package/node/fetch.js +306 -0
- package/node/groups/index.js +63 -65
- package/node/impersonate/index.js +5 -18
- package/node/index.js +71 -116
- package/node/metadata/index.js +52 -61
- package/node/notifications/index.js +27 -37
- package/node/reports/index.js +70 -78
- package/node/roles/index.js +51 -56
- package/node/security-center/index.js +9 -21
- package/node/sub-tenants/index.js +89 -90
- package/node/subscriptions/index.js +107 -69
- package/node/subscriptions/invoices.js +17 -25
- package/node/subscriptions/managedSubscriptions.js +27 -32
- package/node/subscriptions/paymentMethods.js +20 -27
- package/node/subscriptions/paymentProviders.js +6 -15
- package/node/subscriptions/plans.js +9 -17
- package/node/subscriptions/providers/index.js +18 -0
- package/node/subscriptions/providers/stripe/index.js +21 -26
- package/node/subscriptions/subscriptions.js +27 -32
- package/node/subscriptions/summaries.js +6 -15
- package/node/subscriptions/tenantConfiguration.js +9 -17
- package/node/subscriptions/vendorPublicConfigurations.js +6 -15
- package/node/teams/index.js +138 -130
- package/node/tenants/index.js +60 -65
- package/node/user-phone-numbers/index.js +24 -32
- package/node/users/index.js +53 -58
- package/node/vendor/index.js +6 -17
- package/notifications/index.d.ts +16 -22
- package/notifications/index.js +22 -33
- package/package.json +1 -1
- package/reports/index.d.ts +44 -50
- package/reports/index.js +62 -75
- package/roles/index.d.ts +38 -44
- package/roles/index.js +41 -57
- package/security-center/index.d.ts +2 -14
- package/security-center/index.js +6 -15
- package/sub-tenants/index.d.ts +15 -57
- package/sub-tenants/index.js +68 -88
- package/subscriptions/index.d.ts +11 -56
- package/subscriptions/index.js +11 -58
- package/subscriptions/invoices.d.ts +13 -16
- package/subscriptions/invoices.js +14 -24
- package/subscriptions/managedSubscriptions.d.ts +15 -18
- package/subscriptions/managedSubscriptions.js +22 -33
- package/subscriptions/paymentMethods.d.ts +13 -16
- package/subscriptions/paymentMethods.js +17 -26
- package/subscriptions/paymentProviders.d.ts +5 -8
- package/subscriptions/paymentProviders.js +4 -11
- package/subscriptions/plans.d.ts +8 -11
- package/subscriptions/plans.js +6 -14
- package/subscriptions/providers/index.d.ts +1 -0
- package/subscriptions/providers/index.js +1 -0
- package/subscriptions/providers/stripe/index.d.ts +21 -24
- package/subscriptions/providers/stripe/index.js +16 -27
- package/subscriptions/subscriptions.d.ts +21 -24
- package/subscriptions/subscriptions.js +22 -33
- package/subscriptions/summaries.d.ts +4 -7
- package/subscriptions/summaries.js +3 -10
- package/subscriptions/tenantConfiguration.d.ts +3 -6
- package/subscriptions/tenantConfiguration.js +7 -15
- package/subscriptions/vendorPublicConfigurations.d.ts +2 -5
- package/subscriptions/vendorPublicConfigurations.js +4 -11
- package/teams/index.d.ts +131 -35
- package/teams/index.js +93 -122
- package/tenants/index.d.ts +37 -25
- package/tenants/index.js +46 -62
- package/user-phone-numbers/index.d.ts +26 -32
- package/user-phone-numbers/index.js +19 -32
- package/users/index.d.ts +15 -21
- package/users/index.js +44 -60
- package/vendor/index.d.ts +6 -12
- package/vendor/index.js +4 -11
- package/BaseApiClient.d.ts +0 -16
- package/BaseApiClient.js +0 -39
- package/FetchClient.d.ts +0 -42
- package/FetchClient.js +0 -308
- package/node/BaseApiClient.js +0 -49
- package/node/FetchClient.js +0 -326
package/connectivity/index.js
CHANGED
|
@@ -2,152 +2,119 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
2
2
|
const _excluded = ["eventKey"],
|
|
3
3
|
_excluded2 = ["eventKey"];
|
|
4
4
|
import { urls } from '../constants';
|
|
5
|
-
import {
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
this.getSlackChannels = () => {
|
|
19
|
-
return this.get(`${urls.integrations.configurations.v1}/slack/channels`);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
this.postSlackConfiguration = data => {
|
|
23
|
-
if (data.id) {
|
|
24
|
-
return this.patch(`${urls.integrations.configurations.v1}/slack/subscription/${data.id}`, data);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return this.post(`${urls.integrations.configurations.v1}/slack/subscriptions`, data);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
this.deleteSlackConfiguration = data => {
|
|
31
|
-
return this.delete(`${urls.integrations.configurations.v1}/slack/subscriptions/${data.id}`);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
this.postSlackCode = code => {
|
|
35
|
-
return this.post(`${urls.integrations.configurations.v1}/slack/applications/registrations`, {
|
|
36
|
-
code
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
this.getEmailConfiguration = () => {
|
|
41
|
-
return this.get(`${urls.integrations.configurations.v1}/emails`);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
this.postEmailConfiguration = _ref => {
|
|
45
|
-
let {
|
|
46
|
-
eventKey
|
|
47
|
-
} = _ref,
|
|
48
|
-
data = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
49
|
-
|
|
50
|
-
return this.post(`${urls.integrations.configurations.v1}/emails/${eventKey}`, data);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
this.patchEmailConfiguration = ({
|
|
54
|
-
eventKey,
|
|
55
|
-
enabled
|
|
56
|
-
}) => {
|
|
57
|
-
return this.patch(`${urls.integrations.configurations.v1}/emails/${eventKey}`, {
|
|
58
|
-
enabled
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
this.deleteEmailSubscriptions = (eventKey, subscriptionId) => {
|
|
63
|
-
return this.delete(`${urls.integrations.configurations.v1}/emails/${eventKey}/subscriptions/${subscriptionId}`);
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
this.putEmailSubscriptions = (subscriptionId, eventKey, data) => {
|
|
67
|
-
return this.put(`${urls.integrations.configurations.v1}/emails/${eventKey}/subscriptions/${subscriptionId}`, data);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
this.deleteEmailConfiguration = eventKey => {
|
|
71
|
-
return this.delete(`${urls.integrations.configurations.v1}/emails/${eventKey}`);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
this.getSMSConfiguration = () => {
|
|
75
|
-
return this.get(`${urls.integrations.configurations.v2}/sms`);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
this.postSMSConfiguration = _ref2 => {
|
|
79
|
-
let {
|
|
80
|
-
eventKey
|
|
81
|
-
} = _ref2,
|
|
82
|
-
data = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
83
|
-
|
|
84
|
-
return this.post(`${urls.integrations.configurations.v2}/sms/${eventKey}`, data);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
this.patchSMSConfiguration = ({
|
|
88
|
-
eventKey,
|
|
89
|
-
enabled
|
|
90
|
-
}) => {
|
|
91
|
-
return this.patch(`${urls.integrations.configurations.v2}/sms/${eventKey}`, {
|
|
92
|
-
enabled
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
this.deleteSMSSubscriptions = (eventKey, subscriptionId) => {
|
|
97
|
-
return this.delete(`${urls.integrations.configurations.v2}/sms/${eventKey}/subscriptions/${subscriptionId}`);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
this.putSMSSubscriptions = (subscriptionId, eventKey, data) => {
|
|
101
|
-
return this.put(`${urls.integrations.configurations.v2}/sms/${eventKey}/subscriptions/${subscriptionId}`, data);
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
this.deleteSMSConfiguration = eventKey => {
|
|
105
|
-
return this.delete(`${urls.integrations.configurations.v2}/sms/${eventKey}`);
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
this.getWebhooksConfigurations = () => {
|
|
109
|
-
return this.get(urls.webhooks.v1);
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
this.postWebhooksConfiguration = data => {
|
|
113
|
-
if (data._id) {
|
|
114
|
-
return this.patch(`${urls.webhooks.v1}/${data._id}`, data);
|
|
115
|
-
} else {
|
|
116
|
-
return this.post(`${urls.webhooks.v1}/custom`, data);
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
this.deleteWebhooksConfiguration = id => {
|
|
121
|
-
return this.delete(`${urls.webhooks.v1}/${id}`);
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
this.getWebhookLog = (id, offset = 0, limit = 10) => {
|
|
125
|
-
const query = new URLSearchParams({
|
|
126
|
-
id,
|
|
127
|
-
offset: `${offset}`,
|
|
128
|
-
limit: `${limit}`
|
|
129
|
-
});
|
|
130
|
-
return this.get(`${urls.webhooks.v1}/logs/?${query.toString()}`);
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
this.postWebhookTest = data => {
|
|
134
|
-
return this.post(`${urls.webhooks.v1}/test`, data);
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
this.postWebhookRetry = id => {
|
|
138
|
-
return this.post(`${urls.webhooks.v1}/logs/${id}/retries`);
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
this.getCategories = () => {
|
|
142
|
-
return this.get(`${urls.events.configurations.v1}/categories`);
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
this.getChannelMaps = channels => {
|
|
146
|
-
return this.get(urls.events.configurations.v1, {
|
|
147
|
-
channels
|
|
148
|
-
});
|
|
149
|
-
};
|
|
5
|
+
import { Get, Patch, Post, Delete, Put } from '../fetch';
|
|
6
|
+
export const getSlackConfiguration = () => {
|
|
7
|
+
return Get(`${urls.integrations.configurations.v1}/slack`);
|
|
8
|
+
};
|
|
9
|
+
export const getSlackScope = () => {
|
|
10
|
+
return Get(`${urls.integrations.configurations.v1}/slack/applications`);
|
|
11
|
+
};
|
|
12
|
+
export const getSlackChannels = () => {
|
|
13
|
+
return Get(`${urls.integrations.configurations.v1}/slack/channels`);
|
|
14
|
+
};
|
|
15
|
+
export const postSlackConfiguration = data => {
|
|
16
|
+
if (data.id) {
|
|
17
|
+
return Patch(`${urls.integrations.configurations.v1}/slack/subscription/${data.id}`, data);
|
|
150
18
|
}
|
|
151
19
|
|
|
152
|
-
}
|
|
153
|
-
|
|
20
|
+
return Post(`${urls.integrations.configurations.v1}/slack/subscriptions`, data);
|
|
21
|
+
};
|
|
22
|
+
export const deleteSlackConfiguration = data => {
|
|
23
|
+
return Delete(`${urls.integrations.configurations.v1}/slack/subscriptions/${data.id}`);
|
|
24
|
+
};
|
|
25
|
+
export const postSlackCode = code => {
|
|
26
|
+
return Post(`${urls.integrations.configurations.v1}/slack/applications/registrations`, {
|
|
27
|
+
code
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
export const getEmailConfiguration = () => {
|
|
31
|
+
return Get(`${urls.integrations.configurations.v1}/emails`);
|
|
32
|
+
};
|
|
33
|
+
export const postEmailConfiguration = _ref => {
|
|
34
|
+
let {
|
|
35
|
+
eventKey
|
|
36
|
+
} = _ref,
|
|
37
|
+
data = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
38
|
+
|
|
39
|
+
return Post(`${urls.integrations.configurations.v1}/emails/${eventKey}`, data);
|
|
40
|
+
};
|
|
41
|
+
export const patchEmailConfiguration = ({
|
|
42
|
+
eventKey,
|
|
43
|
+
enabled
|
|
44
|
+
}) => {
|
|
45
|
+
return Patch(`${urls.integrations.configurations.v1}/emails/${eventKey}`, {
|
|
46
|
+
enabled
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
export const deleteEmailSubscriptions = (eventKey, subscriptionId) => {
|
|
50
|
+
return Delete(`${urls.integrations.configurations.v1}/emails/${eventKey}/subscriptions/${subscriptionId}`);
|
|
51
|
+
};
|
|
52
|
+
export const putEmailSubscriptions = (subscriptionId, eventKey, data) => {
|
|
53
|
+
return Put(`${urls.integrations.configurations.v1}/emails/${eventKey}/subscriptions/${subscriptionId}`, data);
|
|
54
|
+
};
|
|
55
|
+
export const deleteEmailConfiguration = eventKey => {
|
|
56
|
+
return Delete(`${urls.integrations.configurations.v1}/emails/${eventKey}`);
|
|
57
|
+
};
|
|
58
|
+
export const getSMSConfiguration = () => {
|
|
59
|
+
return Get(`${urls.integrations.configurations.v2}/sms`);
|
|
60
|
+
};
|
|
61
|
+
export const postSMSConfiguration = _ref2 => {
|
|
62
|
+
let {
|
|
63
|
+
eventKey
|
|
64
|
+
} = _ref2,
|
|
65
|
+
data = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
66
|
+
|
|
67
|
+
return Post(`${urls.integrations.configurations.v2}/sms/${eventKey}`, data);
|
|
68
|
+
};
|
|
69
|
+
export const patchSMSConfiguration = ({
|
|
70
|
+
eventKey,
|
|
71
|
+
enabled
|
|
72
|
+
}) => {
|
|
73
|
+
return Patch(`${urls.integrations.configurations.v2}/sms/${eventKey}`, {
|
|
74
|
+
enabled
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
export const deleteSMSSubscriptions = (eventKey, subscriptionId) => {
|
|
78
|
+
return Delete(`${urls.integrations.configurations.v2}/sms/${eventKey}/subscriptions/${subscriptionId}`);
|
|
79
|
+
};
|
|
80
|
+
export const putSMSSubscriptions = (subscriptionId, eventKey, data) => {
|
|
81
|
+
return Put(`${urls.integrations.configurations.v2}/sms/${eventKey}/subscriptions/${subscriptionId}`, data);
|
|
82
|
+
};
|
|
83
|
+
export const deleteSMSConfiguration = eventKey => {
|
|
84
|
+
return Delete(`${urls.integrations.configurations.v2}/sms/${eventKey}`);
|
|
85
|
+
};
|
|
86
|
+
export const getWebhooksConfigurations = () => {
|
|
87
|
+
return Get(urls.webhooks.v1);
|
|
88
|
+
};
|
|
89
|
+
export const postWebhooksConfiguration = data => {
|
|
90
|
+
if (data._id) {
|
|
91
|
+
return Patch(`${urls.webhooks.v1}/${data._id}`, data);
|
|
92
|
+
} else {
|
|
93
|
+
return Post(`${urls.webhooks.v1}/custom`, data);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
export const deleteWebhooksConfiguration = id => {
|
|
97
|
+
return Delete(`${urls.webhooks.v1}/${id}`);
|
|
98
|
+
};
|
|
99
|
+
export const getWebhookLog = (id, offset = 0, limit = 10) => {
|
|
100
|
+
const query = new URLSearchParams({
|
|
101
|
+
id,
|
|
102
|
+
offset: `${offset}`,
|
|
103
|
+
limit: `${limit}`
|
|
104
|
+
});
|
|
105
|
+
return Get(`${urls.webhooks.v1}/logs/?${query.toString()}`);
|
|
106
|
+
};
|
|
107
|
+
export const postWebhookTest = data => {
|
|
108
|
+
return Post(`${urls.webhooks.v1}/test`, data);
|
|
109
|
+
};
|
|
110
|
+
export const postWebhookRetry = id => {
|
|
111
|
+
return Post(`${urls.webhooks.v1}/logs/${id}/retries`);
|
|
112
|
+
};
|
|
113
|
+
export const getCategories = () => {
|
|
114
|
+
return Get(`${urls.events.configurations.v1}/categories`);
|
|
115
|
+
};
|
|
116
|
+
export const getChannelMaps = channels => {
|
|
117
|
+
return Get(urls.events.configurations.v1, {
|
|
118
|
+
channels
|
|
119
|
+
});
|
|
120
|
+
};
|
package/directory/index.d.ts
CHANGED
|
@@ -1,32 +1,23 @@
|
|
|
1
1
|
import { Scim2ConnectionConfigResponse, Scim2CountResponse, Scim2CreateConnectionConfigRequest, Scim2CreateConnectionConfigResponse, Scim2PatchConnectionConfigRequest } from './interfaces';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* Delete SCIM2 configuration
|
|
25
|
-
*
|
|
26
|
-
* ``authorized user``
|
|
27
|
-
*/
|
|
28
|
-
deleteConfiguration: (id: string) => Promise<void>;
|
|
29
|
-
countConfigurationUsers: (id: string) => Promise<Scim2CountResponse>;
|
|
30
|
-
}
|
|
31
|
-
declare const _default: DirectoryApi;
|
|
32
|
-
export default _default;
|
|
2
|
+
/**
|
|
3
|
+
* returns all scim2 configurations
|
|
4
|
+
*
|
|
5
|
+
* ``authorized user``
|
|
6
|
+
*/
|
|
7
|
+
export declare function getConfigs(): Promise<Scim2ConnectionConfigResponse[]>;
|
|
8
|
+
/**
|
|
9
|
+
* update scim2 configuration
|
|
10
|
+
* ``authorized user``
|
|
11
|
+
*/
|
|
12
|
+
export declare function updateConfiguration(id: string, body: Scim2PatchConnectionConfigRequest): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* create scim2 configuration
|
|
15
|
+
* ``authorized user``
|
|
16
|
+
*/
|
|
17
|
+
export declare function createConfiguration(body: Scim2CreateConnectionConfigRequest): Promise<Scim2CreateConnectionConfigResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* delete scim2 configuration
|
|
20
|
+
* ``authorized user``
|
|
21
|
+
*/
|
|
22
|
+
export declare function deleteConfiguration(id: string): Promise<void>;
|
|
23
|
+
export declare function countConfigurationUsers(id: string): Promise<Scim2CountResponse>;
|
package/directory/index.js
CHANGED
|
@@ -1,29 +1,17 @@
|
|
|
1
1
|
import { urls } from '../constants';
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
super(appName);
|
|
6
|
-
|
|
7
|
-
this.getConfigs = async () => {
|
|
8
|
-
return this.get(`${urls.directory.v1}`);
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
this.updateConfiguration = async (id, body) => {
|
|
12
|
-
return this.patch(`${urls.directory.v1}/${id}`, body);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
this.createConfiguration = async body => {
|
|
16
|
-
return this.post(`${urls.directory.v1}`, body);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
this.deleteConfiguration = async id => {
|
|
20
|
-
return this.delete(`${urls.directory.v1}/${id}`);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
this.countConfigurationUsers = async id => {
|
|
24
|
-
return this.get(`${urls.directory.temp}/${id}/Users/count`);
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
2
|
+
import { Delete, Get, Patch, Post } from '../fetch';
|
|
3
|
+
export async function getConfigs() {
|
|
4
|
+
return Get(`${urls.directory.v1}`);
|
|
28
5
|
}
|
|
29
|
-
export
|
|
6
|
+
export async function updateConfiguration(id, body) {
|
|
7
|
+
return Patch(`${urls.directory.v1}/${id}`, body);
|
|
8
|
+
}
|
|
9
|
+
export async function createConfiguration(body) {
|
|
10
|
+
return Post(`${urls.directory.v1}`, body);
|
|
11
|
+
}
|
|
12
|
+
export async function deleteConfiguration(id) {
|
|
13
|
+
return Delete(`${urls.directory.v1}/${id}`);
|
|
14
|
+
}
|
|
15
|
+
export async function countConfigurationUsers(id) {
|
|
16
|
+
return Get(`${urls.directory.temp}/${id}/Users/count`);
|
|
17
|
+
}
|
package/entitlements/index.d.ts
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import { UserEntitlementsContext as UserEntitlementsResponseV2 } from "@frontegg/entitlements-javascript-commons";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* `authorized user`
|
|
11
|
-
*/
|
|
12
|
-
loadEntitlementsV2: () => Promise<UserEntitlementsResponseV2>;
|
|
13
|
-
}
|
|
14
|
-
declare const _default: EntitlementsApi;
|
|
15
|
-
export default _default;
|
|
2
|
+
/**
|
|
3
|
+
* Load user entitlements data v2.
|
|
4
|
+
* Including all user permissions and features data.
|
|
5
|
+
* Now the final isEntitled response is not part of it, but includes the data needed to calculate it.
|
|
6
|
+
*
|
|
7
|
+
* ``authorized user``
|
|
8
|
+
*/
|
|
9
|
+
export declare function loadEntitlementsV2(): Promise<UserEntitlementsResponseV2>;
|
package/entitlements/index.js
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { urls } from '../constants';
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
this.loadEntitlementsV2 = async () => {
|
|
8
|
-
return this.get(urls.entitlements.v2);
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
export default new EntitlementsApi('default');
|
|
2
|
+
import { Get } from '../fetch';
|
|
3
|
+
export async function loadEntitlementsV2() {
|
|
4
|
+
return Get(urls.entitlements.v2);
|
|
5
|
+
}
|
package/feature-flags/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { IFeatureFlagsAttributes } from
|
|
2
|
-
import { BaseApiClient } from '../BaseApiClient';
|
|
1
|
+
import { IFeatureFlagsAttributes } from "./interfaces";
|
|
3
2
|
export declare class FeatureFlags {
|
|
4
3
|
private _flags;
|
|
5
4
|
private static _instances;
|
|
@@ -10,9 +9,4 @@ export declare class FeatureFlags {
|
|
|
10
9
|
get flags(): IFeatureFlagsAttributes;
|
|
11
10
|
set(featureFlags?: IFeatureFlagsAttributes): void;
|
|
12
11
|
}
|
|
13
|
-
export declare
|
|
14
|
-
constructor(appName: string);
|
|
15
|
-
loadFeatureFlags: () => Promise<IFeatureFlagsAttributes>;
|
|
16
|
-
}
|
|
17
|
-
declare const _default: FeatureFlagsApi;
|
|
18
|
-
export default _default;
|
|
12
|
+
export declare function loadFeatureFlags(): Promise<IFeatureFlagsAttributes>;
|
package/feature-flags/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { urls } from
|
|
3
|
-
import {
|
|
2
|
+
import { urls } from "../constants";
|
|
3
|
+
import { Get } from "../fetch";
|
|
4
4
|
const defaultFeatureFlags = {
|
|
5
5
|
flags: {}
|
|
6
6
|
};
|
|
@@ -12,11 +12,11 @@ export class FeatureFlags {
|
|
|
12
12
|
this._flags = (_defaultFeatureFlags$ = defaultFeatureFlags.flags) != null ? _defaultFeatureFlags$ : {};
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
static getInstance(name =
|
|
15
|
+
static getInstance(name = "default") {
|
|
16
16
|
return this._instances[name];
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
static set(featureFlags, name =
|
|
19
|
+
static set(featureFlags, name = "default") {
|
|
20
20
|
const featureFlagsInstance = new FeatureFlags();
|
|
21
21
|
featureFlagsInstance.set(featureFlags);
|
|
22
22
|
FeatureFlags._instances[name] = featureFlagsInstance;
|
|
@@ -25,7 +25,7 @@ export class FeatureFlags {
|
|
|
25
25
|
|
|
26
26
|
static getFeatureFlags(flags, name) {
|
|
27
27
|
const featureFlagsInstance = this.getInstance(name);
|
|
28
|
-
return flags.map(flag => (featureFlagsInstance == null ? void 0 : featureFlagsInstance._flags[flag]) ===
|
|
28
|
+
return flags.map(flag => (featureFlagsInstance == null ? void 0 : featureFlagsInstance._flags[flag]) === "on");
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
get flags() {
|
|
@@ -42,14 +42,6 @@ export class FeatureFlags {
|
|
|
42
42
|
|
|
43
43
|
}
|
|
44
44
|
FeatureFlags._instances = {};
|
|
45
|
-
export
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
this.loadFeatureFlags = async () => {
|
|
50
|
-
return this.get(urls.featureFlags.v1);
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
export default new FeatureFlagsApi('default');
|
|
45
|
+
export async function loadFeatureFlags() {
|
|
46
|
+
return Get(urls.featureFlags.v1);
|
|
47
|
+
}
|
package/fetch.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ContextOptions, UserJwtOptions } from './interfaces';
|
|
2
|
+
interface RequestOptions {
|
|
3
|
+
url: string;
|
|
4
|
+
method: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
|
|
5
|
+
body?: any;
|
|
6
|
+
params?: any;
|
|
7
|
+
contentType?: string;
|
|
8
|
+
responseType?: 'json' | 'plain' | 'blob';
|
|
9
|
+
headers?: Record<string, string>;
|
|
10
|
+
credentials?: RequestCredentials;
|
|
11
|
+
}
|
|
12
|
+
export declare function getBaseUrl(context: ContextOptions, url: string, withFronteggPrefix?: boolean): string;
|
|
13
|
+
export declare function getMetadataHeaders(context: ContextOptions): Record<string, string>;
|
|
14
|
+
export declare function getScopedTenant(): string | null;
|
|
15
|
+
export declare const Get: (url: string, params?: any, opts?: Pick<RequestOptions, "body" | "params" | "contentType" | "responseType" | "headers" | "credentials"> | undefined) => Promise<any>;
|
|
16
|
+
export declare const Post: (url: string, body?: any, opts?: Pick<RequestOptions, "body" | "params" | "contentType" | "responseType" | "headers" | "credentials"> | undefined) => Promise<any>;
|
|
17
|
+
export declare const Patch: (url: string, body?: any, opts?: Pick<RequestOptions, "body" | "params" | "contentType" | "responseType" | "headers" | "credentials"> | undefined) => Promise<any>;
|
|
18
|
+
export declare const Put: (url: string, body?: any, opts?: Pick<RequestOptions, "body" | "params" | "contentType" | "responseType" | "headers" | "credentials"> | undefined) => Promise<any>;
|
|
19
|
+
export declare const Delete: (url: string, body?: any, opts?: Pick<RequestOptions, "body" | "params" | "contentType" | "responseType" | "headers" | "credentials"> | undefined) => Promise<any>;
|
|
20
|
+
export declare const PostDownload: (url: string, body?: any, params?: any, opts?: any) => Promise<any>;
|
|
21
|
+
export declare const extractHeadersFromOptions: (options?: UserJwtOptions) => {
|
|
22
|
+
Authorization?: string;
|
|
23
|
+
};
|
|
24
|
+
export {};
|