@abyss-project/commons-front-core 17.1.0 → 17.2.0

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/catalog/captures-plan.ts +116 -103
  3. package/catalog/catalog-entries.ts +148 -140
  4. package/catalog/pages/DeliveryHistory.tsx +66 -0
  5. package/catalog/pages/DeliverySubscriptions.tsx +110 -0
  6. package/catalog/pages/ScheduledTasks.tsx +117 -0
  7. package/catalog/pages/index.ts +165 -159
  8. package/catalog/specs/captures.spec.ts +145 -91
  9. package/catalog/specs/write-capture-index.ts +81 -76
  10. package/dist/{CookieConsentSettings-CTAyLGkm.js → CookieConsentSettings-DHpcYTa2.js} +1 -1
  11. package/dist/{Surface-76bwVL_Z.js → Surface-BUxzLLhb.js} +500 -90
  12. package/dist/{Tabs-D2bdAWGo.js → Tabs-D7TDtprO.js} +99 -99
  13. package/dist/components/business/Deliveries/DeliveryHistory.component.d.ts +8 -0
  14. package/dist/components/business/Deliveries/DeliveryHistory.component.spec.d.ts +1 -0
  15. package/dist/components/business/Deliveries/DeliverySubscriptionForm.d.ts +23 -0
  16. package/dist/components/business/Deliveries/DeliverySubscriptions.component.d.ts +9 -0
  17. package/dist/components/business/Deliveries/DeliverySubscriptions.component.spec.d.ts +1 -0
  18. package/dist/components/business/Deliveries/ScheduledTaskForm.d.ts +21 -0
  19. package/dist/components/business/Deliveries/ScheduledTasks.component.d.ts +9 -0
  20. package/dist/components/business/Deliveries/ScheduledTasks.component.spec.d.ts +1 -0
  21. package/dist/components/business/Deliveries/deliveries.logic.d.ts +35 -0
  22. package/dist/components/business/Deliveries/deliveries.logic.spec.d.ts +1 -0
  23. package/dist/components/business/Deliveries/deliveries.types.d.ts +65 -0
  24. package/dist/components/business/Deliveries/test-support/deliveries.fixtures.d.ts +19 -0
  25. package/dist/components/business/Deliveries/test-support/row-menu.d.ts +4 -0
  26. package/dist/components/business/Deliveries/use-paged-list.hook.d.ts +25 -0
  27. package/dist/components/business/index.d.ts +4 -0
  28. package/dist/cookie-consent.js +2 -2
  29. package/dist/{design-theme-GNwBGEo_.js → design-theme-Bc2sMuUP.js} +1 -1
  30. package/dist/{editors-npV-IKED.js → editors-CGj-vsZu.js} +27 -27
  31. package/dist/editors.js +1 -1
  32. package/dist/hooks/use-rich-intl.hook.d.ts +432 -18
  33. package/dist/{index-BUwk65yN.js → index-5lpeThh7.js} +2 -2
  34. package/dist/{index-CqQ3PZ3K.js → index-853Jaoqw.js} +3 -3
  35. package/dist/{index-BGhYJfRf.js → index-B4PJ4K6l.js} +2 -2
  36. package/dist/{index-B7TpUAN3.js → index-BISOeVc7.js} +2 -2
  37. package/dist/{index-DnFO_WNV.js → index-BS3QPrVM.js} +4 -4
  38. package/dist/{index-C1_3Bq6c.js → index-BVsU-XEb.js} +2 -2
  39. package/dist/{index-C52yVIrz.js → index-Bxpp4VC9.js} +2 -2
  40. package/dist/{index-Dd5hKcko.js → index-CNfYiPB9.js} +2 -2
  41. package/dist/{index-B0uq2NNW.js → index-CONaN903.js} +2 -2
  42. package/dist/{index-C7tcg6JR.js → index-CTsQY6zW.js} +3 -3
  43. package/dist/{index-CboA-nSE.js → index-CYmjv9TK.js} +4 -4
  44. package/dist/{index-sK15Uy0d.js → index-DKMFAW5f.js} +1 -1
  45. package/dist/{index-CAyUKp6J.js → index-DOrEPYZN.js} +3 -3
  46. package/dist/{index-CCVhl3JV.js → index-DfnEQYyW.js} +2 -2
  47. package/dist/{index-bmHi0NgU.js → index-DrgdyC6J.js} +2 -2
  48. package/dist/{index-Cp4UAUdF.js → index-DvrKcy8f.js} +2 -2
  49. package/dist/{index-CtRut8xk.js → index-DxZ1bG6u.js} +2 -2
  50. package/dist/{index-C8xWjIs7.js → index-DykCZUJc.js} +4 -4
  51. package/dist/{index-BtesgJeO.js → index-YX_yu3BN.js} +2 -2
  52. package/dist/{index-4ZuDYpO-.js → index-_3uQ1KPn.js} +3 -3
  53. package/dist/{index-BP3DenBU.js → index-a62vDo6s.js} +2 -2
  54. package/dist/index.js +10831 -9213
  55. package/dist/legacy.js +5 -5
  56. package/dist/translations/en.d.ts +206 -1
  57. package/dist/translations/fr.d.ts +206 -1
  58. package/package.json +8 -3
  59. package/test-results/catalog/.last-run.json +4 -0
