@frontegg/rest-api 3.1.76-alpha.9502349697 → 3.1.76-alpha.9794353373

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/ContextHolder/index.d.ts +30 -108
  2. package/ContextHolder/index.js +57 -153
  3. package/account-settings/index.d.ts +7 -19
  4. package/account-settings/index.js +13 -23
  5. package/applications/index.d.ts +44 -49
  6. package/applications/index.js +37 -51
  7. package/audits/index.d.ts +15 -27
  8. package/audits/index.js +17 -27
  9. package/auth/index.d.ts +768 -817
  10. package/auth/index.js +721 -902
  11. package/auth/secutiry-poilicy/index.d.ts +102 -58
  12. package/auth/secutiry-poilicy/index.js +90 -122
  13. package/auth/utils.d.ts +2 -2
  14. package/auth/utils.js +8 -9
  15. package/connectivity/index.d.ts +27 -126
  16. package/connectivity/index.js +114 -147
  17. package/directory/index.d.ts +22 -31
  18. package/directory/index.js +15 -27
  19. package/entitlements/index.d.ts +8 -14
  20. package/entitlements/index.js +4 -12
  21. package/feature-flags/index.d.ts +2 -8
  22. package/feature-flags/index.js +8 -16
  23. package/fetch.d.ts +24 -0
  24. package/fetch.js +265 -0
  25. package/groups/index.d.ts +49 -73
  26. package/groups/index.js +45 -64
  27. package/impersonate/index.d.ts +6 -15
  28. package/impersonate/index.js +5 -13
  29. package/index.d.ts +108 -154
  30. package/index.js +78 -109
  31. package/interfaces.d.ts +0 -10
  32. package/metadata/index.d.ts +7 -67
  33. package/metadata/index.js +32 -52
  34. package/node/ContextHolder/index.js +57 -153
  35. package/node/account-settings/index.js +16 -27
  36. package/node/applications/index.js +44 -51
  37. package/node/audits/index.js +20 -31
  38. package/node/auth/index.js +1035 -768
  39. package/node/auth/secutiry-poilicy/index.js +136 -125
  40. package/node/auth/utils.js +7 -9
  41. package/node/connectivity/index.js +187 -148
  42. package/node/directory/index.js +20 -29
  43. package/node/entitlements/index.js +5 -18
  44. package/node/feature-flags/index.js +9 -21
  45. package/node/fetch.js +306 -0
  46. package/node/groups/index.js +63 -65
  47. package/node/impersonate/index.js +5 -18
  48. package/node/index.js +71 -116
  49. package/node/metadata/index.js +52 -61
  50. package/node/notifications/index.js +27 -37
  51. package/node/reports/index.js +70 -78
  52. package/node/roles/index.js +51 -56
  53. package/node/security-center/index.js +9 -21
  54. package/node/sub-tenants/index.js +89 -90
  55. package/node/subscriptions/index.js +107 -69
  56. package/node/subscriptions/invoices.js +17 -25
  57. package/node/subscriptions/managedSubscriptions.js +27 -32
  58. package/node/subscriptions/paymentMethods.js +20 -27
  59. package/node/subscriptions/paymentProviders.js +6 -15
  60. package/node/subscriptions/plans.js +9 -17
  61. package/node/subscriptions/providers/index.js +18 -0
  62. package/node/subscriptions/providers/stripe/index.js +21 -26
  63. package/node/subscriptions/subscriptions.js +27 -32
  64. package/node/subscriptions/summaries.js +6 -15
  65. package/node/subscriptions/tenantConfiguration.js +9 -17
  66. package/node/subscriptions/vendorPublicConfigurations.js +6 -15
  67. package/node/teams/index.js +138 -130
  68. package/node/tenants/index.js +60 -65
  69. package/node/user-phone-numbers/index.js +24 -32
  70. package/node/users/index.js +53 -58
  71. package/node/vendor/index.js +6 -17
  72. package/notifications/index.d.ts +16 -22
  73. package/notifications/index.js +22 -33
  74. package/package.json +1 -1
  75. package/reports/index.d.ts +44 -50
  76. package/reports/index.js +62 -75
  77. package/roles/index.d.ts +38 -44
  78. package/roles/index.js +41 -57
  79. package/security-center/index.d.ts +2 -14
  80. package/security-center/index.js +6 -15
  81. package/sub-tenants/index.d.ts +15 -57
  82. package/sub-tenants/index.js +68 -88
  83. package/subscriptions/index.d.ts +11 -56
  84. package/subscriptions/index.js +11 -58
  85. package/subscriptions/invoices.d.ts +13 -16
  86. package/subscriptions/invoices.js +14 -24
  87. package/subscriptions/managedSubscriptions.d.ts +15 -18
  88. package/subscriptions/managedSubscriptions.js +22 -33
  89. package/subscriptions/paymentMethods.d.ts +13 -16
  90. package/subscriptions/paymentMethods.js +17 -26
  91. package/subscriptions/paymentProviders.d.ts +5 -8
  92. package/subscriptions/paymentProviders.js +4 -11
  93. package/subscriptions/plans.d.ts +8 -11
  94. package/subscriptions/plans.js +6 -14
  95. package/subscriptions/providers/index.d.ts +1 -0
  96. package/subscriptions/providers/index.js +1 -0
  97. package/subscriptions/providers/stripe/index.d.ts +21 -24
  98. package/subscriptions/providers/stripe/index.js +16 -27
  99. package/subscriptions/subscriptions.d.ts +21 -24
  100. package/subscriptions/subscriptions.js +22 -33
  101. package/subscriptions/summaries.d.ts +4 -7
  102. package/subscriptions/summaries.js +3 -10
  103. package/subscriptions/tenantConfiguration.d.ts +3 -6
  104. package/subscriptions/tenantConfiguration.js +7 -15
  105. package/subscriptions/vendorPublicConfigurations.d.ts +2 -5
  106. package/subscriptions/vendorPublicConfigurations.js +4 -11
  107. package/teams/index.d.ts +131 -35
  108. package/teams/index.js +93 -122
  109. package/tenants/index.d.ts +37 -25
  110. package/tenants/index.js +46 -62
  111. package/user-phone-numbers/index.d.ts +26 -32
  112. package/user-phone-numbers/index.js +19 -32
  113. package/users/index.d.ts +15 -21
  114. package/users/index.js +44 -60
  115. package/vendor/index.d.ts +6 -12
  116. package/vendor/index.js +4 -11
  117. package/BaseApiClient.d.ts +0 -16
  118. package/BaseApiClient.js +0 -39
  119. package/FetchClient.d.ts +0 -42
  120. package/FetchClient.js +0 -308
  121. package/node/BaseApiClient.js +0 -49
  122. package/node/FetchClient.js +0 -326
