@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.
Files changed (122) hide show
  1. package/BaseApiClient.d.ts +16 -0
  2. package/BaseApiClient.js +39 -0
  3. package/ContextHolder/index.d.ts +108 -27
  4. package/ContextHolder/index.js +155 -50
  5. package/FetchClient.d.ts +42 -0
  6. package/FetchClient.js +308 -0
  7. package/account-settings/index.d.ts +19 -7
  8. package/account-settings/index.js +23 -13
  9. package/applications/index.d.ts +49 -44
  10. package/applications/index.js +51 -37
  11. package/audits/index.d.ts +27 -15
  12. package/audits/index.js +27 -17
  13. package/auth/index.d.ts +817 -768
  14. package/auth/index.js +902 -721
  15. package/auth/secutiry-poilicy/index.d.ts +58 -102
  16. package/auth/secutiry-poilicy/index.js +122 -90
  17. package/auth/utils.d.ts +2 -2
  18. package/auth/utils.js +9 -8
  19. package/connectivity/index.d.ts +126 -27
  20. package/connectivity/index.js +147 -114
  21. package/directory/index.d.ts +31 -22
  22. package/directory/index.js +27 -15
  23. package/entitlements/index.d.ts +14 -8
  24. package/entitlements/index.js +12 -4
  25. package/feature-flags/index.d.ts +8 -2
  26. package/feature-flags/index.js +16 -8
  27. package/groups/index.d.ts +73 -49
  28. package/groups/index.js +64 -45
  29. package/impersonate/index.d.ts +15 -6
  30. package/impersonate/index.js +13 -5
  31. package/index.d.ts +154 -108
  32. package/index.js +109 -78
  33. package/interfaces.d.ts +10 -0
  34. package/metadata/index.d.ts +67 -7
  35. package/metadata/index.js +52 -32
  36. package/node/BaseApiClient.js +49 -0
  37. package/node/ContextHolder/index.js +155 -50
  38. package/node/FetchClient.js +326 -0
  39. package/node/account-settings/index.js +27 -16
  40. package/node/applications/index.js +51 -44
  41. package/node/audits/index.js +31 -20
  42. package/node/auth/index.js +768 -1035
  43. package/node/auth/secutiry-poilicy/index.js +125 -136
  44. package/node/auth/utils.js +9 -7
  45. package/node/connectivity/index.js +148 -187
  46. package/node/directory/index.js +29 -20
  47. package/node/entitlements/index.js +18 -5
  48. package/node/feature-flags/index.js +21 -9
  49. package/node/groups/index.js +65 -63
  50. package/node/impersonate/index.js +18 -5
  51. package/node/index.js +116 -71
  52. package/node/metadata/index.js +61 -52
  53. package/node/notifications/index.js +37 -27
  54. package/node/reports/index.js +78 -70
  55. package/node/roles/index.js +56 -51
  56. package/node/security-center/index.js +21 -9
  57. package/node/sub-tenants/index.js +90 -89
  58. package/node/subscriptions/index.js +69 -107
  59. package/node/subscriptions/invoices.js +25 -17
  60. package/node/subscriptions/managedSubscriptions.js +32 -27
  61. package/node/subscriptions/paymentMethods.js +27 -20
  62. package/node/subscriptions/paymentProviders.js +15 -6
  63. package/node/subscriptions/plans.js +17 -9
  64. package/node/subscriptions/providers/stripe/index.js +26 -21
  65. package/node/subscriptions/subscriptions.js +32 -27
  66. package/node/subscriptions/summaries.js +15 -6
  67. package/node/subscriptions/tenantConfiguration.js +17 -9
  68. package/node/subscriptions/vendorPublicConfigurations.js +15 -6
  69. package/node/teams/index.js +130 -138
  70. package/node/tenants/index.js +65 -60
  71. package/node/user-phone-numbers/index.js +32 -24
  72. package/node/users/index.js +58 -53
  73. package/node/vendor/index.js +17 -6
  74. package/notifications/index.d.ts +22 -16
  75. package/notifications/index.js +33 -22
  76. package/package.json +1 -1
  77. package/reports/index.d.ts +50 -44
  78. package/reports/index.js +75 -62
  79. package/roles/index.d.ts +44 -38
  80. package/roles/index.js +57 -41
  81. package/security-center/index.d.ts +14 -2
  82. package/security-center/index.js +15 -6
  83. package/sub-tenants/index.d.ts +57 -15
  84. package/sub-tenants/index.js +88 -68
  85. package/subscriptions/index.d.ts +56 -11
  86. package/subscriptions/index.js +58 -11
  87. package/subscriptions/invoices.d.ts +16 -13
  88. package/subscriptions/invoices.js +24 -14
  89. package/subscriptions/managedSubscriptions.d.ts +18 -15
  90. package/subscriptions/managedSubscriptions.js +33 -22
  91. package/subscriptions/paymentMethods.d.ts +16 -13
  92. package/subscriptions/paymentMethods.js +26 -17
  93. package/subscriptions/paymentProviders.d.ts +8 -5
  94. package/subscriptions/paymentProviders.js +11 -4
  95. package/subscriptions/plans.d.ts +11 -8
  96. package/subscriptions/plans.js +14 -6
  97. package/subscriptions/providers/stripe/index.d.ts +24 -21
  98. package/subscriptions/providers/stripe/index.js +27 -16
  99. package/subscriptions/subscriptions.d.ts +24 -21
  100. package/subscriptions/subscriptions.js +33 -22
  101. package/subscriptions/summaries.d.ts +7 -4
  102. package/subscriptions/summaries.js +10 -3
  103. package/subscriptions/tenantConfiguration.d.ts +6 -3
  104. package/subscriptions/tenantConfiguration.js +15 -7
  105. package/subscriptions/vendorPublicConfigurations.d.ts +5 -2
  106. package/subscriptions/vendorPublicConfigurations.js +11 -4
  107. package/teams/index.d.ts +35 -131
  108. package/teams/index.js +122 -93
  109. package/tenants/index.d.ts +25 -37
  110. package/tenants/index.js +62 -46
  111. package/user-phone-numbers/index.d.ts +32 -26
  112. package/user-phone-numbers/index.js +32 -19
  113. package/users/index.d.ts +21 -15
  114. package/users/index.js +60 -44
  115. package/vendor/index.d.ts +12 -6
  116. package/vendor/index.js +11 -4
  117. package/fetch.d.ts +0 -24
  118. package/fetch.js +0 -265
  119. package/node/fetch.js +0 -306
  120. package/node/subscriptions/providers/index.js +0 -18
  121. package/subscriptions/providers/index.d.ts +0 -1
  122. package/subscriptions/providers/index.js +0 -1
