@dpuse/dpuse-shared 1.0.128 → 1.0.130

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 CHANGED
@@ -241,14 +241,14 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
241
241
 
242
242
  | Chunk/Module/File | Composition |
243
243
  | :-------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------- |
244
- | **dist/dpuse-shared.es.js** | 36.1 kB · gzip 9.5 kB · 100.0% of the build |
245
- |     src → index.ts + 9 more | `█████████████░░░░░░░` 65.9% · 23.8 kB |
246
- |         ↳ index.ts | `▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░` 56.0% · 20.2 kB |
247
- |         ↳ connectorConfig.schema.ts | `▒░░░░░░░░░░░░░░░░░░░` 3.4% · 1.2 kB |
248
- |         ↳ componentConfig.schema.ts | `▒░░░░░░░░░░░░░░░░░░░` 2.5% · 936 B |
249
- |         ↳ 7 smaller files | `▒░░░░░░░░░░░░░░░░░░░` 3.9% · 1.4 kB |
250
- |     valibot → dist/index.mjs | `████░░░░░░░░░░░░░░░░` 19.4% · 7.0 kB |
251
- |     (bundler output, whitespace & JSON) | `███░░░░░░░░░░░░░░░░░` 14.6% · 5.3 kB |
244
+ | **dist/dpuse-shared.es.js** | 37.3 kB · gzip 9.9 kB · 100.0% of the build |
245
+ |     src → index.ts + 9 more | `█████████████░░░░░░░` 66.5% · 24.8 kB |
246
+ |         ↳ index.ts | `▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░` 56.9% · 21.2 kB |
247
+ |         ↳ connectorConfig.schema.ts | `▒░░░░░░░░░░░░░░░░░░░` 3.3% · 1.2 kB |
248
+ |         ↳ componentConfig.schema.ts | `░░░░░░░░░░░░░░░░░░░░` 2.5% · 936 B |
249
+ |         ↳ 7 smaller files | `▒░░░░░░░░░░░░░░░░░░░` 3.8% · 1.4 kB |
250
+ |     valibot → dist/index.mjs | `████░░░░░░░░░░░░░░░░` 18.8% · 7.0 kB |
251
+ |     (bundler output, whitespace & JSON) | `███░░░░░░░░░░░░░░░░░` 14.7% · 5.5 kB |
252
252
 
253
253
  Bars show each row's share of its output file. ↳ rows are part of the row above.
254
254
 
@@ -479,7 +479,7 @@ function ce(e, t = "en") {
479
479
  }
480
480
  //#endregion
481
481
  //#region src/component/dataView/index.ts
482
- n({ en: "Data Positioning Events" }), n({ en: "Delimited Text" }), n({ en: "JSON" }), n({ en: "SPSS" }), n({ en: "XLSX" }), n({ en: "XML" });
482
+ n({ en: "Data Positioning Events" }), n({ en: "Delimited Text" }), n({ en: "JSON" }), n({ en: "Markdown" }), n({ en: "SPSS" }), n({ en: "Plain Text" }), n({ en: "XLSX" }), n({ en: "XML" });
483
483
  var le = [
484
484
  ",",
485
485
  ";",
@@ -763,7 +763,7 @@ async function Me(e, t, n) {
763
763
  } catch (e) {
764
764
  a = `<body unavailable: ${B(e).message}>`;
765
765
  }
766
- return new z(i, n, { body: ze(a) });
766
+ return new z(i, n, { body: Be(a) });
767
767
  }
768
768
  function Ne(e) {
769
769
  return e.map((e) => e.message).join(" ");
@@ -789,7 +789,7 @@ function Fe(e) {
789
789
  let t = /* @__PURE__ */ new Set(), n = [], r = B(e);
790
790
  for (; r != null && !t.has(r);) {
791
791
  t.add(r);
792
- let [e, i] = Be(r), a = V(e);
792
+ let [e, i] = Ve(r), a = ze(e);
793
793
  /(?:\.{3}|[.!?])$/.test(a.message) || (a.message += "."), n.push(a), r = i;
794
794
  }
795
795
  return n;
@@ -826,27 +826,27 @@ function Re(e, t) {
826
826
  }
827
827
  }
828
828
  }
