@frontegg/rest-api 3.1.75 → 3.1.76-alpha.9502349697
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 +39 -0
- package/ContextHolder/index.d.ts +108 -27
- package/ContextHolder/index.js +155 -50
- package/FetchClient.d.ts +42 -0
- package/FetchClient.js +308 -0
- package/account-settings/index.d.ts +19 -7
- package/account-settings/index.js +23 -13
- package/applications/index.d.ts +49 -44
- package/applications/index.js +51 -37
- package/audits/index.d.ts +27 -15
- package/audits/index.js +27 -17
- package/auth/index.d.ts +817 -768
- package/auth/index.js +902 -721
- package/auth/secutiry-poilicy/index.d.ts +58 -102
- package/auth/secutiry-poilicy/index.js +122 -90
- package/auth/utils.d.ts +2 -2
- package/auth/utils.js +9 -8
- package/connectivity/index.d.ts +126 -27
- package/connectivity/index.js +147 -114
- package/directory/index.d.ts +31 -22
- package/directory/index.js +27 -15
- package/entitlements/index.d.ts +14 -8
- package/entitlements/index.js +12 -4
- package/feature-flags/index.d.ts +8 -2
- package/feature-flags/index.js +16 -8
- package/groups/index.d.ts +73 -49
- package/groups/index.js +64 -45
- package/impersonate/index.d.ts +15 -6
- package/impersonate/index.js +13 -5
- package/index.d.ts +154 -108
- package/index.js +109 -78
- package/interfaces.d.ts +10 -0
- package/metadata/index.d.ts +67 -7
- package/metadata/index.js +52 -32
- package/node/BaseApiClient.js +49 -0
- package/node/ContextHolder/index.js +155 -50
- package/node/FetchClient.js +326 -0
- package/node/account-settings/index.js +27 -16
- package/node/applications/index.js +51 -44
- package/node/audits/index.js +31 -20
- package/node/auth/index.js +768 -1035
- package/node/auth/secutiry-poilicy/index.js +125 -136
- package/node/auth/utils.js +9 -7
- package/node/connectivity/index.js +148 -187
- package/node/directory/index.js +29 -20
- package/node/entitlements/index.js +18 -5
- package/node/feature-flags/index.js +21 -9
- package/node/groups/index.js +65 -63
- package/node/impersonate/index.js +18 -5
- package/node/index.js +116 -71
- package/node/metadata/index.js +61 -52
- package/node/notifications/index.js +37 -27
- package/node/reports/index.js +78 -70
- package/node/roles/index.js +56 -51
- package/node/security-center/index.js +21 -9
- package/node/sub-tenants/index.js +90 -89
- package/node/subscriptions/index.js +69 -107
- package/node/subscriptions/invoices.js +25 -17
- package/node/subscriptions/managedSubscriptions.js +32 -27
- package/node/subscriptions/paymentMethods.js +27 -20
- package/node/subscriptions/paymentProviders.js +15 -6
- package/node/subscriptions/plans.js +17 -9
- package/node/subscriptions/providers/stripe/index.js +26 -21
- package/node/subscriptions/subscriptions.js +32 -27
- package/node/subscriptions/summaries.js +15 -6
- package/node/subscriptions/tenantConfiguration.js +17 -9
- package/node/subscriptions/vendorPublicConfigurations.js +15 -6
- package/node/teams/index.js +130 -138
- package/node/tenants/index.js +65 -60
- package/node/user-phone-numbers/index.js +32 -24
- package/node/users/index.js +58 -53
- package/node/vendor/index.js +17 -6
- package/notifications/index.d.ts +22 -16
- package/notifications/index.js +33 -22
- package/package.json +1 -1
- package/reports/index.d.ts +50 -44
- package/reports/index.js +75 -62
- package/roles/index.d.ts +44 -38
- package/roles/index.js +57 -41
- package/security-center/index.d.ts +14 -2
- package/security-center/index.js +15 -6
- package/sub-tenants/index.d.ts +57 -15
- package/sub-tenants/index.js +88 -68
- package/subscriptions/index.d.ts +56 -11
- package/subscriptions/index.js +58 -11
- package/subscriptions/invoices.d.ts +16 -13
- package/subscriptions/invoices.js +24 -14
- package/subscriptions/managedSubscriptions.d.ts +18 -15
- package/subscriptions/managedSubscriptions.js +33 -22
- package/subscriptions/paymentMethods.d.ts +16 -13
- package/subscriptions/paymentMethods.js +26 -17
- package/subscriptions/paymentProviders.d.ts +8 -5
- package/subscriptions/paymentProviders.js +11 -4
- package/subscriptions/plans.d.ts +11 -8
- package/subscriptions/plans.js +14 -6
- package/subscriptions/providers/stripe/index.d.ts +24 -21
- package/subscriptions/providers/stripe/index.js +27 -16
- package/subscriptions/subscriptions.d.ts +24 -21
- package/subscriptions/subscriptions.js +33 -22
- package/subscriptions/summaries.d.ts +7 -4
- package/subscriptions/summaries.js +10 -3
- package/subscriptions/tenantConfiguration.d.ts +6 -3
- package/subscriptions/tenantConfiguration.js +15 -7
- package/subscriptions/vendorPublicConfigurations.d.ts +5 -2
- package/subscriptions/vendorPublicConfigurations.js +11 -4
- package/teams/index.d.ts +35 -131
- package/teams/index.js +122 -93
- package/tenants/index.d.ts +25 -37
- package/tenants/index.js +62 -46
- package/user-phone-numbers/index.d.ts +32 -26
- package/user-phone-numbers/index.js +32 -19
- package/users/index.d.ts +21 -15
- package/users/index.js +60 -44
- package/vendor/index.d.ts +12 -6
- package/vendor/index.js +11 -4
- package/fetch.d.ts +0 -24
- package/fetch.js +0 -265
- package/node/fetch.js +0 -306
- package/node/subscriptions/providers/index.js +0 -18
- package/subscriptions/providers/index.d.ts +0 -1
- package/subscriptions/providers/index.js +0 -1
package/connectivity/index.js
CHANGED
|
@@ -2,119 +2,152 @@ 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
|
-
|
|
5
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
6
|
+
export class ConnectivityApi extends BaseApiClient {
|
|
7
|
+
constructor(appName) {
|
|
8
|
+
super(appName);
|
|
9
|
+
|
|
10
|
+
this.getSlackConfiguration = () => {
|
|
11
|
+
return this.get(`${urls.integrations.configurations.v1}/slack`);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
this.getSlackScope = () => {
|
|
15
|
+
return this.get(`${urls.integrations.configurations.v1}/slack/applications`);
|
|
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
|
+
};
|
|
19
73
|
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
+
};
|
|
94
150
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
-
};
|
|
151
|
+
|
|
152
|
+
}
|
|
153
|
+
export default new ConnectivityApi('default');
|
package/directory/index.d.ts
CHANGED
|
@@ -1,23 +1,32 @@
|
|
|
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
|
-
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export declare class DirectoryApi extends BaseApiClient {
|
|
4
|
+
constructor(appName: string);
|
|
5
|
+
/**
|
|
6
|
+
* Returns all SCIM2 configurations
|
|
7
|
+
*
|
|
8
|
+
* ``authorized user``
|
|
9
|
+
*/
|
|
10
|
+
getConfigs: () => Promise<Scim2ConnectionConfigResponse[]>;
|
|
11
|
+
/**
|
|
12
|
+
* Update SCIM2 configuration
|
|
13
|
+
*
|
|
14
|
+
* ``authorized user``
|
|
15
|
+
*/
|
|
16
|
+
updateConfiguration: (id: string, body: Scim2PatchConnectionConfigRequest) => Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Create SCIM2 configuration
|
|
19
|
+
*
|
|
20
|
+
* ``authorized user``
|
|
21
|
+
*/
|
|
22
|
+
createConfiguration: (body: Scim2CreateConnectionConfigRequest) => Promise<Scim2CreateConnectionConfigResponse>;
|
|
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;
|
package/directory/index.js
CHANGED
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
import { urls } from '../constants';
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export class DirectoryApi extends BaseApiClient {
|
|
4
|
+
constructor(appName) {
|
|
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
|
+
|
|
5
28
|
}
|
|
6
|
-
export
|
|
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
|
-
}
|
|
29
|
+
export default new DirectoryApi('default');
|
package/entitlements/index.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { UserEntitlementsContext as UserEntitlementsResponseV2 } from "@frontegg/entitlements-javascript-commons";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export declare class EntitlementsApi extends BaseApiClient {
|
|
4
|
+
constructor(appName: string);
|
|
5
|
+
/**
|
|
6
|
+
* Load user entitlements data v2.
|
|
7
|
+
* Including all user permissions and features data.
|
|
8
|
+
* Now the final isEntitled response is not part of it, but includes the data needed to calculate it.
|
|
9
|
+
*
|
|
10
|
+
* `authorized user`
|
|
11
|
+
*/
|
|
12
|
+
loadEntitlementsV2: () => Promise<UserEntitlementsResponseV2>;
|
|
13
|
+
}
|
|
14
|
+
declare const _default: EntitlementsApi;
|
|
15
|
+
export default _default;
|
package/entitlements/index.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { urls } from '../constants';
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export class EntitlementsApi extends BaseApiClient {
|
|
4
|
+
constructor(appName) {
|
|
5
|
+
super(appName);
|
|
6
|
+
|
|
7
|
+
this.loadEntitlementsV2 = async () => {
|
|
8
|
+
return this.get(urls.entitlements.v2);
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
export default new EntitlementsApi('default');
|
package/feature-flags/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { IFeatureFlagsAttributes } from
|
|
1
|
+
import { IFeatureFlagsAttributes } from './interfaces';
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
2
3
|
export declare class FeatureFlags {
|
|
3
4
|
private _flags;
|
|
4
5
|
private static _instances;
|
|
@@ -9,4 +10,9 @@ export declare class FeatureFlags {
|
|
|
9
10
|
get flags(): IFeatureFlagsAttributes;
|
|
10
11
|
set(featureFlags?: IFeatureFlagsAttributes): void;
|
|
11
12
|
}
|
|
12
|
-
export declare
|
|
13
|
+
export declare class FeatureFlagsApi extends BaseApiClient {
|
|
14
|
+
constructor(appName: string);
|
|
15
|
+
loadFeatureFlags: () => Promise<IFeatureFlagsAttributes>;
|
|
16
|
+
}
|
|
17
|
+
declare const _default: FeatureFlagsApi;
|
|
18
|
+
export default _default;
|
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 { BaseApiClient } from '../BaseApiClient';
|
|
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,6 +42,14 @@ export class FeatureFlags {
|
|
|
42
42
|
|
|
43
43
|
}
|
|
44
44
|
FeatureFlags._instances = {};
|
|
45
|
-
export
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
export class FeatureFlagsApi extends BaseApiClient {
|
|
46
|
+
constructor(appName) {
|
|
47
|
+
super(appName);
|
|
48
|
+
|
|
49
|
+
this.loadFeatureFlags = async () => {
|
|
50
|
+
return this.get(urls.featureFlags.v1);
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
export default new FeatureFlagsApi('default');
|
package/groups/index.d.ts
CHANGED
|
@@ -1,49 +1,73 @@
|
|
|
1
|
-
import { ICreateGroup, ICreateGroupResponse, IGetGroup, IGetGroupQueryOptions, IGetGroupsByIds, IGroupConfigResponse, IGroupResponse, IUpdateGroup, IUpdateGroupConfig, IUpdateGroupRoles, IUpdateGroupUsers } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
1
|
+
import { ICreateGroup, ICreateGroupResponse, IGetGroup, IGetGroupQueryOptions, IGetGroupsByIds, IGroupConfigResponse, IGroupResponse, IUpdateGroup, IUpdateGroupConfig, IUpdateGroupRoles, IUpdateGroupUsers } from './interfaces';
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export declare class GroupsApi extends BaseApiClient {
|
|
4
|
+
constructor(appName: string);
|
|
5
|
+
/**
|
|
6
|
+
* Get group by given id
|
|
7
|
+
* @param groupId - The ID of the group to retrieve
|
|
8
|
+
* @param query - Optional query parameters
|
|
9
|
+
*/
|
|
10
|
+
getGroupById: ({ groupId }: IGetGroup, query?: IGetGroupQueryOptions | undefined) => Promise<IGroupResponse>;
|
|
11
|
+
/**
|
|
12
|
+
* Get all tenant groups
|
|
13
|
+
* @param query - Optional query parameters
|
|
14
|
+
*/
|
|
15
|
+
getGroups: (query?: IGetGroupQueryOptions | undefined) => Promise<IGroupResponse[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Get groups by ids
|
|
18
|
+
* @param body - Request body containing group IDs
|
|
19
|
+
* @param params - Optional query parameters
|
|
20
|
+
*/
|
|
21
|
+
getGroupsByIds: (body: IGetGroupsByIds, params?: IGetGroupQueryOptions | undefined) => Promise<IGroupResponse[]>;
|
|
22
|
+
/**
|
|
23
|
+
* Create new group
|
|
24
|
+
* @param body - Request body to create a group
|
|
25
|
+
*/
|
|
26
|
+
createGroup: (body: ICreateGroup) => Promise<ICreateGroupResponse>;
|
|
27
|
+
/**
|
|
28
|
+
* Update existing group by Id
|
|
29
|
+
* @param groupId - The ID of the group to update
|
|
30
|
+
* @param body - Request body containing update data
|
|
31
|
+
*/
|
|
32
|
+
updateGroup: ({ groupId, ...body }: IUpdateGroup) => Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Delete existing group by Id
|
|
35
|
+
* @param groupId - The ID of the group to delete
|
|
36
|
+
*/
|
|
37
|
+
deleteGroup: (groupId: string) => Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Add roles to existing group
|
|
40
|
+
* @param groupId - The ID of the group
|
|
41
|
+
* @param body - Request body containing roles to add
|
|
42
|
+
*/
|
|
43
|
+
addRolesToGroup: (groupId: string, body: IUpdateGroupRoles) => Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Delete roles from existing group
|
|
46
|
+
* @param groupId - The ID of the group
|
|
47
|
+
* @param body - Request body containing roles to delete
|
|
48
|
+
*/
|
|
49
|
+
deleteRolesFromGroup: (groupId: string, body: IUpdateGroupRoles) => Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Add users to existing group
|
|
52
|
+
* @param groupId - The ID of the group
|
|
53
|
+
* @param body - Request body containing users to add
|
|
54
|
+
*/
|
|
55
|
+
addUsersToGroup: (groupId: string, body: IUpdateGroupUsers) => Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Delete users from existing group
|
|
58
|
+
* @param groupId - The ID of the group
|
|
59
|
+
* @param body - Request body containing users to delete
|
|
60
|
+
*/
|
|
61
|
+
deleteUsersFromGroup: (groupId: string, body: IUpdateGroupUsers) => Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Get or create default groups configuration
|
|
64
|
+
*/
|
|
65
|
+
getGroupConfiguration: () => Promise<IGroupConfigResponse>;
|
|
66
|
+
/**
|
|
67
|
+
* Create or update groups configuration
|
|
68
|
+
* @param body - Request body to update group configuration
|
|
69
|
+
*/
|
|
70
|
+
updateGroupConfiguration: (body: IUpdateGroupConfig) => Promise<IGroupConfigResponse>;
|
|
71
|
+
}
|
|
72
|
+
declare const _default: GroupsApi;
|
|
73
|
+
export default _default;
|