@frontegg/rest-api 3.1.74 → 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 (123) 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/tenants/interfaces.d.ts +2 -0
  112. package/user-phone-numbers/index.d.ts +32 -26
  113. package/user-phone-numbers/index.js +32 -19
  114. package/users/index.d.ts +21 -15
  115. package/users/index.js +60 -44
  116. package/vendor/index.d.ts +12 -6
  117. package/vendor/index.js +11 -4
  118. package/fetch.d.ts +0 -24
  119. package/fetch.js +0 -265
  120. package/node/fetch.js +0 -306
  121. package/node/subscriptions/providers/index.js +0 -18
  122. package/subscriptions/providers/index.d.ts +0 -1
  123. package/subscriptions/providers/index.js +0 -1
@@ -3,58 +3,65 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.assignUserToApplications = assignUserToApplications;
7
- exports.getApplicationsData = getApplicationsData;
8
- exports.getTenantsApplications = getTenantsApplications;
9
- exports.getUserApplicationsId = getUserApplicationsId;
10
- exports.getUsersApplicationsId = getUsersApplicationsId;
11
- exports.getUsersOfApplications = getUsersOfApplications;
12
- exports.unassignUserFromApplications = unassignUserFromApplications;
6
+ exports.default = exports.ApplicationsApi = void 0;
13
7
 
14
8
  var _constants = require("../constants");
15
9
 
16
- var _fetch = require("../fetch");
10
+ var _BaseApiClient = require("../BaseApiClient");
17
11
 
18
- async function getUserApplicationsId({
19
- userId
20
- }) {
21
- return (0, _fetch.Get)(`${_constants.urls.identity.applications.v1}/${userId}/apps`);
22
- }
12
+ class ApplicationsApi extends _BaseApiClient.BaseApiClient {
13
+ constructor(appName) {
14
+ super(appName);
23
15
 
24
- async function getUsersApplicationsId({
25
- userIds
26
- }) {
27
- return (0, _fetch.Get)(`${_constants.urls.identity.applications.v1}/users-apps`, {
28
- userIds: userIds.join(',')
29
- });
30
- }
16
+ this.getUserApplicationsId = async ({
17
+ userId
18
+ }) => {
19
+ return this.get(`${_constants.urls.identity.applications.v1}/${userId}/apps`);
20
+ };
31
21
 
32
- async function getTenantsApplications() {
33
- return (0, _fetch.Get)(_constants.urls.applications.tenant.v1);
34
- }
22
+ this.getUsersApplicationsId = async ({
23
+ userIds
24
+ }) => {
25
+ return this.get(`${_constants.urls.identity.applications.v1}/users-apps`, {
26
+ userIds: userIds.join(',')
27
+ });
28
+ };
35
29
 
36
- async function getApplicationsData({
37
- appIds,
38
- includeFreeAccess = true
39
- }) {
40
- return (0, _fetch.Get)(_constants.urls.applications.v1, {
41
- ids: appIds.join(','),
42
- _includeFreeAccess: includeFreeAccess
43
- });
44
- }
30
+ this.getTenantsApplications = async () => {
31
+ return this.get(_constants.urls.applications.tenant.v1);
32
+ };
45
33
 
46
- async function assignUserToApplications(body) {
47
- return (0, _fetch.Post)(`${_constants.urls.identity.applications.v1}/apps-user`, body);
48
- }
34
+ this.getApplicationsData = async ({
35
+ appIds,
36
+ includeFreeAccess = true
37
+ }) => {
38
+ return this.get(_constants.urls.applications.v1, {
39
+ ids: appIds.join(','),
40
+ _includeFreeAccess: includeFreeAccess
41
+ });
42
+ };
43
+
44
+ this.assignUserToApplications = async body => {
45
+ return this.post(`${_constants.urls.identity.applications.v1}/apps-user`, body);
46
+ };
47
+
48
+ this.unassignUserFromApplications = async body => {
49
+ return this.delete(`${_constants.urls.identity.applications.v1}/user-apps`, body);
50
+ };
51
+
52
+ this.getUsersOfApplications = async ({
53
+ appIds
54
+ }) => {
55
+ return this.get(`${_constants.urls.identity.applications.v1}/apps-users`, {
56
+ appIds: appIds.join(',')
57
+ });
58
+ };
59
+ }
49
60
 
50
- async function unassignUserFromApplications(body) {
51
- return (0, _fetch.Delete)(`${_constants.urls.identity.applications.v1}/user-apps`, body);
52
61
  }
53
62
 
54
- async function getUsersOfApplications({
55
- appIds
56
- }) {
57
- return (0, _fetch.Get)(`${_constants.urls.identity.applications.v1}/apps-users`, {
58
- appIds: appIds.join(',')
59
- });
60
- }
63
+ exports.ApplicationsApi = ApplicationsApi;
64
+
65
+ var _default = new ApplicationsApi('default');
66
+
67
+ exports.default = _default;
@@ -5,33 +5,44 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.exportAudits = exportAudits;
9
- exports.getAudits = getAudits;
10
- exports.getAuditsStats = getAuditsStats;
8
+ exports.default = exports.AuditsApi = void 0;
11
9
 
12
10
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
13
11
 
14
- var _fetch = require("../fetch");
15
-
16
12
  var _constants = require("../constants");
17
13
 
14
+ var _BaseApiClient = require("../BaseApiClient");
15
+
18
16
  const _excluded = ["endpoint", "headerProps"];
19
17
 
20
- async function getAudits(params) {
21
- return (0, _fetch.Get)(_constants.urls.audits.v1, params);
22
- }
18
+ class AuditsApi extends _BaseApiClient.BaseApiClient {
19
+ constructor(appName) {
20
+ super(appName);
21
+
22
+ this.getAudits = async params => {
23
+ return this.get(_constants.urls.audits.v1, params);
24
+ };
25
+
26
+ this.getAuditsStats = async params => {
27
+ return this.get(`${_constants.urls.audits.v1}/stats`, params);
28
+ };
29
+
30
+ this.exportAudits = async params => {
31
+ const {
32
+ endpoint,
33
+ headerProps
34
+ } = params,
35
+ restParams = (0, _objectWithoutPropertiesLoose2.default)(params, _excluded);
36
+ return this.postDownload(`${_constants.urls.audits.v1}/export/${endpoint}`, {
37
+ properties: headerProps
38
+ }, restParams);
39
+ };
40
+ }
23
41
 
24
- async function getAuditsStats(params) {
25
- return (0, _fetch.Get)(`${_constants.urls.audits.v1}/stats`, params);
26
42
  }
27
43
 
28
- async function exportAudits(params) {
29
- const {
30
- endpoint,
31
- headerProps
32
- } = params,
33
- restParams = (0, _objectWithoutPropertiesLoose2.default)(params, _excluded);
34
- return (0, _fetch.PostDownload)(`${_constants.urls.audits.v1}/export/${endpoint}`, {
35
- properties: headerProps
36
- }, restParams);
37
- }
44
+ exports.AuditsApi = AuditsApi;
45
+
46
+ var _default = new AuditsApi('default');
47
+
48
+ exports.default = _default;