@datapos/datapos-shared 0.3.168 → 0.3.169

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,100 +1,97 @@
1
- const F = ["createObject", "dropObject", "removeRecords", "upsertRecords"], j = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"];
2
- function U() {
1
+ const M = ["createObject", "dropObject", "removeRecords", "upsertRecords"], k = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"];
2
+ function F() {
3
3
  function e(t, a, r) {
4
4
  r.textContent = "Cytoscape.js diagram goes here...";
5
5
  }
6
6
  return { render: e };
7
7
  }
8
- function B() {
8
+ function U() {
9
9
  function e(t, a, r) {
10
10
  r.textContent = "values table goes here...";
11
11
  }
12
12
  return { render: e };
13
13
  }
14
- const O = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", x = "highcharts";
14
+ const N = "https://cdn.jsdelivr.net/npm/highcharts@11.4.3/es-modules/masters/", x = "highcharts";
15
15
  let b, T = !1;
16
- function P() {
17
- async function e(n, s, m, h) {
16
+ function j() {
17
+ async function e(n, s, u, h) {
18
18
  await r();
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 });
22
- const p = {
22
+ const g = {
23
23
  chart: { type: n.options.highchartsType },
24
24
  plotOptions: { series: { borderColor: "#333" } },
25
25
  series: l,
26
26
  title: { text: s.title.text },
27
27
  xAxis: { categories: s.data.categoryLabels },
28
28
  yAxis: { title: { text: s.data.name } }
29
- }, u = b.chart(m, p, h);
30
- return { chart: u, resize: () => u.reflow(), vendorId: x };
29
+ }, m = b.chart(u, g, h);
30
+ return { chart: m, resize: () => m.reflow(), vendorId: x };
31
31
  }
32
- async function t(n, s, m, h) {
32
+ async function t(n, s, u, h) {
33
33
  await Promise.all([r(), 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 });
37
- const p = {
37
+ const g = {
38
38
  chart: { polar: !0 },
39
39
  plotOptions: { series: { borderColor: "#333" } },
40
40
  series: l,
41
41
  title: { text: s.title.text },
42
42
  xAxis: { categories: s.data.categoryLabels },
43
43
  yAxis: { title: { text: s.data.name } }
44
- }, u = b.chart(m, p, h);
45
- return { chart: u, resize: () => u.reflow(), vendorId: x };
44
+ }, m = b.chart(u, g, h);
45
+ return { chart: m, resize: () => m.reflow(), vendorId: x };
46
46
  }
47
- async function a(n, s, m, h) {
47
+ async function a(n, s, u, h) {
48
48
  await Promise.all([r(), o()]);
49
- const l = [], p = [];
49
+ const l = [], g = [];
50
50
  for (let f = 0; f < s.data.measures[0].data.length; f++)
51
- p.push([s.data.measures[0].data[f][0], s.data.measures[1].data[f][0]]);
52
- l.push({ type: n.options.highchartsType, name: "Unknown", data: p });
53
- const u = {
51
+ g.push([s.data.measures[0].data[f][0], s.data.measures[1].data[f][0]]);
52
+ l.push({ type: n.options.highchartsType, name: "Unknown", data: g });
53
+ const m = {
54
54
  chart: { type: n.options.highchartsType, inverted: n.options.inverted },
55
55
  plotOptions: { series: { borderColor: "#333" } },
56
56
  series: l,
57
57
  title: { text: s.title.text },
58
58
  xAxis: { categories: s.data.categoryLabels },
59
59
  yAxis: { title: { text: s.data.name } }
60
- }, c = b.chart(m, u, h);
60
+ }, c = b.chart(u, m, h);
61
61
  return { chart: c, resize: () => c.reflow(), vendorId: x };
62
62
  }
63
63
  async function r() {
64
64
  if (b) return;
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`;
65
+ 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`;
66
66
  b = (await import(
67
67
  /* @vite-ignore */
68
68
  s
69
69
  )).default, await import(
70
70
  /* @vite-ignore */
71
- m
71
+ u
72
72
  );
73
73
  }
74
74
  async function o() {
75
75
  if (T) return;
76
- await import(`${O}highcharts-more.src.js`), T = !0;
76
+ await import(`${N}highcharts-more.src.js`), T = !0;
77
77
  }
78
78
  return { renderCartesianChart: e, renderPolarChart: t, renderRangeChart: a };
79
79
  }
80
- const S = 4, A = `https://cdn.jsdelivr.net/npm/micromark@${S}/+esm`, N = 1, C = `https://cdn.jsdelivr.net/npm/prismjs@${N}/+esm`;
81
- let I, w;
82
- function W() {
80
+ const S = 4, A = `https://cdn.jsdelivr.net/npm/micromark@${S}/+esm`;
81
+ let I, D;
82
+ function B() {
83
83
  async function e(a, r, o) {
84
84
  await t(), o.textContent = "Micromark & Prism content goes here...";
85
85
  }
86
86
  async function t() {
87
- I && w || (I = await import(
87
+ I && D || (I = await import(
88
88
  /* @vite-ignore */
89
89
  A
90
- ), w = await import(
91
- /* @vite-ignore */
92
- C
93
- ), console.log("micromarkModule", I), console.log("prismModule", w));
90
+ ), console.log("micromarkModule", I), console.log("prismModule", D));
94
91
  }
95
92
  return { render: e };
96
93
  }
97
- const H = 0, z = (e) => e, V = () => Date.now(), X = {
94
+ const H = 0, P = (e) => e, W = () => Date.now(), z = {
98
95
  cartesian_areaLine: { categoryId: "cartesian", typeId: "areaLine", label: { "en-gb": "Area Line" }, options: { highchartsType: "area" } },
99
96
  cartesian_areaSpline: { categoryId: "cartesian", typeId: "areaSpline", label: { "en-gb": "Area Spline" }, options: { highchartsType: "area" } },
100
97
  cartesian_bar: { categoryId: "cartesian", typeId: "bar", label: { "en-gb": "Bar" }, options: { highchartsType: "bar" } },
@@ -113,63 +110,63 @@ const H = 0, z = (e) => e, V = () => Date.now(), X = {
113
110
  streamgraph: { categoryId: "streamgraph", label: { "en-gb": "Streamgraph" }, options: {} },
114
111
  values: { categoryId: "values", label: { "en-gb": "Values" }, options: {} }
115
112
  };
116
- class D extends Error {
113
+ class w extends Error {
117
114
  locator;
118
115
  constructor(t, a, r) {
119
116
  super(t, r), this.name = "DataPosError", this.locator = a, Error.captureStackTrace?.(this, new.target);
120
117
  }
121
118
  }
122
- class g extends D {
119
+ class p extends w {
123
120
  constructor(t, a, r) {
124
121
  super(t, a, r), this.name = "ApplicationError";
125
122
  }
126
123
  }
127
- class G extends g {
124
+ class V extends p {
128
125
  constructor(t, a, r) {
129
126
  super(t, a, r), this.name = "APIError";
130
127
  }
131
128
  }
132
- class K extends g {
129
+ class X extends p {
133
130
  constructor(t, a, r) {
134
131
  super(t, a, r), this.name = "EngineError";
135
132
  }
136
133
  }
137
- class v extends g {
134
+ class v extends p {
138
135
  body;
139
136
  constructor(t, a, r, o) {
140
137
  super(t, a, o), this.name = "FetchError", this.body = r;
141
138
  }
142
139
  }
143
- class _ extends g {
140
+ class O extends p {
144
141
  componentName;
145
142
  info;
146
143
  constructor(t, a, r, o, n) {
147
144
  super(t, a, n), this.name = "VueHandledError", this.info = r, this.componentName = o;
148
145
  }
149
146
  }
150
- class J extends g {
147
+ class G extends p {
151
148
  constructor(t, a, r) {
152
149
  super(t, a, r), this.name = "WindowHandledRuntimeError";
153
150
  }
154
151
  }
155
- class q extends g {
152
+ class K extends p {
156
153
  constructor(t, a, r) {
157
154
  super(t, a, r), this.name = "WindowHandledPromiseRejectionError";
158
155
  }
159
156
  }
160
- class Q extends D {
157
+ class J extends w {
161
158
  constructor(t, a, r) {
162
159
  super(t, a, r), this.name = "OperationalError";
163
160
  }
164
161
  }
165
- async function Y(e, t, a) {
162
+ async function q(e, t, a) {
166
163
  const r = `${t} Response status '${e.status}${e.statusText ? ` - ${e.statusText}` : ""}' received.`, o = await e.text();
167
164
  return new v(r, a, o);
168
165
  }
169
- function Z(e) {
166
+ function Q(e) {
170
167
  return e.map((t) => t.message).join(" ");
171
168
  }
172
- function ee(e, t = "Unknown error.") {
169
+ function Y(e, t = "Unknown error.") {
173
170
  if (e instanceof Error) return e;
174
171
  if (typeof e == "string") return new Error(e);
175
172
  try {
@@ -178,7 +175,7 @@ function ee(e, t = "Unknown error.") {
178
175
  return new Error(t);
179
176
  }
180
177
  }
181
- function re(e) {
178
+ function Z(e) {
182
179
  const t = /* @__PURE__ */ new Set(), a = [];
183
180
  let r = e;
184
181
  for (; r && !t.has(r); ) {
@@ -186,9 +183,9 @@ function re(e) {
186
183
  let o;
187
184
  if (r instanceof v)
188
185
  o = { body: r.body, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
189
- else if (r instanceof _)
186
+ else if (r instanceof O)
190
187
  o = { componentName: r.componentName, info: r.info, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
191
- else if (r instanceof D)
188
+ else if (r instanceof w)
192
189
  o = { locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
193
190
  else if (r instanceof Error) {
194
191
  const n = r;
@@ -198,7 +195,7 @@ function re(e) {
198
195
  }
199
196
  return a;
200
197
  }
201
- const R = "en-US", y = {}, te = (e) => {
198
+ const R = "en-US", y = {}, ee = (e) => {
202
199
  switch (e) {
203
200
  case "Edm.Binary":
204
201
  return "unknown";
@@ -237,12 +234,12 @@ const R = "en-US", y = {}, te = (e) => {
237
234
  default:
238
235
  return "unknown";
239
236
  }
240
- }, ae = (e) => {
237
+ }, re = (e) => {
241
238
  if (e) {
242
239
  const t = e.lastIndexOf("/"), a = e.lastIndexOf(".", t > -1 ? t : e.length);
243
240
  return a > -1 ? e.substring(0, a) : e;
244
241
  }
245
- }, ne = (e) => {
242
+ }, te = (e) => {
246
243
  if (e) {
247
244
  const t = e.lastIndexOf(".");
248
245
  if (t > -1) return e.substring(t + 1);
@@ -259,7 +256,7 @@ const R = "en-US", y = {}, te = (e) => {
259
256
  style: "decimal",
260
257
  useGrouping: !0
261
258
  }), y[o] = n), n.format(e);
262
- }, oe = (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`, se = (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`, ie = (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, t = R) => {
259
+ }, ae = (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`, ne = (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`, oe = (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, t = R) => {
263
260
  if (e == null) return "";
264
261
  const a = `${t}decimal0.0`;
265
262
  let r = y[a];
@@ -271,7 +268,7 @@ const R = "en-US", y = {}, te = (e) => {
271
268
  style: "decimal",
272
269
  useGrouping: !0
273
270
  }), y[a] = r), r.format(e);
274
- }, le = (e) => {
271
+ }, se = (e) => {
275
272
  switch (e) {
276
273
  case "csv":
277
274
  return "text/csv";
@@ -285,7 +282,7 @@ const R = "en-US", y = {}, te = (e) => {
285
282
  default:
286
283
  return "application/octet-stream";
287
284
  }
288
- }, L = [
285
+ }, C = [
289
286
  { id: "dtv", label: { "en-gb": "Delimited Text" } },
290
287
  { id: "e/e", label: { "en-gb": "Entity/Event" } },
291
288
  { id: "jsonArray", label: { "en-gb": "JSON Array" } },
@@ -293,22 +290,22 @@ const R = "en-US", y = {}, te = (e) => {
293
290
  { id: "xls", label: { "en-gb": "XLS" } },
294
291
  { id: "xlsx", label: { "en-gb": "XLSX" } },
295
292
  { id: "xml", label: { "en-gb": "XML" } }
296
- ], ce = (e = d) => {
293
+ ], ie = (e = d) => {
297
294
  const t = [];
298
- for (const a of L) t.push({ ...a, label: a.label[e] || a.label[d] || a.id });
295
+ for (const a of C) t.push({ ...a, label: a.label[e] || a.label[d] || a.id });
299
296
  return t;
300
- }, $ = [
297
+ }, _ = [
301
298
  { id: `
302
299
  `, label: { "en-gb": "Newline" } },
303
300
  { id: "\r", label: { "en-gb": "Carriage Return" } },
304
301
  { id: `\r
305
302
  `, label: { "en-gb": "Carriage Return/Newline" } }
306
- ], de = (e = d) => {
303
+ ], le = (e = d) => {
307
304
  const t = [];
308
- for (const a of $)
305
+ for (const a of _)
309
306
  t.push({ ...a, label: a.label[e] || a.label[d] || a.id });
310
307
  return t;
311
- }, M = [
308
+ }, L = [
312
309
  { id: ":", label: { "en-gb": "Colon" } },
313
310
  { id: ",", label: { "en-gb": "Comma" } },
314
311
  { id: "!", label: { "en-gb": "Exclamation Mark" } },
@@ -320,12 +317,12 @@ const R = "en-US", y = {}, te = (e) => {
320
317
  { id: "_", label: { "en-gb": "Underscore" } },
321
318
  { id: "0x1F", label: { "en-gb": "Unit Separator" } },
322
319
  { id: "|", label: { "en-gb": "Vertical Bar" } }
323
- ], me = (e = d) => {
320
+ ], ce = (e = d) => {
324
321
  const t = [];
325
- for (const a of M)
322
+ for (const a of L)
326
323
  t.push({ ...a, label: a.label[e] || a.label[d] || a.id });
327
324
  return t;
328
- }, k = [
325
+ }, $ = [
329
326
  { id: "alpha", color: "red", label: { "en-gb": "alpha" } },
330
327
  { id: "beta", color: "amber", label: { "en-gb": "beta" } },
331
328
  { id: "generalAvailability", color: "green", label: { "en-gb": "" } },
@@ -335,45 +332,45 @@ const R = "en-US", y = {}, te = (e) => {
335
332
  { id: "releaseCandidate", color: "green", label: { "en-gb": "release-candidate" } },
336
333
  { id: "unavailable", color: "other", label: { "en-gb": "unavailable" } },
337
334
  { id: "underReview", color: "other", label: { "en-gb": "under-review" } }
338
- ], ue = (e, t = d) => {
339
- const a = k.find((r) => r.id === e);
335
+ ], de = (e, t = d) => {
336
+ const a = $.find((r) => r.id === e);
340
337
  return a ? { ...a, label: a.label[t] || a.label[d] || e } : { id: e, color: "other", label: e };
341
338
  }, d = "en-gb";
342
339
  export {
343
- G as APIError,
344
- g as ApplicationError,
345
- F as CONNECTOR_DESTINATION_OPERATIONS,
346
- j as CONNECTOR_SOURCE_OPERATIONS,
340
+ V as APIError,
341
+ p as ApplicationError,
342
+ M as CONNECTOR_DESTINATION_OPERATIONS,
343
+ k as CONNECTOR_SOURCE_OPERATIONS,
347
344
  d as DEFAULT_LOCALE_CODE,
348
345
  H as DefaultTimestamp,
349
- K as EngineError,
346
+ X as EngineError,
350
347
  v as FetchError,
351
- Q as OperationalError,
352
- _ as VueError,
353
- q as WindowPromiseRejectionError,
354
- J as WindowRuntimeError,
355
- Y as buildFetchError,
356
- Z as concatenateSerialisedErrorMessages,
357
- z as convertMillisecondsToTimestamp,
358
- te as convertODataTypeIdToUsageTypeId,
359
- ne as extractExtensionFromPath,
360
- ae as extractNameFromPath,
348
+ J as OperationalError,
349
+ O as VueError,
350
+ K as WindowPromiseRejectionError,
351
+ G as WindowRuntimeError,
352
+ q as buildFetchError,
353
+ Q as concatenateSerialisedErrorMessages,
354
+ P as convertMillisecondsToTimestamp,
355
+ ee as convertODataTypeIdToUsageTypeId,
356
+ te as extractExtensionFromPath,
357
+ re as extractNameFromPath,
361
358
  i as formatNumberAsDecimalNumber,
362
- ie as formatNumberAsDuration,
363
- oe as formatNumberAsSize,
364
- se as formatNumberAsStorageSize,
359
+ oe as formatNumberAsDuration,
360
+ ae as formatNumberAsSize,
361
+ ne as formatNumberAsStorageSize,
365
362
  E as formatNumberAsWholeNumber,
366
- ue as getComponentStatus,
367
- V as getCurrentTimestamp,
368
- ce as getDataFormats,
369
- de as getRecordDelimiters,
370
- me as getValueDelimiters,
371
- le as lookupMimeTypeForExtension,
372
- ee as normalizeToError,
373
- X as presentationViewTypeMap,
374
- re as serialiseError,
375
- U as useCytoscapeJS,
376
- B as useDataTable,
377
- P as useHighcharts,
378
- W as useMicromark
363
+ de as getComponentStatus,
364
+ W as getCurrentTimestamp,
365
+ ie as getDataFormats,
366
+ le as getRecordDelimiters,
367
+ ce as getValueDelimiters,
368
+ se as lookupMimeTypeForExtension,
369
+ Y as normalizeToError,
370
+ z as presentationViewTypeMap,
371
+ Z as serialiseError,
372
+ F as useCytoscapeJS,
373
+ U as useDataTable,
374
+ j as useHighcharts,
375
+ B as useMicromark
379
376
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datapos/datapos-shared",
3
- "version": "0.3.168",
3
+ "version": "0.3.169",
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,