@datapos/datapos-shared 0.3.337 → 0.3.338

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,23 +1,22 @@
1
- import { convertODataTypeIdToUsageTypeId as Ge, extractExtensionFromPath as Ve, extractNameFromPath as He, formatNumberAsDecimalNumber as We, formatNumberAsDuration as $e, formatNumberAsSize as Xe, formatNumberAsStorageSize as Be, formatNumberAsWholeNumber as Je, lookupMimeTypeForExtension as Ke } from "./datapos-shared.utilities.es.js";
2
- let j;
1
+ let M;
3
2
  // @__NO_SIDE_EFFECTS__
4
- function G(t) {
3
+ function V(t) {
5
4
  return {
6
- lang: t?.lang ?? j?.lang,
5
+ lang: t?.lang ?? M?.lang,
7
6
  message: t?.message,
8
- abortEarly: t?.abortEarly ?? j?.abortEarly,
9
- abortPipeEarly: t?.abortPipeEarly ?? j?.abortPipeEarly
7
+ abortEarly: t?.abortEarly ?? M?.abortEarly,
8
+ abortPipeEarly: t?.abortPipeEarly ?? M?.abortPipeEarly
10
9
  };
11
10
  }
12
- let V;
11
+ let z;
13
12
  // @__NO_SIDE_EFFECTS__
14
13
  function H(t) {
15
- return V?.get(t);
14
+ return z?.get(t);
16
15
  }
17
- let W;
16
+ let $;
18
17
  // @__NO_SIDE_EFFECTS__
19
- function $(t) {
20
- return W?.get(t);
18
+ function W(t) {
19
+ return $?.get(t);
21
20
  }
22
21
  let X;
23
22
  // @__NO_SIDE_EFFECTS__
@@ -25,12 +24,12 @@ function B(t, n) {
25
24
  return X?.get(t)?.get(n);
26
25
  }
27
26
  // @__NO_SIDE_EFFECTS__
28
- function T(t) {
27
+ function _(t) {
29
28
  const n = typeof t;
30
29
  return n === "string" ? `"${t}"` : n === "number" || n === "bigint" || n === "boolean" ? `${t}` : n === "object" || n === "function" ? (t && Object.getPrototypeOf(t)?.constructor?.name) ?? "null" : n;
31
30
  }
32
31
  function y(t, n, e, r, s) {
33
- const o = s && "input" in s ? s.input : e.value, i = s?.expected ?? t.expects ?? null, u = s?.received ?? /* @__PURE__ */ T(o), a = {
32
+ const o = s && "input" in s ? s.input : e.value, i = s?.expected ?? t.expects ?? null, u = s?.received ?? /* @__PURE__ */ _(o), a = {
34
33
  kind: t.kind,
35
34
  type: t.type,
36
35
  input: o,
@@ -43,7 +42,7 @@ function y(t, n, e, r, s) {
43
42
  lang: r.lang,
44
43
  abortEarly: r.abortEarly,
45
44
  abortPipeEarly: r.abortPipeEarly
46
- }, p = t.kind === "schema", d = s?.message ?? t.message ?? /* @__PURE__ */ B(t.reference, a.lang) ?? (p ? /* @__PURE__ */ $(a.lang) : null) ?? r.message ?? /* @__PURE__ */ H(a.lang);
45
+ }, p = t.kind === "schema", d = s?.message ?? t.message ?? /* @__PURE__ */ B(t.reference, a.lang) ?? (p ? /* @__PURE__ */ W(a.lang) : null) ?? r.message ?? /* @__PURE__ */ H(a.lang);
47
46
  d !== void 0 && (a.message = typeof d == "function" ? d(a) : d), p && (e.typed = !1), e.issues ? e.issues.push(a) : e.issues = [a];
48
47
  }
49
48
  // @__NO_SIDE_EFFECTS__
@@ -52,7 +51,7 @@ function g(t) {
52
51
  version: 1,
53
52
  vendor: "valibot",
54
53
  validate(n) {
55
- return t["~run"]({ value: n }, /* @__PURE__ */ G());
54
+ return t["~run"]({ value: n }, /* @__PURE__ */ V());
56
55
  }
57
56
  };
58
57
  }
@@ -115,11 +114,11 @@ function E(t, n) {
115
114
  };
116
115
  }
117
116
  // @__NO_SIDE_EFFECTS__
118
- function _(t) {
117
+ function T(t) {
119
118
  return {
120
119
  kind: "schema",
121
120
  type: "boolean",
122
- reference: _,
121
+ reference: T,
123
122
  expects: "boolean",
124
123
  async: !1,
125
124
  message: t,
@@ -137,7 +136,7 @@ function k(t, n) {
137
136
  kind: "schema",
138
137
  type: "literal",
139
138
  reference: k,
140
- expects: /* @__PURE__ */ T(t),
139
+ expects: /* @__PURE__ */ _(t),
141
140
  async: !1,
142
141
  literal: t,
143
142
  message: n,
@@ -259,11 +258,11 @@ function f(t, n) {
259
258
  };
260
259
  }
261
260
  // @__NO_SIDE_EFFECTS__
262
- function A(t, n, e) {
261
+ function R(t, n, e) {
263
262
  return {
264
263
  kind: "schema",
265
264
  type: "record",
266
- reference: A,
265
+ reference: R,
267
266
  expects: "Object",
268
267
  async: !1,
269
268
  key: t,
@@ -340,11 +339,11 @@ function P(t) {
340
339
  return n;
341
340
  }
342
341
  // @__NO_SIDE_EFFECTS__
343
- function F(t, n) {
342
+ function U(t, n) {
344
343
  return {
345
344
  kind: "schema",
346
345
  type: "union",
347
- reference: F,
346
+ reference: U,
348
347
  expects: /* @__PURE__ */ K(t.map((e) => e.expects), "|"),
349
348
  async: !1,
350
349
  options: t,
@@ -375,12 +374,12 @@ function F(t, n) {
375
374
  }
376
375
  };
377
376
  }
378
- const h = (t) => /* @__PURE__ */ F(t.map((n) => /* @__PURE__ */ k(n))), Q = /* @__PURE__ */ b({
377
+ const h = (t) => /* @__PURE__ */ U(t.map((n) => /* @__PURE__ */ k(n))), Q = /* @__PURE__ */ b({
379
378
  "en-au": /* @__PURE__ */ l(),
380
379
  "en-gb": /* @__PURE__ */ l(),
381
380
  "en-us": /* @__PURE__ */ l(),
382
381
  "es-es": /* @__PURE__ */ l()
383
- }), M = /* @__PURE__ */ b({
382
+ }), j = /* @__PURE__ */ b({
384
383
  "en-au": /* @__PURE__ */ f(/* @__PURE__ */ l()),
385
384
  "en-gb": /* @__PURE__ */ f(/* @__PURE__ */ l()),
386
385
  "en-us": /* @__PURE__ */ f(/* @__PURE__ */ l()),
@@ -425,10 +424,10 @@ const te = /* @__PURE__ */ b({
425
424
  id: /* @__PURE__ */ l(),
426
425
  color: Y,
427
426
  label: /* @__PURE__ */ l()
428
- }), R = {
427
+ }), A = {
429
428
  id: /* @__PURE__ */ l(),
430
- label: M,
431
- description: M,
429
+ label: j,
430
+ description: j,
432
431
  firstCreatedAt: /* @__PURE__ */ f(/* @__PURE__ */ x()),
433
432
  icon: /* @__PURE__ */ m(/* @__PURE__ */ l()),
434
433
  iconDark: /* @__PURE__ */ m(/* @__PURE__ */ l()),
@@ -436,15 +435,15 @@ const te = /* @__PURE__ */ b({
436
435
  status: /* @__PURE__ */ m(te),
437
436
  statusId: Z
438
437
  }, he = /* @__PURE__ */ b({
439
- ...R,
438
+ ...A,
440
439
  typeId: ee
441
- }), N = {
442
- ...R,
440
+ }), I = {
441
+ ...A,
443
442
  version: /* @__PURE__ */ l()
444
- }, U = /* @__PURE__ */ b({
443
+ }, F = /* @__PURE__ */ b({
445
444
  id: /* @__PURE__ */ l(),
446
- label: M,
447
- description: M,
445
+ label: j,
446
+ description: j,
448
447
  icon: /* @__PURE__ */ m(/* @__PURE__ */ l()),
449
448
  iconDark: /* @__PURE__ */ m(/* @__PURE__ */ l()),
450
449
  order: /* @__PURE__ */ x(),
@@ -492,17 +491,17 @@ const te = /* @__PURE__ */ b({
492
491
  ]), ae = h(["bidirectional", "destination", "source", "unknown"]), le = /* @__PURE__ */ b({
493
492
  authMethodId: se,
494
493
  activeConnectionCount: /* @__PURE__ */ f(/* @__PURE__ */ x()),
495
- canDescribe: /* @__PURE__ */ f(/* @__PURE__ */ _()),
494
+ canDescribe: /* @__PURE__ */ f(/* @__PURE__ */ T()),
496
495
  id: /* @__PURE__ */ f(/* @__PURE__ */ l()),
497
496
  label: /* @__PURE__ */ f(Q),
498
497
  maxConnectionCount: /* @__PURE__ */ f(/* @__PURE__ */ x()),
499
- params: /* @__PURE__ */ f(/* @__PURE__ */ E(/* @__PURE__ */ A(/* @__PURE__ */ l(), /* @__PURE__ */ l())))
498
+ params: /* @__PURE__ */ f(/* @__PURE__ */ E(/* @__PURE__ */ R(/* @__PURE__ */ l(), /* @__PURE__ */ l())))
500
499
  }), Ee = /* @__PURE__ */ b({
501
- ...N,
500
+ ...I,
502
501
  typeId: /* @__PURE__ */ k("connector"),
503
502
  category: /* @__PURE__ */ m(/* @__PURE__ */ b({ id: /* @__PURE__ */ l(), label: /* @__PURE__ */ l() })),
504
503
  categoryId: oe,
505
- implementations: /* @__PURE__ */ A(/* @__PURE__ */ l(), le),
504
+ implementations: /* @__PURE__ */ R(/* @__PURE__ */ l(), le),
506
505
  operations: /* @__PURE__ */ E(ie),
507
506
  usageId: ae,
508
507
  vendorAccountURL: /* @__PURE__ */ m(/* @__PURE__ */ l()),
@@ -514,23 +513,23 @@ const te = /* @__PURE__ */ b({
514
513
  };
515
514
  D({ "en-gb": "Application" }), D({ "en-gb": "Curated Dataset" }), D({ "en-gb": "Database" }), D({ "en-gb": "File Store" });
516
515
  const ce = h(["list"]), ue = /* @__PURE__ */ b({
517
- ...R,
516
+ ...A,
518
517
  typeId: /* @__PURE__ */ k("contextModelGroup"),
519
- modelRefs: /* @__PURE__ */ E(U),
518
+ modelRefs: /* @__PURE__ */ E(F),
520
519
  order: /* @__PURE__ */ x()
521
520
  }), ke = /* @__PURE__ */ b({
522
- ...N,
521
+ ...I,
523
522
  typeId: /* @__PURE__ */ k("context"),
524
523
  models: /* @__PURE__ */ E(ue),
525
524
  operations: /* @__PURE__ */ E(ce)
526
525
  });
527
- class I extends Error {
526
+ class L extends Error {
528
527
  locator;
529
528
  constructor(n, e, r) {
530
529
  super(n, r), this.name = "DataPosError", this.locator = e;
531
530
  }
532
531
  }
533
- class C extends I {
532
+ class C extends L {
534
533
  constructor(n, e, r) {
535
534
  super(n, e, r), this.name = "ApplicationError";
536
535
  }
@@ -545,7 +544,7 @@ class Oe extends C {
545
544
  super(n, e, r), this.name = "EngineError";
546
545
  }
547
546
  }
548
- class z extends C {
547
+ class G extends C {
549
548
  body;
550
549
  constructor(n, e, r, s) {
551
550
  super(n, e, s), this.name = "FetchError", this.body = r;
@@ -563,24 +562,24 @@ class De extends C {
563
562
  super(n, e, r), this.name = "WindowHandledRuntimeError";
564
563
  }
565
564
  }
566
- class Me extends C {
565
+ class je extends C {
567
566
  constructor(n, e, r) {
568
567
  super(n, e, r), this.name = "WindowHandledPromiseRejectionError";
569
568
  }
570
569
  }
571
- class je extends I {
570
+ class Me extends L {
572
571
  constructor(n, e, r) {
573
572
  super(n, e, r), this.name = "OperationalError";
574
573
  }
575
574
  }
576
575
  async function we(t, n, e) {
577
576
  const r = ` - ${t.statusText}`, s = `${n} Response status '${t.status}${t.statusText ? r : ""}' received.`, o = await t.text();
578
- return new z(s, e, o);
577
+ return new G(s, e, o);
579
578
  }
580
- function Ae(t) {
579
+ function Re(t) {
581
580
  return t.map((n) => n.message).join(" ");
582
581
  }
583
- function Re(t) {
582
+ function Ae(t) {
584
583
  if (t instanceof Error) return t;
585
584
  if (typeof t == "string") return new Error(t);
586
585
  if (typeof t == "number" || typeof t == "boolean" || typeof t == "bigint") return new Error(String(t));
@@ -593,17 +592,17 @@ function Re(t) {
593
592
  }
594
593
  return new Error("Unknown error");
595
594
  }
596
- function Ne(t) {
595
+ function Ie(t) {
597
596
  const n = /* @__PURE__ */ new Set(), e = [];
598
597
  let r = t;
599
598
  for (; r && !n.has(r); ) {
600
599
  n.add(r);
601
600
  let s;
602
- if (r instanceof z)
601
+ if (r instanceof G)
603
602
  s = { body: r.body, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
604
603
  else if (r instanceof pe)
605
604
  s = { componentName: r.componentName, info: r.info, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
606
- else if (r instanceof I)
605
+ else if (r instanceof L)
607
606
  s = { locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
608
607
  else if (r instanceof Error) {
609
608
  const o = r;
@@ -614,13 +613,13 @@ function Ne(t) {
614
613
  }
615
614
  return e;
616
615
  }
617
- const de = h(["list", "render", "setColorMode"]), Ie = /* @__PURE__ */ b({
618
- ...N,
616
+ const de = h(["list", "render", "setColorMode"]), Le = /* @__PURE__ */ b({
617
+ ...I,
619
618
  typeId: /* @__PURE__ */ k("presenter"),
620
- presentations: /* @__PURE__ */ E(U),
619
+ presentations: /* @__PURE__ */ E(F),
621
620
  operations: /* @__PURE__ */ E(de)
622
621
  });
623
- function Le() {
622
+ function Ne() {
624
623
  return { render: fe };
625
624
  }
626
625
  function fe(t, n, e) {
@@ -632,7 +631,7 @@ function Pe() {
632
631
  function be(t, n) {
633
632
  console.log(1111, t), console.log(2222, n), console.log(3333, n.childNodes), console.log(4444, n.children);
634
633
  }
635
- const c = (t) => new Map(Object.entries(t)), L = (t, n, e = O) => {
634
+ const c = (t) => new Map(Object.entries(t)), N = (t, n, e = O) => {
636
635
  const r = t.get(n);
637
636
  if (r !== void 0) return r;
638
637
  if (e !== n)
@@ -645,10 +644,10 @@ const c = (t) => new Map(Object.entries(t)), L = (t, n, e = O) => {
645
644
  { id: "xls", labels: c({ "en-gb": "XLS" }) },
646
645
  { id: "xlsx", labels: c({ "en-gb": "XLSX" }) },
647
646
  { id: "xml", labels: c({ "en-gb": "XML" }) }
648
- ], Te = (t = O) => {
647
+ ], _e = (t = O) => {
649
648
  const n = [];
650
649
  for (const e of me) {
651
- const r = L(e.labels, t);
650
+ const r = N(e.labels, t);
652
651
  n.push({ id: e.id, label: r ?? e.id });
653
652
  }
654
653
  return n;
@@ -658,10 +657,10 @@ const c = (t) => new Map(Object.entries(t)), L = (t, n, e = O) => {
658
657
  { id: "\r", labels: c({ "en-gb": "Carriage Return" }) },
659
658
  { id: `\r
660
659
  `, labels: c({ "en-gb": "Carriage Return/Newline" }) }
661
- ], _e = (t = O) => {
660
+ ], Te = (t = O) => {
662
661
  const n = [];
663
662
  for (const e of ye) {
664
- const r = L(e.labels, t);
663
+ const r = N(e.labels, t);
665
664
  n.push({ id: e.id, label: r ?? e.id });
666
665
  }
667
666
  return n;
@@ -677,10 +676,10 @@ const c = (t) => new Map(Object.entries(t)), L = (t, n, e = O) => {
677
676
  { id: "_", labels: c({ "en-gb": "Underscore" }) },
678
677
  { id: "0x1F", labels: c({ "en-gb": "Unit Separator" }) },
679
678
  { id: "|", labels: c({ "en-gb": "Vertical Bar" }) }
680
- ], Fe = (t = O) => {
679
+ ], Ue = (t = O) => {
681
680
  const n = [];
682
681
  for (const e of ge) {
683
- const r = L(e.labels, t);
682
+ const r = N(e.labels, t);
684
683
  n.push({ id: e.id, label: r ?? e.id });
685
684
  }
686
685
  return n;
@@ -692,32 +691,23 @@ export {
692
691
  xe as CONNECTOR_SOURCE_OPERATIONS,
693
692
  O as DEFAULT_LOCALE_CODE,
694
693
  Oe as EngineError,
695
- z as FetchError,
696
- je as OperationalError,
694
+ G as FetchError,
695
+ Me as OperationalError,
697
696
  pe as VueError,
698
- Me as WindowPromiseRejectionError,
697
+ je as WindowPromiseRejectionError,
699
698
  De as WindowRuntimeError,
700
699
  we as buildFetchError,
701
700
  he as componentConfigSchema,
702
- Ae as concatenateSerialisedErrorMessages,
701
+ Re as concatenateSerialisedErrorMessages,
703
702
  Ee as connectorConfigSchema,
704
703
  ke as contextConfigSchema,
705
- Ge as convertODataTypeIdToUsageTypeId,
706
- Ve as extractExtensionFromPath,
707
- He as extractNameFromPath,
708
- We as formatNumberAsDecimalNumber,
709
- $e as formatNumberAsDuration,
710
- Xe as formatNumberAsSize,
711
- Be as formatNumberAsStorageSize,
712
- Je as formatNumberAsWholeNumber,
713
704
  ve as getComponentStatus,
714
- Te as getDataFormats,
715
- _e as getRecordDelimiters,
716
- Fe as getValueDelimiters,
717
- Ke as lookupMimeTypeForExtension,
718
- Re as normalizeToError,
719
- Ie as presenterConfigSchema,
720
- Ne as serialiseError,
721
- Le as useCytoscapeJS,
705
+ _e as getDataFormats,
706
+ Te as getRecordDelimiters,
707
+ Ue as getValueDelimiters,
708
+ Ae as normalizeToError,
709
+ Le as presenterConfigSchema,
710
+ Ie as serialiseError,
711
+ Ne as useCytoscapeJS,
722
712
  Pe as useDataTable
723
713
  };
@@ -64,9 +64,5 @@ export { useDataTable } from './composables/useDataTable';
64
64
  /** Constants */
65
65
  export declare const DEFAULT_LOCALE_CODE: LocaleCode;
66
66
  /** Utilities */
67
- export { convertODataTypeIdToUsageTypeId } from './utilities';
68
- export { extractExtensionFromPath, extractNameFromPath } from './utilities';
69
- export { formatNumberAsDecimalNumber, formatNumberAsDuration, formatNumberAsSize, formatNumberAsStorageSize, formatNumberAsWholeNumber } from './utilities';
70
67
  export { getDataFormats, getRecordDelimiters, getValueDelimiters } from './component/dataView';
71
68
  export { getComponentStatus } from './component';
72
- export { lookupMimeTypeForExtension } from './utilities';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datapos/datapos-shared",
3
- "version": "0.3.337",
3
+ "version": "0.3.338",
4
4
  "description": "A library containing common constants, types and utilities used across all Data Positioning projects.",
5
5
  "license": "MIT",
6
6
  "author": "Jonathan Terrell <terrell.jm@gmail.com>",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "./utilities": {
25
25
  "import": "./dist/utilities.js",
26
- "types": "./dist/types/utilities.d.ts"
26
+ "types": "./dist/types/src/utilities.d.ts"
27
27
  }
28
28
  },
29
29
  "sideEffects": false,