@platforma-sdk/model 1.29.14 → 1.29.17

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
@@ -474,7 +474,7 @@ class I {
474
474
  let l = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
475
475
  (u) => [u, this.resolve({ field: u, assertFieldType: r })]
476
476
  );
477
- return s && (l = l.filter((u) => u[1] !== void 0)), l.map(([u, w]) => o(u, w));
477
+ return s && (l = l.filter((u) => u[1] !== void 0)), l.map(([u, y]) => o(u, y));
478
478
  }
479
479
  }
480
480
  const Ee = "staging", Fe = "main", at = {
@@ -513,18 +513,18 @@ const bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
513
513
  label: V.string()
514
514
  }), dt = V.array(pt), ft = 1e-3, ht = "__LABEL__", Ae = "__LABEL__@1";
515
515
  function Oe(t, e, n = {}) {
516
- const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = t.map((d) => {
516
+ const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = t.map((f) => {
517
517
  var q, F;
518
- const h = e(d);
519
- let f, x, c;
520
- "spec" in h && typeof h.spec == "object" ? (f = h.spec, x = h.prefixTrace, c = h.suffixTrace) : f = h;
521
- const y = (q = f.annotations) == null ? void 0 : q[ut], g = (F = f.annotations) == null ? void 0 : F[ct], v = (g ? dt.safeParse(JSON.parse(g)).data : void 0) ?? [], A = [
518
+ const h = e(f);
519
+ let d, x, c;
520
+ "spec" in h && typeof h.spec == "object" ? (d = h.spec, x = h.prefixTrace, c = h.suffixTrace) : d = h;
521
+ const v = (q = d.annotations) == null ? void 0 : q[ut], g = (F = d.annotations) == null ? void 0 : F[ct], b = (g ? dt.safeParse(JSON.parse(g)).data : void 0) ?? [], A = [
522
522
  ...x ?? [],
523
- ...v,
523
+ ...b,
524
524
  ...c ?? []
525
525
  ];
526
- if (y) {
527
- const _ = { label: y, type: ht, importance: -2 };
526
+ if (v) {
527
+ const _ = { label: v, type: ht, importance: -2 };
528
528
  n.addLabelAsSuffix ? A.push(_) : A.splice(0, 0, _);
529
529
  }
530
530
  const D = [], $ = /* @__PURE__ */ new Map();
@@ -541,24 +541,24 @@ function Oe(t, e, n = {}) {
541
541
  ), D.push({ ...A[_], fullType: P, occurenceIndex: J });
542
542
  }
543
543
  return D.reverse(), {
544
- value: d,
545
- spec: f,
546
- label: y,
544
+ value: f,
545
+ spec: d,
546
+ label: v,
547
547
  fullTrace: D
548
548
  };
549
549
  }), o = [], a = [], l = [...r];
550
- l.sort(([, d], [, h]) => h - d);
551
- for (const [d] of l)
552
- d.endsWith("@1") || i.get(d) === t.length ? o.push(d) : a.push(d);
553
- const u = (d) => {
550
+ l.sort(([, f], [, h]) => h - f);
551
+ for (const [f] of l)
552
+ f.endsWith("@1") || i.get(f) === t.length ? o.push(f) : a.push(f);
553
+ const u = (f) => {
554
554
  const h = [];
555
- for (let f = 0; f < s.length; f++) {
556
- const x = s[f], c = x.fullTrace.filter((v) => d.has(v.fullType));
555
+ for (let d = 0; d < s.length; d++) {
556
+ const x = s[d], c = x.fullTrace.filter((b) => f.has(b.fullType));
557
557
  if (c.length === 0)
558
558
  return;
559
- const y = c.map((v) => v.label), g = n.separator ?? " / ";
559
+ const v = c.map((b) => b.label), g = n.separator ?? " / ";
560
560
  h.push({
561
- label: y.join(g),
561
+ label: v.join(g),
562
562
  value: x.value
563
563
  });
564
564
  }
@@ -566,19 +566,19 @@ function Oe(t, e, n = {}) {
566
566
  };
567
567
  if (o.length === 0) {
568
568
  if (a.length !== 0) throw new Error("Assertion error.");
569
- const d = u(new Set(Ae));
570
- if (d === void 0) throw new Error("Assertion error.");
571
- return d;
572
- }
573
- let w = 0, b = 0;
574
- for (; w < o.length; ) {
575
- const d = /* @__PURE__ */ new Set();
576
- n.includeNativeLabel && d.add(Ae);
577
- for (let f = 0; f < w; ++f) d.add(o[f]);
578
- d.add(o[b]);
579
- const h = u(d);
580
- if (h !== void 0 && new Set(h.map((f) => f.label)).size === t.length) return h;
581
- b++, b >= o.length && (w++, b = w);
569
+ const f = u(new Set(Ae));
570
+ if (f === void 0) throw new Error("Assertion error.");
571
+ return f;
572
+ }
573
+ let y = 0, w = 0;
574
+ for (; y < o.length; ) {
575
+ const f = /* @__PURE__ */ new Set();
576
+ n.includeNativeLabel && f.add(Ae);
577
+ for (let d = 0; d < y; ++d) f.add(o[d]);
578
+ f.add(o[w]);
579
+ const h = u(f);
580
+ if (h !== void 0 && new Set(h.map((d) => d.label)).size === t.length) return h;
581
+ w++, w >= o.length && (y++, w = y);
582
582
  }
583
583
  const p = u(/* @__PURE__ */ new Set([...o, ...a]));
584
584
  if (p === void 0) throw new Error("Assertion error.");
@@ -948,28 +948,28 @@ class ge {
948
948
  ...i ?? {}
949
949
  }, l = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], u = [];
950
950
  for (const p of l) {
951
- const d = Ct(p);
951
+ const f = Ct(p);
952
952
  let h;
953
- if (d) {
953
+ if (f) {
954
954
  if (!r)
955
955
  throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");
956
956
  h = Ge(r.anchors, p, n);
957
957
  } else
958
958
  h = p;
959
- const f = /* @__PURE__ */ new Set(), x = [];
959
+ const d = /* @__PURE__ */ new Set(), x = [];
960
960
  for (const g of this.providers) {
961
- const v = g.selectColumns(h);
962
- for (const A of v) {
963
- if (f.has(A.id)) throw new Error(`Duplicate column id ${A.id} in provider ${g.constructor.name}`);
964
- f.add(A.id), x.push(A);
961
+ const b = g.selectColumns(h);
962
+ for (const A of b) {
963
+ if (d.has(A.id)) throw new Error(`Duplicate column id ${A.id} in provider ${g.constructor.name}`);
964
+ d.add(A.id), x.push(A);
965
965
  }
966
966
  }
967
967
  if (x.length === 0) continue;
968
- const c = St(p), y = c.length > 0;
968
+ const c = St(p), v = c.length > 0;
969
969
  for (const g of x) {
970
970
  if (!Q(g.spec)) continue;
971
- const v = g.spec;
972
- if (y) {
971
+ const b = g.spec;
972
+ if (v) {
973
973
  const A = vt(g.data);
974
974
  if (!A) {
975
975
  if (s) continue;
@@ -979,8 +979,8 @@ class ge {
979
979
  throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${A.type} for column ${g.id}`);
980
980
  const D = yt(A), $ = c[c.length - 1];
981
981
  if ($ >= A.partitionKeyLength)
982
- throw new Error(`Not enough partition keys (${A.partitionKeyLength}) for requested split axes (max index ${$}) in column ${v.name}`);
983
- const q = c.map((P) => this.findLabels(E(v.axesSpec[P]))), F = [], _ = (P, N) => {
982
+ throw new Error(`Not enough partition keys (${A.partitionKeyLength}) for requested split axes (max index ${$}) in column ${b.name}`);
983
+ const q = c.map((P) => this.findLabels(E(b.axesSpec[P]))), F = [], _ = (P, N) => {
984
984
  if (N >= c.length) {
985
985
  if (F.push([...P]), F.length > 1e4)
986
986
  throw new Error("Too many key combinations, aborting.");
@@ -999,19 +999,19 @@ class ge {
999
999
  };
1000
1000
  if (_([], 0), F.length === 0)
1001
1001
  continue;
1002
- const R = [...v.axesSpec], se = c.map((P) => P);
1002
+ const R = [...b.axesSpec], se = c.map((P) => P);
1003
1003
  for (let P = c.length - 1; P >= 0; P--)
1004
1004
  R.splice(c[P], 1);
1005
- const J = { ...v, axesSpec: R };
1005
+ const J = { ...b, axesSpec: R };
1006
1006
  for (const P of F) {
1007
1007
  const N = P.map((O, k) => {
1008
- const z = se[k], Ne = E(v.axesSpec[z]), oe = q[k], Be = (oe == null ? void 0 : oe[O]) ?? String(O);
1008
+ const z = se[k], Ne = E(b.axesSpec[z]), oe = q[k], Be = (oe == null ? void 0 : oe[O]) ?? String(O);
1009
1009
  return { axisIdx: z, axisId: Ne, value: O, label: Be };
1010
1010
  });
1011
1011
  u.push({
1012
1012
  type: "split",
1013
1013
  originalColumn: g,
1014
- spec: v,
1014
+ spec: b,
1015
1015
  adjustedSpec: J,
1016
1016
  dataEntries: A,
1017
1017
  axisFilters: N
@@ -1021,39 +1021,39 @@ class ge {
1021
1021
  u.push({
1022
1022
  type: "direct",
1023
1023
  originalColumn: g,
1024
- spec: v,
1025
- adjustedSpec: v
1024
+ spec: b,
1025
+ adjustedSpec: b
1026
1026
  });
1027
1027
  }
1028
1028
  }
1029
1029
  if (u.length === 0) return [];
1030
- const w = Oe(
1030
+ const y = Oe(
1031
1031
  u,
1032
1032
  (p) => ({
1033
1033
  spec: p.spec,
1034
1034
  suffixTrace: p.type === "split" ? At(p.axisFilters) : void 0
1035
1035
  }),
1036
1036
  a
1037
- ), b = [];
1038
- for (const { value: p, label: d } of w) {
1039
- const { originalColumn: h, spec: f } = p, x = p.type === "split" ? p.axisFilters : void 0, c = Pt(x);
1040
- let y;
1041
- r ? y = r.deriveS(f, c) : y = xt(h.id, c);
1037
+ ), w = [];
1038
+ for (const { value: p, label: f } of y) {
1039
+ const { originalColumn: h, spec: d } = p, x = p.type === "split" ? p.axisFilters : void 0, c = Pt(x);
1040
+ let v;
1041
+ r ? v = r.deriveS(d, c) : v = xt(h.id, c);
1042
1042
  let g = { ...p.adjustedSpec };
1043
1043
  o && (g = {
1044
1044
  ...g,
1045
1045
  annotations: {
1046
1046
  ...g.annotations ?? {},
1047
- "pl7.app/label": d
1047
+ "pl7.app/label": f
1048
1048
  }
1049
- }), b.push({
1050
- id: y,
1049
+ }), w.push({
1050
+ id: v,
1051
1051
  spec: g,
1052
1052
  data: () => p.type === "split" ? qe(bt(p.dataEntries, c)) : p.originalColumn.data,
1053
- label: d
1053
+ label: f
1054
1054
  });
1055
1055
  }
1056
- return b;
1056
+ return w;
1057
1057
  }
1058
1058
  getColumns(e, n) {
1059
1059
  const r = this.getUniversalEntries(e, {
@@ -1432,7 +1432,7 @@ class X {
1432
1432
  return this.ctx.getCurrentUnstableMarker();
1433
1433
  }
1434
1434
  }
1435
- const M = "1.29.14";
1435
+ const M = "1.29.17";
1436
1436
  function _t(t) {
1437
1437
  return t.__renderLambda === !0;
1438
1438
  }
@@ -1478,7 +1478,7 @@ function An(t) {
1478
1478
  renderingMode: n,
1479
1479
  initialArgs: o,
1480
1480
  outputs: Object.fromEntries(
1481
- Object.entries(r).map(([u, w]) => [u, j(w)])
1481
+ Object.entries(r).map(([u, y]) => [u, j(y)])
1482
1482
  ),
1483
1483
  inputsValid: j(i),
1484
1484
  sections: j(s),
@@ -1496,7 +1496,7 @@ function An(t) {
1496
1496
  renderingMode: r,
1497
1497
  initialArgs: o,
1498
1498
  outputs: Object.fromEntries(
1499
- Object.entries(i).map(([u, w]) => [u, j(w)])
1499
+ Object.entries(i).map(([u, y]) => [u, j(y)])
1500
1500
  ),
1501
1501
  inputsValid: j(n),
1502
1502
  sections: j(s),
@@ -1721,8 +1721,8 @@ function Ve(t, e) {
1721
1721
  for (const a of e) {
1722
1722
  const l = a.spec.axesSpec[0], u = E(a.spec.axesSpec[0]);
1723
1723
  if (W(o, u)) {
1724
- const w = Object.keys(o.domain ?? {}).length, b = Object.keys(u.domain ?? {}).length;
1725
- if (w > b) {
1724
+ const y = Object.keys(o.domain ?? {}).length, w = Object.keys(u.domain ?? {}).length;
1725
+ if (y > w) {
1726
1726
  const p = n(a.id, o.domain);
1727
1727
  r.set(p, {
1728
1728
  id: p,
@@ -1781,9 +1781,9 @@ function $e(t, e, n, r, i, s) {
1781
1781
  };
1782
1782
  }
1783
1783
  function Cn(t, e, n, r) {
1784
- var u, w;
1784
+ var u, y;
1785
1785
  Array.isArray(r) && (r = { filters: r });
1786
- const i = (r == null ? void 0 : r.coreJoinType) ?? "full", s = [...(r == null ? void 0 : r.filters) ?? [], ...((u = n == null ? void 0 : n.pTableParams) == null ? void 0 : u.filters) ?? []], o = ((w = n == null ? void 0 : n.pTableParams) == null ? void 0 : w.sorting) ?? [], a = je(t.resultPool);
1786
+ const i = (r == null ? void 0 : r.coreJoinType) ?? "full", s = [...(r == null ? void 0 : r.filters) ?? [], ...((u = n == null ? void 0 : n.pTableParams) == null ? void 0 : u.filters) ?? []], o = ((y = n == null ? void 0 : n.pTableParams) == null ? void 0 : y.sorting) ?? [], a = je(t.resultPool);
1787
1787
  if (!a) return;
1788
1788
  const l = Ve(e.map(Ie), a);
1789
1789
  if (Ke([...e, ...l]))
@@ -1796,36 +1796,36 @@ function Tt(t) {
1796
1796
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "optional";
1797
1797
  }
1798
1798
  function Sn(t, e, n, r, i) {
1799
- var f, x;
1800
- const s = (i == null ? void 0 : i.coreJoinType) ?? "full", o = [...(i == null ? void 0 : i.filters) ?? [], ...((f = r == null ? void 0 : r.pTableParams) == null ? void 0 : f.filters) ?? []], a = ((x = r == null ? void 0 : r.pTableParams) == null ? void 0 : x.sorting) ?? [], l = e.find((c) => n(c.spec));
1799
+ var d, x;
1800
+ const s = (i == null ? void 0 : i.coreJoinType) ?? "full", o = [...(i == null ? void 0 : i.filters) ?? [], ...((d = r == null ? void 0 : r.pTableParams) == null ? void 0 : d.filters) ?? []], a = ((x = r == null ? void 0 : r.pTableParams) == null ? void 0 : x.sorting) ?? [], l = e.find((c) => n(c.spec));
1801
1801
  if (!l) return;
1802
1802
  const u = je(t.resultPool);
1803
1803
  if (!u) return;
1804
- const w = [
1804
+ const y = new Set((() => {
1805
+ var v, g;
1806
+ if (s === "inner") return [];
1807
+ const c = (g = (v = r == null ? void 0 : r.gridState.columnVisibility) == null ? void 0 : v.hiddenColIds) == null ? void 0 : g.map(Lt).filter((b) => b.type === "column").map((b) => b.id);
1808
+ return c || e.filter((b) => Tt(b.spec)).map((b) => b.id);
1809
+ })());
1810
+ y.delete(l.id), [...o.map((c) => c.column), ...a.map((c) => c.column)].filter((c) => c.type === "column").map((c) => y.delete(c.id));
1811
+ const w = e.filter((c) => !y.has(c.id)), p = Ve(w.map(Ie), u), f = [
1805
1812
  ...l.spec.axesSpec.map((c) => ({
1806
1813
  type: "axis",
1807
1814
  id: E(c),
1808
1815
  spec: c
1809
1816
  })),
1810
- ...[...e, ...u].map((c) => ({
1817
+ ...[...e, ...p].map((c) => ({
1811
1818
  type: "column",
1812
1819
  id: c.id,
1813
1820
  spec: c.spec
1814
1821
  }))
1815
- ], b = new Set((() => {
1816
- var y, g;
1817
- if (s === "inner") return [];
1818
- const c = (g = (y = r == null ? void 0 : r.gridState.columnVisibility) == null ? void 0 : y.hiddenColIds) == null ? void 0 : g.map(Lt).filter((v) => v.type === "column").map((v) => v.id);
1819
- return c || e.filter((v) => Tt(v.spec)).map((v) => v.id);
1820
- })());
1821
- b.delete(l.id), [...o.map((c) => c.column), ...a.map((c) => c.column)].filter((c) => c.type === "column").map((c) => b.delete(c.id));
1822
- const p = e.filter((c) => !b.has(c.id)), d = Ve(p.map(Ie), u);
1823
- if (!Ke([...p, ...d])) return;
1822
+ ];
1823
+ if (!Ke([...w, ...p])) return;
1824
1824
  const h = t.createPTable(
1825
- $e(e, d, s, o, a, i == null ? void 0 : i.coreColumnPredicate)
1825
+ $e(e, p, s, o, a, i == null ? void 0 : i.coreColumnPredicate)
1826
1826
  );
1827
1827
  return {
1828
- tableSpec: w,
1828
+ tableSpec: f,
1829
1829
  tableHandle: h
1830
1830
  };
1831
1831
  }
@@ -1874,38 +1874,38 @@ function Ce(t, e) {
1874
1874
  return [];
1875
1875
  if (!Je(t, e))
1876
1876
  return [];
1877
- const o = r.map((b) => n.filter((p) => W(p, b))), a = Ft(o), l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), w = a.map((b) => {
1877
+ const o = r.map((w) => n.filter((p) => W(p, w))), a = Ft(o), l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), y = a.map((w) => {
1878
1878
  const p = /* @__PURE__ */ new Set();
1879
- return b.map((d, h) => {
1880
- const f = e.spec.axesSpec[h].domain, x = d.domain;
1881
- return Object.entries(x ?? {}).forEach(([c, y]) => {
1882
- if ((f == null ? void 0 : f[c]) === void 0) {
1883
- const g = JSON.stringify([c, y]);
1879
+ return w.map((f, h) => {
1880
+ const d = e.spec.axesSpec[h].domain, x = f.domain;
1881
+ return Object.entries(x ?? {}).forEach(([c, v]) => {
1882
+ if ((d == null ? void 0 : d[c]) === void 0) {
1883
+ const g = JSON.stringify([c, v]);
1884
1884
  p.add(g), l.add(g);
1885
1885
  }
1886
1886
  }), {
1887
- ...d,
1887
+ ...f,
1888
1888
  annotations: e.spec.axesSpec[h].annotations
1889
1889
  };
1890
1890
  }), p;
1891
1891
  });
1892
- return [...l].forEach((b) => {
1893
- w.some((p) => !p.has(b)) && u.add(b);
1894
- }), a.map((b, p) => {
1892
+ return [...l].forEach((w) => {
1893
+ y.some((p) => !p.has(w)) && u.add(w);
1894
+ }), a.map((w, p) => {
1895
1895
  var c;
1896
- const d = Et(e.id, b.map((y) => y.domain)), h = ((c = e.spec.annotations) == null ? void 0 : c[xe]) ?? "", f = [...w[p]].filter((y) => u.has(y)).sort().map((y) => {
1896
+ const f = Et(e.id, w.map((v) => v.domain)), h = ((c = e.spec.annotations) == null ? void 0 : c[xe]) ?? "", d = [...y[p]].filter((v) => u.has(v)).sort().map((v) => {
1897
1897
  var g;
1898
- return (g = JSON.parse(y)) == null ? void 0 : g[1];
1898
+ return (g = JSON.parse(v)) == null ? void 0 : g[1];
1899
1899
  }).join(" / "), x = {
1900
1900
  ...e.spec.annotations,
1901
1901
  [Ot]: "true"
1902
1902
  };
1903
- return (h || f) && (x[xe] = h && f ? h + " / " + f : h + f), {
1904
- id: d,
1903
+ return (h || d) && (x[xe] = h && d ? h + " / " + d : h + d), {
1904
+ id: f,
1905
1905
  spec: {
1906
1906
  ...e.spec,
1907
- axesSpec: b.map((y, g) => ({
1908
- ...y,
1907
+ axesSpec: w.map((v, g) => ({
1908
+ ...v,
1909
1909
  annotations: e.spec.axesSpec[g].annotations
1910
1910
  })),
1911
1911
  annotations: x
@@ -2095,7 +2095,7 @@ export {
2095
2095
  Lt as parsePTableColumnId,
2096
2096
  wn as parseResourceMap,
2097
2097
  rt as readOutput,
2098
- Pn as strinfigyPTableColumnId,
2098
+ Pn as stringifyPTableColumnId,
2099
2099
  Ut as wrapOutputs
2100
2100
  };
2101
2101
  //# sourceMappingURL=index.mjs.map