@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.
- package/ContextHolder.js +67 -101
- package/account-settings/index.js +4 -43
- package/audits/index.js +16 -69
- package/auth/enums.js +2 -2
- package/auth/index.d.ts +4 -0
- package/auth/index.js +354 -2044
- package/auth/interfaces.js +1 -1
- package/auth/secutiry-poilicy/index.js +45 -254
- package/connectivity/index.js +79 -73
- package/constants.js +1 -1
- package/error.js +9 -33
- package/fetch.js +165 -519
- package/index.js +26 -26
- package/jwt.js +19 -45
- package/metadata/index.js +19 -159
- package/node/ContextHolder.js +68 -104
- package/node/account-settings/index.js +4 -46
- package/node/audits/index.js +15 -68
- package/node/auth/enums.js +2 -2
- package/node/auth/index.js +487 -2099
- package/node/auth/interfaces.js +2 -2
- package/node/auth/secutiry-poilicy/index.js +36 -240
- package/node/connectivity/index.js +78 -71
- package/node/constants.js +1 -1
- package/node/error.js +9 -38
- package/node/fetch.js +166 -521
- package/node/index.js +47 -49
- package/node/jwt.js +19 -51
- package/node/metadata/index.js +19 -163
- package/node/notifications/index.js +18 -94
- package/node/reports/index.js +62 -171
- package/node/roles/index.js +34 -172
- package/node/routers.js +2 -2
- package/node/sub-tenants/index.js +12 -126
- package/node/subscriptions/enums.js +4 -4
- package/node/subscriptions/index.js +10 -10
- package/node/subscriptions/interfaces.js +1 -1
- package/node/subscriptions/invoices.js +10 -70
- package/node/subscriptions/managedSubscriptions.js +16 -111
- package/node/subscriptions/paymentMethods.js +15 -69
- package/node/subscriptions/paymentProviders.js +2 -26
- package/node/subscriptions/plans.js +4 -46
- package/node/subscriptions/providers/index.js +1 -1
- package/node/subscriptions/providers/stripe/index.js +10 -106
- package/node/subscriptions/subscriptions.js +16 -111
- package/node/subscriptions/summaries.js +2 -26
- package/node/subscriptions/tenantConfiguration.js +4 -46
- package/node/teams/index.js +57 -406
- package/node/tenants/index.js +8 -86
- package/node/vendor/index.js +2 -26
- package/notifications/index.js +18 -93
- package/package.json +1 -1
- package/reports/index.js +65 -175
- package/roles/index.js +34 -175
- package/routers.js +2 -2
- package/sub-tenants/index.js +12 -127
- package/subscriptions/enums.js +4 -4
- package/subscriptions/invoices.js +12 -70
- package/subscriptions/managedSubscriptions.js +20 -115
- package/subscriptions/paymentMethods.js +16 -70
- package/subscriptions/paymentProviders.js +2 -22
- package/subscriptions/plans.js +4 -43
- package/subscriptions/providers/stripe/index.js +10 -106
- package/subscriptions/subscriptions.js +20 -115
- package/subscriptions/summaries.js +2 -22
- package/subscriptions/tenantConfiguration.js +4 -43
- package/teams/index.js +56 -420
- package/tenants/index.js +8 -85
- package/vendor/index.js +2 -23
package/auth/interfaces.js
CHANGED
|
@@ -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
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
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
|
}
|
package/connectivity/index.js
CHANGED
|
@@ -1,114 +1,120 @@
|
|
|
1
|
-
import
|
|
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
|
|
5
|
-
return Get(
|
|
6
|
+
export const getSlackConfiguration = () => {
|
|
7
|
+
return Get(`${urls.integrations.configurations.v1}/slack`);
|
|
6
8
|
};
|
|
7
|
-
export
|
|
8
|
-
return Get(
|
|
9
|
+
export const getSlackScope = () => {
|
|
10
|
+
return Get(`${urls.integrations.configurations.v1}/slack/applications`);
|
|
9
11
|
};
|
|
10
|
-
export
|
|
11
|
-
return Get(
|
|
12
|
+
export const getSlackChannels = () => {
|
|
13
|
+
return Get(`${urls.integrations.configurations.v1}/slack/channels`);
|
|
12
14
|
};
|
|
13
|
-
export
|
|
15
|
+
export const postSlackConfiguration = data => {
|
|
14
16
|
if (data.id) {
|
|
15
|
-
return Patch(
|
|
17
|
+
return Patch(`${urls.integrations.configurations.v1}/slack/subscription/${data.id}`, data);
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
return Post(
|
|
20
|
+
return Post(`${urls.integrations.configurations.v1}/slack/subscriptions`, data);
|
|
19
21
|
};
|
|
20
|
-
export
|
|
21
|
-
return Delete(
|
|
22
|
+
export const deleteSlackConfiguration = data => {
|
|
23
|
+
return Delete(`${urls.integrations.configurations.v1}/slack/subscriptions/${data.id}`);
|
|
22
24
|
};
|
|
23
|
-
export
|
|
24
|
-
return Post(
|
|
25
|
-
code
|
|
25
|
+
export const postSlackCode = code => {
|
|
26
|
+
return Post(`${urls.integrations.configurations.v1}/slack/applications/registrations`, {
|
|
27
|
+
code
|
|
26
28
|
});
|
|
27
29
|
};
|
|
28
|
-
export
|
|
29
|
-
return Get(
|
|
30
|
+
export const getEmailConfiguration = () => {
|
|
31
|
+
return Get(`${urls.integrations.configurations.v1}/emails`);
|
|
30
32
|
};
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
export const postEmailConfiguration = _ref => {
|
|
34
|
+
let {
|
|
35
|
+
eventKey
|
|
36
|
+
} = _ref,
|
|
37
|
+
data = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
34
38
|
|
|
35
|
-
return Post(
|
|
36
|
-
};
|
|
37
|
-
export
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
|
45
|
-
return Delete(
|
|
49
|
+
export const deleteEmailSubscriptions = (eventKey, subscriptionId) => {
|
|
50
|
+
return Delete(`${urls.integrations.configurations.v1}/emails/${eventKey}/subscriptions/${subscriptionId}`);
|
|
46
51
|
};
|
|
47
|
-
export
|
|
48
|
-
return Put(
|
|
52
|
+
export const putEmailSubscriptions = (subscriptionId, eventKey, data) => {
|
|
53
|
+
return Put(`${urls.integrations.configurations.v1}/emails/${eventKey}/subscriptions/${subscriptionId}`, data);
|
|
49
54
|
};
|
|
50
|
-
export
|
|
51
|
-
return Delete(
|
|
55
|
+
export const deleteEmailConfiguration = eventKey => {
|
|
56
|
+
return Delete(`${urls.integrations.configurations.v1}/emails/${eventKey}`);
|
|
52
57
|
};
|
|
53
|
-
export
|
|
54
|
-
return Get(
|
|
58
|
+
export const getSMSConfiguration = () => {
|
|
59
|
+
return Get(`${urls.integrations.configurations.v2}/sms`);
|
|
55
60
|
};
|
|
56
|
-
export
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
export const postSMSConfiguration = _ref2 => {
|
|
62
|
+
let {
|
|
63
|
+
eventKey
|
|
64
|
+
} = _ref2,
|
|
65
|
+
data = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
59
66
|
|
|
60
|
-
return Post(
|
|
61
|
-
};
|
|
62
|
-
export
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
|
67
75
|
});
|
|
68
76
|
};
|
|
69
|
-
export
|
|
70
|
-
return Delete(
|
|
77
|
+
export const deleteSMSSubscriptions = (eventKey, subscriptionId) => {
|
|
78
|
+
return Delete(`${urls.integrations.configurations.v2}/sms/${eventKey}/subscriptions/${subscriptionId}`);
|
|
71
79
|
};
|
|
72
|
-
export
|
|
73
|
-
return Put(
|
|
80
|
+
export const putSMSSubscriptions = (subscriptionId, eventKey, data) => {
|
|
81
|
+
return Put(`${urls.integrations.configurations.v2}/sms/${eventKey}/subscriptions/${subscriptionId}`, data);
|
|
74
82
|
};
|
|
75
|
-
export
|
|
76
|
-
return Delete(
|
|
83
|
+
export const deleteSMSConfiguration = eventKey => {
|
|
84
|
+
return Delete(`${urls.integrations.configurations.v2}/sms/${eventKey}`);
|
|
77
85
|
};
|
|
78
|
-
export
|
|
86
|
+
export const getWebhooksConfigurations = () => {
|
|
79
87
|
return Get(urls.webhooks.v1);
|
|
80
88
|
};
|
|
81
|
-
export
|
|
89
|
+
export const postWebhooksConfiguration = data => {
|
|
82
90
|
if (data._id) {
|
|
83
|
-
return Patch(
|
|
91
|
+
return Patch(`${urls.webhooks.v1}/${data._id}`, data);
|
|
84
92
|
} else {
|
|
85
|
-
return Post(
|
|
93
|
+
return Post(`${urls.webhooks.v1}/custom`, data);
|
|
86
94
|
}
|
|
87
95
|
};
|
|
88
|
-
export
|
|
89
|
-
return Delete(
|
|
96
|
+
export const deleteWebhooksConfiguration = id => {
|
|
97
|
+
return Delete(`${urls.webhooks.v1}/${id}`);
|
|
90
98
|
};
|
|
91
|
-
export
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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(
|
|
105
|
+
return Get(`${urls.webhooks.v1}/logs/?${query.toString()}`);
|
|
100
106
|
};
|
|
101
|
-
export
|
|
102
|
-
return Post(
|
|
107
|
+
export const postWebhookTest = data => {
|
|
108
|
+
return Post(`${urls.webhooks.v1}/test`, data);
|
|
103
109
|
};
|
|
104
|
-
export
|
|
105
|
-
return Post(
|
|
110
|
+
export const postWebhookRetry = id => {
|
|
111
|
+
return Post(`${urls.webhooks.v1}/logs/${id}/retries`);
|
|
106
112
|
};
|
|
107
|
-
export
|
|
108
|
-
return Get(
|
|
113
|
+
export const getCategories = () => {
|
|
114
|
+
return Get(`${urls.events.configurations.v1}/categories`);
|
|
109
115
|
};
|
|
110
|
-
export
|
|
116
|
+
export const getChannelMaps = channels => {
|
|
111
117
|
return Get(urls.events.configurations.v1, {
|
|
112
|
-
channels
|
|
118
|
+
channels
|
|
113
119
|
});
|
|
114
120
|
};
|
package/constants.js
CHANGED
package/error.js
CHANGED
|
@@ -1,36 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return this._statusCode;
|
|
32
|
-
}
|
|
33
|
-
}]);
|
|
8
|
+
get statusCode() {
|
|
9
|
+
return this._statusCode;
|
|
10
|
+
}
|
|
34
11
|
|
|
35
|
-
|
|
36
|
-
}(_wrapNativeSuper(Error));
|
|
12
|
+
}
|