@datapos/datapos-shared 0.3.392 → 0.3.393

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,4 +1,4 @@
1
- import { a, g as e } from "./index-Duq-Z9YV.js";
1
+ import { a, g as e } from "./index-shYsk_2c.js";
2
2
  export {
3
3
  a as componentConfigSchema,
4
4
  e as getComponentStatus
@@ -1,4 +1,4 @@
1
- import { c as r } from "./index-Duq-Z9YV.js";
1
+ import { c as r } from "./index-shYsk_2c.js";
2
2
  const e = (a) => {
3
3
  const t = Object.entries(a).filter((n) => typeof n[1] == "string");
4
4
  return new Map(t);
@@ -1,4 +1,4 @@
1
- import { D as s, a as t, c as o, b as c, e as n, f as m, h as r, p as i, u as g, d as C } from "./index-Duq-Z9YV.js";
1
+ import { D as s, a as t, c as o, b as c, e as n, f as m, h as r, p as i, u as g, d as C } from "./index-shYsk_2c.js";
2
2
  export {
3
3
  s as DEFAULT_LOCALE_CODE,
4
4
  t as componentConfigSchema,
@@ -1,6 +1,6 @@
1
1
  let M;
2
2
  // @__NO_SIDE_EFFECTS__
3
- function F(n) {
3
+ function G(n) {
4
4
  return {
5
5
  lang: n?.lang ?? M?.lang,
6
6
  message: n?.message,
@@ -8,28 +8,28 @@ function F(n) {
8
8
  abortPipeEarly: n?.abortPipeEarly ?? M?.abortPipeEarly
9
9
  };
10
10
  }
11
- let G;
11
+ let N;
12
12
  // @__NO_SIDE_EFFECTS__
13
- function N(n) {
14
- return G?.get(n);
13
+ function T(n) {
14
+ return N?.get(n);
15
15
  }
16
- let T;
16
+ let z;
17
17
  // @__NO_SIDE_EFFECTS__
18
- function z(n) {
19
- return T?.get(n);
18
+ function V(n) {
19
+ return z?.get(n);
20
20
  }
21
- let V;
21
+ let X;
22
22
  // @__NO_SIDE_EFFECTS__
23
- function X(n, t) {
24
- return V?.get(n)?.get(t);
23
+ function K(n, t) {
24
+ return X?.get(n)?.get(t);
25
25
  }
26
26
  // @__NO_SIDE_EFFECTS__
27
- function _(n) {
27
+ function w(n) {
28
28
  const t = typeof n;
29
29
  return t === "string" ? `"${n}"` : t === "number" || t === "bigint" || t === "boolean" ? `${n}` : t === "object" || t === "function" ? (n && Object.getPrototypeOf(n)?.constructor?.name) ?? "null" : t;
30
30
  }
31
31
  function g(n, t, e, r, o) {
32
- const s = o && "input" in o ? o.input : e.value, i = o?.expected ?? n.expects ?? null, c = o?.received ?? /* @__PURE__ */ _(s), l = {
32
+ const s = o && "input" in o ? o.input : e.value, i = o?.expected ?? n.expects ?? null, c = o?.received ?? /* @__PURE__ */ w(s), l = {
33
33
  kind: n.kind,
34
34
  type: n.type,
35
35
  input: s,
@@ -42,7 +42,7 @@ function g(n, t, e, r, o) {
42
42
  lang: r.lang,
43
43
  abortEarly: r.abortEarly,
44
44
  abortPipeEarly: r.abortPipeEarly
45
- }, p = n.kind === "schema", d = o?.message ?? n.message ?? /* @__PURE__ */ X(n.reference, l.lang) ?? (p ? /* @__PURE__ */ z(l.lang) : null) ?? r.message ?? /* @__PURE__ */ N(l.lang);
45
+ }, p = n.kind === "schema", d = o?.message ?? n.message ?? /* @__PURE__ */ K(n.reference, l.lang) ?? (p ? /* @__PURE__ */ V(l.lang) : null) ?? r.message ?? /* @__PURE__ */ T(l.lang);
46
46
  d !== void 0 && (l.message = typeof d == "function" ? d(l) : d), p && (e.typed = !1), e.issues ? e.issues.push(l) : e.issues = [l];
47
47
  }
48
48
  // @__NO_SIDE_EFFECTS__
@@ -51,21 +51,21 @@ function h(n) {
51
51
  version: 1,
52
52
  vendor: "valibot",
53
53
  validate(t) {
54
- return n["~run"]({ value: t }, /* @__PURE__ */ F());
54
+ return n["~run"]({ value: t }, /* @__PURE__ */ G());
55
55
  }
56
56
  };
57
57
  }
58
58
  // @__NO_SIDE_EFFECTS__
59
- function K(n, t) {
59
+ function q(n, t) {
60
60
  return Object.hasOwn(n, t) && t !== "__proto__" && t !== "prototype" && t !== "constructor";
61
61
  }
62
62
  // @__NO_SIDE_EFFECTS__
63
- function q(n, t) {
63
+ function H(n, t) {
64
64
  const e = [...new Set(n)];
65
65
  return e.length > 1 ? `(${e.join(` ${t} `)})` : e[0] ?? "never";
66
66
  }
67
67
  // @__NO_SIDE_EFFECTS__
68
- function H(n, t, e) {
68
+ function J(n, t, e) {
69
69
  return typeof n.fallback == "function" ? n.fallback(t, e) : n.fallback;
70
70
  }
71
71
  // @__NO_SIDE_EFFECTS__
@@ -114,11 +114,11 @@ function S(n, t) {
114
114
  };
115
115
  }
116
116
  // @__NO_SIDE_EFFECTS__
117
- function w(n) {
117
+ function P(n) {
118
118
  return {
119
119
  kind: "schema",
120
120
  type: "boolean",
121
- reference: w,
121
+ reference: P,
122
122
  expects: "boolean",
123
123
  async: !1,
124
124
  message: n,
@@ -136,7 +136,7 @@ function k(n, t) {
136
136
  kind: "schema",
137
137
  type: "literal",
138
138
  reference: k,
139
- expects: /* @__PURE__ */ _(n),
139
+ expects: /* @__PURE__ */ w(n),
140
140
  async: !1,
141
141
  literal: n,
142
142
  message: t,
@@ -220,7 +220,7 @@ function f(n, t) {
220
220
  }
221
221
  }
222
222
  l.typed || (e.typed = !1), e.value[s] = l.value;
223
- } else if (i.fallback !== void 0) e.value[s] = /* @__PURE__ */ H(i);
223
+ } else if (i.fallback !== void 0) e.value[s] = /* @__PURE__ */ J(i);
224
224
  else if (i.type !== "exact_optional" && i.type !== "optional" && i.type !== "nullish" && (g(this, "key", e, r, {
225
225
  input: void 0,
226
226
  expected: `"${s}"`,
@@ -275,7 +275,7 @@ function I(n, t, e) {
275
275
  const s = r.value;
276
276
  if (s && typeof s == "object") {
277
277
  r.typed = !0, r.value = {};
278
- for (const i in s) if (/* @__PURE__ */ K(s, i)) {
278
+ for (const i in s) if (/* @__PURE__ */ q(s, i)) {
279
279
  const c = s[i], l = this.key["~run"]({ value: i }, o);
280
280
  if (l.issues) {
281
281
  const d = {
@@ -339,12 +339,12 @@ function R(n) {
339
339
  return t;
340
340
  }
341
341
  // @__NO_SIDE_EFFECTS__
342
- function P(n, t) {
342
+ function U(n, t) {
343
343
  return {
344
344
  kind: "schema",
345
345
  type: "union",
346
- reference: P,
347
- expects: /* @__PURE__ */ q(n.map((e) => e.expects), "|"),
346
+ reference: U,
347
+ expects: /* @__PURE__ */ H(n.map((e) => e.expects), "|"),
348
348
  async: !1,
349
349
  options: n,
350
350
  message: t,
@@ -374,7 +374,7 @@ function P(n, t) {
374
374
  }
375
375
  };
376
376
  }
377
- const m = (n) => /* @__PURE__ */ P(n.map((t) => /* @__PURE__ */ k(t))), J = /* @__PURE__ */ f({
377
+ const m = (n) => /* @__PURE__ */ U(n.map((t) => /* @__PURE__ */ k(t))), B = /* @__PURE__ */ f({
378
378
  "en-au": /* @__PURE__ */ a(),
379
379
  "en-gb": /* @__PURE__ */ a(),
380
380
  "en-us": /* @__PURE__ */ a(),
@@ -384,7 +384,7 @@ const m = (n) => /* @__PURE__ */ P(n.map((t) => /* @__PURE__ */ k(t))), J = /* @
384
384
  "en-gb": /* @__PURE__ */ b(/* @__PURE__ */ a()),
385
385
  "en-us": /* @__PURE__ */ b(/* @__PURE__ */ a()),
386
386
  "es-es": /* @__PURE__ */ b(/* @__PURE__ */ a())
387
- }), B = m(["amber", "green", "red", "other"]), Q = m([
387
+ }), Q = m(["amber", "green", "red", "other"]), W = m([
388
388
  "alpha",
389
389
  "beta",
390
390
  "generalAvailability",
@@ -394,7 +394,7 @@ const m = (n) => /* @__PURE__ */ P(n.map((t) => /* @__PURE__ */ k(t))), J = /* @
394
394
  "releaseCandidate",
395
395
  "unavailable",
396
396
  "underReview"
397
- ]), W = m([
397
+ ]), Y = m([
398
398
  "app",
399
399
  "connector",
400
400
  "connectorConnection",
@@ -418,9 +418,9 @@ const m = (n) => /* @__PURE__ */ P(n.map((t) => /* @__PURE__ */ k(t))), J = /* @
418
418
  "presenter",
419
419
  "presenterPresentation",
420
420
  "tool"
421
- ]), Y = /* @__PURE__ */ f({
421
+ ]), Z = /* @__PURE__ */ f({
422
422
  id: /* @__PURE__ */ a(),
423
- color: B,
423
+ color: Q,
424
424
  label: /* @__PURE__ */ a()
425
425
  }), L = {
426
426
  id: /* @__PURE__ */ a(),
@@ -430,12 +430,12 @@ const m = (n) => /* @__PURE__ */ P(n.map((t) => /* @__PURE__ */ k(t))), J = /* @
430
430
  icon: /* @__PURE__ */ y(/* @__PURE__ */ a()),
431
431
  iconDark: /* @__PURE__ */ y(/* @__PURE__ */ a()),
432
432
  lastUpdatedAt: /* @__PURE__ */ y(/* @__PURE__ */ C()),
433
- status: /* @__PURE__ */ y(Y),
434
- statusId: Q
433
+ status: /* @__PURE__ */ y(Z),
434
+ statusId: W
435
435
  }, be = /* @__PURE__ */ f({
436
436
  ...L,
437
- typeId: W
438
- }), U = /* @__PURE__ */ f({
437
+ typeId: Y
438
+ }), F = /* @__PURE__ */ f({
439
439
  id: /* @__PURE__ */ a(),
440
440
  label: D,
441
441
  description: D,
@@ -443,15 +443,7 @@ const m = (n) => /* @__PURE__ */ P(n.map((t) => /* @__PURE__ */ k(t))), J = /* @
443
443
  iconDark: /* @__PURE__ */ y(/* @__PURE__ */ a()),
444
444
  order: /* @__PURE__ */ C(),
445
445
  path: /* @__PURE__ */ a()
446
- }), v = (n) => {
447
- const t = Object.entries(n).filter((e) => typeof e[1] == "string");
448
- return new Map(t);
449
- }, Z = (n, t, e = E) => {
450
- const r = n.get(t);
451
- if (r !== void 0) return r;
452
- if (e !== t)
453
- return n.get(e);
454
- }, $ = [
446
+ }), _ = [
455
447
  { id: "alpha", color: "red", labels: v({ "en-gb": "alpha" }) },
456
448
  { id: "beta", color: "amber", labels: v({ "en-gb": "beta" }) },
457
449
  { id: "generalAvailability", color: "green", labels: v({ "en-gb": "" }) },
@@ -461,14 +453,26 @@ const m = (n) => /* @__PURE__ */ P(n.map((t) => /* @__PURE__ */ k(t))), J = /* @
461
453
  { id: "releaseCandidate", color: "green", labels: v({ "en-gb": "release-candidate" }) },
462
454
  { id: "unavailable", color: "other", labels: v({ "en-gb": "unavailable" }) },
463
455
  { id: "underReview", color: "other", labels: v({ "en-gb": "under-review" }) }
464
- ], fe = (n, t = E) => {
465
- const e = $.find((r) => r.id === n);
456
+ ];
457
+ function v(n) {
458
+ const t = Object.entries(n).filter((e) => typeof e[1] == "string");
459
+ return new Map(t);
460
+ }
461
+ function fe(n, t = E) {
462
+ console.log(1111, _);
463
+ const e = _.find((r) => r.id === n);
466
464
  if (e) {
467
- const r = Z(e.labels, t);
465
+ const r = $(e.labels, t);
468
466
  return { id: e.id, color: e.color, label: r ?? e.id };
469
467
  }
470
468
  return { id: n, color: "other", label: n };
471
- };
469
+ }
470
+ function $(n, t, e = E) {
471
+ const r = n.get(t);
472
+ if (r != null) return r;
473
+ if (e !== t)
474
+ return n.get(e);
475
+ }
472
476
  m(["app", "engine", "connector", "context", "presenter", "tool"]);
473
477
  const O = {
474
478
  ...L,
@@ -476,9 +480,9 @@ const O = {
476
480
  }, ee = m(["apiKey", "disabled", "oAuth2", "none"]), ne = /* @__PURE__ */ f({
477
481
  authMethodId: ee,
478
482
  activeConnectionCount: /* @__PURE__ */ b(/* @__PURE__ */ C()),
479
- canDescribe: /* @__PURE__ */ b(/* @__PURE__ */ w()),
483
+ canDescribe: /* @__PURE__ */ b(/* @__PURE__ */ P()),
480
484
  id: /* @__PURE__ */ b(/* @__PURE__ */ a()),
481
- label: /* @__PURE__ */ b(J),
485
+ label: /* @__PURE__ */ b(B),
482
486
  maxConnectionCount: /* @__PURE__ */ b(/* @__PURE__ */ C()),
483
487
  params: /* @__PURE__ */ b(/* @__PURE__ */ S(/* @__PURE__ */ I(/* @__PURE__ */ a(), /* @__PURE__ */ a())))
484
488
  }), te = m(["application", "curatedDataset", "database", "fileStore"]), re = m([
@@ -510,7 +514,7 @@ const O = {
510
514
  }), oe = m(["list"]), ie = /* @__PURE__ */ f({
511
515
  ...L,
512
516
  typeId: /* @__PURE__ */ k("contextModelGroup"),
513
- modelRefs: /* @__PURE__ */ S(U),
517
+ modelRefs: /* @__PURE__ */ S(F),
514
518
  order: /* @__PURE__ */ C()
515
519
  }), ge = /* @__PURE__ */ f({
516
520
  ...O,
@@ -520,7 +524,7 @@ const O = {
520
524
  }), le = m(["list", "render", "setColorMode"]), he = /* @__PURE__ */ f({
521
525
  ...O,
522
526
  typeId: /* @__PURE__ */ k("presenter"),
523
- presentations: /* @__PURE__ */ S(U),
527
+ presentations: /* @__PURE__ */ S(F),
524
528
  operations: /* @__PURE__ */ S(le)
525
529
  });
526
530
  function me() {
@@ -5,11 +5,13 @@ import { LocaleCode, LocalisedString } from '../index';
5
5
  interface Component {
6
6
  readonly config: ComponentConfig;
7
7
  }
8
+ /** Component configuration. */
8
9
  type ComponentConfig = InferOutput<typeof componentConfigSchema>;
9
10
  type ComponentStatus = InferOutput<typeof componentStatusSchema>;
10
11
  type ComponentStatusColorId = InferOutput<typeof componentStatusColorIdSchema>;
11
12
  type ComponentStatusId = InferOutput<typeof componentStatusIdSchema>;
12
13
  type ComponentTypeId = InferOutput<typeof componentTypeIdSchema>;
14
+ /** Component reference. */
13
15
  interface ComponentReference {
14
16
  id: string;
15
17
  label: Partial<LocalisedString>;
@@ -19,7 +21,7 @@ interface ComponentReference {
19
21
  order: number;
20
22
  path: string;
21
23
  }
22
- declare const getComponentStatus: (id: string, localeId?: LocaleCode) => ComponentStatus;
24
+ declare function getComponentStatus(id: string, localeId?: LocaleCode): ComponentStatus;
23
25
  /** Exports */
24
26
  export { getComponentStatus };
25
27
  export { componentConfigSchema } from './componentConfig.schema';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datapos/datapos-shared",
3
- "version": "0.3.392",
3
+ "version": "0.3.393",
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>",