@datapos/datapos-shared 0.3.184 → 0.3.186
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.
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
const U = ["createObject", "dropObject", "removeRecords", "upsertRecords"], P = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"];
|
|
2
2
|
function B() {
|
|
3
|
-
function e(a,
|
|
4
|
-
|
|
3
|
+
function e(a, t, r) {
|
|
4
|
+
r.textContent = "Cytoscape.js diagram goes here...";
|
|
5
5
|
}
|
|
6
6
|
return { render: e };
|
|
7
7
|
}
|
|
8
8
|
function W() {
|
|
9
|
-
function e(a,
|
|
10
|
-
|
|
9
|
+
function e(a, t, r) {
|
|
10
|
+
r.textContent = "values table goes here...";
|
|
11
11
|
}
|
|
12
12
|
return { render: e };
|
|
13
13
|
}
|
|
14
|
-
const A = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/",
|
|
14
|
+
const A = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", x = "highcharts";
|
|
15
15
|
let b, R = !1;
|
|
16
16
|
function H() {
|
|
17
17
|
async function e(n, s, m, h) {
|
|
18
|
-
await
|
|
18
|
+
await r();
|
|
19
19
|
const l = [];
|
|
20
20
|
for (const c of s.data.measures)
|
|
21
21
|
l.push({ type: n.options.highchartsType, name: c.name, data: c.data });
|
|
@@ -27,10 +27,10 @@ function H() {
|
|
|
27
27
|
xAxis: { categories: s.data.categoryLabels },
|
|
28
28
|
yAxis: { title: { text: s.data.name } }
|
|
29
29
|
}, u = b.chart(m, p, h);
|
|
30
|
-
return { chart: u, resize: () => u.reflow(), vendorId:
|
|
30
|
+
return { chart: u, resize: () => u.reflow(), vendorId: x };
|
|
31
31
|
}
|
|
32
32
|
async function a(n, s, m, h) {
|
|
33
|
-
await Promise.all([
|
|
33
|
+
await Promise.all([r(), o()]);
|
|
34
34
|
const l = [];
|
|
35
35
|
for (const c of s.data.measures)
|
|
36
36
|
l.push({ type: n.options.highchartsType, name: c.name, data: c.data });
|
|
@@ -42,10 +42,10 @@ function H() {
|
|
|
42
42
|
xAxis: { categories: s.data.categoryLabels },
|
|
43
43
|
yAxis: { title: { text: s.data.name } }
|
|
44
44
|
}, u = b.chart(m, p, h);
|
|
45
|
-
return { chart: u, resize: () => u.reflow(), vendorId:
|
|
45
|
+
return { chart: u, resize: () => u.reflow(), vendorId: x };
|
|
46
46
|
}
|
|
47
|
-
async function
|
|
48
|
-
await Promise.all([
|
|
47
|
+
async function t(n, s, m, h) {
|
|
48
|
+
await Promise.all([r(), o()]);
|
|
49
49
|
const l = [], p = [];
|
|
50
50
|
for (let f = 0; f < s.data.measures[0].data.length; f++)
|
|
51
51
|
p.push([s.data.measures[0].data[f][0], s.data.measures[1].data[f][0]]);
|
|
@@ -58,9 +58,9 @@ function H() {
|
|
|
58
58
|
xAxis: { categories: s.data.categoryLabels },
|
|
59
59
|
yAxis: { title: { text: s.data.name } }
|
|
60
60
|
}, c = b.chart(m, u, h);
|
|
61
|
-
return { chart: c, resize: () => c.reflow(), vendorId:
|
|
61
|
+
return { chart: c, resize: () => c.reflow(), vendorId: x };
|
|
62
62
|
}
|
|
63
|
-
async function
|
|
63
|
+
async function r() {
|
|
64
64
|
if (b) return;
|
|
65
65
|
const n = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", s = `${n}highcharts.src.js`, m = `${n}modules/accessibility.src.js`;
|
|
66
66
|
b = (await import(
|
|
@@ -75,20 +75,20 @@ function H() {
|
|
|
75
75
|
if (R) return;
|
|
76
76
|
await import(`${A}highcharts-more.src.js`), R = !0;
|
|
77
77
|
}
|
|
78
|
-
return { renderCartesianChart: e, renderPolarChart: a, renderRangeChart:
|
|
78
|
+
return { renderCartesianChart: e, renderPolarChart: a, renderRangeChart: t };
|
|
79
79
|
}
|
|
80
|
-
const O = 4, N = `https://cdn.jsdelivr.net/npm/micromark@${O}/+esm`,
|
|
81
|
-
let
|
|
80
|
+
const O = 4, N = `https://cdn.jsdelivr.net/npm/micromark@${O}/+esm`, T = 1, _ = `https://cdn.jsdelivr.net/npm/prismjs@${T}/+esm`, C = `https://cdn.jsdelivr.net/npm/prismjs@${T}/components/prism-javascript.min.js`, L = `https://cdn.jsdelivr.net/npm/prismjs@${T}/components/prism-javascript.min.js`;
|
|
81
|
+
let w, y;
|
|
82
82
|
function V() {
|
|
83
83
|
async function e() {
|
|
84
|
-
return await
|
|
84
|
+
return await t(), { micromark: w, Prism: y };
|
|
85
85
|
}
|
|
86
86
|
async function a() {
|
|
87
|
-
await
|
|
87
|
+
await t();
|
|
88
88
|
}
|
|
89
|
-
async function
|
|
90
|
-
if (
|
|
91
|
-
const
|
|
89
|
+
async function t() {
|
|
90
|
+
if (w && y) return;
|
|
91
|
+
const r = await Promise.all([
|
|
92
92
|
import(
|
|
93
93
|
/* @vite-ignore */
|
|
94
94
|
N
|
|
@@ -96,17 +96,17 @@ function V() {
|
|
|
96
96
|
import(
|
|
97
97
|
/* @vite-ignore */
|
|
98
98
|
_
|
|
99
|
-
),
|
|
100
|
-
import(
|
|
101
|
-
/* @vite-ignore */
|
|
102
|
-
C
|
|
103
|
-
),
|
|
104
|
-
import(
|
|
105
|
-
/* @vite-ignore */
|
|
106
|
-
L
|
|
107
99
|
)
|
|
100
|
+
// import(/* @vite-ignore */ PRISM_JAVASCRIPT_URL),
|
|
101
|
+
// import(/* @vite-ignore */ PRISM_JSON_URL)
|
|
108
102
|
]);
|
|
109
|
-
|
|
103
|
+
w = r[0].micromark, y = r[1].default, globalThis.Prism = y, await Promise.all([import(
|
|
104
|
+
/* @vite-ignore */
|
|
105
|
+
C
|
|
106
|
+
), import(
|
|
107
|
+
/* @vite-ignore */
|
|
108
|
+
L
|
|
109
|
+
)]);
|
|
110
110
|
}
|
|
111
111
|
return { getStuff: e, render: a };
|
|
112
112
|
}
|
|
@@ -129,63 +129,63 @@ const z = 0, X = (e) => e, G = () => Date.now(), J = {
|
|
|
129
129
|
streamgraph: { categoryId: "streamgraph", label: { "en-gb": "Streamgraph" }, options: {} },
|
|
130
130
|
values: { categoryId: "values", label: { "en-gb": "Values" }, options: {} }
|
|
131
131
|
};
|
|
132
|
-
class
|
|
132
|
+
class D extends Error {
|
|
133
133
|
locator;
|
|
134
|
-
constructor(a,
|
|
135
|
-
super(a,
|
|
134
|
+
constructor(a, t, r) {
|
|
135
|
+
super(a, r), this.name = "DataPosError", this.locator = t, Error.captureStackTrace?.(this, new.target);
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
class g extends
|
|
139
|
-
constructor(a,
|
|
140
|
-
super(a,
|
|
138
|
+
class g extends D {
|
|
139
|
+
constructor(a, t, r) {
|
|
140
|
+
super(a, t, r), this.name = "ApplicationError";
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
class K extends g {
|
|
144
|
-
constructor(a,
|
|
145
|
-
super(a,
|
|
144
|
+
constructor(a, t, r) {
|
|
145
|
+
super(a, t, r), this.name = "APIError";
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
class q extends g {
|
|
149
|
-
constructor(a,
|
|
150
|
-
super(a,
|
|
149
|
+
constructor(a, t, r) {
|
|
150
|
+
super(a, t, r), this.name = "EngineError";
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
class v extends g {
|
|
154
154
|
body;
|
|
155
|
-
constructor(a,
|
|
156
|
-
super(a,
|
|
155
|
+
constructor(a, t, r, o) {
|
|
156
|
+
super(a, t, o), this.name = "FetchError", this.body = r;
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
class $ extends g {
|
|
160
160
|
componentName;
|
|
161
161
|
info;
|
|
162
|
-
constructor(a,
|
|
163
|
-
super(a,
|
|
162
|
+
constructor(a, t, r, o, n) {
|
|
163
|
+
super(a, t, n), this.name = "VueHandledError", this.info = r, this.componentName = o;
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
class Q extends g {
|
|
167
|
-
constructor(a,
|
|
168
|
-
super(a,
|
|
167
|
+
constructor(a, t, r) {
|
|
168
|
+
super(a, t, r), this.name = "WindowHandledRuntimeError";
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
class Y extends g {
|
|
172
|
-
constructor(a,
|
|
173
|
-
super(a,
|
|
172
|
+
constructor(a, t, r) {
|
|
173
|
+
super(a, t, r), this.name = "WindowHandledPromiseRejectionError";
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
class Z extends
|
|
177
|
-
constructor(a,
|
|
178
|
-
super(a,
|
|
176
|
+
class Z extends D {
|
|
177
|
+
constructor(a, t, r) {
|
|
178
|
+
super(a, t, r), this.name = "OperationalError";
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
async function ee(e, a,
|
|
182
|
-
const
|
|
183
|
-
return new v(
|
|
181
|
+
async function ee(e, a, t) {
|
|
182
|
+
const r = `${a} Response status '${e.status}${e.statusText ? ` - ${e.statusText}` : ""}' received.`, o = await e.text();
|
|
183
|
+
return new v(r, t, o);
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function re(e) {
|
|
186
186
|
return e.map((a) => a.message).join(" ");
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function te(e, a = "Unknown error.") {
|
|
189
189
|
if (e instanceof Error) return e;
|
|
190
190
|
if (typeof e == "string") return new Error(e);
|
|
191
191
|
try {
|
|
@@ -195,26 +195,26 @@ function re(e, a = "Unknown error.") {
|
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
function ae(e) {
|
|
198
|
-
const a = /* @__PURE__ */ new Set(),
|
|
199
|
-
let
|
|
200
|
-
for (;
|
|
201
|
-
a.add(
|
|
198
|
+
const a = /* @__PURE__ */ new Set(), t = [];
|
|
199
|
+
let r = e;
|
|
200
|
+
for (; r && !a.has(r); ) {
|
|
201
|
+
a.add(r);
|
|
202
202
|
let o;
|
|
203
|
-
if (
|
|
204
|
-
o = { body:
|
|
205
|
-
else if (
|
|
206
|
-
o = { componentName:
|
|
207
|
-
else if (
|
|
208
|
-
o = { locator:
|
|
209
|
-
else if (
|
|
210
|
-
const n =
|
|
211
|
-
o = { locator: "", message: n.message, name: n.name, stack: n.stack },
|
|
212
|
-
} else
|
|
213
|
-
/(?:\.{3}|[.!?])$/.test(o.message) || (o.message += "."),
|
|
203
|
+
if (r instanceof v)
|
|
204
|
+
o = { body: r.body, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
|
|
205
|
+
else if (r instanceof $)
|
|
206
|
+
o = { componentName: r.componentName, info: r.info, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
|
|
207
|
+
else if (r instanceof D)
|
|
208
|
+
o = { locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
|
|
209
|
+
else if (r instanceof Error) {
|
|
210
|
+
const n = r;
|
|
211
|
+
o = { locator: "", message: n.message, name: n.name, stack: n.stack }, r = n.cause;
|
|
212
|
+
} else r ? (o = { locator: "", message: String(r), name: "Error" }, r = void 0) : (o = { locator: "", message: "Unknown error.", name: "Error" }, r = void 0);
|
|
213
|
+
/(?:\.{3}|[.!?])$/.test(o.message) || (o.message += "."), t.push(o);
|
|
214
214
|
}
|
|
215
|
-
return
|
|
215
|
+
return t;
|
|
216
216
|
}
|
|
217
|
-
const S = "en-US",
|
|
217
|
+
const S = "en-US", E = {}, ne = (e) => {
|
|
218
218
|
switch (e) {
|
|
219
219
|
case "Edm.Binary":
|
|
220
220
|
return "unknown";
|
|
@@ -255,38 +255,38 @@ const S = "en-US", y = {}, ne = (e) => {
|
|
|
255
255
|
}
|
|
256
256
|
}, oe = (e) => {
|
|
257
257
|
if (e) {
|
|
258
|
-
const a = e.lastIndexOf("/"),
|
|
259
|
-
return
|
|
258
|
+
const a = e.lastIndexOf("/"), t = e.lastIndexOf(".", a > -1 ? a : e.length);
|
|
259
|
+
return t > -1 ? e.substring(0, t) : e;
|
|
260
260
|
}
|
|
261
261
|
}, se = (e) => {
|
|
262
262
|
if (e) {
|
|
263
263
|
const a = e.lastIndexOf(".");
|
|
264
264
|
if (a > -1) return e.substring(a + 1);
|
|
265
265
|
}
|
|
266
|
-
}, i = (e, a = 2,
|
|
266
|
+
}, i = (e, a = 2, t = a, r = S) => {
|
|
267
267
|
if (e == null) return "";
|
|
268
|
-
const o = `${
|
|
269
|
-
let n =
|
|
270
|
-
return n || (n = new Intl.NumberFormat(
|
|
268
|
+
const o = `${r}decimal${a}.${t}`;
|
|
269
|
+
let n = E[o];
|
|
270
|
+
return n || (n = new Intl.NumberFormat(r, {
|
|
271
271
|
localeMatcher: "best fit",
|
|
272
272
|
maximumFractionDigits: a,
|
|
273
|
-
minimumFractionDigits:
|
|
273
|
+
minimumFractionDigits: t,
|
|
274
274
|
minimumIntegerDigits: 1,
|
|
275
275
|
style: "decimal",
|
|
276
276
|
useGrouping: !0
|
|
277
|
-
}),
|
|
278
|
-
}, ie = (e) => e == null ? "" : e < 1e3 ?
|
|
277
|
+
}), E[o] = n), n.format(e);
|
|
278
|
+
}, ie = (e) => e == null ? "" : e < 1e3 ? I(e) : e < 1e6 ? `${i(e / 1e3, 2, 0)}K` : e < 1e9 ? `${i(e / 1e6, 2, 0)}M` : e < 1e12 ? `${i(e / 1e9, 2, 0)}B` : `${i(e / 1e12, 2, 0)}T`, le = (e) => e == null ? "" : e === 1 ? "1 byte" : e < 1024 ? `${I(e)} bytes` : e < 1048576 ? `${i(e / 1024, 2, 0)} KB` : e < 1073741824 ? `${i(e / 1048576, 2, 0)} MB` : e < 1099511627776 ? `${i(e / 1073741824, 2, 0)} GB` : `${i(e / 1099511627776, 2, 0)} TB`, ce = (e) => e == null ? "" : e < 1e3 ? `${I(e)} ms` : e === 1e3 ? `${I(e)} sec` : e < 6e4 ? `${i(e / 1e3, 2, 0)} secs` : e === 6e4 ? "1 min" : e < 36e5 ? `${i(e / 6e4, 2, 0)} mins` : e === 36e5 ? "1 hr" : e < 864e5 ? `${i(e / 36e5, 2, 0)} hrs` : e === 864e5 ? "1 day" : `${i(e / 864e5, 2, 0)} days`, I = (e, a = S) => {
|
|
279
279
|
if (e == null) return "";
|
|
280
|
-
const
|
|
281
|
-
let
|
|
282
|
-
return
|
|
280
|
+
const t = `${a}decimal0.0`;
|
|
281
|
+
let r = E[t];
|
|
282
|
+
return r || (r = new Intl.NumberFormat(a, {
|
|
283
283
|
localeMatcher: "best fit",
|
|
284
284
|
maximumFractionDigits: 0,
|
|
285
285
|
minimumFractionDigits: 0,
|
|
286
286
|
minimumIntegerDigits: 1,
|
|
287
287
|
style: "decimal",
|
|
288
288
|
useGrouping: !0
|
|
289
|
-
}),
|
|
289
|
+
}), E[t] = r), r.format(e);
|
|
290
290
|
}, de = (e) => {
|
|
291
291
|
switch (e) {
|
|
292
292
|
case "csv":
|
|
@@ -311,7 +311,7 @@ const S = "en-US", y = {}, ne = (e) => {
|
|
|
311
311
|
{ id: "xml", label: { "en-gb": "XML" } }
|
|
312
312
|
], me = (e = d) => {
|
|
313
313
|
const a = [];
|
|
314
|
-
for (const
|
|
314
|
+
for (const t of M) a.push({ ...t, label: t.label[e] || t.label[d] || t.id });
|
|
315
315
|
return a;
|
|
316
316
|
}, j = [
|
|
317
317
|
{ id: `
|
|
@@ -321,8 +321,8 @@ const S = "en-US", y = {}, ne = (e) => {
|
|
|
321
321
|
`, label: { "en-gb": "Carriage Return/Newline" } }
|
|
322
322
|
], ue = (e = d) => {
|
|
323
323
|
const a = [];
|
|
324
|
-
for (const
|
|
325
|
-
a.push({ ...
|
|
324
|
+
for (const t of j)
|
|
325
|
+
a.push({ ...t, label: t.label[e] || t.label[d] || t.id });
|
|
326
326
|
return a;
|
|
327
327
|
}, k = [
|
|
328
328
|
{ id: ":", label: { "en-gb": "Colon" } },
|
|
@@ -338,8 +338,8 @@ const S = "en-US", y = {}, ne = (e) => {
|
|
|
338
338
|
{ id: "|", label: { "en-gb": "Vertical Bar" } }
|
|
339
339
|
], pe = (e = d) => {
|
|
340
340
|
const a = [];
|
|
341
|
-
for (const
|
|
342
|
-
a.push({ ...
|
|
341
|
+
for (const t of k)
|
|
342
|
+
a.push({ ...t, label: t.label[e] || t.label[d] || t.id });
|
|
343
343
|
return a;
|
|
344
344
|
}, F = [
|
|
345
345
|
{ id: "alpha", color: "red", label: { "en-gb": "alpha" } },
|
|
@@ -352,8 +352,8 @@ const S = "en-US", y = {}, ne = (e) => {
|
|
|
352
352
|
{ id: "unavailable", color: "other", label: { "en-gb": "unavailable" } },
|
|
353
353
|
{ id: "underReview", color: "other", label: { "en-gb": "under-review" } }
|
|
354
354
|
], ge = (e, a = d) => {
|
|
355
|
-
const
|
|
356
|
-
return
|
|
355
|
+
const t = F.find((r) => r.id === e);
|
|
356
|
+
return t ? { ...t, label: t.label[a] || t.label[d] || e } : { id: e, color: "other", label: e };
|
|
357
357
|
}, d = "en-gb";
|
|
358
358
|
export {
|
|
359
359
|
K as APIError,
|
|
@@ -369,7 +369,7 @@ export {
|
|
|
369
369
|
Y as WindowPromiseRejectionError,
|
|
370
370
|
Q as WindowRuntimeError,
|
|
371
371
|
ee as buildFetchError,
|
|
372
|
-
|
|
372
|
+
re as concatenateSerialisedErrorMessages,
|
|
373
373
|
X as convertMillisecondsToTimestamp,
|
|
374
374
|
ne as convertODataTypeIdToUsageTypeId,
|
|
375
375
|
se as extractExtensionFromPath,
|
|
@@ -378,14 +378,14 @@ export {
|
|
|
378
378
|
ce as formatNumberAsDuration,
|
|
379
379
|
ie as formatNumberAsSize,
|
|
380
380
|
le as formatNumberAsStorageSize,
|
|
381
|
-
|
|
381
|
+
I as formatNumberAsWholeNumber,
|
|
382
382
|
ge as getComponentStatus,
|
|
383
383
|
G as getCurrentTimestamp,
|
|
384
384
|
me as getDataFormats,
|
|
385
385
|
ue as getRecordDelimiters,
|
|
386
386
|
pe as getValueDelimiters,
|
|
387
387
|
de as lookupMimeTypeForExtension,
|
|
388
|
-
|
|
388
|
+
te as normalizeToError,
|
|
389
389
|
J as presentationViewTypeMap,
|
|
390
390
|
ae as serialiseError,
|
|
391
391
|
B as useCytoscapeJS,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { micromark } from 'micromark';
|
|
2
|
-
import { default as
|
|
2
|
+
import { default as Prism } from 'prismjs';
|
|
3
3
|
import { Module } from '../../module';
|
|
4
4
|
import { Component, ComponentConfig, ComponentRef } from '..';
|
|
5
5
|
export interface Presenter extends Module, Component {
|
|
@@ -18,5 +18,5 @@ export type PresenterLocalisedConfig = Omit<PresenterConfig, 'label' | 'descript
|
|
|
18
18
|
};
|
|
19
19
|
export type PresenterTools = {
|
|
20
20
|
micromark: typeof micromark;
|
|
21
|
-
|
|
21
|
+
Prism: typeof Prism;
|
|
22
22
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datapos/datapos-shared",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.186",
|
|
4
4
|
"description": "A TypeScript library containing common declarations and utilities used across other Data Positioning repositories.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"zod": "^4.1.12"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@datapos/datapos-development": "^0.3.
|
|
38
|
+
"@datapos/datapos-development": "^0.3.66",
|
|
39
39
|
"@types/markdown-it": "^14.1.2",
|
|
40
40
|
"@types/node": "^24.10.0",
|
|
41
41
|
"@types/prismjs": "^1.26.5",
|