@frontegg/rest-api 3.0.1 → 3.0.4

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 (69) hide show
  1. package/ContextHolder.js +67 -101
  2. package/account-settings/index.js +4 -43
  3. package/audits/index.js +16 -69
  4. package/auth/enums.js +2 -2
  5. package/auth/index.d.ts +4 -0
  6. package/auth/index.js +354 -2044
  7. package/auth/interfaces.js +1 -1
  8. package/auth/secutiry-poilicy/index.js +45 -254
  9. package/connectivity/index.js +79 -73
  10. package/constants.js +1 -1
  11. package/error.js +9 -33
  12. package/fetch.js +165 -519
  13. package/index.js +26 -26
  14. package/jwt.js +19 -45
  15. package/metadata/index.js +19 -159
  16. package/node/ContextHolder.js +68 -104
  17. package/node/account-settings/index.js +4 -46
  18. package/node/audits/index.js +15 -68
  19. package/node/auth/enums.js +2 -2
  20. package/node/auth/index.js +487 -2099
  21. package/node/auth/interfaces.js +2 -2
  22. package/node/auth/secutiry-poilicy/index.js +36 -240
  23. package/node/connectivity/index.js +78 -71
  24. package/node/constants.js +1 -1
  25. package/node/error.js +9 -38
  26. package/node/fetch.js +166 -521
  27. package/node/index.js +47 -49
  28. package/node/jwt.js +19 -51
  29. package/node/metadata/index.js +19 -163
  30. package/node/notifications/index.js +18 -94
  31. package/node/reports/index.js +62 -171
  32. package/node/roles/index.js +34 -172
  33. package/node/routers.js +2 -2
  34. package/node/sub-tenants/index.js +12 -126
  35. package/node/subscriptions/enums.js +4 -4
  36. package/node/subscriptions/index.js +10 -10
  37. package/node/subscriptions/interfaces.js +1 -1
  38. package/node/subscriptions/invoices.js +10 -70
  39. package/node/subscriptions/managedSubscriptions.js +16 -111
  40. package/node/subscriptions/paymentMethods.js +15 -69
  41. package/node/subscriptions/paymentProviders.js +2 -26
  42. package/node/subscriptions/plans.js +4 -46
  43. package/node/subscriptions/providers/index.js +1 -1
  44. package/node/subscriptions/providers/stripe/index.js +10 -106
  45. package/node/subscriptions/subscriptions.js +16 -111
  46. package/node/subscriptions/summaries.js +2 -26
  47. package/node/subscriptions/tenantConfiguration.js +4 -46
  48. package/node/teams/index.js +57 -406
  49. package/node/tenants/index.js +8 -86
  50. package/node/vendor/index.js +2 -26
  51. package/notifications/index.js +18 -93
  52. package/package.json +1 -1
  53. package/reports/index.js +65 -175
  54. package/roles/index.js +34 -175
  55. package/routers.js +2 -2
  56. package/sub-tenants/index.js +12 -127
  57. package/subscriptions/enums.js +4 -4
  58. package/subscriptions/invoices.js +12 -70
  59. package/subscriptions/managedSubscriptions.js +20 -115
  60. package/subscriptions/paymentMethods.js +16 -70
  61. package/subscriptions/paymentProviders.js +2 -22
  62. package/subscriptions/plans.js +4 -43
  63. package/subscriptions/providers/stripe/index.js +10 -106
  64. package/subscriptions/subscriptions.js +20 -115
  65. package/subscriptions/summaries.js +2 -22
  66. package/subscriptions/tenantConfiguration.js +4 -43
  67. package/teams/index.js +56 -420
  68. package/tenants/index.js +8 -85
  69. package/vendor/index.js +2 -23
@@ -7,7 +7,7 @@ export * from './secutiry-poilicy/interfaces';
7
7
  ;
8
8
  ;
9
9
  ;
