@platforma-sdk/model 1.28.1 → 1.28.4

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
@@ -514,11 +514,11 @@ const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
514
514
  }), st = K.array(it), ot = 1e-3, at = "__LABEL__", ve = "__LABEL__@1";
515
515
  function Ee(t, e, n = {}) {
516
516
  const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = t.map((p) => {
517
- var q, D;
517
+ var q, F;
518
518
  const c = e(p);
519
519
  let h, A, y;
520
520
  "spec" in c && typeof c.spec == "object" ? (h = c.spec, A = c.prefixTrace, y = c.suffixTrace) : h = c;
521
- const v = (q = h.annotations) == null ? void 0 : q[nt], g = (D = h.annotations) == null ? void 0 : D[rt], P = (g ? st.safeParse(JSON.parse(g)).data : void 0) ?? [], b = [
521
+ const v = (q = h.annotations) == null ? void 0 : q[nt], g = (F = h.annotations) == null ? void 0 : F[rt], P = (g ? st.safeParse(JSON.parse(g)).data : void 0) ?? [], b = [
522
522
  ...A ?? [],
523
523
  ...P,
524
524
  ...y ?? []
@@ -527,7 +527,7 @@ function Ee(t, e, n = {}) {
527
527
  const I = { label: v, type: at, importance: -2 };
528
528
  n.addLabelAsSuffix ? b.push(I) : b.splice(0, 0, I);
529
529
  }
530
- const F = [], $ = /* @__PURE__ */ new Map();
530
+ const k = [], $ = /* @__PURE__ */ new Map();
531
531
  for (let I = b.length - 1; I >= 0; --I) {
532
532
  const { type: R } = b[I], se = b[I].importance ?? 0, J = ($.get(R) ?? 0) + 1;
533
533
  $.set(R, J);
@@ -538,13 +538,13 @@ function Ee(t, e, n = {}) {
538
538
  r.get(w) ?? Number.NEGATIVE_INFINITY,
539
539
  se - (b.length - I) * ot
540
540
  )
541
- ), F.push({ ...b[I], fullType: w, occurenceIndex: J });
541
+ ), k.push({ ...b[I], fullType: w, occurenceIndex: J });
542
542
  }
543
- return F.reverse(), {
543
+ return k.reverse(), {
544
544
  value: p,
545
545
  spec: h,
546
546
  label: v,
547
- fullTrace: F
547
+ fullTrace: k
548
548
  };
549
549
  }), o = [], a = [], l = [...r];
550
550
  l.sort(([, p], [, c]) => c - p);
@@ -577,17 +577,15 @@ function Ee(t, e, n = {}) {
577
577
  for (let h = 0; h < S; ++h) p.add(o[h]);
578
578
  p.add(o[d]);
579
579
  const c = u(p);
580
- if (c !== void 0) {
581
- if (new Set(c.map((h) => h.label)).size === t.length) return c;
582
- d++, d == o.length && (S++, d = S);
583
- }
580
+ if (c !== void 0 && new Set(c.map((h) => h.label)).size === t.length) return c;
581
+ d++, d >= o.length && (S++, d = S);
584
582
  }
585
583
  const f = u(/* @__PURE__ */ new Set([...o, ...a]));
586
584
  if (f === void 0) throw new Error("Assertion error.");
587
585
  return f;
588
586
  }
589
587
  const H = "PColumnData/", te = H + "ResourceMap", ne = H + "Partitioned/ResourceMap", U = H + "JsonPartitioned", V = H + "BinaryPartitioned", Fe = H + "Partitioned/", re = Fe + "JsonPartitioned", B = Fe + "BinaryPartitioned";
590
- function De(t, e, n, r = [], i) {
588
+ function ke(t, e, n, r = [], i) {
591
589
  if (t === void 0) return !1;
592
590
  switch (t.resourceType.name) {
593
591
  case te: {
@@ -604,7 +602,7 @@ function De(t, e, n, r = [], i) {
604
602
  const a = t.resolve({ field: o, assertFieldType: "Input" });
605
603
  if (a === void 0) s = !1;
606
604
  else {
607
- const l = [...r, ...JSON.parse(o)], u = De(
605
+ const l = [...r, ...JSON.parse(o)], u = ke(
608
606
  a,
609
607
  e,
610
608
  n,
@@ -622,7 +620,7 @@ function De(t, e, n, r = [], i) {
622
620
  }
623
621
  function pn(t, e, n = !1) {
624
622
  const r = [];
625
- return { isComplete: De(t, e, r, [], n), data: r };
623
+ return { isComplete: ke(t, e, r, [], n), data: r };
626
624
  }
627
625
  const fe = (t) => {
628
626
  if (t.endsWith(".index"))
@@ -979,35 +977,36 @@ class be {
979
977
  }
980
978
  if (!Je(b))
981
979
  throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${b.type} for column ${g.id}`);
982
- const F = ct(b), $ = y[y.length - 1];
980
+ const k = ct(b), $ = y[y.length - 1];
983
981
  if ($ >= b.partitionKeyLength)
984
982
  throw new Error(`Not enough partition keys (${b.partitionKeyLength}) for requested split axes (max index ${$}) in column ${P.name}`);
985
- const q = y.map((w) => this.findLabels(E(P.axesSpec[w]))), D = [], I = (w, N) => {
983
+ const q = y.map((w) => this.findLabels(E(P.axesSpec[w]))), F = [], I = (w, N) => {
986
984
  if (N >= y.length) {
987
- D.push([...w]);
985
+ if (F.push([...w]), F.length > 1e4)
986
+ throw new Error("Too many key combinations, aborting.");
988
987
  return;
989
988
  }
990
- const k = y[N];
991
- if (k >= F.length)
992
- throw new Error(`Axis index ${k} out of bounds for unique keys array (length ${F.length}) during split key generation for column ${g.id}`);
993
- const O = F[k];
989
+ const D = y[N];
990
+ if (D >= k.length)
991
+ throw new Error(`Axis index ${D} out of bounds for unique keys array (length ${k.length}) during split key generation for column ${g.id}`);
992
+ const O = k[D];
994
993
  if (!O || O.length === 0) {
995
- D.length = 0;
994
+ F.length = 0;
996
995
  return;
997
996
  }
998
997
  for (const z of O)
999
998
  w.push(z), I(w, N + 1), w.pop();
1000
999
  };
1001
- if (I([], 0), D.length === 0)
1000
+ if (I([], 0), F.length === 0)
1002
1001
  continue;
1003
1002
  const R = [...P.axesSpec], se = y.map((w) => w);
1004
1003
  for (let w = y.length - 1; w >= 0; w--)
1005
1004
  R.splice(y[w], 1);
1006
1005
  const J = { ...P, axesSpec: R };
1007
- for (const w of D) {
1008
- const N = w.map((k, O) => {
1009
- const z = se[O], Re = E(P.axesSpec[z]), oe = q[O], Oe = (oe == null ? void 0 : oe[k]) ?? String(k);
1010
- return { axisIdx: z, axisId: Re, value: k, label: Oe };
1006
+ for (const w of F) {
1007
+ const N = w.map((D, O) => {
1008
+ const z = se[O], Re = E(P.axesSpec[z]), oe = q[O], Oe = (oe == null ? void 0 : oe[D]) ?? String(D);
1009
+ return { axisIdx: z, axisId: Re, value: D, label: Oe };
1011
1010
  });
1012
1011
  u.push({
1013
1012
  type: "split",
@@ -1430,7 +1429,7 @@ class X {
1430
1429
  return this.ctx.getCurrentUnstableMarker();
1431
1430
  }
1432
1431
  }
1433
- const M = "1.28.1";
1432
+ const M = "1.28.4";
1434
1433
  function wt(t) {
1435
1434
  return t.__renderLambda === !0;
1436
1435
  }
@@ -1771,7 +1770,7 @@ function xt(t, e) {
1771
1770
  const n = t.spec.axesSpec.map(E);
1772
1771
  return e.spec.axesSpec.map(E).every((i) => n.some((s) => G(s, i) && G(i, s)));
1773
1772
  }
1774
- function ke(t, e) {
1773
+ function De(t, e) {
1775
1774
  const n = t.spec.axesSpec.map(E);
1776
1775
  return e.spec.axesSpec.map(E).every((i) => n.some((s) => G(s, i)));
1777
1776
  }
@@ -1780,7 +1779,7 @@ function Se(t, e) {
1780
1779
  const n = t.spec.axesSpec.map(E), r = e.spec.axesSpec.map(E);
1781
1780
  if (xt(t, e))
1782
1781
  return [];
1783
- if (!ke(t, e))
1782
+ if (!De(t, e))
1784
1783
  return [];
1785
1784
  const o = r.map((d) => n.filter((f) => G(f, d))), a = St(o), l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), S = a.map((d) => {
1786
1785
  const f = /* @__PURE__ */ new Set();
@@ -1840,7 +1839,7 @@ function _t(t, e) {
1840
1839
  for (const i of t) {
1841
1840
  if (i.id === r.id)
1842
1841
  break;
1843
- if (ke(i, r)) {
1842
+ if (De(i, r)) {
1844
1843
  n.push(r);
1845
1844
  break;
1846
1845
  }