@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/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(arr, i) {
63
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
64
- if (null != _i) {
65
- var _s,
66
- _e,
67
- _x,
68
- _r,
69
- _arr = [],
70
- _n = !0,
71
- _d = !1;
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 (_x = (_i = _i.call(arr)).next, 0 === i) {
74
- if (Object(_i) !== _i) return;
75
- _n = !1;
76
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
77
- } catch (err) {
78
- _d = !0, _e = err;
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 (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
81
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
82
82
  } finally {
83
- if (_d) throw _e;
83
+ if (o) throw n;
84
84
  }
85
85
  }
86
- return _arr;
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(obj) {
216
+ function _typeof(o) {
217
217
  "@babel/helpers - typeof";
218
218
 
219
- return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
220
- return typeof obj;
221
- } : function (obj) {
222
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
223
- }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
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 exports;
236
+ return e;
237
237
  }, module.exports.__esModule = true, module.exports["default"] = module.exports;
238
- var exports = {},
239
- Op = Object.prototype,
240
- hasOwn = Op.hasOwnProperty,
241
- defineProperty = Object.defineProperty || function (obj, key, desc) {
242
- obj[key] = desc.value;
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
- $Symbol = "function" == typeof Symbol ? Symbol : {},
245
- iteratorSymbol = $Symbol.iterator || "@@iterator",
246
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
247
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
248
- function define(obj, key, value) {
249
- return Object.defineProperty(obj, key, {
250
- value: 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
- }), obj[key];
255
+ }), t[e];
255
256
  }
256
257
  try {
257
258
  define({}, "");
258
- } catch (err) {
259
- define = function define(obj, key, value) {
260
- return obj[key] = value;
259
+ } catch (t) {
260
+ define = function define(t, e, r) {
261
+ return t[e] = r;
261
262
  };
262
263
  }
263
- function wrap(innerFn, outerFn, self, tryLocsList) {
264
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
265
- generator = Object.create(protoGenerator.prototype),
266
- context = new Context(tryLocsList || []);
267
- return defineProperty(generator, "_invoke", {
268
- value: makeInvokeMethod(innerFn, self, context)
269
- }), generator;
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(fn, obj, arg) {
272
+ function tryCatch(t, e, r) {
272
273
  try {
273
274
  return {
274
275
  type: "normal",
275
- arg: fn.call(obj, arg)
276
+ arg: t.call(e, r)
276
277
  };
277
- } catch (err) {
278
+ } catch (t) {
278
279
  return {
279
280
  type: "throw",
280
- arg: err
281
+ arg: t
281
282
  };
282
283
  }
283
284
  }
284
- exports.wrap = wrap;
285
- var ContinueSentinel = {};
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 IteratorPrototype = {};
290
- define(IteratorPrototype, iteratorSymbol, function () {
294
+ var p = {};
295
+ define(p, a, function () {
291
296
  return this;
292
297
  });
293
- var getProto = Object.getPrototypeOf,
294
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
295
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
296
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
297
- function defineIteratorMethods(prototype) {
298
- ["next", "throw", "return"].forEach(function (method) {
299
- define(prototype, method, function (arg) {
300
- return this._invoke(method, arg);
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(generator, PromiseImpl) {
305
- function invoke(method, arg, resolve, reject) {
306
- var record = tryCatch(generator[method], generator, arg);
307
- if ("throw" !== record.type) {
308
- var result = record.arg,
309
- value = result.value;
310
- return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
311
- invoke("next", value, resolve, reject);
312
- }, function (err) {
313
- invoke("throw", err, resolve, reject);
314
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
315
- result.value = unwrapped, resolve(result);
316
- }, function (error) {
317
- return invoke("throw", error, resolve, reject);
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
- reject(record.arg);
325
+ a(c.arg);
321
326
  }
322
- var previousPromise;
323
- defineProperty(this, "_invoke", {
324
- value: function value(method, arg) {
327
+ var r;
328
+ o(this, "_invoke", {
329
+ value: function value(t, n) {
325
330
  function callInvokeWithMethodAndArg() {
326
- return new PromiseImpl(function (resolve, reject) {
327
- invoke(method, arg, resolve, reject);
331
+ return new e(function (e, r) {
332
+ invoke(t, n, e, r);
328
333
  });
329
334
  }
330
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
335
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
331
336
  }
332
337
  });
333
338
  }
334
- function makeInvokeMethod(innerFn, self, context) {
335
- var state = "suspendedStart";
336
- return function (method, arg) {
337
- if ("executing" === state) throw new Error("Generator is already running");
338
- if ("completed" === state) {
339
- if ("throw" === method) throw arg;
340
- return doneResult();
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 (context.method = method, context.arg = arg;;) {
343
- var delegate = context.delegate;
344
- if (delegate) {
345
- var delegateResult = maybeInvokeDelegate(delegate, context);
346
- if (delegateResult) {
347
- if (delegateResult === ContinueSentinel) continue;
348
- return delegateResult;
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" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
352
- if ("suspendedStart" === state) throw state = "completed", context.arg;
353
- context.dispatchException(context.arg);
354
- } else "return" === context.method && context.abrupt("return", context.arg);
355
- state = "executing";
356
- var record = tryCatch(innerFn, self, context);
357
- if ("normal" === record.type) {
358
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
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: record.arg,
361
- done: context.done
368
+ value: p.arg,
369
+ done: n.done
362
370
  };
363
371
  }
364
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
372
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
365
373
  }
366
374
  };
367
375
  }
368
- function maybeInvokeDelegate(delegate, context) {
369
- var methodName = context.method,
370
- method = delegate.iterator[methodName];
371
- if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
372
- var record = tryCatch(method, delegate.iterator, context.arg);
373
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
374
- var info = record.arg;
375
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
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(locs) {
378
- var entry = {
379
- tryLoc: locs[0]
385
+ function pushTryEntry(t) {
386
+ var e = {
387
+ tryLoc: t[0]
380
388
  };
381
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
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(entry) {
384
- var record = entry.completion || {};
385
- record.type = "normal", delete record.arg, entry.completion = record;
391
+ function resetTryEntry(t) {
392
+ var e = t.completion || {};
393
+ e.type = "normal", delete e.arg, t.completion = e;
386
394
  }
387
- function Context(tryLocsList) {
395
+ function Context(t) {
388
396
  this.tryEntries = [{
389
397
  tryLoc: "root"
390
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
398
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
391
399
  }
392
- function values(iterable) {
393
- if (iterable) {
394
- var iteratorMethod = iterable[iteratorSymbol];
395
- if (iteratorMethod) return iteratorMethod.call(iterable);
396
- if ("function" == typeof iterable.next) return iterable;
397
- if (!isNaN(iterable.length)) {
398
- var i = -1,
399
- next = function next() {
400
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
401
- return next.value = undefined, next.done = !0, next;
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 next.next = next;
411
+ return i.next = i;
404
412
  }
405
413
  }
406
- return {
407
- next: doneResult
408
- };
414
+ throw new TypeError(_typeof(e) + " is not iterable");
409
415
  }
410
- function doneResult() {
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
- }), defineProperty(GeneratorFunctionPrototype, "constructor", {
419
+ }), o(GeneratorFunctionPrototype, "constructor", {
420
420
  value: GeneratorFunction,
421
421
  configurable: !0
422
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
423
- var ctor = "function" == typeof genFun && genFun.constructor;
424
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
425
- }, exports.mark = function (genFun) {
426
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
427
- }, exports.awrap = function (arg) {
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: arg
429
+ __await: t
430
430
  };
431
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
431
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
432
432
  return this;
433
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
434
- void 0 === PromiseImpl && (PromiseImpl = Promise);
435
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
436
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
437
- return result.done ? result.value : iter.next();
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(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
439
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
440
440
  return this;
441
- }), define(Gp, "toString", function () {
441
+ }), define(g, "toString", function () {
442
442
  return "[object Generator]";
443
- }), exports.keys = function (val) {
444
- var object = Object(val),
445
- keys = [];
446
- for (var key in object) keys.push(key);
447
- return keys.reverse(), function next() {
448
- for (; keys.length;) {
449
- var key = keys.pop();
450
- if (key in object) return next.value = key, next.done = !1, next;
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
- }, exports.values = values, Context.prototype = {
454
+ }, e.values = values, Context.prototype = {
455
455
  constructor: Context,
456
- reset: function reset(skipTempReset) {
457
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
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 rootRecord = this.tryEntries[0].completion;
462
- if ("throw" === rootRecord.type) throw rootRecord.arg;
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(exception) {
466
- if (this.done) throw exception;
467
- var context = this;
468
- function handle(loc, caught) {
469
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
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 i = this.tryEntries.length - 1; i >= 0; --i) {
472
- var entry = this.tryEntries[i],
473
- record = entry.completion;
474
- if ("root" === entry.tryLoc) return handle("end");
475
- if (entry.tryLoc <= this.prev) {
476
- var hasCatch = hasOwn.call(entry, "catchLoc"),
477
- hasFinally = hasOwn.call(entry, "finallyLoc");
478
- if (hasCatch && hasFinally) {
479
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
480
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
481
- } else if (hasCatch) {
482
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
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 (!hasFinally) throw new Error("try statement without catch or finally");
485
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
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(type, arg) {
491
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
492
- var entry = this.tryEntries[i];
493
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
494
- var finallyEntry = entry;
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
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
499
- var record = finallyEntry ? finallyEntry.completion : {};
500
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
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(record, afterLoc) {
503
- if ("throw" === record.type) throw record.arg;
504
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
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(finallyLoc) {
507
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
508
- var entry = this.tryEntries[i];
509
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
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(tryLoc) {
513
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
514
- var entry = this.tryEntries[i];
515
- if (entry.tryLoc === tryLoc) {
516
- var record = entry.completion;
517
- if ("throw" === record.type) {
518
- var thrown = record.arg;
519
- resetTryEntry(entry);
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 thrown;
521
+ return o;
522
522
  }
523
523
  }
524
524
  throw new Error("illegal catch attempt");
525
525
  },
526
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
526
+ delegateYield: function delegateYield(e, r, n) {
527
527
  return this.delegate = {
528
- iterator: values(iterable),
529
- resultName: resultName,
530
- nextLoc: nextLoc
531
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
528
+ iterator: values(e),
529
+ resultName: r,
530
+ nextLoc: n
531
+ }, "next" === this.method && (this.arg = t), y;
532
532
  }
533
- }, exports;
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, null, deliveryDetails.requestHeader)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Typography, {
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, null, JSON.stringify(JSON.parse(deliveryDetails.requestBody), null, 2)))) : /*#__PURE__*/React.createElement("div", {
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, null, deliveryDetails.responseHeader)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Typography, {
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, null, deliveryDetails.responseBody)))));
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
- width: "35%",
709
- render: function render(_ref2) {
710
- var identifier = _ref2.identifier,
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(Typography, {
715
- style: "body2",
716
- weight: "semibold"
717
- }, identifier), redelivery && /*#__PURE__*/React.createElement(Tag, {
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: "15%",
736
- render: function render(_ref3) {
737
- var responseStatusCode = _ref3.responseStatusCode,
738
- status = _ref3.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 ? void 0 : _options$onSuccess.call(options);
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 ? void 0 : _options$onSuccess2.call(options);
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 ? void 0 : _options$onSuccess3.call(options);
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(obj) {
928
+ function _typeof(o) {
925
929
  "@babel/helpers - typeof";
926
930
 
927
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
928
- return typeof obj;
929
- } : function (obj) {
930
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
931
- }, _typeof(obj);
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://help.neetocal.com/articles/webhook";
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(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
987
- function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1090
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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
- return onClose();
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: function 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(Input, {
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: WEBHOOK_HELP_URL,
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
- }), /*#__PURE__*/React.createElement(Switch, {
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
- return setIsDeleteAlertOpen(false);
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