@platforma-sdk/model 1.27.8 → 1.27.10

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,19 +1,20 @@
1
1
  var _e = Object.defineProperty;
2
2
  var Ie = (t, e, n) => e in t ? _e(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var T = (t, e, n) => Ie(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { isPColumn as M, mapPObjectData as ue, selectorsToPredicate as ce, AnchoredIdDeriver as te, isPlRef as Ce, resolveAnchors as Le, isPColumnSpec as J, getAxisId as L, entriesToDataInfo as Te, mapValueInVOE as Fe, ensurePColumn as Re, isDataInfo as me, extractAllColumns as ke, mapPTableDef as De, mapDataInfo as Ee, canonicalizeAxisId as Oe, matchAxisId as G } from "@milaboratories/pl-model-common";
4
+ import { isPColumn as M, mapPObjectData as ue, selectorsToPredicate as ce, AnchoredIdDeriver as te, isPlRef as Ce, resolveAnchors as Le, isPColumnSpec as J, getAxisId as L, entriesToDataInfo as Te, mapValueInVOE as Fe, ensurePColumn as Re, isDataInfo as me, extractAllColumns as ke, mapPTableDef as De, mapDataInfo as Oe, canonicalizeAxisId as Ee, matchAxisId as G } from "@milaboratories/pl-model-common";
5
5
  export * from "@milaboratories/pl-model-common";
6
- import { z as E } from "zod";
6
+ import { z as O } from "zod";
7
+ export * from "@milaboratories/pl-error-like";
7
8
  class je extends Error {
8
9
  constructor(e, n) {
9
- super(`${e.length}${n ? "+" : ""} errors, first error: ` + e[0]), this.errors = e, this.moreErrors = n;
10
+ super(`${e.length}${n ? "+" : ""} errors, first error: ` + e[0].message), this.errors = e, this.moreErrors = n;
10
11
  }
11
12
  }
12
13
  function Ve(t) {
13
14
  if (!t.ok) throw new je(t.errors, t.moreErrors);
14
15
  return t.value;
15
16
  }
16
- function ft(t) {
17
+ function ht(t) {
17
18
  return new Proxy(t, {
18
19
  get(e, n) {
19
20
  return Ve(e[n]);
@@ -26,13 +27,13 @@ function b(t) {
26
27
  function W(t) {
27
28
  return { type: "GetFromCtx", variable: t };
28
29
  }
29
- function ht(t) {
30
+ function gt(t) {
30
31
  return {
31
32
  type: "Isolate",
32
33
  cfg: t
33
34
  };
34
35
  }
35
- const gt = W("$args"), mt = W("$it"), yt = W("$prod"), bt = W("$staging"), vt = W("$ui");
36
+ const mt = W("$args"), yt = W("$it"), bt = W("$prod"), vt = W("$staging"), wt = W("$ui");
36
37
  function Y(t) {
37
38
  return { type: "Immediate", value: t };
38
39
  }
@@ -44,7 +45,7 @@ function ye(t) {
44
45
  template: e
45
46
  };
46
47
  }
47
- function wt(...t) {
48
+ function xt(...t) {
48
49
  const e = [];
49
50
  for (const n of t) e.push(b(n));
50
51
  return {
@@ -59,7 +60,7 @@ function X(t, e) {
59
60
  field: b(e)
60
61
  };
61
62
  }
62
- function xt(t, e, n = "$it") {
63
+ function At(t, e, n = "$it") {
63
64
  return {
64
65
  type: "MapRecordValues",
65
66
  source: t,
@@ -67,7 +68,7 @@ function xt(t, e, n = "$it") {
67
68
  itVar: n
68
69
  };
69
70
  }
70
- function At(t, e, n = "$it") {
71
+ function St(t, e, n = "$it") {
71
72
  return {
72
73
  type: "MapArrayValues",
73
74
  source: t,
@@ -75,46 +76,46 @@ function At(t, e, n = "$it") {
75
76
  itVar: n
76
77
  };
77
78
  }
78
- function St(t) {
79
+ function Pt(t) {
79
80
  return {
80
81
  type: "Flatten",
81
82
  source: t
82
83
  };
83
84
  }
84
- function Pt(t) {
85
+ function _t(t) {
85
86
  return {
86
87
  type: "IsEmpty",
87
88
  arg: t
88
89
  };
89
90
  }
90
- function _t(t) {
91
+ function It(t) {
91
92
  return {
92
93
  type: "Not",
93
94
  operand: t
94
95
  };
95
96
  }
96
- function It(t, e) {
97
+ function Ct(t, e) {
97
98
  return {
98
99
  type: "And",
99
100
  operand1: t,
100
101
  operand2: e
101
102
  };
102
103
  }
103
- function Ct(t, e) {
104
+ function Lt(t, e) {
104
105
  return {
105
106
  type: "Or",
106
107
  operand1: t,
107
108
  operand2: e
108
109
  };
109
110
  }
110
- function Lt(t, e) {
111
+ function Tt(t, e) {
111
112
  return {
112
113
  type: "GetResourceField",
113
114
  source: b(t),
114
115
  field: b(e)
115
116
  };
116
117
  }
117
- function Tt() {
118
+ function Ft() {
118
119
  return function(t) {
119
120
  return {
120
121
  type: "GetResourceValueAsJson",
@@ -122,7 +123,7 @@ function Tt() {
122
123
  };
123
124
  };
124
125
  }
125
- function Ft(t, e, n = "$it") {
126
+ function Rt(t, e, n = "$it") {
126
127
  return {
127
128
  type: "MapResourceFields",
128
129
  source: t,
@@ -130,19 +131,19 @@ function Ft(t, e, n = "$it") {
130
131
  itVar: n
131
132
  };
132
133
  }
133
- function Rt(t) {
134
+ function kt(t) {
134
135
  return {
135
136
  type: "GetBlobContent",
136
137
  source: b(t)
137
138
  };
138
139
  }
139
- function kt(t) {
140
+ function Dt(t) {
140
141
  return {
141
142
  type: "GetBlobContentAsString",
142
143
  source: b(t)
143
144
  };
144
145
  }
145
- function Dt() {
146
+ function Ot() {
146
147
  return function(t) {
147
148
  return {
148
149
  type: "GetBlobContentAsJson",
@@ -156,47 +157,47 @@ function Et(t) {
156
157
  source: b(t)
157
158
  };
158
159
  }
159
- function Ot(t) {
160
+ function jt(t) {
160
161
  return {
161
162
  type: "GetOnDemandBlobContent",
162
163
  source: b(t)
163
164
  };
164
165
  }
165
- function jt(t, e) {
166
+ function Vt(t, e) {
166
167
  return {
167
168
  type: "ExtractArchiveAndGetURL",
168
169
  format: e,
169
170
  source: b(t)
170
171
  };
171
172
  }
172
- function Vt(t) {
173
+ function Kt(t) {
173
174
  return {
174
175
  type: "GetImportProgress",
175
176
  source: b(t)
176
177
  };
177
178
  }
178
- function Kt(t, e) {
179
+ function $t(t, e) {
179
180
  return {
180
181
  type: "GetLastLogs",
181
182
  source: b(t),
182
183
  lines: e
183
184
  };
184
185
  }
185
- function $t(t, e) {
186
+ function Jt(t, e) {
186
187
  return {
187
188
  type: "GetProgressLog",
188
189
  source: b(t),
189
190
  patternToSearch: e
190
191
  };
191
192
  }
192
- function Jt(t, e) {
193
+ function Nt(t, e) {
193
194
  return {
194
195
  type: "GetProgressLogWithInfo",
195
196
  source: b(t),
196
197
  patternToSearch: e
197
198
  };
198
199
  }
199
- function Nt(t) {
200
+ function Bt(t) {
200
201
  return {
201
202
  type: "GetLogHandle",
202
203
  source: b(t)
@@ -497,19 +498,19 @@ function Be(t) {
497
498
  const e = /* @__PURE__ */ new Set();
498
499
  return oe(e, /* @__PURE__ */ new Set(), t), e;
499
500
  }
500
- const Bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
501
+ const Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
501
502
  __proto__: null,
502
503
  GlobalCfgRenderCtxFeatureFlags: Ne,
503
504
  MainAccessorName: we,
504
505
  StagingAccessorName: ve,
505
506
  getAllFutureAwaits: Be,
506
507
  isFutureAwait: xe
507
- }, Symbol.toStringTag, { value: "Module" })), Ue = "pl7.app/label", Me = "pl7.app/trace", Ge = E.object({
508
- type: E.string(),
509
- importance: E.number().optional(),
510
- id: E.string().optional(),
511
- label: E.string()
512
- }), We = E.array(Ge), He = 1e-3, qe = "__LABEL__", pe = "__LABEL__@1";
508
+ }, Symbol.toStringTag, { value: "Module" })), Ue = "pl7.app/label", Me = "pl7.app/trace", Ge = O.object({
509
+ type: O.string(),
510
+ importance: O.number().optional(),
511
+ id: O.string().optional(),
512
+ label: O.string()
513
+ }), We = O.array(Ge), He = 1e-3, qe = "__LABEL__", pe = "__LABEL__@1";
513
514
  function de(t, e, n = {}) {
514
515
  const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = t.map((f) => {
515
516
  var R, k;
@@ -571,7 +572,7 @@ function de(t, e, n = {}) {
571
572
  }
572
573
  return l(/* @__PURE__ */ new Set([...o, ...a]));
573
574
  }
574
- const H = "PColumnData/", Q = H + "ResourceMap", Z = H + "Partitioned/ResourceMap", N = H + "JsonPartitioned", O = H + "BinaryPartitioned", Ae = H + "Partitioned/", ee = Ae + "JsonPartitioned", B = Ae + "BinaryPartitioned";
575
+ const H = "PColumnData/", Q = H + "ResourceMap", Z = H + "Partitioned/ResourceMap", N = H + "JsonPartitioned", E = H + "BinaryPartitioned", Ae = H + "Partitioned/", ee = Ae + "JsonPartitioned", B = Ae + "BinaryPartitioned";
575
576
  function Se(t, e, n, r = [], i) {
576
577
  if (t === void 0) return !1;
577
578
  switch (t.resourceType.name) {
@@ -605,7 +606,7 @@ function Se(t, e, n, r = [], i) {
605
606
  throw new Error(`Unknown resource type: ${t.resourceType.name}`);
606
607
  }
607
608
  }
608
- function Ut(t, e, n = !1) {
609
+ function Mt(t, e, n = !1) {
609
610
  const r = [];
610
611
  return { isComplete: Se(t, e, r, [], n), data: r };
611
612
  }
@@ -628,7 +629,7 @@ function ze(t) {
628
629
  i = n.partitionKeyLength + n.keyLength;
629
630
  break;
630
631
  case N:
631
- case O:
632
+ case E:
632
633
  i = n.partitionKeyLength;
633
634
  break;
634
635
  case B:
@@ -639,9 +640,9 @@ function ze(t) {
639
640
  switch (e) {
640
641
  case Q:
641
642
  case N:
642
- case O:
643
+ case E:
643
644
  for (let s of t.listInputFields()) {
644
- e === O && (s = ae(s).baseKey);
645
+ e === E && (s = ae(s).baseKey);
645
646
  const o = [...JSON.parse(s)];
646
647
  r.push(o);
647
648
  }
@@ -701,7 +702,7 @@ function le(t, e = []) {
701
702
  parts: i
702
703
  };
703
704
  }
704
- case O: {
705
+ case E: {
705
706
  if (typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
706
707
  throw new Error(`Missing partitionKeyLength in metadata for ${n}`);
707
708
  const i = [], s = /* @__PURE__ */ new Map();
@@ -756,8 +757,8 @@ function le(t, e = []) {
756
757
  for (const o of t.listInputFields()) {
757
758
  const a = t.resolve({ field: o, assertFieldType: "Input" });
758
759
  if (a === void 0) return;
759
- if (a.resourceType.name !== O)
760
- throw new Error(`Expected ${O} inside ${n}, but got ${a.resourceType.name}`);
760
+ if (a.resourceType.name !== E)
761
+ throw new Error(`Expected ${E} inside ${n}, but got ${a.resourceType.name}`);
761
762
  const c = le(a, JSON.parse(o));
762
763
  if (c === void 0) return;
763
764
  if (c.type !== "BinaryPartitioned")
@@ -842,12 +843,12 @@ function re(t, e) {
842
843
  return !0;
843
844
  }
844
845
  function fe(t) {
845
- return ue(t, (e) => e instanceof I ? e.handle : me(e) ? Ee(e, (n) => n.handle) : e);
846
+ return ue(t, (e) => e instanceof I ? e.handle : me(e) ? Oe(e, (n) => n.handle) : e);
846
847
  }
847
848
  function Qe(t) {
848
849
  if (t)
849
850
  return t.map((e) => ({
850
- type: `split:${Oe(e.axisId)}`,
851
+ type: `split:${Ee(e.axisId)}`,
851
852
  label: e.label,
852
853
  importance: 1e6
853
854
  // High importance for split filters in labels
@@ -1275,7 +1276,7 @@ class z {
1275
1276
  return this.ctx.getCurrentUnstableMarker();
1276
1277
  }
1277
1278
  }
1278
- const U = "1.27.8";
1279
+ const U = "1.27.10";
1279
1280
  function tt(t) {
1280
1281
  return t.__renderLambda === !0;
1281
1282
  }
@@ -1287,7 +1288,7 @@ function D(t) {
1287
1288
  if (t !== void 0)
1288
1289
  return typeof t == "string" ? { __renderLambda: !0, handle: t, retentive: !1 } : t;
1289
1290
  }
1290
- function Mt(t) {
1291
+ function Gt(t) {
1291
1292
  if (t.v3 !== void 0) {
1292
1293
  const {
1293
1294
  initialArgs: e,
@@ -1526,7 +1527,7 @@ class _ {
1526
1527
  return Ke() ? be({ sdkVersion: U }) : { config: e };
1527
1528
  }
1528
1529
  }
1529
- function Gt(t, e, n, r) {
1530
+ function Wt(t, e, n, r) {
1530
1531
  var l, m;
1531
1532
  Array.isArray(r) && (r = { filters: r });
1532
1533
  const i = t.resultPool.getData().entries.map((u) => u.obj).filter(M).filter((u) => u.spec.name === "pl7.app/label" && u.spec.axesSpec.length === 1), s = (u, f) => {
@@ -1582,7 +1583,7 @@ function Gt(t, e, n, r) {
1582
1583
  sorting: ((m = n == null ? void 0 : n.pTableParams) == null ? void 0 : m.sorting) ?? []
1583
1584
  });
1584
1585
  }
1585
- function Wt(t, e, n) {
1586
+ function Ht(t, e, n) {
1586
1587
  const r = t.resultPool.findLabels(e);
1587
1588
  return {
1588
1589
  axis: e,
@@ -1700,7 +1701,7 @@ const lt = [
1700
1701
  "String",
1701
1702
  "Bytes"
1702
1703
  ];
1703
- function Ht(t, e) {
1704
+ function qt(t, e) {
1704
1705
  if (e === void 0) return;
1705
1706
  const n = t.resultPool.getData().entries.map((s) => s.obj).filter(M).filter((s) => lt.includes(s.spec.valueType)), r = at(e, n), i = [...r, ...ot(r)];
1706
1707
  if (!i.some(
@@ -1708,7 +1709,7 @@ function Ht(t, e) {
1708
1709
  ))
1709
1710
  return t.createPFrame(i);
1710
1711
  }
1711
- class qt {
1712
+ class zt {
1712
1713
  constructor(e) {
1713
1714
  this.handle = e;
1714
1715
  }
@@ -1735,37 +1736,44 @@ function ut(t) {
1735
1736
  name: X(t, "name")
1736
1737
  });
1737
1738
  }
1738
- function zt(t) {
1739
+ function Yt(t) {
1739
1740
  return ye({
1740
1741
  ref: ut(X(t, "ref")),
1741
1742
  label: X(t, "label")
1742
1743
  });
1743
1744
  }
1744
- const Yt = {
1745
+ const Xt = {
1745
1746
  sdkVersion: U
1746
1747
  };
1747
- function Xt() {
1748
+ function ct() {
1748
1749
  return be({ sdkVersion: U });
1749
1750
  }
1750
1751
  function Qt(t) {
1752
+ try {
1753
+ return ct();
1754
+ } catch {
1755
+ return t;
1756
+ }
1757
+ }
1758
+ function Zt(t) {
1751
1759
  if (typeof globalThis.getEnvironmentValue == "function")
1752
1760
  return globalThis.getEnvironmentValue(t);
1753
1761
  }
1754
1762
  export {
1755
- gt as Args,
1763
+ mt as Args,
1756
1764
  _ as BlockModel,
1757
- Yt as CurrentSdkInfo,
1765
+ Xt as CurrentSdkInfo,
1758
1766
  S as FutureRef,
1759
1767
  it as IS_VIRTUAL_COLUMN,
1760
- mt as It,
1761
- Bt as JsRenderInternal,
1768
+ yt as It,
1769
+ Ut as JsRenderInternal,
1762
1770
  he as LABEL_ANNOTATION,
1763
- yt as MainOutputs,
1771
+ bt as MainOutputs,
1764
1772
  je as OutputError,
1765
1773
  Ue as PAnnotationLabel,
1766
1774
  Me as PAnnotationTrace,
1767
- qt as PFrameImpl,
1768
- O as RT_BINARY_PARTITIONED,
1775
+ zt as PFrameImpl,
1776
+ E as RT_BINARY_PARTITIONED,
1769
1777
  B as RT_BINARY_SUPER_PARTITIONED,
1770
1778
  N as RT_JSON_PARTITIONED,
1771
1779
  ee as RT_JSON_SUPER_PARTITIONED,
@@ -1773,58 +1781,59 @@ export {
1773
1781
  Z as RT_RESOURCE_MAP_PARTITIONED,
1774
1782
  z as RenderCtx,
1775
1783
  et as ResultPool,
1776
- bt as StagingOutputs,
1784
+ vt as StagingOutputs,
1777
1785
  We as Trace,
1778
1786
  Ge as TraceEntry,
1779
1787
  I as TreeNodeAccessor,
1780
- vt as UiState,
1781
- It as and,
1782
- Ht as createPFrameForGraphs,
1783
- Gt as createPlDataTable,
1784
- Wt as createPlDataTableSheet,
1788
+ wt as UiState,
1789
+ Ct as and,
1790
+ qt as createPFrameForGraphs,
1791
+ Wt as createPlDataTable,
1792
+ Ht as createPlDataTableSheet,
1785
1793
  de as deriveLabels,
1786
1794
  se as downgradeCfgOrLambda,
1787
1795
  at as enrichColumnsWithCompatible,
1788
- jt as extractArchiveAndGetURL,
1789
- Mt as extractConfig,
1796
+ Vt as extractArchiveAndGetURL,
1797
+ Gt as extractConfig,
1790
1798
  Xe as filterDataInfoEntries,
1791
- St as flatten,
1792
- zt as fromPlOption,
1799
+ Pt as flatten,
1800
+ Yt as fromPlOption,
1793
1801
  ut as fromPlRef,
1794
1802
  ot as getAdditionalColumns,
1795
- Rt as getBlobContent,
1796
- Dt as getBlobContentAsJson,
1797
- kt as getBlobContentAsString,
1803
+ kt as getBlobContent,
1804
+ Ot as getBlobContentAsJson,
1805
+ Dt as getBlobContentAsString,
1798
1806
  Et as getDownloadedBlobContent,
1799
- Qt as getEnvironmentValue,
1807
+ Zt as getEnvironmentValue,
1800
1808
  W as getFromCfg,
1801
1809
  Y as getImmediate,
1802
- Vt as getImportProgress,
1810
+ Kt as getImportProgress,
1803
1811
  X as getJsonField,
1804
- Kt as getLastLogs,
1805
- Nt as getLogHandle,
1806
- Ot as getOnDemandBlobContent,
1812
+ $t as getLastLogs,
1813
+ Bt as getLogHandle,
1814
+ jt as getOnDemandBlobContent,
1807
1815
  ze as getPartitionKeysList,
1808
- $t as getProgressLog,
1809
- Jt as getProgressLogWithInfo,
1810
- Xt as getRawPlatformaInstance,
1811
- Lt as getResourceField,
1812
- Tt as getResourceValueAsJson,
1816
+ Qt as getPlatformaOrDefault,
1817
+ Jt as getProgressLog,
1818
+ Nt as getProgressLogWithInfo,
1819
+ ct as getRawPlatformaInstance,
1820
+ Tt as getResourceField,
1821
+ Ft as getResourceValueAsJson,
1813
1822
  Ye as getUniquePartitionKeys,
1814
1823
  ie as ifDef,
1815
1824
  tt as isConfigLambda,
1816
- Pt as isEmpty,
1817
- ht as isolate,
1818
- wt as makeArray,
1825
+ _t as isEmpty,
1826
+ gt as isolate,
1827
+ xt as makeArray,
1819
1828
  ye as makeObject,
1820
- At as mapArrayValues,
1821
- xt as mapRecordValues,
1822
- Ft as mapResourceFields,
1823
- _t as not,
1824
- Ct as or,
1829
+ St as mapArrayValues,
1830
+ At as mapRecordValues,
1831
+ Rt as mapResourceFields,
1832
+ It as not,
1833
+ Lt as or,
1825
1834
  le as parsePColumnData,
1826
- Ut as parseResourceMap,
1835
+ Mt as parseResourceMap,
1827
1836
  Ve as readOutput,
1828
- ft as wrapOutputs
1837
+ ht as wrapOutputs
1829
1838
  };
1830
1839
  //# sourceMappingURL=index.mjs.map