@datapos/datapos-shared 0.3.186 → 0.3.188

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,21 +1,21 @@
1
1
  const U = ["createObject", "dropObject", "removeRecords", "upsertRecords"], P = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"];
2
2
  function B() {
3
- function e(a, t, r) {
4
- r.textContent = "Cytoscape.js diagram goes here...";
3
+ function e(a, r, t) {
4
+ t.textContent = "Cytoscape.js diagram goes here...";
5
5
  }
6
6
  return { render: e };
7
7
  }
8
8
  function W() {
9
- function e(a, t, r) {
10
- r.textContent = "values table goes here...";
9
+ function e(a, r, t) {
10
+ t.textContent = "values table goes here...";
11
11
  }
12
12
  return { render: e };
13
13
  }
14
- const A = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", x = "highcharts";
14
+ const A = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", I = "highcharts";
15
15
  let b, R = !1;
16
16
  function H() {
17
17
  async function e(n, s, m, h) {
18
- await r();
18
+ await t();
19
19
  const l = [];
20
20
  for (const c of s.data.measures)
21
21
  l.push({ type: n.options.highchartsType, name: c.name, data: c.data });
@@ -27,10 +27,10 @@ function H() {
27
27
  xAxis: { categories: s.data.categoryLabels },
28
28
  yAxis: { title: { text: s.data.name } }
29
29
  }, u = b.chart(m, p, h);
30
- return { chart: u, resize: () => u.reflow(), vendorId: x };
30
+ return { chart: u, resize: () => u.reflow(), vendorId: I };
31
31
  }
32
32
  async function a(n, s, m, h) {
33
- await Promise.all([r(), o()]);
33
+ await Promise.all([t(), o()]);
34
34
  const l = [];
35
35
  for (const c of s.data.measures)
36
36
  l.push({ type: n.options.highchartsType, name: c.name, data: c.data });
@@ -42,10 +42,10 @@ function H() {
42
42
  xAxis: { categories: s.data.categoryLabels },
43
43
  yAxis: { title: { text: s.data.name } }
44
44
  }, u = b.chart(m, p, h);
45
- return { chart: u, resize: () => u.reflow(), vendorId: x };
45
+ return { chart: u, resize: () => u.reflow(), vendorId: I };
46
46
  }
47
- async function t(n, s, m, h) {
48
- await Promise.all([r(), o()]);
47
+ async function r(n, s, m, h) {
48
+ await Promise.all([t(), o()]);
49
49
  const l = [], p = [];
50
50
  for (let f = 0; f < s.data.measures[0].data.length; f++)
51
51
  p.push([s.data.measures[0].data[f][0], s.data.measures[1].data[f][0]]);
@@ -58,9 +58,9 @@ function H() {
58
58
  xAxis: { categories: s.data.categoryLabels },
59
59
  yAxis: { title: { text: s.data.name } }
60
60
  }, c = b.chart(m, u, h);
61
- return { chart: c, resize: () => c.reflow(), vendorId: x };
61
+ return { chart: c, resize: () => c.reflow(), vendorId: I };
62
62
  }
63
- async function r() {
63
+ async function t() {
64
64
  if (b) return;
65
65
  const n = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", s = `${n}highcharts.src.js`, m = `${n}modules/accessibility.src.js`;
66
66
  b = (await import(
@@ -75,20 +75,20 @@ function H() {
75
75
  if (R) return;
76
76
  await import(`${A}highcharts-more.src.js`), R = !0;
77
77
  }
78
- return { renderCartesianChart: e, renderPolarChart: a, renderRangeChart: t };
78
+ return { renderCartesianChart: e, renderPolarChart: a, renderRangeChart: r };
79
79
  }
80
- const O = 4, N = `https://cdn.jsdelivr.net/npm/micromark@${O}/+esm`, T = 1, _ = `https://cdn.jsdelivr.net/npm/prismjs@${T}/+esm`, C = `https://cdn.jsdelivr.net/npm/prismjs@${T}/components/prism-javascript.min.js`, L = `https://cdn.jsdelivr.net/npm/prismjs@${T}/components/prism-javascript.min.js`;
81
- let w, y;
80
+ const O = 4, N = `https://cdn.jsdelivr.net/npm/micromark@${O}/+esm`, w = 1, _ = `https://cdn.jsdelivr.net/npm/prismjs@${w}/+esm`, C = `https://cdn.jsdelivr.net/npm/prismjs@${w}/components/prism-javascript.min.js`, L = `https://cdn.jsdelivr.net/npm/prismjs@${w}/components/prism-javascript.min.js`;
81
+ let x, T;
82
82
  function V() {
83
83
  async function e() {
84
- return await t(), { micromark: w, Prism: y };
84
+ return await r(), { micromark: x, Prism: T };
85
85
  }
86
86
  async function a() {
87
- await t();
87
+ await r();
88
88
  }
89
- async function t() {
90
- if (w && y) return;
91
- const r = await Promise.all([
89
+ async function r() {
90
+ if (x && T) return;
91
+ const t = await Promise.all([
92
92
  import(
93
93
  /* @vite-ignore */
94
94
  N
@@ -100,7 +100,7 @@ function V() {
100
100
  // import(/* @vite-ignore */ PRISM_JAVASCRIPT_URL),
101
101
  // import(/* @vite-ignore */ PRISM_JSON_URL)
102
102
  ]);
103
- w = r[0].micromark, y = r[1].default, globalThis.Prism = y, await Promise.all([import(
103
+ x = t[0].micromark, T = t[1].default, console.log("globalThis", globalThis), await Promise.all([import(
104
104
  /* @vite-ignore */
105
105
  C
106
106
  ), import(
@@ -131,61 +131,61 @@ const z = 0, X = (e) => e, G = () => Date.now(), J = {
131
131
  };
132
132
  class D extends Error {
133
133
  locator;
134
- constructor(a, t, r) {
135
- super(a, r), this.name = "DataPosError", this.locator = t, Error.captureStackTrace?.(this, new.target);
134
+ constructor(a, r, t) {
135
+ super(a, t), this.name = "DataPosError", this.locator = r, Error.captureStackTrace?.(this, new.target);
136
136
  }
137
137
  }
138
138
  class g extends D {
139
- constructor(a, t, r) {
140
- super(a, t, r), this.name = "ApplicationError";
139
+ constructor(a, r, t) {
140
+ super(a, r, t), this.name = "ApplicationError";
141
141
  }
142
142
  }
143
143
  class K extends g {
144
- constructor(a, t, r) {
145
- super(a, t, r), this.name = "APIError";
144
+ constructor(a, r, t) {
145
+ super(a, r, t), this.name = "APIError";
146
146
  }
147
147
  }
148
148
  class q extends g {
149
- constructor(a, t, r) {
150
- super(a, t, r), this.name = "EngineError";
149
+ constructor(a, r, t) {
150
+ super(a, r, t), this.name = "EngineError";
151
151
  }
152
152
  }
153
153
  class v extends g {
154
154
  body;
155
- constructor(a, t, r, o) {
156
- super(a, t, o), this.name = "FetchError", this.body = r;
155
+ constructor(a, r, t, o) {
156
+ super(a, r, o), this.name = "FetchError", this.body = t;
157
157
  }
158
158
  }
159
159
  class $ extends g {
160
160
  componentName;
161
161
  info;
162
- constructor(a, t, r, o, n) {
163
- super(a, t, n), this.name = "VueHandledError", this.info = r, this.componentName = o;
162
+ constructor(a, r, t, o, n) {
163
+ super(a, r, n), this.name = "VueHandledError", this.info = t, this.componentName = o;
164
164
  }
165
165
  }
166
166
  class Q extends g {
167
- constructor(a, t, r) {
168
- super(a, t, r), this.name = "WindowHandledRuntimeError";
167
+ constructor(a, r, t) {
168
+ super(a, r, t), this.name = "WindowHandledRuntimeError";
169
169
  }
170
170
  }
171
171
  class Y extends g {
172
- constructor(a, t, r) {
173
- super(a, t, r), this.name = "WindowHandledPromiseRejectionError";
172
+ constructor(a, r, t) {
173
+ super(a, r, t), this.name = "WindowHandledPromiseRejectionError";
174
174
  }
175
175
  }
176
176
  class Z extends D {
177
- constructor(a, t, r) {
178
- super(a, t, r), this.name = "OperationalError";
177
+ constructor(a, r, t) {
178
+ super(a, r, t), this.name = "OperationalError";
179
179
  }
180
180
  }
181
- async function ee(e, a, t) {
182
- const r = `${a} Response status '${e.status}${e.statusText ? ` - ${e.statusText}` : ""}' received.`, o = await e.text();
183
- return new v(r, t, o);
181
+ async function ee(e, a, r) {
182
+ const t = `${a} Response status '${e.status}${e.statusText ? ` - ${e.statusText}` : ""}' received.`, o = await e.text();
183
+ return new v(t, r, o);
184
184
  }
185
- function re(e) {
185
+ function te(e) {
186
186
  return e.map((a) => a.message).join(" ");
187
187
  }
188
- function te(e, a = "Unknown error.") {
188
+ function re(e, a = "Unknown error.") {
189
189
  if (e instanceof Error) return e;
190
190
  if (typeof e == "string") return new Error(e);
191
191
  try {
@@ -195,26 +195,26 @@ function te(e, a = "Unknown error.") {
195
195
  }
196
196
  }
197
197
  function ae(e) {
198
- const a = /* @__PURE__ */ new Set(), t = [];
199
- let r = e;
200
- for (; r && !a.has(r); ) {
201
- a.add(r);
198
+ const a = /* @__PURE__ */ new Set(), r = [];
199
+ let t = e;
200
+ for (; t && !a.has(t); ) {
201
+ a.add(t);
202
202
  let o;
203
- if (r instanceof v)
204
- o = { body: r.body, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
205
- else if (r instanceof $)
206
- o = { componentName: r.componentName, info: r.info, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
207
- else if (r instanceof D)
208
- o = { locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
209
- else if (r instanceof Error) {
210
- const n = r;
211
- o = { locator: "", message: n.message, name: n.name, stack: n.stack }, r = n.cause;
212
- } else r ? (o = { locator: "", message: String(r), name: "Error" }, r = void 0) : (o = { locator: "", message: "Unknown error.", name: "Error" }, r = void 0);
213
- /(?:\.{3}|[.!?])$/.test(o.message) || (o.message += "."), t.push(o);
203
+ if (t instanceof v)
204
+ o = { body: t.body, locator: t.locator, message: t.message, name: t.name, stack: t.stack }, t = t.cause;
205
+ else if (t instanceof $)
206
+ o = { componentName: t.componentName, info: t.info, locator: t.locator, message: t.message, name: t.name, stack: t.stack }, t = t.cause;
207
+ else if (t instanceof D)
208
+ o = { locator: t.locator, message: t.message, name: t.name, stack: t.stack }, t = t.cause;
209
+ else if (t instanceof Error) {
210
+ const n = t;
211
+ o = { locator: "", message: n.message, name: n.name, stack: n.stack }, t = n.cause;
212
+ } else t ? (o = { locator: "", message: String(t), name: "Error" }, t = void 0) : (o = { locator: "", message: "Unknown error.", name: "Error" }, t = void 0);
213
+ /(?:\.{3}|[.!?])$/.test(o.message) || (o.message += "."), r.push(o);
214
214
  }
215
- return t;
215
+ return r;
216
216
  }
217
- const S = "en-US", E = {}, ne = (e) => {
217
+ const S = "en-US", y = {}, ne = (e) => {
218
218
  switch (e) {
219
219
  case "Edm.Binary":
220
220
  return "unknown";
@@ -255,38 +255,38 @@ const S = "en-US", E = {}, ne = (e) => {
255
255
  }
256
256
  }, oe = (e) => {
257
257
  if (e) {
258
- const a = e.lastIndexOf("/"), t = e.lastIndexOf(".", a > -1 ? a : e.length);
259
- return t > -1 ? e.substring(0, t) : e;
258
+ const a = e.lastIndexOf("/"), r = e.lastIndexOf(".", a > -1 ? a : e.length);
259
+ return r > -1 ? e.substring(0, r) : e;
260
260
  }
261
261
  }, se = (e) => {
262
262
  if (e) {
263
263
  const a = e.lastIndexOf(".");
264
264
  if (a > -1) return e.substring(a + 1);
265
265
  }
266
- }, i = (e, a = 2, t = a, r = S) => {
266
+ }, i = (e, a = 2, r = a, t = S) => {
267
267
  if (e == null) return "";
268
- const o = `${r}decimal${a}.${t}`;
269
- let n = E[o];
270
- return n || (n = new Intl.NumberFormat(r, {
268
+ const o = `${t}decimal${a}.${r}`;
269
+ let n = y[o];
270
+ return n || (n = new Intl.NumberFormat(t, {
271
271
  localeMatcher: "best fit",
272
272
  maximumFractionDigits: a,
273
- minimumFractionDigits: t,
273
+ minimumFractionDigits: r,
274
274
  minimumIntegerDigits: 1,
275
275
  style: "decimal",
276
276
  useGrouping: !0
277
- }), E[o] = n), n.format(e);
278
- }, ie = (e) => e == null ? "" : e < 1e3 ? I(e) : e < 1e6 ? `${i(e / 1e3, 2, 0)}K` : e < 1e9 ? `${i(e / 1e6, 2, 0)}M` : e < 1e12 ? `${i(e / 1e9, 2, 0)}B` : `${i(e / 1e12, 2, 0)}T`, le = (e) => e == null ? "" : e === 1 ? "1 byte" : e < 1024 ? `${I(e)} bytes` : e < 1048576 ? `${i(e / 1024, 2, 0)} KB` : e < 1073741824 ? `${i(e / 1048576, 2, 0)} MB` : e < 1099511627776 ? `${i(e / 1073741824, 2, 0)} GB` : `${i(e / 1099511627776, 2, 0)} TB`, ce = (e) => e == null ? "" : e < 1e3 ? `${I(e)} ms` : e === 1e3 ? `${I(e)} sec` : e < 6e4 ? `${i(e / 1e3, 2, 0)} secs` : e === 6e4 ? "1 min" : e < 36e5 ? `${i(e / 6e4, 2, 0)} mins` : e === 36e5 ? "1 hr" : e < 864e5 ? `${i(e / 36e5, 2, 0)} hrs` : e === 864e5 ? "1 day" : `${i(e / 864e5, 2, 0)} days`, I = (e, a = S) => {
277
+ }), y[o] = n), n.format(e);
278
+ }, ie = (e) => e == null ? "" : e < 1e3 ? E(e) : e < 1e6 ? `${i(e / 1e3, 2, 0)}K` : e < 1e9 ? `${i(e / 1e6, 2, 0)}M` : e < 1e12 ? `${i(e / 1e9, 2, 0)}B` : `${i(e / 1e12, 2, 0)}T`, le = (e) => e == null ? "" : e === 1 ? "1 byte" : e < 1024 ? `${E(e)} bytes` : e < 1048576 ? `${i(e / 1024, 2, 0)} KB` : e < 1073741824 ? `${i(e / 1048576, 2, 0)} MB` : e < 1099511627776 ? `${i(e / 1073741824, 2, 0)} GB` : `${i(e / 1099511627776, 2, 0)} TB`, ce = (e) => e == null ? "" : e < 1e3 ? `${E(e)} ms` : e === 1e3 ? `${E(e)} sec` : e < 6e4 ? `${i(e / 1e3, 2, 0)} secs` : e === 6e4 ? "1 min" : e < 36e5 ? `${i(e / 6e4, 2, 0)} mins` : e === 36e5 ? "1 hr" : e < 864e5 ? `${i(e / 36e5, 2, 0)} hrs` : e === 864e5 ? "1 day" : `${i(e / 864e5, 2, 0)} days`, E = (e, a = S) => {
279
279
  if (e == null) return "";
280
- const t = `${a}decimal0.0`;
281
- let r = E[t];
282
- return r || (r = new Intl.NumberFormat(a, {
280
+ const r = `${a}decimal0.0`;
281
+ let t = y[r];
282
+ return t || (t = new Intl.NumberFormat(a, {
283
283
  localeMatcher: "best fit",
284
284
  maximumFractionDigits: 0,
285
285
  minimumFractionDigits: 0,
286
286
  minimumIntegerDigits: 1,
287
287
  style: "decimal",
288
288
  useGrouping: !0
289
- }), E[t] = r), r.format(e);
289
+ }), y[r] = t), t.format(e);
290
290
  }, de = (e) => {
291
291
  switch (e) {
292
292
  case "csv":
@@ -311,7 +311,7 @@ const S = "en-US", E = {}, ne = (e) => {
311
311
  { id: "xml", label: { "en-gb": "XML" } }
312
312
  ], me = (e = d) => {
313
313
  const a = [];
314
- for (const t of M) a.push({ ...t, label: t.label[e] || t.label[d] || t.id });
314
+ for (const r of M) a.push({ ...r, label: r.label[e] || r.label[d] || r.id });
315
315
  return a;
316
316
  }, j = [
317
317
  { id: `
@@ -321,8 +321,8 @@ const S = "en-US", E = {}, ne = (e) => {
321
321
  `, label: { "en-gb": "Carriage Return/Newline" } }
322
322
  ], ue = (e = d) => {
323
323
  const a = [];
324
- for (const t of j)
325
- a.push({ ...t, label: t.label[e] || t.label[d] || t.id });
324
+ for (const r of j)
325
+ a.push({ ...r, label: r.label[e] || r.label[d] || r.id });
326
326
  return a;
327
327
  }, k = [
328
328
  { id: ":", label: { "en-gb": "Colon" } },
@@ -338,8 +338,8 @@ const S = "en-US", E = {}, ne = (e) => {
338
338
  { id: "|", label: { "en-gb": "Vertical Bar" } }
339
339
  ], pe = (e = d) => {
340
340
  const a = [];
341
- for (const t of k)
342
- a.push({ ...t, label: t.label[e] || t.label[d] || t.id });
341
+ for (const r of k)
342
+ a.push({ ...r, label: r.label[e] || r.label[d] || r.id });
343
343
  return a;
344
344
  }, F = [
345
345
  { id: "alpha", color: "red", label: { "en-gb": "alpha" } },
@@ -352,8 +352,8 @@ const S = "en-US", E = {}, ne = (e) => {
352
352
  { id: "unavailable", color: "other", label: { "en-gb": "unavailable" } },
353
353
  { id: "underReview", color: "other", label: { "en-gb": "under-review" } }
354
354
  ], ge = (e, a = d) => {
355
- const t = F.find((r) => r.id === e);
356
- return t ? { ...t, label: t.label[a] || t.label[d] || e } : { id: e, color: "other", label: e };
355
+ const r = F.find((t) => t.id === e);
356
+ return r ? { ...r, label: r.label[a] || r.label[d] || e } : { id: e, color: "other", label: e };
357
357
  }, d = "en-gb";
358
358
  export {
359
359
  K as APIError,
@@ -369,7 +369,7 @@ export {
369
369
  Y as WindowPromiseRejectionError,
370
370
  Q as WindowRuntimeError,
371
371
  ee as buildFetchError,
372
- re as concatenateSerialisedErrorMessages,
372
+ te as concatenateSerialisedErrorMessages,
373
373
  X as convertMillisecondsToTimestamp,
374
374
  ne as convertODataTypeIdToUsageTypeId,
375
375
  se as extractExtensionFromPath,
@@ -378,14 +378,14 @@ export {
378
378
  ce as formatNumberAsDuration,
379
379
  ie as formatNumberAsSize,
380
380
  le as formatNumberAsStorageSize,
381
- I as formatNumberAsWholeNumber,
381
+ E as formatNumberAsWholeNumber,
382
382
  ge as getComponentStatus,
383
383
  G as getCurrentTimestamp,
384
384
  me as getDataFormats,
385
385
  ue as getRecordDelimiters,
386
386
  pe as getValueDelimiters,
387
387
  de as lookupMimeTypeForExtension,
388
- te as normalizeToError,
388
+ re as normalizeToError,
389
389
  J as presentationViewTypeMap,
390
390
  ae as serialiseError,
391
391
  B as useCytoscapeJS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datapos/datapos-shared",
3
- "version": "0.3.186",
3
+ "version": "0.3.188",
4
4
  "description": "A TypeScript library containing common declarations and utilities used across other Data Positioning repositories.",
5
5
  "license": "MIT",
6
6
  "private": false,