@@ -8,7 +8,7 @@ import hn from "@mui/material/Select";
8
8
  import { styled as l, useTheme as bn, getContrastRatio as Ce } from "@mui/material/styles";
9
9
  import { visuallyHidden as $e } from "@mui/utils";
10
10
  import { useIntl as L } from "react-intl";
11
- import { a as R, p as o, h as A, d as Z, D as K, c as yn, t as De, s as de, e as oe, g as te, M as Pe, b as He, i as vn, B as wn } from "./Surface-76bwVL_Z.js";
11
+ import { a as R, p as o, h as A, d as Z, D as K, c as yn, t as De, s as de, e as oe, g as te, M as Pe, b as He, i as vn, B as wn } from "./Surface-BUxzLLhb.js";
12
12
  import { i as xn, b as Cn, r as kn, u as Sn, A as In, E as Fn } from "./index-C27b790L.js";
13
13
  import X from "@mui/material/Button";
14
14
  import { byteSizeIEC as Mn } from "@abyss-project/main";
@@ -36,10 +36,10 @@ import _n from "@mui/icons-material/ChevronRightRounded";
36
36
  import Bn from "@mui/material/Alert";
37
37
  import Vn from "@mui/material/TextField";
38
38
  import jn from "@mui/material/Popover";
39
- import Be from "@mui/material/ButtonBase";
40
39
  import Gn from "@mui/material/InputAdornment";
41
40
  import qn from "@mui/material/FormLabel";
42
41
  import { isMuiElement as Un } from "@mui/material/utils";
42
+ import Be from "@mui/material/ButtonBase";
43
43
  import { Link as Kn } from "react-router-dom";
