@milaboratories/pl-model-common 1.16.0 → 1.16.2

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,9 +1,9 @@
1
1
  var D = Object.defineProperty;
2
2
  var L = (e, n, t) => n in e ? D(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
3
3
  var l = (e, n, t) => L(e, typeof n != "symbol" ? n + "" : n, t);
4
- import { z as p } from "zod";
4
+ import { z as m } from "zod";
5
5
  import h from "canonicalize";
6
- function ke(e) {
6
+ function xe(e) {
7
7
  if (e.code !== void 0)
8
8
  return {
9
9
  code: e.code,
@@ -11,11 +11,11 @@ function ke(e) {
11
11
  featureFlags: e.featureFlags
12
12
  };
13
13
  }
14
- function m(e) {
14
+ function p(e) {
15
15
  if (e !== void 0)
16
16
  return typeof e == "string" ? { __renderLambda: !0, handle: e, retentive: !1 } : e;
17
17
  }
18
- function xe(e) {
18
+ function ke(e) {
19
19
  if (e.v3 !== void 0) {
20
20
  const {
21
21
  initialArgs: n,
@@ -53,10 +53,10 @@ function xe(e) {
53
53
  renderingMode: t,
54
54
  initialArgs: a,
55
55
  outputs: Object.fromEntries(
56
- Object.entries(r).map(([c, f]) => [c, m(f)])
56
+ Object.entries(r).map(([c, f]) => [c, p(f)])
57
57
  ),
58
- inputsValid: m(o),
59
- sections: m(i),
58
+ inputsValid: p(o),
59
+ sections: p(i),
60
60
  initialUiState: void 0,
61
61
  code: s
62
62
  };
@@ -71,10 +71,10 @@ function xe(e) {
71
71
  renderingMode: r,
72
72
  initialArgs: a,
73
73
  outputs: Object.fromEntries(
74
- Object.entries(o).map(([c, f]) => [c, m(f)])
74
+ Object.entries(o).map(([c, f]) => [c, p(f)])
75
75
  ),
76
- inputsValid: m(t),
77
- sections: m(i),
76
+ inputsValid: p(t),
77
+ sections: p(i),
78
78
  initialUiState: void 0,
79
79
  code: s
80
80
  };
@@ -85,11 +85,11 @@ function xe(e) {
85
85
  );
86
86
  }
87
87
  }
88
- const Pe = p.object({
88
+ const Pe = m.object({
89
89
  /** Included left border. */
90
- from: p.number(),
90
+ from: m.number(),
91
91
  /** Excluded right border. */
92
- to: p.number()
92
+ to: m.number()
93
93
  });
94
94
  function Ee(e, n) {
95
95
  if (!(e == null || n == null))
@@ -221,7 +221,7 @@ function Ve(e) {
221
221
  }
222
222
  }
223
223
  }
224
- function Ie(e) {
224
+ function Fe(e) {
225
225
  switch (e.type) {
226
226
  case "Json": {
227
227
  const n = {};
@@ -255,7 +255,7 @@ function Ie(e) {
255
255
  }
256
256
  }
257
257
  }
258
- function je(e, n) {
258
+ function Ie(e, n) {
259
259
  if (e !== void 0)
260
260
  switch (e.type) {
261
261
  case "Json":
@@ -285,13 +285,13 @@ function je(e, n) {
285
285
  }
286
286
  }
287
287
  }
288
- const q = -2147483648, x = -9007199254740991n, Fe = NaN, Je = NaN, T = null, z = null;
288
+ const q = -2147483648, k = -9007199254740991n, je = NaN, Je = NaN, T = null, z = null;
289
289
  function b(e, n) {
290
290
  switch (n) {
291
291
  case "Int":
292
292
  return e === q;
293
293
  case "Long":
294
- return e === Number(x) || e === x;
294
+ return e === Number(k) || e === k;
295
295
  case "Float":
296
296
  return Number.isNaN(e);
297
297
  case "Double":
@@ -829,11 +829,11 @@ function tn(e) {
829
829
  };
830
830
  return e.domain !== void 0 && (n.domain = e.domain), d(e) && (n.axesSpec = C(e.axesSpec)), h(n);
831
831
  }
832
- const rn = { href: "/" }, on = p.object({
833
- __isRef: p.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),
834
- blockId: p.string().describe("Upstream block id"),
835
- name: p.string().describe("Name of the output provided to the upstream block's output context"),
836
- requireEnrichments: p.literal(!0).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")
832
+ const rn = { href: "/" }, on = m.object({
833
+ __isRef: m.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),
834
+ blockId: m.string().describe("Upstream block id"),
835
+ name: m.string().describe("Name of the output provided to the upstream block's output context"),
836
+ requireEnrichments: m.literal(!0).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")
837
837
  }).describe(
838
838
  "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."
839
839
  ).readonly();
@@ -905,23 +905,23 @@ function $(e, n, t) {
905
905
  c += "=";
906
906
  return c;
907
907
  }
908
- const V = 15, de = 24, I = p.string().length(de).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
908
+ const V = 15, de = 24, F = m.string().length(de).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
909
909
  function dn() {
910
910
  const e = new Uint8Array(V);
911
- return crypto.getRandomValues(e), I.parse($(e, "RFC4648"));
911
+ return crypto.getRandomValues(e), F.parse($(e, "RFC4648"));
912
912
  }
913
913
  function le(e) {
914
914
  if (e.length !== V) throw new Error(`Wrong number of bytes: ${e.length}`);
915
- return I.parse($(e, "RFC4648"));
915
+ return F.parse($(e, "RFC4648"));
916
916
  }
917
917
  async function ln(e) {
918
918
  const n = new TextEncoder(), t = await crypto.subtle.digest("SHA-256", n.encode(e));
919
919
  return le(new Uint8Array(t.slice(0, 15)));
920
920
  }
921
- function pn(e) {
921
+ function mn(e) {
922
922
  return JSON.stringify(e);
923
923
  }
924
- function mn(e) {
924
+ function pn(e) {
925
925
  return h(e);
926
926
  }
927
927
  function yn(e) {
@@ -942,13 +942,22 @@ class gn extends Error {
942
942
  function bn(e) {
943
943
  return e instanceof Error && e.name === "AbortError";
944
944
  }
945
- function pe(e) {
946
- return e instanceof Error ? e.name === "AbortError" || pe(e.cause) : !1;
945
+ function me(e) {
946
+ return e instanceof Error ? e.name === "AbortError" || me(e.cause) : !1;
947
947
  }
948
948
  function wn(e) {
949
949
  return e instanceof Error && e.name === "AggregateError";
950
950
  }
951
- function me(e) {
951
+ class An extends Error {
952
+ constructor() {
953
+ super(...arguments);
954
+ l(this, "name", "PFrameError");
955
+ }
956
+ }
957
+ function xn(e) {
958
+ return e instanceof Error && e.name === "PFrameError";
959
+ }
960
+ function pe(e) {
952
961
  if (typeof e == "string")
953
962
  return `String value was thrown: ${e}`;
954
963
  if (e && typeof e == "object")
@@ -959,15 +968,15 @@ function me(e) {
959
968
  }
960
969
  return `Non-Error value (${typeof e}) was thrown: ${e}`;
961
970
  }
962
- function k(e) {
963
- return e instanceof Error ? e : new Error(me(e));
971
+ function x(e) {
972
+ return e instanceof Error ? e : new Error(pe(e));
964
973
  }
965
- function j(e) {
966
- const n = e.cause ? j(e.cause) : void 0, t = new Error(e.message, n !== void 0 ? { cause: n } : void 0);
974
+ function I(e) {
975
+ const n = e.cause ? I(e.cause) : void 0, t = new Error(e.message, n !== void 0 ? { cause: n } : void 0);
967
976
  return t.name = e.name || "Error", t.stack = e.stack, t;
968
977
  }
969
- function F(e) {
970
- const n = k(e), t = n.cause ? F(n.cause) : void 0;
978
+ function j(e) {
979
+ const n = x(e), t = n.cause ? j(n.cause) : void 0;
971
980
  return {
972
981
  name: n.name,
973
982
  message: n.message,
@@ -975,47 +984,47 @@ function F(e) {
975
984
  ...n.cause !== void 0 && { cause: t }
976
985
  };
977
986
  }
978
- function An(e) {
987
+ function kn(e) {
979
988
  if (e.error)
980
989
  throw e.error;
981
990
  return e.value;
982
991
  }
983
992
  function J(e) {
984
- return e.error ? { error: F(e.error) } : { value: e.value };
985
- }
986
- function kn(e) {
987
993
  return e.error ? { error: j(e.error) } : { value: e.value };
988
994
  }
995
+ function Pn(e) {
996
+ return e.error ? { error: I(e.error) } : { value: e.value };
997
+ }
989
998
  function ye(e) {
990
999
  try {
991
1000
  return { value: e() };
992
1001
  } catch (n) {
993
- return { error: k(n) };
1002
+ return { error: x(n) };
994
1003
  }
995
1004
  }
996
1005
  async function he(e) {
997
1006
  try {
998
1007
  return { value: await e() };
999
1008
  } catch (n) {
1000
- return { error: k(n) };
1009
+ return { error: x(n) };
1001
1010
  }
1002
1011
  }
1003
- function xn(e) {
1012
+ function En(e) {
1004
1013
  const n = ye(e);
1005
1014
  return J(n);
1006
1015
  }
1007
- async function Pn(e) {
1016
+ async function Sn(e) {
1008
1017
  const n = await he(e);
1009
1018
  return J(n);
1010
1019
  }
1011
- const En = ["supportsLazyState"], Sn = ["requiresUIAPIVersion", "requiresModelAPIVersion"];
1012
- function vn(e, n, t = !0) {
1020
+ const vn = ["supportsLazyState"], Nn = ["requiresUIAPIVersion", "requiresModelAPIVersion"];
1021
+ function On(e, n, t = !0) {
1013
1022
  return e === void 0 ? !1 : e[n] === t;
1014
1023
  }
1015
- function Nn(e) {
1024
+ function Cn(e) {
1016
1025
  return e === void 0 ? /* @__PURE__ */ new Set() : new Set(Object.entries(e).filter(([n, t]) => n.startsWith("requires") && t === !0).map(([n]) => n));
1017
1026
  }
1018
- function On(e) {
1027
+ function $n(e) {
1019
1028
  return e === void 0 ? /* @__PURE__ */ new Set() : new Set(Object.entries(e).filter(([n, t]) => n.startsWith("supports") && t === !0).map(([n]) => n));
1020
1029
  }
1021
1030
  class ge extends Error {
@@ -1025,7 +1034,7 @@ class ge extends Error {
1025
1034
  this.incompatibleFlags = t;
1026
1035
  }
1027
1036
  }
1028
- class Cn {
1037
+ class Vn {
1029
1038
  constructor() {
1030
1039
  l(this, "supportedRequirements", /* @__PURE__ */ new Map());
1031
1040
  }
@@ -1074,45 +1083,46 @@ class Cn {
1074
1083
  }
1075
1084
  export {
1076
1085
  hn as AbortError,
1077
- Sn as AllRequiresFeatureFlags,
1078
- En as AllSupportsFeatureFlags,
1086
+ Nn as AllRequiresFeatureFlags,
1087
+ vn as AllSupportsFeatureFlags,
1079
1088
  He as AnchoredIdDeriver,
1080
1089
  rn as DefaultNavigationState,
1081
1090
  ge as IncompatibleFlagsError,
1091
+ An as PFrameError,
1082
1092
  Y as PTableAbsent,
1083
1093
  Z as PTableNA,
1084
1094
  z as PValueBytesNA,
1085
1095
  Je as PValueDoubleNA,
1086
- Fe as PValueFloatNA,
1096
+ je as PValueFloatNA,
1087
1097
  q as PValueIntNA,
1088
- x as PValueLongNA,
1098
+ k as PValueLongNA,
1089
1099
  T as PValueStringNA,
1090
- I as PlId,
1100
+ F as PlId,
1091
1101
  V as PlIdBytes,
1092
1102
  de as PlIdLength,
1093
1103
  on as PlRef,
1094
1104
  Pe as RangeBytes,
1095
- Cn as RuntimeCapabilities,
1105
+ Vn as RuntimeCapabilities,
1096
1106
  gn as UiError,
1097
1107
  _e as canonicalizeAxisId,
1098
- mn as canonicalizeJson,
1099
- vn as checkBlockFlag,
1108
+ pn as canonicalizeJson,
1109
+ On as checkBlockFlag,
1100
1110
  an as createPlRef,
1101
1111
  Ve as dataInfoToEntries,
1102
1112
  tn as deriveNativeId,
1103
- j as deserializeError,
1104
- kn as deserializeResult,
1113
+ I as deserializeError,
1114
+ Pn as deserializeResult,
1105
1115
  ln as digestPlId,
1106
- k as ensureError,
1116
+ x as ensureError,
1107
1117
  Re as ensureNotNAPValue,
1108
1118
  Ye as ensurePColumn,
1109
- Ie as entriesToDataInfo,
1119
+ Fe as entriesToDataInfo,
1110
1120
  w as executePSpecPredicate,
1111
1121
  en as extractAllColumns,
1112
- Nn as extractAllRequirements,
1113
- On as extractAllSupports,
1114
- ke as extractCodeWithInfo,
1115
- xe as extractConfigGeneric,
1122
+ Cn as extractAllRequirements,
1123
+ $n as extractAllSupports,
1124
+ xe as extractCodeWithInfo,
1125
+ ke as extractConfigGeneric,
1116
1126
  C as getAxesId,
1117
1127
  y as getAxisId,
1118
1128
  Me as getColumnIdAndSpec,
@@ -1120,7 +1130,7 @@ export {
1120
1130
  K as getFilePathFromHandle,
1121
1131
  Ke as getPColumnSpecId,
1122
1132
  Te as getPTableColumnId,
1123
- pe as hasAbortError,
1133
+ me as hasAbortError,
1124
1134
  bn as isAbortError,
1125
1135
  wn as isAggregateError,
1126
1136
  Oe as isDataInfo,
@@ -1134,6 +1144,7 @@ export {
1134
1144
  Qe as isPColumnResult,
1135
1145
  d as isPColumnSpec,
1136
1146
  Xe as isPColumnSpecResult,
1147
+ xn as isPFrameError,
1137
1148
  Be as isPTableAbsent,
1138
1149
  W as isPValue,
1139
1150
  $e as isPartitionedDataInfoEntries,
@@ -1141,7 +1152,7 @@ export {
1141
1152
  Q as isValueAbsent,
1142
1153
  b as isValueNA,
1143
1154
  Ce as mapDataInfo,
1144
- je as mapDataInfoEntries,
1155
+ Ie as mapDataInfoEntries,
1145
1156
  g as mapJoinEntry,
1146
1157
  Ze as mapPObjectData,
1147
1158
  qe as mapPTableDef,
@@ -1160,17 +1171,17 @@ export {
1160
1171
  We as resolveAnchors,
1161
1172
  G as safeConvertToPValue,
1162
1173
  nn as selectorsToPredicate,
1163
- F as serializeError,
1174
+ j as serializeError,
1164
1175
  J as serializeResult,
1165
1176
  te as stringifyColumnId,
1166
- pn as stringifyJson,
1177
+ mn as stringifyJson,
1167
1178
  De as toJsonSafePValue,
1168
1179
  dn as uniquePlId,
1169
- An as unwrapResult,
1180
+ kn as unwrapResult,
1170
1181
  Se as validateRangeBytes,
1171
1182
  un as withEnrichments,
1172
- xn as wrapAndSerialize,
1173
- Pn as wrapAndSerializeAsync,
1183
+ En as wrapAndSerialize,
1184
+ Sn as wrapAndSerializeAsync,
1174
1185
  he as wrapAsyncCallback,
1175
1186
  ye as wrapCallback
1176
1187
  };