@platforma-sdk/model 1.41.3 → 1.41.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
@@ -1,7 +1,7 @@
1
1
  var it = Object.defineProperty;
2
2
  var ot = (t, e, n) => e in t ? it(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var V = (t, e, n) => ot(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { isPColumn as je, mapPObjectData as Ae, isDataInfoEntries as qe, isDataInfo as pe, dataInfoToEntries as st, selectorsToPredicate as Y, resolveAnchors as Fe, deriveNativeId as at, isPColumnSpec as oe, isPartitionedDataInfoEntries as lt, getAxisId as k, entriesToDataInfo as ut, canonicalizeAxisId as ct, withEnrichments as xe, AnchoredIdDeriver as Ie, isPlRef as pt, mapValueInVOE as dt, ensurePColumn as ft, extractAllColumns as ht, mapPTableDef as mt, mapDataInfo as gt, extractConfigGeneric as yt, matchAxisId as U, getColumnIdAndSpec as _e, canonicalizeJson as D, parseJson as Le, visitDataInfo as bt, isPTableAbsent as vt, uniquePlId as Ct, PTableNA as Tt } from "@milaboratories/pl-model-common";
4
+ import { isPColumn as je, mapPObjectData as Ae, isDataInfoEntries as qe, isDataInfo as pe, dataInfoToEntries as st, selectorsToPredicate as Y, resolveAnchors as xe, deriveNativeId as at, isPColumnSpec as oe, isPartitionedDataInfoEntries as lt, getAxisId as k, entriesToDataInfo as ut, canonicalizeAxisId as ct, withEnrichments as Fe, AnchoredIdDeriver as Ie, isPlRef as pt, mapValueInVOE as dt, ensurePColumn as ft, extractAllColumns as ht, mapPTableDef as mt, mapDataInfo as gt, extractConfigGeneric as yt, matchAxisId as U, getColumnIdAndSpec as _e, canonicalizeJson as D, parseJson as Le, visitDataInfo as bt, isPTableAbsent as vt, uniquePlId as Ct, PTableNA as Tt } from "@milaboratories/pl-model-common";
5
5
  export * from "@milaboratories/pl-model-common";
6
6
  import Be from "canonicalize";
7
7
  import { z as B } from "zod";
@@ -83,13 +83,13 @@ function wn(t) {
83
83
  source: t
84
84
  };
85
85
  }
86
- function Fn(t) {
86
+ function xn(t) {
87
87
  return {
88
88
  type: "IsEmpty",
89
89
  arg: t
90
90
  };
91
91
  }
92
- function xn(t) {
92
+ function Fn(t) {
93
93
  return {
94
94
  type: "Not",
95
95
  operand: t
@@ -230,7 +230,7 @@ function G(t, e) {
230
230
  return n.callbackRegistry[t] = e, !0;
231
231
  }
232
232
  const fe = /* @__PURE__ */ new Map();
233
- function Ft(t, e) {
233
+ function xt(t, e) {
234
234
  t in b().callbackRegistry || (b().callbackRegistry[t] = (n) => {
235
235
  for (const r of fe.get(t))
236
236
  r(n);
@@ -240,7 +240,7 @@ class L {
240
240
  constructor(e, n = (r) => r) {
241
241
  V(this, "isResolved", !1);
242
242
  V(this, "resolvedValue");
243
- this.handle = e, this.postProcess = n, Ft(e, (r) => {
243
+ this.handle = e, this.postProcess = n, xt(e, (r) => {
244
244
  this.resolvedValue = n(r), this.isResolved = !0;
245
245
  });
246
246
  }
@@ -480,7 +480,7 @@ class O {
480
480
  return o && (l = l.filter((u) => u[1] !== void 0)), l.map(([u, h]) => s(u, h));
481
481
  }
482
482
  }
483
- const We = "staging", Ge = "main", xt = {
483
+ const We = "staging", Ge = "main", Ft = {
484
484
  explicitColumnsSupport: !0,
485
485
  inlineColumnsSupport: !0,
486
486
  activeArgs: !0,
@@ -506,7 +506,7 @@ function It(t) {
506
506
  }
507
507
  const Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
508
508
  __proto__: null,
509
- GlobalCfgRenderCtxFeatureFlags: xt,
509
+ GlobalCfgRenderCtxFeatureFlags: Ft,
510
510
  MainAccessorName: Ge,
511
511
  StagingAccessorName: We,
512
512
  getAllFutureAwaits: It,
@@ -523,7 +523,7 @@ function ze(t, e, n = {}) {
523
523
  const y = e(d);
524
524
  let p, g, C;
525
525
  "spec" in y && typeof y.spec == "object" ? (p = y.spec, g = y.prefixTrace, C = y.suffixTrace) : p = y;
526
- const E = (c = p.annotations) == null ? void 0 : c[_t], F = (v = p.annotations) == null ? void 0 : v[Lt], S = (F ? Vt.safeParse(JSON.parse(F)).data : void 0) ?? [], P = [
526
+ const E = (c = p.annotations) == null ? void 0 : c[_t], x = (v = p.annotations) == null ? void 0 : v[Lt], S = (x ? Vt.safeParse(JSON.parse(x)).data : void 0) ?? [], P = [
527
527
  ...g ?? [],
528
528
  ...S,
529
529
  ...C ?? []
@@ -532,10 +532,10 @@ function ze(t, e, n = {}) {
532
532
  const I = { label: E, type: Ot, importance: -2 };
533
533
  n.addLabelAsSuffix ? P.push(I) : P.splice(0, 0, I);
534
534
  }
535
- const T = [], x = /* @__PURE__ */ new Map();
535
+ const T = [], F = /* @__PURE__ */ new Map();
536
536
  for (let I = P.length - 1; I >= 0; --I) {
537
- const { type: $ } = P[I], K = P[I].importance ?? 0, j = (x.get($) ?? 0) + 1;
538
- x.set($, j);
537
+ const { type: $ } = P[I], K = P[I].importance ?? 0, j = (F.get($) ?? 0) + 1;
538
+ F.set($, j);
539
539
  const N = `${$}@${j}`;
540
540
  o.set(N, (o.get(N) ?? 0) + 1), r.set(
541
541
  N,
@@ -566,9 +566,9 @@ function ze(t, e, n = {}) {
566
566
  value: C.value
567
567
  });
568
568
  else return;
569
- const F = E.map((P) => P.label), S = n.separator ?? " / ";
569
+ const x = E.map((P) => P.label), S = n.separator ?? " / ";
570
570
  p.push({
571
- label: F.join(S),
571
+ label: x.join(S),
572
572
  value: C.value
573
573
  });
574
574
  }
@@ -965,7 +965,7 @@ class Q {
965
965
  if (Ve(g)) {
966
966
  if (!r)
967
967
  throw new Error("Anchored selectors in exclude require an AnchoredIdDeriver to be provided in options.");
968
- return Y(Fe(r.anchors, g, n));
968
+ return Y(xe(r.anchors, g, n));
969
969
  } else
970
970
  return Y(g);
971
971
  });
@@ -978,25 +978,25 @@ class Q {
978
978
  if (g) {
979
979
  if (!r)
980
980
  throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");
981
- C = Fe(r.anchors, p, n);
981
+ C = xe(r.anchors, p, n);
982
982
  } else
983
983
  C = p;
984
- const E = /* @__PURE__ */ new Set(), F = [];
984
+ const E = /* @__PURE__ */ new Set(), x = [];
985
985
  for (const T of this.providers) {
986
- const x = T.selectColumns(C);
987
- for (const c of x) {
986
+ const F = T.selectColumns(C);
987
+ for (const c of F) {
988
988
  if (u(c.spec)) continue;
989
989
  if (E.has(c.id))
990
990
  throw new Error(`Duplicate column id ${c.id} in provider ${T.constructor.name}`);
991
991
  const v = at(c.spec);
992
- m.has(v) || (E.add(c.id), m.add(v), F.push(c));
992
+ m.has(v) || (E.add(c.id), m.add(v), x.push(c));
993
993
  }
994
994
  }
995
- if (F.length === 0) continue;
995
+ if (x.length === 0) continue;
996
996
  const S = $t(p), P = S.length > 0;
997
- for (const T of F) {
997
+ for (const T of x) {
998
998
  if (!oe(T.spec)) continue;
999
- const x = T.spec;
999
+ const F = T.spec;
1000
1000
  if (P) {
1001
1001
  if (Mt(T.data))
1002
1002
  throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${T.id}`);
@@ -1009,8 +1009,8 @@ class Q {
1009
1009
  throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${c.type} for column ${T.id}`);
1010
1010
  const v = Nt(c), I = S[S.length - 1];
1011
1011
  if (I >= c.partitionKeyLength)
1012
- throw new Error(`Not enough partition keys (${c.partitionKeyLength}) for requested split axes (max index ${I}) in column ${x.name}`);
1013
- const $ = S.map((_) => this.findLabels(k(x.axesSpec[_]))), K = [], j = (_, W) => {
1012
+ throw new Error(`Not enough partition keys (${c.partitionKeyLength}) for requested split axes (max index ${I}) in column ${F.name}`);
1013
+ const $ = S.map((_) => this.findLabels(k(F.axesSpec[_]))), K = [], j = (_, W) => {
1014
1014
  if (W >= S.length) {
1015
1015
  if (K.push([..._]), K.length > 1e4)
1016
1016
  throw new Error("Too many key combinations, aborting.");
@@ -1029,19 +1029,19 @@ class Q {
1029
1029
  };
1030
1030
  if (j([], 0), K.length === 0)
1031
1031
  continue;
1032
- const N = [...x.axesSpec], et = S.map((_) => _);
1032
+ const N = [...F.axesSpec], et = S.map((_) => _);
1033
1033
  for (let _ = S.length - 1; _ >= 0; _--)
1034
1034
  N.splice(S[_], 1);
1035
- const tt = { ...x, axesSpec: N };
1035
+ const tt = { ...F, axesSpec: N };
1036
1036
  for (const _ of K) {
1037
1037
  const W = _.map((M, q) => {
1038
- const te = et[q], nt = k(x.axesSpec[te]), de = $[q], rt = (de == null ? void 0 : de[M]) ?? String(M);
1038
+ const te = et[q], nt = k(F.axesSpec[te]), de = $[q], rt = (de == null ? void 0 : de[M]) ?? String(M);
1039
1039
  return { axisIdx: te, axisId: nt, value: M, label: rt };
1040
1040
  });
1041
1041
  f.push({
1042
1042
  type: "split",
1043
1043
  originalColumn: T,
1044
- spec: x,
1044
+ spec: F,
1045
1045
  adjustedSpec: tt,
1046
1046
  dataEntries: c,
1047
1047
  axisFilters: W
@@ -1051,8 +1051,8 @@ class Q {
1051
1051
  f.push({
1052
1052
  type: "direct",
1053
1053
  originalColumn: T,
1054
- spec: x,
1055
- adjustedSpec: x
1054
+ spec: F,
1055
+ adjustedSpec: F
1056
1056
  });
1057
1057
  }
1058
1058
  }
@@ -1066,7 +1066,7 @@ class Q {
1066
1066
  l
1067
1067
  ), y = [];
1068
1068
  for (const { value: p, label: g } of d) {
1069
- const { originalColumn: C, spec: E } = p, F = p.type === "split" ? p.axisFilters : void 0, S = Bt(F);
1069
+ const { originalColumn: C, spec: E } = p, x = p.type === "split" ? p.axisFilters : void 0, S = Bt(x);
1070
1070
  let P;
1071
1071
  r ? P = r.deriveS(E, S) : P = Jt(C.id, S);
1072
1072
  let T = { ...p.adjustedSpec };
@@ -1165,10 +1165,10 @@ class Wt {
1165
1165
  const r = typeof e == "function" ? e : Y(e), i = this.getSpecs().entries.filter((a) => r(a.obj));
1166
1166
  let o = {}, s = !1;
1167
1167
  return typeof n < "u" && (typeof n == "function" ? o = n : typeof n == "object" && ("includeNativeLabel" in n || "separator" in n || "addLabelAsSuffix" in n ? o = n : (n = n, o = n.label ?? {}, s = n.refsWithEnrichments ?? !1))), typeof o == "object" ? ze(i, (a) => a.obj, o ?? {}).map(({ value: { ref: a }, label: l }) => ({
1168
- ref: xe(a, s),
1168
+ ref: Fe(a, s),
1169
1169
  label: l
1170
1170
  })) : i.map(({ ref: a, obj: l }) => ({
1171
- ref: xe(a, s),
1171
+ ref: Fe(a, s),
1172
1172
  label: o(l, a)
1173
1173
  }));
1174
1174
  }
@@ -1535,7 +1535,7 @@ class ne {
1535
1535
  this.ctx.logError(e);
1536
1536
  }
1537
1537
  }
1538
- const Gt = "1.41.3", X = Gt;
1538
+ const Gt = "1.41.6", X = Gt;
1539
1539
  function Ht(t) {
1540
1540
  return t.__renderLambda === !0;
1541
1541
  }
@@ -1946,16 +1946,16 @@ function Gn(t, e, n, r) {
1946
1946
  filters: p,
1947
1947
  sorting: g,
1948
1948
  coreColumnPredicate: r == null ? void 0 : r.coreColumnPredicate
1949
- }), E = t.createPTable(C), F = new Set((() => {
1949
+ }), E = t.createPTable(C), x = new Set((() => {
1950
1950
  if (d === "inner") return [];
1951
1951
  const c = o.pTableParams.hiddenColIds;
1952
1952
  return c || i.filter((v) => Zt(v.spec)).map((v) => v.id);
1953
1953
  })());
1954
- i.filter((c) => Pe(c.spec)).forEach((c) => F.delete(c.id)), r != null && r.coreColumnPredicate && i.flatMap((v) => {
1954
+ i.filter((c) => Pe(c.spec)).forEach((c) => x.delete(c.id)), r != null && r.coreColumnPredicate && i.flatMap((v) => {
1955
1955
  var I;
1956
1956
  return (I = r == null ? void 0 : r.coreColumnPredicate) != null && I.call(r, v.spec) ? [v.id] : [];
1957
- }).forEach((v) => F.delete(v)), [...y.map((c) => c.column), ...p.map((c) => c.column), ...g.map((c) => c.column)].filter((c) => c.type === "column").forEach((c) => F.delete(c.id));
1958
- const S = i.filter((c) => !F.has(c.id)), P = Re(S.map(_e), s);
1957
+ }).forEach((v) => x.delete(v)), [...y.map((c) => c.column), ...p.map((c) => c.column), ...g.map((c) => c.column)].filter((c) => c.type === "column").forEach((c) => x.delete(c.id));
1958
+ const S = i.filter((c) => !x.has(c.id)), P = Re(S.map(_e), s);
1959
1959
  if (!Yt([...S, ...P])) return;
1960
1960
  const T = Ne({
1961
1961
  columns: S,
@@ -1965,11 +1965,11 @@ function Gn(t, e, n, r) {
1965
1965
  filters: p,
1966
1966
  sorting: g,
1967
1967
  coreColumnPredicate: r == null ? void 0 : r.coreColumnPredicate
1968
- }), x = t.createPTable(T);
1968
+ }), F = t.createPTable(T);
1969
1969
  return {
1970
1970
  sourceId: o.pTableParams.sourceId,
1971
1971
  fullTableHandle: E,
1972
- visibleTableHandle: x
1972
+ visibleTableHandle: F
1973
1973
  };
1974
1974
  }
1975
1975
  function Hn(t, e, n) {
@@ -2184,7 +2184,13 @@ function Xn({
2184
2184
  data: i
2185
2185
  };
2186
2186
  }
2187
- function Yn(t) {
2187
+ function Yn() {
2188
+ return {
2189
+ axesSpec: [],
2190
+ selectedKeys: []
2191
+ };
2192
+ }
2193
+ function Qn(t) {
2188
2194
  return t === Tt ? (console.error("Axis value can never be N/A"), "") : t;
2189
2195
  }
2190
2196
  function un(t) {
@@ -2560,13 +2566,13 @@ const Ze = {
2560
2566
  supportedFor: () => !1
2561
2567
  }
2562
2568
  };
2563
- function Qn(t) {
2569
+ function Zn(t) {
2564
2570
  return t ? Object.entries(Ze).filter(([e, n]) => n.supportedFor(t)).map(([e, n]) => ({
2565
2571
  label: n.label,
2566
2572
  value: e
2567
2573
  })) : [];
2568
2574
  }
2569
- function Zn(t) {
2575
+ function er(t) {
2570
2576
  return Ze[t];
2571
2577
  }
2572
2578
  function we(t) {
@@ -2692,7 +2698,7 @@ function we(t) {
2692
2698
  function Me(t) {
2693
2699
  return t.filter((e) => e.type !== void 0).map(we);
2694
2700
  }
2695
- function er(t) {
2701
+ function tr(t) {
2696
2702
  return {
2697
2703
  title: t.title,
2698
2704
  mode: t.mode,
@@ -2702,7 +2708,7 @@ function er(t) {
2702
2708
  }))
2703
2709
  };
2704
2710
  }
2705
- class tr {
2711
+ class nr {
2706
2712
  constructor(e) {
2707
2713
  this.handle = e;
2708
2714
  }
@@ -2733,29 +2739,29 @@ function cn(t) {
2733
2739
  name: ae(t, "name")
2734
2740
  });
2735
2741
  }
2736
- function nr(t) {
2742
+ function rr(t) {
2737
2743
  return Je({
2738
2744
  ref: cn(ae(t, "ref")),
2739
2745
  label: ae(t, "label")
2740
2746
  });
2741
2747
  }
2742
- const rr = {
2748
+ const ir = {
2743
2749
  sdkVersion: X
2744
2750
  };
2745
- function ir() {
2751
+ function or() {
2746
2752
  return platformaApiVersion ?? 1;
2747
2753
  }
2748
- function or() {
2754
+ function sr() {
2749
2755
  return $e({ sdkVersion: X, apiVersion: platformaApiVersion });
2750
2756
  }
2751
- function sr(t) {
2757
+ function ar(t) {
2752
2758
  if (typeof globalThis.getEnvironmentValue == "function")
2753
2759
  return globalThis.getEnvironmentValue(t);
2754
2760
  }
2755
2761
  export {
2756
2762
  yn as Args,
2757
2763
  Oe as BlockModel,
2758
- rr as CurrentSdkInfo,
2764
+ ir as CurrentSdkInfo,
2759
2765
  L as FutureRef,
2760
2766
  nn as IS_VIRTUAL_COLUMN,
2761
2767
  bn as It,
@@ -2767,7 +2773,7 @@ export {
2767
2773
  _t as PAnnotationLabel,
2768
2774
  Lt as PAnnotationTrace,
2769
2775
  Q as PColumnCollection,
2770
- tr as PFrameImpl,
2776
+ nr as PFrameImpl,
2771
2777
  J as RT_BINARY_PARTITIONED,
2772
2778
  z as RT_BINARY_SUPER_PARTITIONED,
2773
2779
  H as RT_JSON_PARTITIONED,
@@ -2784,7 +2790,7 @@ export {
2784
2790
  Yt as allColumnsComputed,
2785
2791
  re as allColumnsReady,
2786
2792
  In as and,
2787
- er as compileAnnotationScript,
2793
+ tr as compileAnnotationScript,
2788
2794
  we as compileFilter,
2789
2795
  Me as compileFilters,
2790
2796
  Ut as convertOrParsePColumnData,
@@ -2792,6 +2798,7 @@ export {
2792
2798
  Hn as createPlDataTableSheet,
2793
2799
  De as createPlDataTableStateV2,
2794
2800
  Gn as createPlDataTableV2,
2801
+ Yn as createPlSelectionModel,
2795
2802
  Xn as createRowSelectionColumn,
2796
2803
  ze as deriveLabels,
2797
2804
  me as downgradeCfgOrLambda,
@@ -2801,7 +2808,7 @@ export {
2801
2808
  Kt as filterDataInfoEntries,
2802
2809
  Ze as filterUiMetadata,
2803
2810
  wn as flatten,
2804
- nr as fromPlOption,
2811
+ rr as fromPlOption,
2805
2812
  cn as fromPlRef,
2806
2813
  Xt as getAllLabelColumns,
2807
2814
  sn as getAvailableWithLinkersAxes,
@@ -2809,9 +2816,9 @@ export {
2809
2816
  Dn as getBlobContentAsJson,
2810
2817
  On as getBlobContentAsString,
2811
2818
  Rn as getDownloadedBlobContent,
2812
- sr as getEnvironmentValue,
2813
- Zn as getFilterUiMetadata,
2814
- Qn as getFilterUiTypeOptions,
2819
+ ar as getEnvironmentValue,
2820
+ er as getFilterUiMetadata,
2821
+ Zn as getFilterUiTypeOptions,
2815
2822
  Z as getFromCfg,
2816
2823
  se as getImmediate,
2817
2824
  Kn as getImportProgress,
@@ -2822,10 +2829,10 @@ export {
2822
2829
  Re as getMatchingLabelColumns,
2823
2830
  Nn as getOnDemandBlobContent,
2824
2831
  Dt as getPartitionKeysList,
2825
- ir as getPlatformaApiVersion,
2832
+ or as getPlatformaApiVersion,
2826
2833
  jn as getProgressLog,
2827
2834
  qn as getProgressLogWithInfo,
2828
- or as getRawPlatformaInstance,
2835
+ sr as getRawPlatformaInstance,
2829
2836
  Ln as getResourceField,
2830
2837
  En as getResourceValueAsJson,
2831
2838
  Nt as getUniquePartitionKeys,
@@ -2834,7 +2841,7 @@ export {
2834
2841
  Zt as isColumnOptional,
2835
2842
  ln as isColumnReady,
2836
2843
  Ht as isConfigLambda,
2837
- Fn as isEmpty,
2844
+ xn as isEmpty,
2838
2845
  Se as isLabelColumn,
2839
2846
  Pe as isLinkerColumn,
2840
2847
  gn as isolate,
@@ -2842,10 +2849,10 @@ export {
2842
2849
  Qe as makeDefaultPTableParams,
2843
2850
  Je as makeObject,
2844
2851
  An as mapArrayValues,
2845
- Yn as mapPTableValueToAxisKey,
2852
+ Qn as mapPTableValueToAxisKey,
2846
2853
  Pn as mapRecordValues,
2847
2854
  Vn as mapResourceFields,
2848
- xn as not,
2855
+ Fn as not,
2849
2856
  _n as or,
2850
2857
  Ce as parsePColumnData,
2851
2858
  $n as parseResourceMap,