@dpuse/dpuse-shared 1.0.183 → 1.0.185

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
@@ -270,16 +270,16 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
270
270
 
271
271
  | Chunk/Module/File | Composition |
272
272
  | :-------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------- |
273
- | **dist/dpuse-shared.es.js** | 72.0 kB · gzip 19.1 kB · 100.0% of the build |
274
- |     src → index.ts + 13 more | `████████████████░░░░` 79.4% · 57.2 kB |
275
- |         ↳ index.ts | `▒▒▒▒▒▒▒▒░░░░░░░░░░░░` 41.1% · 29.6 kB |
276
- |         ↳ dataFormatIcons.ts | `▒▒▒▒▒░░░░░░░░░░░░░░░` 23.4% · 16.8 kB |
273
+ | **dist/dpuse-shared.es.js** | 71.6 kB · gzip 19.0 kB · 100.0% of the build |
274
+ |     src → index.ts + 13 more | `████████████████░░░░` 79.7% · 57.1 kB |
275
+ |         ↳ index.ts | `▒▒▒▒▒▒▒▒░░░░░░░░░░░░` 41.3% · 29.6 kB |
276
+ |         ↳ dataFormatIcons.ts | `▒▒▒▒▒░░░░░░░░░░░░░░░` 23.5% · 16.8 kB |
277
277
  |         ↳ objectParsing.ts | `▒░░░░░░░░░░░░░░░░░░░` 7.1% · 5.1 kB |
278
278
  |         ↳ delimitedText.ts | `░░░░░░░░░░░░░░░░░░░░` 2.2% · 1.6 kB |
279
279
  |         ↳ connectorConfig.schema.ts | `░░░░░░░░░░░░░░░░░░░░` 1.8% · 1.3 kB |
280
280
  |         ↳ 9 smaller files | `▒░░░░░░░░░░░░░░░░░░░` 3.8% · 2.7 kB |
281
- |     valibot → dist/index.mjs | `██░░░░░░░░░░░░░░░░░░` 10.5% · 7.6 kB |
282
- |     (bundler output, whitespace & JSON) | `██░░░░░░░░░░░░░░░░░░` 10.0% · 7.2 kB |
281
+ |     valibot → dist/index.mjs | `██░░░░░░░░░░░░░░░░░░` 10.6% · 7.6 kB |
282
+ |     (bundler output, whitespace & JSON) | `██░░░░░░░░░░░░░░░░░░` 9.7% · 6.9 kB |
283
283
 
284
284
  Bars show each row's share of its output file. ↳ rows are part of the row above.
285
285
 
@@ -1,4 +1,4 @@
1
- //#region src/locale/label.ts
1
+ // src/locale/label.ts
2
2
  var e = "en", t = [{
3
3
  id: "en",
4
4
  flag: "gb",
@@ -15,8 +15,7 @@ function r(e, t, n = "en") {
15
15
  let r = e.get(t);
16
16
  return r === void 0 ? n === t ? void 0 : e.get(n) : r;
17
17
  }
18
- //#endregion
19
- //#region node_modules/valibot/dist/index.mjs
18
+ // node_modules/valibot/dist/index.mjs
20
19
  var i = {
21
20
  lang: void 0,
22
21
  message: void 0,
@@ -253,7 +252,7 @@ function x(e, t, n) {
253
252
  break;
254
253
  }
255
254
  }
256
- (!a.typed || !o.typed) && (e.typed = !1), a.typed && (e.value[a.value] = o.value);
255
+ a.typed && o.typed || (e.typed = !1), a.typed && (e.value[a.value] = o.value);
257
256
  }
258
257
  } else s(this, "type", e, t);
259
258
  return e;
@@ -391,14 +390,13 @@ function te(...e) {
391
390
  t.typed = !1;
392
391
  break;
393
392
  }
394
- (!t.issues || !n.abortEarly && !n.abortPipeEarly) && (t = r["~run"](t, n));
393
+ t.issues && (n.abortEarly || n.abortPipeEarly) || (t = r["~run"](t, n));
395
394
  }
