@datapos/datapos-shared 0.3.124 → 0.3.126

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.
@@ -18,41 +18,41 @@ 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 M() {
21
+ function B() {
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 U() {
27
+ function M() {
28
28
  function e(r, a, t) {
29
29
  t.textContent = "values table goes here...";
30
30
  }
31
31
  return { render: e };
32
32
  }
33
33
  const O = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", E = "highcharts";
34
- let b, S = !1;
35
- function B() {
36
- async function e(n, s, u, d) {
34
+ let b, I = !1;
35
+ function U() {
36
+ async function e(o, s, d, u) {
37
37
  await t();
38
38
  const c = [];
39
39
  for (const g of s.data.measures)
40
- c.push({ type: n.options.highchartsType, name: g.name, data: g.data });
40
+ c.push({ type: o.options.highchartsType, name: g.name, data: g.data });
41
41
  const f = {
42
- chart: { type: n.options.highchartsType },
42
+ chart: { type: o.options.highchartsType },
43
43
  plotOptions: { series: { borderColor: "#333" } },
44
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
- }, m = b.chart(u, f, d);
48
+ }, m = b.chart(d, f, u);
49
49
  return { chart: m, resize: () => m.reflow(), vendorId: E };
50
50
  }
51
- async function r(n, s, u, d) {
52
- await Promise.all([t(), o()]);
51
+ async function r(o, s, d, u) {
52
+ await Promise.all([t(), n()]);
53
53
  const c = [];
54
54
  for (const g of s.data.measures)
55
- c.push({ type: n.options.highchartsType, name: g.name, data: g.data });
55
+ c.push({ type: o.options.highchartsType, name: g.name, data: g.data });
56
56
  const f = {
57
57
  chart: { polar: !0 },
58
58
  plotOptions: { series: { borderColor: "#333" } },
@@ -60,39 +60,39 @@ function B() {
60
60
  title: { text: s.title.text },
61
61
  xAxis: { categories: s.data.categoryLabels },
62
62
  yAxis: { title: { text: s.data.name } }
63
- }, m = b.chart(u, f, d);
63
+ }, m = b.chart(d, f, u);
64
64
  return { chart: m, resize: () => m.reflow(), vendorId: E };
65
65
  }
66
- async function a(n, s, u, d) {
67
- await Promise.all([t(), o()]);
66
+ async function a(o, s, d, u) {
67
+ await Promise.all([t(), n()]);
68
68
  const c = [], f = [];
69
69
  for (let y = 0; y < s.data.measures[0].data.length; y++)
70
70
  f.push([s.data.measures[0].data[y][0], s.data.measures[1].data[y][0]]);
71
- c.push({ type: n.options.highchartsType, name: "Unknown", data: f });
71
+ c.push({ type: o.options.highchartsType, name: "Unknown", data: f });
72
72
  const m = {
73
- chart: { type: n.options.highchartsType, inverted: n.options.inverted },
73
+ chart: { type: o.options.highchartsType, inverted: o.options.inverted },
74
74
  plotOptions: { series: { borderColor: "#333" } },
75
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
- }, g = b.chart(u, m, d);
79
+ }, g = b.chart(d, m, u);
80
80
  return { chart: g, resize: () => g.reflow(), vendorId: E };
81
81
  }
82
82
  async function t() {
83
83
  if (b) return;
84
- const n = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", s = `${n}highcharts.src.js`, u = `${n}modules/accessibility.src.js`;
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
85
  b = (await import(
86
86
  /* @vite-ignore */
87
87
  s
88
88
  )).default, await import(
89
89
  /* @vite-ignore */
90
- u
90
+ d
91
91
  );
92
92
  }
93
- async function o() {
94
- if (S) return;
95
- await import(`${O}highcharts-more.src.js`), S = !0;
93
+ async function n() {
94
+ if (I) return;
95
+ await import(`${O}highcharts-more.src.js`), I = !0;
96
96
  }
97
97
  return { renderCartesianChart: e, renderPolarChart: r, renderRangeChart: a };
98
98
  }
@@ -117,25 +117,25 @@ class H extends h {
117
117
  super(r, a, t), this.name = "EngineError";
118
118
  }
119
119
  }
120
- class I extends h {
120
+ class S extends h {
121
121
  body;
122
- constructor(r, a, t, o) {
123
- super(r, a, o), this.name = "FetchError", this.body = t;
122
+ constructor(r, a, t, n) {
123
+ super(r, a, n), this.name = "FetchError", this.body = t;
124
124
  }
125
125
  }
126
126
  class T extends h {
127
127
  componentName;
128
128
  info;
129
- constructor(r, a, t, o, n) {
130
- super(r, a, n), this.name = "VueHandledError", this.info = t, this.componentName = o;
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 P extends h {
133
+ class V extends h {
134
134
  constructor(r, a, t) {
135
135
  super(r, a, t), this.name = "WindowHandledRuntimeError";
136
136
  }
137
137
  }
138
- class V extends h {
138
+ class P extends h {
139
139
  constructor(r, a, t) {
140
140
  super(r, a, t), this.name = "WindowHandledPromiseRejectionError";
141
141
  }
@@ -146,8 +146,8 @@ class W extends v {
146
146
  }
147
147
  }
148
148
  async function X(e, r, a) {
149
- const t = `${r} Response status '${e.status}${e.statusText ? ` - ${e.statusText}` : ""}' received.`, o = await e.text();
150
- return new I(t, a, o);
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
152
  function G(e) {
153
153
  return e.map((r) => r.message).join(" ");
@@ -166,18 +166,18 @@ function K(e) {
166
166
  let t = e;
167
167
  for (; t && !r.has(t); ) {
168
168
  r.add(t);
169
- let o;
170
- if (t instanceof I)
171
- o = { body: t.body, locator: t.locator, message: t.message, name: t.name, stack: t.stack }, t = t.cause;
169
+ let n;
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
172
  else if (t instanceof T)
173
- o = { componentName: t.componentName, info: t.info, locator: t.locator, message: t.message, name: t.name, stack: t.stack }, t = t.cause;
173
+ n = { componentName: t.componentName, info: t.info, locator: t.locator, message: t.message, name: t.name, stack: t.stack }, t = t.cause;
174
174
  else if (t instanceof v)
175
- o = { locator: t.locator, message: t.message, name: t.name, stack: t.stack }, t = t.cause;
175
+ n = { locator: t.locator, message: t.message, name: t.name, stack: t.stack }, t = t.cause;
176
176
  else if (t instanceof Error) {
177
- const n = t;
178
- o = { locator: "", message: n.message, name: n.name, stack: n.stack }, t = n.cause;
179
- } else t ? (o = { locator: "", message: String(t), name: "Error" }, t = void 0) : (o = { locator: "", message: "Unknown error.", name: "Error" }, t = void 0);
180
- /(?:\.{3}|[.!?])$/.test(o.message) || (o.message += "."), a.push(o);
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
181
  }
182
182
  return a;
183
183
  }
@@ -232,16 +232,16 @@ const N = "en-US", w = {}, q = (e) => {
232
232
  }
233
233
  }, l = (e, r = 2, a = r, t = N) => {
234
234
  if (e == null) return "";
235
- const o = `${t}decimal${r}.${a}`;
236
- let n = w[o];
237
- return n || (n = new Intl.NumberFormat(t, {
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
239
  maximumFractionDigits: r,
240
240
  minimumFractionDigits: a,
241
241
  minimumIntegerDigits: 1,
242
242
  style: "decimal",
243
243
  useGrouping: !0
244
- }), w[o] = n), n.format(e);
244
+ }), w[n] = o), o.format(e);
245
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
247
  const a = `${r}decimal0.0`;
@@ -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
- ], ne = (e = p) => {
279
+ ], oe = (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
- ], oe = (e = p) => {
289
+ ], ne = (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 });
@@ -324,49 +324,56 @@ const N = "en-US", w = {}, q = (e) => {
324
324
  }, R = ["createObject", "dropObject", "removeRecords", "upsertRecords"], $ = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"];
325
325
  async function ce() {
326
326
  try {
327
+ console.log("🚀 Building connector configuration...");
327
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");
328
- let t = !1, o = !1;
329
- const n = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, s = [...a.matchAll(n)].filter((d) => !d[1] && d[2] !== "constructor").map((d) => {
330
- const c = d[2];
331
- return t = t || R.includes(c), o = o || $.includes(c), c;
332
- }), u = o && t ? "bidirectional" : o ? "source" : t ? "destination" : null;
333
- e.name && (r.id = e.name), r.operations = s, r.usageId = u, e.version && (r.version = e.version), await i.writeFile("config.json", JSON.stringify(r, void 0, 4), "utf8"), console.log("✅ Connector configuration built.");
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;
333
+ });
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.");
334
337
  } catch (e) {
335
338
  console.warn("❌ Error building connector configuration.", e);
336
339
  }
337
340
  }
338
341
  async function le() {
339
342
  try {
340
- 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, o = [...a.matchAll(t)].filter((n) => !n[1] && n[2] !== "constructor").map((n) => n[2]);
341
- e.name && (r.id = e.name), r.operations = o, e.version && (r.version = e.version), await i.writeFile("config.json", JSON.stringify(r, void 0, 4), "utf8");
343
+ console.log("🚀 Building context configuration...");
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");
342
346
  } catch (e) {
343
347
  console.warn("❌ Error building context configuration.", e);
344
348
  }
345
349
  }
346
350
  async function de() {
347
351
  try {
348
- 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, o = [...a.matchAll(t)].filter((n) => !n[1] && n[2] !== "constructor").map((n) => n[2]);
349
- e.name && (r.id = e.name), r.operations = o, e.version && (r.version = e.version), await i.writeFile("config.json", JSON.stringify(r, void 0, 4), "utf8");
352
+ console.log("🚀 Building informer configuration...");
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");
350
355
  } catch (e) {
351
356
  console.warn("❌ Error building informer configuration.", e);
352
357
  }
353
358
  }
354
359
  async function ue() {
355
360
  try {
356
- 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, o = [...a.matchAll(t)].filter((n) => !n[1] && n[2] !== "constructor").map((n) => n[2]);
357
- e.name && (r.id = e.name), r.operations = o, e.version && (r.version = e.version), await i.writeFile("config.json", JSON.stringify(r, void 0, 4), "utf8");
361
+ console.log("🚀 Building presenter configuration...");
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");
358
364
  } catch (e) {
359
365
  console.warn("❌ Error building context configuration.", e);
360
366
  }
361
367
  }
362
368
  async function ge() {
363
369
  try {
370
+ console.log("🚀 Bumping version...");
364
371
  const e = await JSON.parse(await i.readFile("package.json", "utf8"));
365
372
  if (e.version) {
366
373
  const r = e.version, a = e.version.split(".");
367
- e.version = `${a[0]}.${a[1]}.${Number(a[2]) + 1}`, await i.writeFile("package.json", JSON.stringify(e, void 0, 4), "utf8"), console.log(`✅ Bumped version from ${r} to ${e.version}.`);
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}.`);
368
375
  } else
369
- e.version = "0.0.001", await i.writeFile("package.json", JSON.stringify(e, void 0, 4), "utf8"), console.log(`âš ī¸ Set version 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}.`);
370
377
  } catch (e) {
371
378
  console.warn("❌ Error bumping package version.", e);
372
379
  }
@@ -378,11 +385,11 @@ export {
378
385
  p as DEFAULT_LOCALE_CODE,
379
386
  j as DefaultTimestamp,
380
387
  H as EngineError,
381
- I as FetchError,
388
+ S as FetchError,
382
389
  W as OperationalError,
383
390
  T as VueError,
384
- V as WindowPromiseRejectionError,
385
- P as WindowRuntimeError,
391
+ P as WindowPromiseRejectionError,
392
+ V as WindowRuntimeError,
386
393
  ce as buildConnectorConfig,
387
394
  le as buildContextConfig,
388
395
  X as buildFetchError,
@@ -401,14 +408,14 @@ export {
401
408
  x as formatNumberAsWholeNumber,
402
409
  ie as getComponentStatus,
403
410
  J as getCurrentTimestamp,
404
- ne as getDataFormats,
405
- oe as getRecordDelimiters,
411
+ oe as getDataFormats,
412
+ ne as getRecordDelimiters,
406
413
  se as getValueDelimiters,
407
414
  ae as lookupMimeTypeForExtension,
408
415
  Z as normalizeToError,
409
416
  L as presentationViewTypeMap,
410
417
  K as serialiseError,
411
- M as useCytoscapeJS,
412
- U as useDataTable,
413
- B as useHighcharts
418
+ B as useCytoscapeJS,
419
+ M as useDataTable,
420
+ U as useHighcharts
414
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.124",
5
+ "version": "0.3.126",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"