@@ -1,53 +1,39 @@
1
1
  import { urls } from "../constants";
2
- import { BaseApiClient } from '../BaseApiClient';
3
- export class ApplicationsApi extends BaseApiClient {
4
- constructor(appName) {
5
- super(appName);
6
-
7
- this.getUserApplicationsId = async ({
8
- userId
9
- }) => {
10
- return this.get(`${urls.identity.applications.v1}/${userId}/apps`);
11
- };
12
-
13
- this.getUsersApplicationsId = async ({
14
- userIds
15
- }) => {
16
- return this.get(`${urls.identity.applications.v1}/users-apps`, {
17
- userIds: userIds.join(',')
18
- });
19
- };
20
-
21
- this.getTenantsApplications = async () => {
22
- return this.get(urls.applications.tenant.v1);
23
- };
24
-
25
- this.getApplicationsData = async ({
26
- appIds,
27
- includeFreeAccess = true
28
- }) => {
29
- return this.get(urls.applications.v1, {
30
- ids: appIds.join(','),
31
- _includeFreeAccess: includeFreeAccess
32
- });
33
- };
34
-
35
- this.assignUserToApplications = async body => {
36
- return this.post(`${urls.identity.applications.v1}/apps-user`, body);
37
- };
38
-
39
- this.unassignUserFromApplications = async body => {
40
- return this.delete(`${urls.identity.applications.v1}/user-apps`, body);
41
- };
42
-
43
- this.getUsersOfApplications = async ({
44
- appIds
45
- }) => {
46
- return this.get(`${urls.identity.applications.v1}/apps-users`, {
47
- appIds: appIds.join(',')
48
- });
49
- };
50
- }
51
-
2
+ import { Post, Get, Delete } from "../fetch";
3
+ export async function getUserApplicationsId({
4
+ userId
5
+ }) {
6
+ return Get(`${urls.identity.applications.v1}/${userId}/apps`);
52
7
  }
53
- export default new ApplicationsApi('default');
8
+ export async function getUsersApplicationsId({
9
+ userIds
10
+ }) {
11
+ return Get(`${urls.identity.applications.v1}/users-apps`, {
12
+ userIds: userIds.join(',')
13
+ });
14
+ }
15
+ export async function getTenantsApplications() {
16
+ return Get(urls.applications.tenant.v1);
17
+ }
18
+ export async function getApplicationsData({
19
+ appIds,
20
+ includeFreeAccess = true
21
+ }) {
22
+ return Get(urls.applications.v1, {
23
+ ids: appIds.join(','),
24
+ _includeFreeAccess: includeFreeAccess
25
+ });
26
+ }
27
+ export async function assignUserToApplications(body) {
28
+ return Post(`${urls.identity.applications.v1}/apps-user`, body);
29
+ }
30
+ export async function unassignUserFromApplications(body) {
31
+ return Delete(`${urls.identity.applications.v1}/user-apps`, body);
32
+ }
33
+ export async function getUsersOfApplications({
34
+ appIds
35
+ }) {
36
+ return Get(`${urls.identity.applications.v1}/apps-users`, {
37
+ appIds: appIds.join(',')
38
+ });
39
+ }
package/audits/index.d.ts CHANGED
@@ -1,28 +1,16 @@
1
1
  import { IAudits, IAuditsStats, IGetAuditsParams, IGetAuditsStatsParams, IExportAudits } from './interfaces';
2
- import { BaseApiClient } from '../BaseApiClient';
3
- export declare class AuditsApi extends BaseApiClient {
4
- constructor(appName: string);
5
- /**
6
- * Fetches audit logs based on the provided parameters.
7
- *
8
- * @param params - Parameters to filter and paginate audits.
9
- * @returns A promise that resolves to the list of audits.
10
- */
11
- getAudits: (params: IGetAuditsParams) => Promise<IAudits>;
12
- /**
13
- * Retrieves audit statistics based on the provided parameters.
14
- *
15
- * @param params - Parameters to filter and define the scope of the stats.
16
- * @returns A promise that resolves to the audits statistics.
17
- */
18
- getAuditsStats: (params: IGetAuditsStatsParams) => Promise<IAuditsStats>;
19
- /**
20
- * Exports audit logs based on the provided parameters.
21
- *
22
- * @param params - Parameters including endpoint, header properties, and other request specifics.
23
- * @returns A promise that initiates a download for the exported audits.
24
- */
25
- exportAudits: (params: IExportAudits) => Promise<void>;
26
- }
27
- declare const _default: AuditsApi;
28
- export default _default;
2
+ /*****************************************
3
+ * Audits Api
4
+ *****************************************/
5
+ /**
6
+ * get Audits
7
+ */
8
+ export declare function getAudits(params: IGetAuditsParams): Promise<IAudits>;
9
+ /**
10
+ * get Audits Stats
11
+ */
12
+ export declare function getAuditsStats(params: IGetAuditsStatsParams): Promise<IAuditsStats>;
13
+ /**
14
+ * export Audits
15
+ */
16
+ export declare function exportAudits(params: IExportAudits): Promise<any>;
package/audits/index.js CHANGED
@@ -1,31 +1,21 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  const _excluded = ["endpoint", "headerProps"];
3
+ import { Get, PostDownload } from '../fetch';
3
4
  import { urls } from '../constants';
4
- import { BaseApiClient } from '../BaseApiClient';
5
- export class AuditsApi extends BaseApiClient {
6
- constructor(appName) {
7
- super(appName);
8
-
9
- this.getAudits = async params => {
10
- return this.get(urls.audits.v1, params);
11
- };
12
-
13
- this.getAuditsStats = async params => {
14
- return this.get(`${urls.audits.v1}/stats`, params);
15
- };
16
-
17
- this.exportAudits = async params => {
18
- const {
19
- endpoint,
20
- headerProps
21
- } = params,
22
- restParams = _objectWithoutPropertiesLoose(params, _excluded);
23
-
24
- return this.postDownload(`${urls.audits.v1}/export/${endpoint}`, {
25
- properties: headerProps
26
- }, restParams);
27
- };
28
- }
29
-
5
+ export async function getAudits(params) {
6
+ return Get(urls.audits.v1, params);
7
+ }
8
+ export async function getAuditsStats(params) {
9
+ return Get(`${urls.audits.v1}/stats`, params);
30
10
  }
31
- export default new AuditsApi('default');
11
+ export async function exportAudits(params) {
12
+ const {
13
+ endpoint,
14
+ headerProps
15
+ } = params,
16
+ restParams = _objectWithoutPropertiesLoose(params, _excluded);
17
+
18
+ return PostDownload(`${urls.audits.v1}/export/${endpoint}`, {
19
+ properties: headerProps
20
+ }, restParams);
21
+ }