396
395
  return t;
397
396
  }
398
397
  });
399
398
  }
400
- //#endregion
401
- //#region src/locale/locale.schema.ts
399
+ // src/locale/locale.schema.ts
402
400
  var T = /* @__PURE__ */ S({
403
401
  en: /* @__PURE__ */ C(),
404
402
  es: /* @__PURE__ */ C()
@@ -509,8 +507,7 @@ function fe(e, t = "en") {
509
507
  label: e
510
508
  };
511
509
  }
512
- //#endregion
513
- //#region src/component/dataView/dataFormatIcons.ts
510
+ // src/component/dataView/dataFormatIcons.ts
514
511
  var pe = {
515
512
  arrow: {
516
513
  icon: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1350 1181.25\"><polygon fill=\"#000\" points=\"168.75,168.75 590.62,590.62 168.75,1012.5 168.75,843.75 421.88,590.62 168.75,337.5\"/><polygon fill=\"#000\" points=\"464.06,168.75 885.94,590.62 464.06,1012.5 464.06,843.75 717.19,590.62 464.06,337.5\"/><polygon fill=\"#000\" points=\"759.38,168.75 1181.25,590.62 759.38,1012.5 759.38,843.75 1012.5,590.62 759.38,337.5\"/></svg>",
@@ -561,8 +558,7 @@ var pe = {
561
558
  iconDark: null
562
559
  }
563
560
  };
564
- //#endregion
565
- //#region src/component/dataView/index.ts
561
+ // src/component/dataView/index.ts
566
562
  n({ en: "Arrow" }), n({ en: "Avro" }), n({ en: "Delimited text (CSV, TSV…)" }), n({ en: "JSON" }), n({ en: "JSON Lines (JSONL)" }), n({ en: "Markdown (MD)" }), n({ en: "OpenDocument spreadsheet (ODS)" }), n({ en: "Parquet" }), n({ en: "SPSS (SAV)" }), n({ en: "SQLite" }), n({ en: "Excel (XLSX, XLSM)" }), n({ en: "XML" });
567
563
  var me = [
568
564
  ",",
@@ -584,8 +580,7 @@ n({ en: "Newline" }), n({ en: "Carriage Return" }), n({ en: "Carriage Return/New
584
580
  "presenter",
585
581
  "tool"
586
582
  ]);
587
- //#endregion
588
- //#region src/component/module/moduleConfig.schema.ts
583
+ // src/component/module/moduleConfig.schema.ts
589
584
  var D = {
590
585
  ...le,
591
586
  vendorAccountURL: /* @__PURE__ */ v(/* @__PURE__ */ C()),
@@ -594,8 +589,7 @@ var D = {
594
589
  version: /* @__PURE__ */ C()
595
590
  };
596
591
  ({ ...D });
597
- //#endregion
598
- //#region src/component/module/connector/connectorConfig.schema.ts
592
+ // src/component/module/connector/connectorConfig.schema.ts
599
593
  var he = E([
600
594
  "abortOperation",
601
595
  "auditObjectContent",
@@ -1625,8 +1619,7 @@ function Ee(e, t) {
1625
1619
  let n = O[e].label;
1626
1620
  return n[t] ?? n.en ?? e;
1627
1621
  }
1628
- //#endregion
1629
- //#region src/errors/index.ts
1622
+ // src/errors/index.ts
1630
1623
  var M = 2048, N = "[REDACTED]", De = 10, Oe = /api[-_]?key|authori[sz]ation|cookie|credential|passw(?:or)?d|private[-_]?key|secret|token/i, ke = [
1631
1624
  [/\b(Bearer|Basic) +[\w.~+/=-]+/gi, (e, t) => `${t} ${N}`],
1632
1625
  [/(?<![\w-])([\w-]+)(["']?[ \t]*[:=][ \t]*["']?)([^\s"'&,;}?#]+)/g, (e, t, n, r) => Oe.test(t) && !/^(?:Basic|Bearer)$/i.test(r) ? `${t}${n}${N}` : e],
@@ -1793,8 +1786,7 @@ var Ue = /* @__PURE__ */ S({ dataFormatIds: /* @__PURE__ */ te(/* @__PURE__ */ h
1793
1786
  actionNames: /* @__PURE__ */ b(We),
1794
1787
  parser: /* @__PURE__ */ b(Ue)
1795
1788
  });
1796
- //#endregion
1797
- //#region src/component/module/tool/delimitedText.ts
1789
+ // src/component/module/tool/delimitedText.ts
1798
1790
  async function Ke(e, t, n) {
1799
1791
  let r = qe(e), { issues: i, parsedRecords: a, valueDelimiterId: o } = await Je(e, t.valueDelimiterIds, t.isComplete, n);
1800
1792
  return {
@@ -1855,8 +1847,7 @@ function B(e) {
1855
1847
  let [n = 0, r = 0] = [...t].toSorted((e, t) => t[1] - e[1])[0] ?? [];
1856
1848
  return n > 1 && r * 2 > e.length;
1857
1849
  }
1858
- //#endregion
1859
- //#region src/component/module/tool/index.ts
1850
+ // src/component/module/tool/index.ts
1860
1851
  var Ze = "https://engine-eu.dpuse.app/tools", Qe = { dtv: "dpuse-tool-rust-csv-core-parser" }, V = "dpuse-tool-";
1861
1852
  function H(e, t) {
1862
1853
  return e.filter((e) => e.parser?.dataFormatIds.some((e) => e === t) === !0).toSorted((e, t) => e.id.localeCompare(t.id, "en"));
@@ -1897,8 +1888,7 @@ async function W(e, t) {
1897
1888
  throw new F(`Failed to load tool '${n}' v${r.version}.`, "dpuse-shared.component.module.tool.loadTool", t, { cause: e });
1898
1889
  }
1899
1890
  }
1900
- //#endregion
1901
- //#region src/component/module/connector/objectParsing.ts
1891
+ // src/component/module/connector/objectParsing.ts
1902
1892
  var $e = "\n", G = ",", et = 13, K = 10, tt = 34, q = 1048576;
1903
1893
  async function nt(e) {
1904
1894
  let { asAt: t, filePreview: n, inferDataTypes: r, parserId: i, startedAt: a, toolConfigs: o, valueDelimiterId: s } = e, { dataFormatId: c, text: l } = n, u = n.bytes.length;
@@ -1906,13 +1896,12 @@ async function nt(e) {
1906
1896
  contentAuditConfig: J({
1907
1897
  asAt: t,
1908
1898
  columns: [],
1909
- hasHeaders: !1,
1910
1899
  isComplete: !0,
1911
1900
  recordCount: 0,
1912
1901
  size: u,
1913
1902
  startedAt: a
1914
1903
  }),
1915
- previewConfig: {
1904
+ sampleConfig: {
1916
1905
  issues: [{
1917
1906
  id: "empty",
1918
1907
  lineNumber: void 0,
@@ -1923,7 +1912,7 @@ async function nt(e) {
1923
1912
  size: 0,
1924
1913
  text: void 0
1925
1914
  },
1926
- readConfig: {
1915
+ readingConfig: {
1927
1916
  dataFormatId: "dtv",
1928
1917
  encodingConfidenceLevel: void 0,
1929
1918
  encodingId: void 0,
@@ -1937,19 +1926,18 @@ async function nt(e) {
1937
1926
  contentAuditConfig: J({
1938
1927
  asAt: t,
1939
1928
  columns: [],
1940
- hasHeaders: !1,
1941
1929
  isComplete: n.isComplete,
1942
1930
  recordCount: 0,
1943
1931
  size: u,
1944
1932
  startedAt: a
1945
1933
  }),
1946
- previewConfig: {
1934
+ sampleConfig: {
1947
1935
  issues: [],
1948
1936
  parsedRecords: [],
1949
1937
  size: u,
1950
1938
  text: l
1951
1939
  },
1952
- readConfig: {
1940
+ readingConfig: {
1953
1941
  dataFormatId: c ?? "unknown",
1954
1942
  encodingConfidenceLevel: n.encodingConfidenceLevel,
1955
1943
  encodingId: n.encodingId,
@@ -1972,19 +1960,18 @@ async function nt(e) {
1972
1960
  contentAuditConfig: J({
1973
1961
  asAt: t,
1974
1962
  columns: _.columnConfigs,
1975
- hasHeaders: _.hasHeaderRow,
1976
1963
  isComplete: n.isComplete,
1977
1964
  recordCount: Math.max(0, g.parsedRecords.length - +!!_.hasHeaderRow),
1978
1965
  size: u,
1979
1966
  startedAt: a
1980
1967
  }),
1981
- previewConfig: {
1968
+ sampleConfig: {
1982
1969
  issues: g.issues,
1983
1970
  parsedRecords: g.parsedRecords,
1984
1971
  size: u,
1985
1972
  text: l
1986
1973
  },
1987
- readConfig: {
1974
+ readingConfig: {
1988
1975
  dataFormatId: c,
1989
1976
  encodingConfidenceLevel: n.encodingConfidenceLevel,
1990
1977
  encodingId: n.encodingId,
@@ -2017,34 +2004,35 @@ async function it(e) {
2017
2004
  l.auditRecords(t), n(t.length, f.byteCount());
2018
2005
  }), { columnConfigs: m, hasHeaders: h } = l.completeAudit();
2019
2006
  return {
2020
- asAt: s,
2021
- byteCount: f.byteCount(),
2022
- columns: m,
2023
- commentLineCount: p.commentLineCount,
2024
- duration: performance.now() - c,
2025
- emptyLineCount: p.emptyLineCount,
2026
- hasHeaders: h,
2027
- invalidFieldLengthCount: p.nonUniformRecordCount,
2028
- isComplete: f.isComplete(),
2029
- lineCount: p.lineCount,
2030
- recordCount: Math.max(0, p.recordCount - +!!h),
2031
- sourceWaitDuration: d.waitDuration()
2007
+ contentAuditConfig: {
2008
+ asAt: s,
2009
+ byteCount: f.byteCount(),
2010
+ columns: m,
2011
+ commentLineCount: p.commentLineCount,
2012
+ duration: performance.now() - c,
2013
+ emptyLineCount: p.emptyLineCount,
2014
+ invalidFieldLengthCount: p.nonUniformRecordCount,
2015
+ isComplete: f.isComplete(),
2016
+ lineCount: p.lineCount,
2017
+ recordCount: Math.max(0, p.recordCount - +!!h),
2018
+ sourceWaitDuration: d.waitDuration()
2019
+ },
2020
+ hasHeaders: h
2032
2021
  };
2033
2022
  }
2034
2023
  function J(e) {
2035
- let { asAt: t, columns: n, hasHeaders: r, isComplete: i, recordCount: a, size: o, startedAt: s } = e;
2024
+ let { asAt: t, columns: n, isComplete: r, recordCount: i, size: a, startedAt: o } = e;
2036
2025
  return {
2037
2026
  asAt: t,
2038
- byteCount: o,
2027
+ byteCount: a,
2039
2028
  columns: n,
2040
2029
  commentLineCount: void 0,
2041
- duration: performance.now() - s,
2030
+ duration: performance.now() - o,
2042
2031
  emptyLineCount: void 0,
2043
- hasHeaders: r,
2044
2032
  invalidFieldLengthCount: void 0,
2045
- isComplete: i,
2033
+ isComplete: r,
2046
2034
  lineCount: void 0,
2047
- recordCount: a,
2035
+ recordCount: i,
2048
2036
  sourceWaitDuration: void 0
2049
2037
  };
2050
2038
  }
@@ -2109,8 +2097,7 @@ async function Y(e, t, n) {
2109
2097
  parserId: r.id
2110
2098
  };
2111
2099
  }
2112
- //#endregion
2113
- //#region src/component/module/connector/index.ts
2100
+ // src/component/module/connector/index.ts
2114
2101
  var ct = [
2115
2102
  {
2116
2103
  id: "application",
@@ -2268,8 +2255,7 @@ function vt(e) {
2268
2255
  for (let e of Object.keys(ut)) n += `| ${ut[e]} | ${t.has(e) ? "✓" : ""} |\n`;
2269
2256
  return n;
2270
2257
  }
2271
- //#endregion
2272
- //#region src/component/module/cookbook/cookbookConfig.schema.ts
2258
+ // src/component/module/cookbook/cookbookConfig.schema.ts
2273
2259
  var yt = E(["list"]), bt = /* @__PURE__ */ S({
2274
2260
  ...D,
2275
2261
  typeId: /* @__PURE__ */ _("cookbook"),
@@ -2301,8 +2287,7 @@ async function wt(e, t, n, r) {
2301
2287
  throw new F(`Failed to load presenter '${i}' v${e.version}.`, "dpuse-shared.component.module.presenter.loadPresenter", n, { cause: t });
2302
2288
  }
2303
2289
  }
2304
- //#endregion
2305
- //#region src/locale/index.ts
2290
+ // src/locale/index.ts
2306
2291
  function Tt(e, t) {
2307
2292
  return {
2308
2293
  ...e,
@@ -2327,8 +2312,7 @@ function Dt(e, t) {
2327
2312
  description: e.description[t] ?? e.description.en ?? ""
2328
2313
  };
2329
2314
  }
2330
- //#endregion
2331
- //#region src/utilities/index.ts
2315
+ // src/utilities/index.ts
2332
2316
  var Ot = /* @__PURE__ */ new Map([
2333
2317
  ["arrow", "application/vnd.apache.arrow.file"],
2334
2318
  ["avro", "application/vnd.apache.avro"],
@@ -2464,5 +2448,4 @@ function Ut(e, t) {
2464
2448
  let n = 10 ** t;
2465
2449
  return Math.round(e * n) / n;
2466
2450
  }
2467
- //#endregion
2468
2451
  export { Ae as APIError, F as AppError, Me as ConnectorError, pe as DATA_FORMAT_ICON_CONFIGS, e as DEFAULT_LOCALE_ID, O as ENCODING_GROUP_CONFIG_MAP, k as ENCODING_TYPE_CONFIG_MAP, je as EngineError, I as FetchError, me as ORDERED_VALUE_DELIMITER_IDS, t as SUPPORTED_LANGUAGES, V as TOOL_NAME_PREFIX, it as auditObjectContentWithParser, Ne as buildFetchError, nt as buildPreviewObjectResult, ue as componentInstanceConfigSchema, Pe as concatenateSerialisedErrorMessages, Se as connectorConfigSchema, ht as constructConnectorCategoryConfig, gt as constructConnectorItemTypeConfig, _t as constructConnectorUsageConfig, Bt as convertODataTypeIdToUsageTypeId, bt as cookbookConfigSchema, n as createLabelMap, mt as determineConnectorUsageId, Lt as extractExtensionFromPath, It as extractPathWithoutExtension, jt as formatNumberAsDecimalNumber, Ft as formatNumberAsDuration, Nt as formatNumberAsSize, Pt as formatNumberAsStorageSize, Mt as formatNumberAsWholeNumber, fe as getComponentStatus, vt as getConnectorActionsTable, Te as getEncodingTypeConfigs, Rt as hasMimeTypeForExtension, Fe as ignoreErrors, A as isEncodingTypeId, H as listParserToolConfigs, wt as loadPresenter, W as loadTool, Tt as localiseConfig, Et as localiseConfigs, Dt as localiseReference, zt as lookupMimeTypeForExtension, L as normalizeToError, Ke as parseDelimitedText, St as presenterConfigSchema, j as resolveDecoderId, r as resolveLabel, U as resolveParserToolConfig, rt as retrieveRecordsWithParser, Ie as serialiseError, Ge as toolConfigSchema, Le as unserialiseError };