@datapos/datapos-shared 0.3.114 → 0.3.116
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,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { promises as x } from "fs";
|
|
2
|
+
const L = 0, O = (e) => e, _ = () => Date.now(), k = {
|
|
2
3
|
cartesian_areaLine: { categoryId: "cartesian", typeId: "areaLine", label: { "en-gb": "Area Line" }, options: { highchartsType: "area" } },
|
|
3
4
|
cartesian_areaSpline: { categoryId: "cartesian", typeId: "areaSpline", label: { "en-gb": "Area Spline" }, options: { highchartsType: "area" } },
|
|
4
5
|
cartesian_bar: { categoryId: "cartesian", typeId: "bar", label: { "en-gb": "Bar" }, options: { highchartsType: "bar" } },
|
|
@@ -17,66 +18,66 @@ const R = 0, L = (e) => e, F = () => Date.now(), _ = {
|
|
|
17
18
|
streamgraph: { categoryId: "streamgraph", label: { "en-gb": "Streamgraph" }, options: {} },
|
|
18
19
|
values: { categoryId: "values", label: { "en-gb": "Values" }, options: {} }
|
|
19
20
|
};
|
|
20
|
-
function
|
|
21
|
+
function M() {
|
|
21
22
|
function e(t, a, r) {
|
|
22
23
|
r.textContent = "Cytoscape.js diagram goes here...";
|
|
23
24
|
}
|
|
24
25
|
return { render: e };
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
+
function U() {
|
|
27
28
|
function e(t, a, r) {
|
|
28
29
|
r.textContent = "values table goes here...";
|
|
29
30
|
}
|
|
30
31
|
return { render: e };
|
|
31
32
|
}
|
|
32
|
-
const
|
|
33
|
-
let b,
|
|
34
|
-
function
|
|
33
|
+
const S = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", I = "highcharts";
|
|
34
|
+
let b, T = !1;
|
|
35
|
+
function j() {
|
|
35
36
|
async function e(n, s, u, h) {
|
|
36
37
|
await r();
|
|
37
38
|
const l = [];
|
|
38
39
|
for (const c of s.data.measures)
|
|
39
40
|
l.push({ type: n.options.highchartsType, name: c.name, data: c.data });
|
|
40
|
-
const
|
|
41
|
+
const m = {
|
|
41
42
|
chart: { type: n.options.highchartsType },
|
|
42
43
|
plotOptions: { series: { borderColor: "#333" } },
|
|
43
44
|
series: l,
|
|
44
45
|
title: { text: s.title.text },
|
|
45
46
|
xAxis: { categories: s.data.categoryLabels },
|
|
46
47
|
yAxis: { title: { text: s.data.name } }
|
|
47
|
-
},
|
|
48
|
-
return { chart:
|
|
48
|
+
}, g = b.chart(u, m, h);
|
|
49
|
+
return { chart: g, resize: () => g.reflow(), vendorId: I };
|
|
49
50
|
}
|
|
50
51
|
async function t(n, s, u, h) {
|
|
51
52
|
await Promise.all([r(), o()]);
|
|
52
53
|
const l = [];
|
|
53
54
|
for (const c of s.data.measures)
|
|
54
55
|
l.push({ type: n.options.highchartsType, name: c.name, data: c.data });
|
|
55
|
-
const
|
|
56
|
+
const m = {
|
|
56
57
|
chart: { polar: !0 },
|
|
57
58
|
plotOptions: { series: { borderColor: "#333" } },
|
|
58
59
|
series: l,
|
|
59
60
|
title: { text: s.title.text },
|
|
60
61
|
xAxis: { categories: s.data.categoryLabels },
|
|
61
62
|
yAxis: { title: { text: s.data.name } }
|
|
62
|
-
},
|
|
63
|
-
return { chart:
|
|
63
|
+
}, g = b.chart(u, m, h);
|
|
64
|
+
return { chart: g, resize: () => g.reflow(), vendorId: I };
|
|
64
65
|
}
|
|
65
66
|
async function a(n, s, u, h) {
|
|
66
67
|
await Promise.all([r(), o()]);
|
|
67
|
-
const l = [],
|
|
68
|
+
const l = [], m = [];
|
|
68
69
|
for (let f = 0; f < s.data.measures[0].data.length; f++)
|
|
69
|
-
|
|
70
|
-
l.push({ type: n.options.highchartsType, name: "Unknown", data:
|
|
71
|
-
const
|
|
70
|
+
m.push([s.data.measures[0].data[f][0], s.data.measures[1].data[f][0]]);
|
|
71
|
+
l.push({ type: n.options.highchartsType, name: "Unknown", data: m });
|
|
72
|
+
const g = {
|
|
72
73
|
chart: { type: n.options.highchartsType, inverted: n.options.inverted },
|
|
73
74
|
plotOptions: { series: { borderColor: "#333" } },
|
|
74
75
|
series: l,
|
|
75
76
|
title: { text: s.title.text },
|
|
76
77
|
xAxis: { categories: s.data.categoryLabels },
|
|
77
78
|
yAxis: { title: { text: s.data.name } }
|
|
78
|
-
}, c = b.chart(u,
|
|
79
|
-
return { chart: c, resize: () => c.reflow(), vendorId:
|
|
79
|
+
}, c = b.chart(u, g, h);
|
|
80
|
+
return { chart: c, resize: () => c.reflow(), vendorId: I };
|
|
80
81
|
}
|
|
81
82
|
async function r() {
|
|
82
83
|
if (b) return;
|
|
@@ -90,68 +91,68 @@ function M() {
|
|
|
90
91
|
);
|
|
91
92
|
}
|
|
92
93
|
async function o() {
|
|
93
|
-
if (
|
|
94
|
-
await import(`${
|
|
94
|
+
if (T) return;
|
|
95
|
+
await import(`${S}highcharts-more.src.js`), T = !0;
|
|
95
96
|
}
|
|
96
97
|
return { renderCartesianChart: e, renderPolarChart: t, renderRangeChart: a };
|
|
97
98
|
}
|
|
98
|
-
class
|
|
99
|
+
class w extends Error {
|
|
99
100
|
locator;
|
|
100
101
|
constructor(t, a, r) {
|
|
101
102
|
super(t, r), this.name = "DataPosError", this.locator = a, Error.captureStackTrace?.(this, new.target);
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
|
-
class p extends
|
|
105
|
+
class p extends w {
|
|
105
106
|
constructor(t, a, r) {
|
|
106
107
|
super(t, a, r), this.name = "ApplicationError";
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
|
-
class
|
|
110
|
+
class B extends p {
|
|
110
111
|
constructor(t, a, r) {
|
|
111
112
|
super(t, a, r), this.name = "APIError";
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
|
-
class
|
|
115
|
+
class H extends p {
|
|
115
116
|
constructor(t, a, r) {
|
|
116
117
|
super(t, a, r), this.name = "EngineError";
|
|
117
118
|
}
|
|
118
119
|
}
|
|
119
|
-
class
|
|
120
|
+
class D extends p {
|
|
120
121
|
body;
|
|
121
122
|
constructor(t, a, r, o) {
|
|
122
123
|
super(t, a, o), this.name = "FetchError", this.body = r;
|
|
123
124
|
}
|
|
124
125
|
}
|
|
125
|
-
class
|
|
126
|
+
class N extends p {
|
|
126
127
|
componentName;
|
|
127
128
|
info;
|
|
128
129
|
constructor(t, a, r, o, n) {
|
|
129
130
|
super(t, a, n), this.name = "VueHandledError", this.info = r, this.componentName = o;
|
|
130
131
|
}
|
|
131
132
|
}
|
|
132
|
-
class
|
|
133
|
+
class J extends p {
|
|
133
134
|
constructor(t, a, r) {
|
|
134
135
|
super(t, a, r), this.name = "WindowHandledRuntimeError";
|
|
135
136
|
}
|
|
136
137
|
}
|
|
137
|
-
class
|
|
138
|
+
class W extends p {
|
|
138
139
|
constructor(t, a, r) {
|
|
139
140
|
super(t, a, r), this.name = "WindowHandledPromiseRejectionError";
|
|
140
141
|
}
|
|
141
142
|
}
|
|
142
|
-
class
|
|
143
|
+
class z extends w {
|
|
143
144
|
constructor(t, a, r) {
|
|
144
145
|
super(t, a, r), this.name = "OperationalError";
|
|
145
146
|
}
|
|
146
147
|
}
|
|
147
|
-
async function
|
|
148
|
+
async function P(e, t, a) {
|
|
148
149
|
const r = `${t} Response status '${e.status}${e.statusText ? ` - ${e.statusText}` : ""}' received.`, o = await e.text();
|
|
149
|
-
return new
|
|
150
|
+
return new D(r, a, o);
|
|
150
151
|
}
|
|
151
|
-
function
|
|
152
|
+
function V(e) {
|
|
152
153
|
return e.map((t) => t.message).join(" ");
|
|
153
154
|
}
|
|
154
|
-
function
|
|
155
|
+
function X(e, t = "Unknown error.") {
|
|
155
156
|
if (e instanceof Error) return e;
|
|
156
157
|
if (typeof e == "string") return new Error(e);
|
|
157
158
|
try {
|
|
@@ -160,17 +161,17 @@ function V(e, t = "Unknown error.") {
|
|
|
160
161
|
return new Error(t);
|
|
161
162
|
}
|
|
162
163
|
}
|
|
163
|
-
function
|
|
164
|
+
function G(e) {
|
|
164
165
|
const t = /* @__PURE__ */ new Set(), a = [];
|
|
165
166
|
let r = e;
|
|
166
167
|
for (; r && !t.has(r); ) {
|
|
167
168
|
t.add(r);
|
|
168
169
|
let o;
|
|
169
|
-
if (r instanceof
|
|
170
|
+
if (r instanceof D)
|
|
170
171
|
o = { body: r.body, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
|
|
171
|
-
else if (r instanceof
|
|
172
|
+
else if (r instanceof N)
|
|
172
173
|
o = { componentName: r.componentName, info: r.info, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
|
|
173
|
-
else if (r instanceof
|
|
174
|
+
else if (r instanceof w)
|
|
174
175
|
o = { locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
|
|
175
176
|
else if (r instanceof Error) {
|
|
176
177
|
const n = r;
|
|
@@ -180,7 +181,15 @@ function X(e) {
|
|
|
180
181
|
}
|
|
181
182
|
return a;
|
|
182
183
|
}
|
|
183
|
-
|
|
184
|
+
async function K() {
|
|
185
|
+
try {
|
|
186
|
+
const e = await JSON.parse(await x.readFile("config.json", "utf8")), t = await JSON.parse(await x.readFile("package.json", "utf8"));
|
|
187
|
+
await x.writeFile("configNEW.json", JSON.stringify({ ...e, id: t.name, version: t.version }, void 0, 4));
|
|
188
|
+
} catch (e) {
|
|
189
|
+
console.warn("Error building connector configuration.", e);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
const v = "en-US", y = {}, q = (e) => {
|
|
184
193
|
switch (e) {
|
|
185
194
|
case "Edm.Binary":
|
|
186
195
|
return "unknown";
|
|
@@ -219,17 +228,17 @@ const D = "en-US", y = {}, G = (e) => {
|
|
|
219
228
|
default:
|
|
220
229
|
return "unknown";
|
|
221
230
|
}
|
|
222
|
-
},
|
|
231
|
+
}, Q = (e) => {
|
|
223
232
|
if (e) {
|
|
224
233
|
const t = e.lastIndexOf("/"), a = e.lastIndexOf(".", t > -1 ? t : e.length);
|
|
225
234
|
return a > -1 ? e.substring(0, a) : e;
|
|
226
235
|
}
|
|
227
|
-
},
|
|
236
|
+
}, Y = (e) => {
|
|
228
237
|
if (e) {
|
|
229
238
|
const t = e.lastIndexOf(".");
|
|
230
239
|
if (t > -1) return e.substring(t + 1);
|
|
231
240
|
}
|
|
232
|
-
}, i = (e, t = 2, a = t, r =
|
|
241
|
+
}, i = (e, t = 2, a = t, r = v) => {
|
|
233
242
|
if (e == null) return "";
|
|
234
243
|
const o = `${r}decimal${t}.${a}`;
|
|
235
244
|
let n = y[o];
|
|
@@ -241,7 +250,7 @@ const D = "en-US", y = {}, G = (e) => {
|
|
|
241
250
|
style: "decimal",
|
|
242
251
|
useGrouping: !0
|
|
243
252
|
}), y[o] = n), n.format(e);
|
|
244
|
-
},
|
|
253
|
+
}, Z = (e) => e == null ? "" : e < 1e3 ? E(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`, ee = (e) => e == null ? "" : e === 1 ? "1 byte" : e < 1024 ? `${E(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`, re = (e) => e == null ? "" : e < 1e3 ? `${E(e)} ms` : e === 1e3 ? `${E(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`, E = (e, t = v) => {
|
|
245
254
|
if (e == null) return "";
|
|
246
255
|
const a = `${t}decimal0.0`;
|
|
247
256
|
let r = y[a];
|
|
@@ -253,7 +262,7 @@ const D = "en-US", y = {}, G = (e) => {
|
|
|
253
262
|
style: "decimal",
|
|
254
263
|
useGrouping: !0
|
|
255
264
|
}), y[a] = r), r.format(e);
|
|
256
|
-
},
|
|
265
|
+
}, te = (e) => {
|
|
257
266
|
switch (e) {
|
|
258
267
|
case "csv":
|
|
259
268
|
return "text/csv";
|
|
@@ -275,19 +284,19 @@ const D = "en-US", y = {}, G = (e) => {
|
|
|
275
284
|
{ id: "xls", label: { "en-gb": "XLS" } },
|
|
276
285
|
{ id: "xlsx", label: { "en-gb": "XLSX" } },
|
|
277
286
|
{ id: "xml", label: { "en-gb": "XML" } }
|
|
278
|
-
],
|
|
287
|
+
], ae = (e = d) => {
|
|
279
288
|
const t = [];
|
|
280
289
|
for (const a of A) t.push({ ...a, label: a.label[e] || a.label[d] || a.id });
|
|
281
290
|
return t;
|
|
282
|
-
},
|
|
291
|
+
}, C = [
|
|
283
292
|
{ id: `
|
|
284
293
|
`, label: { "en-gb": "Newline" } },
|
|
285
294
|
{ id: "\r", label: { "en-gb": "Carriage Return" } },
|
|
286
295
|
{ id: `\r
|
|
287
296
|
`, label: { "en-gb": "Carriage Return/Newline" } }
|
|
288
|
-
],
|
|
297
|
+
], ne = (e = d) => {
|
|
289
298
|
const t = [];
|
|
290
|
-
for (const a of
|
|
299
|
+
for (const a of C)
|
|
291
300
|
t.push({ ...a, label: a.label[e] || a.label[d] || a.id });
|
|
292
301
|
return t;
|
|
293
302
|
}, $ = [
|
|
@@ -302,12 +311,12 @@ const D = "en-US", y = {}, G = (e) => {
|
|
|
302
311
|
{ id: "_", label: { "en-gb": "Underscore" } },
|
|
303
312
|
{ id: "0x1F", label: { "en-gb": "Unit Separator" } },
|
|
304
313
|
{ id: "|", label: { "en-gb": "Vertical Bar" } }
|
|
305
|
-
],
|
|
314
|
+
], oe = (e = d) => {
|
|
306
315
|
const t = [];
|
|
307
316
|
for (const a of $)
|
|
308
317
|
t.push({ ...a, label: a.label[e] || a.label[d] || a.id });
|
|
309
318
|
return t;
|
|
310
|
-
},
|
|
319
|
+
}, R = [
|
|
311
320
|
{ id: "alpha", color: "red", label: { "en-gb": "alpha" } },
|
|
312
321
|
{ id: "beta", color: "amber", label: { "en-gb": "beta" } },
|
|
313
322
|
{ id: "generalAvailability", color: "green", label: { "en-gb": "" } },
|
|
@@ -317,42 +326,43 @@ const D = "en-US", y = {}, G = (e) => {
|
|
|
317
326
|
{ id: "releaseCandidate", color: "green", label: { "en-gb": "release-candidate" } },
|
|
318
327
|
{ id: "unavailable", color: "other", label: { "en-gb": "unavailable" } },
|
|
319
328
|
{ id: "underReview", color: "other", label: { "en-gb": "under-review" } }
|
|
320
|
-
],
|
|
321
|
-
const a =
|
|
329
|
+
], se = (e, t = d) => {
|
|
330
|
+
const a = R.find((r) => r.id === e);
|
|
322
331
|
return a ? { ...a, label: a.label[t] || a.label[d] || e } : { id: e, color: "other", label: e };
|
|
323
332
|
}, d = "en-gb";
|
|
324
333
|
export {
|
|
325
|
-
|
|
334
|
+
B as APIError,
|
|
326
335
|
p as ApplicationError,
|
|
327
336
|
d as DEFAULT_LOCALE_CODE,
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
P as
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
337
|
+
L as DefaultTimestamp,
|
|
338
|
+
H as EngineError,
|
|
339
|
+
D as FetchError,
|
|
340
|
+
z as OperationalError,
|
|
341
|
+
N as VueError,
|
|
342
|
+
W as WindowPromiseRejectionError,
|
|
343
|
+
J as WindowRuntimeError,
|
|
344
|
+
K as buildConnectorConfig,
|
|
345
|
+
P as buildFetchError,
|
|
346
|
+
V as concatenateSerialisedErrorMessages,
|
|
347
|
+
O as convertMillisecondsToTimestamp,
|
|
348
|
+
q as convertODataTypeIdToUsageTypeId,
|
|
349
|
+
Y as extractExtensionFromPath,
|
|
350
|
+
Q as extractNameFromPath,
|
|
341
351
|
i as formatNumberAsDecimalNumber,
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
352
|
+
re as formatNumberAsDuration,
|
|
353
|
+
Z as formatNumberAsSize,
|
|
354
|
+
ee as formatNumberAsStorageSize,
|
|
355
|
+
E as formatNumberAsWholeNumber,
|
|
356
|
+
se as getComponentStatus,
|
|
357
|
+
_ as getCurrentTimestamp,
|
|
358
|
+
ae as getDataFormats,
|
|
359
|
+
ne as getRecordDelimiters,
|
|
360
|
+
oe as getValueDelimiters,
|
|
361
|
+
te as lookupMimeTypeForExtension,
|
|
362
|
+
X as normalizeToError,
|
|
363
|
+
k as presentationViewTypeMap,
|
|
364
|
+
G as serialiseError,
|
|
365
|
+
M as useCytoscapeJS,
|
|
366
|
+
U as useDataTable,
|
|
367
|
+
j as useHighcharts
|
|
358
368
|
};
|
|
@@ -49,6 +49,7 @@ export { type CytoscapeJSView, useCytoscapeJS } from './composables/useCytoscape
|
|
|
49
49
|
export { useDataTable } from './composables/useDataTable';
|
|
50
50
|
export { type HighchartsView, useHighcharts } from './composables/useHighcharts';
|
|
51
51
|
export { APIError, ApplicationError, EngineError, FetchError, OperationalError, VueError, WindowRuntimeError, WindowPromiseRejectionError } from './errors';
|
|
52
|
+
export { buildConnectorConfig } from './devOps';
|
|
52
53
|
export { buildFetchError, concatenateSerialisedErrorMessages, normalizeToError, serialiseError } from './errors';
|
|
53
54
|
export { convertMillisecondsToTimestamp, getCurrentTimestamp } from './timestamp';
|
|
54
55
|
export { convertODataTypeIdToUsageTypeId } from './utilities';
|
package/package.json
CHANGED
|
File without changes
|