@frontegg/rest-api 3.0.1 → 3.0.2

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