44
44
  const Yn = l(qn)(({ theme: e }) => ({
45
45
  display: "block",
@@ -1372,7 +1372,70 @@ function Cr({
1372
1372
  }
1373
1373
  );
1374
1374
  }
1375
- const kr = { l: 0.72, c: 0.12 }, Sr = [
1375
+ const ro = [32, 160, 8239, 8201].map(
1376
+ (e) => String.fromCharCode(e)
1377
+ ), io = (e) => {
1378
+ var t, r;
1379
+ const n = new Intl.NumberFormat(e).formatToParts(11111.1);
1380
+ return {
1381
+ group: ((t = n.find((s) => s.type === "group")) == null ? void 0 : t.value) ?? " ",
1382
+ decimal: ((r = n.find((s) => s.type === "decimal")) == null ? void 0 : r.value) ?? "."
1383
+ };
1384
+ }, Te = (e, n) => {
1385
+ const r = [n.group, ...ro].reduce(
1386
+ (c, a) => c.split(a).join(""),
1387
+ e.trim()
1388
+ ).replace(",", ".");
1389
+ if (r === "" || !/^-?\d*\.?\d+$|^-?\d+\.$/.test(r))
1390
+ return null;
1391
+ const s = Number.parseFloat(r);
1392
+ return Number.isFinite(s) ? s : null;
1393
+ };
1394
+ function kr({
1395
+ label: e,
1396
+ value: n,
1397
+ onChange: t,
1398
+ decimals: r = 0,
1399
+ min: s = 0,
1400
+ disabled: c,
1401
+ adornment: a
1402
+ }) {
1403
+ const d = L(), f = ge(
1404
+ () => io(d.locale),
1405
+ [d.locale]
1406
+ ), v = Q(
1407
+ (p) => p === null ? "" : d.formatNumber(p, {
1408
+ minimumFractionDigits: r,
1409
+ maximumFractionDigits: r
1410
+ }),
1411
+ [d, r]
1412
+ ), [b, u] = I(!1), [h, m] = I(() => v(n));
1413
+ return B(() => {
1414
+ b || m(v(n));
1415
+ }, [n, b, v]), /* @__PURE__ */ i(Ve, { label: e, children: /* @__PURE__ */ i(
1416
+ fe,
1417
+ {
1418
+ disabled: c,
1419
+ value: h,
1420
+ inputProps: { inputMode: "decimal" },
1421
+ onFocus: () => {
1422
+ u(!0), n !== null && m(String(n).replace(".", f.decimal));
1423
+ },
1424
+ onChange: (p) => {
1425
+ m(p.target.value);
1426
+ const y = Te(p.target.value, f);
1427
+ y !== null ? t(y) : p.target.value === "" && t(null);
1428
+ },
1429
+ onBlur: () => {
1430
+ u(!1);
1431
+ let p = Te(h, f);
1432
+ p !== null && (p = Number.parseFloat(Math.max(p, s).toFixed(r))), t(p), m(v(p));
1433
+ },
1434
+ endAdornment: a ? /* @__PURE__ */ i(Gn, { position: "end", children: a }) : void 0
1435
+ }
1436
+ ) });
1437
+ }
1438
+ const Sr = { l: 0.72, c: 0.12 }, Ir = [
1376
1439
  266,
1377
1440
  296,
1378
1441
  326,
@@ -1398,25 +1461,25 @@ const kr = { l: 0.72, c: 0.12 }, Sr = [
1398
1461
  "#37bda2",
1399
1462
  "#18b9c9",
1400
1463
  "#4eb0e5"
1401
- ], Ir = "#767676", Fr = rn[6], Mr = "#111a2f", Or = "#5674be", ro = /^#?([0-9a-f]{6})$/i, q = (e) => {
1402
- const n = ro.exec(e.trim());
1464
+ ], Fr = "#767676", Mr = rn[6], Or = "#111a2f", Wr = "#5674be", so = /^#?([0-9a-f]{6})$/i, q = (e) => {
1465
+ const n = so.exec(e.trim());
1403
1466
  return n ? `#${n[1].toLowerCase()}` : null;
1404
- }, io = l("div")(({ theme: e }) => ({
1467
+ }, ao = l("div")(({ theme: e }) => ({
1405
1468
  display: "flex",
1406
1469
  alignItems: "center",
1407
1470
  gap: o(e.design.space[3])
1408
- })), so = l("span")(({ theme: e }) => ({
1471
+ })), lo = l("span")(({ theme: e }) => ({
1409
1472
  flex: "none",
1410
1473
  width: o(e.design.densityValues[e.design.density].control),
1411
1474
  height: o(e.design.densityValues[e.design.density].control),
1412
1475
  borderRadius: o(e.design.radii.md),
1413
1476
  border: A(e.design.tokens["border.control"])
1414
- })), ao = l("div")(({ theme: e }) => ({
1477
+ })), co = l("div")(({ theme: e }) => ({
1415
1478
  display: "flex",
1416
1479
  flexWrap: "wrap",
1417
1480
  gap: o(e.design.space[2]),
1418
1481
  marginTop: o(e.design.space[2])
1419
- })), lo = l(Be)(({ theme: e }) => {
1482
+ })), uo = l(Be)(({ theme: e }) => {
1420
1483
  const { densityValues: n, density: t, space: r } = e.design, s = n[t].control - r[2];
1421
1484
  return {
1422
1485
  width: o(s),
@@ -1432,7 +1495,7 @@ const kr = { l: 0.72, c: 0.12 }, Sr = [
1432
1495
  }
1433
1496
  };
1434
1497
  });
1435
- function Wr({
1498
+ function Tr({
1436
1499
  label: e,
1437
1500
  value: n,
1438
1501
  onChange: t,
@@ -1451,9 +1514,9 @@ function Wr({
1451
1514
  }, b = q(n);
1452
1515
  return /* @__PURE__ */ x(le, { fullWidth: !0, error: f, children: [
1453
1516
  /* @__PURE__ */ i(Le, { htmlFor: `${c}-hex`, children: e }),
1454
- /* @__PURE__ */ x(io, { children: [
1517
+ /* @__PURE__ */ x(ao, { children: [
1455
1518
  /* @__PURE__ */ i(
1456
- so,
1519
+ lo,
1457
1520
  {
1458
1521
  "aria-hidden": "true",
1459
1522
  style: { backgroundColor: b ?? void 0 }
@@ -1477,12 +1540,12 @@ function Wr({
1477
1540
  ] }),
1478
1541
  f && /* @__PURE__ */ i(se, { id: `${c}-error`, children: s.formatMessage({ id: "ds.inputs.color.invalid" }) }),
1479
1542
  /* @__PURE__ */ i(
1480
- ao,
1543
+ co,
1481
1544
  {
1482
1545
  role: "group",
1483
1546
  "aria-label": s.formatMessage({ id: "ds.inputs.color.swatches" }),
1484
1547
  children: r.map((u) => /* @__PURE__ */ i(
1485
- lo,
1548
+ uo,
1486
1549
  {
1487
1550
  "aria-pressed": q(u) === b,
1488
1551
  "aria-label": u,
@@ -1495,10 +1558,10 @@ function Wr({
1495
1558
  )
1496
1559
  ] });
1497
1560
  }
1498
- const co = 6, uo = l("div", {
1561
+ const po = 6, go = l("div", {
1499
1562
  shouldForwardProp: (e) => e !== "edges"
1500
1563
  })(({ theme: e, edges: n }) => {
1501
- const { tokens: t, radii: r, space: s } = e.design, c = o(s[1] * co), a = t["text.primary"], d = n.start ? `transparent, ${a} ${c}` : a, f = n.end ? `${a} calc(100% - ${c}), transparent` : a;
1564
+ const { tokens: t, radii: r, space: s } = e.design, c = o(s[1] * po), a = t["text.primary"], d = n.start ? `transparent, ${a} ${c}` : a, f = n.end ? `${a} calc(100% - ${c}), transparent` : a;
1502
1565
  return {
1503
1566
  maskImage: n.start || n.end ? `linear-gradient(to right, ${d}, ${f})` : "none",
1504
1567
  display: "inline-flex",
@@ -1523,7 +1586,7 @@ const co = 6, uo = l("div", {
1523
1586
  backgroundColor: "transparent"
1524
1587
  }
1525
1588
  };
1526
- }), po = l(Be)(({ theme: e }) => {
1589
+ }), fo = l(Be)(({ theme: e }) => {
1527
1590
  const { tokens: n, space: t, typeScale: r, fonts: s, densityValues: c, radii: a } = e.design;
1528
1591
  return {
1529
1592
  flex: "none",
@@ -1555,19 +1618,19 @@ const co = 6, uo = l("div", {
1555
1618
  '&[aria-checked="true"]': { backgroundColor: n["bg.raised"] }
1556
1619
  }
1557
1620
  };
1558
- }), go = l("span")(({ theme: e }) => ({
1621
+ }), mo = l("span")(({ theme: e }) => ({
1559
1622
  display: "inline-flex",
1560
1623
  flex: "none",
1561
1624
  "& svg": {
1562
1625
  width: o(e.design.space[4]),
1563
1626
  height: o(e.design.space[4])
1564
1627
  }
1565
- })), fo = l("span")($e), mo = l("span")(({ theme: e }) => ({
1628
+ })), ho = l("span")($e), bo = l("span")(({ theme: e }) => ({
1566
1629
  fontFamily: e.design.fonts.mono,
1567
1630
  fontSize: o(e.design.typeScale.caption),
1568
1631
  color: e.design.tokens["text.muted"]
1569
1632
  }));
1570
- function Tr({
1633
+ function Rr({
1571
1634
  options: e,
1572
1635
  value: n,
1573
1636
  onChange: t,
@@ -1612,7 +1675,7 @@ function Tr({
1612
1675
  0
1613
1676
  );
1614
1677
  return /* @__PURE__ */ i(
1615
- uo,
1678
+ go,
1616
1679
  {
1617
1680
  ref: c,
1618
1681
  role: "radiogroup",
@@ -1624,7 +1687,7 @@ function Tr({
1624
1687
  children: e.map((u, h) => {
1625
1688
  const m = u.value === n;
1626
1689
  return /* @__PURE__ */ x(
1627
- po,
1690
+ fo,
1628
1691
  {
1629
1692
  role: "radio",
1630
1693
  "aria-checked": m,
@@ -1634,9 +1697,9 @@ function Tr({
1634
1697
  tabIndex: h === b ? 0 : -1,
1635
1698
  onClick: () => t(u.value),
1636
1699
  children: [
1637
- u.icon !== void 0 && /* @__PURE__ */ i(go, { "aria-hidden": !0, children: u.icon }),
1638
- u.icon !== void 0 && u.iconOnly ? /* @__PURE__ */ i(fo, { children: u.label }) : u.label,
1639
- u.count !== void 0 && /* @__PURE__ */ i(mo, { children: u.count })
1700
+ u.icon !== void 0 && /* @__PURE__ */ i(mo, { "aria-hidden": !0, children: u.icon }),
1701
+ u.icon !== void 0 && u.iconOnly ? /* @__PURE__ */ i(ho, { children: u.label }) : u.label,
1702
+ u.count !== void 0 && /* @__PURE__ */ i(bo, { children: u.count })
1640
1703
  ]
1641
1704
  },
1642
1705
  u.value
@@ -1645,69 +1708,6 @@ function Tr({
1645
1708
  }
1646
1709
  );
1647
1710
  }
1648
- const ho = [32, 160, 8239, 8201].map(
1649
- (e) => String.fromCharCode(e)
1650
- ), bo = (e) => {
1651
- var t, r;
1652
- const n = new Intl.NumberFormat(e).formatToParts(11111.1);
1653
- return {
1654
- group: ((t = n.find((s) => s.type === "group")) == null ? void 0 : t.value) ?? " ",
1655
- decimal: ((r = n.find((s) => s.type === "decimal")) == null ? void 0 : r.value) ?? "."
1656
- };
1657
- }, Te = (e, n) => {
1658
- const r = [n.group, ...ho].reduce(
1659
- (c, a) => c.split(a).join(""),
1660
- e.trim()
1661
- ).replace(",", ".");
1662
- if (r === "" || !/^-?\d*\.?\d+$|^-?\d+\.$/.test(r))
1663
- return null;
1664
- const s = Number.parseFloat(r);
1665
- return Number.isFinite(s) ? s : null;
1666
- };
1667
- function Rr({
1668
- label: e,
1669
- value: n,
1670
- onChange: t,
1671
- decimals: r = 0,
1672
- min: s = 0,
1673
- disabled: c,
1674
- adornment: a
1675
- }) {
1676
- const d = L(), f = ge(
1677
- () => bo(d.locale),
1678
- [d.locale]
1679
- ), v = Q(
1680
- (p) => p === null ? "" : d.formatNumber(p, {
1681
- minimumFractionDigits: r,
1682
- maximumFractionDigits: r
1683
- }),
1684
- [d, r]
1685
- ), [b, u] = I(!1), [h, m] = I(() => v(n));
1686
- return B(() => {
1687
- b || m(v(n));
1688
- }, [n, b, v]), /* @__PURE__ */ i(Ve, { label: e, children: /* @__PURE__ */ i(
1689
- fe,
1690
- {
1691
- disabled: c,
1692
- value: h,
1693
- inputProps: { inputMode: "decimal" },
1694
- onFocus: () => {
1695
- u(!0), n !== null && m(String(n).replace(".", f.decimal));
1696
- },
1697
- onChange: (p) => {
1698
- m(p.target.value);
1699
- const y = Te(p.target.value, f);
1700
- y !== null ? t(y) : p.target.value === "" && t(null);
1701
- },
1702
- onBlur: () => {
1703
- u(!1);
1704
- let p = Te(h, f);
1705
- p !== null && (p = Number.parseFloat(Math.max(p, s).toFixed(r))), t(p), m(v(p));
1706
- },
1707
- endAdornment: a ? /* @__PURE__ */ i(Gn, { position: "end", children: a }) : void 0
1708
- }
1709
- ) });
1710
- }
1711
1711
  const yo = 1, vo = (e, n) => n === "vertical" ? e.scrollHeight - e.clientHeight - e.scrollTop : e.scrollWidth - e.clientWidth - e.scrollLeft, wo = (e, n, t) => {
1712
1712
  const [r, s] = I(!1), c = Q(() => {
1713
1713
  const a = e.current;
@@ -1927,28 +1927,28 @@ export {
1927
1927
  vr as D,
1928
1928
  Ve as F,
1929
1929
  Wt as I,
1930
- Rr as N,
1930
+ kr as N,
1931
1931
  yr as R,
1932
- Tr as S,
1932
+ Rr as S,
1933
1933
  xo as T,
1934
1934
  je as a,
1935
1935
  Tt as b,
1936
1936
  nn as c,
1937
1937
  Kt as d,
1938
- wo as e,
1939
- Zt as f,
1938
+ Zt as e,
1939
+ wo as f,
1940
1940
  Ot as g,
1941
- Wr as h,
1941
+ Tr as h,
1942
1942
  Jt as i,
1943
1943
  wr as j,
1944
1944
  Er as k,
1945
- kr as l,
1946
- Sr as m,
1945
+ Sr as l,
1946
+ Ir as m,
1947
1947
  q as n,
1948
1948
  rn as o,
1949
- Ir as p,
1950
- Fr as q,
1951
- Mr as r,
1952
- Or as s,
1949
+ Fr as p,
1950
+ Mr as q,
1951
+ Or as r,
1952
+ Wr as s,
1953
1953
  xr as u
1954
1954
  };
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import { DeliveryHistoryProps } from './deliveries.types';
3
+ /**
4
+ * The deliveries of a scope (usually one subscription): a paginated list with a status filter, a
5
+ * detail drawer (request, headers sent, response, timeline) and a replay of the deliveries that
6
+ * ended. Data and actions come through props.
7
+ */
8
+ export declare const DeliveryHistory: FC<DeliveryHistoryProps>;
@@ -0,0 +1,23 @@
1
+ import { DeliveryEventType, FlowDeliverySource, ICreateDeliverySubscriptionBody, IDeliverySubscription, IUpdateDeliverySubscriptionBody } from '@abyss-project/flow';
2
+ /** What the form hands back: a creation, or the editable part of a subscription. */
3
+ export type DeliverySubscriptionFormResult = {
4
+ create: ICreateDeliverySubscriptionBody;
5
+ } | {
6
+ update: IUpdateDeliverySubscriptionBody;
7
+ };
8
+ interface DeliverySubscriptionFormProps {
9
+ /** The subscription edited; `null` creates one. */
10
+ subscription: IDeliverySubscription | null;
11
+ sources: FlowDeliverySource[];
12
+ eventTypesBySource: Record<FlowDeliverySource, DeliveryEventType[]>;
13
+ /** A rejection stays in the form, with the message of the rejection. */
14
+ onSubmit(result: DeliverySubscriptionFormResult): Promise<void>;
15
+ onCancel(): void;
16
+ }
17
+ /**
18
+ * The body of the create and edit drawer. It lives inside the drawer so that closing it drops the
19
+ * typed values. The source is chosen at creation and cannot change after; its event types are the
20
+ * only ones offered, and the body format only exists for a Form subscription.
21
+ */
22
+ export declare function DeliverySubscriptionForm({ subscription, sources, eventTypesBySource, onSubmit, onCancel, }: DeliverySubscriptionFormProps): import("react/jsx-runtime").JSX.Element;
23
+ export {};
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ import { DeliverySubscriptionsProps } from './deliveries.types';
3
+ /**
4
+ * The delivery subscriptions of a scope: the list, the create and edit drawer, the secret shown
5
+ * once after a creation or a reset, the enable switch and the confirmed delete. Data and actions
6
+ * come through props (see `DeliverySubscriptionsProps`); the actions a viewer lacks the permission
7
+ * for are not drawn.
8
+ */
9
+ export declare const DeliverySubscriptions: FC<DeliverySubscriptionsProps>;
@@ -0,0 +1,21 @@
1
+ import { ICreateScheduledTaskBody, IScheduledTask, IUpdateScheduledTaskBody } from '@abyss-project/flow';
2
+ /** What the form hands back: a creation, or the editable part of a task. */
3
+ export type ScheduledTaskFormResult = {
4
+ create: ICreateScheduledTaskBody;
5
+ } | {
6
+ update: IUpdateScheduledTaskBody;
7
+ };
8
+ interface ScheduledTaskFormProps {
9
+ /** The task edited; `null` creates one. */
10
+ task: IScheduledTask | null;
11
+ /** A rejection stays in the form, with the message of the rejection. */
12
+ onSubmit(result: ScheduledTaskFormResult): Promise<void>;
13
+ onCancel(): void;
14
+ }
15
+ /**
16
+ * The body of the create and edit drawer. It lives inside the drawer so that closing it drops the
17
+ * typed values. The schedule is checked by Flow: an invalid cron comes back as a rejection and its
18
+ * message is shown at the top of the form. The retry settings left empty keep Flow's defaults.
19
+ */
20
+ export declare function ScheduledTaskForm({ task, onSubmit, onCancel, }: ScheduledTaskFormProps): import("react/jsx-runtime").JSX.Element;
21
+ export {};
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ import { ScheduledTasksProps } from './deliveries.types';
3
+ /**
4
+ * The scheduled tasks of a scope: the list, the create and edit drawer, the secret shown once
5
+ * after a creation or a regeneration, the enable switch, « run now », the confirmed delete and the
6
+ * drawer of a task's runs. Data and actions come through props (see `ScheduledTasksProps`); the
7
+ * actions a viewer lacks the permission for are not drawn.
8
+ */
9
+ export declare const ScheduledTasks: FC<ScheduledTasksProps>;
@@ -0,0 +1,35 @@
1
+ import { IntlShape } from 'react-intl';
2
+ import { DeliveryFormat, DeliveryStatus, FlowDeliverySource, IDelivery, ScheduledTaskRunStatus } from '@abyss-project/flow';
3
+ import { ExecutionState } from '../../../theme/tokens/domain';
4
+ import { StatusTone } from '../../meaning/StatusBadge/StatusBadge';
5
+ /**
6
+ * The Flow enums are imported as types only (the SDK is an optional peer, so nothing of it may
7
+ * load at runtime). `${Enum}` is the union of an enum's string values: an enum member is
8
+ * assignable to it, which lets the code below compare and index by the value.
9
+ */
10
+ export type DeliveryStatusValue = `${DeliveryStatus}`;
11
+ export type RunStatusValue = `${ScheduledTaskRunStatus}`;
12
+ /** The only source whose subscriptions pick a body format (JSON, or a Discord post). */
13
+ export declare const FORM_SOURCE: FlowDeliverySource;
14
+ export declare const JSON_FORMAT: DeliveryFormat;
15
+ export declare const DISCORD_FORMAT: DeliveryFormat;
16
+ /** Rows asked per page of every list. */
17
+ export declare const DELIVERIES_PAGE_SIZE = 20;
18
+ /** The badge tone of an execution state: `domainTokens.executionState` is made of `status.*`. */
19
+ export declare const executionStateTone: (state: ExecutionState) => StatusTone;
20
+ export declare const deliveryStatusTone: (status: DeliveryStatus) => StatusTone;
21
+ export declare const runStatusTone: (status: ScheduledTaskRunStatus) => StatusTone;
22
+ /** A replay is offered on a delivery that ended: sent, or given up on. */
23
+ export declare const isReplayable: (delivery: IDelivery) => boolean;
24
+ /** The headers a delivery is sent with, as far as the stored delivery tells (never the signature). */
25
+ export declare const deliveryHeaders: (delivery: IDelivery) => Array<[name: string, value: string]>;
26
+ /** Presets the schedule field offers beside a free cron (the aliases Flow accepts). */
27
+ export declare const SCHEDULE_PRESETS: readonly ["@hourly", "@daily", "@weekly", "@monthly"];
28
+ /**
29
+ * What a rejected call says, when it says something: the validation message of a Flow answer, its
30
+ * message, or the message of a plain `Error`. `null` when the rejection carries no text (the
31
+ * caller then shows its generic sentence).
32
+ */
33
+ export declare const readRejectionMessage: (error: unknown) => string | null;
34
+ /** A date and time in the viewer's language; an empty cell when the date is absent. */
35
+ export declare const formatDateTime: (intl: Pick<IntlShape, "formatDate">, value: Date | string | null) => string;
@@ -0,0 +1,65 @@
1
+ import { BasePaginate, DeliveryEventType, FlowDeliverySource, ICreateDeliverySubscriptionBody, ICreateScheduledTaskBody, IDelivery, IDeliverySubscription, IPaginateDeliveryQuery, IPaginateDeliverySubscriptionQuery, IPaginateScheduledTaskQuery, IPaginateScheduledTaskRunQuery, IScheduledTask, IScheduledTaskRun, IUpdateDeliverySubscriptionBody, IUpdateScheduledTaskBody } from '@abyss-project/flow';
2
+ /**
3
+ * The Deliveries components are data-agnostic: every datum and every action goes through a prop
4
+ * that returns a promise, so each service front binds its own Flow SDK calls (scope included) and
5
+ * unwraps the `data` of the answer. The Flow SDK is an optional peer, imported as types only.
6
+ */
7
+ export interface DeliveryPermissionsBase {
8
+ canCreate: boolean;
9
+ canUpdate: boolean;
10
+ canDelete: boolean;
11
+ }
12
+ export interface DeliverySubscriptionPermissions extends DeliveryPermissionsBase {
13
+ canResetSecret: boolean;
14
+ canReadHistory: boolean;
15
+ }
16
+ export interface ScheduledTaskPermissions extends DeliveryPermissionsBase {
17
+ canRegenerateSecret: boolean;
18
+ canTrigger: boolean;
19
+ }
20
+ /** A secret leaves the API once, with the answer of a creation or a reset. */
21
+ export interface DeliverySubscriptionWithSecret {
22
+ deliverySubscription: IDeliverySubscription;
23
+ secret: string;
24
+ }
25
+ export interface ScheduledTaskWithSecret {
26
+ scheduledTask: IScheduledTask;
27
+ secret: string;
28
+ }
29
+ export interface DeliverySubscriptionsProps {
30
+ /** The sources the host may subscribe to (the form offers these only). */
31
+ sources: FlowDeliverySource[];
32
+ /** `DELIVERY_EVENT_TYPES_BY_SOURCE` of the Flow SDK, or a subset of it. */
33
+ eventTypesBySource: Record<FlowDeliverySource, DeliveryEventType[]>;
34
+ list(params: IPaginateDeliverySubscriptionQuery): Promise<BasePaginate<IDeliverySubscription>>;
35
+ create(body: ICreateDeliverySubscriptionBody): Promise<DeliverySubscriptionWithSecret>;
36
+ update(id: string, body: IUpdateDeliverySubscriptionBody): Promise<IDeliverySubscription>;
37
+ remove(id: string): Promise<void>;
38
+ resetSecret(id: string): Promise<DeliverySubscriptionWithSecret>;
39
+ onOpenHistory(subscription: IDeliverySubscription): void;
40
+ /** Where « Ouvrir dans Flow » leads. */
41
+ flowUrl: string;
42
+ permissions: DeliverySubscriptionPermissions;
43
+ }
44
+ export interface DeliveryHistoryProps {
45
+ list(params: IPaginateDeliveryQuery): Promise<BasePaginate<IDelivery>>;
46
+ get(id: string): Promise<IDelivery>;
47
+ /** A replay is a new attempt with the same delivery id. */
48
+ replayDelivery(id: string): Promise<void>;
49
+ canReplay: boolean;
50
+ /** Where « Ouvrir dans Flow » leads. */
51
+ flowUrl: string;
52
+ }
53
+ export interface ScheduledTasksProps {
54
+ list(params: IPaginateScheduledTaskQuery): Promise<BasePaginate<IScheduledTask>>;
55
+ create(body: ICreateScheduledTaskBody): Promise<ScheduledTaskWithSecret>;
56
+ update(id: string, body: IUpdateScheduledTaskBody): Promise<IScheduledTask>;
57
+ remove(id: string): Promise<void>;
58
+ regenerateSecret(id: string): Promise<ScheduledTaskWithSecret>;
59
+ /** « Run now »: queues one run at once. */
60
+ trigger(id: string): Promise<void>;
61
+ listRuns(id: string, params: IPaginateScheduledTaskRunQuery): Promise<BasePaginate<IScheduledTaskRun>>;
62
+ permissions: ScheduledTaskPermissions;
63
+ /** Where « Ouvrir dans Flow » leads. */
64
+ flowUrl: string;
65
+ }
@@ -0,0 +1,19 @@
1
+ import { BasePaginate, DeliveryEventType, DeliveryFormat, DeliveryStatus, FlowDeliverySource, IDelivery, IDeliverySubscription, IScheduledTask, IScheduledTaskRun, ScheduledTaskRunStatus } from '@abyss-project/flow';
2
+ /**
3
+ * Fixtures shared by the specs and the catalog pages. The Flow enums are types only here (the SDK
4
+ * is an optional peer), so their values are written as strings and cast.
5
+ */
6
+ export declare const source: (value: string) => FlowDeliverySource;
7
+ export declare const deliveryStatus: (value: string) => DeliveryStatus;
8
+ export declare const runStatus: (value: string) => ScheduledTaskRunStatus;
9
+ export declare const deliveryFormat: (value: string) => DeliveryFormat;
10
+ export declare const eventType: (value: string) => DeliveryEventType;
11
+ export declare const SOURCES: FlowDeliverySource[];
12
+ /** The shape of `DELIVERY_EVENT_TYPES_BY_SOURCE` of the Flow SDK, for the sources above. */
13
+ export declare const EVENT_TYPES_BY_SOURCE: Record<FlowDeliverySource, DeliveryEventType[]>;
14
+ export declare const page: <T>(data: T[]) => BasePaginate<T>;
15
+ export declare const subscription: (overrides?: Partial<IDeliverySubscription>) => IDeliverySubscription;
16
+ export declare const delivery: (overrides?: Partial<IDelivery>) => IDelivery;
17
+ export declare const failedDelivery: (overrides?: Partial<IDelivery>) => IDelivery;
18
+ export declare const scheduledTask: (overrides?: Partial<IScheduledTask>) => IScheduledTask;
19
+ export declare const taskRun: (overrides?: Partial<IScheduledTaskRun>) => IScheduledTaskRun;
@@ -0,0 +1,4 @@
1
+ /** Opens the « Actions » menu of the row named `row` (a URL, a task name, a delivery id). */
2
+ export declare const openRowMenu: (row: string) => Promise<void>;
3
+ /** Picks `action` in the « Actions » menu of the row named `row`. */
4
+ export declare const chooseRowAction: (row: string, action: string) => Promise<void>;
@@ -0,0 +1,25 @@
1
+ import { BasePaginate } from '@abyss-project/flow';
2
+ export declare enum PagedListStatus {
3
+ Loading = "loading",
4
+ Ready = "ready",
5
+ Error = "error"
6
+ }
7
+ export interface PagedList<T> {
8
+ status: PagedListStatus;
9
+ rows: T[];
10
+ page: number;
11
+ pageCount: number;
12
+ total: number;
13
+ goToPage(page: number): void;
14
+ /** Loads the current page again, keeping the rows on screen meanwhile. */
15
+ reload(): void;
16
+ /** After a failure: back to the loading state, then loads again. */
17
+ retry(): void;
18
+ }
19
+ /**
20
+ * One paginated list fed by a promise. `filterKey` stands for the filters `load` reads: when it
21
+ * changes the list loads again (the host puts the page back to 1 in the same update). An answer
22
+ * that arrives after a newer request, or after the unmount, is dropped; a page left empty (its
23
+ * last row was removed) falls back to the page before.
24
+ */
25
+ export declare function usePagedList<T>(load: (page: number) => Promise<BasePaginate<T>>, filterKey: string): PagedList<T>;
@@ -25,3 +25,7 @@ export * from './Support/SupportStatusTimeline.component';
25
25
  export * from './Support/SupportTopBar.component';
26
26
  export * from './Support/SupportSidebar.component';
27
27
  export * from './Support/SupportTicketDetail.component';
28
+ export * from './Deliveries/deliveries.types';
29
+ export * from './Deliveries/DeliverySubscriptions.component';
30
+ export * from './Deliveries/DeliveryHistory.component';
31
+ export * from './Deliveries/ScheduledTasks.component';
@@ -1,5 +1,5 @@
1
- import { A as e, d as a, C as n, b as C, D as i, R as t, V as r, e as A, r as k, f as c, u as l, c as f, a as b, w as u } from "./CookieConsentSettings-CTAyLGkm.js";
2
- import { f as E } from "./Surface-76bwVL_Z.js";
1
+ import { A as e, d as a, C as n, b as C, D as i, R as t, V as r, e as A, r as k, f as c, u as l, c as f, a as b, w as u } from "./CookieConsentSettings-DHpcYTa2.js";
2
+ import { f as E } from "./Surface-BUxzLLhb.js";
3
3
  export {
4
4
  e as AbyssCookieConsentProvider,
5
5
  a as COOKIE_NAME,
@@ -2,7 +2,7 @@ import { B as Mt, C as DW, D as PW, F as KW, f as WW, m as af, n as b3, G as BW,
2
2
  import { W as JW, r as zW, C as ZW } from "./index-D7cgykJH.js";
3
3
  import * as ga from "react";
4
4
  import PT, { useRef as gt, useEffect as xr, useState as Pr, useCallback as xe, useMemo as Ye, useLayoutEffect as fE, createContext as no, forwardRef as ms, createElement as Tr, useContext as ji, memo as Kt, cloneElement as $W, Component as dE, Fragment as t2, isValidElement as eB } from "react";
5
- import { u as tB, T as qc, q as rB, H as hE, l as gE, r as pE, o as vE, y as mE, z as bE, J as nB, K as iB, I as aB, n as oB } from "./Surface-76bwVL_Z.js";
5
+ import { u as tB, T as qc, v as rB, H as hE, l as gE, r as pE, q as vE, y as mE, z as bE, J as nB, K as iB, I as aB, o as oB } from "./Surface-BUxzLLhb.js";
6
6
  import KT from "@mui/icons-material/InsertDriveFile";
7
7
  import sB from "@mui/icons-material/Image";
8
8
  import uB from "@mui/icons-material/PictureAsPdf";