@datapos/datapos-shared 0.3.342 → 0.3.348
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 +2 -0
- package/dist/datapos-shared-connector.es.js +610 -0
- package/dist/datapos-shared-errors.es.js +109 -0
- package/dist/datapos-shared.es.js +14 -711
- package/dist/types/src/errors/index.d.ts +68 -48
- package/dist/types/src/index.d.ts +0 -2
- package/dist/types/src/utilities/index.d.ts +1 -1
- package/package.json +10 -4
- package/dist/types/src/component/dataView/OLD_ContentAuditColumn.d.ts +0 -33
- package/dist/types/src/component/dataView/OLD_PreviewColumn.d.ts +0 -5
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
class i extends Error {
|
|
2
|
+
locator;
|
|
3
|
+
/** Logical source of the error. */
|
|
4
|
+
constructor(n, s, r) {
|
|
5
|
+
super(n, r), this.name = new.target.name, this.locator = s;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
class a extends i {
|
|
9
|
+
}
|
|
10
|
+
class g extends a {
|
|
11
|
+
}
|
|
12
|
+
class p extends a {
|
|
13
|
+
}
|
|
14
|
+
class c extends a {
|
|
15
|
+
body;
|
|
16
|
+
/** Sanitized HTTP response body. */
|
|
17
|
+
constructor(n, s, r, t) {
|
|
18
|
+
super(n, s, t), this.name = new.target.name, this.body = E(r ?? void 0);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
class w extends i {
|
|
22
|
+
}
|
|
23
|
+
class m extends a {
|
|
24
|
+
componentName;
|
|
25
|
+
/** Vue component name, if available. */
|
|
26
|
+
info;
|
|
27
|
+
/** Vue error info string. */
|
|
28
|
+
constructor(n, s, r, t, o) {
|
|
29
|
+
super(n, s, o), this.name = new.target.name, this.info = r, this.componentName = t;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
class y extends a {
|
|
33
|
+
}
|
|
34
|
+
class h extends a {
|
|
35
|
+
}
|
|
36
|
+
async function k(e, n, s) {
|
|
37
|
+
const r = ` - ${e.statusText}`, t = `${n} Response status '${e.status}${e.statusText ? r : ""}' received.`;
|
|
38
|
+
let o;
|
|
39
|
+
try {
|
|
40
|
+
o = await e.text();
|
|
41
|
+
} catch (l) {
|
|
42
|
+
o = `<body unavailable: ${f(l).message}>`;
|
|
43
|
+
}
|
|
44
|
+
return new c(t, s, o);
|
|
45
|
+
}
|
|
46
|
+
function b(e) {
|
|
47
|
+
return e.map((n) => n.message).join(" ");
|
|
48
|
+
}
|
|
49
|
+
function f(e) {
|
|
50
|
+
if (e instanceof Error) return e;
|
|
51
|
+
if (typeof e == "string") return new Error(e);
|
|
52
|
+
if (typeof e == "number" || typeof e == "boolean" || typeof e == "bigint") return new Error(String(e));
|
|
53
|
+
if (typeof e == "symbol") return new Error(e.description ?? "Unknown error");
|
|
54
|
+
if (e != null && typeof e == "object")
|
|
55
|
+
try {
|
|
56
|
+
return new Error(JSON.stringify(e));
|
|
57
|
+
} catch {
|
|
58
|
+
return new Error("Unknown error");
|
|
59
|
+
}
|
|
60
|
+
return new Error("Unknown error");
|
|
61
|
+
}
|
|
62
|
+
function x(e) {
|
|
63
|
+
const n = /* @__PURE__ */ new Set(), s = [];
|
|
64
|
+
let r = e;
|
|
65
|
+
for (; r != null && !n.has(r); ) {
|
|
66
|
+
n.add(r);
|
|
67
|
+
let t;
|
|
68
|
+
if (r instanceof c)
|
|
69
|
+
t = { body: r.body, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
|
|
70
|
+
else if (r instanceof m)
|
|
71
|
+
t = { componentName: r.componentName, info: r.info, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
|
|
72
|
+
else if (r instanceof i)
|
|
73
|
+
t = { locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
|
|
74
|
+
else if (r instanceof Error) {
|
|
75
|
+
const o = r;
|
|
76
|
+
t = { locator: "", message: o.message, name: o.name, stack: o.stack }, r = o.cause;
|
|
77
|
+
} else
|
|
78
|
+
t = { locator: "", message: d(r), name: "Error" }, r = void 0;
|
|
79
|
+
/(?:\.{3}|[.!?])$/.test(t.message) || (t.message += "."), s.push(t);
|
|
80
|
+
}
|
|
81
|
+
return s;
|
|
82
|
+
}
|
|
83
|
+
function d(e) {
|
|
84
|
+
let n;
|
|
85
|
+
try {
|
|
86
|
+
n = JSON.stringify(e);
|
|
87
|
+
} catch {
|
|
88
|
+
typeof e == "symbol" ? n = e.description ?? "Unknown error" : typeof e == "bigint" ? n = e.toString() : n = "Unknown error";
|
|
89
|
+
}
|
|
90
|
+
return n === "" && (n = "Unknown error"), n;
|
|
91
|
+
}
|
|
92
|
+
function E(e) {
|
|
93
|
+
if (!(e == null || e === ""))
|
|
94
|
+
return e.length > 2048 ? `${e.slice(0, 2048)}... [truncated]` : e;
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
g as APIError,
|
|
98
|
+
a as ApplicationError,
|
|
99
|
+
p as EngineError,
|
|
100
|
+
c as FetchError,
|
|
101
|
+
w as OperationalError,
|
|
102
|
+
m as VueHandledError,
|
|
103
|
+
h as WindowHandledPromiseRejectionError,
|
|
104
|
+
y as WindowHandledRuntimeError,
|
|
105
|
+
k as buildFetchError,
|
|
106
|
+
b as concatenateSerialisedErrorMessages,
|
|
107
|
+
f as normalizeToError,
|
|
108
|
+
x as serialiseError
|
|
109
|
+
};
|