@datapos/datapos-shared 0.3.191 → 0.3.192

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
- const M = ["createObject", "dropObject", "removeRecords", "upsertRecords"], F = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"];
2
- function j() {
3
- function e(a, t, r) {
4
- r.textContent = "Cytoscape.js diagram goes here...";
1
+ const F = ["createObject", "dropObject", "removeRecords", "upsertRecords"], U = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"];
2
+ function P() {
3
+ function e(a, r, t) {
4
+ t.textContent = "Cytoscape.js diagram goes here...";
5
5
  }
6
6
  return { render: e };
7
7
  }
8
- function U() {
9
- function e(a, t, r) {
10
- r.textContent = "values table goes here...";
8
+ function B() {
9
+ function e(a, r, t) {
10
+ t.textContent = "values table goes here...";
11
11
  }
12
12
  return { render: e };
13
13
  }
14
14
  const v = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", I = "highcharts";
15
- let b, D = !1;
16
- function B() {
15
+ let b, T = !1;
16
+ function W() {
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 });
@@ -30,7 +30,7 @@ function B() {
30
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 });
@@ -44,8 +44,8 @@ function B() {
44
44
  }, u = b.chart(m, p, h);
45
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]]);
@@ -60,7 +60,7 @@ function B() {
60
60
  }, c = b.chart(m, u, h);
61
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(
@@ -72,21 +72,21 @@ function B() {
72
72
  );
73
73
  }
74
74
  async function o() {
75
- if (D) return;
76
- await import(`${v}highcharts-more.src.js`), D = !0;
75
+ if (T) return;
76
+ await import(`${v}highcharts-more.src.js`), T = !0;
77
77
  }
78
- return { renderCartesianChart: e, renderPolarChart: a, renderRangeChart: t };
78
+ return { renderCartesianChart: e, renderPolarChart: a, renderRangeChart: r };
79
79
  }
80
- const S = 4, O = `https://cdn.jsdelivr.net/npm/micromark@${S}/+esm`, A = 1, N = `https://cdn.jsdelivr.net/npm/prismjs@${A}/+esm`;
80
+ const A = 4, O = `https://cdn.jsdelivr.net/npm/micromark@${A}/+esm`, w = 1, N = `https://cdn.jsdelivr.net/npm/prismjs@${w}/+esm`, _ = `https://cdn.jsdelivr.net/npm/prismjs@${w}/components/prism-javascript.min.js`, C = `https://cdn.jsdelivr.net/npm/prismjs@${w}/components/prism-json.min.js`;
81
81
  let x;
82
- function P() {
82
+ function H() {
83
83
  async function e() {
84
- return await t(), { micromark: x };
84
+ return await r(), { micromark: x };
85
85
  }
86
86
  async function a() {
87
- await t();
87
+ await r();
88
88
  }
89
- async function t() {
89
+ async function r() {
90
90
  if (x) return;
91
91
  x = (await Promise.all([import(
92
92
  /* @vite-ignore */
@@ -94,11 +94,17 @@ function P() {
94
94
  ), import(
95
95
  /* @vite-ignore */
96
96
  N
97
- )]))[0].micromark;
97
+ )]))[0].micromark, await Promise.all([import(
98
+ /* @vite-ignore */
99
+ _
100
+ ), import(
101
+ /* @vite-ignore */
102
+ C
103
+ )]);
98
104
  }
99
105
  return { getStuff: e, render: a };
100
106
  }