10
- export var SecondaryAuthStrategy;
10
+ export let SecondaryAuthStrategy;
11
11
 
12
12
  (function (SecondaryAuthStrategy) {
13
13
  SecondaryAuthStrategy["WebAuthnPlatform"] = "WebAuthnPlatform";
@@ -1,257 +1,48 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
- import _regeneratorRuntime from "@babel/runtime/regenerator";
3
1
  import { Get, Patch, Post } from '../../fetch';
4
2
  import { urls } from '../../constants';
5
- export function getGlobalSecurityPolicy() {
6
- return _getGlobalSecurityPolicy.apply(this, arguments);
7
- }
8
-
9
- function _getGlobalSecurityPolicy() {
10
- _getGlobalSecurityPolicy = _asyncToGenerator(_regeneratorRuntime.mark(function _callee() {
11
- return _regeneratorRuntime.wrap(function _callee$(_context) {
12
- while (1) {
13
- switch (_context.prev = _context.next) {
14
- case 0:
15
- return _context.abrupt("return", Get(urls.identity.configurations.v1));
16
-
17
- case 1:
18
- case "end":
19
- return _context.stop();
20
- }
21
- }
22
- }, _callee);
23
- }));
24
- return _getGlobalSecurityPolicy.apply(this, arguments);
25
- }
26
-
27
- export function getMfaPolicy() {
28
- return _getMfaPolicy.apply(this, arguments);
29
- }
30
-
31
- function _getMfaPolicy() {
32
- _getMfaPolicy = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2() {
33
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
34
- while (1) {
35
- switch (_context2.prev = _context2.next) {
36
- case 0:
37
- return _context2.abrupt("return", Get("".concat(urls.identity.configurations.v1, "/mfa-policy")));
38
-
39
- case 1:
40
- case "end":
41
- return _context2.stop();
42
- }
43
- }
44
- }, _callee2);
45
- }));
46
- return _getMfaPolicy.apply(this, arguments);
47
- }
48
-
49
- export function getVendorMfaPolicy() {
50
- return _getVendorMfaPolicy.apply(this, arguments);
51
- }
52
-
53
- function _getVendorMfaPolicy() {
54
- _getVendorMfaPolicy = _asyncToGenerator(_regeneratorRuntime.mark(function _callee3() {
55
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
56
- while (1) {
57
- switch (_context3.prev = _context3.next) {
58
- case 0:
59
- return _context3.abrupt("return", Get("".concat(urls.identity.configurations.v1, "/mfa-policy/vendor")));
60
-
61
- case 1:
62
- case "end":
63
- return _context3.stop();
64
- }
65
- }
66
- }, _callee3);
67
- }));
68
- return _getVendorMfaPolicy.apply(this, arguments);
69
- }
70
-
71
- export function saveMfaPolicy(_x) {
72
- return _saveMfaPolicy.apply(this, arguments);
73
- }
74
-
75
- function _saveMfaPolicy() {
76
- _saveMfaPolicy = _asyncToGenerator(_regeneratorRuntime.mark(function _callee4(body) {
77
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
78
- while (1) {
79
- switch (_context4.prev = _context4.next) {
80
- case 0:
81
- if (!body.id) {
82
- _context4.next = 4;
83
- break;
84
- }
85
-
86
- return _context4.abrupt("return", Patch("".concat(urls.identity.configurations.v1, "/mfa-policy"), body));
87
-
88
- case 4:
89
- return _context4.abrupt("return", Post("".concat(urls.identity.configurations.v1, "/mfa-policy"), body));
90
-
91
- case 5:
92
- case "end":
93
- return _context4.stop();
94
- }
95
- }
96
- }, _callee4);
97
- }));
98
- return _saveMfaPolicy.apply(this, arguments);
99
- }
100
-
101
- export function getLockoutPolicy() {
102
- return _getLockoutPolicy.apply(this, arguments);
103
- }
104
-
105
- function _getLockoutPolicy() {
106
- _getLockoutPolicy = _asyncToGenerator(_regeneratorRuntime.mark(function _callee5() {
107
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
108
- while (1) {
109
- switch (_context5.prev = _context5.next) {
110
- case 0:
111
- return _context5.abrupt("return", Get("".concat(urls.identity.configurations.v1, "/lockout-policy")));
112
-
113
- case 1:
114
- case "end":
115
- return _context5.stop();
116
- }
117
- }
118
- }, _callee5);
119
- }));
120
- return _getLockoutPolicy.apply(this, arguments);
121
- }
122
-
123
- export function saveLockoutPolicy(_x2) {
124
- return _saveLockoutPolicy.apply(this, arguments);
125
- }
126
-
127
- function _saveLockoutPolicy() {
128
- _saveLockoutPolicy = _asyncToGenerator(_regeneratorRuntime.mark(function _callee6(body) {
129
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
130
- while (1) {
131
- switch (_context6.prev = _context6.next) {
132
- case 0:
133
- if (!body.id) {
134
- _context6.next = 4;
135
- break;
136
- }
137
-
138
- return _context6.abrupt("return", Patch("".concat(urls.identity.configurations.v1, "/lockout-policy"), body));
139
-
140
- case 4:
141
- return _context6.abrupt("return", Post("".concat(urls.identity.configurations.v1, "/lockout-policy"), body));
142
-
143
- case 5:
144
- case "end":
145
- return _context6.stop();
146
- }
147
- }
148
- }, _callee6);
149
- }));
150
- return _saveLockoutPolicy.apply(this, arguments);
151
- }
152
-
153
- export function getCaptchaPolicy() {
154
- return _getCaptchaPolicy.apply(this, arguments);
155
- }
156
-
157
- function _getCaptchaPolicy() {
158
- _getCaptchaPolicy = _asyncToGenerator(_regeneratorRuntime.mark(function _callee7() {
159
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
160
- while (1) {
161
- switch (_context7.prev = _context7.next) {
162
- case 0:
163
- _context7.prev = 0;
164
- _context7.next = 3;
165
- return Get("".concat(urls.identity.configurations.v1, "/captcha-policy/public"));
166
-
167
- case 3:
168
- return _context7.abrupt("return", _context7.sent);
169
-
170
- case 6:
171
- _context7.prev = 6;
172
- _context7.t0 = _context7["catch"](0);
173
- return _context7.abrupt("return", null);
174
-
175
- case 9:
176
- case "end":
177
- return _context7.stop();
178
- }
179
- }
180
- }, _callee7, null, [[0, 6]]);
181
- }));
182
- return _getCaptchaPolicy.apply(this, arguments);
183
- }
184
-
185
- export function getPasswordHistoryPolicy() {
186
- return _getPasswordHistoryPolicy.apply(this, arguments);
187
- }
188
-
189
- function _getPasswordHistoryPolicy() {
190
- _getPasswordHistoryPolicy = _asyncToGenerator(_regeneratorRuntime.mark(function _callee8() {
191
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
192
- while (1) {
193
- switch (_context8.prev = _context8.next) {
194
- case 0:
195
- return _context8.abrupt("return", Get("".concat(urls.identity.configurations.v1, "/password-history-policy")));
196
-
197
- case 1:
198
- case "end":
199
- return _context8.stop();
200
- }
201
- }
202
- }, _callee8);
203
- }));
204
- return _getPasswordHistoryPolicy.apply(this, arguments);
205
- }
206
-
207
- export function savePasswordHistoryPolicy(_x3) {
208
- return _savePasswordHistoryPolicy.apply(this, arguments);
209
- }
210
-
211
- function _savePasswordHistoryPolicy() {
212
- _savePasswordHistoryPolicy = _asyncToGenerator(_regeneratorRuntime.mark(function _callee9(body) {
213
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
214
- while (1) {
215
- switch (_context9.prev = _context9.next) {
216
- case 0:
217
- if (!body.id) {
218
- _context9.next = 4;
219
- break;
220
- }
221
-
222
- return _context9.abrupt("return", Patch("".concat(urls.identity.configurations.v1, "/password-history-policy"), body));
223
-
224
- case 4:
225
- return _context9.abrupt("return", Post("".concat(urls.identity.configurations.v1, "/password-history-policy"), body));
226
-
227
- case 5:
228
- case "end":
229
- return _context9.stop();
230
- }
231
- }
232
- }, _callee9);
233
- }));
234
- return _savePasswordHistoryPolicy.apply(this, arguments);
235
- }
236
-
237
- export function getPasswordConfigPolicy() {
238
- return _getPasswordConfigPolicy.apply(this, arguments);
239
- }
240
-
241
- function _getPasswordConfigPolicy() {
242
- _getPasswordConfigPolicy = _asyncToGenerator(_regeneratorRuntime.mark(function _callee10() {
243
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
244
- while (1) {
245
- switch (_context10.prev = _context10.next) {
246
- case 0:
247
- return _context10.abrupt("return", Get("".concat(urls.identity.configurations.v1, "/password")));
248
-
249
- case 1:
250
- case "end":
251
- return _context10.stop();
252
- }
253
- }
254
- }, _callee10);
255
- }));
256
- return _getPasswordConfigPolicy.apply(this, arguments);
3
+ export async function getGlobalSecurityPolicy() {
4
+ return Get(urls.identity.configurations.v1);
5
+ }
6
+ export async function getMfaPolicy() {
7
+ return Get(`${urls.identity.configurations.v1}/mfa-policy`);
8
+ }
9
+ export async function getVendorMfaPolicy() {
10
+ return Get(`${urls.identity.configurations.v1}/mfa-policy/vendor`);
11
+ }
12
+ export async function saveMfaPolicy(body) {
13
+ if (body.id) {
14
+ return Patch(`${urls.identity.configurations.v1}/mfa-policy`, body);
15
+ } else {
16
+ return Post(`${urls.identity.configurations.v1}/mfa-policy`, body);
17
+ }
18
+ }
19
+ export async function getLockoutPolicy() {
20
+ return Get(`${urls.identity.configurations.v1}/lockout-policy`);
21
+ }
22
+ export async function saveLockoutPolicy(body) {
23
+ if (body.id) {
24
+ return Patch(`${urls.identity.configurations.v1}/lockout-policy`, body);
25
+ } else {
26
+ return Post(`${urls.identity.configurations.v1}/lockout-policy`, body);
27
+ }
28
+ }
29
+ export async function getCaptchaPolicy() {
30
+ try {
31
+ return await Get(`${urls.identity.configurations.v1}/captcha-policy/public`);
32
+ } catch {
33
+ return null;
34
+ }
35
+ }
36
+ export async function getPasswordHistoryPolicy() {
37
+ return Get(`${urls.identity.configurations.v1}/password-history-policy`);
38
+ }
39
+ export async function savePasswordHistoryPolicy(body) {
40
+ if (body.id) {
41
+ return Patch(`${urls.identity.configurations.v1}/password-history-policy`, body);
42
+ } else {
43
+ return Post(`${urls.identity.configurations.v1}/password-history-policy`, body);
44
+ }
45
+ }
46
+ export async function getPasswordConfigPolicy() {
47
+ return Get(`${urls.identity.configurations.v1}/password`);
257
48
  }
