@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.
@@ -1,5 +1,5 @@
1
- import { promises as l } from "fs";
2
- const ge = 0, pe = (e) => e, fe = () => Date.now(), me = {
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 be() {
22
- function e(t, o, r) {
23
- r.textContent = "Cytoscape.js diagram goes here...";
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 he() {
28
- function e(t, o, r) {
29
- r.textContent = "values table goes here...";
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 z = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", C = "highcharts";
34
- let O, k = !1;
35
- function ye() {
36
- async function e(a, s, c, g) {
37
- await r();
38
- const u = [];
39
- for (const f of s.data.measures)
40
- u.push({ type: a.options.highchartsType, name: f.name, data: f.data });
41
- const y = {
42
- chart: { type: a.options.highchartsType },
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: u,
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
- }, h = O.chart(c, y, g);
49
- return { chart: h, resize: () => h.reflow(), vendorId: C };
50
- }
51
- async function t(a, s, c, g) {
52
- await Promise.all([r(), n()]);
53
- const u = [];
54
- for (const f of s.data.measures)
55
- u.push({ type: a.options.highchartsType, name: f.name, data: f.data });
56
- const y = {
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: u,
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
- }, h = O.chart(c, y, g);
64
- return { chart: h, resize: () => h.reflow(), vendorId: C };
65
- }
66
- async function o(a, s, c, g) {
67
- await Promise.all([r(), n()]);
68
- const u = [], y = [];
69
- for (let T = 0; T < s.data.measures[0].data.length; T++)
70
- y.push([s.data.measures[0].data[T][0], s.data.measures[1].data[T][0]]);
71
- u.push({ type: a.options.highchartsType, name: "Unknown", data: y });
72
- const h = {
73
- chart: { type: a.options.highchartsType, inverted: a.options.inverted },
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: u,
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
- }, f = O.chart(c, h, g);
80
- return { chart: f, resize: () => f.reflow(), vendorId: C };
79
+ }, g = b.chart(d, m, u);
80
+ return { chart: g, resize: () => g.reflow(), vendorId: E };
81
81
  }
82
- async function r() {
83
- if (O) return;
84
- const a = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", s = `${a}highcharts.src.js`, c = `${a}modules/accessibility.src.js`;
85
- O = (await import(
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
- c
90
+ d
91
91
  );
92
92
  }
93
93
  async function n() {
94
- if (k) return;
95
- await import(`${z}highcharts-more.src.js`), k = !0;
94
+ if (I) return;
95
+ await import(`${O}highcharts-more.src.js`), I = !0;
96
96
  }
97
- return { renderCartesianChart: e, renderPolarChart: t, renderRangeChart: o };
97
+ return { renderCartesianChart: e, renderPolarChart: r, renderRangeChart: a };
98
98
  }
99
- class D extends Error {
99
+ class v extends Error {
100
100
  locator;
101
- constructor(t, o, r) {
102
- super(t, r), this.name = "DataPosError", this.locator = o, Error.captureStackTrace?.(this, new.target);
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 x extends D {
106
- constructor(t, o, r) {
107
- super(t, o, r), this.name = "ApplicationError";
105
+ class h extends v {
106
+ constructor(r, a, t) {
107
+ super(r, a, t), this.name = "ApplicationError";
108
108
  }
109
109
  }
110
- class ve extends x {
111
- constructor(t, o, r) {
112
- super(t, o, r), this.name = "APIError";
110
+ class z extends h {
111
+ constructor(r, a, t) {
112
+ super(r, a, t), this.name = "APIError";
113
113
  }
114
114
  }
115
- class we extends x {
116
- constructor(t, o, r) {
117
- super(t, o, r), this.name = "EngineError";
115
+ class H extends h {
116
+ constructor(r, a, t) {
117
+ super(r, a, t), this.name = "EngineError";
118
118
  }
119
119
  }
120
- class V extends x {
120
+ class S extends h {
121
121
  body;
122
- constructor(t, o, r, n) {
123
- super(t, o, n), this.name = "FetchError", this.body = r;
122
+ constructor(r, a, t, n) {
123
+ super(r, a, n), this.name = "FetchError", this.body = t;
124
124
  }
125
125
  }
126
- class H extends x {
126
+ class T extends h {
127
127
  componentName;
128
128
  info;
129
- constructor(t, o, r, n, a) {
130
- super(t, o, a), this.name = "VueHandledError", this.info = r, this.componentName = n;
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 xe extends x {
134
- constructor(t, o, r) {
135
- super(t, o, r), this.name = "WindowHandledRuntimeError";
133
+ class V extends h {
134
+ constructor(r, a, t) {
135
+ super(r, a, t), this.name = "WindowHandledRuntimeError";
136
136
  }
137
137
  }
138
- class Oe extends x {
139
- constructor(t, o, r) {
140
- super(t, o, r), this.name = "WindowHandledPromiseRejectionError";
138
+ class P extends h {
139
+ constructor(r, a, t) {
140
+ super(r, a, t), this.name = "WindowHandledPromiseRejectionError";
141
141
  }
142
142
  }
143
- class Ee extends D {
144
- constructor(t, o, r) {
145
- super(t, o, r), this.name = "OperationalError";
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 Se(e, t, o) {
149
- const r = `${t} Response status '${e.status}${e.statusText ? ` - ${e.statusText}` : ""}' received.`, n = await e.text();
150
- return new V(r, o, n);
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 Te(e) {
153
- return e.map((t) => t.message).join(" ");
152
+ function G(e) {
153
+ return e.map((r) => r.message).join(" ");
154
154
  }
155
- function Ie(e, t = "Unknown error.") {
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 ?? t));
159
+ return new Error(JSON.stringify(e ?? r));
160
160
  } catch {
161
- return new Error(t);
161
+ return new Error(r);
162
162
  }
163
163
  }
164
- function Ne(e) {
165
- const t = /* @__PURE__ */ new Set(), o = [];
166
- let r = e;
167
- for (; r && !t.has(r); ) {
168
- t.add(r);
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 (r instanceof V)
171
- n = { body: r.body, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
172
- else if (r instanceof H)
173
- n = { componentName: r.componentName, info: r.info, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
174
- else if (r instanceof D)
175
- n = { locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
176
- else if (r instanceof Error) {
177
- const a = r;
178
- n = { locator: "", message: a.message, name: a.name, stack: a.stack }, r = a.cause;
179
- } else r ? (n = { locator: "", message: String(r), name: "Error" }, r = void 0) : (n = { locator: "", message: "Unknown error.", name: "Error" }, r = void 0);
180
- /(?:\.{3}|[.!?])$/.test(n.message) || (n.message += "."), o.push(n);
181
- }
182
- return o;
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 W = "en-US", I = {}, Ae = (e) => {
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
- }, Ce = (e) => {
223
+ }, Q = (e) => {
224
224
  if (e) {
225
- const t = e.lastIndexOf("/"), o = e.lastIndexOf(".", t > -1 ? t : e.length);
226
- return o > -1 ? e.substring(0, o) : e;
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
- }, Fe = (e) => {
228
+ }, Y = (e) => {
229
229
  if (e) {
230
- const t = e.lastIndexOf(".");
231
- if (t > -1) return e.substring(t + 1);
230
+ const r = e.lastIndexOf(".");
231
+ if (r > -1) return e.substring(r + 1);
232
232
  }
233
- }, d = (e, t = 2, o = t, r = W) => {
233
+ }, l = (e, r = 2, a = r, t = N) => {
234
234
  if (e == null) return "";
235
- const n = `${r}decimal${t}.${o}`;
236
- let a = I[n];
237
- return a || (a = new Intl.NumberFormat(r, {
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: t,
240
- minimumFractionDigits: o,
239
+ maximumFractionDigits: r,
240
+ minimumFractionDigits: a,
241
241
  minimumIntegerDigits: 1,
242
242
  style: "decimal",
243
243
  useGrouping: !0
244
- }), I[n] = a), a.format(e);
245
- }, Re = (e) => e == null ? "" : e < 1e3 ? N(e) : e < 1e6 ? `${d(e / 1e3, 2, 0)}K` : e < 1e9 ? `${d(e / 1e6, 2, 0)}M` : e < 1e12 ? `${d(e / 1e9, 2, 0)}B` : `${d(e / 1e12, 2, 0)}T`, je = (e) => e == null ? "" : e === 1 ? "1 byte" : e < 1024 ? `${N(e)} bytes` : e < 1048576 ? `${d(e / 1024, 2, 0)} KB` : e < 1073741824 ? `${d(e / 1048576, 2, 0)} MB` : e < 1099511627776 ? `${d(e / 1073741824, 2, 0)} GB` : `${d(e / 1099511627776, 2, 0)} TB`, Be = (e) => e == null ? "" : e < 1e3 ? `${N(e)} ms` : e === 1e3 ? `${N(e)} sec` : e < 6e4 ? `${d(e / 1e3, 2, 0)} secs` : e === 6e4 ? "1 min" : e < 36e5 ? `${d(e / 6e4, 2, 0)} mins` : e === 36e5 ? "1 hr" : e < 864e5 ? `${d(e / 36e5, 2, 0)} hrs` : e === 864e5 ? "1 day" : `${d(e / 864e5, 2, 0)} days`, N = (e, t = W) => {
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 o = `${t}decimal0.0`;
248
- let r = I[o];
249
- return r || (r = new Intl.NumberFormat(t, {
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
- }), I[o] = r), r.format(e);
257
- }, De = (e) => {
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
- }, X = [
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
- ], ke = (e = b) => {
280
- const t = [];
281
- for (const o of X) t.push({ ...o, label: o.label[e] || o.label[b] || o.id });
282
- return t;
283
- }, Y = [
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
- ], $e = (e = b) => {
290
- const t = [];
291
- for (const o of Y)
292
- t.push({ ...o, label: o.label[e] || o.label[b] || o.id });
293
- return t;
294
- }, Z = [
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
- ], Me = (e = b) => {
307
- const t = [];
308
- for (const o of Z)
309
- t.push({ ...o, label: o.label[e] || o.label[b] || o.id });
310
- return t;
311
- }, K = [
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
- ], Le = (e, t = b) => {
322
- const o = K.find((r) => r.id === e);
323
- return o ? { ...o, label: o.label[t] || o.label[b] || e } : { id: e, color: "other", label: e };
324
- }, F = 10, $ = (e = 0) => (t) => `\x1B[${t + e}m`, M = (e = 0) => (t) => `\x1B[${38 + e};5;${t}m`, L = (e = 0) => (t, o, r) => `\x1B[${38 + e};2;${t};${o};${r}m`, i = {
325
- modifier: {
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 l.readFile("package.json", "utf8")), t = await JSON.parse(await l.readFile("config.json", "utf8")), o = await l.readFile("src/index.ts", "utf8");
600
- let r = !1, n = !1;
601
- const a = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, s = [...o.matchAll(a)].filter((g) => !g[1] && g[2] !== "constructor").map((g) => {
602
- const u = g[2];
603
- return r = r || ce.includes(u), n = n || ue.includes(u), u;
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(`ℹ️ Implements ${s.length} operations.`) : console.log("⚠️ Implements no operations.");
606
- const c = n && r ? "bidirectional" : n ? "source" : r ? "destination" : null;
607
- console.log(c ? `ℹ️ Supports ${c} usage.` : "⚠️ No usage identified."), e.name && (t.id = e.name), t.operations = s, t.usageId = c, e.version && (t.version = e.version), await l.writeFile("config.json", JSON.stringify(t, void 0, 4), "utf8"), console.log("✅ Connector configuration built."), console.log(m.blue.bold("ℹ️ "), m.blue("Info: Process started.")), console.log(m.yellow.bold("⚠️ "), m.yellow("Warning: Low disk space.")), console.log(m.red.bold("❌ "), m.red("Error: Connection failed.")), console.log(m.green.bold("✅ "), m.green("Success: Operation complete."));
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 _e() {
341
+ async function le() {
613
342
  try {
614
343
  console.log("🚀 Building context configuration...");
615
- const e = await JSON.parse(await l.readFile("package.json", "utf8")), t = await JSON.parse(await l.readFile("config.json", "utf8")), o = await l.readFile("src/index.ts", "utf8"), r = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, n = [...o.matchAll(r)].filter((a) => !a[1] && a[2] !== "constructor").map((a) => a[2]);
616
- e.name && (t.id = e.name), t.operations = n, e.version && (t.version = e.version), await l.writeFile("config.json", JSON.stringify(t, void 0, 4), "utf8");
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 Pe() {
350
+ async function de() {
622
351
  try {
623
352
  console.log("🚀 Building informer configuration...");
624
- const e = await JSON.parse(await l.readFile("package.json", "utf8")), t = await JSON.parse(await l.readFile("config.json", "utf8")), o = await l.readFile("src/index.ts", "utf8"), r = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, n = [...o.matchAll(r)].filter((a) => !a[1] && a[2] !== "constructor").map((a) => a[2]);
625
- e.name && (t.id = e.name), t.operations = n, e.version && (t.version = e.version), await l.writeFile("config.json", JSON.stringify(t, void 0, 4), "utf8");
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 Ue() {
359
+ async function ue() {
631
360
  try {
632
361
  console.log("🚀 Building presenter configuration...");
633
- const e = await JSON.parse(await l.readFile("package.json", "utf8")), t = await JSON.parse(await l.readFile("config.json", "utf8")), o = await l.readFile("src/index.ts", "utf8"), r = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, n = [...o.matchAll(r)].filter((a) => !a[1] && a[2] !== "constructor").map((a) => a[2]);
634
- e.name && (t.id = e.name), t.operations = n, e.version && (t.version = e.version), await l.writeFile("config.json", JSON.stringify(t, void 0, 4), "utf8");
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 Ge() {
368
+ async function ge() {
640
369
  try {
641
370
  console.log("🚀 Bumping version...");
642
- const e = await JSON.parse(await l.readFile("package.json", "utf8"));
371
+ const e = await JSON.parse(await i.readFile("package.json", "utf8"));
643
372
  if (e.version) {
644
- const t = e.version, o = e.version.split(".");
645
- e.version = `${o[0]}.${o[1]}.${Number(o[2]) + 1}`, await l.writeFile("package.json", JSON.stringify(e, void 0, 4), "utf8"), console.log(`✅ Version bumped from ${t} to ${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 l.writeFile("package.json", JSON.stringify(e, void 0, 4), "utf8"), console.log(`⚠️ Version initialised to ${e.version}.`);
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 b = "en-gb";
381
+ const p = "en-gb";
653
382
  export {
654
- ve as APIError,
655
- x as ApplicationError,
656
- b as DEFAULT_LOCALE_CODE,
657
- ge as DefaultTimestamp,
658
- we as EngineError,
659
- V as FetchError,
660
- Ee as OperationalError,
661
- H as VueError,
662
- Oe as WindowPromiseRejectionError,
663
- xe as WindowRuntimeError,
664
- Je as buildConnectorConfig,
665
- _e as buildContextConfig,
666
- Se as buildFetchError,
667
- Pe as buildInformerConfig,
668
- Ue as buildPresenterConfig,
669
- Ge as bumpVersion,
670
- Te as concatenateSerialisedErrorMessages,
671
- pe as convertMillisecondsToTimestamp,
672
- Ae as convertODataTypeIdToUsageTypeId,
673
- Fe as extractExtensionFromPath,
674
- Ce as extractNameFromPath,
675
- d as formatNumberAsDecimalNumber,
676
- Be as formatNumberAsDuration,
677
- Re as formatNumberAsSize,
678
- je as formatNumberAsStorageSize,
679
- N as formatNumberAsWholeNumber,
680
- Le as getComponentStatus,
681
- fe as getCurrentTimestamp,
682
- ke as getDataFormats,
683
- $e as getRecordDelimiters,
684
- Me as getValueDelimiters,
685
- De as lookupMimeTypeForExtension,
686
- Ie as normalizeToError,
687
- me as presentationViewTypeMap,
688
- Ne as serialiseError,
689
- be as useCytoscapeJS,
690
- he as useDataTable,
691
- ye as useHighcharts
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.130",
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
  }