@bigbinary/neeto-webhooks-frontend 1.6.7 → 1.6.9
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/README.md +117 -12
- package/app/javascript/src/translations/en.json +3 -1
- package/dist/index.cjs.js +428 -291
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +444 -307
- package/dist/index.js.map +1 -1
- package/package.json +79 -69
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useRef, useCallback } from 'react';
|
|
1
|
+
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
|
2
2
|
import { useParams, useRouteMatch, Switch as Switch$1, Route } from 'react-router-dom';
|
|
3
3
|
import { isPresent, removeBy, isNotEmpty, removeById, findBy } from '@bigbinary/neeto-cist';
|
|
4
4
|
import { DEFAULT_STALE_TIME, SINGULAR, DEFAULT_PAGE_SIZE, PLURAL } from '@bigbinary/neeto-commons-frontend/constants';
|
|
@@ -12,12 +12,12 @@ import { QueryClient, QueryCache, QueryClientProvider, useQuery, useQueryClient,
|
|
|
12
12
|
import { ReactQueryDevtools } from 'react-query/devtools';
|
|
13
13
|
import axios from 'axios';
|
|
14
14
|
import DateFormat from '@bigbinary/neeto-molecules/DateFormat';
|
|
15
|
-
import { t } from 'i18next';
|
|
15
|
+
import { t as t$1 } from 'i18next';
|
|
16
16
|
import { prop, pluck, assoc } from 'ramda';
|
|
17
|
-
import { Info } from '@bigbinary/neeto-icons';
|
|
17
|
+
import { Info, Plus } from '@bigbinary/neeto-icons';
|
|
18
|
+
import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
|
|
18
19
|
import { Form, Textarea, Select, Input, Switch, ActionBlock } from '@bigbinary/neetoui/formik';
|
|
19
20
|
import { buildUrl } from '@bigbinary/neeto-commons-frontend/utils';
|
|
20
|
-
import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
|
|
21
21
|
import * as yup from 'yup';
|
|
22
22
|
|
|
23
23
|
var getDeliveriesPath = function getDeliveriesPath(webhooksPath) {
|
|
@@ -59,31 +59,31 @@ function _arrayWithHoles(arr) {
|
|
|
59
59
|
if (Array.isArray(arr)) return arr;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
function _iterableToArrayLimit(
|
|
63
|
-
var
|
|
64
|
-
if (null !=
|
|
65
|
-
var
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
62
|
+
function _iterableToArrayLimit(r, l) {
|
|
63
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
64
|
+
if (null != t) {
|
|
65
|
+
var e,
|
|
66
|
+
n,
|
|
67
|
+
i,
|
|
68
|
+
u,
|
|
69
|
+
a = [],
|
|
70
|
+
f = !0,
|
|
71
|
+
o = !1;
|
|
72
72
|
try {
|
|
73
|
-
if (
|
|
74
|
-
if (Object(
|
|
75
|
-
|
|
76
|
-
} else for (; !(
|
|
77
|
-
} catch (
|
|
78
|
-
|
|
73
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
74
|
+
if (Object(t) !== t) return;
|
|
75
|
+
f = !1;
|
|
76
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
77
|
+
} catch (r) {
|
|
78
|
+
o = !0, n = r;
|
|
79
79
|
} finally {
|
|
80
80
|
try {
|
|
81
|
-
if (!
|
|
81
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
82
82
|
} finally {
|
|
83
|
-
if (
|
|
83
|
+
if (o) throw n;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
return
|
|
86
|
+
return a;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
|
|
@@ -213,14 +213,14 @@ var _typeof$1 = {exports: {}};
|
|
|
213
213
|
_typeof$1.exports;
|
|
214
214
|
|
|
215
215
|
(function (module) {
|
|
216
|
-
function _typeof(
|
|
216
|
+
function _typeof(o) {
|
|
217
217
|
"@babel/helpers - typeof";
|
|
218
218
|
|
|
219
|
-
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (
|
|
220
|
-
return typeof
|
|
221
|
-
} : function (
|
|
222
|
-
return
|
|
223
|
-
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(
|
|
219
|
+
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
220
|
+
return typeof o;
|
|
221
|
+
} : function (o) {
|
|
222
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
223
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
|
|
224
224
|
}
|
|
225
225
|
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
226
226
|
} (_typeof$1));
|
|
@@ -233,304 +233,304 @@ regeneratorRuntime$1.exports;
|
|
|
233
233
|
var _typeof = _typeofExports["default"];
|
|
234
234
|
function _regeneratorRuntime() {
|
|
235
235
|
module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
|
236
|
-
return
|
|
236
|
+
return e;
|
|
237
237
|
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
238
|
-
var
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
238
|
+
var t,
|
|
239
|
+
e = {},
|
|
240
|
+
r = Object.prototype,
|
|
241
|
+
n = r.hasOwnProperty,
|
|
242
|
+
o = Object.defineProperty || function (t, e, r) {
|
|
243
|
+
t[e] = r.value;
|
|
243
244
|
},
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
function define(
|
|
249
|
-
return Object.defineProperty(
|
|
250
|
-
value:
|
|
245
|
+
i = "function" == typeof Symbol ? Symbol : {},
|
|
246
|
+
a = i.iterator || "@@iterator",
|
|
247
|
+
c = i.asyncIterator || "@@asyncIterator",
|
|
248
|
+
u = i.toStringTag || "@@toStringTag";
|
|
249
|
+
function define(t, e, r) {
|
|
250
|
+
return Object.defineProperty(t, e, {
|
|
251
|
+
value: r,
|
|
251
252
|
enumerable: !0,
|
|
252
253
|
configurable: !0,
|
|
253
254
|
writable: !0
|
|
254
|
-
}),
|
|
255
|
+
}), t[e];
|
|
255
256
|
}
|
|
256
257
|
try {
|
|
257
258
|
define({}, "");
|
|
258
|
-
} catch (
|
|
259
|
-
define = function define(
|
|
260
|
-
return
|
|
259
|
+
} catch (t) {
|
|
260
|
+
define = function define(t, e, r) {
|
|
261
|
+
return t[e] = r;
|
|
261
262
|
};
|
|
262
263
|
}
|
|
263
|
-
function wrap(
|
|
264
|
-
var
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
return
|
|
268
|
-
value: makeInvokeMethod(
|
|
269
|
-
}),
|
|
264
|
+
function wrap(t, e, r, n) {
|
|
265
|
+
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
266
|
+
a = Object.create(i.prototype),
|
|
267
|
+
c = new Context(n || []);
|
|
268
|
+
return o(a, "_invoke", {
|
|
269
|
+
value: makeInvokeMethod(t, r, c)
|
|
270
|
+
}), a;
|
|
270
271
|
}
|
|
271
|
-
function tryCatch(
|
|
272
|
+
function tryCatch(t, e, r) {
|
|
272
273
|
try {
|
|
273
274
|
return {
|
|
274
275
|
type: "normal",
|
|
275
|
-
arg:
|
|
276
|
+
arg: t.call(e, r)
|
|
276
277
|
};
|
|
277
|
-
} catch (
|
|
278
|
+
} catch (t) {
|
|
278
279
|
return {
|
|
279
280
|
type: "throw",
|
|
280
|
-
arg:
|
|
281
|
+
arg: t
|
|
281
282
|
};
|
|
282
283
|
}
|
|
283
284
|
}
|
|
284
|
-
|
|
285
|
-
var
|
|
285
|
+
e.wrap = wrap;
|
|
286
|
+
var h = "suspendedStart",
|
|
287
|
+
l = "suspendedYield",
|
|
288
|
+
f = "executing",
|
|
289
|
+
s = "completed",
|
|
290
|
+
y = {};
|
|
286
291
|
function Generator() {}
|
|
287
292
|
function GeneratorFunction() {}
|
|
288
293
|
function GeneratorFunctionPrototype() {}
|
|
289
|
-
var
|
|
290
|
-
define(
|
|
294
|
+
var p = {};
|
|
295
|
+
define(p, a, function () {
|
|
291
296
|
return this;
|
|
292
297
|
});
|
|
293
|
-
var
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
var
|
|
297
|
-
function defineIteratorMethods(
|
|
298
|
-
["next", "throw", "return"].forEach(function (
|
|
299
|
-
define(
|
|
300
|
-
return this._invoke(
|
|
298
|
+
var d = Object.getPrototypeOf,
|
|
299
|
+
v = d && d(d(values([])));
|
|
300
|
+
v && v !== r && n.call(v, a) && (p = v);
|
|
301
|
+
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
302
|
+
function defineIteratorMethods(t) {
|
|
303
|
+
["next", "throw", "return"].forEach(function (e) {
|
|
304
|
+
define(t, e, function (t) {
|
|
305
|
+
return this._invoke(e, t);
|
|
301
306
|
});
|
|
302
307
|
});
|
|
303
308
|
}
|
|
304
|
-
function AsyncIterator(
|
|
305
|
-
function invoke(
|
|
306
|
-
var
|
|
307
|
-
if ("throw" !==
|
|
308
|
-
var
|
|
309
|
-
|
|
310
|
-
return
|
|
311
|
-
invoke("next",
|
|
312
|
-
}, function (
|
|
313
|
-
invoke("throw",
|
|
314
|
-
}) :
|
|
315
|
-
|
|
316
|
-
}, function (
|
|
317
|
-
return invoke("throw",
|
|
309
|
+
function AsyncIterator(t, e) {
|
|
310
|
+
function invoke(r, o, i, a) {
|
|
311
|
+
var c = tryCatch(t[r], t, o);
|
|
312
|
+
if ("throw" !== c.type) {
|
|
313
|
+
var u = c.arg,
|
|
314
|
+
h = u.value;
|
|
315
|
+
return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
316
|
+
invoke("next", t, i, a);
|
|
317
|
+
}, function (t) {
|
|
318
|
+
invoke("throw", t, i, a);
|
|
319
|
+
}) : e.resolve(h).then(function (t) {
|
|
320
|
+
u.value = t, i(u);
|
|
321
|
+
}, function (t) {
|
|
322
|
+
return invoke("throw", t, i, a);
|
|
318
323
|
});
|
|
319
324
|
}
|
|
320
|
-
|
|
325
|
+
a(c.arg);
|
|
321
326
|
}
|
|
322
|
-
var
|
|
323
|
-
|
|
324
|
-
value: function value(
|
|
327
|
+
var r;
|
|
328
|
+
o(this, "_invoke", {
|
|
329
|
+
value: function value(t, n) {
|
|
325
330
|
function callInvokeWithMethodAndArg() {
|
|
326
|
-
return new
|
|
327
|
-
invoke(
|
|
331
|
+
return new e(function (e, r) {
|
|
332
|
+
invoke(t, n, e, r);
|
|
328
333
|
});
|
|
329
334
|
}
|
|
330
|
-
return
|
|
335
|
+
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
331
336
|
}
|
|
332
337
|
});
|
|
333
338
|
}
|
|
334
|
-
function makeInvokeMethod(
|
|
335
|
-
var
|
|
336
|
-
return function (
|
|
337
|
-
if (
|
|
338
|
-
if (
|
|
339
|
-
if ("throw" ===
|
|
340
|
-
return
|
|
339
|
+
function makeInvokeMethod(e, r, n) {
|
|
340
|
+
var o = h;
|
|
341
|
+
return function (i, a) {
|
|
342
|
+
if (o === f) throw new Error("Generator is already running");
|
|
343
|
+
if (o === s) {
|
|
344
|
+
if ("throw" === i) throw a;
|
|
345
|
+
return {
|
|
346
|
+
value: t,
|
|
347
|
+
done: !0
|
|
348
|
+
};
|
|
341
349
|
}
|
|
342
|
-
for (
|
|
343
|
-
var
|
|
344
|
-
if (
|
|
345
|
-
var
|
|
346
|
-
if (
|
|
347
|
-
if (
|
|
348
|
-
return
|
|
350
|
+
for (n.method = i, n.arg = a;;) {
|
|
351
|
+
var c = n.delegate;
|
|
352
|
+
if (c) {
|
|
353
|
+
var u = maybeInvokeDelegate(c, n);
|
|
354
|
+
if (u) {
|
|
355
|
+
if (u === y) continue;
|
|
356
|
+
return u;
|
|
349
357
|
}
|
|
350
358
|
}
|
|
351
|
-
if ("next" ===
|
|
352
|
-
if (
|
|
353
|
-
|
|
354
|
-
} else "return" ===
|
|
355
|
-
|
|
356
|
-
var
|
|
357
|
-
if ("normal" ===
|
|
358
|
-
if (
|
|
359
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
360
|
+
if (o === h) throw o = s, n.arg;
|
|
361
|
+
n.dispatchException(n.arg);
|
|
362
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
363
|
+
o = f;
|
|
364
|
+
var p = tryCatch(e, r, n);
|
|
365
|
+
if ("normal" === p.type) {
|
|
366
|
+
if (o = n.done ? s : l, p.arg === y) continue;
|
|
359
367
|
return {
|
|
360
|
-
value:
|
|
361
|
-
done:
|
|
368
|
+
value: p.arg,
|
|
369
|
+
done: n.done
|
|
362
370
|
};
|
|
363
371
|
}
|
|
364
|
-
"throw" ===
|
|
372
|
+
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
365
373
|
}
|
|
366
374
|
};
|
|
367
375
|
}
|
|
368
|
-
function maybeInvokeDelegate(
|
|
369
|
-
var
|
|
370
|
-
|
|
371
|
-
if (
|
|
372
|
-
var
|
|
373
|
-
if ("throw" ===
|
|
374
|
-
var
|
|
375
|
-
return
|
|
376
|
+
function maybeInvokeDelegate(e, r) {
|
|
377
|
+
var n = r.method,
|
|
378
|
+
o = e.iterator[n];
|
|
379
|
+
if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
|
380
|
+
var i = tryCatch(o, e.iterator, r.arg);
|
|
381
|
+
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
382
|
+
var a = i.arg;
|
|
383
|
+
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
376
384
|
}
|
|
377
|
-
function pushTryEntry(
|
|
378
|
-
var
|
|
379
|
-
tryLoc:
|
|
385
|
+
function pushTryEntry(t) {
|
|
386
|
+
var e = {
|
|
387
|
+
tryLoc: t[0]
|
|
380
388
|
};
|
|
381
|
-
1 in
|
|
389
|
+
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
382
390
|
}
|
|
383
|
-
function resetTryEntry(
|
|
384
|
-
var
|
|
385
|
-
|
|
391
|
+
function resetTryEntry(t) {
|
|
392
|
+
var e = t.completion || {};
|
|
393
|
+
e.type = "normal", delete e.arg, t.completion = e;
|
|
386
394
|
}
|
|
387
|
-
function Context(
|
|
395
|
+
function Context(t) {
|
|
388
396
|
this.tryEntries = [{
|
|
389
397
|
tryLoc: "root"
|
|
390
|
-
}],
|
|
398
|
+
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
391
399
|
}
|
|
392
|
-
function values(
|
|
393
|
-
if (
|
|
394
|
-
var
|
|
395
|
-
if (
|
|
396
|
-
if ("function" == typeof
|
|
397
|
-
if (!isNaN(
|
|
398
|
-
var
|
|
399
|
-
|
|
400
|
-
for (; ++
|
|
401
|
-
return next.value =
|
|
400
|
+
function values(e) {
|
|
401
|
+
if (e || "" === e) {
|
|
402
|
+
var r = e[a];
|
|
403
|
+
if (r) return r.call(e);
|
|
404
|
+
if ("function" == typeof e.next) return e;
|
|
405
|
+
if (!isNaN(e.length)) {
|
|
406
|
+
var o = -1,
|
|
407
|
+
i = function next() {
|
|
408
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
409
|
+
return next.value = t, next.done = !0, next;
|
|
402
410
|
};
|
|
403
|
-
return
|
|
411
|
+
return i.next = i;
|
|
404
412
|
}
|
|
405
413
|
}
|
|
406
|
-
|
|
407
|
-
next: doneResult
|
|
408
|
-
};
|
|
414
|
+
throw new TypeError(_typeof(e) + " is not iterable");
|
|
409
415
|
}
|
|
410
|
-
|
|
411
|
-
return {
|
|
412
|
-
value: undefined,
|
|
413
|
-
done: !0
|
|
414
|
-
};
|
|
415
|
-
}
|
|
416
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
|
|
416
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
417
417
|
value: GeneratorFunctionPrototype,
|
|
418
418
|
configurable: !0
|
|
419
|
-
}),
|
|
419
|
+
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
420
420
|
value: GeneratorFunction,
|
|
421
421
|
configurable: !0
|
|
422
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype,
|
|
423
|
-
var
|
|
424
|
-
return !!
|
|
425
|
-
},
|
|
426
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(
|
|
427
|
-
},
|
|
422
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
423
|
+
var e = "function" == typeof t && t.constructor;
|
|
424
|
+
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
425
|
+
}, e.mark = function (t) {
|
|
426
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
427
|
+
}, e.awrap = function (t) {
|
|
428
428
|
return {
|
|
429
|
-
__await:
|
|
429
|
+
__await: t
|
|
430
430
|
};
|
|
431
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype,
|
|
431
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
432
432
|
return this;
|
|
433
|
-
}),
|
|
434
|
-
void 0 ===
|
|
435
|
-
var
|
|
436
|
-
return
|
|
437
|
-
return
|
|
433
|
+
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
434
|
+
void 0 === i && (i = Promise);
|
|
435
|
+
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
436
|
+
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
437
|
+
return t.done ? t.value : a.next();
|
|
438
438
|
});
|
|
439
|
-
}, defineIteratorMethods(
|
|
439
|
+
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
440
440
|
return this;
|
|
441
|
-
}), define(
|
|
441
|
+
}), define(g, "toString", function () {
|
|
442
442
|
return "[object Generator]";
|
|
443
|
-
}),
|
|
444
|
-
var
|
|
445
|
-
|
|
446
|
-
for (var
|
|
447
|
-
return
|
|
448
|
-
for (;
|
|
449
|
-
var
|
|
450
|
-
if (
|
|
443
|
+
}), e.keys = function (t) {
|
|
444
|
+
var e = Object(t),
|
|
445
|
+
r = [];
|
|
446
|
+
for (var n in e) r.push(n);
|
|
447
|
+
return r.reverse(), function next() {
|
|
448
|
+
for (; r.length;) {
|
|
449
|
+
var t = r.pop();
|
|
450
|
+
if (t in e) return next.value = t, next.done = !1, next;
|
|
451
451
|
}
|
|
452
452
|
return next.done = !0, next;
|
|
453
453
|
};
|
|
454
|
-
},
|
|
454
|
+
}, e.values = values, Context.prototype = {
|
|
455
455
|
constructor: Context,
|
|
456
|
-
reset: function reset(
|
|
457
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
456
|
+
reset: function reset(e) {
|
|
457
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
458
458
|
},
|
|
459
459
|
stop: function stop() {
|
|
460
460
|
this.done = !0;
|
|
461
|
-
var
|
|
462
|
-
if ("throw" ===
|
|
461
|
+
var t = this.tryEntries[0].completion;
|
|
462
|
+
if ("throw" === t.type) throw t.arg;
|
|
463
463
|
return this.rval;
|
|
464
464
|
},
|
|
465
|
-
dispatchException: function dispatchException(
|
|
466
|
-
if (this.done) throw
|
|
467
|
-
var
|
|
468
|
-
function handle(
|
|
469
|
-
return
|
|
465
|
+
dispatchException: function dispatchException(e) {
|
|
466
|
+
if (this.done) throw e;
|
|
467
|
+
var r = this;
|
|
468
|
+
function handle(n, o) {
|
|
469
|
+
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
470
470
|
}
|
|
471
|
-
for (var
|
|
472
|
-
var
|
|
473
|
-
|
|
474
|
-
if ("root" ===
|
|
475
|
-
if (
|
|
476
|
-
var
|
|
477
|
-
|
|
478
|
-
if (
|
|
479
|
-
if (this.prev <
|
|
480
|
-
if (this.prev <
|
|
481
|
-
} else if (
|
|
482
|
-
if (this.prev <
|
|
471
|
+
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
472
|
+
var i = this.tryEntries[o],
|
|
473
|
+
a = i.completion;
|
|
474
|
+
if ("root" === i.tryLoc) return handle("end");
|
|
475
|
+
if (i.tryLoc <= this.prev) {
|
|
476
|
+
var c = n.call(i, "catchLoc"),
|
|
477
|
+
u = n.call(i, "finallyLoc");
|
|
478
|
+
if (c && u) {
|
|
479
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
480
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
481
|
+
} else if (c) {
|
|
482
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
483
483
|
} else {
|
|
484
|
-
if (!
|
|
485
|
-
if (this.prev <
|
|
484
|
+
if (!u) throw new Error("try statement without catch or finally");
|
|
485
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
489
|
},
|
|
490
|
-
abrupt: function abrupt(
|
|
491
|
-
for (var
|
|
492
|
-
var
|
|
493
|
-
if (
|
|
494
|
-
var
|
|
490
|
+
abrupt: function abrupt(t, e) {
|
|
491
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
492
|
+
var o = this.tryEntries[r];
|
|
493
|
+
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
494
|
+
var i = o;
|
|
495
495
|
break;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
|
|
499
|
-
var
|
|
500
|
-
return
|
|
498
|
+
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
499
|
+
var a = i ? i.completion : {};
|
|
500
|
+
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
501
501
|
},
|
|
502
|
-
complete: function complete(
|
|
503
|
-
if ("throw" ===
|
|
504
|
-
return "break" ===
|
|
502
|
+
complete: function complete(t, e) {
|
|
503
|
+
if ("throw" === t.type) throw t.arg;
|
|
504
|
+
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
|
505
505
|
},
|
|
506
|
-
finish: function finish(
|
|
507
|
-
for (var
|
|
508
|
-
var
|
|
509
|
-
if (
|
|
506
|
+
finish: function finish(t) {
|
|
507
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
508
|
+
var r = this.tryEntries[e];
|
|
509
|
+
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
510
510
|
}
|
|
511
511
|
},
|
|
512
|
-
"catch": function _catch(
|
|
513
|
-
for (var
|
|
514
|
-
var
|
|
515
|
-
if (
|
|
516
|
-
var
|
|
517
|
-
if ("throw" ===
|
|
518
|
-
var
|
|
519
|
-
resetTryEntry(
|
|
512
|
+
"catch": function _catch(t) {
|
|
513
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
514
|
+
var r = this.tryEntries[e];
|
|
515
|
+
if (r.tryLoc === t) {
|
|
516
|
+
var n = r.completion;
|
|
517
|
+
if ("throw" === n.type) {
|
|
518
|
+
var o = n.arg;
|
|
519
|
+
resetTryEntry(r);
|
|
520
520
|
}
|
|
521
|
-
return
|
|
521
|
+
return o;
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
524
|
throw new Error("illegal catch attempt");
|
|
525
525
|
},
|
|
526
|
-
delegateYield: function delegateYield(
|
|
526
|
+
delegateYield: function delegateYield(e, r, n) {
|
|
527
527
|
return this.delegate = {
|
|
528
|
-
iterator: values(
|
|
529
|
-
resultName:
|
|
530
|
-
nextLoc:
|
|
531
|
-
}, "next" === this.method && (this.arg =
|
|
528
|
+
iterator: values(e),
|
|
529
|
+
resultName: r,
|
|
530
|
+
nextLoc: n
|
|
531
|
+
}, "next" === this.method && (this.arg = t), y;
|
|
532
532
|
}
|
|
533
|
-
},
|
|
533
|
+
}, e;
|
|
534
534
|
}
|
|
535
535
|
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
536
536
|
} (regeneratorRuntime$1));
|
|
@@ -561,9 +561,12 @@ var DELIVERY_TAB = {
|
|
|
561
561
|
};
|
|
562
562
|
|
|
563
563
|
var Snippet = function Snippet(_ref) {
|
|
564
|
-
var children = _ref.children
|
|
564
|
+
var children = _ref.children,
|
|
565
|
+
_ref$dataCy = _ref.dataCy,
|
|
566
|
+
dataCy = _ref$dataCy === void 0 ? "" : _ref$dataCy;
|
|
565
567
|
return /*#__PURE__*/React.createElement("div", {
|
|
566
|
-
className: "neeto-ui-rounded neeto-ui-border-gray-300 neeto-ui-bg-gray-100 my-2 whitespace-pre-wrap break-all border p-4"
|
|
568
|
+
className: "neeto-ui-rounded neeto-ui-border-gray-300 neeto-ui-bg-gray-100 my-2 whitespace-pre-wrap break-all border p-4",
|
|
569
|
+
"data-cy": dataCy
|
|
567
570
|
}, children);
|
|
568
571
|
};
|
|
569
572
|
|
|
@@ -598,11 +601,13 @@ var TransactionDetails = function TransactionDetails(_ref) {
|
|
|
598
601
|
className: "flex items-center space-x-1"
|
|
599
602
|
}, t("neetoWebhooks.delivery.identifier"), ":", /*#__PURE__*/React.createElement(Typography, {
|
|
600
603
|
className: "px-2 font-bold",
|
|
604
|
+
"data-cy": "delivery-identifier",
|
|
601
605
|
style: "body2"
|
|
602
606
|
}, identifier)), /*#__PURE__*/React.createElement("span", {
|
|
603
607
|
className: "flex items-center"
|
|
604
608
|
}, t("neetoWebhooks.common.responseStatus"), ":", /*#__PURE__*/React.createElement(Typography, {
|
|
605
609
|
className: "px-2 font-bold",
|
|
610
|
+
"data-cy": "delivery-response-code",
|
|
606
611
|
style: "body2"
|
|
607
612
|
}, responseStatusCode), /*#__PURE__*/React.createElement(Tag, {
|
|
608
613
|
style: status === "success" ? "success" : "warning"
|
|
@@ -622,15 +627,23 @@ var TransactionDetails = function TransactionDetails(_ref) {
|
|
|
622
627
|
className: "space-y-4"
|
|
623
628
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Typography, {
|
|
624
629
|
style: "h5"
|
|
625
|
-
}, t("neetoWebhooks.delivery.header")), /*#__PURE__*/React.createElement(Snippet,
|
|
630
|
+
}, t("neetoWebhooks.delivery.header")), /*#__PURE__*/React.createElement(Snippet, {
|
|
631
|
+
dataCy: "delivery-request-header"
|
|
632
|
+
}, deliveryDetails.requestHeader)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Typography, {
|
|
626
633
|
style: "h5"
|
|
627
|
-
}, t("neetoWebhooks.delivery.payload")), /*#__PURE__*/React.createElement(Snippet,
|
|
634
|
+
}, t("neetoWebhooks.delivery.payload")), /*#__PURE__*/React.createElement(Snippet, {
|
|
635
|
+
dataCy: "delivery-request-payload"
|
|
636
|
+
}, JSON.stringify(JSON.parse(deliveryDetails.requestBody), null, 2)))) : /*#__PURE__*/React.createElement("div", {
|
|
628
637
|
className: "space-y-4"
|
|
629
638
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Typography, {
|
|
630
639
|
style: "h5"
|
|
631
|
-
}, t("neetoWebhooks.delivery.header")), /*#__PURE__*/React.createElement(Snippet,
|
|
640
|
+
}, t("neetoWebhooks.delivery.header")), /*#__PURE__*/React.createElement(Snippet, {
|
|
641
|
+
dataCy: "delivery-response-header"
|
|
642
|
+
}, deliveryDetails.responseHeader)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Typography, {
|
|
632
643
|
style: "h5"
|
|
633
|
-
}, t("neetoWebhooks.delivery.body")), /*#__PURE__*/React.createElement(Snippet,
|
|
644
|
+
}, t("neetoWebhooks.delivery.body")), /*#__PURE__*/React.createElement(Snippet, {
|
|
645
|
+
dataCy: "delivery-response-body"
|
|
646
|
+
}, deliveryDetails.responseBody)))));
|
|
634
647
|
};
|
|
635
648
|
|
|
636
649
|
var Details = function Details(_ref) {
|
|
@@ -703,25 +716,28 @@ var Details = function Details(_ref) {
|
|
|
703
716
|
var buildColumns$1 = function buildColumns(_ref) {
|
|
704
717
|
var handleDetailsClick = _ref.handleDetailsClick;
|
|
705
718
|
return [{
|
|
706
|
-
title: t("neetoWebhooks.delivery.identifier", SINGULAR),
|
|
719
|
+
title: t$1("neetoWebhooks.delivery.identifier", SINGULAR),
|
|
707
720
|
key: "identifier",
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
redelivery = _ref2.redelivery;
|
|
721
|
+
dataIndex: "identifier",
|
|
722
|
+
width: 390,
|
|
723
|
+
render: function render(_, delivery) {
|
|
712
724
|
return /*#__PURE__*/React.createElement("div", {
|
|
713
725
|
className: "flex items-center gap-x-3"
|
|
714
|
-
}, /*#__PURE__*/React.createElement(
|
|
715
|
-
style: "
|
|
716
|
-
weight: "semibold"
|
|
717
|
-
|
|
726
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
727
|
+
style: "link",
|
|
728
|
+
weight: "semibold",
|
|
729
|
+
onClick: function onClick() {
|
|
730
|
+
return handleDetailsClick(delivery);
|
|
731
|
+
}
|
|
732
|
+
}, delivery.identifier), delivery.redelivery && /*#__PURE__*/React.createElement(Tag, {
|
|
718
733
|
style: "info"
|
|
719
|
-
}, t("neetoWebhooks.delivery.redelivery")));
|
|
734
|
+
}, t$1("neetoWebhooks.delivery.redelivery")));
|
|
720
735
|
}
|
|
721
736
|
}, {
|
|
722
|
-
title: t("neetoWebhooks.tableHeaders.createdAt"),
|
|
737
|
+
title: t$1("neetoWebhooks.tableHeaders.createdAt"),
|
|
723
738
|
key: "createdAt",
|
|
724
739
|
dataIndex: "createdAt",
|
|
740
|
+
width: 280,
|
|
725
741
|
render: function render(createdAt) {
|
|
726
742
|
return /*#__PURE__*/React.createElement("div", {
|
|
727
743
|
className: "flex items-center justify-between space-x-1"
|
|
@@ -730,12 +746,12 @@ var buildColumns$1 = function buildColumns(_ref) {
|
|
|
730
746
|
})));
|
|
731
747
|
}
|
|
732
748
|
}, {
|
|
733
|
-
title: t("neetoWebhooks.common.responseStatus"),
|
|
749
|
+
title: t$1("neetoWebhooks.common.responseStatus"),
|
|
734
750
|
key: "responseStatusCode",
|
|
735
|
-
width:
|
|
736
|
-
render: function render(
|
|
737
|
-
var responseStatusCode =
|
|
738
|
-
status =
|
|
751
|
+
width: 160,
|
|
752
|
+
render: function render(_ref2) {
|
|
753
|
+
var responseStatusCode = _ref2.responseStatusCode,
|
|
754
|
+
status = _ref2.status;
|
|
739
755
|
return /*#__PURE__*/React.createElement("span", {
|
|
740
756
|
className: "flex items-center"
|
|
741
757
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
@@ -746,23 +762,11 @@ var buildColumns$1 = function buildColumns(_ref) {
|
|
|
746
762
|
}, status));
|
|
747
763
|
}
|
|
748
764
|
}, {
|
|
749
|
-
title: t("neetoWebhooks.common.event", SINGULAR),
|
|
765
|
+
title: t$1("neetoWebhooks.common.event", SINGULAR),
|
|
750
766
|
key: "event",
|
|
751
767
|
dataIndex: "event",
|
|
768
|
+
width: 270,
|
|
752
769
|
render: prop("label")
|
|
753
|
-
}, {
|
|
754
|
-
title: t("neetoWebhooks.tableHeaders.details"),
|
|
755
|
-
key: "details",
|
|
756
|
-
dataIndex: "details",
|
|
757
|
-
render: function render(_, delivery) {
|
|
758
|
-
return /*#__PURE__*/React.createElement(Button, {
|
|
759
|
-
label: t("neetoWebhooks.buttons.viewDetails"),
|
|
760
|
-
size: "small",
|
|
761
|
-
onClick: function onClick() {
|
|
762
|
-
return handleDetailsClick(delivery);
|
|
763
|
-
}
|
|
764
|
-
});
|
|
765
|
-
}
|
|
766
770
|
}];
|
|
767
771
|
};
|
|
768
772
|
|
|
@@ -882,7 +886,7 @@ var useCreateWebhook = function useCreateWebhook(options) {
|
|
|
882
886
|
onSuccess: function onSuccess() {
|
|
883
887
|
var _options$onSuccess;
|
|
884
888
|
queryClient.invalidateQueries(QUERY_KEYS.WEBHOOK_LIST);
|
|
885
|
-
options === null || options === void 0 || (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0
|
|
889
|
+
options === null || options === void 0 || (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 || _options$onSuccess.call(options);
|
|
886
890
|
}
|
|
887
891
|
});
|
|
888
892
|
};
|
|
@@ -906,7 +910,7 @@ var useUpdateWebhook = function useUpdateWebhook(id, options) {
|
|
|
906
910
|
queryClient.invalidateQueries(QUERY_KEYS.WEBHOOK_LIST);
|
|
907
911
|
queryClient.invalidateQueries([QUERY_KEYS.WEBHOOK_DETAILS, id]);
|
|
908
912
|
queryClient.invalidateQueries([QUERY_KEYS.DELIVERY_LIST, id]);
|
|
909
|
-
options === null || options === void 0 || (_options$onSuccess2 = options.onSuccess) === null || _options$onSuccess2 === void 0
|
|
913
|
+
options === null || options === void 0 || (_options$onSuccess2 = options.onSuccess) === null || _options$onSuccess2 === void 0 || _options$onSuccess2.call(options);
|
|
910
914
|
}
|
|
911
915
|
});
|
|
912
916
|
};
|
|
@@ -916,19 +920,19 @@ var useDestroyWebhook = function useDestroyWebhook(options) {
|
|
|
916
920
|
onSuccess: function onSuccess() {
|
|
917
921
|
var _options$onSuccess3;
|
|
918
922
|
queryClient.invalidateQueries(QUERY_KEYS.WEBHOOK_LIST);
|
|
919
|
-
options === null || options === void 0 || (_options$onSuccess3 = options.onSuccess) === null || _options$onSuccess3 === void 0
|
|
923
|
+
options === null || options === void 0 || (_options$onSuccess3 = options.onSuccess) === null || _options$onSuccess3 === void 0 || _options$onSuccess3.call(options);
|
|
920
924
|
}
|
|
921
925
|
});
|
|
922
926
|
};
|
|
923
927
|
|
|
924
|
-
function _typeof(
|
|
928
|
+
function _typeof(o) {
|
|
925
929
|
"@babel/helpers - typeof";
|
|
926
930
|
|
|
927
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (
|
|
928
|
-
return typeof
|
|
929
|
-
} : function (
|
|
930
|
-
return
|
|
931
|
-
}, _typeof(
|
|
931
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
932
|
+
return typeof o;
|
|
933
|
+
} : function (o) {
|
|
934
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
935
|
+
}, _typeof(o);
|
|
932
936
|
}
|
|
933
937
|
|
|
934
938
|
function _toPrimitive(input, hint) {
|
|
@@ -976,34 +980,100 @@ var useFetchEvents = function useFetchEvents() {
|
|
|
976
980
|
});
|
|
977
981
|
};
|
|
978
982
|
|
|
979
|
-
var WEBHOOK_HELP_URL = "https://
|
|
983
|
+
var WEBHOOK_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-4bb6c2a2";
|
|
984
|
+
var WEBHOOK_SECRETS_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-80de90bd";
|
|
985
|
+
|
|
986
|
+
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
987
|
+
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
988
|
+
// generators (like Math.random()).
|
|
989
|
+
let getRandomValues;
|
|
990
|
+
const rnds8 = new Uint8Array(16);
|
|
991
|
+
function rng() {
|
|
992
|
+
// lazy load so that environments that need to polyfill have a chance to do so
|
|
993
|
+
if (!getRandomValues) {
|
|
994
|
+
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
|
995
|
+
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
996
|
+
|
|
997
|
+
if (!getRandomValues) {
|
|
998
|
+
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
return getRandomValues(rnds8);
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
/**
|
|
1006
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
|
1007
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
1008
|
+
*/
|
|
1009
|
+
|
|
1010
|
+
const byteToHex = [];
|
|
1011
|
+
|
|
1012
|
+
for (let i = 0; i < 256; ++i) {
|
|
1013
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
function unsafeStringify(arr, offset = 0) {
|
|
1017
|
+
// Note: Be careful editing this code! It's been tuned for performance
|
|
1018
|
+
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
1019
|
+
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
1023
|
+
var native = {
|
|
1024
|
+
randomUUID
|
|
1025
|
+
};
|
|
1026
|
+
|
|
1027
|
+
function v4(options, buf, offset) {
|
|
1028
|
+
if (native.randomUUID && !buf && !options) {
|
|
1029
|
+
return native.randomUUID();
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
options = options || {};
|
|
1033
|
+
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
1034
|
+
|
|
1035
|
+
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
1036
|
+
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
1037
|
+
|
|
1038
|
+
if (buf) {
|
|
1039
|
+
offset = offset || 0;
|
|
1040
|
+
|
|
1041
|
+
for (let i = 0; i < 16; ++i) {
|
|
1042
|
+
buf[offset + i] = rnds[i];
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
return buf;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
return unsafeStringify(rnds);
|
|
1049
|
+
}
|
|
980
1050
|
|
|
981
1051
|
var MENU_ITEMS = {
|
|
982
1052
|
EDIT: "edit",
|
|
983
1053
|
DELETE: "delete"
|
|
984
1054
|
};
|
|
985
1055
|
|
|
986
|
-
function ownKeys$1(
|
|
987
|
-
function _objectSpread$1(
|
|
1056
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1057
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
988
1058
|
var getMenuItems = function getMenuItems(_ref) {
|
|
989
1059
|
var onEdit = _ref.onEdit,
|
|
990
1060
|
onDelete = _ref.onDelete;
|
|
991
1061
|
return [{
|
|
992
1062
|
key: MENU_ITEMS.EDIT,
|
|
993
|
-
label: t("neetoWebhooks.buttons.edit"),
|
|
1063
|
+
label: t$1("neetoWebhooks.buttons.edit"),
|
|
994
1064
|
onClick: onEdit
|
|
995
1065
|
}, {
|
|
996
1066
|
key: MENU_ITEMS.DELETE,
|
|
997
|
-
label: t("neetoWebhooks.buttons.delete"),
|
|
1067
|
+
label: t$1("neetoWebhooks.buttons.delete"),
|
|
998
1068
|
onClick: onDelete
|
|
999
1069
|
}];
|
|
1000
1070
|
};
|
|
1001
1071
|
var getValidationSchema = function getValidationSchema(webhooks) {
|
|
1002
1072
|
return yup.object().shape({
|
|
1003
|
-
endpoint: yup.string().trim().matches(/^(https?):\/\//i, t("neetoWebhooks.errors.webhook.invalidUrlProtocol")).url(t("neetoWebhooks.errors.webhook.invalidUrl")).required(t("neetoWebhooks.errors.webhook.required")).test("Is endpoint unique", t("neetoWebhooks.errors.webhook.urlNotUnique"), function (endpoint, ctx) {
|
|
1073
|
+
endpoint: yup.string().trim().matches(/^(https?):\/\//i, t$1("neetoWebhooks.errors.webhook.invalidUrlProtocol")).url(t$1("neetoWebhooks.errors.webhook.invalidUrl")).required(t$1("neetoWebhooks.errors.webhook.required")).test("Is endpoint unique", t$1("neetoWebhooks.errors.webhook.urlNotUnique"), function (endpoint, ctx) {
|
|
1004
1074
|
return !pluck("endpoint", removeById(ctx.parent.id, webhooks)).includes(endpoint === null || endpoint === void 0 ? void 0 : endpoint.trim());
|
|
1005
1075
|
}),
|
|
1006
|
-
events: yup.array().min(1, t("neetoWebhooks.errors.webhook.events.required")),
|
|
1076
|
+
events: yup.array().min(1, t$1("neetoWebhooks.errors.webhook.events.required")),
|
|
1007
1077
|
secret: yup.string().trim().nullable()
|
|
1008
1078
|
});
|
|
1009
1079
|
};
|
|
@@ -1042,9 +1112,10 @@ var buildColumns = function buildColumns(_ref6) {
|
|
|
1042
1112
|
handleEdit = _ref6.handleEdit,
|
|
1043
1113
|
deliveriesPath = _ref6.deliveriesPath;
|
|
1044
1114
|
return [{
|
|
1045
|
-
title: t("neetoWebhooks.common.endpoint"),
|
|
1115
|
+
title: t$1("neetoWebhooks.common.endpoint"),
|
|
1046
1116
|
key: "endpoint",
|
|
1047
1117
|
dataIndex: "endpoint",
|
|
1118
|
+
width: 830,
|
|
1048
1119
|
render: function render(endpoint, webhook) {
|
|
1049
1120
|
return /*#__PURE__*/React.createElement("div", {
|
|
1050
1121
|
className: "flex items-center justify-between space-x-3"
|
|
@@ -1068,15 +1139,15 @@ var buildColumns = function buildColumns(_ref6) {
|
|
|
1068
1139
|
}));
|
|
1069
1140
|
}
|
|
1070
1141
|
}, {
|
|
1071
|
-
title: t("neetoWebhooks.webhook.active"),
|
|
1142
|
+
title: t$1("neetoWebhooks.webhook.active"),
|
|
1072
1143
|
key: "isActive",
|
|
1073
1144
|
dataIndex: "isActive",
|
|
1074
1145
|
render: function render(isActive) {
|
|
1075
|
-
return isActive ? t("neetoWebhooks.webhook.activeStatuses.yes") : t("neetoWebhooks.webhook.activeStatuses.no");
|
|
1146
|
+
return isActive ? t$1("neetoWebhooks.webhook.activeStatuses.yes") : t$1("neetoWebhooks.webhook.activeStatuses.no");
|
|
1076
1147
|
},
|
|
1077
1148
|
width: 100
|
|
1078
1149
|
}, {
|
|
1079
|
-
title: t("neetoWebhooks.common.event", PLURAL),
|
|
1150
|
+
title: t$1("neetoWebhooks.common.event", PLURAL),
|
|
1080
1151
|
dataIndex: "events",
|
|
1081
1152
|
key: "events",
|
|
1082
1153
|
render: function render(events) {
|
|
@@ -1085,21 +1156,30 @@ var buildColumns = function buildColumns(_ref6) {
|
|
|
1085
1156
|
width: 400
|
|
1086
1157
|
}];
|
|
1087
1158
|
};
|
|
1159
|
+
var generateRandomSecret = function generateRandomSecret() {
|
|
1160
|
+
return v4().replace(/-/g, "");
|
|
1161
|
+
};
|
|
1088
1162
|
|
|
1089
|
-
function ownKeys(
|
|
1090
|
-
function _objectSpread(
|
|
1163
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1164
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1091
1165
|
var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
1092
1166
|
var editingWebhookId = _ref.editingWebhookId,
|
|
1093
1167
|
entityId = _ref.entityId,
|
|
1094
1168
|
entityType = _ref.entityType,
|
|
1095
1169
|
isOpen = _ref.isOpen,
|
|
1096
1170
|
onClose = _ref.onClose,
|
|
1171
|
+
onCreate = _ref.onCreate,
|
|
1097
1172
|
webhooks = _ref.webhooks;
|
|
1098
1173
|
var _useTranslation = useTranslation(),
|
|
1099
1174
|
t = _useTranslation.t;
|
|
1175
|
+
var _useState = useState(false),
|
|
1176
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1177
|
+
isSecretInputFieldVisible = _useState2[0],
|
|
1178
|
+
setIsSecretInputFieldVisible = _useState2[1];
|
|
1100
1179
|
var _useCreateWebhook = useCreateWebhook({
|
|
1101
1180
|
onSuccess: function onSuccess() {
|
|
1102
|
-
|
|
1181
|
+
onClose();
|
|
1182
|
+
onCreate === null || onCreate === void 0 || onCreate();
|
|
1103
1183
|
}
|
|
1104
1184
|
}),
|
|
1105
1185
|
createWebhook = _useCreateWebhook.mutate;
|
|
@@ -1109,9 +1189,7 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
1109
1189
|
_useShowWebhook$data3 = _useShowWebhook$data2.webhook,
|
|
1110
1190
|
webhook = _useShowWebhook$data3 === void 0 ? {} : _useShowWebhook$data3;
|
|
1111
1191
|
var _useUpdateWebhook = useUpdateWebhook(editingWebhookId, {
|
|
1112
|
-
onSuccess:
|
|
1113
|
-
return onClose();
|
|
1114
|
-
}
|
|
1192
|
+
onSuccess: onClose
|
|
1115
1193
|
}),
|
|
1116
1194
|
updateWebhook = _useUpdateWebhook.mutate;
|
|
1117
1195
|
var endpointRef = useRef();
|
|
@@ -1138,10 +1216,28 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
1138
1216
|
entityType: entityType
|
|
1139
1217
|
}));
|
|
1140
1218
|
};
|
|
1219
|
+
var handleClick = function handleClick(setFieldValue) {
|
|
1220
|
+
var randomWebhookSecret = generateRandomSecret();
|
|
1221
|
+
setFieldValue("secret", randomWebhookSecret);
|
|
1222
|
+
setIsSecretInputFieldVisible(true);
|
|
1223
|
+
};
|
|
1224
|
+
var handleRegenerate = function handleRegenerate(setFieldValue) {
|
|
1225
|
+
var randomWebhookSecret = generateRandomSecret();
|
|
1226
|
+
setFieldValue("secret", randomWebhookSecret);
|
|
1227
|
+
};
|
|
1228
|
+
var handleDelete = function handleDelete(setFieldValue) {
|
|
1229
|
+
setFieldValue("secret", null);
|
|
1230
|
+
setIsSecretInputFieldVisible(false);
|
|
1231
|
+
};
|
|
1232
|
+
useEffect(function () {
|
|
1233
|
+
if (webhook !== null && webhook !== void 0 && webhook.secret) {
|
|
1234
|
+
setIsSecretInputFieldVisible(true);
|
|
1235
|
+
}
|
|
1236
|
+
}, [webhook]);
|
|
1141
1237
|
return /*#__PURE__*/React.createElement(Pane, {
|
|
1142
|
-
initialFocusRef: endpointRef,
|
|
1143
1238
|
isOpen: isOpen,
|
|
1144
|
-
onClose: onClose
|
|
1239
|
+
onClose: onClose,
|
|
1240
|
+
initialFocusRef: endpointRef
|
|
1145
1241
|
}, /*#__PURE__*/React.createElement(Pane.Header, {
|
|
1146
1242
|
className: "flex items-center space-x-3"
|
|
1147
1243
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
@@ -1167,7 +1263,8 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
1167
1263
|
}, function (_ref2) {
|
|
1168
1264
|
var dirty = _ref2.dirty,
|
|
1169
1265
|
isSubmitting = _ref2.isSubmitting,
|
|
1170
|
-
isValid = _ref2.isValid
|
|
1266
|
+
isValid = _ref2.isValid,
|
|
1267
|
+
setFieldValue = _ref2.setFieldValue;
|
|
1171
1268
|
return isLoading ? /*#__PURE__*/React.createElement("div", {
|
|
1172
1269
|
className: "flex items-center justify-center"
|
|
1173
1270
|
}, /*#__PURE__*/React.createElement(Spinner, null)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Pane.Body, null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -1189,15 +1286,16 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
1189
1286
|
name: "events",
|
|
1190
1287
|
options: events,
|
|
1191
1288
|
placeholder: t("neetoWebhooks.webhook.eventPlaceholder")
|
|
1192
|
-
}), /*#__PURE__*/React.createElement(
|
|
1289
|
+
}), isSecretInputFieldVisible && /*#__PURE__*/React.createElement("div", {
|
|
1290
|
+
className: "flex items-center justify-between space-x-3"
|
|
1291
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
1193
1292
|
"data-cy": "secret-key-input-field",
|
|
1194
1293
|
name: "secret",
|
|
1195
|
-
placeholder: t("neetoWebhooks.webhook.secretPlaceholder"),
|
|
1196
1294
|
label: /*#__PURE__*/React.createElement(Trans, {
|
|
1197
1295
|
i18nKey: "neetoWebhooks.webhook.secret",
|
|
1198
1296
|
components: {
|
|
1199
1297
|
helpLink: /*#__PURE__*/React.createElement("a", {
|
|
1200
|
-
href:
|
|
1298
|
+
href: WEBHOOK_SECRETS_HELP_URL,
|
|
1201
1299
|
rel: "noreferrer",
|
|
1202
1300
|
target: "_blank"
|
|
1203
1301
|
}),
|
|
@@ -1206,10 +1304,36 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
1206
1304
|
size: 20
|
|
1207
1305
|
})
|
|
1208
1306
|
}
|
|
1209
|
-
})
|
|
1210
|
-
|
|
1307
|
+
}),
|
|
1308
|
+
placeholder: t("neetoWebhooks.webhook.secretPlaceholder")
|
|
1309
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
1310
|
+
className: "mt-6"
|
|
1311
|
+
}, /*#__PURE__*/React.createElement(MoreDropdown, {
|
|
1312
|
+
menuItems: [{
|
|
1313
|
+
key: "regenerate-secret",
|
|
1314
|
+
label: t("neetoWebhooks.buttons.regenerate"),
|
|
1315
|
+
"data-cy": "regenerate-secret",
|
|
1316
|
+
onClick: function onClick() {
|
|
1317
|
+
return handleRegenerate(setFieldValue);
|
|
1318
|
+
}
|
|
1319
|
+
}, {
|
|
1320
|
+
key: "delete-secret",
|
|
1321
|
+
label: t("neetoWebhooks.buttons.delete"),
|
|
1322
|
+
"data-cy": "delete-secret",
|
|
1323
|
+
onClick: function onClick() {
|
|
1324
|
+
return handleDelete(setFieldValue);
|
|
1325
|
+
}
|
|
1326
|
+
}]
|
|
1327
|
+
}))), /*#__PURE__*/React.createElement(Switch, {
|
|
1211
1328
|
label: t("neetoWebhooks.webhook.active"),
|
|
1212
1329
|
name: "isActive"
|
|
1330
|
+
}), !isSecretInputFieldVisible && /*#__PURE__*/React.createElement(Button, {
|
|
1331
|
+
icon: Plus,
|
|
1332
|
+
label: t("neetoWebhooks.buttons.addSecretKey"),
|
|
1333
|
+
style: "text",
|
|
1334
|
+
onClick: function onClick() {
|
|
1335
|
+
return handleClick(setFieldValue);
|
|
1336
|
+
}
|
|
1213
1337
|
}))), /*#__PURE__*/React.createElement(Pane.Footer, {
|
|
1214
1338
|
className: "flex gap-2"
|
|
1215
1339
|
}, /*#__PURE__*/React.createElement(ActionBlock, {
|
|
@@ -1256,7 +1380,9 @@ var Webhooks = function Webhooks(_ref) {
|
|
|
1256
1380
|
var deliveriesPath = _ref.deliveriesPath,
|
|
1257
1381
|
entityType = _ref.entityType,
|
|
1258
1382
|
breadcrumbs = _ref.breadcrumbs,
|
|
1259
|
-
entityId = _ref.entityId
|
|
1383
|
+
entityId = _ref.entityId,
|
|
1384
|
+
onCreate = _ref.onCreate,
|
|
1385
|
+
onDelete = _ref.onDelete;
|
|
1260
1386
|
var _useState = useState(),
|
|
1261
1387
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1262
1388
|
editingWebhookId = _useState2[0],
|
|
@@ -1294,7 +1420,8 @@ var Webhooks = function Webhooks(_ref) {
|
|
|
1294
1420
|
totalCount = _useFetchWebhooks$dat4 === void 0 ? 0 : _useFetchWebhooks$dat4;
|
|
1295
1421
|
var _useDestroyWebhook = useDestroyWebhook({
|
|
1296
1422
|
onSuccess: function onSuccess() {
|
|
1297
|
-
|
|
1423
|
+
setIsDeleteAlertOpen(false);
|
|
1424
|
+
onDelete === null || onDelete === void 0 || onDelete();
|
|
1298
1425
|
}
|
|
1299
1426
|
}),
|
|
1300
1427
|
isDeleting = _useDestroyWebhook.isLoading,
|
|
@@ -1344,6 +1471,7 @@ var Webhooks = function Webhooks(_ref) {
|
|
|
1344
1471
|
editingWebhookId: editingWebhookId,
|
|
1345
1472
|
entityId: entityId,
|
|
1346
1473
|
entityType: entityType,
|
|
1474
|
+
onCreate: onCreate,
|
|
1347
1475
|
webhooks: webhooks,
|
|
1348
1476
|
isOpen: isAddWebhookPaneOpen,
|
|
1349
1477
|
onClose: handlePaneClose
|
|
@@ -1371,7 +1499,9 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
|
|
|
1371
1499
|
var entityType = _ref.entityType,
|
|
1372
1500
|
entityId = _ref.entityId,
|
|
1373
1501
|
_ref$breadcrumbs = _ref.breadcrumbs,
|
|
1374
|
-
breadcrumbs = _ref$breadcrumbs === void 0 ? [] : _ref$breadcrumbs
|
|
1502
|
+
breadcrumbs = _ref$breadcrumbs === void 0 ? [] : _ref$breadcrumbs,
|
|
1503
|
+
onCreate = _ref.onCreate,
|
|
1504
|
+
onDelete = _ref.onDelete;
|
|
1375
1505
|
var _useRouteMatch = useRouteMatch(),
|
|
1376
1506
|
webhooksPath = _useRouteMatch.path,
|
|
1377
1507
|
webhooksUrl = _useRouteMatch.url;
|
|
@@ -1384,19 +1514,26 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
|
|
|
1384
1514
|
breadcrumbs: breadcrumbs,
|
|
1385
1515
|
deliveriesPath: deliveriesPath,
|
|
1386
1516
|
entityId: entityId,
|
|
1387
|
-
entityType: entityType
|
|
1517
|
+
entityType: entityType,
|
|
1518
|
+
onCreate: onCreate,
|
|
1519
|
+
onDelete: onDelete
|
|
1388
1520
|
});
|
|
1389
1521
|
}
|
|
1390
1522
|
}), /*#__PURE__*/React.createElement(Route, {
|
|
1391
|
-
path: deliveriesPath,
|
|
1392
1523
|
component: function component() {
|
|
1393
1524
|
return /*#__PURE__*/React.createElement(Deliveries$1, {
|
|
1394
1525
|
breadcrumbs: breadcrumbs,
|
|
1395
1526
|
webhooksUrl: webhooksUrl
|
|
1396
1527
|
});
|
|
1397
|
-
}
|
|
1528
|
+
},
|
|
1529
|
+
path: deliveriesPath
|
|
1398
1530
|
}));
|
|
1399
1531
|
};
|
|
1400
1532
|
|
|
1533
|
+
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
1534
|
+
|
|
1535
|
+
var css = ".neeto-molecules-header .neeto-molecules-header__breadcrumbs-wrap{flex-wrap:wrap}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3NyYy9zdHlsZXNoZWV0cy9tYWluLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0Usa0VBQ0UsY0FBSiIsInNvdXJjZXNDb250ZW50IjpbIi5uZWV0by1tb2xlY3VsZXMtaGVhZGVyIHtcbiAgLm5lZXRvLW1vbGVjdWxlcy1oZWFkZXJfX2JyZWFkY3J1bWJzLXdyYXAge1xuICAgIGZsZXgtd3JhcDogd3JhcDtcbiAgfVxufVxuIl19 */";
|
|
1536
|
+
n(css,{});
|
|
1537
|
+
|
|
1401
1538
|
export { NeetoWebhooks };
|
|
1402
1539
|
//# sourceMappingURL=index.js.map
|