101
- const W = 0, H = (e) => e, z = () => Date.now(), V = {
107
+ const V = 0, z = (e) => e, X = () => Date.now(), G = {
102
108
  cartesian_areaLine: { categoryId: "cartesian", typeId: "areaLine", label: { "en-gb": "Area Line" }, options: { highchartsType: "area" } },
103
109
  cartesian_areaSpline: { categoryId: "cartesian", typeId: "areaSpline", label: { "en-gb": "Area Spline" }, options: { highchartsType: "area" } },
104
110
  cartesian_bar: { categoryId: "cartesian", typeId: "bar", label: { "en-gb": "Bar" }, options: { highchartsType: "bar" } },
@@ -117,63 +123,63 @@ const W = 0, H = (e) => e, z = () => Date.now(), V = {
117
123
  streamgraph: { categoryId: "streamgraph", label: { "en-gb": "Streamgraph" }, options: {} },
118
124
  values: { categoryId: "values", label: { "en-gb": "Values" }, options: {} }
119
125
  };
120
- class w extends Error {
126
+ class D extends Error {
121
127
  locator;
122
- constructor(a, t, r) {
123
- super(a, r), this.name = "DataPosError", this.locator = t, Error.captureStackTrace?.(this, new.target);
128
+ constructor(a, r, t) {
129
+ super(a, t), this.name = "DataPosError", this.locator = r, Error.captureStackTrace?.(this, new.target);
124
130
  }
125
131
  }
126
- class g extends w {
127
- constructor(a, t, r) {
128
- super(a, t, r), this.name = "ApplicationError";
132
+ class g extends D {
133
+ constructor(a, r, t) {
134
+ super(a, r, t), this.name = "ApplicationError";
129
135
  }
130
136
  }
131
- class X extends g {
132
- constructor(a, t, r) {
133
- super(a, t, r), this.name = "APIError";
137
+ class J extends g {
138
+ constructor(a, r, t) {
139
+ super(a, r, t), this.name = "APIError";
134
140
  }
135
141
  }
136
- class G extends g {
137
- constructor(a, t, r) {
138
- super(a, t, r), this.name = "EngineError";
142
+ class K extends g {
143
+ constructor(a, r, t) {
144
+ super(a, r, t), this.name = "EngineError";
139
145
  }
140
146
  }
141
- class T extends g {
147
+ class R extends g {
142
148
  body;
143
- constructor(a, t, r, o) {
144
- super(a, t, o), this.name = "FetchError", this.body = r;
149
+ constructor(a, r, t, o) {
150
+ super(a, r, o), this.name = "FetchError", this.body = t;
145
151
  }
146
152
  }
147
- class _ extends g {
153
+ class L extends g {
148
154
  componentName;
149
155
  info;
150
- constructor(a, t, r, o, n) {
151
- super(a, t, n), this.name = "VueHandledError", this.info = r, this.componentName = o;
156
+ constructor(a, r, t, o, n) {
157
+ super(a, r, n), this.name = "VueHandledError", this.info = t, this.componentName = o;
152
158
  }
153
159
  }
154
- class K extends g {
155
- constructor(a, t, r) {
156
- super(a, t, r), this.name = "WindowHandledRuntimeError";
160
+ class q extends g {
161
+ constructor(a, r, t) {
162
+ super(a, r, t), this.name = "WindowHandledRuntimeError";
157
163
  }
158
164
  }
159
- class J extends g {
160
- constructor(a, t, r) {
161
- super(a, t, r), this.name = "WindowHandledPromiseRejectionError";
165
+ class Q extends g {
166
+ constructor(a, r, t) {
167
+ super(a, r, t), this.name = "WindowHandledPromiseRejectionError";
162
168
  }
163
169
  }
164
- class q extends w {
165
- constructor(a, t, r) {
166
- super(a, t, r), this.name = "OperationalError";
170
+ class Y extends D {
171
+ constructor(a, r, t) {
172
+ super(a, r, t), this.name = "OperationalError";
167
173
  }
168
174
  }
169
- async function Q(e, a, t) {
170
- const r = `${a} Response status '${e.status}${e.statusText ? ` - ${e.statusText}` : ""}' received.`, o = await e.text();
171
- return new T(r, t, o);
175
+ async function Z(e, a, r) {
176
+ const t = `${a} Response status '${e.status}${e.statusText ? ` - ${e.statusText}` : ""}' received.`, o = await e.text();
177
+ return new R(t, r, o);
172
178
  }
173
- function Y(e) {
179
+ function ee(e) {
174
180
  return e.map((a) => a.message).join(" ");
175
181
  }
176
- function Z(e, a = "Unknown error.") {
182
+ function te(e, a = "Unknown error.") {
177
183
  if (e instanceof Error) return e;
178
184
  if (typeof e == "string") return new Error(e);
179
185
  try {
@@ -182,27 +188,27 @@ function Z(e, a = "Unknown error.") {
182
188
  return new Error(a);
183
189
  }
184
190
  }
185
- function ee(e) {
186
- const a = /* @__PURE__ */ new Set(), t = [];
187
- let r = e;
188
- for (; r && !a.has(r); ) {
189
- a.add(r);
191
+ function re(e) {
192
+ const a = /* @__PURE__ */ new Set(), r = [];
193
+ let t = e;
194
+ for (; t && !a.has(t); ) {
195
+ a.add(t);
190
196
  let o;
191
- if (r instanceof T)
192
- o = { body: r.body, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
193
- else if (r instanceof _)
194
- o = { componentName: r.componentName, info: r.info, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
195
- else if (r instanceof w)
196
- o = { locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
197
- else if (r instanceof Error) {
198
- const n = r;
199
- o = { locator: "", message: n.message, name: n.name, stack: n.stack }, r = n.cause;
200
- } else r ? (o = { locator: "", message: String(r), name: "Error" }, r = void 0) : (o = { locator: "", message: "Unknown error.", name: "Error" }, r = void 0);
201
- /(?:\.{3}|[.!?])$/.test(o.message) || (o.message += "."), t.push(o);
197
+ if (t instanceof R)
198
+ o = { body: t.body, locator: t.locator, message: t.message, name: t.name, stack: t.stack }, t = t.cause;
199
+ else if (t instanceof L)
200
+ o = { componentName: t.componentName, info: t.info, locator: t.locator, message: t.message, name: t.name, stack: t.stack }, t = t.cause;
201
+ else if (t instanceof D)
202
+ o = { locator: t.locator, message: t.message, name: t.name, stack: t.stack }, t = t.cause;
203
+ else if (t instanceof Error) {
204
+ const n = t;
205
+ o = { locator: "", message: n.message, name: n.name, stack: n.stack }, t = n.cause;
206
+ } else t ? (o = { locator: "", message: String(t), name: "Error" }, t = void 0) : (o = { locator: "", message: "Unknown error.", name: "Error" }, t = void 0);
207
+ /(?:\.{3}|[.!?])$/.test(o.message) || (o.message += "."), r.push(o);
202
208
  }
203
- return t;
209
+ return r;
204
210
  }
205
- const R = "en-US", y = {}, re = (e) => {
211
+ const S = "en-US", y = {}, ae = (e) => {
206
212
  switch (e) {
207
213
  case "Edm.Binary":
208
214
  return "unknown";
@@ -241,41 +247,41 @@ const R = "en-US", y = {}, re = (e) => {
241
247
  default:
242
248
  return "unknown";
243
249
  }
244
- }, te = (e) => {
250
+ }, ne = (e) => {
245
251
  if (e) {
246
- const a = e.lastIndexOf("/"), t = e.lastIndexOf(".", a > -1 ? a : e.length);
247
- return t > -1 ? e.substring(0, t) : e;
252
+ const a = e.lastIndexOf("/"), r = e.lastIndexOf(".", a > -1 ? a : e.length);
253
+ return r > -1 ? e.substring(0, r) : e;
248
254
  }
249
- }, ae = (e) => {
255
+ }, oe = (e) => {
250
256
  if (e) {
251
257
  const a = e.lastIndexOf(".");
252
258
  if (a > -1) return e.substring(a + 1);
253
259
  }
254
- }, i = (e, a = 2, t = a, r = R) => {
260
+ }, i = (e, a = 2, r = a, t = S) => {
255
261
  if (e == null) return "";
256
- const o = `${r}decimal${a}.${t}`;
262
+ const o = `${t}decimal${a}.${r}`;
257
263
  let n = y[o];
258
- return n || (n = new Intl.NumberFormat(r, {
264
+ return n || (n = new Intl.NumberFormat(t, {
259
265
  localeMatcher: "best fit",
260
266
  maximumFractionDigits: a,
261
- minimumFractionDigits: t,
267
+ minimumFractionDigits: r,
262
268
  minimumIntegerDigits: 1,
263
269
  style: "decimal",
264
270
  useGrouping: !0
265
271
  }), y[o] = n), n.format(e);
266
- }, ne = (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`, oe = (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`, se = (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 = R) => {
272
+ }, se = (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`, ie = (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`, le = (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) => {
267
273
  if (e == null) return "";
268
- const t = `${a}decimal0.0`;
269
- let r = y[t];
270
- return r || (r = new Intl.NumberFormat(a, {
274
+ const r = `${a}decimal0.0`;
275
+ let t = y[r];
276
+ return t || (t = new Intl.NumberFormat(a, {
271
277
  localeMatcher: "best fit",
272
278
  maximumFractionDigits: 0,
273
279
  minimumFractionDigits: 0,
274
280
  minimumIntegerDigits: 1,
275
281
  style: "decimal",
276
282
  useGrouping: !0
277
- }), y[t] = r), r.format(e);
278
- }, ie = (e) => {
283
+ }), y[r] = t), t.format(e);
284
+ }, ce = (e) => {
279
285
  switch (e) {
280
286
  case "csv":
281
287
  return "text/csv";
@@ -289,7 +295,7 @@ const R = "en-US", y = {}, re = (e) => {
289
295
  default:
290
296
  return "application/octet-stream";
291
297
  }
292
- }, C = [
298
+ }, $ = [
293
299
  { id: "dtv", label: { "en-gb": "Delimited Text" } },
294
300
  { id: "e/e", label: { "en-gb": "Entity/Event" } },
295
301
  { id: "jsonArray", label: { "en-gb": "JSON Array" } },
@@ -297,22 +303,22 @@ const R = "en-US", y = {}, re = (e) => {
297
303
  { id: "xls", label: { "en-gb": "XLS" } },
298
304
  { id: "xlsx", label: { "en-gb": "XLSX" } },
299
305
  { id: "xml", label: { "en-gb": "XML" } }
300
- ], le = (e = d) => {
306
+ ], de = (e = d) => {
301
307
  const a = [];
302
- for (const t of C) a.push({ ...t, label: t.label[e] || t.label[d] || t.id });
308
+ for (const r of $) a.push({ ...r, label: r.label[e] || r.label[d] || r.id });
303
309
  return a;
304
- }, L = [
310
+ }, M = [
305
311
  { id: `
306
312
  `, label: { "en-gb": "Newline" } },
307
313
  { id: "\r", label: { "en-gb": "Carriage Return" } },
308
314
  { id: `\r
309
315
  `, label: { "en-gb": "Carriage Return/Newline" } }
310
- ], ce = (e = d) => {
316
+ ], me = (e = d) => {
311
317
  const a = [];
312
- for (const t of L)
313
- a.push({ ...t, label: t.label[e] || t.label[d] || t.id });
318
+ for (const r of M)
319
+ a.push({ ...r, label: r.label[e] || r.label[d] || r.id });
314
320
  return a;
315
- }, $ = [
321
+ }, j = [
316
322
  { id: ":", label: { "en-gb": "Colon" } },
317
323
  { id: ",", label: { "en-gb": "Comma" } },
318
324
  { id: "!", label: { "en-gb": "Exclamation Mark" } },
@@ -324,10 +330,10 @@ const R = "en-US", y = {}, re = (e) => {
324
330
  { id: "_", label: { "en-gb": "Underscore" } },
325
331
  { id: "0x1F", label: { "en-gb": "Unit Separator" } },
326
332
  { id: "|", label: { "en-gb": "Vertical Bar" } }
327
- ], de = (e = d) => {
333
+ ], ue = (e = d) => {
328
334
  const a = [];
329
- for (const t of $)
330
- a.push({ ...t, label: t.label[e] || t.label[d] || t.id });
335
+ for (const r of j)
336
+ a.push({ ...r, label: r.label[e] || r.label[d] || r.id });
331
337
  return a;
332
338
  }, k = [
333
339
  { id: "alpha", color: "red", label: { "en-gb": "alpha" } },
@@ -339,45 +345,45 @@ const R = "en-US", y = {}, re = (e) => {
339
345
  { id: "releaseCandidate", color: "green", label: { "en-gb": "release-candidate" } },
340
346
  { id: "unavailable", color: "other", label: { "en-gb": "unavailable" } },
341
347
  { id: "underReview", color: "other", label: { "en-gb": "under-review" } }
342
- ], me = (e, a = d) => {
343
- const t = k.find((r) => r.id === e);
344
- return t ? { ...t, label: t.label[a] || t.label[d] || e } : { id: e, color: "other", label: e };
348
+ ], pe = (e, a = d) => {
349
+ const r = k.find((t) => t.id === e);
350
+ return r ? { ...r, label: r.label[a] || r.label[d] || e } : { id: e, color: "other", label: e };
345
351
  }, d = "en-gb";
346
352
  export {
347
- X as APIError,
353
+ J as APIError,
348
354
  g as ApplicationError,
349
- M as CONNECTOR_DESTINATION_OPERATIONS,
350
- F as CONNECTOR_SOURCE_OPERATIONS,
355
+ F as CONNECTOR_DESTINATION_OPERATIONS,
356
+ U as CONNECTOR_SOURCE_OPERATIONS,
351
357
  d as DEFAULT_LOCALE_CODE,
352
- W as DefaultTimestamp,
353
- G as EngineError,
354
- T as FetchError,
355
- q as OperationalError,
356
- _ as VueError,
357
- J as WindowPromiseRejectionError,
358
- K as WindowRuntimeError,
359
- Q as buildFetchError,
360
- Y as concatenateSerialisedErrorMessages,
361
- H as convertMillisecondsToTimestamp,
362
- re as convertODataTypeIdToUsageTypeId,
363
- ae as extractExtensionFromPath,
364
- te as extractNameFromPath,
358
+ V as DefaultTimestamp,
359
+ K as EngineError,
360
+ R as FetchError,
361
+ Y as OperationalError,
362
+ L as VueError,
363
+ Q as WindowPromiseRejectionError,
364
+ q as WindowRuntimeError,
365
+ Z as buildFetchError,
366
+ ee as concatenateSerialisedErrorMessages,
367
+ z as convertMillisecondsToTimestamp,
368
+ ae as convertODataTypeIdToUsageTypeId,
369
+ oe as extractExtensionFromPath,
370
+ ne as extractNameFromPath,
365
371
  i as formatNumberAsDecimalNumber,
366
- se as formatNumberAsDuration,
367
- ne as formatNumberAsSize,
368
- oe as formatNumberAsStorageSize,
372
+ le as formatNumberAsDuration,
373
+ se as formatNumberAsSize,
374
+ ie as formatNumberAsStorageSize,
369
375
  E as formatNumberAsWholeNumber,
370
- me as getComponentStatus,
371
- z as getCurrentTimestamp,
372
- le as getDataFormats,
373
- ce as getRecordDelimiters,
374
- de as getValueDelimiters,
375
- ie as lookupMimeTypeForExtension,
376
- Z as normalizeToError,
377
- V as presentationViewTypeMap,
378
- ee as serialiseError,
379
- j as useCytoscapeJS,
380
- U as useDataTable,
381
- B as useHighcharts,
382
- P as useMicromark
376
+ pe as getComponentStatus,
377
+ X as getCurrentTimestamp,
378
+ de as getDataFormats,
379
+ me as getRecordDelimiters,
380
+ ue as getValueDelimiters,
381
+ ce as lookupMimeTypeForExtension,
382
+ te as normalizeToError,
383
+ G as presentationViewTypeMap,
384
+ re as serialiseError,
385
+ P as useCytoscapeJS,
386
+ B as useDataTable,
387
+ W as useHighcharts,
388
+ H as useMicromark
383
389
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datapos/datapos-shared",
3
- "version": "0.3.191",
3
+ "version": "0.3.192",
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,