@dpuse/dpuse-shared 1.0.116 → 1.0.119
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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<!-- OPENING_START -->
|
|
4
4
|
|
|
5
5
|
[](./LICENSE)
|
|
6
|
-
[](https://www.npmjs.com/package/@dpuse/dpuse-shared)
|
|
7
7
|
[](https://github.com/dpuse/dpuse-shared/actions/workflows/ci.yml)
|
|
8
8
|
|
|
9
9
|
Common constants, types and utilities used across DPUse projects.
|
|
@@ -227,7 +227,7 @@ License data is updated each time `npm run document` is run, using [license-chec
|
|
|
227
227
|
|
|
228
228
|
The dependency tree below shows how each package in the table above is reached — direct and transitive — along with its installed version, release date, and update status. A package that does not ship itself, such as one whose parts are bundled separately, is left out and what ships beneath it is shown in its place. Packages flagged ❗ have a newer version available; ⚠️ indicates a package that hasn't been updated in the last 6 months or longer. Neither flag necessarily indicates a problem: we let new releases stabilise before upgrading, and some packages are mature and stable (have limited or no dependencies), so they require no active development.
|
|
229
229
|
|
|
230
|
-
- **[valibot](https://github.com/open-circle/valibot)** 1.5.0 —
|
|
230
|
+
- **[valibot](https://github.com/open-circle/valibot)** 1.5.0 — 1 mth ago: 2026-09-09
|
|
231
231
|
|
|
232
232
|
<!-- DEPENDENCY_LICENSES_END -->
|
|
233
233
|
|
|
@@ -239,19 +239,21 @@ This report is updated with each release, from the bundle the release builds, us
|
|
|
239
239
|
|
|
240
240
|
_Note: Sonda's Vite reports currently exclude CSS files, since Vite does not generate source maps for CSS._
|
|
241
241
|
|
|
242
|
-
| Chunk/Module/File | Composition
|
|
243
|
-
| :-------------------------------------------------------------------------- |
|
|
244
|
-
| **dist/dpuse-shared.es.js** | 35.
|
|
245
|
-
| src
|
|
246
|
-
| ↳ index.ts |
|
|
247
|
-
| ↳ connectorConfig.schema.ts |
|
|
248
|
-
| ↳ componentConfig.schema.ts |
|
|
249
|
-
| ↳ 7 smaller files |
|
|
250
|
-
| valibot → dist/index.mjs |
|
|
251
|
-
| (bundler output, whitespace & JSON) |
|
|
242
|
+
| Chunk/Module/File | Composition |
|
|
243
|
+
| :-------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------- |
|
|
244
|
+
| **dist/dpuse-shared.es.js** | 35.0 kB · gzip 9.3 kB · 100.0% of the build |
|
|
245
|
+
| src → index.ts + 9 more | `█████████████░░░░░░░` 65.6% · 23.0 kB |
|
|
246
|
+
| ↳ index.ts | `▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░` 55.6% · 19.5 kB |
|
|
247
|
+
| ↳ connectorConfig.schema.ts | `▒░░░░░░░░░░░░░░░░░░░` 3.4% · 1.2 kB |
|
|
248
|
+
| ↳ componentConfig.schema.ts | `▒░░░░░░░░░░░░░░░░░░░` 2.6% · 936 B |
|
|
249
|
+
| ↳ 7 smaller files | `▒░░░░░░░░░░░░░░░░░░░` 4.0% · 1.4 kB |
|
|
250
|
+
| valibot → dist/index.mjs | `████░░░░░░░░░░░░░░░░` 20.0% · 7.0 kB |
|
|
251
|
+
| (bundler output, whitespace & JSON) | `███░░░░░░░░░░░░░░░░░` 14.4% · 5.0 kB |
|
|
252
252
|
|
|
253
253
|
Bars show each row's share of its output file. ↳ rows are part of the row above.
|
|
254
254
|
|
|
255
|
+
- n more = the row also holds n more files from the same package or folder, each no larger than the one named. A package can appear under several output files, each holding different files, never the same file twice.
|
|
256
|
+
|
|
255
257
|
(bundler output, whitespace & JSON) = bytes Sonda can't trace to a source file: whitespace (indentation and line breaks), code the bundler generates (region comments, the combined import/export lines, its small runtime helper and wrappers), and imported JSON such as `config.json`, which the bundler doesn't map. The JSON and the generated code are real bytes that ship; the whitespace mostly disappears once compressed.
|
|
256
258
|
|
|
257
259
|
<!-- BUNDLE_END -->
|
|
@@ -303,9 +305,6 @@ This section is updated each time `npm run document` is run. Settings come from
|
|
|
303
305
|
|
|
304
306
|
This project is working towards the [OpenSSF Best Practices](https://www.bestpractices.dev) Passing badge, a self-certification covering security policy, vulnerability reporting, build processes, code quality, and more. Currently the [OpenSSF Scorecard](https://scorecard.dev) provides an independent automated assessment of the project's security practices and is an ongoing area of improvement.
|
|
305
307
|
|
|
306
|
-
> [!NOTE]
|
|
307
|
-
> Apart from the Best Practices badge above, the remaining Scorecard gaps need multi-person review or a pull-request workflow, which this solo-maintained project doesn't use.
|
|
308
|
-
|
|
309
308
|
### Reporting Vulnerabilities
|
|
310
309
|
|
|
311
310
|
Please do not open public GitHub issues for security vulnerabilities. Use [GitHub private vulnerability reporting](https://github.com/dpuse/dpuse-shared/security/advisories/new) instead. See [SECURITY.md](./SECURITY.md) for the full disclosure policy, contact details, and expected response times.
|
package/dist/dpuse-shared.es.js
CHANGED
|
@@ -655,7 +655,7 @@ function xe(e) {
|
|
|
655
655
|
for (let r of e) be.has(r) && (t = !0), ye.has(r) && (n = !0);
|
|
656
656
|
return t && n ? "bidirectional" : t ? "source" : n ? "destination" : "unknown";
|
|
657
657
|
}
|
|
658
|
-
var
|
|
658
|
+
var Se = (e, t = "en") => {
|
|
659
659
|
let i = _e.find((t) => t.id === e);
|
|
660
660
|
return i ? {
|
|
661
661
|
label: r(n(i.label), t) ?? i.id,
|
|
@@ -664,7 +664,7 @@ var j = (e, t = "en") => {
|
|
|
664
664
|
label: e,
|
|
665
665
|
description: ""
|
|
666
666
|
};
|
|
667
|
-
},
|
|
667
|
+
}, Ce = (e, t = "en") => {
|
|
668
668
|
let i = ve.find((t) => t.id === e);
|
|
669
669
|
return i ? {
|
|
670
670
|
label: r(n(i.label), t) ?? i.id,
|
|
@@ -674,7 +674,7 @@ var j = (e, t = "en") => {
|
|
|
674
674
|
description: ""
|
|
675
675
|
};
|
|
676
676
|
};
|
|
677
|
-
function
|
|
677
|
+
function we(e) {
|
|
678
678
|
let t = new Set(e), n = "|Action|Supported|\n";
|
|
679
679
|
n += "|:----|:-------:|\n";
|
|
680
680
|
for (let e of Object.keys(A)) n += `| ${A[e]} | ${t.has(e) ? "✓" : ""} |\n`;
|
|
@@ -682,71 +682,71 @@ function Se(e) {
|
|
|
682
682
|
}
|
|
683
683
|
//#endregion
|
|
684
684
|
//#region src/component/module/cookbook/cookbookConfig.schema.ts
|
|
685
|
-
var
|
|
685
|
+
var Te = T(["list"]), Ee = /* @__PURE__ */ b({
|
|
686
686
|
...k,
|
|
687
687
|
typeId: /* @__PURE__ */ h("cookbook"),
|
|
688
|
-
actionNames: /* @__PURE__ */ p(
|
|
688
|
+
actionNames: /* @__PURE__ */ p(Te),
|
|
689
689
|
recipes: /* @__PURE__ */ p(D)
|
|
690
|
-
}),
|
|
690
|
+
}), De = T([
|
|
691
691
|
"list",
|
|
692
692
|
"render",
|
|
693
693
|
"setColorMode"
|
|
694
|
-
]),
|
|
694
|
+
]), Oe = /* @__PURE__ */ b({
|
|
695
695
|
...k,
|
|
696
696
|
typeId: /* @__PURE__ */ h("presenter"),
|
|
697
|
-
actionNames: /* @__PURE__ */ p(
|
|
697
|
+
actionNames: /* @__PURE__ */ p(De),
|
|
698
698
|
presentations: /* @__PURE__ */ p(D)
|
|
699
|
-
}),
|
|
700
|
-
[/\b(Bearer|Basic) +[\w.~+/=-]+/gi, (e, t) => `${t} ${
|
|
701
|
-
[/(?<![\w-])([\w-]+)(["']?[ \t]*[:=][ \t]*["']?)([^\s"'&,;}?#]+)/g, (e, t, n, r) =>
|
|
702
|
-
[/\beyJ[\w-]+\.[\w-]+\.[\w-]*/g, () =>
|
|
703
|
-
[/\b(?:sk-|xaat-|xapt-|sl\.)[\w-]{16,}/g, () =>
|
|
704
|
-
[/(?<![\w.+-])[\w.+-]+@[\w-]+\.[\w.-]+/g, () =>
|
|
705
|
-
],
|
|
699
|
+
}), j = 2048, M = "[REDACTED]", ke = 10, N = /api[-_]?key|authori[sz]ation|cookie|credential|passw(?:or)?d|private[-_]?key|secret|token/i, Ae = [
|
|
700
|
+
[/\b(Bearer|Basic) +[\w.~+/=-]+/gi, (e, t) => `${t} ${M}`],
|
|
701
|
+
[/(?<![\w-])([\w-]+)(["']?[ \t]*[:=][ \t]*["']?)([^\s"'&,;}?#]+)/g, (e, t, n, r) => N.test(t) && !/^(?:Basic|Bearer)$/i.test(r) ? `${t}${n}${M}` : e],
|
|
702
|
+
[/\beyJ[\w-]+\.[\w-]+\.[\w-]*/g, () => M],
|
|
703
|
+
[/\b(?:sk-|xaat-|xapt-|sl\.)[\w-]{16,}/g, () => M],
|
|
704
|
+
[/(?<![\w.+-])[\w.+-]+@[\w-]+\.[\w.-]+/g, () => M]
|
|
705
|
+
], P = class extends Error {
|
|
706
706
|
data;
|
|
707
707
|
locator;
|
|
708
708
|
constructor(e, t, n, r) {
|
|
709
709
|
super(e, r), this.name = "DPUseError", this.data = n, this.locator = t;
|
|
710
710
|
}
|
|
711
|
-
},
|
|
711
|
+
}, F = class extends P {
|
|
712
712
|
constructor(e, t, n, r) {
|
|
713
713
|
super(e, t, n, r), this.name = "AppError";
|
|
714
714
|
}
|
|
715
|
-
},
|
|
715
|
+
}, I = class extends P {
|
|
716
716
|
constructor(e, t, n, r) {
|
|
717
717
|
super(e, t, n, r), this.name = "APIError";
|
|
718
718
|
}
|
|
719
|
-
},
|
|
719
|
+
}, L = class extends P {
|
|
720
720
|
constructor(e, t, n, r) {
|
|
721
721
|
super(e, t, n, r), this.name = "EngineError";
|
|
722
722
|
}
|
|
723
|
-
},
|
|
723
|
+
}, R = class extends P {
|
|
724
724
|
constructor(e, t, n, r) {
|
|
725
725
|
super(e, t, n, r), this.name = "ConnectorError";
|
|
726
726
|
}
|
|
727
|
-
},
|
|
727
|
+
}, z = class extends P {
|
|
728
728
|
constructor(e, t, n, r) {
|
|
729
729
|
super(e, t, n, r), this.name = "FetchError";
|
|
730
730
|
}
|
|
731
731
|
};
|
|
732
|
-
async function
|
|
732
|
+
async function je(e, t, n) {
|
|
733
733
|
let r = ` - ${e.statusText}`, i = `${t} Response status '${String(e.status)}${e.statusText ? r : ""}' received.`, a;
|
|
734
734
|
try {
|
|
735
735
|
a = await e.text();
|
|
736
736
|
} catch (e) {
|
|
737
|
-
a = `<body unavailable: ${
|
|
737
|
+
a = `<body unavailable: ${B(e).message}>`;
|
|
738
738
|
}
|
|
739
|
-
return new
|
|
739
|
+
return new z(i, n, { body: Re(a) });
|
|
740
740
|
}
|
|
741
|
-
function
|
|
741
|
+
function Me(e) {
|
|
742
742
|
return e.map((e) => e.message).join(" ");
|
|
743
743
|
}
|
|
744
|
-
function
|
|
744
|
+
function Ne(e) {
|
|
745
745
|
try {
|
|
746
746
|
e();
|
|
747
747
|
} catch {}
|
|
748
748
|
}
|
|
749
|
-
function
|
|
749
|
+
function B(e) {
|
|
750
750
|
if (e instanceof Error) return e;
|
|
751
751
|
if (typeof e == "string") return Error(e);
|
|
752
752
|
if (typeof e == "number" || typeof e == "boolean" || typeof e == "bigint") return Error(String(e));
|
|
@@ -758,24 +758,24 @@ function H(e) {
|
|
|
758
758
|
}
|
|
759
759
|
return /* @__PURE__ */ Error("Unknown error");
|
|
760
760
|
}
|
|
761
|
-
function
|
|
762
|
-
let t = /* @__PURE__ */ new Set(), n = [], r =
|
|
761
|
+
function Pe(e) {
|
|
762
|
+
let t = /* @__PURE__ */ new Set(), n = [], r = B(e);
|
|
763
763
|
for (; r != null && !t.has(r);) {
|
|
764
764
|
t.add(r);
|
|
765
|
-
let [e, i] =
|
|
765
|
+
let [e, i] = ze(r), a = Le(e);
|
|
766
766
|
/(?:\.{3}|[.!?])$/.test(a.message) || (a.message += "."), n.push(a), r = i;
|
|
767
767
|
}
|
|
768
768
|
return n;
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function V(e) {
|
|
771
771
|
let t;
|
|
772
772
|
for (let n of e.toReversed()) {
|
|
773
|
-
let e =
|
|
773
|
+
let e = Ie(n, t);
|
|
774
774
|
n.stack !== void 0 && (e.stack = n.stack), t = e;
|
|
775
775
|
}
|
|
776
776
|
return t ?? /* @__PURE__ */ Error("No error to unserialise.");
|
|
777
777
|
}
|
|
778
|
-
function
|
|
778
|
+
function Fe(e) {
|
|
779
779
|
let t;
|
|
780
780
|
try {
|
|
781
781
|
t = JSON.stringify(e);
|
|
@@ -784,13 +784,13 @@ function Pe(e) {
|
|
|
784
784
|
}
|
|
785
785
|
return t === "" && (t = "Unknown error"), t;
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function Ie(e, t) {
|
|
788
788
|
switch (e.name) {
|
|
789
|
-
case "APIError": return new
|
|
790
|
-
case "AppError": return new
|
|
791
|
-
case "ConnectorError": return new
|
|
792
|
-
case "EngineError": return new
|
|
793
|
-
case "FetchError": return new
|
|
789
|
+
case "APIError": return new I(e.message, e.locator, e.data, { cause: t });
|
|
790
|
+
case "AppError": return new F(e.message, e.locator, e.data, { cause: t });
|
|
791
|
+
case "ConnectorError": return new R(e.message, e.locator, e.data, { cause: t });
|
|
792
|
+
case "EngineError": return new L(e.message, e.locator, e.data, { cause: t });
|
|
793
|
+
case "FetchError": return new z(e.message, e.locator, e.data, { cause: t });
|
|
794
794
|
default: {
|
|
795
795
|
let n = e.name;
|
|
796
796
|
return new class extends Error {
|
|
@@ -799,29 +799,29 @@ function Fe(e, t) {
|
|
|
799
799
|
}
|
|
800
800
|
}
|
|
801
801
|
}
|
|
802
|
-
function
|
|
802
|
+
function Le(e) {
|
|
803
803
|
let { data: t, message: n, stack: r } = e;
|
|
804
804
|
return {
|
|
805
805
|
...e,
|
|
806
|
-
data: t === void 0 ? void 0 :
|
|
807
|
-
message:
|
|
808
|
-
stack: r === void 0 ? void 0 :
|
|
806
|
+
data: t === void 0 ? void 0 : U(t, /* @__PURE__ */ new WeakSet(), 0),
|
|
807
|
+
message: H(n),
|
|
808
|
+
stack: r === void 0 ? void 0 : H(r)
|
|
809
809
|
};
|
|
810
810
|
}
|
|
811
|
-
function
|
|
811
|
+
function H(e) {
|
|
812
812
|
let t = e;
|
|
813
|
-
for (let [e, n] of
|
|
813
|
+
for (let [e, n] of Ae) t = t.replaceAll(e, (e, ...t) => n(e, ...t));
|
|
814
814
|
return t;
|
|
815
815
|
}
|
|
816
|
-
function
|
|
817
|
-
return typeof e == "string" ?
|
|
818
|
-
}
|
|
819
|
-
function Le(e) {
|
|
820
|
-
if (e != null && e !== "") return e.length > N ? `${e.slice(0, N)}... [truncated]` : e;
|
|
816
|
+
function U(e, t, n) {
|
|
817
|
+
return typeof e == "string" ? H(e) : typeof e != "object" || !e ? e : n >= ke ? 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)])));
|
|
821
818
|
}
|
|
822
819
|
function Re(e) {
|
|
823
|
-
|
|
824
|
-
|
|
820
|
+
if (e != null && e !== "") return e.length > j ? `${e.slice(0, j)}... [truncated]` : e;
|
|
821
|
+
}
|
|
822
|
+
function ze(e) {
|
|
823
|
+
let t = e.cause == null ? null : B(e.cause);
|
|
824
|
+
if (e instanceof P) return [{
|
|
825
825
|
data: e.data,
|
|
826
826
|
locator: e.locator,
|
|
827
827
|
message: e.message,
|
|
@@ -838,24 +838,24 @@ function Re(e) {
|
|
|
838
838
|
}, t] : [{
|
|
839
839
|
data: n,
|
|
840
840
|
locator: "",
|
|
841
|
-
message:
|
|
841
|
+
message: Fe(e),
|
|
842
842
|
name: "Error",
|
|
843
843
|
stack: void 0
|
|
844
844
|
}, null];
|
|
845
845
|
}
|
|
846
846
|
//#endregion
|
|
847
847
|
//#region src/component/module/tool/index.ts
|
|
848
|
-
var
|
|
849
|
-
async function
|
|
848
|
+
var Be = "https://engine-eu.dpuse.app/tools";
|
|
849
|
+
async function Ve(e, t) {
|
|
850
850
|
let n = `dpuse-tool-${t}`, r = e.find((e) => e.id === n);
|
|
851
851
|
if (!r) {
|
|
852
852
|
let r = {
|
|
853
853
|
availableToolIds: e.map((e) => e.id),
|
|
854
854
|
toolName: n
|
|
855
855
|
};
|
|
856
|
-
throw new
|
|
856
|
+
throw new F(`Tool '${t}' not found.`, "dpuse-shared.component.module.tool.loadTool", r);
|
|
857
857
|
}
|
|
858
|
-
let i = `${
|
|
858
|
+
let i = `${Be}/${t}_v${r.version}/${n}.es.js`;
|
|
859
859
|
try {
|
|
860
860
|
return new (await (import(
|
|
861
861
|
/* @vite-ignore */
|
|
@@ -867,12 +867,12 @@ async function Be(e, t) {
|
|
|
867
867
|
url: i,
|
|
868
868
|
version: r.version
|
|
869
869
|
};
|
|
870
|
-
throw new
|
|
870
|
+
throw new F(`Failed to load tool '${n}' v${r.version}.`, "dpuse-shared.component.module.tool.loadTool", t, { cause: e });
|
|
871
871
|
}
|
|
872
872
|
}
|
|
873
873
|
//#endregion
|
|
874
874
|
//#region src/encoding/index.ts
|
|
875
|
-
var
|
|
875
|
+
var He = {
|
|
876
876
|
arabic: {
|
|
877
877
|
id: "arabic",
|
|
878
878
|
label: {
|
|
@@ -1020,7 +1020,7 @@ var Ve = {
|
|
|
1020
1020
|
es: "Occidental"
|
|
1021
1021
|
}
|
|
1022
1022
|
}
|
|
1023
|
-
},
|
|
1023
|
+
}, Ue = {
|
|
1024
1024
|
ascii: {
|
|
1025
1025
|
id: "ascii",
|
|
1026
1026
|
groupId: null,
|
|
@@ -1451,16 +1451,16 @@ var Ve = {
|
|
|
1451
1451
|
groupId: "baltic",
|
|
1452
1452
|
decoderId: "windows-1257"
|
|
1453
1453
|
}
|
|
1454
|
-
},
|
|
1455
|
-
function
|
|
1456
|
-
return Object.hasOwn(
|
|
1454
|
+
}, W = He, G = Ue;
|
|
1455
|
+
function K(e) {
|
|
1456
|
+
return Object.hasOwn(G, e);
|
|
1457
1457
|
}
|
|
1458
|
-
function
|
|
1459
|
-
return
|
|
1458
|
+
function We(e) {
|
|
1459
|
+
return K(e) ? G[e].decoderId ?? e : e;
|
|
1460
1460
|
}
|
|
1461
|
-
function
|
|
1462
|
-
return Array.from(Object.values(
|
|
1463
|
-
let i = n == null ? "" :
|
|
1461
|
+
function Ge(e = "en") {
|
|
1462
|
+
return Array.from(Object.values(G), ({ decoderId: t, groupId: n, id: r }) => {
|
|
1463
|
+
let i = n == null ? "" : Ke(n, e);
|
|
1464
1464
|
return {
|
|
1465
1465
|
id: r,
|
|
1466
1466
|
groupLabel: i,
|
|
@@ -1470,13 +1470,13 @@ function We(e = "en") {
|
|
|
1470
1470
|
};
|
|
1471
1471
|
}).toSorted((t, n) => t.groupLabel.localeCompare(n.groupLabel, e) || t.label.localeCompare(n.label, e));
|
|
1472
1472
|
}
|
|
1473
|
-
function
|
|
1474
|
-
let n =
|
|
1473
|
+
function Ke(e, t) {
|
|
1474
|
+
let n = W[e].label;
|
|
1475
1475
|
return n[t] ?? n.en ?? e;
|
|
1476
1476
|
}
|
|
1477
1477
|
//#endregion
|
|
1478
1478
|
//#region src/locale/index.ts
|
|
1479
|
-
function
|
|
1479
|
+
function qe(e, t) {
|
|
1480
1480
|
return {
|
|
1481
1481
|
...e,
|
|
1482
1482
|
label: e.label[t] ?? e.id,
|
|
@@ -1484,7 +1484,7 @@ function Ke(e, t) {
|
|
|
1484
1484
|
verb: e.verb?.[t] ?? void 0
|
|
1485
1485
|
};
|
|
1486
1486
|
}
|
|
1487
|
-
function
|
|
1487
|
+
function Je(e, t, n = !1) {
|
|
1488
1488
|
let r = e.map((e) => ({
|
|
1489
1489
|
...e,
|
|
1490
1490
|
label: e.label[t] ?? e.id,
|
|
@@ -1493,7 +1493,7 @@ function J(e, t, n = !1) {
|
|
|
1493
1493
|
}));
|
|
1494
1494
|
return n ? r.toSorted((e, t) => e.label.localeCompare(t.label) || e.id.localeCompare(t.id)) : r;
|
|
1495
1495
|
}
|
|
1496
|
-
function
|
|
1496
|
+
function Ye(e, t) {
|
|
1497
1497
|
return {
|
|
1498
1498
|
...e,
|
|
1499
1499
|
label: e.label[t] ?? e.id,
|
|
@@ -1502,103 +1502,75 @@ function qe(e, t) {
|
|
|
1502
1502
|
}
|
|
1503
1503
|
//#endregion
|
|
1504
1504
|
//#region src/utilities/index.ts
|
|
1505
|
-
var
|
|
1506
|
-
[
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
]
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
],
|
|
1516
|
-
[
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
],
|
|
1521
|
-
[
|
|
1522
|
-
"secs",
|
|
1523
|
-
1e3,
|
|
1524
|
-
(e) => e === 1 ? "1 sec" : `${$(e)} secs`
|
|
1525
|
-
],
|
|
1526
|
-
[
|
|
1527
|
-
"ms",
|
|
1528
|
-
0,
|
|
1529
|
-
(e) => `${$(e)} ms`
|
|
1530
|
-
]
|
|
1531
|
-
], X = "en", Z = /* @__PURE__ */ new Map();
|
|
1532
|
-
function Je(e) {
|
|
1533
|
-
switch (e) {
|
|
1534
|
-
case "Edm.Binary": return "unknown";
|
|
1535
|
-
case "Edm.Boolean": return "boolean";
|
|
1536
|
-
case "Edm.Byte": return "wholeNumber";
|
|
1537
|
-
case "Edm.DateTime": return "moment";
|
|
1538
|
-
case "Edm.DateTimeOffset": return "moment";
|
|
1539
|
-
case "Edm.Decimal": return "decimalNumber";
|
|
1540
|
-
case "Edm.Double": return "decimalNumber";
|
|
1541
|
-
case "Edm.Guid": return "string";
|
|
1542
|
-
case "Edm.Int16": return "wholeNumber";
|
|
1543
|
-
case "Edm.Int32": return "wholeNumber";
|
|
1544
|
-
case "Edm.Int64": return "wholeNumber";
|
|
1545
|
-
case "Edm.SByte": return "wholeNumber";
|
|
1546
|
-
case "Edm.Single": return "decimalNumber";
|
|
1547
|
-
case "Edm.String": return "string";
|
|
1548
|
-
case "Edm.Time": return "momentTime";
|
|
1549
|
-
default: return "unknown";
|
|
1550
|
-
}
|
|
1551
|
-
}
|
|
1552
|
-
function Ye(e) {
|
|
1553
|
-
if (e) {
|
|
1554
|
-
let t = e.lastIndexOf("/") + 1, n = e.lastIndexOf(".");
|
|
1555
|
-
return n <= t || n === -1 ? e : e.slice(0, Math.max(0, n));
|
|
1556
|
-
}
|
|
1557
|
-
}
|
|
1558
|
-
function Xe(e) {
|
|
1559
|
-
if (e) {
|
|
1560
|
-
let t = e.lastIndexOf("/") + 1, n = e.lastIndexOf(".");
|
|
1561
|
-
if (n <= t) return;
|
|
1562
|
-
if (n !== -1) return e.slice(Math.max(0, n + 1));
|
|
1563
|
-
}
|
|
1564
|
-
}
|
|
1565
|
-
function Q(e, t = 2, n = t, r = X) {
|
|
1566
|
-
if (e == null) return "";
|
|
1567
|
-
let i = `${r}decimal${String(t)}.${String(n)}`, a = Z.get(i);
|
|
1568
|
-
return a || (a = new Intl.NumberFormat(r, {
|
|
1505
|
+
var q = "en", J = [
|
|
1506
|
+
["day", 864e5],
|
|
1507
|
+
["hour", 36e5],
|
|
1508
|
+
["minute", 6e4],
|
|
1509
|
+
["second", 1e3],
|
|
1510
|
+
["millisecond", 1]
|
|
1511
|
+
], Xe = [
|
|
1512
|
+
["byte", 1],
|
|
1513
|
+
["kilobyte", 1024],
|
|
1514
|
+
["megabyte", 1048576],
|
|
1515
|
+
["gigabyte", 1073741824],
|
|
1516
|
+
["terabyte", 1099511627776]
|
|
1517
|
+
], Y = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map();
|
|
1518
|
+
function Z(e, t = 2, n = t, r = q) {
|
|
1519
|
+
return e == null ? "" : $(r, {
|
|
1569
1520
|
localeMatcher: "best fit",
|
|
1570
1521
|
maximumFractionDigits: t,
|
|
1571
|
-
minimumFractionDigits: n,
|
|
1522
|
+
minimumFractionDigits: Math.min(n, t),
|
|
1572
1523
|
minimumIntegerDigits: 1,
|
|
1573
1524
|
style: "decimal",
|
|
1574
1525
|
useGrouping: !0
|
|
1575
|
-
})
|
|
1526
|
+
}).format(e);
|
|
1576
1527
|
}
|
|
1577
|
-
function Ze(e, t =
|
|
1578
|
-
return
|
|
1528
|
+
function Ze(e, t = q) {
|
|
1529
|
+
return Z(e, 0, 0, t);
|
|
1579
1530
|
}
|
|
1580
|
-
function Qe(e, t = 1) {
|
|
1581
|
-
return e == null
|
|
1531
|
+
function Qe(e, t = 1, n = q) {
|
|
1532
|
+
return e == null || !Number.isFinite(e) ? "" : $(n, {
|
|
1533
|
+
maximumFractionDigits: t,
|
|
1534
|
+
notation: "compact"
|
|
1535
|
+
}).format(e);
|
|
1582
1536
|
}
|
|
1583
|
-
function $e(e, t =
|
|
1584
|
-
if (e == null) return "";
|
|
1585
|
-
let
|
|
1586
|
-
|
|
1587
|
-
|
|
1537
|
+
function $e(e, t = 1, n = q) {
|
|
1538
|
+
if (e == null || !Number.isFinite(e)) return "";
|
|
1539
|
+
let [r, i] = Xe.find(([, n]) => ot(Math.abs(e) / n, n === 1 ? 0 : t) < 1024) ?? ["terabyte", 1099511627776];
|
|
1540
|
+
return $(n, {
|
|
1541
|
+
maximumFractionDigits: i === 1 ? 0 : t,
|
|
1542
|
+
style: "unit",
|
|
1543
|
+
unit: r,
|
|
1544
|
+
unitDisplay: i === 1 ? "long" : "short"
|
|
1545
|
+
}).format(e / i);
|
|
1588
1546
|
}
|
|
1589
|
-
function
|
|
1590
|
-
if (e == null) return "";
|
|
1591
|
-
let
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1547
|
+
function et(e, t = "millisecond", n = q) {
|
|
1548
|
+
if (e == null || !Number.isFinite(e)) return "";
|
|
1549
|
+
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 = [];
|
|
1550
|
+
for (let [t, i] of s) {
|
|
1551
|
+
let a = Math.floor(r / i);
|
|
1552
|
+
if (a === 0 && c.length > 0) continue;
|
|
1553
|
+
r -= a * i;
|
|
1554
|
+
let o = c.length === 0 && e < 0 && a > 0 ? -a : a;
|
|
1555
|
+
c.push($(n, {
|
|
1556
|
+
style: "unit",
|
|
1557
|
+
unit: t,
|
|
1558
|
+
unitDisplay: "short"
|
|
1559
|
+
}).format(o));
|
|
1560
|
+
}
|
|
1561
|
+
return at(n).format(c);
|
|
1562
|
+
}
|
|
1563
|
+
function tt(e) {
|
|
1564
|
+
if (!e) return;
|
|
1565
|
+
let t = Q(e);
|
|
1566
|
+
return t === void 0 ? e : e.slice(0, t);
|
|
1567
|
+
}
|
|
1568
|
+
function nt(e) {
|
|
1569
|
+
if (!e) return;
|
|
1570
|
+
let t = Q(e);
|
|
1571
|
+
return t === void 0 ? void 0 : e.slice(t + 1);
|
|
1600
1572
|
}
|
|
1601
|
-
function
|
|
1573
|
+
function rt(e) {
|
|
1602
1574
|
switch (e?.toLowerCase()) {
|
|
1603
1575
|
case "csv": return "text/csv";
|
|
1604
1576
|
case "tab":
|
|
@@ -1608,5 +1580,45 @@ function et(e) {
|
|
|
1608
1580
|
default: return "application/octet-stream";
|
|
1609
1581
|
}
|
|
1610
1582
|
}
|
|
1583
|
+
function it(e) {
|
|
1584
|
+
switch (e) {
|
|
1585
|
+
case "Edm.Boolean": return "boolean";
|
|
1586
|
+
case "Edm.Byte":
|
|
1587
|
+
case "Edm.Int16":
|
|
1588
|
+
case "Edm.Int32":
|
|
1589
|
+
case "Edm.Int64":
|
|
1590
|
+
case "Edm.SByte": return "wholeNumber";
|
|
1591
|
+
case "Edm.Decimal":
|
|
1592
|
+
case "Edm.Double":
|
|
1593
|
+
case "Edm.Single": return "decimalNumber";
|
|
1594
|
+
case "Edm.Date":
|
|
1595
|
+
case "Edm.DateTime":
|
|
1596
|
+
case "Edm.DateTimeOffset": return "moment";
|
|
1597
|
+
case "Edm.Time":
|
|
1598
|
+
case "Edm.TimeOfDay": return "momentTime";
|
|
1599
|
+
case "Edm.Guid":
|
|
1600
|
+
case "Edm.String": return "string";
|
|
1601
|
+
default: return "unknown";
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
function Q(e) {
|
|
1605
|
+
let t = e.lastIndexOf("/") + 1, n = e.lastIndexOf(".");
|
|
1606
|
+
return n > t && n < e.length - 1 ? n : void 0;
|
|
1607
|
+
}
|
|
1608
|
+
function at(e) {
|
|
1609
|
+
let t = Y.get(e);
|
|
1610
|
+
return t || (t = new Intl.ListFormat(e, {
|
|
1611
|
+
style: "narrow",
|
|
1612
|
+
type: "unit"
|
|
1613
|
+
}), Y.set(e, t)), t;
|
|
1614
|
+
}
|
|
1615
|
+
function $(e, t) {
|
|
1616
|
+
let n = `${e}|${JSON.stringify(t)}`, r = X.get(n);
|
|
1617
|
+
return r || (r = new Intl.NumberFormat(e, t), X.set(n, r)), r;
|
|
1618
|
+
}
|
|
1619
|
+
function ot(e, t) {
|
|
1620
|
+
let n = 10 ** t;
|
|
1621
|
+
return Math.round(e * n) / n;
|
|
1622
|
+
}
|
|
1611
1623
|
//#endregion
|
|
1612
|
-
export {
|
|
1624
|
+
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, je as buildFetchError, oe as componentInstanceConfigSchema, Me as concatenateSerialisedErrorMessages, ge as connectorConfigSchema, Se as constructConnectorCategoryConfig, Ce as constructConnectorUsageConfig, it as convertODataTypeIdToUsageTypeId, Ee as cookbookConfigSchema, n as createLabelMap, xe as determineConnectorUsageId, nt as extractExtensionFromPath, tt as extractPathWithoutExtension, Z as formatNumberAsDecimalNumber, et as formatNumberAsDuration, Qe as formatNumberAsSize, $e as formatNumberAsStorageSize, Ze as formatNumberAsWholeNumber, ce as getComponentStatus, we as getConnectorActionsTable, Ge as getEncodingTypeConfigs, Ne as ignoreErrors, K as isEncodingTypeId, Ve as loadTool, qe as localiseConfig, Je as localiseConfigs, Ye as localiseReference, rt as lookupMimeTypeForExtension, B as normalizeToError, Oe as presenterConfigSchema, We as resolveDecoderId, r as resolveLabel, Pe as serialiseError, V as unserialiseError };
|