@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.cjs.js
CHANGED
|
@@ -19,9 +19,9 @@ var DateFormat = require('@bigbinary/neeto-molecules/DateFormat');
|
|
|
19
19
|
var i18next = require('i18next');
|
|
20
20
|
var ramda = require('ramda');
|
|
21
21
|
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
22
|
+
var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
|
|
22
23
|
var formik = require('@bigbinary/neetoui/formik');
|
|
23
24
|
var utils = require('@bigbinary/neeto-commons-frontend/utils');
|
|
24
|
-
var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
|
|
25
25
|
var yup = require('yup');
|
|
26
26
|
|
|
27
27
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -93,31 +93,31 @@ function _arrayWithHoles(arr) {
|
|
|
93
93
|
if (Array.isArray(arr)) return arr;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
function _iterableToArrayLimit(
|
|
97
|
-
var
|
|
98
|
-
if (null !=
|
|
99
|
-
var
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
96
|
+
function _iterableToArrayLimit(r, l) {
|
|
97
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
98
|
+
if (null != t) {
|
|
99
|
+
var e,
|
|
100
|
+
n,
|
|
101
|
+
i,
|
|
102
|
+
u,
|
|
103
|
+
a = [],
|
|
104
|
+
f = !0,
|
|
105
|
+
o = !1;
|
|
106
106
|
try {
|
|
107
|
-
if (
|
|
108
|
-
if (Object(
|
|
109
|
-
|
|
110
|
-
} else for (; !(
|
|
111
|
-
} catch (
|
|
112
|
-
|
|
107
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
108
|
+
if (Object(t) !== t) return;
|
|
109
|
+
f = !1;
|
|
110
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
111
|
+
} catch (r) {
|
|
112
|
+
o = !0, n = r;
|
|
113
113
|
} finally {
|
|
114
114
|
try {
|
|
115
|
-
if (!
|
|
115
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
116
116
|
} finally {
|
|
117
|
-
if (
|
|
117
|
+
if (o) throw n;
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
return
|
|
120
|
+
return a;
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
|
|
@@ -247,14 +247,14 @@ var _typeof$1 = {exports: {}};
|
|
|
247
247
|
_typeof$1.exports;
|
|
248
248
|
|
|
249
249
|
(function (module) {
|
|
250
|
-
function _typeof(
|
|
250
|
+
function _typeof(o) {
|
|
251
251
|
"@babel/helpers - typeof";
|
|
252
252
|
|
|
253
|
-
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (
|
|
254
|
-
return typeof
|
|
255
|
-
} : function (
|
|
256
|
-
return
|
|
257
|
-
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(
|
|
253
|
+
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
254
|
+
return typeof o;
|
|
255
|
+
} : function (o) {
|
|
256
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
257
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
|
|
258
258
|
}
|
|
259
259
|
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
260
260
|
} (_typeof$1));
|
|
@@ -267,304 +267,304 @@ regeneratorRuntime$1.exports;
|
|
|
267
267
|
var _typeof = _typeofExports["default"];
|
|
268
268
|
function _regeneratorRuntime() {
|
|
269
269
|
module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
|
270
|
-
return
|
|
270
|
+
return e;
|
|
271
271
|
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
272
|
-
var
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
272
|
+
var t,
|
|
273
|
+
e = {},
|
|
274
|
+
r = Object.prototype,
|
|
275
|
+
n = r.hasOwnProperty,
|
|
276
|
+
o = Object.defineProperty || function (t, e, r) {
|
|
277
|
+
t[e] = r.value;
|
|
277
278
|
},
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
function define(
|
|
283
|
-
return Object.defineProperty(
|
|
284
|
-
value:
|
|
279
|
+
i = "function" == typeof Symbol ? Symbol : {},
|
|
280
|
+
a = i.iterator || "@@iterator",
|
|
281
|
+
c = i.asyncIterator || "@@asyncIterator",
|
|
282
|
+
u = i.toStringTag || "@@toStringTag";
|
|
283
|
+
function define(t, e, r) {
|
|
284
|
+
return Object.defineProperty(t, e, {
|
|
285
|
+
value: r,
|
|
285
286
|
enumerable: !0,
|
|
286
287
|
configurable: !0,
|
|
287
288
|
writable: !0
|
|
288
|
-
}),
|
|
289
|
+
}), t[e];
|
|
289
290
|
}
|
|
290
291
|
try {
|
|
291
292
|
define({}, "");
|
|
292
|
-
} catch (
|
|
293
|
-
define = function define(
|
|
294
|
-
return
|
|
293
|
+
} catch (t) {
|
|
294
|
+
define = function define(t, e, r) {
|
|
295
|
+
return t[e] = r;
|
|
295
296
|
};
|
|
296
297
|
}
|
|
297
|
-
function wrap(
|
|
298
|
-
var
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
return
|
|
302
|
-
value: makeInvokeMethod(
|
|
303
|
-
}),
|
|
298
|
+
function wrap(t, e, r, n) {
|
|
299
|
+
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
300
|
+
a = Object.create(i.prototype),
|
|
301
|
+
c = new Context(n || []);
|
|
302
|
+
return o(a, "_invoke", {
|
|
303
|
+
value: makeInvokeMethod(t, r, c)
|
|
304
|
+
}), a;
|
|
304
305
|
}
|
|
305
|
-
function tryCatch(
|
|
306
|
+
function tryCatch(t, e, r) {
|
|
306
307
|
try {
|
|
307
308
|
return {
|
|
308
309
|
type: "normal",
|
|
309
|
-
arg:
|
|
310
|
+
arg: t.call(e, r)
|
|
310
311
|
};
|
|
311
|
-
} catch (
|
|
312
|
+
} catch (t) {
|
|
312
313
|
return {
|
|
313
314
|
type: "throw",
|
|
314
|
-
arg:
|
|
315
|
+
arg: t
|
|
315
316
|
};
|
|
316
317
|
}
|
|
317
318
|
}
|
|
318
|
-
|
|
319
|
-
var
|
|
319
|
+
e.wrap = wrap;
|
|
320
|
+
var h = "suspendedStart",
|
|
321
|
+
l = "suspendedYield",
|
|
322
|
+
f = "executing",
|
|
323
|
+
s = "completed",
|
|
324
|
+
y = {};
|
|
320
325
|
function Generator() {}
|
|
321
326
|
function GeneratorFunction() {}
|
|
322
327
|
function GeneratorFunctionPrototype() {}
|
|
323
|
-
var
|
|
324
|
-
define(
|
|
328
|
+
var p = {};
|
|
329
|
+
define(p, a, function () {
|
|
325
330
|
return this;
|
|
326
331
|
});
|
|
327
|
-
var
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
var
|
|
331
|
-
function defineIteratorMethods(
|
|
332
|
-
["next", "throw", "return"].forEach(function (
|
|
333
|
-
define(
|
|
334
|
-
return this._invoke(
|
|
332
|
+
var d = Object.getPrototypeOf,
|
|
333
|
+
v = d && d(d(values([])));
|
|
334
|
+
v && v !== r && n.call(v, a) && (p = v);
|
|
335
|
+
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
336
|
+
function defineIteratorMethods(t) {
|
|
337
|
+
["next", "throw", "return"].forEach(function (e) {
|
|
338
|
+
define(t, e, function (t) {
|
|
339
|
+
return this._invoke(e, t);
|
|
335
340
|
});
|
|
336
341
|
});
|
|
337
342
|
}
|
|
338
|
-
function AsyncIterator(
|
|
339
|
-
function invoke(
|
|
340
|
-
var
|
|
341
|
-
if ("throw" !==
|
|
342
|
-
var
|
|
343
|
-
|
|
344
|
-
return
|
|
345
|
-
invoke("next",
|
|
346
|
-
}, function (
|
|
347
|
-
invoke("throw",
|
|
348
|
-
}) :
|
|
349
|
-
|
|
350
|
-
}, function (
|
|
351
|
-
return invoke("throw",
|
|
343
|
+
function AsyncIterator(t, e) {
|
|
344
|
+
function invoke(r, o, i, a) {
|
|
345
|
+
var c = tryCatch(t[r], t, o);
|
|
346
|
+
if ("throw" !== c.type) {
|
|
347
|
+
var u = c.arg,
|
|
348
|
+
h = u.value;
|
|
349
|
+
return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
350
|
+
invoke("next", t, i, a);
|
|
351
|
+
}, function (t) {
|
|
352
|
+
invoke("throw", t, i, a);
|
|
353
|
+
}) : e.resolve(h).then(function (t) {
|
|
354
|
+
u.value = t, i(u);
|
|
355
|
+
}, function (t) {
|
|
356
|
+
return invoke("throw", t, i, a);
|
|
352
357
|
});
|
|
353
358
|
}
|
|
354
|
-
|
|
359
|
+
a(c.arg);
|
|
355
360
|
}
|
|
356
|
-
var
|
|
357
|
-
|
|
358
|
-
value: function value(
|
|
361
|
+
var r;
|
|
362
|
+
o(this, "_invoke", {
|
|
363
|
+
value: function value(t, n) {
|
|
359
364
|
function callInvokeWithMethodAndArg() {
|
|
360
|
-
return new
|
|
361
|
-
invoke(
|
|
365
|
+
return new e(function (e, r) {
|
|
366
|
+
invoke(t, n, e, r);
|
|
362
367
|
});
|
|
363
368
|
}
|
|
364
|
-
return
|
|
369
|
+
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
365
370
|
}
|
|
366
371
|
});
|
|
367
372
|
}
|
|
368
|
-
function makeInvokeMethod(
|
|
369
|
-
var
|
|
370
|
-
return function (
|
|
371
|
-
if (
|
|
372
|
-
if (
|
|
373
|
-
if ("throw" ===
|
|
374
|
-
return
|
|
373
|
+
function makeInvokeMethod(e, r, n) {
|
|
374
|
+
var o = h;
|
|
375
|
+
return function (i, a) {
|
|
376
|
+
if (o === f) throw new Error("Generator is already running");
|
|
377
|
+
if (o === s) {
|
|
378
|
+
if ("throw" === i) throw a;
|
|
379
|
+
return {
|
|
380
|
+
value: t,
|
|
381
|
+
done: !0
|
|
382
|
+
};
|
|
375
383
|
}
|
|
376
|
-
for (
|
|
377
|
-
var
|
|
378
|
-
if (
|
|
379
|
-
var
|
|
380
|
-
if (
|
|
381
|
-
if (
|
|
382
|
-
return
|
|
384
|
+
for (n.method = i, n.arg = a;;) {
|
|
385
|
+
var c = n.delegate;
|
|
386
|
+
if (c) {
|
|
387
|
+
var u = maybeInvokeDelegate(c, n);
|
|
388
|
+
if (u) {
|
|
389
|
+
if (u === y) continue;
|
|
390
|
+
return u;
|
|
383
391
|
}
|
|
384
392
|
}
|
|
385
|
-
if ("next" ===
|
|
386
|
-
if (
|
|
387
|
-
|
|
388
|
-
} else "return" ===
|
|
389
|
-
|
|
390
|
-
var
|
|
391
|
-
if ("normal" ===
|
|
392
|
-
if (
|
|
393
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
394
|
+
if (o === h) throw o = s, n.arg;
|
|
395
|
+
n.dispatchException(n.arg);
|
|
396
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
397
|
+
o = f;
|
|
398
|
+
var p = tryCatch(e, r, n);
|
|
399
|
+
if ("normal" === p.type) {
|
|
400
|
+
if (o = n.done ? s : l, p.arg === y) continue;
|
|
393
401
|
return {
|
|
394
|
-
value:
|
|
395
|
-
done:
|
|
402
|
+
value: p.arg,
|
|
403
|
+
done: n.done
|
|
396
404
|
};
|
|
397
405
|
}
|
|
398
|
-
"throw" ===
|
|
406
|
+
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
399
407
|
}
|
|
400
408
|
};
|
|
401
409
|
}
|
|
402
|
-
function maybeInvokeDelegate(
|
|
403
|
-
var
|
|
404
|
-
|
|
405
|
-
if (
|
|
406
|
-
var
|
|
407
|
-
if ("throw" ===
|
|
408
|
-
var
|
|
409
|
-
return
|
|
410
|
+
function maybeInvokeDelegate(e, r) {
|
|
411
|
+
var n = r.method,
|
|
412
|
+
o = e.iterator[n];
|
|
413
|
+
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;
|
|
414
|
+
var i = tryCatch(o, e.iterator, r.arg);
|
|
415
|
+
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
416
|
+
var a = i.arg;
|
|
417
|
+
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);
|
|
410
418
|
}
|
|
411
|
-
function pushTryEntry(
|
|
412
|
-
var
|
|
413
|
-
tryLoc:
|
|
419
|
+
function pushTryEntry(t) {
|
|
420
|
+
var e = {
|
|
421
|
+
tryLoc: t[0]
|
|
414
422
|
};
|
|
415
|
-
1 in
|
|
423
|
+
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
416
424
|
}
|
|
417
|
-
function resetTryEntry(
|
|
418
|
-
var
|
|
419
|
-
|
|
425
|
+
function resetTryEntry(t) {
|
|
426
|
+
var e = t.completion || {};
|
|
427
|
+
e.type = "normal", delete e.arg, t.completion = e;
|
|
420
428
|
}
|
|
421
|
-
function Context(
|
|
429
|
+
function Context(t) {
|
|
422
430
|
this.tryEntries = [{
|
|
423
431
|
tryLoc: "root"
|
|
424
|
-
}],
|
|
432
|
+
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
425
433
|
}
|
|
426
|
-
function values(
|
|
427
|
-
if (
|
|
428
|
-
var
|
|
429
|
-
if (
|
|
430
|
-
if ("function" == typeof
|
|
431
|
-
if (!isNaN(
|
|
432
|
-
var
|
|
433
|
-
|
|
434
|
-
for (; ++
|
|
435
|
-
return next.value =
|
|
434
|
+
function values(e) {
|
|
435
|
+
if (e || "" === e) {
|
|
436
|
+
var r = e[a];
|
|
437
|
+
if (r) return r.call(e);
|
|
438
|
+
if ("function" == typeof e.next) return e;
|
|
439
|
+
if (!isNaN(e.length)) {
|
|
440
|
+
var o = -1,
|
|
441
|
+
i = function next() {
|
|
442
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
443
|
+
return next.value = t, next.done = !0, next;
|
|
436
444
|
};
|
|
437
|
-
return
|
|
445
|
+
return i.next = i;
|
|
438
446
|
}
|
|
439
447
|
}
|
|
440
|
-
|
|
441
|
-
next: doneResult
|
|
442
|
-
};
|
|
448
|
+
throw new TypeError(_typeof(e) + " is not iterable");
|
|
443
449
|
}
|
|
444
|
-
|
|
445
|
-
return {
|
|
446
|
-
value: undefined,
|
|
447
|
-
done: !0
|
|
448
|
-
};
|
|
449
|
-
}
|
|
450
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
|
|
450
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
451
451
|
value: GeneratorFunctionPrototype,
|
|
452
452
|
configurable: !0
|
|
453
|
-
}),
|
|
453
|
+
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
454
454
|
value: GeneratorFunction,
|
|
455
455
|
configurable: !0
|
|
456
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype,
|
|
457
|
-
var
|
|
458
|
-
return !!
|
|
459
|
-
},
|
|
460
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(
|
|
461
|
-
},
|
|
456
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
457
|
+
var e = "function" == typeof t && t.constructor;
|
|
458
|
+
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
459
|
+
}, e.mark = function (t) {
|
|
460
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
461
|
+
}, e.awrap = function (t) {
|
|
462
462
|
return {
|
|
463
|
-
__await:
|
|
463
|
+
__await: t
|
|
464
464
|
};
|
|
465
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype,
|
|
465
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
466
466
|
return this;
|
|
467
|
-
}),
|
|
468
|
-
void 0 ===
|
|
469
|
-
var
|
|
470
|
-
return
|
|
471
|
-
return
|
|
467
|
+
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
468
|
+
void 0 === i && (i = Promise);
|
|
469
|
+
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
470
|
+
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
471
|
+
return t.done ? t.value : a.next();
|
|
472
472
|
});
|
|
473
|
-
}, defineIteratorMethods(
|
|
473
|
+
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
474
474
|
return this;
|
|
475
|
-
}), define(
|
|
475
|
+
}), define(g, "toString", function () {
|
|
476
476
|
return "[object Generator]";
|
|
477
|
-
}),
|
|
478
|
-
var
|
|
479
|
-
|
|
480
|
-
for (var
|
|
481
|
-
return
|
|
482
|
-
for (;
|
|
483
|
-
var
|
|
484
|
-
if (
|
|
477
|
+
}), e.keys = function (t) {
|
|
478
|
+
var e = Object(t),
|
|
479
|
+
r = [];
|
|
480
|
+
for (var n in e) r.push(n);
|
|
481
|
+
return r.reverse(), function next() {
|
|
482
|
+
for (; r.length;) {
|
|
483
|
+
var t = r.pop();
|
|
484
|
+
if (t in e) return next.value = t, next.done = !1, next;
|
|
485
485
|
}
|
|
486
486
|
return next.done = !0, next;
|
|
487
487
|
};
|
|
488
|
-
},
|
|
488
|
+
}, e.values = values, Context.prototype = {
|
|
489
489
|
constructor: Context,
|
|
490
|
-
reset: function reset(
|
|
491
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
490
|
+
reset: function reset(e) {
|
|
491
|
+
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);
|
|
492
492
|
},
|
|
493
493
|
stop: function stop() {
|
|
494
494
|
this.done = !0;
|
|
495
|
-
var
|
|
496
|
-
if ("throw" ===
|
|
495
|
+
var t = this.tryEntries[0].completion;
|
|
496
|
+
if ("throw" === t.type) throw t.arg;
|
|
497
497
|
return this.rval;
|
|
498
498
|
},
|
|
499
|
-
dispatchException: function dispatchException(
|
|
500
|
-
if (this.done) throw
|
|
501
|
-
var
|
|
502
|
-
function handle(
|
|
503
|
-
return
|
|
499
|
+
dispatchException: function dispatchException(e) {
|
|
500
|
+
if (this.done) throw e;
|
|
501
|
+
var r = this;
|
|
502
|
+
function handle(n, o) {
|
|
503
|
+
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
504
504
|
}
|
|
505
|
-
for (var
|
|
506
|
-
var
|
|
507
|
-
|
|
508
|
-
if ("root" ===
|
|
509
|
-
if (
|
|
510
|
-
var
|
|
511
|
-
|
|
512
|
-
if (
|
|
513
|
-
if (this.prev <
|
|
514
|
-
if (this.prev <
|
|
515
|
-
} else if (
|
|
516
|
-
if (this.prev <
|
|
505
|
+
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
506
|
+
var i = this.tryEntries[o],
|
|
507
|
+
a = i.completion;
|
|
508
|
+
if ("root" === i.tryLoc) return handle("end");
|
|
509
|
+
if (i.tryLoc <= this.prev) {
|
|
510
|
+
var c = n.call(i, "catchLoc"),
|
|
511
|
+
u = n.call(i, "finallyLoc");
|
|
512
|
+
if (c && u) {
|
|
513
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
514
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
515
|
+
} else if (c) {
|
|
516
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
517
517
|
} else {
|
|
518
|
-
if (!
|
|
519
|
-
if (this.prev <
|
|
518
|
+
if (!u) throw new Error("try statement without catch or finally");
|
|
519
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
523
|
},
|
|
524
|
-
abrupt: function abrupt(
|
|
525
|
-
for (var
|
|
526
|
-
var
|
|
527
|
-
if (
|
|
528
|
-
var
|
|
524
|
+
abrupt: function abrupt(t, e) {
|
|
525
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
526
|
+
var o = this.tryEntries[r];
|
|
527
|
+
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
528
|
+
var i = o;
|
|
529
529
|
break;
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
|
-
|
|
533
|
-
var
|
|
534
|
-
return
|
|
532
|
+
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
533
|
+
var a = i ? i.completion : {};
|
|
534
|
+
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
535
535
|
},
|
|
536
|
-
complete: function complete(
|
|
537
|
-
if ("throw" ===
|
|
538
|
-
return "break" ===
|
|
536
|
+
complete: function complete(t, e) {
|
|
537
|
+
if ("throw" === t.type) throw t.arg;
|
|
538
|
+
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;
|
|
539
539
|
},
|
|
540
|
-
finish: function finish(
|
|
541
|
-
for (var
|
|
542
|
-
var
|
|
543
|
-
if (
|
|
540
|
+
finish: function finish(t) {
|
|
541
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
542
|
+
var r = this.tryEntries[e];
|
|
543
|
+
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
544
544
|
}
|
|
545
545
|
},
|
|
546
|
-
"catch": function _catch(
|
|
547
|
-
for (var
|
|
548
|
-
var
|
|
549
|
-
if (
|
|
550
|
-
var
|
|
551
|
-
if ("throw" ===
|
|
552
|
-
var
|
|
553
|
-
resetTryEntry(
|
|
546
|
+
"catch": function _catch(t) {
|
|
547
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
548
|
+
var r = this.tryEntries[e];
|
|
549
|
+
if (r.tryLoc === t) {
|
|
550
|
+
var n = r.completion;
|
|
551
|
+
if ("throw" === n.type) {
|
|
552
|
+
var o = n.arg;
|
|
553
|
+
resetTryEntry(r);
|
|
554
554
|
}
|
|
555
|
-
return
|
|
555
|
+
return o;
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
558
|
throw new Error("illegal catch attempt");
|
|
559
559
|
},
|
|
560
|
-
delegateYield: function delegateYield(
|
|
560
|
+
delegateYield: function delegateYield(e, r, n) {
|
|
561
561
|
return this.delegate = {
|
|
562
|
-
iterator: values(
|
|
563
|
-
resultName:
|
|
564
|
-
nextLoc:
|
|
565
|
-
}, "next" === this.method && (this.arg =
|
|
562
|
+
iterator: values(e),
|
|
563
|
+
resultName: r,
|
|
564
|
+
nextLoc: n
|
|
565
|
+
}, "next" === this.method && (this.arg = t), y;
|
|
566
566
|
}
|
|
567
|
-
},
|
|
567
|
+
}, e;
|
|
568
568
|
}
|
|
569
569
|
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
570
570
|
} (regeneratorRuntime$1));
|
|
@@ -595,9 +595,12 @@ var DELIVERY_TAB = {
|
|
|
595
595
|
};
|
|
596
596
|
|
|
597
597
|
var Snippet = function Snippet(_ref) {
|
|
598
|
-
var children = _ref.children
|
|
598
|
+
var children = _ref.children,
|
|
599
|
+
_ref$dataCy = _ref.dataCy,
|
|
600
|
+
dataCy = _ref$dataCy === void 0 ? "" : _ref$dataCy;
|
|
599
601
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
600
|
-
className: "neeto-ui-rounded neeto-ui-border-gray-300 neeto-ui-bg-gray-100 my-2 whitespace-pre-wrap break-all border p-4"
|
|
602
|
+
className: "neeto-ui-rounded neeto-ui-border-gray-300 neeto-ui-bg-gray-100 my-2 whitespace-pre-wrap break-all border p-4",
|
|
603
|
+
"data-cy": dataCy
|
|
601
604
|
}, children);
|
|
602
605
|
};
|
|
603
606
|
|
|
@@ -632,11 +635,13 @@ var TransactionDetails = function TransactionDetails(_ref) {
|
|
|
632
635
|
className: "flex items-center space-x-1"
|
|
633
636
|
}, t("neetoWebhooks.delivery.identifier"), ":", /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
634
637
|
className: "px-2 font-bold",
|
|
638
|
+
"data-cy": "delivery-identifier",
|
|
635
639
|
style: "body2"
|
|
636
640
|
}, identifier)), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
637
641
|
className: "flex items-center"
|
|
638
642
|
}, t("neetoWebhooks.common.responseStatus"), ":", /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
639
643
|
className: "px-2 font-bold",
|
|
644
|
+
"data-cy": "delivery-response-code",
|
|
640
645
|
style: "body2"
|
|
641
646
|
}, responseStatusCode), /*#__PURE__*/React__default["default"].createElement(neetoui.Tag, {
|
|
642
647
|
style: status === "success" ? "success" : "warning"
|
|
@@ -656,15 +661,23 @@ var TransactionDetails = function TransactionDetails(_ref) {
|
|
|
656
661
|
className: "space-y-4"
|
|
657
662
|
}, /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
658
663
|
style: "h5"
|
|
659
|
-
}, t("neetoWebhooks.delivery.header")), /*#__PURE__*/React__default["default"].createElement(Snippet,
|
|
664
|
+
}, t("neetoWebhooks.delivery.header")), /*#__PURE__*/React__default["default"].createElement(Snippet, {
|
|
665
|
+
dataCy: "delivery-request-header"
|
|
666
|
+
}, deliveryDetails.requestHeader)), /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
660
667
|
style: "h5"
|
|
661
|
-
}, t("neetoWebhooks.delivery.payload")), /*#__PURE__*/React__default["default"].createElement(Snippet,
|
|
668
|
+
}, t("neetoWebhooks.delivery.payload")), /*#__PURE__*/React__default["default"].createElement(Snippet, {
|
|
669
|
+
dataCy: "delivery-request-payload"
|
|
670
|
+
}, JSON.stringify(JSON.parse(deliveryDetails.requestBody), null, 2)))) : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
662
671
|
className: "space-y-4"
|
|
663
672
|
}, /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
664
673
|
style: "h5"
|
|
665
|
-
}, t("neetoWebhooks.delivery.header")), /*#__PURE__*/React__default["default"].createElement(Snippet,
|
|
674
|
+
}, t("neetoWebhooks.delivery.header")), /*#__PURE__*/React__default["default"].createElement(Snippet, {
|
|
675
|
+
dataCy: "delivery-response-header"
|
|
676
|
+
}, deliveryDetails.responseHeader)), /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
666
677
|
style: "h5"
|
|
667
|
-
}, t("neetoWebhooks.delivery.body")), /*#__PURE__*/React__default["default"].createElement(Snippet,
|
|
678
|
+
}, t("neetoWebhooks.delivery.body")), /*#__PURE__*/React__default["default"].createElement(Snippet, {
|
|
679
|
+
dataCy: "delivery-response-body"
|
|
680
|
+
}, deliveryDetails.responseBody)))));
|
|
668
681
|
};
|
|
669
682
|
|
|
670
683
|
var Details = function Details(_ref) {
|
|
@@ -739,16 +752,18 @@ var buildColumns$1 = function buildColumns(_ref) {
|
|
|
739
752
|
return [{
|
|
740
753
|
title: i18next.t("neetoWebhooks.delivery.identifier", constants.SINGULAR),
|
|
741
754
|
key: "identifier",
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
redelivery = _ref2.redelivery;
|
|
755
|
+
dataIndex: "identifier",
|
|
756
|
+
width: 390,
|
|
757
|
+
render: function render(_, delivery) {
|
|
746
758
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
747
759
|
className: "flex items-center gap-x-3"
|
|
748
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.
|
|
749
|
-
style: "
|
|
750
|
-
weight: "semibold"
|
|
751
|
-
|
|
760
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
761
|
+
style: "link",
|
|
762
|
+
weight: "semibold",
|
|
763
|
+
onClick: function onClick() {
|
|
764
|
+
return handleDetailsClick(delivery);
|
|
765
|
+
}
|
|
766
|
+
}, delivery.identifier), delivery.redelivery && /*#__PURE__*/React__default["default"].createElement(neetoui.Tag, {
|
|
752
767
|
style: "info"
|
|
753
768
|
}, i18next.t("neetoWebhooks.delivery.redelivery")));
|
|
754
769
|
}
|
|
@@ -756,6 +771,7 @@ var buildColumns$1 = function buildColumns(_ref) {
|
|
|
756
771
|
title: i18next.t("neetoWebhooks.tableHeaders.createdAt"),
|
|
757
772
|
key: "createdAt",
|
|
758
773
|
dataIndex: "createdAt",
|
|
774
|
+
width: 280,
|
|
759
775
|
render: function render(createdAt) {
|
|
760
776
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
761
777
|
className: "flex items-center justify-between space-x-1"
|
|
@@ -766,10 +782,10 @@ var buildColumns$1 = function buildColumns(_ref) {
|
|
|
766
782
|
}, {
|
|
767
783
|
title: i18next.t("neetoWebhooks.common.responseStatus"),
|
|
768
784
|
key: "responseStatusCode",
|
|
769
|
-
width:
|
|
770
|
-
render: function render(
|
|
771
|
-
var responseStatusCode =
|
|
772
|
-
status =
|
|
785
|
+
width: 160,
|
|
786
|
+
render: function render(_ref2) {
|
|
787
|
+
var responseStatusCode = _ref2.responseStatusCode,
|
|
788
|
+
status = _ref2.status;
|
|
773
789
|
return /*#__PURE__*/React__default["default"].createElement("span", {
|
|
774
790
|
className: "flex items-center"
|
|
775
791
|
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
@@ -783,20 +799,8 @@ var buildColumns$1 = function buildColumns(_ref) {
|
|
|
783
799
|
title: i18next.t("neetoWebhooks.common.event", constants.SINGULAR),
|
|
784
800
|
key: "event",
|
|
785
801
|
dataIndex: "event",
|
|
802
|
+
width: 270,
|
|
786
803
|
render: ramda.prop("label")
|
|
787
|
-
}, {
|
|
788
|
-
title: i18next.t("neetoWebhooks.tableHeaders.details"),
|
|
789
|
-
key: "details",
|
|
790
|
-
dataIndex: "details",
|
|
791
|
-
render: function render(_, delivery) {
|
|
792
|
-
return /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
793
|
-
label: i18next.t("neetoWebhooks.buttons.viewDetails"),
|
|
794
|
-
size: "small",
|
|
795
|
-
onClick: function onClick() {
|
|
796
|
-
return handleDetailsClick(delivery);
|
|
797
|
-
}
|
|
798
|
-
});
|
|
799
|
-
}
|
|
800
804
|
}];
|
|
801
805
|
};
|
|
802
806
|
|
|
@@ -916,7 +920,7 @@ var useCreateWebhook = function useCreateWebhook(options) {
|
|
|
916
920
|
onSuccess: function onSuccess() {
|
|
917
921
|
var _options$onSuccess;
|
|
918
922
|
queryClient.invalidateQueries(QUERY_KEYS.WEBHOOK_LIST);
|
|
919
|
-
options === null || options === void 0 || (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0
|
|
923
|
+
options === null || options === void 0 || (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 || _options$onSuccess.call(options);
|
|
920
924
|
}
|
|
921
925
|
});
|
|
922
926
|
};
|
|
@@ -940,7 +944,7 @@ var useUpdateWebhook = function useUpdateWebhook(id, options) {
|
|
|
940
944
|
queryClient.invalidateQueries(QUERY_KEYS.WEBHOOK_LIST);
|
|
941
945
|
queryClient.invalidateQueries([QUERY_KEYS.WEBHOOK_DETAILS, id]);
|
|
942
946
|
queryClient.invalidateQueries([QUERY_KEYS.DELIVERY_LIST, id]);
|
|
943
|
-
options === null || options === void 0 || (_options$onSuccess2 = options.onSuccess) === null || _options$onSuccess2 === void 0
|
|
947
|
+
options === null || options === void 0 || (_options$onSuccess2 = options.onSuccess) === null || _options$onSuccess2 === void 0 || _options$onSuccess2.call(options);
|
|
944
948
|
}
|
|
945
949
|
});
|
|
946
950
|
};
|
|
@@ -950,19 +954,19 @@ var useDestroyWebhook = function useDestroyWebhook(options) {
|
|
|
950
954
|
onSuccess: function onSuccess() {
|
|
951
955
|
var _options$onSuccess3;
|
|
952
956
|
queryClient.invalidateQueries(QUERY_KEYS.WEBHOOK_LIST);
|
|
953
|
-
options === null || options === void 0 || (_options$onSuccess3 = options.onSuccess) === null || _options$onSuccess3 === void 0
|
|
957
|
+
options === null || options === void 0 || (_options$onSuccess3 = options.onSuccess) === null || _options$onSuccess3 === void 0 || _options$onSuccess3.call(options);
|
|
954
958
|
}
|
|
955
959
|
});
|
|
956
960
|
};
|
|
957
961
|
|
|
958
|
-
function _typeof(
|
|
962
|
+
function _typeof(o) {
|
|
959
963
|
"@babel/helpers - typeof";
|
|
960
964
|
|
|
961
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (
|
|
962
|
-
return typeof
|
|
963
|
-
} : function (
|
|
964
|
-
return
|
|
965
|
-
}, _typeof(
|
|
965
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
966
|
+
return typeof o;
|
|
967
|
+
} : function (o) {
|
|
968
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
969
|
+
}, _typeof(o);
|
|
966
970
|
}
|
|
967
971
|
|
|
968
972
|
function _toPrimitive(input, hint) {
|
|
@@ -1010,15 +1014,81 @@ var useFetchEvents = function useFetchEvents() {
|
|
|
1010
1014
|
});
|
|
1011
1015
|
};
|
|
1012
1016
|
|
|
1013
|
-
var WEBHOOK_HELP_URL = "https://
|
|
1017
|
+
var WEBHOOK_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-4bb6c2a2";
|
|
1018
|
+
var WEBHOOK_SECRETS_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-80de90bd";
|
|
1019
|
+
|
|
1020
|
+
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
1021
|
+
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
1022
|
+
// generators (like Math.random()).
|
|
1023
|
+
let getRandomValues;
|
|
1024
|
+
const rnds8 = new Uint8Array(16);
|
|
1025
|
+
function rng() {
|
|
1026
|
+
// lazy load so that environments that need to polyfill have a chance to do so
|
|
1027
|
+
if (!getRandomValues) {
|
|
1028
|
+
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
|
1029
|
+
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
1030
|
+
|
|
1031
|
+
if (!getRandomValues) {
|
|
1032
|
+
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
return getRandomValues(rnds8);
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
/**
|
|
1040
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
|
1041
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
1042
|
+
*/
|
|
1043
|
+
|
|
1044
|
+
const byteToHex = [];
|
|
1045
|
+
|
|
1046
|
+
for (let i = 0; i < 256; ++i) {
|
|
1047
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
function unsafeStringify(arr, offset = 0) {
|
|
1051
|
+
// Note: Be careful editing this code! It's been tuned for performance
|
|
1052
|
+
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
1053
|
+
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]];
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
1057
|
+
var native = {
|
|
1058
|
+
randomUUID
|
|
1059
|
+
};
|
|
1060
|
+
|
|
1061
|
+
function v4(options, buf, offset) {
|
|
1062
|
+
if (native.randomUUID && !buf && !options) {
|
|
1063
|
+
return native.randomUUID();
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
options = options || {};
|
|
1067
|
+
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
1068
|
+
|
|
1069
|
+
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
1070
|
+
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
1071
|
+
|
|
1072
|
+
if (buf) {
|
|
1073
|
+
offset = offset || 0;
|
|
1074
|
+
|
|
1075
|
+
for (let i = 0; i < 16; ++i) {
|
|
1076
|
+
buf[offset + i] = rnds[i];
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
return buf;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
return unsafeStringify(rnds);
|
|
1083
|
+
}
|
|
1014
1084
|
|
|
1015
1085
|
var MENU_ITEMS = {
|
|
1016
1086
|
EDIT: "edit",
|
|
1017
1087
|
DELETE: "delete"
|
|
1018
1088
|
};
|
|
1019
1089
|
|
|
1020
|
-
function ownKeys$1(
|
|
1021
|
-
function _objectSpread$1(
|
|
1090
|
+
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; }
|
|
1091
|
+
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; }
|
|
1022
1092
|
var getMenuItems = function getMenuItems(_ref) {
|
|
1023
1093
|
var onEdit = _ref.onEdit,
|
|
1024
1094
|
onDelete = _ref.onDelete;
|
|
@@ -1079,6 +1149,7 @@ var buildColumns = function buildColumns(_ref6) {
|
|
|
1079
1149
|
title: i18next.t("neetoWebhooks.common.endpoint"),
|
|
1080
1150
|
key: "endpoint",
|
|
1081
1151
|
dataIndex: "endpoint",
|
|
1152
|
+
width: 830,
|
|
1082
1153
|
render: function render(endpoint, webhook) {
|
|
1083
1154
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1084
1155
|
className: "flex items-center justify-between space-x-3"
|
|
@@ -1119,21 +1190,30 @@ var buildColumns = function buildColumns(_ref6) {
|
|
|
1119
1190
|
width: 400
|
|
1120
1191
|
}];
|
|
1121
1192
|
};
|
|
1193
|
+
var generateRandomSecret = function generateRandomSecret() {
|
|
1194
|
+
return v4().replace(/-/g, "");
|
|
1195
|
+
};
|
|
1122
1196
|
|
|
1123
|
-
function ownKeys(
|
|
1124
|
-
function _objectSpread(
|
|
1197
|
+
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; }
|
|
1198
|
+
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; }
|
|
1125
1199
|
var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
1126
1200
|
var editingWebhookId = _ref.editingWebhookId,
|
|
1127
1201
|
entityId = _ref.entityId,
|
|
1128
1202
|
entityType = _ref.entityType,
|
|
1129
1203
|
isOpen = _ref.isOpen,
|
|
1130
1204
|
onClose = _ref.onClose,
|
|
1205
|
+
onCreate = _ref.onCreate,
|
|
1131
1206
|
webhooks = _ref.webhooks;
|
|
1132
1207
|
var _useTranslation = reactI18next.useTranslation(),
|
|
1133
1208
|
t = _useTranslation.t;
|
|
1209
|
+
var _useState = React.useState(false),
|
|
1210
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1211
|
+
isSecretInputFieldVisible = _useState2[0],
|
|
1212
|
+
setIsSecretInputFieldVisible = _useState2[1];
|
|
1134
1213
|
var _useCreateWebhook = useCreateWebhook({
|
|
1135
1214
|
onSuccess: function onSuccess() {
|
|
1136
|
-
|
|
1215
|
+
onClose();
|
|
1216
|
+
onCreate === null || onCreate === void 0 || onCreate();
|
|
1137
1217
|
}
|
|
1138
1218
|
}),
|
|
1139
1219
|
createWebhook = _useCreateWebhook.mutate;
|
|
@@ -1143,9 +1223,7 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
1143
1223
|
_useShowWebhook$data3 = _useShowWebhook$data2.webhook,
|
|
1144
1224
|
webhook = _useShowWebhook$data3 === void 0 ? {} : _useShowWebhook$data3;
|
|
1145
1225
|
var _useUpdateWebhook = useUpdateWebhook(editingWebhookId, {
|
|
1146
|
-
onSuccess:
|
|
1147
|
-
return onClose();
|
|
1148
|
-
}
|
|
1226
|
+
onSuccess: onClose
|
|
1149
1227
|
}),
|
|
1150
1228
|
updateWebhook = _useUpdateWebhook.mutate;
|
|
1151
1229
|
var endpointRef = React.useRef();
|
|
@@ -1172,10 +1250,28 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
1172
1250
|
entityType: entityType
|
|
1173
1251
|
}));
|
|
1174
1252
|
};
|
|
1253
|
+
var handleClick = function handleClick(setFieldValue) {
|
|
1254
|
+
var randomWebhookSecret = generateRandomSecret();
|
|
1255
|
+
setFieldValue("secret", randomWebhookSecret);
|
|
1256
|
+
setIsSecretInputFieldVisible(true);
|
|
1257
|
+
};
|
|
1258
|
+
var handleRegenerate = function handleRegenerate(setFieldValue) {
|
|
1259
|
+
var randomWebhookSecret = generateRandomSecret();
|
|
1260
|
+
setFieldValue("secret", randomWebhookSecret);
|
|
1261
|
+
};
|
|
1262
|
+
var handleDelete = function handleDelete(setFieldValue) {
|
|
1263
|
+
setFieldValue("secret", null);
|
|
1264
|
+
setIsSecretInputFieldVisible(false);
|
|
1265
|
+
};
|
|
1266
|
+
React.useEffect(function () {
|
|
1267
|
+
if (webhook !== null && webhook !== void 0 && webhook.secret) {
|
|
1268
|
+
setIsSecretInputFieldVisible(true);
|
|
1269
|
+
}
|
|
1270
|
+
}, [webhook]);
|
|
1175
1271
|
return /*#__PURE__*/React__default["default"].createElement(neetoui.Pane, {
|
|
1176
|
-
initialFocusRef: endpointRef,
|
|
1177
1272
|
isOpen: isOpen,
|
|
1178
|
-
onClose: onClose
|
|
1273
|
+
onClose: onClose,
|
|
1274
|
+
initialFocusRef: endpointRef
|
|
1179
1275
|
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Header, {
|
|
1180
1276
|
className: "flex items-center space-x-3"
|
|
1181
1277
|
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
@@ -1201,7 +1297,8 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
1201
1297
|
}, function (_ref2) {
|
|
1202
1298
|
var dirty = _ref2.dirty,
|
|
1203
1299
|
isSubmitting = _ref2.isSubmitting,
|
|
1204
|
-
isValid = _ref2.isValid
|
|
1300
|
+
isValid = _ref2.isValid,
|
|
1301
|
+
setFieldValue = _ref2.setFieldValue;
|
|
1205
1302
|
return isLoading ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1206
1303
|
className: "flex items-center justify-center"
|
|
1207
1304
|
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Spinner, null)) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Body, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -1223,15 +1320,16 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
1223
1320
|
name: "events",
|
|
1224
1321
|
options: events,
|
|
1225
1322
|
placeholder: t("neetoWebhooks.webhook.eventPlaceholder")
|
|
1226
|
-
}), /*#__PURE__*/React__default["default"].createElement(
|
|
1323
|
+
}), isSecretInputFieldVisible && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1324
|
+
className: "flex items-center justify-between space-x-3"
|
|
1325
|
+
}, /*#__PURE__*/React__default["default"].createElement(formik.Input, {
|
|
1227
1326
|
"data-cy": "secret-key-input-field",
|
|
1228
1327
|
name: "secret",
|
|
1229
|
-
placeholder: t("neetoWebhooks.webhook.secretPlaceholder"),
|
|
1230
1328
|
label: /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
1231
1329
|
i18nKey: "neetoWebhooks.webhook.secret",
|
|
1232
1330
|
components: {
|
|
1233
1331
|
helpLink: /*#__PURE__*/React__default["default"].createElement("a", {
|
|
1234
|
-
href:
|
|
1332
|
+
href: WEBHOOK_SECRETS_HELP_URL,
|
|
1235
1333
|
rel: "noreferrer",
|
|
1236
1334
|
target: "_blank"
|
|
1237
1335
|
}),
|
|
@@ -1240,10 +1338,36 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
1240
1338
|
size: 20
|
|
1241
1339
|
})
|
|
1242
1340
|
}
|
|
1243
|
-
})
|
|
1244
|
-
|
|
1341
|
+
}),
|
|
1342
|
+
placeholder: t("neetoWebhooks.webhook.secretPlaceholder")
|
|
1343
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1344
|
+
className: "mt-6"
|
|
1345
|
+
}, /*#__PURE__*/React__default["default"].createElement(MoreDropdown__default["default"], {
|
|
1346
|
+
menuItems: [{
|
|
1347
|
+
key: "regenerate-secret",
|
|
1348
|
+
label: t("neetoWebhooks.buttons.regenerate"),
|
|
1349
|
+
"data-cy": "regenerate-secret",
|
|
1350
|
+
onClick: function onClick() {
|
|
1351
|
+
return handleRegenerate(setFieldValue);
|
|
1352
|
+
}
|
|
1353
|
+
}, {
|
|
1354
|
+
key: "delete-secret",
|
|
1355
|
+
label: t("neetoWebhooks.buttons.delete"),
|
|
1356
|
+
"data-cy": "delete-secret",
|
|
1357
|
+
onClick: function onClick() {
|
|
1358
|
+
return handleDelete(setFieldValue);
|
|
1359
|
+
}
|
|
1360
|
+
}]
|
|
1361
|
+
}))), /*#__PURE__*/React__default["default"].createElement(formik.Switch, {
|
|
1245
1362
|
label: t("neetoWebhooks.webhook.active"),
|
|
1246
1363
|
name: "isActive"
|
|
1364
|
+
}), !isSecretInputFieldVisible && /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
1365
|
+
icon: neetoIcons.Plus,
|
|
1366
|
+
label: t("neetoWebhooks.buttons.addSecretKey"),
|
|
1367
|
+
style: "text",
|
|
1368
|
+
onClick: function onClick() {
|
|
1369
|
+
return handleClick(setFieldValue);
|
|
1370
|
+
}
|
|
1247
1371
|
}))), /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Footer, {
|
|
1248
1372
|
className: "flex gap-2"
|
|
1249
1373
|
}, /*#__PURE__*/React__default["default"].createElement(formik.ActionBlock, {
|
|
@@ -1290,7 +1414,9 @@ var Webhooks = function Webhooks(_ref) {
|
|
|
1290
1414
|
var deliveriesPath = _ref.deliveriesPath,
|
|
1291
1415
|
entityType = _ref.entityType,
|
|
1292
1416
|
breadcrumbs = _ref.breadcrumbs,
|
|
1293
|
-
entityId = _ref.entityId
|
|
1417
|
+
entityId = _ref.entityId,
|
|
1418
|
+
onCreate = _ref.onCreate,
|
|
1419
|
+
onDelete = _ref.onDelete;
|
|
1294
1420
|
var _useState = React.useState(),
|
|
1295
1421
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1296
1422
|
editingWebhookId = _useState2[0],
|
|
@@ -1328,7 +1454,8 @@ var Webhooks = function Webhooks(_ref) {
|
|
|
1328
1454
|
totalCount = _useFetchWebhooks$dat4 === void 0 ? 0 : _useFetchWebhooks$dat4;
|
|
1329
1455
|
var _useDestroyWebhook = useDestroyWebhook({
|
|
1330
1456
|
onSuccess: function onSuccess() {
|
|
1331
|
-
|
|
1457
|
+
setIsDeleteAlertOpen(false);
|
|
1458
|
+
onDelete === null || onDelete === void 0 || onDelete();
|
|
1332
1459
|
}
|
|
1333
1460
|
}),
|
|
1334
1461
|
isDeleting = _useDestroyWebhook.isLoading,
|
|
@@ -1378,6 +1505,7 @@ var Webhooks = function Webhooks(_ref) {
|
|
|
1378
1505
|
editingWebhookId: editingWebhookId,
|
|
1379
1506
|
entityId: entityId,
|
|
1380
1507
|
entityType: entityType,
|
|
1508
|
+
onCreate: onCreate,
|
|
1381
1509
|
webhooks: webhooks,
|
|
1382
1510
|
isOpen: isAddWebhookPaneOpen,
|
|
1383
1511
|
onClose: handlePaneClose
|
|
@@ -1405,7 +1533,9 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
|
|
|
1405
1533
|
var entityType = _ref.entityType,
|
|
1406
1534
|
entityId = _ref.entityId,
|
|
1407
1535
|
_ref$breadcrumbs = _ref.breadcrumbs,
|
|
1408
|
-
breadcrumbs = _ref$breadcrumbs === void 0 ? [] : _ref$breadcrumbs
|
|
1536
|
+
breadcrumbs = _ref$breadcrumbs === void 0 ? [] : _ref$breadcrumbs,
|
|
1537
|
+
onCreate = _ref.onCreate,
|
|
1538
|
+
onDelete = _ref.onDelete;
|
|
1409
1539
|
var _useRouteMatch = reactRouterDom.useRouteMatch(),
|
|
1410
1540
|
webhooksPath = _useRouteMatch.path,
|
|
1411
1541
|
webhooksUrl = _useRouteMatch.url;
|
|
@@ -1418,19 +1548,26 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
|
|
|
1418
1548
|
breadcrumbs: breadcrumbs,
|
|
1419
1549
|
deliveriesPath: deliveriesPath,
|
|
1420
1550
|
entityId: entityId,
|
|
1421
|
-
entityType: entityType
|
|
1551
|
+
entityType: entityType,
|
|
1552
|
+
onCreate: onCreate,
|
|
1553
|
+
onDelete: onDelete
|
|
1422
1554
|
});
|
|
1423
1555
|
}
|
|
1424
1556
|
}), /*#__PURE__*/React__default["default"].createElement(reactRouterDom.Route, {
|
|
1425
|
-
path: deliveriesPath,
|
|
1426
1557
|
component: function component() {
|
|
1427
1558
|
return /*#__PURE__*/React__default["default"].createElement(Deliveries$1, {
|
|
1428
1559
|
breadcrumbs: breadcrumbs,
|
|
1429
1560
|
webhooksUrl: webhooksUrl
|
|
1430
1561
|
});
|
|
1431
|
-
}
|
|
1562
|
+
},
|
|
1563
|
+
path: deliveriesPath
|
|
1432
1564
|
}));
|
|
1433
1565
|
};
|
|
1434
1566
|
|
|
1567
|
+
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}}
|
|
1568
|
+
|
|
1569
|
+
var css = ".neeto-molecules-header .neeto-molecules-header__breadcrumbs-wrap{flex-wrap:wrap}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3NyYy9zdHlsZXNoZWV0cy9tYWluLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0Usa0VBQ0UsY0FBSiIsInNvdXJjZXNDb250ZW50IjpbIi5uZWV0by1tb2xlY3VsZXMtaGVhZGVyIHtcbiAgLm5lZXRvLW1vbGVjdWxlcy1oZWFkZXJfX2JyZWFkY3J1bWJzLXdyYXAge1xuICAgIGZsZXgtd3JhcDogd3JhcDtcbiAgfVxufVxuIl19 */";
|
|
1570
|
+
n(css,{});
|
|
1571
|
+
|
|
1435
1572
|
exports.NeetoWebhooks = NeetoWebhooks;
|
|
1436
1573
|
//# sourceMappingURL=index.cjs.js.map
|