@datapos/datapos-shared 0.3.127 → 0.3.129
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 +65 -65
- package/package.json +12 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { promises as i } from "fs";
|
|
2
|
-
const
|
|
2
|
+
const _ = 0, J = (e) => e, L = () => Date.now(), B = {
|
|
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,13 +18,13 @@ const j = 0, _ = (e) => e, J = () => Date.now(), L = {
|
|
|
18
18
|
streamgraph: { categoryId: "streamgraph", label: { "en-gb": "Streamgraph" }, options: {} },
|
|
19
19
|
values: { categoryId: "values", label: { "en-gb": "Values" }, options: {} }
|
|
20
20
|
};
|
|
21
|
-
function
|
|
21
|
+
function M() {
|
|
22
22
|
function e(r, a, t) {
|
|
23
23
|
t.textContent = "Cytoscape.js diagram goes here...";
|
|
24
24
|
}
|
|
25
25
|
return { render: e };
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function U() {
|
|
28
28
|
function e(r, a, t) {
|
|
29
29
|
t.textContent = "values table goes here...";
|
|
30
30
|
}
|
|
@@ -32,7 +32,7 @@ function M() {
|
|
|
32
32
|
}
|
|
33
33
|
const O = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", E = "highcharts";
|
|
34
34
|
let b, I = !1;
|
|
35
|
-
function
|
|
35
|
+
function z() {
|
|
36
36
|
async function e(o, s, d, u) {
|
|
37
37
|
await t();
|
|
38
38
|
const c = [];
|
|
@@ -107,12 +107,12 @@ class h extends v {
|
|
|
107
107
|
super(r, a, t), this.name = "ApplicationError";
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
class
|
|
110
|
+
class H extends h {
|
|
111
111
|
constructor(r, a, t) {
|
|
112
112
|
super(r, a, t), this.name = "APIError";
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
class
|
|
115
|
+
class V extends h {
|
|
116
116
|
constructor(r, a, t) {
|
|
117
117
|
super(r, a, t), this.name = "EngineError";
|
|
118
118
|
}
|
|
@@ -130,29 +130,29 @@ class T extends h {
|
|
|
130
130
|
super(r, a, o), this.name = "VueHandledError", this.info = t, this.componentName = n;
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
class
|
|
133
|
+
class P extends h {
|
|
134
134
|
constructor(r, a, t) {
|
|
135
135
|
super(r, a, t), this.name = "WindowHandledRuntimeError";
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
class
|
|
138
|
+
class W extends h {
|
|
139
139
|
constructor(r, a, t) {
|
|
140
140
|
super(r, a, t), this.name = "WindowHandledPromiseRejectionError";
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
class
|
|
143
|
+
class X extends v {
|
|
144
144
|
constructor(r, a, t) {
|
|
145
145
|
super(r, a, t), this.name = "OperationalError";
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
async function
|
|
148
|
+
async function G(e, r, a) {
|
|
149
149
|
const t = `${r} Response status '${e.status}${e.statusText ? ` - ${e.statusText}` : ""}' received.`, n = await e.text();
|
|
150
150
|
return new S(t, a, n);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function Z(e) {
|
|
153
153
|
return e.map((r) => r.message).join(" ");
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function K(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 {
|
|
@@ -161,7 +161,7 @@ function Z(e, r = "Unknown error.") {
|
|
|
161
161
|
return new Error(r);
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function q(e) {
|
|
165
165
|
const r = /* @__PURE__ */ new Set(), a = [];
|
|
166
166
|
let t = e;
|
|
167
167
|
for (; t && !r.has(t); ) {
|
|
@@ -181,7 +181,7 @@ function K(e) {
|
|
|
181
181
|
}
|
|
182
182
|
return a;
|
|
183
183
|
}
|
|
184
|
-
const N = "en-US", w = {},
|
|
184
|
+
const N = "en-US", w = {}, Q = (e) => {
|
|
185
185
|
switch (e) {
|
|
186
186
|
case "Edm.Binary":
|
|
187
187
|
return "unknown";
|
|
@@ -220,12 +220,12 @@ const N = "en-US", w = {}, q = (e) => {
|
|
|
220
220
|
default:
|
|
221
221
|
return "unknown";
|
|
222
222
|
}
|
|
223
|
-
},
|
|
223
|
+
}, Y = (e) => {
|
|
224
224
|
if (e) {
|
|
225
225
|
const r = e.lastIndexOf("/"), a = e.lastIndexOf(".", r > -1 ? r : e.length);
|
|
226
226
|
return a > -1 ? e.substring(0, a) : e;
|
|
227
227
|
}
|
|
228
|
-
},
|
|
228
|
+
}, ee = (e) => {
|
|
229
229
|
if (e) {
|
|
230
230
|
const r = e.lastIndexOf(".");
|
|
231
231
|
if (r > -1) return e.substring(r + 1);
|
|
@@ -242,7 +242,7 @@ const N = "en-US", w = {}, q = (e) => {
|
|
|
242
242
|
style: "decimal",
|
|
243
243
|
useGrouping: !0
|
|
244
244
|
}), w[n] = o), o.format(e);
|
|
245
|
-
},
|
|
245
|
+
}, te = (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`, re = (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`, ae = (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
247
|
const a = `${r}decimal0.0`;
|
|
248
248
|
let t = w[a];
|
|
@@ -254,7 +254,7 @@ const N = "en-US", w = {}, q = (e) => {
|
|
|
254
254
|
style: "decimal",
|
|
255
255
|
useGrouping: !0
|
|
256
256
|
}), w[a] = t), t.format(e);
|
|
257
|
-
},
|
|
257
|
+
}, oe = (e) => {
|
|
258
258
|
switch (e) {
|
|
259
259
|
case "csv":
|
|
260
260
|
return "text/csv";
|
|
@@ -276,7 +276,7 @@ const N = "en-US", w = {}, q = (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
|
-
],
|
|
279
|
+
], ne = (e = p) => {
|
|
280
280
|
const r = [];
|
|
281
281
|
for (const a of D) r.push({ ...a, label: a.label[e] || a.label[p] || a.id });
|
|
282
282
|
return r;
|
|
@@ -286,7 +286,7 @@ const N = "en-US", w = {}, q = (e) => {
|
|
|
286
286
|
{ id: "\r", label: { "en-gb": "Carriage Return" } },
|
|
287
287
|
{ id: `\r
|
|
288
288
|
`, label: { "en-gb": "Carriage Return/Newline" } }
|
|
289
|
-
],
|
|
289
|
+
], se = (e = p) => {
|
|
290
290
|
const r = [];
|
|
291
291
|
for (const a of C)
|
|
292
292
|
r.push({ ...a, label: a.label[e] || a.label[p] || a.id });
|
|
@@ -303,7 +303,7 @@ const N = "en-US", w = {}, q = (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
|
-
],
|
|
306
|
+
], ie = (e = p) => {
|
|
307
307
|
const r = [];
|
|
308
308
|
for (const a of A)
|
|
309
309
|
r.push({ ...a, label: a.label[e] || a.label[p] || a.id });
|
|
@@ -318,27 +318,27 @@ const N = "en-US", w = {}, q = (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
|
-
],
|
|
321
|
+
], ce = (e, r = p) => {
|
|
322
322
|
const a = F.find((t) => t.id === e);
|
|
323
323
|
return a ? { ...a, label: a.label[r] || a.label[p] || e } : { id: e, color: "other", label: e };
|
|
324
|
-
}, R = ["createObject", "dropObject", "removeRecords", "upsertRecords"],
|
|
325
|
-
async function
|
|
324
|
+
}, R = "✅", $ = ["createObject", "dropObject", "removeRecords", "upsertRecords"], k = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"];
|
|
325
|
+
async function le() {
|
|
326
326
|
try {
|
|
327
|
-
console.log("
|
|
327
|
+
console.log("● Building connector configuration...");
|
|
328
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
329
|
let t = !1, n = !1;
|
|
330
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
331
|
const c = u[2];
|
|
332
|
-
return t = t ||
|
|
332
|
+
return t = t || $.includes(c), n = n || k.includes(c), c;
|
|
333
333
|
});
|
|
334
|
-
s.length > 0 ? console.log(
|
|
334
|
+
s.length > 0 ? console.log(`ℹ Implements ${s.length} operations.`) : console.log("⚠ Implements no operations.");
|
|
335
335
|
const d = n && t ? "bidirectional" : n ? "source" : t ? "destination" : null;
|
|
336
|
-
console.log(d ?
|
|
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(R, "Connector configuration built.");
|
|
337
337
|
} catch (e) {
|
|
338
|
-
console.warn("
|
|
338
|
+
console.warn("✗ Error building connector configuration.", e);
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
|
-
async function
|
|
341
|
+
async function de() {
|
|
342
342
|
try {
|
|
343
343
|
console.log("🚀 Building context configuration...");
|
|
344
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]);
|
|
@@ -347,7 +347,7 @@ async function le() {
|
|
|
347
347
|
console.warn("❌ Error building context configuration.", e);
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
async function
|
|
350
|
+
async function ue() {
|
|
351
351
|
try {
|
|
352
352
|
console.log("🚀 Building informer configuration...");
|
|
353
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]);
|
|
@@ -356,7 +356,7 @@ async function de() {
|
|
|
356
356
|
console.warn("❌ Error building informer configuration.", e);
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
async function
|
|
359
|
+
async function ge() {
|
|
360
360
|
try {
|
|
361
361
|
console.log("🚀 Building presenter configuration...");
|
|
362
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]);
|
|
@@ -365,7 +365,7 @@ async function ue() {
|
|
|
365
365
|
console.warn("❌ Error building context configuration.", e);
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
-
async function
|
|
368
|
+
async function pe() {
|
|
369
369
|
try {
|
|
370
370
|
console.log("🚀 Bumping version...");
|
|
371
371
|
const e = await JSON.parse(await i.readFile("package.json", "utf8"));
|
|
@@ -380,42 +380,42 @@ async function ge() {
|
|
|
380
380
|
}
|
|
381
381
|
const p = "en-gb";
|
|
382
382
|
export {
|
|
383
|
-
|
|
383
|
+
H as APIError,
|
|
384
384
|
h as ApplicationError,
|
|
385
385
|
p as DEFAULT_LOCALE_CODE,
|
|
386
|
-
|
|
387
|
-
|
|
386
|
+
_ as DefaultTimestamp,
|
|
387
|
+
V as EngineError,
|
|
388
388
|
S as FetchError,
|
|
389
|
-
|
|
389
|
+
X as OperationalError,
|
|
390
390
|
T as VueError,
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
391
|
+
W as WindowPromiseRejectionError,
|
|
392
|
+
P as WindowRuntimeError,
|
|
393
|
+
le as buildConnectorConfig,
|
|
394
|
+
de as buildContextConfig,
|
|
395
|
+
G as buildFetchError,
|
|
396
|
+
ue as buildInformerConfig,
|
|
397
|
+
ge as buildPresenterConfig,
|
|
398
|
+
pe as bumpVersion,
|
|
399
|
+
Z as concatenateSerialisedErrorMessages,
|
|
400
|
+
J as convertMillisecondsToTimestamp,
|
|
401
|
+
Q as convertODataTypeIdToUsageTypeId,
|
|
402
|
+
ee as extractExtensionFromPath,
|
|
403
|
+
Y as extractNameFromPath,
|
|
404
404
|
l as formatNumberAsDecimalNumber,
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
405
|
+
ae as formatNumberAsDuration,
|
|
406
|
+
te as formatNumberAsSize,
|
|
407
|
+
re as formatNumberAsStorageSize,
|
|
408
408
|
x as formatNumberAsWholeNumber,
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
409
|
+
ce as getComponentStatus,
|
|
410
|
+
L as getCurrentTimestamp,
|
|
411
|
+
ne as getDataFormats,
|
|
412
|
+
se as getRecordDelimiters,
|
|
413
|
+
ie as getValueDelimiters,
|
|
414
|
+
oe as lookupMimeTypeForExtension,
|
|
415
|
+
K as normalizeToError,
|
|
416
|
+
B as presentationViewTypeMap,
|
|
417
|
+
q as serialiseError,
|
|
418
|
+
M as useCytoscapeJS,
|
|
419
|
+
U as useDataTable,
|
|
420
|
+
z as useHighcharts
|
|
421
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.129",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
},
|
|
17
17
|
"types": "./dist/types/src/index.d.ts",
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@datapos/datapos-development": "^0.3.
|
|
19
|
+
"@datapos/datapos-development": "^0.3.39",
|
|
20
20
|
"@types/markdown-it": "^14.1.2",
|
|
21
|
-
"@types/node": "^24.
|
|
22
|
-
"@typescript-eslint/eslint-plugin": "^8.46.
|
|
23
|
-
"@typescript-eslint/parser": "^8.46.
|
|
21
|
+
"@types/node": "^24.10.0",
|
|
22
|
+
"@typescript-eslint/eslint-plugin": "^8.46.3",
|
|
23
|
+
"@typescript-eslint/parser": "^8.46.3",
|
|
24
24
|
"csv-parse": "^6.1.0",
|
|
25
25
|
"date-fns": "^4.1.0",
|
|
26
|
-
"eslint": "^9.
|
|
26
|
+
"eslint": "^9.39.1",
|
|
27
27
|
"eslint-plugin-import": "^2.32.0",
|
|
28
28
|
"highcharts": "^12.4.0",
|
|
29
29
|
"jiti": "^2.6.1",
|
|
@@ -53,5 +53,11 @@
|
|
|
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
|
+
"install": "^0.13.0",
|
|
59
|
+
"log-symbols": "^7.0.1",
|
|
60
|
+
"npm": "^11.6.2",
|
|
61
|
+
"uninstall": "^0.0.0"
|
|
56
62
|
}
|
|
57
63
|
}
|