@@ -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 { 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);
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
- 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);
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
- 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
- };
151
+
152
+ }
153
+ export default new ConnectivityApi('default');
@@ -1,23 +1,32 @@
1
1
  import { Scim2ConnectionConfigResponse, Scim2CountResponse, Scim2CreateConnectionConfigRequest, Scim2CreateConnectionConfigResponse, Scim2PatchConnectionConfigRequest } from './interfaces';
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>;
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;
@@ -1,17 +1,29 @@
1
1
  import { urls } from '../constants';
2
- import { Delete, Get, Patch, Post } from '../fetch';
3
- export async function getConfigs() {
4
- return Get(`${urls.directory.v1}`);
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 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
- }
29
+ export default new DirectoryApi('default');
@@ -1,9 +1,15 @@
1
1
  import { UserEntitlementsContext as UserEntitlementsResponseV2 } from "@frontegg/entitlements-javascript-commons";
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>;
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;
@@ -1,5 +1,13 @@
1
1
  import { urls } from '../constants';
2
- import { Get } from '../fetch';
3
- export async function loadEntitlementsV2() {
4
- return Get(urls.entitlements.v2);
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');
@@ -1,4 +1,5 @@
1
- import { IFeatureFlagsAttributes } from "./interfaces";
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 function loadFeatureFlags(): Promise<IFeatureFlagsAttributes>;
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;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import { urls } from "../constants";
3
- import { Get } from "../fetch";
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 = "default") {
15
+ static getInstance(name = 'default') {
16
16
  return this._instances[name];
17
17
  }
18
18
 
19
- static set(featureFlags, name = "default") {
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]) === "on");
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 async function loadFeatureFlags() {
46
- return Get(urls.featureFlags.v1);
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 "./interfaces";
2
- /**
3
- * Get group by given id
4
- */
5
- export declare function getGroupById({ groupId }: IGetGroup, query?: IGetGroupQueryOptions): Promise<IGroupResponse>;
6
- /**
7
- * Get all tenant groups
8
- */
9
- export declare function getGroups(query?: IGetGroupQueryOptions): Promise<IGroupResponse[]>;
10
- /**
11
- * Get groups by ids
12
- */
13
- export declare function getGroupsByIds(body: IGetGroupsByIds, params?: IGetGroupQueryOptions): Promise<IGroupResponse[]>;
14
- /**
15
- * Create new group
16
- */
17
- export declare function createGroup(body: ICreateGroup): Promise<ICreateGroupResponse>;
18
- /**
19
- * Update existing group by Id
20
- */
21
- export declare function updateGroup({ groupId, ...body }: IUpdateGroup): Promise<void>;
22
- /**
23
- * Delete existing group by Id
24
- */
25
- export declare function deleteGroup(groupId: string): Promise<void>;
26
- /**
27
- * Add roles to existing group
28
- */
29
- export declare function addRolesToGroup(groupId: string, body: IUpdateGroupRoles): Promise<void>;
30
- /**
31
- * Delete roles from existing group
32
- */
33
- export declare function deleteRolesFromGroup(groupId: string, body: IUpdateGroupRoles): Promise<void>;
34
- /**
35
- * Add users to existing group
36
- */
37
- export declare function addUsersToGroup(groupId: string, body: IUpdateGroupUsers): Promise<void>;
38
- /**
39
- * Delete users from existing group
40
- */
41
- export declare function deleteUsersFromGroup(groupId: string, body: IUpdateGroupUsers): Promise<void>;
42
- /**
43
- * Get or create default groups configuration
44
- */
45
- export declare function getGroupConfiguration(): Promise<IGroupConfigResponse>;
46
- /**
47
- * Create or update groups configuration
48
- */
49
- export declare function updateGroupConfiguration(body: IUpdateGroupConfig): Promise<IGroupConfigResponse>;
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;