@datapos/datapos-shared 0.3.125 → 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.
@@ -33,26 +33,26 @@ function M() {
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
35
  function U() {
36
- async function e(n, s, u, d) {
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,37 +60,37 @@ function U() {
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() {
93
+ async function n() {
94
94
  if (I) return;
95
95
  await import(`${O}highcharts-more.src.js`), I = !0;
96
96
  }
@@ -119,15 +119,15 @@ class H extends h {
119
119
  }
120
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
133
  class V extends h {
@@ -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 S(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;
169
+ let n;
170
170
  if (t instanceof S)
171
- o = { body: t.body, locator: t.locator, message: t.message, name: t.name, stack: t.stack }, t = t.cause;
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 });
@@ -326,12 +326,14 @@ async function ce() {
326
326
  try {
327
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
- let t = !1, o = !1;
330
- 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) => {
331
- const c = d[2];
332
- return t = t || R.includes(c), o = o || $.includes(c), c;
333
- }), u = o && t ? "bidirectional" : o ? "source" : t ? "destination" : null;
334
- 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.");
335
337
  } catch (e) {
336
338
  console.warn("❌ Error building connector configuration.", e);
337
339
  }
@@ -339,8 +341,8 @@ async function ce() {
339
341
  async function le() {
340
342
  try {
341
343
  console.log("🚀 Building context configuration...");
342
- 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]);
343
- 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");
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");
344
346
  } catch (e) {
345
347
  console.warn("❌ Error building context configuration.", e);
346
348
  }
@@ -348,8 +350,8 @@ async function le() {
348
350
  async function de() {
349
351
  try {
350
352
  console.log("🚀 Building informer configuration...");
351
- 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]);
352
- 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");
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");
353
355
  } catch (e) {
354
356
  console.warn("❌ Error building informer configuration.", e);
355
357
  }
@@ -357,8 +359,8 @@ async function de() {
357
359
  async function ue() {
358
360
  try {
359
361
  console.log("🚀 Building presenter configuration...");
360
- 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]);
361
- 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");
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");
362
364
  } catch (e) {
363
365
  console.warn("❌ Error building context configuration.", e);
364
366
  }
@@ -406,8 +408,8 @@ export {
406
408
  x as formatNumberAsWholeNumber,
407
409
  ie as getComponentStatus,
408
410
  J as getCurrentTimestamp,
409
- ne as getDataFormats,
410
- oe as getRecordDelimiters,
411
+ oe as getDataFormats,
412
+ ne as getRecordDelimiters,
411
413
  se as getValueDelimiters,
412
414
  ae as lookupMimeTypeForExtension,
413
415
  Z as normalizeToError,
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.125",
5
+ "version": "0.3.126",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"