@milaboratories/pl-model-common 1.13.5 → 1.13.6

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.
package/dist/index.mjs CHANGED
@@ -10,17 +10,17 @@ function w(n) {
10
10
  throw new Error("Unexpected object: " + n);
11
11
  }
12
12
  const S = "upload://upload/", E = "index://index/";
13
- function L(n) {
13
+ function I(n) {
14
14
  return n.startsWith(S);
15
15
  }
16
- function V(n) {
16
+ function L(n) {
17
17
  return n.startsWith(E);
18
18
  }
19
- function I(n) {
20
- if (V(n)) {
19
+ function V(n) {
20
+ if (L(n)) {
21
21
  const t = n.slice(E.length);
22
22
  return JSON.parse(decodeURIComponent(t)).path;
23
- } else if (L(n)) {
23
+ } else if (I(n)) {
24
24
  const t = n.slice(S.length);
25
25
  return JSON.parse(decodeURIComponent(t)).localPath;
26
26
  }
@@ -30,7 +30,7 @@ function B(n) {
30
30
  return n.replace(/^.*[\\/]/, "");
31
31
  }
32
32
  function dn(n) {
33
- return B(I(n));
33
+ return B(V(n));
34
34
  }
35
35
  function pn(n) {
36
36
  if (!n || typeof n != "object")
@@ -317,14 +317,20 @@ function Nn(n, t, e = {}) {
317
317
  throw Error(`unsupported data type: ${o}`);
318
318
  }
319
319
  }
320
+ function Sn(n) {
321
+ return {
322
+ columnId: n.id,
323
+ spec: n.spec
324
+ };
325
+ }
320
326
  function p(n) {
321
327
  const { type: t, name: e, domain: r } = n;
322
328
  return { type: t, name: e, ...r && { domain: r } };
323
329
  }
324
- function Sn(n) {
330
+ function En(n) {
325
331
  return n.map(p);
326
332
  }
327
- function En(n) {
333
+ function Cn(n) {
328
334
  return b(p(n));
329
335
  }
330
336
  function X(n, t) {
@@ -337,7 +343,7 @@ function X(n, t) {
337
343
  function z(n, t) {
338
344
  return n.name === t.name && X(n.domain, t.domain);
339
345
  }
340
- function Cn(n, t) {
346
+ function Jn(n, t) {
341
347
  return { ...n, src: l(n.src, t) };
342
348
  }
343
349
  function l(n, t) {
@@ -373,7 +379,7 @@ function l(n, t) {
373
379
  function G(n) {
374
380
  return b(n);
375
381
  }
376
- function Jn(n) {
382
+ function On(n) {
377
383
  return JSON.parse(n);
378
384
  }
379
385
  function A(n) {
@@ -382,7 +388,7 @@ function A(n) {
382
388
  function x(n, t) {
383
389
  return JSON.stringify([n, t]);
384
390
  }
385
- class On {
391
+ class $n {
386
392
  /**
387
393
  * Creates a new anchor context from a set of anchor column specifications
388
394
  * @param anchors Record of anchor column specifications indexed by anchor ID
@@ -483,7 +489,7 @@ class On {
483
489
  return G(this.derive(t, e));
484
490
  }
485
491
  }
486
- function $n(n, t, e) {
492
+ function Dn(n, t, e) {
487
493
  const r = { ...t }, o = (e == null ? void 0 : e.ignoreMissingDomains) ?? !1;
488
494
  if (r.domainAnchor !== void 0) {
489
495
  const s = n[r.domainAnchor];
@@ -542,7 +548,7 @@ function Q(n, t) {
542
548
  function Y(n) {
543
549
  return typeof n == "object" && "anchor" in n;
544
550
  }
545
- function Dn(n) {
551
+ function In(n) {
546
552
  return typeof n == "object" && n !== null && "source" in n && "axisFilters" in n;
547
553
  }
548
554
  function f(n) {
@@ -557,17 +563,17 @@ function Ln(n) {
557
563
  function Vn(n) {
558
564
  return f(n.obj.spec);
559
565
  }
560
- function In(n) {
566
+ function Bn(n) {
561
567
  if (!Z(n)) throw new Error(`not a PColumn (kind = ${n.spec.kind})`);
562
568
  return n;
563
569
  }
564
- function Bn(n, t) {
570
+ function jn(n, t) {
565
571
  return n === void 0 ? void 0 : {
566
572
  ...n,
567
573
  data: t(n.data)
568
574
  };
569
575
  }
570
- function jn(n) {
576
+ function Fn(n) {
571
577
  const t = /* @__PURE__ */ new Map(), e = (r) => {
572
578
  switch (r.type) {
573
579
  case "column":
@@ -689,23 +695,23 @@ function N(n, t) {
689
695
  }
690
696
  return !0;
691
697
  }
692
- function Fn(n) {
698
+ function Un(n) {
693
699
  return Array.isArray(n) ? (t) => n.some((e) => f(t) && N(t, e)) : (t) => f(t) && N(t, n);
694
700
  }
695
- const Un = { href: "/" }, Kn = y.object({
701
+ const Kn = { href: "/" }, Rn = y.object({
696
702
  __isRef: y.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),
697
703
  blockId: y.string().describe("Upstream block id"),
698
704
  name: y.string().describe("Name of the output provided to the upstream block's output context")
699
705
  }).describe(
700
706
  "Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees."
701
707
  ).strict().readonly();
702
- function Rn(n) {
708
+ function Mn(n) {
703
709
  return typeof n == "object" && n !== null && "__isRef" in n && n.__isRef === !0 && "blockId" in n && "name" in n;
704
710
  }
705
- function Mn(n, t) {
711
+ function _n(n, t) {
706
712
  return n.blockId === t.blockId && n.name === t.name;
707
713
  }
708
- function _n(n, t) {
714
+ function Hn(n, t) {
709
715
  return n.ok ? { ok: !0, value: t(n.value) } : n;
710
716
  }
711
717
  function nn(n) {
@@ -745,7 +751,7 @@ function C(n, t, e) {
745
751
  return c;
746
752
  }
747
753
  const J = 15, on = 24, O = y.string().length(on).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
748
- function Hn() {
754
+ function Tn() {
749
755
  const n = new Uint8Array(J);
750
756
  return crypto.getRandomValues(n), O.parse(C(n, "RFC4648"));
751
757
  }
@@ -753,13 +759,13 @@ function sn(n) {
753
759
  if (n.length !== J) throw new Error(`Wrong number of bytes: ${n.length}`);
754
760
  return O.parse(C(n, "RFC4648"));
755
761
  }
756
- async function Tn(n) {
762
+ async function vn(n) {
757
763
  const t = new TextEncoder(), e = await crypto.subtle.digest("SHA-256", t.encode(n));
758
764
  return sn(new Uint8Array(e.slice(0, 15)));
759
765
  }
760
766
  export {
761
- On as AnchoredIdDeriver,
762
- Un as DefaultNavigationState,
767
+ $n as AnchoredIdDeriver,
768
+ Kn as DefaultNavigationState,
763
769
  v as PTableAbsent,
764
770
  W as PTableNA,
765
771
  K as PValueBytesNA,
@@ -771,24 +777,25 @@ export {
771
777
  O as PlId,
772
778
  J as PlIdBytes,
773
779
  on as PlIdLength,
774
- Kn as PlRef,
775
- En as canonicalizeAxisId,
780
+ Rn as PlRef,
781
+ Cn as canonicalizeAxisId,
776
782
  ln as dataInfoToEntries,
777
- Tn as digestPlId,
783
+ vn as digestPlId,
778
784
  Pn as ensureNotNAPValue,
779
- In as ensurePColumn,
785
+ Bn as ensurePColumn,
780
786
  hn as entriesToDataInfo,
781
787
  g as executePSpecPredicate,
782
- jn as extractAllColumns,
783
- Sn as getAxesId,
788
+ Fn as extractAllColumns,
789
+ En as getAxesId,
784
790
  p as getAxisId,
791
+ Sn as getColumnIdAndSpec,
785
792
  dn as getFileNameFromHandle,
786
- I as getFilePathFromHandle,
793
+ V as getFilePathFromHandle,
787
794
  pn as isDataInfo,
788
795
  j as isDataInfoEntries,
789
- Dn as isFilteredPColumn,
790
- V as isImportFileHandleIndex,
791
- L as isImportFileHandleUpload,
796
+ In as isFilteredPColumn,
797
+ L as isImportFileHandleIndex,
798
+ I as isImportFileHandleUpload,
792
799
  fn as isLiveLog,
793
800
  R as isNotNAPValue,
794
801
  Z as isPColumn,
@@ -798,29 +805,29 @@ export {
798
805
  kn as isPTableAbsent,
799
806
  M as isPValue,
800
807
  yn as isPartitionedDataInfoEntries,
801
- Rn as isPlRef,
808
+ Mn as isPlRef,
802
809
  T as isValueAbsent,
803
810
  h as isValueNA,
804
811
  mn as mapDataInfo,
805
812
  gn as mapDataInfoEntries,
806
813
  l as mapJoinEntry,
807
- Bn as mapPObjectData,
808
- Cn as mapPTableDef,
809
- _n as mapValueInVOE,
814
+ jn as mapPObjectData,
815
+ Jn as mapPTableDef,
816
+ Hn as mapValueInVOE,
810
817
  k as matchAxis,
811
818
  z as matchAxisId,
812
819
  N as matchPColumn,
813
820
  Nn as pTableValue,
814
821
  xn as pValueToStringOrNumber,
815
822
  H as pValueToStringOrNumberOrNull,
816
- Jn as parseColumnId,
823
+ On as parseColumnId,
817
824
  sn as plId,
818
- Mn as plRefsEqual,
819
- $n as resolveAnchors,
825
+ _n as plRefsEqual,
826
+ Dn as resolveAnchors,
820
827
  _ as safeConvertToPValue,
821
- Fn as selectorsToPredicate,
828
+ Un as selectorsToPredicate,
822
829
  G as stringifyColumnId,
823
830
  An as toJsonSafePValue,
824
- Hn as uniquePlId
831
+ Tn as uniquePlId
825
832
  };
826
833
  //# sourceMappingURL=index.mjs.map