@datapos/datapos-shared 0.3.130 → 0.3.131
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/dist/datapos-shared.es.js +208 -479
- package/package.json +1 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { promises as
|
|
2
|
-
const
|
|
1
|
+
import { promises as i } from "fs";
|
|
2
|
+
const j = 0, _ = (e) => e, J = () => Date.now(), L = {
|
|
3
3
|
cartesian_areaLine: { categoryId: "cartesian", typeId: "areaLine", label: { "en-gb": "Area Line" }, options: { highchartsType: "area" } },
|
|
4
4
|
cartesian_areaSpline: { categoryId: "cartesian", typeId: "areaSpline", label: { "en-gb": "Area Spline" }, options: { highchartsType: "area" } },
|
|
5
5
|
cartesian_bar: { categoryId: "cartesian", typeId: "bar", label: { "en-gb": "Bar" }, options: { highchartsType: "bar" } },
|
|
@@ -18,170 +18,170 @@ const ge = 0, pe = (e) => e, fe = () => Date.now(), me = {
|
|
|
18
18
|
streamgraph: { categoryId: "streamgraph", label: { "en-gb": "Streamgraph" }, options: {} },
|
|
19
19
|
values: { categoryId: "values", label: { "en-gb": "Values" }, options: {} }
|
|
20
20
|
};
|
|
21
|
-
function
|
|
22
|
-
function e(
|
|
23
|
-
|
|
21
|
+
function B() {
|
|
22
|
+
function e(r, a, t) {
|
|
23
|
+
t.textContent = "Cytoscape.js diagram goes here...";
|
|
24
24
|
}
|
|
25
25
|
return { render: e };
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
function e(
|
|
29
|
-
|
|
27
|
+
function M() {
|
|
28
|
+
function e(r, a, t) {
|
|
29
|
+
t.textContent = "values table goes here...";
|
|
30
30
|
}
|
|
31
31
|
return { render: e };
|
|
32
32
|
}
|
|
33
|
-
const
|
|
34
|
-
let
|
|
35
|
-
function
|
|
36
|
-
async function e(
|
|
37
|
-
await
|
|
38
|
-
const
|
|
39
|
-
for (const
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
chart: { type:
|
|
33
|
+
const O = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", E = "highcharts";
|
|
34
|
+
let b, I = !1;
|
|
35
|
+
function U() {
|
|
36
|
+
async function e(o, s, d, u) {
|
|
37
|
+
await t();
|
|
38
|
+
const c = [];
|
|
39
|
+
for (const g of s.data.measures)
|
|
40
|
+
c.push({ type: o.options.highchartsType, name: g.name, data: g.data });
|
|
41
|
+
const f = {
|
|
42
|
+
chart: { type: o.options.highchartsType },
|
|
43
43
|
plotOptions: { series: { borderColor: "#333" } },
|
|
44
|
-
series:
|
|
44
|
+
series: c,
|
|
45
45
|
title: { text: s.title.text },
|
|
46
46
|
xAxis: { categories: s.data.categoryLabels },
|
|
47
47
|
yAxis: { title: { text: s.data.name } }
|
|
48
|
-
},
|
|
49
|
-
return { chart:
|
|
50
|
-
}
|
|
51
|
-
async function
|
|
52
|
-
await Promise.all([
|
|
53
|
-
const
|
|
54
|
-
for (const
|
|
55
|
-
|
|
56
|
-
const
|
|
48
|
+
}, m = b.chart(d, f, u);
|
|
49
|
+
return { chart: m, resize: () => m.reflow(), vendorId: E };
|
|
50
|
+
}
|
|
51
|
+
async function r(o, s, d, u) {
|
|
52
|
+
await Promise.all([t(), n()]);
|
|
53
|
+
const c = [];
|
|
54
|
+
for (const g of s.data.measures)
|
|
55
|
+
c.push({ type: o.options.highchartsType, name: g.name, data: g.data });
|
|
56
|
+
const f = {
|
|
57
57
|
chart: { polar: !0 },
|
|
58
58
|
plotOptions: { series: { borderColor: "#333" } },
|
|
59
|
-
series:
|
|
59
|
+
series: c,
|
|
60
60
|
title: { text: s.title.text },
|
|
61
61
|
xAxis: { categories: s.data.categoryLabels },
|
|
62
62
|
yAxis: { title: { text: s.data.name } }
|
|
63
|
-
},
|
|
64
|
-
return { chart:
|
|
65
|
-
}
|
|
66
|
-
async function o
|
|
67
|
-
await Promise.all([
|
|
68
|
-
const
|
|
69
|
-
for (let
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
chart: { type:
|
|
63
|
+
}, m = b.chart(d, f, u);
|
|
64
|
+
return { chart: m, resize: () => m.reflow(), vendorId: E };
|
|
65
|
+
}
|
|
66
|
+
async function a(o, s, d, u) {
|
|
67
|
+
await Promise.all([t(), n()]);
|
|
68
|
+
const c = [], f = [];
|
|
69
|
+
for (let y = 0; y < s.data.measures[0].data.length; y++)
|
|
70
|
+
f.push([s.data.measures[0].data[y][0], s.data.measures[1].data[y][0]]);
|
|
71
|
+
c.push({ type: o.options.highchartsType, name: "Unknown", data: f });
|
|
72
|
+
const m = {
|
|
73
|
+
chart: { type: o.options.highchartsType, inverted: o.options.inverted },
|
|
74
74
|
plotOptions: { series: { borderColor: "#333" } },
|
|
75
|
-
series:
|
|
75
|
+
series: c,
|
|
76
76
|
title: { text: s.title.text },
|
|
77
77
|
xAxis: { categories: s.data.categoryLabels },
|
|
78
78
|
yAxis: { title: { text: s.data.name } }
|
|
79
|
-
},
|
|
80
|
-
return { chart:
|
|
79
|
+
}, g = b.chart(d, m, u);
|
|
80
|
+
return { chart: g, resize: () => g.reflow(), vendorId: E };
|
|
81
81
|
}
|
|
82
|
-
async function
|
|
83
|
-
if (
|
|
84
|
-
const
|
|
85
|
-
|
|
82
|
+
async function t() {
|
|
83
|
+
if (b) return;
|
|
84
|
+
const o = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", s = `${o}highcharts.src.js`, d = `${o}modules/accessibility.src.js`;
|
|
85
|
+
b = (await import(
|
|
86
86
|
/* @vite-ignore */
|
|
87
87
|
s
|
|
88
88
|
)).default, await import(
|
|
89
89
|
/* @vite-ignore */
|
|
90
|
-
|
|
90
|
+
d
|
|
91
91
|
);
|
|
92
92
|
}
|
|
93
93
|
async function n() {
|
|
94
|
-
if (
|
|
95
|
-
await import(`${
|
|
94
|
+
if (I) return;
|
|
95
|
+
await import(`${O}highcharts-more.src.js`), I = !0;
|
|
96
96
|
}
|
|
97
|
-
return { renderCartesianChart: e, renderPolarChart:
|
|
97
|
+
return { renderCartesianChart: e, renderPolarChart: r, renderRangeChart: a };
|
|
98
98
|
}
|
|
99
|
-
class
|
|
99
|
+
class v extends Error {
|
|
100
100
|
locator;
|
|
101
|
-
constructor(
|
|
102
|
-
super(
|
|
101
|
+
constructor(r, a, t) {
|
|
102
|
+
super(r, t), this.name = "DataPosError", this.locator = a, Error.captureStackTrace?.(this, new.target);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
class
|
|
106
|
-
constructor(
|
|
107
|
-
super(
|
|
105
|
+
class h extends v {
|
|
106
|
+
constructor(r, a, t) {
|
|
107
|
+
super(r, a, t), this.name = "ApplicationError";
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
class
|
|
111
|
-
constructor(
|
|
112
|
-
super(
|
|
110
|
+
class z extends h {
|
|
111
|
+
constructor(r, a, t) {
|
|
112
|
+
super(r, a, t), this.name = "APIError";
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
class
|
|
116
|
-
constructor(
|
|
117
|
-
super(
|
|
115
|
+
class H extends h {
|
|
116
|
+
constructor(r, a, t) {
|
|
117
|
+
super(r, a, t), this.name = "EngineError";
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
class
|
|
120
|
+
class S extends h {
|
|
121
121
|
body;
|
|
122
|
-
constructor(
|
|
123
|
-
super(
|
|
122
|
+
constructor(r, a, t, n) {
|
|
123
|
+
super(r, a, n), this.name = "FetchError", this.body = t;
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
class
|
|
126
|
+
class T extends h {
|
|
127
127
|
componentName;
|
|
128
128
|
info;
|
|
129
|
-
constructor(
|
|
130
|
-
super(
|
|
129
|
+
constructor(r, a, t, n, o) {
|
|
130
|
+
super(r, a, o), this.name = "VueHandledError", this.info = t, this.componentName = n;
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
class
|
|
134
|
-
constructor(
|
|
135
|
-
super(
|
|
133
|
+
class V extends h {
|
|
134
|
+
constructor(r, a, t) {
|
|
135
|
+
super(r, a, t), this.name = "WindowHandledRuntimeError";
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
class
|
|
139
|
-
constructor(
|
|
140
|
-
super(
|
|
138
|
+
class P extends h {
|
|
139
|
+
constructor(r, a, t) {
|
|
140
|
+
super(r, a, t), this.name = "WindowHandledPromiseRejectionError";
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
class
|
|
144
|
-
constructor(
|
|
145
|
-
super(
|
|
143
|
+
class W extends v {
|
|
144
|
+
constructor(r, a, t) {
|
|
145
|
+
super(r, a, t), this.name = "OperationalError";
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
async function
|
|
149
|
-
const
|
|
150
|
-
return new
|
|
148
|
+
async function X(e, r, a) {
|
|
149
|
+
const t = `${r} Response status '${e.status}${e.statusText ? ` - ${e.statusText}` : ""}' received.`, n = await e.text();
|
|
150
|
+
return new S(t, a, n);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
return e.map((
|
|
152
|
+
function G(e) {
|
|
153
|
+
return e.map((r) => r.message).join(" ");
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function Z(e, r = "Unknown error.") {
|
|
156
156
|
if (e instanceof Error) return e;
|
|
157
157
|
if (typeof e == "string") return new Error(e);
|
|
158
158
|
try {
|
|
159
|
-
return new Error(JSON.stringify(e ??
|
|
159
|
+
return new Error(JSON.stringify(e ?? r));
|
|
160
160
|
} catch {
|
|
161
|
-
return new Error(
|
|
161
|
+
return new Error(r);
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
const
|
|
166
|
-
let
|
|
167
|
-
for (;
|
|
168
|
-
|
|
164
|
+
function K(e) {
|
|
165
|
+
const r = /* @__PURE__ */ new Set(), a = [];
|
|
166
|
+
let t = e;
|
|
167
|
+
for (; t && !r.has(t); ) {
|
|
168
|
+
r.add(t);
|
|
169
169
|
let n;
|
|
170
|
-
if (
|
|
171
|
-
n = { body:
|
|
172
|
-
else if (
|
|
173
|
-
n = { componentName:
|
|
174
|
-
else if (
|
|
175
|
-
n = { locator:
|
|
176
|
-
else if (
|
|
177
|
-
const
|
|
178
|
-
n = { locator: "", message:
|
|
179
|
-
} else
|
|
180
|
-
/(?:\.{3}|[.!?])$/.test(n.message) || (n.message += "."),
|
|
181
|
-
}
|
|
182
|
-
return
|
|
170
|
+
if (t instanceof S)
|
|
171
|
+
n = { body: t.body, locator: t.locator, message: t.message, name: t.name, stack: t.stack }, t = t.cause;
|
|
172
|
+
else if (t instanceof T)
|
|
173
|
+
n = { componentName: t.componentName, info: t.info, locator: t.locator, message: t.message, name: t.name, stack: t.stack }, t = t.cause;
|
|
174
|
+
else if (t instanceof v)
|
|
175
|
+
n = { locator: t.locator, message: t.message, name: t.name, stack: t.stack }, t = t.cause;
|
|
176
|
+
else if (t instanceof Error) {
|
|
177
|
+
const o = t;
|
|
178
|
+
n = { locator: "", message: o.message, name: o.name, stack: o.stack }, t = o.cause;
|
|
179
|
+
} else t ? (n = { locator: "", message: String(t), name: "Error" }, t = void 0) : (n = { locator: "", message: "Unknown error.", name: "Error" }, t = void 0);
|
|
180
|
+
/(?:\.{3}|[.!?])$/.test(n.message) || (n.message += "."), a.push(n);
|
|
181
|
+
}
|
|
182
|
+
return a;
|
|
183
183
|
}
|
|
184
|
-
const
|
|
184
|
+
const N = "en-US", w = {}, q = (e) => {
|
|
185
185
|
switch (e) {
|
|
186
186
|
case "Edm.Binary":
|
|
187
187
|
return "unknown";
|
|
@@ -220,41 +220,41 @@ const W = "en-US", I = {}, Ae = (e) => {
|
|
|
220
220
|
default:
|
|
221
221
|
return "unknown";
|
|
222
222
|
}
|
|
223
|
-
},
|
|
223
|
+
}, Q = (e) => {
|
|
224
224
|
if (e) {
|
|
225
|
-
const
|
|
226
|
-
return
|
|
225
|
+
const r = e.lastIndexOf("/"), a = e.lastIndexOf(".", r > -1 ? r : e.length);
|
|
226
|
+
return a > -1 ? e.substring(0, a) : e;
|
|
227
227
|
}
|
|
228
|
-
},
|
|
228
|
+
}, Y = (e) => {
|
|
229
229
|
if (e) {
|
|
230
|
-
const
|
|
231
|
-
if (
|
|
230
|
+
const r = e.lastIndexOf(".");
|
|
231
|
+
if (r > -1) return e.substring(r + 1);
|
|
232
232
|
}
|
|
233
|
-
},
|
|
233
|
+
}, l = (e, r = 2, a = r, t = N) => {
|
|
234
234
|
if (e == null) return "";
|
|
235
|
-
const n = `${
|
|
236
|
-
let
|
|
237
|
-
return
|
|
235
|
+
const n = `${t}decimal${r}.${a}`;
|
|
236
|
+
let o = w[n];
|
|
237
|
+
return o || (o = new Intl.NumberFormat(t, {
|
|
238
238
|
localeMatcher: "best fit",
|
|
239
|
-
maximumFractionDigits:
|
|
240
|
-
minimumFractionDigits:
|
|
239
|
+
maximumFractionDigits: r,
|
|
240
|
+
minimumFractionDigits: a,
|
|
241
241
|
minimumIntegerDigits: 1,
|
|
242
242
|
style: "decimal",
|
|
243
243
|
useGrouping: !0
|
|
244
|
-
}),
|
|
245
|
-
},
|
|
244
|
+
}), w[n] = o), o.format(e);
|
|
245
|
+
}, ee = (e) => e == null ? "" : e < 1e3 ? x(e) : e < 1e6 ? `${l(e / 1e3, 2, 0)}K` : e < 1e9 ? `${l(e / 1e6, 2, 0)}M` : e < 1e12 ? `${l(e / 1e9, 2, 0)}B` : `${l(e / 1e12, 2, 0)}T`, te = (e) => e == null ? "" : e === 1 ? "1 byte" : e < 1024 ? `${x(e)} bytes` : e < 1048576 ? `${l(e / 1024, 2, 0)} KB` : e < 1073741824 ? `${l(e / 1048576, 2, 0)} MB` : e < 1099511627776 ? `${l(e / 1073741824, 2, 0)} GB` : `${l(e / 1099511627776, 2, 0)} TB`, re = (e) => e == null ? "" : e < 1e3 ? `${x(e)} ms` : e === 1e3 ? `${x(e)} sec` : e < 6e4 ? `${l(e / 1e3, 2, 0)} secs` : e === 6e4 ? "1 min" : e < 36e5 ? `${l(e / 6e4, 2, 0)} mins` : e === 36e5 ? "1 hr" : e < 864e5 ? `${l(e / 36e5, 2, 0)} hrs` : e === 864e5 ? "1 day" : `${l(e / 864e5, 2, 0)} days`, x = (e, r = N) => {
|
|
246
246
|
if (e == null) return "";
|
|
247
|
-
const
|
|
248
|
-
let
|
|
249
|
-
return
|
|
247
|
+
const a = `${r}decimal0.0`;
|
|
248
|
+
let t = w[a];
|
|
249
|
+
return t || (t = new Intl.NumberFormat(r, {
|
|
250
250
|
localeMatcher: "best fit",
|
|
251
251
|
maximumFractionDigits: 0,
|
|
252
252
|
minimumFractionDigits: 0,
|
|
253
253
|
minimumIntegerDigits: 1,
|
|
254
254
|
style: "decimal",
|
|
255
255
|
useGrouping: !0
|
|
256
|
-
}),
|
|
257
|
-
},
|
|
256
|
+
}), w[a] = t), t.format(e);
|
|
257
|
+
}, ae = (e) => {
|
|
258
258
|
switch (e) {
|
|
259
259
|
case "csv":
|
|
260
260
|
return "text/csv";
|
|
@@ -268,7 +268,7 @@ const W = "en-US", I = {}, Ae = (e) => {
|
|
|
268
268
|
default:
|
|
269
269
|
return "application/octet-stream";
|
|
270
270
|
}
|
|
271
|
-
},
|
|
271
|
+
}, D = [
|
|
272
272
|
{ id: "dtv", label: { "en-gb": "Delimited Text" } },
|
|
273
273
|
{ id: "e/e", label: { "en-gb": "Entity/Event" } },
|
|
274
274
|
{ id: "jsonArray", label: { "en-gb": "JSON Array" } },
|
|
@@ -276,22 +276,22 @@ const W = "en-US", I = {}, Ae = (e) => {
|
|
|
276
276
|
{ id: "xls", label: { "en-gb": "XLS" } },
|
|
277
277
|
{ id: "xlsx", label: { "en-gb": "XLSX" } },
|
|
278
278
|
{ id: "xml", label: { "en-gb": "XML" } }
|
|
279
|
-
],
|
|
280
|
-
const
|
|
281
|
-
for (const
|
|
282
|
-
return
|
|
283
|
-
},
|
|
279
|
+
], oe = (e = p) => {
|
|
280
|
+
const r = [];
|
|
281
|
+
for (const a of D) r.push({ ...a, label: a.label[e] || a.label[p] || a.id });
|
|
282
|
+
return r;
|
|
283
|
+
}, C = [
|
|
284
284
|
{ id: `
|
|
285
285
|
`, label: { "en-gb": "Newline" } },
|
|
286
286
|
{ id: "\r", label: { "en-gb": "Carriage Return" } },
|
|
287
287
|
{ id: `\r
|
|
288
288
|
`, label: { "en-gb": "Carriage Return/Newline" } }
|
|
289
|
-
],
|
|
290
|
-
const
|
|
291
|
-
for (const
|
|
292
|
-
|
|
293
|
-
return
|
|
294
|
-
},
|
|
289
|
+
], ne = (e = p) => {
|
|
290
|
+
const r = [];
|
|
291
|
+
for (const a of C)
|
|
292
|
+
r.push({ ...a, label: a.label[e] || a.label[p] || a.id });
|
|
293
|
+
return r;
|
|
294
|
+
}, A = [
|
|
295
295
|
{ id: ":", label: { "en-gb": "Colon" } },
|
|
296
296
|
{ id: ",", label: { "en-gb": "Comma" } },
|
|
297
297
|
{ id: "!", label: { "en-gb": "Exclamation Mark" } },
|
|
@@ -303,12 +303,12 @@ const W = "en-US", I = {}, Ae = (e) => {
|
|
|
303
303
|
{ id: "_", label: { "en-gb": "Underscore" } },
|
|
304
304
|
{ id: "0x1F", label: { "en-gb": "Unit Separator" } },
|
|
305
305
|
{ id: "|", label: { "en-gb": "Vertical Bar" } }
|
|
306
|
-
],
|
|
307
|
-
const
|
|
308
|
-
for (const
|
|
309
|
-
|
|
310
|
-
return
|
|
311
|
-
},
|
|
306
|
+
], se = (e = p) => {
|
|
307
|
+
const r = [];
|
|
308
|
+
for (const a of A)
|
|
309
|
+
r.push({ ...a, label: a.label[e] || a.label[p] || a.id });
|
|
310
|
+
return r;
|
|
311
|
+
}, F = [
|
|
312
312
|
{ id: "alpha", color: "red", label: { "en-gb": "alpha" } },
|
|
313
313
|
{ id: "beta", color: "amber", label: { "en-gb": "beta" } },
|
|
314
314
|
{ id: "generalAvailability", color: "green", label: { "en-gb": "" } },
|
|
@@ -318,375 +318,104 @@ const W = "en-US", I = {}, Ae = (e) => {
|
|
|
318
318
|
{ id: "releaseCandidate", color: "green", label: { "en-gb": "release-candidate" } },
|
|
319
319
|
{ id: "unavailable", color: "other", label: { "en-gb": "unavailable" } },
|
|
320
320
|
{ id: "underReview", color: "other", label: { "en-gb": "under-review" } }
|
|
321
|
-
],
|
|
322
|
-
const
|
|
323
|
-
return
|
|
324
|
-
},
|
|
325
|
-
|
|
326
|
-
reset: [0, 0],
|
|
327
|
-
// 21 isn't widely supported and 22 does the same thing
|
|
328
|
-
bold: [1, 22],
|
|
329
|
-
dim: [2, 22],
|
|
330
|
-
italic: [3, 23],
|
|
331
|
-
underline: [4, 24],
|
|
332
|
-
overline: [53, 55],
|
|
333
|
-
inverse: [7, 27],
|
|
334
|
-
hidden: [8, 28],
|
|
335
|
-
strikethrough: [9, 29]
|
|
336
|
-
},
|
|
337
|
-
color: {
|
|
338
|
-
black: [30, 39],
|
|
339
|
-
red: [31, 39],
|
|
340
|
-
green: [32, 39],
|
|
341
|
-
yellow: [33, 39],
|
|
342
|
-
blue: [34, 39],
|
|
343
|
-
magenta: [35, 39],
|
|
344
|
-
cyan: [36, 39],
|
|
345
|
-
white: [37, 39],
|
|
346
|
-
// Bright color
|
|
347
|
-
blackBright: [90, 39],
|
|
348
|
-
gray: [90, 39],
|
|
349
|
-
// Alias of `blackBright`
|
|
350
|
-
grey: [90, 39],
|
|
351
|
-
// Alias of `blackBright`
|
|
352
|
-
redBright: [91, 39],
|
|
353
|
-
greenBright: [92, 39],
|
|
354
|
-
yellowBright: [93, 39],
|
|
355
|
-
blueBright: [94, 39],
|
|
356
|
-
magentaBright: [95, 39],
|
|
357
|
-
cyanBright: [96, 39],
|
|
358
|
-
whiteBright: [97, 39]
|
|
359
|
-
},
|
|
360
|
-
bgColor: {
|
|
361
|
-
bgBlack: [40, 49],
|
|
362
|
-
bgRed: [41, 49],
|
|
363
|
-
bgGreen: [42, 49],
|
|
364
|
-
bgYellow: [43, 49],
|
|
365
|
-
bgBlue: [44, 49],
|
|
366
|
-
bgMagenta: [45, 49],
|
|
367
|
-
bgCyan: [46, 49],
|
|
368
|
-
bgWhite: [47, 49],
|
|
369
|
-
// Bright color
|
|
370
|
-
bgBlackBright: [100, 49],
|
|
371
|
-
bgGray: [100, 49],
|
|
372
|
-
// Alias of `bgBlackBright`
|
|
373
|
-
bgGrey: [100, 49],
|
|
374
|
-
// Alias of `bgBlackBright`
|
|
375
|
-
bgRedBright: [101, 49],
|
|
376
|
-
bgGreenBright: [102, 49],
|
|
377
|
-
bgYellowBright: [103, 49],
|
|
378
|
-
bgBlueBright: [104, 49],
|
|
379
|
-
bgMagentaBright: [105, 49],
|
|
380
|
-
bgCyanBright: [106, 49],
|
|
381
|
-
bgWhiteBright: [107, 49]
|
|
382
|
-
}
|
|
383
|
-
};
|
|
384
|
-
Object.keys(i.modifier);
|
|
385
|
-
const q = Object.keys(i.color), Q = Object.keys(i.bgColor);
|
|
386
|
-
[...q, ...Q];
|
|
387
|
-
function ee() {
|
|
388
|
-
const e = /* @__PURE__ */ new Map();
|
|
389
|
-
for (const [t, o] of Object.entries(i)) {
|
|
390
|
-
for (const [r, n] of Object.entries(o))
|
|
391
|
-
i[r] = {
|
|
392
|
-
open: `\x1B[${n[0]}m`,
|
|
393
|
-
close: `\x1B[${n[1]}m`
|
|
394
|
-
}, o[r] = i[r], e.set(n[0], n[1]);
|
|
395
|
-
Object.defineProperty(i, t, {
|
|
396
|
-
value: o,
|
|
397
|
-
enumerable: !1
|
|
398
|
-
});
|
|
399
|
-
}
|
|
400
|
-
return Object.defineProperty(i, "codes", {
|
|
401
|
-
value: e,
|
|
402
|
-
enumerable: !1
|
|
403
|
-
}), i.color.close = "\x1B[39m", i.bgColor.close = "\x1B[49m", i.color.ansi = $(), i.color.ansi256 = M(), i.color.ansi16m = L(), i.bgColor.ansi = $(F), i.bgColor.ansi256 = M(F), i.bgColor.ansi16m = L(F), Object.defineProperties(i, {
|
|
404
|
-
rgbToAnsi256: {
|
|
405
|
-
value(t, o, r) {
|
|
406
|
-
return t === o && o === r ? t < 8 ? 16 : t > 248 ? 231 : Math.round((t - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(t / 255 * 5) + 6 * Math.round(o / 255 * 5) + Math.round(r / 255 * 5);
|
|
407
|
-
},
|
|
408
|
-
enumerable: !1
|
|
409
|
-
},
|
|
410
|
-
hexToRgb: {
|
|
411
|
-
value(t) {
|
|
412
|
-
const o = /[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));
|
|
413
|
-
if (!o)
|
|
414
|
-
return [0, 0, 0];
|
|
415
|
-
let [r] = o;
|
|
416
|
-
r.length === 3 && (r = [...r].map((a) => a + a).join(""));
|
|
417
|
-
const n = Number.parseInt(r, 16);
|
|
418
|
-
return [
|
|
419
|
-
/* eslint-disable no-bitwise */
|
|
420
|
-
n >> 16 & 255,
|
|
421
|
-
n >> 8 & 255,
|
|
422
|
-
n & 255
|
|
423
|
-
/* eslint-enable no-bitwise */
|
|
424
|
-
];
|
|
425
|
-
},
|
|
426
|
-
enumerable: !1
|
|
427
|
-
},
|
|
428
|
-
hexToAnsi256: {
|
|
429
|
-
value: (t) => i.rgbToAnsi256(...i.hexToRgb(t)),
|
|
430
|
-
enumerable: !1
|
|
431
|
-
},
|
|
432
|
-
ansi256ToAnsi: {
|
|
433
|
-
value(t) {
|
|
434
|
-
if (t < 8)
|
|
435
|
-
return 30 + t;
|
|
436
|
-
if (t < 16)
|
|
437
|
-
return 90 + (t - 8);
|
|
438
|
-
let o, r, n;
|
|
439
|
-
if (t >= 232)
|
|
440
|
-
o = ((t - 232) * 10 + 8) / 255, r = o, n = o;
|
|
441
|
-
else {
|
|
442
|
-
t -= 16;
|
|
443
|
-
const c = t % 36;
|
|
444
|
-
o = Math.floor(t / 36) / 5, r = Math.floor(c / 6) / 5, n = c % 6 / 5;
|
|
445
|
-
}
|
|
446
|
-
const a = Math.max(o, r, n) * 2;
|
|
447
|
-
if (a === 0)
|
|
448
|
-
return 30;
|
|
449
|
-
let s = 30 + (Math.round(n) << 2 | Math.round(r) << 1 | Math.round(o));
|
|
450
|
-
return a === 2 && (s += 60), s;
|
|
451
|
-
},
|
|
452
|
-
enumerable: !1
|
|
453
|
-
},
|
|
454
|
-
rgbToAnsi: {
|
|
455
|
-
value: (t, o, r) => i.ansi256ToAnsi(i.rgbToAnsi256(t, o, r)),
|
|
456
|
-
enumerable: !1
|
|
457
|
-
},
|
|
458
|
-
hexToAnsi: {
|
|
459
|
-
value: (t) => i.ansi256ToAnsi(i.hexToAnsi256(t)),
|
|
460
|
-
enumerable: !1
|
|
461
|
-
}
|
|
462
|
-
}), i;
|
|
463
|
-
}
|
|
464
|
-
const p = ee(), J = (() => {
|
|
465
|
-
if (!("navigator" in globalThis))
|
|
466
|
-
return 0;
|
|
467
|
-
if (globalThis.navigator.userAgentData) {
|
|
468
|
-
const e = navigator.userAgentData.brands.find(({ brand: t }) => t === "Chromium");
|
|
469
|
-
if (e && e.version > 93)
|
|
470
|
-
return 3;
|
|
471
|
-
}
|
|
472
|
-
return /\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent) ? 1 : 0;
|
|
473
|
-
})(), _ = J !== 0 && {
|
|
474
|
-
level: J
|
|
475
|
-
}, te = {
|
|
476
|
-
stdout: _,
|
|
477
|
-
stderr: _
|
|
478
|
-
};
|
|
479
|
-
function re(e, t, o) {
|
|
480
|
-
let r = e.indexOf(t);
|
|
481
|
-
if (r === -1)
|
|
482
|
-
return e;
|
|
483
|
-
const n = t.length;
|
|
484
|
-
let a = 0, s = "";
|
|
485
|
-
do
|
|
486
|
-
s += e.slice(a, r) + t + o, a = r + n, r = e.indexOf(t, a);
|
|
487
|
-
while (r !== -1);
|
|
488
|
-
return s += e.slice(a), s;
|
|
489
|
-
}
|
|
490
|
-
function oe(e, t, o, r) {
|
|
491
|
-
let n = 0, a = "";
|
|
492
|
-
do {
|
|
493
|
-
const s = e[r - 1] === "\r";
|
|
494
|
-
a += e.slice(n, s ? r - 1 : r) + t + (s ? `\r
|
|
495
|
-
` : `
|
|
496
|
-
`) + o, n = r + 1, r = e.indexOf(`
|
|
497
|
-
`, n);
|
|
498
|
-
} while (r !== -1);
|
|
499
|
-
return a += e.slice(n), a;
|
|
500
|
-
}
|
|
501
|
-
const { stdout: P, stderr: U } = te, R = Symbol("GENERATOR"), v = Symbol("STYLER"), E = Symbol("IS_EMPTY"), G = [
|
|
502
|
-
"ansi",
|
|
503
|
-
"ansi",
|
|
504
|
-
"ansi256",
|
|
505
|
-
"ansi16m"
|
|
506
|
-
], w = /* @__PURE__ */ Object.create(null), ne = (e, t = {}) => {
|
|
507
|
-
if (t.level && !(Number.isInteger(t.level) && t.level >= 0 && t.level <= 3))
|
|
508
|
-
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
509
|
-
const o = P ? P.level : 0;
|
|
510
|
-
e.level = t.level === void 0 ? o : t.level;
|
|
511
|
-
}, ae = (e) => {
|
|
512
|
-
const t = (...o) => o.join(" ");
|
|
513
|
-
return ne(t, e), Object.setPrototypeOf(t, S.prototype), t;
|
|
514
|
-
};
|
|
515
|
-
function S(e) {
|
|
516
|
-
return ae(e);
|
|
517
|
-
}
|
|
518
|
-
Object.setPrototypeOf(S.prototype, Function.prototype);
|
|
519
|
-
for (const [e, t] of Object.entries(p))
|
|
520
|
-
w[e] = {
|
|
521
|
-
get() {
|
|
522
|
-
const o = A(this, B(t.open, t.close, this[v]), this[E]);
|
|
523
|
-
return Object.defineProperty(this, e, { value: o }), o;
|
|
524
|
-
}
|
|
525
|
-
};
|
|
526
|
-
w.visible = {
|
|
527
|
-
get() {
|
|
528
|
-
const e = A(this, this[v], !0);
|
|
529
|
-
return Object.defineProperty(this, "visible", { value: e }), e;
|
|
530
|
-
}
|
|
531
|
-
};
|
|
532
|
-
const j = (e, t, o, ...r) => e === "rgb" ? t === "ansi16m" ? p[o].ansi16m(...r) : t === "ansi256" ? p[o].ansi256(p.rgbToAnsi256(...r)) : p[o].ansi(p.rgbToAnsi(...r)) : e === "hex" ? j("rgb", t, o, ...p.hexToRgb(...r)) : p[o][e](...r), se = ["rgb", "hex", "ansi256"];
|
|
533
|
-
for (const e of se) {
|
|
534
|
-
w[e] = {
|
|
535
|
-
get() {
|
|
536
|
-
const { level: o } = this;
|
|
537
|
-
return function(...r) {
|
|
538
|
-
const n = B(j(e, G[o], "color", ...r), p.color.close, this[v]);
|
|
539
|
-
return A(this, n, this[E]);
|
|
540
|
-
};
|
|
541
|
-
}
|
|
542
|
-
};
|
|
543
|
-
const t = "bg" + e[0].toUpperCase() + e.slice(1);
|
|
544
|
-
w[t] = {
|
|
545
|
-
get() {
|
|
546
|
-
const { level: o } = this;
|
|
547
|
-
return function(...r) {
|
|
548
|
-
const n = B(j(e, G[o], "bgColor", ...r), p.bgColor.close, this[v]);
|
|
549
|
-
return A(this, n, this[E]);
|
|
550
|
-
};
|
|
551
|
-
}
|
|
552
|
-
};
|
|
553
|
-
}
|
|
554
|
-
const ie = Object.defineProperties(() => {
|
|
555
|
-
}, {
|
|
556
|
-
...w,
|
|
557
|
-
level: {
|
|
558
|
-
enumerable: !0,
|
|
559
|
-
get() {
|
|
560
|
-
return this[R].level;
|
|
561
|
-
},
|
|
562
|
-
set(e) {
|
|
563
|
-
this[R].level = e;
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
}), B = (e, t, o) => {
|
|
567
|
-
let r, n;
|
|
568
|
-
return o === void 0 ? (r = e, n = t) : (r = o.openAll + e, n = t + o.closeAll), {
|
|
569
|
-
open: e,
|
|
570
|
-
close: t,
|
|
571
|
-
openAll: r,
|
|
572
|
-
closeAll: n,
|
|
573
|
-
parent: o
|
|
574
|
-
};
|
|
575
|
-
}, A = (e, t, o) => {
|
|
576
|
-
const r = (...n) => le(r, n.length === 1 ? "" + n[0] : n.join(" "));
|
|
577
|
-
return Object.setPrototypeOf(r, ie), r[R] = e, r[v] = t, r[E] = o, r;
|
|
578
|
-
}, le = (e, t) => {
|
|
579
|
-
if (e.level <= 0 || !t)
|
|
580
|
-
return e[E] ? "" : t;
|
|
581
|
-
let o = e[v];
|
|
582
|
-
if (o === void 0)
|
|
583
|
-
return t;
|
|
584
|
-
const { openAll: r, closeAll: n } = o;
|
|
585
|
-
if (t.includes("\x1B"))
|
|
586
|
-
for (; o !== void 0; )
|
|
587
|
-
t = re(t, o.close, o.open), o = o.parent;
|
|
588
|
-
const a = t.indexOf(`
|
|
589
|
-
`);
|
|
590
|
-
return a !== -1 && (t = oe(t, n, r, a)), r + t + n;
|
|
591
|
-
};
|
|
592
|
-
Object.defineProperties(S.prototype, w);
|
|
593
|
-
const m = S();
|
|
594
|
-
S({ level: U ? U.level : 0 });
|
|
595
|
-
const ce = ["createObject", "dropObject", "removeRecords", "upsertRecords"], ue = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"];
|
|
596
|
-
async function Je() {
|
|
321
|
+
], ie = (e, r = p) => {
|
|
322
|
+
const a = F.find((t) => t.id === e);
|
|
323
|
+
return a ? { ...a, label: a.label[r] || a.label[p] || e } : { id: e, color: "other", label: e };
|
|
324
|
+
}, R = ["createObject", "dropObject", "removeRecords", "upsertRecords"], $ = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"];
|
|
325
|
+
async function ce() {
|
|
597
326
|
try {
|
|
598
327
|
console.log("🚀 Building connector configuration...");
|
|
599
|
-
const e = await JSON.parse(await
|
|
600
|
-
let
|
|
601
|
-
const
|
|
602
|
-
const
|
|
603
|
-
return
|
|
328
|
+
const e = await JSON.parse(await i.readFile("package.json", "utf8")), r = await JSON.parse(await i.readFile("config.json", "utf8")), a = await i.readFile("src/index.ts", "utf8");
|
|
329
|
+
let t = !1, n = !1;
|
|
330
|
+
const o = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, s = [...a.matchAll(o)].filter((u) => !u[1] && u[2] !== "constructor").map((u) => {
|
|
331
|
+
const c = u[2];
|
|
332
|
+
return t = t || R.includes(c), n = n || $.includes(c), c;
|
|
604
333
|
});
|
|
605
|
-
s.length > 0 ? console.log(`ℹ️
|
|
606
|
-
const
|
|
607
|
-
console.log(
|
|
334
|
+
s.length > 0 ? console.log(`ℹ️ Implements ${s.length} operations.`) : console.log("⚠️ Implements no operations.");
|
|
335
|
+
const d = n && t ? "bidirectional" : n ? "source" : t ? "destination" : null;
|
|
336
|
+
console.log(d ? `ℹ️ Supports ${d} usage.` : "⚠️ No usage identified."), e.name && (r.id = e.name), r.operations = s, r.usageId = d, e.version && (r.version = e.version), await i.writeFile("config.json", JSON.stringify(r, void 0, 4), "utf8"), console.log("✅ Connector configuration built.");
|
|
608
337
|
} catch (e) {
|
|
609
338
|
console.warn("❌ Error building connector configuration.", e);
|
|
610
339
|
}
|
|
611
340
|
}
|
|
612
|
-
async function
|
|
341
|
+
async function le() {
|
|
613
342
|
try {
|
|
614
343
|
console.log("🚀 Building context configuration...");
|
|
615
|
-
const e = await JSON.parse(await
|
|
616
|
-
e.name && (
|
|
344
|
+
const e = await JSON.parse(await i.readFile("package.json", "utf8")), r = await JSON.parse(await i.readFile("config.json", "utf8")), a = await i.readFile("src/index.ts", "utf8"), t = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, n = [...a.matchAll(t)].filter((o) => !o[1] && o[2] !== "constructor").map((o) => o[2]);
|
|
345
|
+
e.name && (r.id = e.name), r.operations = n, e.version && (r.version = e.version), await i.writeFile("config.json", JSON.stringify(r, void 0, 4), "utf8");
|
|
617
346
|
} catch (e) {
|
|
618
347
|
console.warn("❌ Error building context configuration.", e);
|
|
619
348
|
}
|
|
620
349
|
}
|
|
621
|
-
async function
|
|
350
|
+
async function de() {
|
|
622
351
|
try {
|
|
623
352
|
console.log("🚀 Building informer configuration...");
|
|
624
|
-
const e = await JSON.parse(await
|
|
625
|
-
e.name && (
|
|
353
|
+
const e = await JSON.parse(await i.readFile("package.json", "utf8")), r = await JSON.parse(await i.readFile("config.json", "utf8")), a = await i.readFile("src/index.ts", "utf8"), t = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, n = [...a.matchAll(t)].filter((o) => !o[1] && o[2] !== "constructor").map((o) => o[2]);
|
|
354
|
+
e.name && (r.id = e.name), r.operations = n, e.version && (r.version = e.version), await i.writeFile("config.json", JSON.stringify(r, void 0, 4), "utf8");
|
|
626
355
|
} catch (e) {
|
|
627
356
|
console.warn("❌ Error building informer configuration.", e);
|
|
628
357
|
}
|
|
629
358
|
}
|
|
630
|
-
async function
|
|
359
|
+
async function ue() {
|
|
631
360
|
try {
|
|
632
361
|
console.log("🚀 Building presenter configuration...");
|
|
633
|
-
const e = await JSON.parse(await
|
|
634
|
-
e.name && (
|
|
362
|
+
const e = await JSON.parse(await i.readFile("package.json", "utf8")), r = await JSON.parse(await i.readFile("config.json", "utf8")), a = await i.readFile("src/index.ts", "utf8"), t = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, n = [...a.matchAll(t)].filter((o) => !o[1] && o[2] !== "constructor").map((o) => o[2]);
|
|
363
|
+
e.name && (r.id = e.name), r.operations = n, e.version && (r.version = e.version), await i.writeFile("config.json", JSON.stringify(r, void 0, 4), "utf8");
|
|
635
364
|
} catch (e) {
|
|
636
365
|
console.warn("❌ Error building context configuration.", e);
|
|
637
366
|
}
|
|
638
367
|
}
|
|
639
|
-
async function
|
|
368
|
+
async function ge() {
|
|
640
369
|
try {
|
|
641
370
|
console.log("🚀 Bumping version...");
|
|
642
|
-
const e = await JSON.parse(await
|
|
371
|
+
const e = await JSON.parse(await i.readFile("package.json", "utf8"));
|
|
643
372
|
if (e.version) {
|
|
644
|
-
const
|
|
645
|
-
e.version = `${
|
|
373
|
+
const r = e.version, a = e.version.split(".");
|
|
374
|
+
e.version = `${a[0]}.${a[1]}.${Number(a[2]) + 1}`, await i.writeFile("package.json", JSON.stringify(e, void 0, 4), "utf8"), console.log(`✅ Version bumped from ${r} to ${e.version}.`);
|
|
646
375
|
} else
|
|
647
|
-
e.version = "0.0.001", await
|
|
376
|
+
e.version = "0.0.001", await i.writeFile("package.json", JSON.stringify(e, void 0, 4), "utf8"), console.log(`⚠️ Version initialised to ${e.version}.`);
|
|
648
377
|
} catch (e) {
|
|
649
378
|
console.warn("❌ Error bumping package version.", e);
|
|
650
379
|
}
|
|
651
380
|
}
|
|
652
|
-
const
|
|
381
|
+
const p = "en-gb";
|
|
653
382
|
export {
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
383
|
+
z as APIError,
|
|
384
|
+
h as ApplicationError,
|
|
385
|
+
p as DEFAULT_LOCALE_CODE,
|
|
386
|
+
j as DefaultTimestamp,
|
|
387
|
+
H as EngineError,
|
|
388
|
+
S as FetchError,
|
|
389
|
+
W as OperationalError,
|
|
390
|
+
T as VueError,
|
|
391
|
+
P as WindowPromiseRejectionError,
|
|
392
|
+
V as WindowRuntimeError,
|
|
393
|
+
ce as buildConnectorConfig,
|
|
394
|
+
le as buildContextConfig,
|
|
395
|
+
X as buildFetchError,
|
|
396
|
+
de as buildInformerConfig,
|
|
397
|
+
ue as buildPresenterConfig,
|
|
398
|
+
ge as bumpVersion,
|
|
399
|
+
G as concatenateSerialisedErrorMessages,
|
|
400
|
+
_ as convertMillisecondsToTimestamp,
|
|
401
|
+
q as convertODataTypeIdToUsageTypeId,
|
|
402
|
+
Y as extractExtensionFromPath,
|
|
403
|
+
Q as extractNameFromPath,
|
|
404
|
+
l as formatNumberAsDecimalNumber,
|
|
405
|
+
re as formatNumberAsDuration,
|
|
406
|
+
ee as formatNumberAsSize,
|
|
407
|
+
te as formatNumberAsStorageSize,
|
|
408
|
+
x as formatNumberAsWholeNumber,
|
|
409
|
+
ie as getComponentStatus,
|
|
410
|
+
J as getCurrentTimestamp,
|
|
411
|
+
oe as getDataFormats,
|
|
412
|
+
ne as getRecordDelimiters,
|
|
413
|
+
se as getValueDelimiters,
|
|
414
|
+
ae as lookupMimeTypeForExtension,
|
|
415
|
+
Z as normalizeToError,
|
|
416
|
+
L as presentationViewTypeMap,
|
|
417
|
+
K as serialiseError,
|
|
418
|
+
B as useCytoscapeJS,
|
|
419
|
+
M as useDataTable,
|
|
420
|
+
U as useHighcharts
|
|
692
421
|
};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@datapos/datapos-shared",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.3.
|
|
5
|
+
"version": "0.3.131",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
@@ -53,12 +53,5 @@
|
|
|
53
53
|
"test": "echo \"***** TEST SCRIPT NOT IMPLEMENTED. *****\"",
|
|
54
54
|
"updateDependencies": "npm run updateOperations",
|
|
55
55
|
"updateOperations": "npm install -D @datapos/datapos-development@latest"
|
|
56
|
-
},
|
|
57
|
-
"dependencies": {
|
|
58
|
-
"chalk": "^5.6.2",
|
|
59
|
-
"install": "^0.13.0",
|
|
60
|
-
"log-symbols": "^7.0.1",
|
|
61
|
-
"npm": "^11.6.2",
|
|
62
|
-
"uninstall": "^0.0.0"
|
|
63
56
|
}
|
|
64
57
|
}
|