@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.
- package/ContextHolder.js +64 -100
- package/account-settings/index.js +4 -43
- package/audits/index.js +16 -69
- package/auth/enums.js +2 -2
- package/auth/index.js +352 -2045
- 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 +159 -519
- package/index.js +26 -26
- package/jwt.js +19 -45
- package/metadata/index.js +18 -160
- 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 +481 -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 +55 -421
- package/tenants/index.js +8 -85
- package/vendor/index.js +2 -23
package/node/auth/interfaces.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
|
21
|
+
async function getGlobalSecurityPolicy() {
|
|
22
|
+
return (0, _fetch.Get)(_constants.urls.identity.configurations.v1);
|
|
29
23
|
}
|
|
30
24
|
|
|
31
|
-
function
|
|
32
|
-
|
|
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
|
|
50
|
-
return
|
|
29
|
+
async function getVendorMfaPolicy() {
|
|
30
|
+
return (0, _fetch.Get)(`${_constants.urls.identity.configurations.v1}/mfa-policy/vendor`);
|
|
51
31
|
}
|
|
52
32
|
|
|
53
|
-
function
|
|
54
|
-
|
|
55
|
-
return
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
|
72
|
-
return
|
|
41
|
+
async function getLockoutPolicy() {
|
|
42
|
+
return (0, _fetch.Get)(`${_constants.urls.identity.configurations.v1}/lockout-policy`);
|
|
73
43
|
}
|
|
74
44
|
|
|
75
|
-
function
|
|
76
|
-
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
|
124
|
-
return
|
|
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
|
|
176
|
-
|
|
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
|
|
180
|
-
|
|
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
|
|
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
|
-
|
|
17
|
-
|
|
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
|
-
|
|
23
|
-
return (0, _fetch.Get)(
|
|
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
|
-
|
|
29
|
-
return (0, _fetch.Get)(
|
|
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
|
-
|
|
37
|
+
const postSlackConfiguration = data => {
|
|
35
38
|
if (data.id) {
|
|
36
|
-
return (0, _fetch.Patch)(
|
|
39
|
+
return (0, _fetch.Patch)(`${_constants.urls.integrations.configurations.v1}/slack/subscription/${data.id}`, data);
|
|
37
40
|
}
|
|
38
41
|
|
|
39
|
-
return (0, _fetch.Post)(
|
|
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
|
-
|
|
45
|
-
return (0, _fetch.Delete)(
|
|
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
|
-
|
|
51
|
-
return (0, _fetch.Post)(
|
|
52
|
-
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
|
-
|
|
59
|
-
return (0, _fetch.Get)(
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
83
|
-
return (0, _fetch.Delete)(
|
|
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
|
-
|
|
89
|
-
return (0, _fetch.Put)(
|
|
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
|
-
|
|
95
|
-
return (0, _fetch.Delete)(
|
|
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
|
-
|
|
101
|
-
return (0, _fetch.Get)(
|
|
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
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
|
|
125
|
-
return (0, _fetch.Delete)(
|
|
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
|
-
|
|
131
|
-
return (0, _fetch.Put)(
|
|
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
|
-
|
|
137
|
-
return (0, _fetch.Delete)(
|
|
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
|
-
|
|
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
|
-
|
|
157
|
+
const postWebhooksConfiguration = data => {
|
|
149
158
|
if (data._id) {
|
|
150
|
-
return (0, _fetch.Patch)(
|
|
159
|
+
return (0, _fetch.Patch)(`${_constants.urls.webhooks.v1}/${data._id}`, data);
|
|
151
160
|
} else {
|
|
152
|
-
return (0, _fetch.Post)(
|
|
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
|
-
|
|
159
|
-
return (0, _fetch.Delete)(
|
|
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
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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)(
|
|
179
|
+
return (0, _fetch.Get)(`${_constants.urls.webhooks.v1}/logs/?${query.toString()}`);
|
|
173
180
|
};
|
|
174
181
|
|
|
175
182
|
exports.getWebhookLog = getWebhookLog;
|
|
176
183
|
|
|
177
|
-
|
|
178
|
-
return (0, _fetch.Post)(
|
|
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
|
-
|
|
184
|
-
return (0, _fetch.Post)(
|
|
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
|
-
|
|
190
|
-
return (0, _fetch.Get)(
|
|
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
|
-
|
|
202
|
+
const getChannelMaps = channels => {
|
|
196
203
|
return (0, _fetch.Get)(_constants.urls.events.configurations.v1, {
|
|
197
|
-
channels
|
|
204
|
+
channels
|
|
198
205
|
});
|
|
199
206
|
};
|
|
200
207
|
|