@@ -1,114 +1,120 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
1
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
+ const _excluded = ["eventKey"],
3
+ _excluded2 = ["eventKey"];
2
4
  import { urls } from '../constants';
3
5
  import { Get, Patch, Post, Delete, Put } from '../fetch';
4
- export var getSlackConfiguration = function getSlackConfiguration() {
5
- return Get("".concat(urls.integrations.configurations.v1, "/slack"));
6
+ export const getSlackConfiguration = () => {
7
+ return Get(`${urls.integrations.configurations.v1}/slack`);
6
8
  };
7
- export var getSlackScope = function getSlackScope() {
8
- return Get("".concat(urls.integrations.configurations.v1, "/slack/applications"));
9
+ export const getSlackScope = () => {
10
+ return Get(`${urls.integrations.configurations.v1}/slack/applications`);
9
11
  };
10
- export var getSlackChannels = function getSlackChannels() {
11
- return Get("".concat(urls.integrations.configurations.v1, "/slack/channels"));
12
+ export const getSlackChannels = () => {
13
+ return Get(`${urls.integrations.configurations.v1}/slack/channels`);
12
14
  };
13
- export var postSlackConfiguration = function postSlackConfiguration(data) {
15
+ export const postSlackConfiguration = data => {
14
16
  if (data.id) {
15
- return Patch("".concat(urls.integrations.configurations.v1, "/slack/subscription/").concat(data.id), data);
17
+ return Patch(`${urls.integrations.configurations.v1}/slack/subscription/${data.id}`, data);
16
18
  }
17
19
 
18
- return Post("".concat(urls.integrations.configurations.v1, "/slack/subscriptions"), data);
20
+ return Post(`${urls.integrations.configurations.v1}/slack/subscriptions`, data);
19
21
  };
20
- export var deleteSlackConfiguration = function deleteSlackConfiguration(data) {
21
- return Delete("".concat(urls.integrations.configurations.v1, "/slack/subscriptions/").concat(data.id));
22
+ export const deleteSlackConfiguration = data => {
23
+ return Delete(`${urls.integrations.configurations.v1}/slack/subscriptions/${data.id}`);
22
24
  };
23
- export var postSlackCode = function postSlackCode(code) {
24
- return Post("".concat(urls.integrations.configurations.v1, "/slack/applications/registrations"), {
25
- code: code
25
+ export const postSlackCode = code => {
26
+ return Post(`${urls.integrations.configurations.v1}/slack/applications/registrations`, {
27
+ code
26
28
  });
27
29
  };
28
- export var getEmailConfiguration = function getEmailConfiguration() {
29
- return Get("".concat(urls.integrations.configurations.v1, "/emails"));
30
+ export const getEmailConfiguration = () => {
31
+ return Get(`${urls.integrations.configurations.v1}/emails`);
30
32
  };
31
- export var postEmailConfiguration = function postEmailConfiguration(_ref) {
32
- var eventKey = _ref.eventKey,
33
- data = _objectWithoutProperties(_ref, ["eventKey"]);
33
+ export const postEmailConfiguration = _ref => {
34
+ let {
35
+ eventKey
36
+ } = _ref,
37
+ data = _objectWithoutPropertiesLoose(_ref, _excluded);
34
38
 
35
- return Post("".concat(urls.integrations.configurations.v1, "/emails/").concat(eventKey), data);
36
- };
37
- export var patchEmailConfiguration = function patchEmailConfiguration(_ref2) {
38
- var eventKey = _ref2.eventKey,
39
- enabled = _ref2.enabled;
40
- return Patch("".concat(urls.integrations.configurations.v1, "/emails/").concat(eventKey), {
41
- enabled: enabled
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
42
47
  });
43
48
  };
44
- export var deleteEmailSubscriptions = function deleteEmailSubscriptions(eventKey, subscriptionId) {
45
- return Delete("".concat(urls.integrations.configurations.v1, "/emails/").concat(eventKey, "/subscriptions/").concat(subscriptionId));
49
+ export const deleteEmailSubscriptions = (eventKey, subscriptionId) => {
50
+ return Delete(`${urls.integrations.configurations.v1}/emails/${eventKey}/subscriptions/${subscriptionId}`);
46
51
  };
47
- export var putEmailSubscriptions = function putEmailSubscriptions(subscriptionId, eventKey, data) {
48
- return Put("".concat(urls.integrations.configurations.v1, "/emails/").concat(eventKey, "/subscriptions/").concat(subscriptionId), data);
52
+ export const putEmailSubscriptions = (subscriptionId, eventKey, data) => {
53
+ return Put(`${urls.integrations.configurations.v1}/emails/${eventKey}/subscriptions/${subscriptionId}`, data);
49
54
  };
50
- export var deleteEmailConfiguration = function deleteEmailConfiguration(eventKey) {
51
- return Delete("".concat(urls.integrations.configurations.v1, "/emails/").concat(eventKey));
55
+ export const deleteEmailConfiguration = eventKey => {
56
+ return Delete(`${urls.integrations.configurations.v1}/emails/${eventKey}`);
52
57
  };
53
- export var getSMSConfiguration = function getSMSConfiguration() {
54
- return Get("".concat(urls.integrations.configurations.v2, "/sms"));
58
+ export const getSMSConfiguration = () => {
59
+ return Get(`${urls.integrations.configurations.v2}/sms`);
55
60
  };
56
- export var postSMSConfiguration = function postSMSConfiguration(_ref3) {
57
- var eventKey = _ref3.eventKey,
58
- data = _objectWithoutProperties(_ref3, ["eventKey"]);
61
+ export const postSMSConfiguration = _ref2 => {
62
+ let {
63
+ eventKey
64
+ } = _ref2,
65
+ data = _objectWithoutPropertiesLoose(_ref2, _excluded2);
59
66
 
60
- return Post("".concat(urls.integrations.configurations.v2, "/sms/").concat(eventKey), data);
61
- };
62
- export var patchSMSConfiguration = function patchSMSConfiguration(_ref4) {
63
- var eventKey = _ref4.eventKey,
64
- enabled = _ref4.enabled;
65
- return Patch("".concat(urls.integrations.configurations.v2, "/sms/").concat(eventKey), {
66
- enabled: enabled
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
67
75
  });
68
76
  };
69
- export var deleteSMSSubscriptions = function deleteSMSSubscriptions(eventKey, subscriptionId) {
70
- return Delete("".concat(urls.integrations.configurations.v2, "/sms/").concat(eventKey, "/subscriptions/").concat(subscriptionId));
77
+ export const deleteSMSSubscriptions = (eventKey, subscriptionId) => {
78
+ return Delete(`${urls.integrations.configurations.v2}/sms/${eventKey}/subscriptions/${subscriptionId}`);
71
79
  };
72
- export var putSMSSubscriptions = function putSMSSubscriptions(subscriptionId, eventKey, data) {
73
- return Put("".concat(urls.integrations.configurations.v2, "/sms/").concat(eventKey, "/subscriptions/").concat(subscriptionId), data);
80
+ export const putSMSSubscriptions = (subscriptionId, eventKey, data) => {
81
+ return Put(`${urls.integrations.configurations.v2}/sms/${eventKey}/subscriptions/${subscriptionId}`, data);
74
82
  };
75
- export var deleteSMSConfiguration = function deleteSMSConfiguration(eventKey) {
76
- return Delete("".concat(urls.integrations.configurations.v2, "/sms/").concat(eventKey));
83
+ export const deleteSMSConfiguration = eventKey => {
84
+ return Delete(`${urls.integrations.configurations.v2}/sms/${eventKey}`);
77
85
  };
78
- export var getWebhooksConfigurations = function getWebhooksConfigurations() {
86
+ export const getWebhooksConfigurations = () => {
79
87
  return Get(urls.webhooks.v1);
80
88
  };
81
- export var postWebhooksConfiguration = function postWebhooksConfiguration(data) {
89
+ export const postWebhooksConfiguration = data => {
82
90
  if (data._id) {
83
- return Patch("".concat(urls.webhooks.v1, "/").concat(data._id), data);
91
+ return Patch(`${urls.webhooks.v1}/${data._id}`, data);
84
92
  } else {
85
- return Post("".concat(urls.webhooks.v1, "/custom"), data);
93
+ return Post(`${urls.webhooks.v1}/custom`, data);
86
94
  }
87
95
  };
88
- export var deleteWebhooksConfiguration = function deleteWebhooksConfiguration(id) {
89
- return Delete("".concat(urls.webhooks.v1, "/").concat(id));
96
+ export const deleteWebhooksConfiguration = id => {
97
+ return Delete(`${urls.webhooks.v1}/${id}`);
90
98
  };
91
- export var getWebhookLog = function getWebhookLog(id) {
92
- var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
93
- var limit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
94
- var query = new URLSearchParams({
95
- id: id,
96
- offset: "".concat(offset),
97
- limit: "".concat(limit)
99
+ export const getWebhookLog = (id, offset = 0, limit = 10) => {
100
+ const query = new URLSearchParams({
101
+ id,
102
+ offset: `${offset}`,
103
+ limit: `${limit}`
98
104
  });
99
- return Get("".concat(urls.webhooks.v1, "/logs/?").concat(query.toString()));
105
+ return Get(`${urls.webhooks.v1}/logs/?${query.toString()}`);
100
106
  };
101
- export var postWebhookTest = function postWebhookTest(data) {
102
- return Post("".concat(urls.webhooks.v1, "/test"), data);
107
+ export const postWebhookTest = data => {
108
+ return Post(`${urls.webhooks.v1}/test`, data);
103
109
  };
104
- export var postWebhookRetry = function postWebhookRetry(id) {
105
- return Post("".concat(urls.webhooks.v1, "/logs/").concat(id, "/retries"));
110
+ export const postWebhookRetry = id => {
111
+ return Post(`${urls.webhooks.v1}/logs/${id}/retries`);
106
112
  };
107
- export var getCategories = function getCategories() {
108
- return Get("".concat(urls.events.configurations.v1, "/categories"));
113
+ export const getCategories = () => {
114
+ return Get(`${urls.events.configurations.v1}/categories`);
109
115
  };
110
- export var getChannelMaps = function getChannelMaps(channels) {
116
+ export const getChannelMaps = channels => {
111
117
  return Get(urls.events.configurations.v1, {
112
- channels: channels
118
+ channels
113
119
  });
114
120
  };
package/constants.js CHANGED
@@ -1,4 +1,4 @@
1
- export var urls = {
1
+ export const urls = {
2
2
  vendor: '/vendors',
3
3
  identity: {
4
4
  webAuthnDevices: {
package/error.js CHANGED
@@ -1,36 +1,12 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _inherits from "@babel/runtime/helpers/esm/inherits";
4
- import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
5
- import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
6
- import _wrapNativeSuper from "@babel/runtime/helpers/esm/wrapNativeSuper";
7
-
8
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
-
10
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
11
-
12
- export var FronteggApiError = function (_Error) {
13
- _inherits(FronteggApiError, _Error);
14
-
15
- var _super = _createSuper(FronteggApiError);
16
-
17
- function FronteggApiError(message, statusCode) {
18
- var _this;
19
-
20
- _classCallCheck(this, FronteggApiError);
21
-
22
- _this = _super.call(this, message);
23
- _this._statusCode = void 0;
24
- _this._statusCode = statusCode;
25
- return _this;
1
+ export class FronteggApiError extends Error {
2
+ constructor(message, statusCode) {
3
+ super(message);
4
+ this._statusCode = void 0;
5
+ this._statusCode = statusCode;
26
6
  }
27
7
 
28
- _createClass(FronteggApiError, [{
29
- key: "statusCode",
30
- get: function get() {
31
- return this._statusCode;
32
- }
33
- }]);
8
+ get statusCode() {
9
+ return this._statusCode;
10
+ }
34
11
 
35
- return FronteggApiError;
36
- }(_wrapNativeSuper(Error));
12
+ }