829
- function V(e) {
829
+ function ze(e) {
830
830
  let { data: t, message: n, stack: r } = e;
831
831
  return {
832
832
  ...e,
833
- data: t === void 0 ? void 0 : U(t, /* @__PURE__ */ new WeakSet(), 0),
834
- message: H(n),
835
- stack: r === void 0 ? void 0 : H(r)
833
+ data: t === void 0 ? void 0 : H(t, /* @__PURE__ */ new WeakSet(), 0),
834
+ message: V(n),
835
+ stack: r === void 0 ? void 0 : V(r)
836
836
  };
837
837
  }
838
- function H(e) {
838
+ function V(e) {
839
839
  let t = e;
840
840
  for (let [e, n] of je) t = t.replaceAll(e, (e, ...t) => n(e, ...t));
841
841
  return t;
842
842
  }
843
- function U(e, t, n) {
844
- return typeof e == "string" ? H(e) : typeof e != "object" || !e ? e : n >= Ae ? M : t.has(e) ? "[Circular]" : (t.add(e), Array.isArray(e) ? e.map((e) => U(e, t, n + 1)) : Object.fromEntries(Object.entries(e).map(([e, r]) => [e, r != null && N.test(e) ? M : U(r, t, n + 1)])));
843
+ function H(e, t, n) {
844
+ return typeof e == "string" ? V(e) : typeof e != "object" || !e ? e : n >= Ae ? M : t.has(e) ? "[Circular]" : (t.add(e), Array.isArray(e) ? e.map((e) => H(e, t, n + 1)) : Object.fromEntries(Object.entries(e).map(([e, r]) => [e, r != null && N.test(e) ? M : H(r, t, n + 1)])));
845
845
  }
846
- function ze(e) {
846
+ function Be(e) {
847
847
  if (e != null && e !== "") return e.length > j ? `${e.slice(0, j)}... [truncated]` : e;
848
848
  }
849
- function Be(e) {
849
+ function Ve(e) {
850
850
  let t = e.cause == null ? null : B(e.cause);
851
851
  if (e instanceof P) return [{
852
852
  data: e.data,
@@ -872,18 +872,18 @@ function Be(e) {
872
872
  }
873
873
  //#endregion
874
874
  //#region src/component/module/presenter/presenterConfig.schema.ts
875
- var Ve = T([
875
+ var He = T([
876
876
  "list",
877
877
  "render",
878
878
  "setColorMode"
879
- ]), He = /* @__PURE__ */ b({
879
+ ]), Ue = /* @__PURE__ */ b({
880
880
  ...k,
881
881
  typeId: /* @__PURE__ */ h("presenter"),
882
- actionNames: /* @__PURE__ */ p(Ve),
882
+ actionNames: /* @__PURE__ */ p(He),
883
883
  presentations: /* @__PURE__ */ p(D)
884
- }), Ue = "https://engine-eu.dpuse.app/presenters";
885
- async function We(e, t, n, r) {
886
- let i = e.id, a = `${Ue}/${i.split("-").slice(2).join("-")}_v${e.version}/${i}.es.js`;
884
+ }), We = "https://engine-eu.dpuse.app/presenters";
885
+ async function Ge(e, t, n, r) {
886
+ let i = e.id, a = `${We}/${i.split("-").slice(2).join("-")}_v${e.version}/${i}.es.js`;
887
887
  try {
888
888
  return new (await (import(
889
889
  /* @vite-ignore */
@@ -900,8 +900,8 @@ async function We(e, t, n, r) {
900
900
  }
901
901
  //#endregion
902
902
  //#region src/component/module/tool/index.ts
903
- var Ge = "https://engine-eu.dpuse.app/tools";
904
- async function Ke(e, t) {
903
+ var Ke = "https://engine-eu.dpuse.app/tools";
904
+ async function qe(e, t) {
905
905
  let n = `dpuse-tool-${t}`, r = e.find((e) => e.id === n);
906
906
  if (!r) {
907
907
  let r = {
@@ -910,7 +910,7 @@ async function Ke(e, t) {
910
910
  };
911
911
  throw new F(`Tool '${t}' not found.`, "dpuse-shared.component.module.tool.loadTool", r);
912
912
  }
913
- let i = `${Ge}/${t}_v${r.version}/${n}.es.js`;
913
+ let i = `${Ke}/${t}_v${r.version}/${n}.es.js`;
914
914
  try {
915
915
  return new (await (import(
916
916
  /* @vite-ignore */
@@ -927,7 +927,7 @@ async function Ke(e, t) {
927
927
  }
928
928
  //#endregion
929
929
  //#region src/encoding/index.ts
930
- var qe = {
930
+ var Je = {
931
931
  arabic: {
932
932
  id: "arabic",
933
933
  label: {
@@ -1075,7 +1075,7 @@ var qe = {
1075
1075
  es: "Occidental"
1076
1076
  }
1077
1077
  }
1078
- }, Je = {
1078
+ }, Ye = {
1079
1079
  ascii: {
1080
1080
  id: "ascii",
1081
1081
  groupId: null,
@@ -1506,16 +1506,16 @@ var qe = {
1506
1506
  groupId: "baltic",
1507
1507
  decoderId: "windows-1257"
1508
1508
  }
1509
- }, W = qe, G = Je;
1510
- function K(e) {
1511
- return Object.hasOwn(G, e);
1509
+ }, U = Je, W = Ye;
1510
+ function G(e) {
1511
+ return Object.hasOwn(W, e);
1512
1512
  }
1513
- function Ye(e) {
1514
- return K(e) ? G[e].decoderId ?? e : e;
1513
+ function Xe(e) {
1514
+ return G(e) ? W[e].decoderId ?? e : e;
1515
1515
  }
1516
- function Xe(e = "en") {
1517
- return Array.from(Object.values(G), ({ decoderId: t, groupId: n, id: r }) => {
1518
- let i = n == null ? "" : Ze(n, e);
1516
+ function Ze(e = "en") {
1517
+ return Array.from(Object.values(W), ({ decoderId: t, groupId: n, id: r }) => {
1518
+ let i = n == null ? "" : Qe(n, e);
1519
1519
  return {
1520
1520
  id: r,
1521
1521
  groupLabel: i,
@@ -1525,13 +1525,13 @@ function Xe(e = "en") {
1525
1525
  };
1526
1526
  }).toSorted((t, n) => t.groupLabel.localeCompare(n.groupLabel, e) || t.label.localeCompare(n.label, e));
1527
1527
  }
1528
- function Ze(e, t) {
1529
- let n = W[e].label;
1528
+ function Qe(e, t) {
1529
+ let n = U[e].label;
1530
1530
  return n[t] ?? n.en ?? e;
1531
1531
  }
1532
1532
  //#endregion
1533
1533
  //#region src/locale/index.ts
1534
- function Qe(e, t) {
1534
+ function $e(e, t) {
1535
1535
  return {
1536
1536
  ...e,
1537
1537
  label: e.label[t] ?? e.id,
@@ -1539,7 +1539,7 @@ function Qe(e, t) {
1539
1539
  verb: e.verb?.[t] ?? void 0
1540
1540
  };
1541
1541
  }
1542
- function $e(e, t, n = !1) {
1542
+ function et(e, t, n = !1) {
1543
1543
  let r = e.map((e) => ({
1544
1544
  ...e,
1545
1545
  label: e.label[t] ?? e.id,
@@ -1548,7 +1548,7 @@ function $e(e, t, n = !1) {
1548
1548
  }));
1549
1549
  return n ? r.toSorted((e, t) => e.label.localeCompare(t.label) || e.id.localeCompare(t.id)) : r;
1550
1550
  }
1551
- function et(e, t) {
1551
+ function tt(e, t) {
1552
1552
  return {
1553
1553
  ...e,
1554
1554
  label: e.label[t] ?? e.id,
@@ -1557,13 +1557,105 @@ function et(e, t) {
1557
1557
  }
1558
1558
  //#endregion
1559
1559
  //#region src/utilities/index.ts
1560
- var q = "en", J = [
1560
+ var nt = new Set(Object.values({
1561
+ archives: [
1562
+ "7z",
1563
+ "bz2",
1564
+ "gz",
1565
+ "rar",
1566
+ "tar",
1567
+ "tgz",
1568
+ "xz",
1569
+ "zip"
1570
+ ],
1571
+ audio: [
1572
+ "aac",
1573
+ "flac",
1574
+ "m4a",
1575
+ "mp3",
1576
+ "ogg",
1577
+ "wav"
1578
+ ],
1579
+ documents: [
1580
+ "doc",
1581
+ "docx",
1582
+ "key",
1583
+ "numbers",
1584
+ "odp",
1585
+ "odt",
1586
+ "pages",
1587
+ "pdf",
1588
+ "ppt",
1589
+ "pptx",
1590
+ "rtf"
1591
+ ],
1592
+ images: [
1593
+ "bmp",
1594
+ "gif",
1595
+ "heic",
1596
+ "ico",
1597
+ "jpeg",
1598
+ "jpg",
1599
+ "png",
1600
+ "psd",
1601
+ "svg",
1602
+ "tif",
1603
+ "tiff",
1604
+ "webp"
1605
+ ],
1606
+ programs: [
1607
+ "app",
1608
+ "bin",
1609
+ "dll",
1610
+ "dmg",
1611
+ "exe",
1612
+ "iso",
1613
+ "msi",
1614
+ "so"
1615
+ ],
1616
+ unreadDataFormats: [
1617
+ "arrow",
1618
+ "avro",
1619
+ "db",
1620
+ "ods",
1621
+ "parquet",
1622
+ "por",
1623
+ "sav",
1624
+ "sqlite",
1625
+ "xls",
1626
+ "xlsm",
1627
+ "xlsx",
1628
+ "xltm",
1629
+ "xltx"
1630
+ ],
1631
+ video: [
1632
+ "avi",
1633
+ "m4v",
1634
+ "mkv",
1635
+ "mov",
1636
+ "mp4",
1637
+ "webm",
1638
+ "wmv"
1639
+ ]
1640
+ }).flat()), K = /* @__PURE__ */ new Map([
1641
+ ["bin", "application/octet-stream"],
1642
+ ["csv", "text/csv"],
1643
+ ["json", "application/json"],
1644
+ ["md", "text/markdown"],
1645
+ ["spss", "application/octet-stream"],
1646
+ ["tab", "text/tab-separated-values"],
1647
+ ["tsv", "text/tab-separated-values"],
1648
+ ["txt", "text/plain"],
1649
+ ["xls", "application/vnd.ms-excel"],
1650
+ ["xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
1651
+ ["xml", "application/xml"]
1652
+ ]), q = "en", J = [
1561
1653
  ["day", 864e5],
1562
1654
  ["hour", 36e5],
1563
1655
  ["minute", 6e4],
1564
1656
  ["second", 1e3],
1565
1657
  ["millisecond", 1]
1566
- ], tt = [
1658
+ ], rt = [
1567
1659
  ["byte", 1],
1568
1660
  ["kilobyte", 1024],
1569
1661
  ["megabyte", 1048576],
@@ -1580,18 +1672,18 @@ function Z(e, t = 2, n = t, r = q) {
1580
1672
  useGrouping: !0
1581
1673
  }).format(e);
1582
1674
  }
1583
- function nt(e, t = q) {
1675
+ function it(e, t = q) {
1584
1676
  return Z(e, 0, 0, t);
1585
1677
  }
1586
- function rt(e, t = 1, n = q) {
1678
+ function at(e, t = 1, n = q) {
1587
1679
  return e == null || !Number.isFinite(e) ? "" : $(n, {
1588
1680
  maximumFractionDigits: t,
1589
1681
  notation: "compact"
1590
1682
  }).format(e);
1591
1683
  }
1592
- function it(e, t = 1, n = q) {
1684
+ function ot(e, t = 1, n = q) {
1593
1685
  if (e == null || !Number.isFinite(e)) return "";
1594
- let [r, i] = tt.find(([, n]) => dt(Math.abs(e) / n, n === 1 ? 0 : t) < 1024) ?? ["terabyte", 1099511627776];
1686
+ let [r, i] = rt.find(([, n]) => ht(Math.abs(e) / n, n === 1 ? 0 : t) < 1024) ?? ["terabyte", 1099511627776];
1595
1687
  return $(n, {
1596
1688
  maximumFractionDigits: i === 1 ? 0 : t,
1597
1689
  style: "unit",
@@ -1599,7 +1691,7 @@ function it(e, t = 1, n = q) {
1599
1691
  unitDisplay: i === 1 ? "long" : "short"
1600
1692
  }).format(e / i);
1601
1693
  }
1602
- function at(e, t = "millisecond", n = q) {
1694
+ function st(e, t = "millisecond", n = q) {
1603
1695
  if (e == null || !Number.isFinite(e)) return "";
1604
1696
  let r = Math.round(Math.abs(e)), i = J.findIndex(([, e]) => r >= e), a = i === -1 ? J.length - 1 : i, o = J.findIndex(([e]) => e === t), s = J.slice(a, Math.max(o, a) + 1), c = [];
1605
1697
  for (let [t, i] of s) {
@@ -1613,29 +1705,28 @@ function at(e, t = "millisecond", n = q) {
1613
1705
  unitDisplay: "short"
1614
1706
  }).format(o));
1615
1707
  }
1616
- return ut(n).format(c);
1708
+ return mt(n).format(c);
1617
1709
  }
1618
- function ot(e) {
1710
+ function ct(e) {
1619
1711
  if (!e) return;
1620
1712
  let t = Q(e);
1621
1713
  return t === void 0 ? e : e.slice(0, t);
1622
1714
  }
1623
- function st(e) {
1715
+ function lt(e) {
1624
1716
  if (!e) return;
1625
1717
  let t = Q(e);
1626
1718
  return t === void 0 ? void 0 : e.slice(t + 1);
1627
1719
  }
1628
- function ct(e) {
1629
- switch (e?.toLowerCase()) {
1630
- case "csv": return "text/csv";
1631
- case "tab":
1632
- case "tsv": return "text/tab-separated-values";
1633
- case "xls": return "application/vnd.ms-excel";
1634
- case "xlsx": return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
1635
- default: return "application/octet-stream";
1636
- }
1720
+ function ut(e) {
1721
+ return e != null && nt.has(e.toLowerCase());
1637
1722
  }
1638
- function lt(e) {
1723
+ function dt(e) {
1724
+ return e != null && K.has(e.toLowerCase());
1725
+ }
1726
+ function ft(e) {
1727
+ return (e == null ? void 0 : K.get(e.toLowerCase())) ?? "application/octet-stream";
1728
+ }
1729
+ function pt(e) {
1639
1730
  switch (e) {
1640
1731
  case "Edm.Boolean": return "boolean";
1641
1732
  case "Edm.Byte":
@@ -1660,7 +1751,7 @@ function Q(e) {
1660
1751
  let t = e.lastIndexOf("/") + 1, n = e.lastIndexOf(".");
1661
1752
  return n > t && n < e.length - 1 ? n : void 0;
1662
1753
  }
1663
- function ut(e) {
1754
+ function mt(e) {
1664
1755
  let t = Y.get(e);
1665
1756
  return t || (t = new Intl.ListFormat(e, {
1666
1757
  style: "narrow",
@@ -1671,9 +1762,9 @@ function $(e, t) {
1671
1762
  let n = `${e}|${JSON.stringify(t)}`, r = X.get(n);
1672
1763
  return r || (r = new Intl.NumberFormat(e, t), X.set(n, r)), r;
1673
1764
  }
1674
- function dt(e, t) {
1765
+ function ht(e, t) {
1675
1766
  let n = 10 ** t;
1676
1767
  return Math.round(e * n) / n;
1677
1768
  }
1678
1769
  //#endregion
1679
- export { I as APIError, F as AppError, R as ConnectorError, e as DEFAULT_LOCALE_ID, W as ENCODING_GROUP_CONFIG_MAP, G as ENCODING_TYPE_CONFIG_MAP, L as EngineError, z as FetchError, le as ORDERED_VALUE_DELIMITER_IDS, t as SUPPORTED_LANGUAGES, Me as buildFetchError, oe as componentInstanceConfigSchema, Ne as concatenateSerialisedErrorMessages, _e as connectorConfigSchema, we as constructConnectorCategoryConfig, Te as constructConnectorItemTypeConfig, Ee as constructConnectorUsageConfig, lt as convertODataTypeIdToUsageTypeId, ke as cookbookConfigSchema, n as createLabelMap, Ce as determineConnectorUsageId, st as extractExtensionFromPath, ot as extractPathWithoutExtension, Z as formatNumberAsDecimalNumber, at as formatNumberAsDuration, rt as formatNumberAsSize, it as formatNumberAsStorageSize, nt as formatNumberAsWholeNumber, ce as getComponentStatus, De as getConnectorActionsTable, Xe as getEncodingTypeConfigs, Pe as ignoreErrors, K as isEncodingTypeId, We as loadPresenter, Ke as loadTool, Qe as localiseConfig, $e as localiseConfigs, et as localiseReference, ct as lookupMimeTypeForExtension, B as normalizeToError, He as presenterConfigSchema, Ye as resolveDecoderId, r as resolveLabel, Fe as serialiseError, Ie as unserialiseError };
1770
+ export { I as APIError, F as AppError, R as ConnectorError, e as DEFAULT_LOCALE_ID, U as ENCODING_GROUP_CONFIG_MAP, W as ENCODING_TYPE_CONFIG_MAP, L as EngineError, z as FetchError, le as ORDERED_VALUE_DELIMITER_IDS, t as SUPPORTED_LANGUAGES, Me as buildFetchError, oe as componentInstanceConfigSchema, Ne as concatenateSerialisedErrorMessages, _e as connectorConfigSchema, we as constructConnectorCategoryConfig, Te as constructConnectorItemTypeConfig, Ee as constructConnectorUsageConfig, pt as convertODataTypeIdToUsageTypeId, ke as cookbookConfigSchema, n as createLabelMap, Ce as determineConnectorUsageId, lt as extractExtensionFromPath, ct as extractPathWithoutExtension, Z as formatNumberAsDecimalNumber, st as formatNumberAsDuration, at as formatNumberAsSize, ot as formatNumberAsStorageSize, it as formatNumberAsWholeNumber, ce as getComponentStatus, De as getConnectorActionsTable, Ze as getEncodingTypeConfigs, dt as hasMimeTypeForExtension, Pe as ignoreErrors, G as isEncodingTypeId, ut as isUnsupportedFileExtension, Ge as loadPresenter, qe as loadTool, $e as localiseConfig, et as localiseConfigs, tt as localiseReference, ft as lookupMimeTypeForExtension, B as normalizeToError, Ue as presenterConfigSchema, Xe as resolveDecoderId, r as resolveLabel, Fe as serialiseError, Ie as unserialiseError };