@milaboratories/pl-model-common 1.8.0 → 1.9.0
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/drivers/pframe/data.d.ts +53 -0
- package/dist/drivers/pframe/data.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +242 -131
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/drivers/pframe/data.ts +196 -0
package/dist/index.mjs
CHANGED
|
@@ -1,198 +1,309 @@
|
|
|
1
|
-
import { z as
|
|
2
|
-
function
|
|
3
|
-
return
|
|
4
|
-
}
|
|
5
|
-
function c(
|
|
6
|
-
throw new Error("Unexpected object: " +
|
|
7
|
-
}
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
return
|
|
11
|
-
}
|
|
12
|
-
function
|
|
13
|
-
return
|
|
14
|
-
}
|
|
15
|
-
function
|
|
16
|
-
if (
|
|
17
|
-
const
|
|
18
|
-
return JSON.parse(decodeURIComponent(
|
|
19
|
-
} else if (
|
|
20
|
-
const
|
|
21
|
-
return JSON.parse(decodeURIComponent(
|
|
1
|
+
import { z as i } from "zod";
|
|
2
|
+
function R(t) {
|
|
3
|
+
return t !== void 0 && t.startsWith("log+live://log/");
|
|
4
|
+
}
|
|
5
|
+
function c(t) {
|
|
6
|
+
throw new Error("Unexpected object: " + t);
|
|
7
|
+
}
|
|
8
|
+
const p = "upload://upload/", d = "index://index/";
|
|
9
|
+
function y(t) {
|
|
10
|
+
return t.startsWith(p);
|
|
11
|
+
}
|
|
12
|
+
function b(t) {
|
|
13
|
+
return t.startsWith(d);
|
|
14
|
+
}
|
|
15
|
+
function g(t) {
|
|
16
|
+
if (b(t)) {
|
|
17
|
+
const n = t.slice(d.length);
|
|
18
|
+
return JSON.parse(decodeURIComponent(n)).path;
|
|
19
|
+
} else if (y(t)) {
|
|
20
|
+
const n = t.slice(p.length);
|
|
21
|
+
return JSON.parse(decodeURIComponent(n)).localPath;
|
|
22
22
|
}
|
|
23
|
-
c(
|
|
23
|
+
c(t);
|
|
24
|
+
}
|
|
25
|
+
function w(t) {
|
|
26
|
+
return t.replace(/^.*[\\/]/, "");
|
|
24
27
|
}
|
|
25
|
-
function
|
|
26
|
-
return
|
|
28
|
+
function O(t) {
|
|
29
|
+
return w(g(t));
|
|
30
|
+
}
|
|
31
|
+
const N = -2147483648, f = -9007199254740991n, P = NaN, h = NaN, E = null, x = null;
|
|
32
|
+
function u(t, n) {
|
|
33
|
+
switch (n) {
|
|
34
|
+
case "Int":
|
|
35
|
+
return t === N;
|
|
36
|
+
case "Long":
|
|
37
|
+
return t === Number(f) || t === f;
|
|
38
|
+
case "Float":
|
|
39
|
+
return t === P;
|
|
40
|
+
case "Double":
|
|
41
|
+
return t === h;
|
|
42
|
+
case "String":
|
|
43
|
+
return t === E;
|
|
44
|
+
case "Bytes":
|
|
45
|
+
return t === x;
|
|
46
|
+
default:
|
|
47
|
+
throw Error(`unsupported data type: ${n}`);
|
|
48
|
+
}
|
|
27
49
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
50
|
+
function _(t) {
|
|
51
|
+
if (!V(t)) throw new Error(`Expected not-NA PValue, got ${t}`);
|
|
52
|
+
return t;
|
|
30
53
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
54
|
+
function V(t, n) {
|
|
55
|
+
if (!n)
|
|
56
|
+
return typeof t == "string" || typeof t == "number" && isFinite(t) || typeof t == "bigint";
|
|
57
|
+
if (u(t, n)) return !1;
|
|
58
|
+
switch (n) {
|
|
34
59
|
case "Int":
|
|
35
|
-
return
|
|
60
|
+
return typeof t == "number";
|
|
36
61
|
case "Long":
|
|
37
|
-
return
|
|
62
|
+
return typeof t == "number" || typeof t == "bigint";
|
|
38
63
|
case "Float":
|
|
39
|
-
return
|
|
64
|
+
return typeof t == "number";
|
|
40
65
|
case "Double":
|
|
41
|
-
return
|
|
66
|
+
return typeof t == "number";
|
|
42
67
|
case "String":
|
|
43
|
-
return
|
|
68
|
+
return typeof t == "string";
|
|
44
69
|
case "Bytes":
|
|
45
|
-
|
|
70
|
+
throw Error("Bytes not yet supported");
|
|
46
71
|
default:
|
|
47
|
-
throw Error(`unsupported data type: ${
|
|
72
|
+
throw Error(`unsupported data type: ${n}`);
|
|
48
73
|
}
|
|
49
74
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
|
|
75
|
+
function I(t, n) {
|
|
76
|
+
if (!n)
|
|
77
|
+
return t === null || typeof t == "string" || typeof t == "number" || typeof t == "bigint";
|
|
78
|
+
if (u(t, n)) return !0;
|
|
79
|
+
switch (n) {
|
|
80
|
+
case "Int":
|
|
81
|
+
return typeof t == "number";
|
|
82
|
+
case "Long":
|
|
83
|
+
return typeof t == "number" || typeof t == "bigint";
|
|
84
|
+
case "Float":
|
|
85
|
+
return typeof t == "number";
|
|
86
|
+
case "Double":
|
|
87
|
+
return typeof t == "number";
|
|
88
|
+
case "String":
|
|
89
|
+
return typeof t == "string";
|
|
90
|
+
case "Bytes":
|
|
91
|
+
throw Error("Bytes not yet supported");
|
|
92
|
+
default:
|
|
93
|
+
throw Error(`unsupported data type: ${n}`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function j(t) {
|
|
97
|
+
if (t === null || typeof t == "string" || typeof t == "number") return t;
|
|
98
|
+
if (typeof t == "bigint") return { bigint: t.toString() };
|
|
99
|
+
throw new Error(`Type ${typeof t} (value ${t}) not yet supported.`);
|
|
100
|
+
}
|
|
101
|
+
function $(t, n) {
|
|
102
|
+
if (t === null || typeof t == "string" || typeof t == "number" || typeof t == "bigint") {
|
|
103
|
+
if (n && !u(t, n) && !I(t, n))
|
|
104
|
+
throw new Error(`Unexpected value type, got ${typeof t}, expected ${n}`);
|
|
105
|
+
return t;
|
|
106
|
+
}
|
|
107
|
+
if (typeof t == "object" && t !== null && "bigint" in t && typeof t.bigint == "string") {
|
|
108
|
+
if (n && n !== "Long")
|
|
109
|
+
throw new Error(`Unexpected value type, got serialized bigint, expected ${n}`);
|
|
110
|
+
return BigInt(t.bigint);
|
|
111
|
+
}
|
|
112
|
+
throw new Error(`Unsupported type ${typeof t} (value ${t}).`);
|
|
113
|
+
}
|
|
114
|
+
function H(t) {
|
|
115
|
+
if (t = A(t), t === null) throw new Error("Value is null");
|
|
116
|
+
return t;
|
|
117
|
+
}
|
|
118
|
+
function A(t) {
|
|
119
|
+
if (t = $(t), t === null) return null;
|
|
120
|
+
if (typeof t == "string") return t;
|
|
121
|
+
if (typeof t == "number") {
|
|
122
|
+
if (!isFinite(t)) throw new Error(`Value is not finite (${t})`);
|
|
123
|
+
return t;
|
|
124
|
+
}
|
|
125
|
+
if (typeof t == "bigint")
|
|
126
|
+
return Number(t);
|
|
127
|
+
throw new Error(`Unexpected value type: ${typeof t}`);
|
|
128
|
+
}
|
|
129
|
+
function k(t, n) {
|
|
130
|
+
const r = Math.floor(n / 8), e = 1 << 7 - n % 8;
|
|
131
|
+
return (t[r] & e) > 0;
|
|
132
|
+
}
|
|
133
|
+
const F = { type: "absent" }, S = null;
|
|
134
|
+
function J(t, n) {
|
|
135
|
+
if (k(t.absent, n)) return F;
|
|
136
|
+
const r = t.data[n], e = t.type;
|
|
137
|
+
if (u(r, e)) return S;
|
|
138
|
+
switch (e) {
|
|
139
|
+
case "Int":
|
|
140
|
+
return r;
|
|
141
|
+
case "Long":
|
|
142
|
+
return Number(r);
|
|
143
|
+
case "Float":
|
|
144
|
+
return r;
|
|
145
|
+
case "Double":
|
|
146
|
+
return r;
|
|
147
|
+
case "String":
|
|
148
|
+
return r;
|
|
149
|
+
case "Bytes":
|
|
150
|
+
throw Error("Bytes not yet supported");
|
|
151
|
+
default:
|
|
152
|
+
throw Error(`unsupported data type: ${e}`);
|
|
153
|
+
}
|
|
53
154
|
}
|
|
54
|
-
function
|
|
55
|
-
const { type:
|
|
56
|
-
return { type:
|
|
155
|
+
function B(t) {
|
|
156
|
+
const { type: n, name: r, domain: e } = t;
|
|
157
|
+
return { type: n, name: r, ...e && { domain: e } };
|
|
57
158
|
}
|
|
58
|
-
function
|
|
59
|
-
return
|
|
159
|
+
function W(t) {
|
|
160
|
+
return t.map(B);
|
|
60
161
|
}
|
|
61
|
-
function
|
|
62
|
-
if (
|
|
63
|
-
if (
|
|
64
|
-
for (const
|
|
65
|
-
if (
|
|
162
|
+
function C(t, n) {
|
|
163
|
+
if (t === void 0) return n === void 0;
|
|
164
|
+
if (n === void 0) return !0;
|
|
165
|
+
for (const r in n)
|
|
166
|
+
if (t[r] !== n[r]) return !1;
|
|
66
167
|
return !0;
|
|
67
168
|
}
|
|
68
|
-
function
|
|
69
|
-
return
|
|
169
|
+
function z(t, n) {
|
|
170
|
+
return t.name === n.name && C(t.domain, n.domain);
|
|
70
171
|
}
|
|
71
|
-
function
|
|
72
|
-
return { ...
|
|
172
|
+
function M(t, n) {
|
|
173
|
+
return { ...t, src: s(t.src, n) };
|
|
73
174
|
}
|
|
74
|
-
function
|
|
75
|
-
switch (
|
|
175
|
+
function s(t, n) {
|
|
176
|
+
switch (t.type) {
|
|
76
177
|
case "column":
|
|
77
178
|
return {
|
|
78
179
|
type: "column",
|
|
79
|
-
column: t
|
|
180
|
+
column: n(t.column)
|
|
80
181
|
};
|
|
81
182
|
case "inner":
|
|
82
183
|
case "full":
|
|
83
184
|
return {
|
|
84
|
-
type:
|
|
85
|
-
entries:
|
|
185
|
+
type: t.type,
|
|
186
|
+
entries: t.entries.map((r) => s(r, n))
|
|
86
187
|
};
|
|
87
188
|
case "outer":
|
|
88
189
|
return {
|
|
89
190
|
type: "outer",
|
|
90
|
-
primary:
|
|
91
|
-
secondary:
|
|
191
|
+
primary: s(t.primary, n),
|
|
192
|
+
secondary: t.secondary.map((r) => s(r, n))
|
|
92
193
|
};
|
|
93
194
|
default:
|
|
94
|
-
c(
|
|
195
|
+
c(t);
|
|
95
196
|
}
|
|
96
197
|
}
|
|
97
|
-
const
|
|
98
|
-
__isRef:
|
|
99
|
-
blockId:
|
|
100
|
-
name:
|
|
198
|
+
const q = { href: "/" }, G = i.object({
|
|
199
|
+
__isRef: i.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),
|
|
200
|
+
blockId: i.string().describe("Upstream block id"),
|
|
201
|
+
name: i.string().describe("Name of the output provided to the upstream block's output context")
|
|
101
202
|
}).describe(
|
|
102
203
|
"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."
|
|
103
204
|
).strict().readonly();
|
|
104
|
-
function
|
|
105
|
-
return
|
|
205
|
+
function K(t, n) {
|
|
206
|
+
return t.blockId === n.blockId && t.name === n.name;
|
|
106
207
|
}
|
|
107
|
-
function
|
|
108
|
-
return
|
|
208
|
+
function o(t) {
|
|
209
|
+
return t.kind === "PColumn";
|
|
109
210
|
}
|
|
110
|
-
function
|
|
111
|
-
return
|
|
211
|
+
function U(t) {
|
|
212
|
+
return o(t.spec);
|
|
112
213
|
}
|
|
113
|
-
function
|
|
114
|
-
return
|
|
214
|
+
function Q(t) {
|
|
215
|
+
return o(t.obj);
|
|
115
216
|
}
|
|
116
|
-
function
|
|
117
|
-
return
|
|
217
|
+
function X(t) {
|
|
218
|
+
return o(t.obj.spec);
|
|
118
219
|
}
|
|
119
|
-
function
|
|
120
|
-
if (!
|
|
121
|
-
return
|
|
220
|
+
function Y(t) {
|
|
221
|
+
if (!U(t)) throw new Error(`not a PColumn (kind = ${t.spec.kind})`);
|
|
222
|
+
return t;
|
|
122
223
|
}
|
|
123
|
-
function
|
|
124
|
-
return
|
|
125
|
-
...
|
|
126
|
-
data: t
|
|
224
|
+
function Z(t, n) {
|
|
225
|
+
return t === void 0 ? void 0 : {
|
|
226
|
+
...t,
|
|
227
|
+
data: n(t.data)
|
|
127
228
|
};
|
|
128
229
|
}
|
|
129
|
-
function
|
|
130
|
-
throw new Error("Unexpected object: " +
|
|
230
|
+
function D(t) {
|
|
231
|
+
throw new Error("Unexpected object: " + t);
|
|
131
232
|
}
|
|
132
|
-
function
|
|
133
|
-
switch (
|
|
233
|
+
function a(t, n) {
|
|
234
|
+
switch (t.type) {
|
|
134
235
|
case "and":
|
|
135
|
-
for (const
|
|
136
|
-
if (!
|
|
236
|
+
for (const r of t.operands)
|
|
237
|
+
if (!a(r, n)) return !1;
|
|
137
238
|
return !0;
|
|
138
239
|
case "or":
|
|
139
|
-
for (const
|
|
140
|
-
if (
|
|
240
|
+
for (const r of t.operands)
|
|
241
|
+
if (a(r, n)) return !0;
|
|
141
242
|
return !1;
|
|
142
243
|
case "not":
|
|
143
|
-
return !
|
|
244
|
+
return !a(t.operand, n);
|
|
144
245
|
case "name":
|
|
145
|
-
return
|
|
246
|
+
return o(n) && n.name === t.name;
|
|
146
247
|
case "name_pattern":
|
|
147
|
-
return
|
|
248
|
+
return o(n) && !!n.name.match(t.pattern);
|
|
148
249
|
case "annotation":
|
|
149
|
-
return
|
|
250
|
+
return o(n) && n.annotations !== void 0 && n.annotations[t.annotation] === t.value;
|
|
150
251
|
case "annotation_pattern":
|
|
151
|
-
return
|
|
252
|
+
return o(n) && n.annotations !== void 0 && n.annotations[t.annotation] !== void 0 && !!n.annotations[t.annotation].match(t.pattern);
|
|
152
253
|
case "has_axes":
|
|
153
|
-
return
|
|
154
|
-
(
|
|
155
|
-
(
|
|
156
|
-
([m,
|
|
254
|
+
return o(n) && t.axes.every(
|
|
255
|
+
(r) => n.axesSpec.some(
|
|
256
|
+
(e) => (r.type === void 0 || r.type === e.type) && (r.name === void 0 || r.name === e.name) && (r.domain === void 0 || Object.keys(r.domain).length === 0 || e.domain !== void 0 && Object.entries(r.domain).every(
|
|
257
|
+
([m, l]) => e.domain[m] === l
|
|
157
258
|
))
|
|
158
259
|
)
|
|
159
260
|
);
|
|
160
261
|
default:
|
|
161
|
-
|
|
262
|
+
D(t);
|
|
162
263
|
}
|
|
163
264
|
}
|
|
164
|
-
function
|
|
165
|
-
return
|
|
265
|
+
function T(t, n) {
|
|
266
|
+
return t.ok ? { ok: !0, value: n(t.value) } : t;
|
|
166
267
|
}
|
|
167
268
|
export {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
269
|
+
q as DefaultNavigationState,
|
|
270
|
+
S as PTableNA,
|
|
271
|
+
F as PTableNull,
|
|
272
|
+
x as PValueBytesNA,
|
|
273
|
+
h as PValueDoubleNA,
|
|
274
|
+
P as PValueFloatNA,
|
|
275
|
+
N as PValueIntNA,
|
|
276
|
+
f as PValueLongNA,
|
|
277
|
+
E as PValueStringNA,
|
|
278
|
+
G as PlRef,
|
|
279
|
+
_ as ensureNotNAPValue,
|
|
280
|
+
Y as ensurePColumn,
|
|
281
|
+
a as executePSpecPredicate,
|
|
282
|
+
W as getAxesId,
|
|
283
|
+
B as getAxisId,
|
|
284
|
+
O as getFileNameFromHandle,
|
|
285
|
+
g as getFilePathFromHandle,
|
|
286
|
+
b as isImportFileHandleIndex,
|
|
287
|
+
y as isImportFileHandleUpload,
|
|
288
|
+
R as isLiveLog,
|
|
289
|
+
V as isNotNAPValue,
|
|
290
|
+
U as isPColumn,
|
|
291
|
+
X as isPColumnResult,
|
|
292
|
+
o as isPColumnSpec,
|
|
293
|
+
Q as isPColumnSpecResult,
|
|
294
|
+
I as isPValue,
|
|
295
|
+
k as isValueAbsent,
|
|
296
|
+
u as isValueNA,
|
|
297
|
+
s as mapJoinEntry,
|
|
298
|
+
Z as mapPObjectData,
|
|
299
|
+
M as mapPTableDef,
|
|
300
|
+
T as mapValueInVOE,
|
|
301
|
+
z as matchAxisId,
|
|
302
|
+
J as pTableValue,
|
|
303
|
+
H as pValueToStringOrNumber,
|
|
304
|
+
A as pValueToStringOrNumberOrNull,
|
|
305
|
+
K as plRefsEqual,
|
|
306
|
+
$ as safeConvertToPValue,
|
|
307
|
+
j as toJsonSafePValue
|
|
197
308
|
};
|
|
198
309
|
//# sourceMappingURL=index.mjs.map
|