@platforma-sdk/model 1.13.0 → 1.13.5
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/components/PlDataTable.d.ts +1 -1
- package/dist/components/PlDataTable.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +432 -423
- package/dist/index.mjs.map +1 -1
- package/dist/render/api.d.ts +5 -5
- package/dist/render/api.d.ts.map +1 -1
- package/dist/render/util/index.d.ts +1 -0
- package/dist/render/util/index.d.ts.map +1 -1
- package/dist/render/util/label.d.ts +4 -0
- package/dist/render/util/label.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/PlDataTable.ts +6 -2
- package/src/render/api.ts +6 -6
- package/src/render/util/index.ts +2 -1
- package/src/render/util/label.ts +11 -7
package/dist/index.mjs
CHANGED
|
@@ -1,252 +1,252 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { isPColumn as W, mapPObjectData as L, mapValueInVOE as
|
|
1
|
+
var ce = Object.defineProperty;
|
|
2
|
+
var de = (t, e, n) => e in t ? ce(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var v = (t, e, n) => de(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { isPColumn as W, mapPObjectData as L, mapValueInVOE as pe, ensurePColumn as fe, isPColumnSpec as he, mapPTableDef as ge, getAxisId as J, matchAxisId as me } from "@milaboratories/pl-model-common";
|
|
5
5
|
export * from "@milaboratories/pl-model-common";
|
|
6
6
|
import { z as P } from "zod";
|
|
7
|
-
class
|
|
8
|
-
constructor(
|
|
9
|
-
super(`${
|
|
7
|
+
class ye extends Error {
|
|
8
|
+
constructor(e, n) {
|
|
9
|
+
super(`${e.length}${n ? "+" : ""} errors, first error: ` + e[0]), this.errors = e, this.moreErrors = n;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
if (!
|
|
14
|
-
return
|
|
12
|
+
function be(t) {
|
|
13
|
+
if (!t.ok) throw new ye(t.errors, t.moreErrors);
|
|
14
|
+
return t.value;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
return new Proxy(
|
|
18
|
-
get(
|
|
19
|
-
return
|
|
16
|
+
function je(t) {
|
|
17
|
+
return new Proxy(t, {
|
|
18
|
+
get(e, n) {
|
|
19
|
+
return be(e[n]);
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
-
function p(
|
|
24
|
-
return typeof
|
|
23
|
+
function p(t) {
|
|
24
|
+
return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ? k(t) : t;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
return { type: "GetFromCtx", variable:
|
|
26
|
+
function R(t) {
|
|
27
|
+
return { type: "GetFromCtx", variable: t };
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function Ne(t) {
|
|
30
30
|
return {
|
|
31
31
|
type: "Isolate",
|
|
32
|
-
cfg:
|
|
32
|
+
cfg: t
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
function k(
|
|
37
|
-
return { type: "Immediate", value:
|
|
35
|
+
const Me = R("$args"), Be = R("$it"), Ue = R("$prod"), Je = R("$staging"), $e = R("$ui");
|
|
36
|
+
function k(t) {
|
|
37
|
+
return { type: "Immediate", value: t };
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
const
|
|
41
|
-
for (const [n, r] of Object.entries(
|
|
39
|
+
function ne(t) {
|
|
40
|
+
const e = {};
|
|
41
|
+
for (const [n, r] of Object.entries(t)) e[n] = p(r);
|
|
42
42
|
return {
|
|
43
43
|
type: "MakeObject",
|
|
44
|
-
template:
|
|
44
|
+
template: e
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
const
|
|
49
|
-
for (const n of
|
|
47
|
+
function Ke(...t) {
|
|
48
|
+
const e = [];
|
|
49
|
+
for (const n of t) e.push(p(n));
|
|
50
50
|
return {
|
|
51
51
|
type: "MakeArray",
|
|
52
|
-
template:
|
|
52
|
+
template: e
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
function x(
|
|
55
|
+
function x(t, e) {
|
|
56
56
|
return {
|
|
57
57
|
type: "GetJsonField",
|
|
58
|
-
source: p(
|
|
59
|
-
field: p(
|
|
58
|
+
source: p(t),
|
|
59
|
+
field: p(e)
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function Ge(t, e, n = "$it") {
|
|
63
63
|
return {
|
|
64
64
|
type: "MapRecordValues",
|
|
65
|
-
source:
|
|
66
|
-
mapping:
|
|
65
|
+
source: t,
|
|
66
|
+
mapping: e,
|
|
67
67
|
itVar: n
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function He(t, e, n = "$it") {
|
|
71
71
|
return {
|
|
72
72
|
type: "MapArrayValues",
|
|
73
|
-
source:
|
|
74
|
-
mapping:
|
|
73
|
+
source: t,
|
|
74
|
+
mapping: e,
|
|
75
75
|
itVar: n
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function We(t) {
|
|
79
79
|
return {
|
|
80
80
|
type: "Flatten",
|
|
81
|
-
source:
|
|
81
|
+
source: t
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function qe(t) {
|
|
85
85
|
return {
|
|
86
86
|
type: "IsEmpty",
|
|
87
|
-
arg:
|
|
87
|
+
arg: t
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function ze(t) {
|
|
91
91
|
return {
|
|
92
92
|
type: "Not",
|
|
93
|
-
operand:
|
|
93
|
+
operand: t
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function Ye(t, e) {
|
|
97
97
|
return {
|
|
98
98
|
type: "And",
|
|
99
|
-
operand1:
|
|
100
|
-
operand2:
|
|
99
|
+
operand1: t,
|
|
100
|
+
operand2: e
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function Xe(t, e) {
|
|
104
104
|
return {
|
|
105
105
|
type: "Or",
|
|
106
|
-
operand1:
|
|
107
|
-
operand2:
|
|
106
|
+
operand1: t,
|
|
107
|
+
operand2: e
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function Qe(t, e) {
|
|
111
111
|
return {
|
|
112
112
|
type: "GetResourceField",
|
|
113
|
-
source: p(
|
|
114
|
-
field: p(
|
|
113
|
+
source: p(t),
|
|
114
|
+
field: p(e)
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
return function(
|
|
117
|
+
function Ze() {
|
|
118
|
+
return function(t) {
|
|
119
119
|
return {
|
|
120
120
|
type: "GetResourceValueAsJson",
|
|
121
|
-
source: p(
|
|
121
|
+
source: p(t)
|
|
122
122
|
};
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function et(t, e, n = "$it") {
|
|
126
126
|
return {
|
|
127
127
|
type: "MapResourceFields",
|
|
128
|
-
source:
|
|
129
|
-
mapping:
|
|
128
|
+
source: t,
|
|
129
|
+
mapping: e,
|
|
130
130
|
itVar: n
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function tt(t) {
|
|
134
134
|
return {
|
|
135
135
|
type: "GetBlobContent",
|
|
136
|
-
source: p(
|
|
136
|
+
source: p(t)
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function nt(t) {
|
|
140
140
|
return {
|
|
141
141
|
type: "GetBlobContentAsString",
|
|
142
|
-
source: p(
|
|
142
|
+
source: p(t)
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
|
-
function
|
|
146
|
-
return function(
|
|
145
|
+
function rt() {
|
|
146
|
+
return function(t) {
|
|
147
147
|
return {
|
|
148
148
|
type: "GetBlobContentAsJson",
|
|
149
|
-
source: p(
|
|
149
|
+
source: p(t)
|
|
150
150
|
};
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function st(t) {
|
|
154
154
|
return {
|
|
155
155
|
type: "GetDownloadedBlobContent",
|
|
156
|
-
source: p(
|
|
156
|
+
source: p(t)
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function it(t) {
|
|
160
160
|
return {
|
|
161
161
|
type: "GetOnDemandBlobContent",
|
|
162
|
-
source: p(
|
|
162
|
+
source: p(t)
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function ot(t) {
|
|
166
166
|
return {
|
|
167
167
|
type: "GetImportProgress",
|
|
168
|
-
source: p(
|
|
168
|
+
source: p(t)
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function at(t, e) {
|
|
172
172
|
return {
|
|
173
173
|
type: "GetLastLogs",
|
|
174
|
-
source: p(
|
|
175
|
-
lines:
|
|
174
|
+
source: p(t),
|
|
175
|
+
lines: e
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function lt(t, e) {
|
|
179
179
|
return {
|
|
180
180
|
type: "GetProgressLog",
|
|
181
|
-
source: p(
|
|
182
|
-
patternToSearch:
|
|
181
|
+
source: p(t),
|
|
182
|
+
patternToSearch: e
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function ut(t) {
|
|
186
186
|
return {
|
|
187
187
|
type: "GetLogHandle",
|
|
188
|
-
source: p(
|
|
188
|
+
source: p(t)
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function _e() {
|
|
192
192
|
return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
if (
|
|
196
|
-
return globalThis.getPlatforma(
|
|
194
|
+
function re(t) {
|
|
195
|
+
if (t && typeof globalThis.getPlatforma == "function")
|
|
196
|
+
return globalThis.getPlatforma(t);
|
|
197
197
|
if (typeof globalThis.platforma < "u") return globalThis.platforma;
|
|
198
198
|
throw new Error("Can't get platforma instance.");
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function ve() {
|
|
201
201
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
202
202
|
}
|
|
203
203
|
function u() {
|
|
204
204
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
205
205
|
throw new Error("Not in config rendering context");
|
|
206
206
|
}
|
|
207
|
-
function O(
|
|
208
|
-
const n =
|
|
207
|
+
function O(t, e) {
|
|
208
|
+
const n = ve();
|
|
209
209
|
if (n === void 0) return !1;
|
|
210
|
-
if (
|
|
211
|
-
return n.callbackRegistry[
|
|
210
|
+
if (t in n.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
|
|
211
|
+
return n.callbackRegistry[t] = e, !0;
|
|
212
212
|
}
|
|
213
213
|
const N = /* @__PURE__ */ new Map();
|
|
214
|
-
function
|
|
215
|
-
|
|
216
|
-
for (const r of N.get(
|
|
214
|
+
function we(t, e) {
|
|
215
|
+
t in u().callbackRegistry || (u().callbackRegistry[t] = (n) => {
|
|
216
|
+
for (const r of N.get(t))
|
|
217
217
|
r(n);
|
|
218
|
-
}, N.set(
|
|
218
|
+
}, N.set(t, [])), N.get(t).push(e);
|
|
219
219
|
}
|
|
220
220
|
class g {
|
|
221
|
-
constructor(
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
this.handle =
|
|
221
|
+
constructor(e, n = (r) => r) {
|
|
222
|
+
v(this, "isResolved", !1);
|
|
223
|
+
v(this, "resolvedValue");
|
|
224
|
+
this.handle = e, this.postProcess = n, we(e, (r) => {
|
|
225
225
|
this.resolvedValue = n(r), this.isResolved = !0;
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
|
-
map(
|
|
229
|
-
return new g(this.handle, (n) =>
|
|
228
|
+
map(e) {
|
|
229
|
+
return new g(this.handle, (n) => e(this.postProcess(n)));
|
|
230
230
|
}
|
|
231
|
-
mapDefined(
|
|
231
|
+
mapDefined(e) {
|
|
232
232
|
return new g(this.handle, (n) => {
|
|
233
233
|
const r = this.postProcess(n);
|
|
234
|
-
return r ?
|
|
234
|
+
return r ? e(r) : void 0;
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
237
|
toJSON() {
|
|
238
238
|
return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
function X(
|
|
242
|
-
return
|
|
241
|
+
function X(t) {
|
|
242
|
+
return t === void 0 ? void 0 : new S(t);
|
|
243
243
|
}
|
|
244
|
-
class
|
|
245
|
-
constructor(
|
|
246
|
-
this.handle =
|
|
244
|
+
class S {
|
|
245
|
+
constructor(e) {
|
|
246
|
+
this.handle = e;
|
|
247
247
|
}
|
|
248
|
-
resolve(...
|
|
249
|
-
const n =
|
|
248
|
+
resolve(...e) {
|
|
249
|
+
const n = e.map(
|
|
250
250
|
(r) => ({
|
|
251
251
|
assertFieldType: "Input",
|
|
252
252
|
...typeof r == "string" ? { field: r } : r
|
|
@@ -254,8 +254,8 @@ class w {
|
|
|
254
254
|
);
|
|
255
255
|
return this.resolveWithCommon({}, ...n);
|
|
256
256
|
}
|
|
257
|
-
resolveOutput(...
|
|
258
|
-
const n =
|
|
257
|
+
resolveOutput(...e) {
|
|
258
|
+
const n = e.map(
|
|
259
259
|
(r) => ({
|
|
260
260
|
assertFieldType: "Output",
|
|
261
261
|
...typeof r == "string" ? { field: r } : r
|
|
@@ -263,8 +263,8 @@ class w {
|
|
|
263
263
|
);
|
|
264
264
|
return this.resolveWithCommon({}, ...n);
|
|
265
265
|
}
|
|
266
|
-
resolveInput(...
|
|
267
|
-
const n =
|
|
266
|
+
resolveInput(...e) {
|
|
267
|
+
const n = e.map(
|
|
268
268
|
(r) => ({
|
|
269
269
|
assertFieldType: "Input",
|
|
270
270
|
...typeof r == "string" ? { field: r } : r
|
|
@@ -272,11 +272,11 @@ class w {
|
|
|
272
272
|
);
|
|
273
273
|
return this.resolveWithCommon({}, ...n);
|
|
274
274
|
}
|
|
275
|
-
resolveAny(...
|
|
276
|
-
return this.resolveWithCommon({}, ...
|
|
275
|
+
resolveAny(...e) {
|
|
276
|
+
return this.resolveWithCommon({}, ...e);
|
|
277
277
|
}
|
|
278
|
-
resolveWithCommon(
|
|
279
|
-
return X(u().resolveWithCommon(this.handle,
|
|
278
|
+
resolveWithCommon(e, ...n) {
|
|
279
|
+
return X(u().resolveWithCommon(this.handle, e, ...n));
|
|
280
280
|
}
|
|
281
281
|
get resourceType() {
|
|
282
282
|
return u().getResourceType(this.handle);
|
|
@@ -305,14 +305,14 @@ class w {
|
|
|
305
305
|
listDynamicFields() {
|
|
306
306
|
return u().listDynamicFields(this.handle);
|
|
307
307
|
}
|
|
308
|
-
getKeyValueBase64(
|
|
309
|
-
return u().getKeyValueBase64(this.handle,
|
|
308
|
+
getKeyValueBase64(e) {
|
|
309
|
+
return u().getKeyValueBase64(this.handle, e);
|
|
310
310
|
}
|
|
311
|
-
getKeyValueAsString(
|
|
312
|
-
return u().getKeyValueAsString(this.handle,
|
|
311
|
+
getKeyValueAsString(e) {
|
|
312
|
+
return u().getKeyValueAsString(this.handle, e);
|
|
313
313
|
}
|
|
314
|
-
getKeyValueAsJson(
|
|
315
|
-
const n = this.getKeyValueAsString(
|
|
314
|
+
getKeyValueAsJson(e) {
|
|
315
|
+
const n = this.getKeyValueAsString(e);
|
|
316
316
|
if (n == null) throw new Error("Resource has no content.");
|
|
317
317
|
return JSON.parse(n);
|
|
318
318
|
}
|
|
@@ -323,15 +323,15 @@ class w {
|
|
|
323
323
|
return u().getDataAsString(this.handle);
|
|
324
324
|
}
|
|
325
325
|
getDataAsJson() {
|
|
326
|
-
const
|
|
327
|
-
if (
|
|
328
|
-
return JSON.parse(
|
|
326
|
+
const e = this.getDataAsString();
|
|
327
|
+
if (e == null) throw new Error("Resource has no content.");
|
|
328
|
+
return JSON.parse(e);
|
|
329
329
|
}
|
|
330
330
|
/**
|
|
331
331
|
*
|
|
332
332
|
*/
|
|
333
|
-
getPColumns(
|
|
334
|
-
const r = this.parsePObjectCollection(
|
|
333
|
+
getPColumns(e = !1, n = "") {
|
|
334
|
+
const r = this.parsePObjectCollection(e, n);
|
|
335
335
|
return r === void 0 ? void 0 : Object.entries(r).map(([, i]) => {
|
|
336
336
|
if (!W(i)) throw new Error(`not a PColumn (kind = ${i.spec.kind})`);
|
|
337
337
|
return i;
|
|
@@ -340,16 +340,16 @@ class w {
|
|
|
340
340
|
/**
|
|
341
341
|
*
|
|
342
342
|
*/
|
|
343
|
-
parsePObjectCollection(
|
|
343
|
+
parsePObjectCollection(e = !1, n = "") {
|
|
344
344
|
const r = u().parsePObjectCollection(
|
|
345
345
|
this.handle,
|
|
346
|
-
|
|
346
|
+
e,
|
|
347
347
|
n
|
|
348
348
|
);
|
|
349
349
|
if (r === void 0) return;
|
|
350
350
|
const s = {};
|
|
351
351
|
for (const [i, o] of Object.entries(r))
|
|
352
|
-
s[i] = L(o, (a) => new
|
|
352
|
+
s[i] = L(o, (a) => new S(a));
|
|
353
353
|
return s;
|
|
354
354
|
}
|
|
355
355
|
getFileContentAsBase64() {
|
|
@@ -361,7 +361,7 @@ class w {
|
|
|
361
361
|
getFileContentAsJson() {
|
|
362
362
|
return new g(
|
|
363
363
|
u().getBlobContentAsString(this.handle)
|
|
364
|
-
).mapDefined((
|
|
364
|
+
).mapDefined((e) => JSON.parse(e));
|
|
365
365
|
}
|
|
366
366
|
/**
|
|
367
367
|
* @deprecated use getFileContentAsBase64
|
|
@@ -402,17 +402,17 @@ class w {
|
|
|
402
402
|
getImportProgress() {
|
|
403
403
|
return new g(u().getImportProgress(this.handle));
|
|
404
404
|
}
|
|
405
|
-
getLastLogs(
|
|
406
|
-
return new g(u().getLastLogs(this.handle,
|
|
405
|
+
getLastLogs(e) {
|
|
406
|
+
return new g(u().getLastLogs(this.handle, e));
|
|
407
407
|
}
|
|
408
|
-
getProgressLog(
|
|
409
|
-
return new g(u().getProgressLog(this.handle,
|
|
408
|
+
getProgressLog(e) {
|
|
409
|
+
return new g(u().getProgressLog(this.handle, e));
|
|
410
410
|
}
|
|
411
411
|
getLogHandle() {
|
|
412
412
|
return new g(u().getLogHandle(this.handle));
|
|
413
413
|
}
|
|
414
|
-
allFieldsResolved(
|
|
415
|
-
switch (
|
|
414
|
+
allFieldsResolved(e = "Input") {
|
|
415
|
+
switch (e) {
|
|
416
416
|
case "Input":
|
|
417
417
|
return this.getInputsLocked() && this.listInputFields().every(
|
|
418
418
|
(n) => this.resolve({ field: n, assertFieldType: "Input" }) !== void 0
|
|
@@ -423,13 +423,13 @@ class w {
|
|
|
423
423
|
);
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
-
mapFields(
|
|
426
|
+
mapFields(e, n) {
|
|
427
427
|
const { fieldType: r, requireLocked: s, skipUnresolved: i } = {
|
|
428
428
|
fieldType: "Input",
|
|
429
429
|
requireLocked: !0,
|
|
430
430
|
skipUnresolved: !1,
|
|
431
431
|
...n
|
|
432
|
-
}, o =
|
|
432
|
+
}, o = e;
|
|
433
433
|
if (s && (r === "Input" && !this.getInputsLocked() || r === "Output" && !this.getOutputsLocked()))
|
|
434
434
|
return;
|
|
435
435
|
let l = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
|
|
@@ -438,64 +438,67 @@ class w {
|
|
|
438
438
|
return i && (l = l.filter((c) => c[1] !== void 0)), l.map(([c, f]) => o(c, f));
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
|
-
const
|
|
442
|
-
function
|
|
443
|
-
return typeof
|
|
441
|
+
const se = "staging", ie = "main";
|
|
442
|
+
function oe(t) {
|
|
443
|
+
return typeof t == "object" && t !== null && "__awaited_futures__" in t;
|
|
444
444
|
}
|
|
445
|
-
function $(
|
|
446
|
-
if (
|
|
447
|
-
if (
|
|
448
|
-
if (
|
|
445
|
+
function $(t, e, n) {
|
|
446
|
+
if (e.has(n)) return;
|
|
447
|
+
if (e.add(n), typeof n === "object")
|
|
448
|
+
if (oe(n)) n.__awaited_futures__.forEach((s) => t.add(s));
|
|
449
449
|
else if (Array.isArray(n))
|
|
450
|
-
for (const s of n) $(
|
|
450
|
+
for (const s of n) $(t, e, s);
|
|
451
451
|
else
|
|
452
452
|
for (const [, s] of Object.entries(n))
|
|
453
|
-
s !== n && $(
|
|
453
|
+
s !== n && $(t, e, s);
|
|
454
454
|
}
|
|
455
|
-
function
|
|
456
|
-
const
|
|
457
|
-
return $(
|
|
455
|
+
function Se(t) {
|
|
456
|
+
const e = /* @__PURE__ */ new Set();
|
|
457
|
+
return $(e, /* @__PURE__ */ new Set(), t), e;
|
|
458
458
|
}
|
|
459
|
-
const
|
|
459
|
+
const ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
460
460
|
__proto__: null,
|
|
461
|
-
MainAccessorName:
|
|
462
|
-
StagingAccessorName:
|
|
463
|
-
getAllFutureAwaits:
|
|
464
|
-
isFutureAwait:
|
|
465
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
461
|
+
MainAccessorName: ie,
|
|
462
|
+
StagingAccessorName: se,
|
|
463
|
+
getAllFutureAwaits: Se,
|
|
464
|
+
isFutureAwait: oe
|
|
465
|
+
}, Symbol.toStringTag, { value: "Module" })), Ae = "pl7.app/label", Pe = "pl7.app/trace", Ie = P.object({
|
|
466
466
|
type: P.string(),
|
|
467
467
|
importance: P.number().optional(),
|
|
468
468
|
id: P.string().optional(),
|
|
469
469
|
label: P.string()
|
|
470
|
-
}),
|
|
471
|
-
function
|
|
472
|
-
const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i =
|
|
470
|
+
}), Ce = P.array(Ie), Re = 1e-3, Te = "__LABEL__", Q = "__LABEL__@1";
|
|
471
|
+
function Fe(t, e, n = {}) {
|
|
472
|
+
const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i = t.map((d) => {
|
|
473
473
|
var z, Y;
|
|
474
|
-
const m =
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
474
|
+
const m = e(d), y = (z = m.annotations) == null ? void 0 : z[Ae], F = (Y = m.annotations) == null ? void 0 : Y[Pe], b = (F ? Ce.safeParse(JSON.parse(F)).data : void 0) ?? [];
|
|
475
|
+
if (y) {
|
|
476
|
+
const _ = { label: y, type: Te, importance: -2 };
|
|
477
|
+
n.addLabelAsSuffix ? b.push(_) : b.splice(0, 0, _);
|
|
478
|
+
}
|
|
479
|
+
const E = [], q = /* @__PURE__ */ new Map();
|
|
480
|
+
for (let _ = b.length - 1; _ >= 0; --_) {
|
|
481
|
+
const { type: V } = b[_], ue = b[_].importance ?? 0, j = (q.get(V) ?? 0) + 1;
|
|
482
|
+
q.set(V, j);
|
|
483
|
+
const I = `${V}@${j}`;
|
|
481
484
|
s.set(I, (s.get(I) ?? 0) + 1), r.set(
|
|
482
485
|
I,
|
|
483
486
|
Math.max(
|
|
484
487
|
r.get(I) ?? Number.NEGATIVE_INFINITY,
|
|
485
|
-
|
|
488
|
+
ue - (b.length - _) * Re
|
|
486
489
|
)
|
|
487
|
-
),
|
|
490
|
+
), E.push({ ...b[_], fullType: I, occurenceIndex: j });
|
|
488
491
|
}
|
|
489
|
-
return
|
|
492
|
+
return E.reverse(), {
|
|
490
493
|
value: d,
|
|
491
494
|
spec: m,
|
|
492
495
|
label: y,
|
|
493
|
-
fullTrace:
|
|
496
|
+
fullTrace: E
|
|
494
497
|
};
|
|
495
498
|
}), o = [], a = [], l = [...r];
|
|
496
499
|
l.sort(([, d], [, m]) => m - d);
|
|
497
500
|
for (const [d] of l)
|
|
498
|
-
d.endsWith("@1") || s.get(d) ===
|
|
501
|
+
d.endsWith("@1") || s.get(d) === t.length ? o.push(d) : a.push(d);
|
|
499
502
|
const c = (d) => i.map((m) => {
|
|
500
503
|
const y = m.fullTrace.filter((b) => d.has(b.fullType)).map((b) => b.label), F = n.separator ?? " / ";
|
|
501
504
|
return {
|
|
@@ -507,35 +510,35 @@ function Ft(e, t, n = {}) {
|
|
|
507
510
|
if (a.length !== 0) throw new Error("Assertion error.");
|
|
508
511
|
return c(new Set(Q));
|
|
509
512
|
}
|
|
510
|
-
let f = 0,
|
|
513
|
+
let f = 0, w = 0;
|
|
511
514
|
for (; f < o.length; ) {
|
|
512
515
|
const d = /* @__PURE__ */ new Set();
|
|
516
|
+
n.includeNativeLabel && d.add(Q);
|
|
513
517
|
for (let y = 0; y < f; ++y) d.add(o[y]);
|
|
514
|
-
d.add(o[
|
|
518
|
+
d.add(o[w]);
|
|
515
519
|
const m = c(d);
|
|
516
|
-
if (new Set(m.map((y) => y.label)).size ===
|
|
517
|
-
|
|
518
|
-
v++, v == o.length && (f++, v = f);
|
|
520
|
+
if (new Set(m.map((y) => y.label)).size === t.length) return m;
|
|
521
|
+
w++, w == o.length && (f++, w = f);
|
|
519
522
|
}
|
|
520
523
|
return c(/* @__PURE__ */ new Set([...o, ...a]));
|
|
521
524
|
}
|
|
522
|
-
class
|
|
525
|
+
class Oe {
|
|
523
526
|
constructor() {
|
|
524
|
-
|
|
525
|
-
|
|
527
|
+
v(this, "ctx", u());
|
|
528
|
+
v(this, "defaultLabelFn", (e, n) => {
|
|
526
529
|
var r;
|
|
527
|
-
return ((r =
|
|
530
|
+
return ((r = e.annotations) == null ? void 0 : r["pl7.app/label"]) ?? "Unlabelled";
|
|
528
531
|
});
|
|
529
532
|
}
|
|
530
533
|
/**
|
|
531
534
|
* @deprecated use getOptions()
|
|
532
535
|
*/
|
|
533
|
-
calculateOptions(
|
|
534
|
-
return this.ctx.calculateOptions(
|
|
536
|
+
calculateOptions(e) {
|
|
537
|
+
return this.ctx.calculateOptions(e);
|
|
535
538
|
}
|
|
536
|
-
getOptions(
|
|
537
|
-
const r = this.getSpecs().entries.filter((s) =>
|
|
538
|
-
return typeof n == "object" || typeof n > "u" ?
|
|
539
|
+
getOptions(e, n) {
|
|
540
|
+
const r = this.getSpecs().entries.filter((s) => e(s.obj));
|
|
541
|
+
return typeof n == "object" || typeof n > "u" ? Fe(r, (s) => s.obj, n ?? {}).map(
|
|
539
542
|
({ value: { ref: s }, label: i }) => ({
|
|
540
543
|
ref: s,
|
|
541
544
|
label: i
|
|
@@ -552,14 +555,14 @@ class Ot {
|
|
|
552
555
|
return this.getData();
|
|
553
556
|
}
|
|
554
557
|
getData() {
|
|
555
|
-
const
|
|
558
|
+
const e = this.ctx.getDataFromResultPool();
|
|
556
559
|
return {
|
|
557
|
-
isComplete:
|
|
558
|
-
entries:
|
|
560
|
+
isComplete: e.isComplete,
|
|
561
|
+
entries: e.entries.map((n) => ({
|
|
559
562
|
ref: n.ref,
|
|
560
563
|
obj: {
|
|
561
564
|
...n.obj,
|
|
562
|
-
data: new
|
|
565
|
+
data: new S(n.obj.data)
|
|
563
566
|
}
|
|
564
567
|
}))
|
|
565
568
|
};
|
|
@@ -571,14 +574,14 @@ class Ot {
|
|
|
571
574
|
return this.getDataWithErrors();
|
|
572
575
|
}
|
|
573
576
|
getDataWithErrors() {
|
|
574
|
-
const
|
|
577
|
+
const e = this.ctx.getDataWithErrorsFromResultPool();
|
|
575
578
|
return {
|
|
576
|
-
isComplete:
|
|
577
|
-
entries:
|
|
579
|
+
isComplete: e.isComplete,
|
|
580
|
+
entries: e.entries.map((n) => ({
|
|
578
581
|
ref: n.ref,
|
|
579
582
|
obj: {
|
|
580
583
|
...n.obj,
|
|
581
|
-
data:
|
|
584
|
+
data: pe(n.obj.data, (r) => new S(r))
|
|
582
585
|
}
|
|
583
586
|
}))
|
|
584
587
|
};
|
|
@@ -596,13 +599,13 @@ class Ot {
|
|
|
596
599
|
* @param ref a Ref
|
|
597
600
|
* @returns data associated with the ref
|
|
598
601
|
*/
|
|
599
|
-
getDataByRef(
|
|
602
|
+
getDataByRef(e) {
|
|
600
603
|
var n;
|
|
601
604
|
return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (n = this.getData().entries.find(
|
|
602
|
-
(r) => r.ref.blockId ===
|
|
605
|
+
(r) => r.ref.blockId === e.blockId && r.ref.name === e.name
|
|
603
606
|
)) == null ? void 0 : n.obj : L(
|
|
604
|
-
this.ctx.getDataFromResultPoolByRef(
|
|
605
|
-
(r) => new
|
|
607
|
+
this.ctx.getDataFromResultPoolByRef(e.blockId, e.name),
|
|
608
|
+
(r) => new S(r)
|
|
606
609
|
);
|
|
607
610
|
}
|
|
608
611
|
/**
|
|
@@ -610,37 +613,37 @@ class Ot {
|
|
|
610
613
|
* @param ref a Ref
|
|
611
614
|
* @returns p-column associated with the ref
|
|
612
615
|
*/
|
|
613
|
-
getPColumnByRef(
|
|
614
|
-
const n = this.getDataByRef(
|
|
616
|
+
getPColumnByRef(e) {
|
|
617
|
+
const n = this.getDataByRef(e);
|
|
615
618
|
if (n)
|
|
616
|
-
return
|
|
619
|
+
return fe(n);
|
|
617
620
|
}
|
|
618
621
|
/**
|
|
619
622
|
* @param ref a Ref
|
|
620
623
|
* @returns object spec associated with the ref
|
|
621
624
|
*/
|
|
622
|
-
getSpecByRef(
|
|
625
|
+
getSpecByRef(e) {
|
|
623
626
|
var n;
|
|
624
627
|
return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (n = this.getSpecs().entries.find(
|
|
625
|
-
(r) => r.ref.blockId ===
|
|
626
|
-
)) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(
|
|
628
|
+
(r) => r.ref.blockId === e.blockId && r.ref.name === e.name
|
|
629
|
+
)) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(e.blockId, e.name);
|
|
627
630
|
}
|
|
628
631
|
/**
|
|
629
632
|
* @param spec object specification
|
|
630
633
|
* @returns array of data objects with compatible specs
|
|
631
634
|
* @deprecated delete this method after Jan 1, 2025
|
|
632
635
|
*/
|
|
633
|
-
findDataWithCompatibleSpec(
|
|
636
|
+
findDataWithCompatibleSpec(e) {
|
|
634
637
|
const n = [];
|
|
635
|
-
|
|
636
|
-
if (!
|
|
638
|
+
e: for (const r of this.getData().entries) {
|
|
639
|
+
if (!he(r.obj.spec))
|
|
637
640
|
continue;
|
|
638
641
|
const s = r.obj.spec;
|
|
639
|
-
if (
|
|
640
|
-
for (let i = 0; i <
|
|
641
|
-
const o =
|
|
642
|
+
if (e.name === s.name && e.valueType === s.valueType && e.axesSpec.length === s.axesSpec.length && K(e.domain, s.domain)) {
|
|
643
|
+
for (let i = 0; i < e.axesSpec.length; ++i) {
|
|
644
|
+
const o = e.axesSpec[i], a = s.axesSpec[i];
|
|
642
645
|
if (o.name !== a.name || o.type !== a.type || !K(o.domain, a.domain))
|
|
643
|
-
continue
|
|
646
|
+
continue e;
|
|
644
647
|
}
|
|
645
648
|
n.push(r.obj);
|
|
646
649
|
}
|
|
@@ -648,27 +651,27 @@ class Ot {
|
|
|
648
651
|
return n;
|
|
649
652
|
}
|
|
650
653
|
}
|
|
651
|
-
function K(
|
|
652
|
-
if (
|
|
653
|
-
if (
|
|
654
|
-
for (const n in
|
|
655
|
-
if (
|
|
654
|
+
function K(t, e) {
|
|
655
|
+
if (t === void 0) return e === void 0;
|
|
656
|
+
if (e === void 0) return !0;
|
|
657
|
+
for (const n in e)
|
|
658
|
+
if (t[n] !== e[n]) return !1;
|
|
656
659
|
return !0;
|
|
657
660
|
}
|
|
658
661
|
class D {
|
|
659
662
|
constructor() {
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
663
|
+
v(this, "ctx");
|
|
664
|
+
v(this, "args");
|
|
665
|
+
v(this, "uiState");
|
|
666
|
+
v(this, "resultPool", new Oe());
|
|
664
667
|
this.ctx = u(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : void 0;
|
|
665
668
|
}
|
|
666
|
-
getNamedAccessor(
|
|
667
|
-
const n = this.ctx.getAccessorHandleByName(
|
|
668
|
-
return n ? new
|
|
669
|
+
getNamedAccessor(e) {
|
|
670
|
+
const n = this.ctx.getAccessorHandleByName(e);
|
|
671
|
+
return n ? new S(n) : void 0;
|
|
669
672
|
}
|
|
670
673
|
get prerun() {
|
|
671
|
-
return this.getNamedAccessor(
|
|
674
|
+
return this.getNamedAccessor(se);
|
|
672
675
|
}
|
|
673
676
|
/**
|
|
674
677
|
* @deprecated use prerun
|
|
@@ -683,7 +686,7 @@ class D {
|
|
|
683
686
|
return this.precalc;
|
|
684
687
|
}
|
|
685
688
|
get outputs() {
|
|
686
|
-
return this.getNamedAccessor(
|
|
689
|
+
return this.getNamedAccessor(ie);
|
|
687
690
|
}
|
|
688
691
|
/**
|
|
689
692
|
* @deprecated use outputs
|
|
@@ -695,12 +698,12 @@ class D {
|
|
|
695
698
|
* Find labels data for a given axis id. It will search for a label column and return its data as a map.
|
|
696
699
|
* @returns a map of axis value => label
|
|
697
700
|
*/
|
|
698
|
-
findLabels(
|
|
701
|
+
findLabels(e) {
|
|
699
702
|
const n = this.resultPool.getData();
|
|
700
703
|
for (const r of n.entries) {
|
|
701
704
|
if (!W(r.obj)) continue;
|
|
702
705
|
const s = r.obj.spec;
|
|
703
|
-
if (s.name === "pl7.app/label" && s.axesSpec.length === 1 && s.axesSpec[0].name ===
|
|
706
|
+
if (s.name === "pl7.app/label" && s.axesSpec.length === 1 && s.axesSpec[0].name === e.name && s.axesSpec[0].type === e.type && K(e.domain, s.axesSpec[0].domain)) {
|
|
704
707
|
if (r.obj.data.resourceType.name !== "PColumnData/Json")
|
|
705
708
|
throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
|
|
706
709
|
return new Map(
|
|
@@ -711,50 +714,50 @@ class D {
|
|
|
711
714
|
}
|
|
712
715
|
}
|
|
713
716
|
}
|
|
714
|
-
createPFrame(
|
|
715
|
-
return this.ctx.createPFrame(
|
|
717
|
+
createPFrame(e) {
|
|
718
|
+
return this.ctx.createPFrame(e.map((n) => L(n, (r) => r.handle)));
|
|
716
719
|
}
|
|
717
|
-
createPTable(
|
|
720
|
+
createPTable(e) {
|
|
718
721
|
var n;
|
|
719
|
-
return "columns" in
|
|
722
|
+
return "columns" in e ? n = {
|
|
720
723
|
src: {
|
|
721
724
|
type: "full",
|
|
722
|
-
entries:
|
|
725
|
+
entries: e.columns.map((r) => ({ type: "column", column: r }))
|
|
723
726
|
},
|
|
724
|
-
filters:
|
|
725
|
-
sorting:
|
|
726
|
-
} : n =
|
|
727
|
+
filters: e.filters ?? [],
|
|
728
|
+
sorting: e.sorting ?? []
|
|
729
|
+
} : n = e, this.ctx.createPTable(ge(n, (r) => L(r, (s) => s.handle)));
|
|
727
730
|
}
|
|
728
731
|
/** @deprecated scheduled for removal from SDK */
|
|
729
|
-
getBlockLabel(
|
|
730
|
-
return this.ctx.getBlockLabel(
|
|
732
|
+
getBlockLabel(e) {
|
|
733
|
+
return this.ctx.getBlockLabel(e);
|
|
731
734
|
}
|
|
732
735
|
getCurrentUnstableMarker() {
|
|
733
736
|
if (!(typeof this.ctx.getCurrentUnstableMarker > "u"))
|
|
734
737
|
return this.ctx.getCurrentUnstableMarker();
|
|
735
738
|
}
|
|
736
739
|
}
|
|
737
|
-
const
|
|
738
|
-
function
|
|
739
|
-
if (
|
|
740
|
-
switch (
|
|
740
|
+
const T = "PColumnData/", G = T + "ResourceMap", H = T + "Partitioned/ResourceMap", Z = T + "JsonPartitioned", M = T + "BinaryPartitioned", ae = T + "Partitioned/", ee = ae + "JsonPartitioned", B = ae + "BinaryPartitioned";
|
|
741
|
+
function le(t, e, n, r = [], s) {
|
|
742
|
+
if (t === void 0) return !1;
|
|
743
|
+
switch (t.resourceType.name) {
|
|
741
744
|
case G: {
|
|
742
|
-
let i =
|
|
743
|
-
for (const o of
|
|
744
|
-
const a =
|
|
745
|
+
let i = t.getInputsLocked();
|
|
746
|
+
for (const o of t.listInputFields()) {
|
|
747
|
+
const a = t.resolve({ field: o, assertFieldType: "Input" }), l = [...r, ...JSON.parse(o)], c = a === void 0 ? void 0 : e(a);
|
|
745
748
|
c === void 0 && (i = !1), (c !== void 0 || s) && n.push({ key: l, value: c });
|
|
746
749
|
}
|
|
747
750
|
return i;
|
|
748
751
|
}
|
|
749
752
|
case H: {
|
|
750
|
-
let i =
|
|
751
|
-
for (const o of
|
|
752
|
-
const a =
|
|
753
|
+
let i = t.getInputsLocked();
|
|
754
|
+
for (const o of t.listInputFields()) {
|
|
755
|
+
const a = t.resolve({ field: o, assertFieldType: "Input" });
|
|
753
756
|
if (a === void 0) i = !1;
|
|
754
757
|
else {
|
|
755
|
-
const l = [...r, ...JSON.parse(o)], c =
|
|
758
|
+
const l = [...r, ...JSON.parse(o)], c = le(
|
|
756
759
|
a,
|
|
757
|
-
|
|
760
|
+
e,
|
|
758
761
|
n,
|
|
759
762
|
l,
|
|
760
763
|
s
|
|
@@ -765,25 +768,25 @@ function lt(e, t, n, r = [], s) {
|
|
|
765
768
|
return i;
|
|
766
769
|
}
|
|
767
770
|
default:
|
|
768
|
-
throw new Error(`Unknown resource type: ${
|
|
771
|
+
throw new Error(`Unknown resource type: ${t.resourceType.name}`);
|
|
769
772
|
}
|
|
770
773
|
}
|
|
771
|
-
function
|
|
774
|
+
function dt(t, e, n = !1) {
|
|
772
775
|
const r = [];
|
|
773
|
-
return { isComplete:
|
|
776
|
+
return { isComplete: le(t, e, r, [], n), data: r };
|
|
774
777
|
}
|
|
775
|
-
const
|
|
776
|
-
if (!
|
|
777
|
-
if (
|
|
778
|
-
return
|
|
779
|
-
throw Error(`key must ends on .index/.values for binary p-column, got: ${
|
|
778
|
+
const te = (t) => {
|
|
779
|
+
if (!t.endsWith(".index")) {
|
|
780
|
+
if (t.endsWith(".values"))
|
|
781
|
+
return t.substring(0, t.length - 7);
|
|
782
|
+
throw Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
|
|
780
783
|
}
|
|
781
784
|
};
|
|
782
|
-
function
|
|
783
|
-
if (!
|
|
784
|
-
const
|
|
785
|
+
function De(t) {
|
|
786
|
+
if (!t) return;
|
|
787
|
+
const e = t.resourceType.name, n = t.getDataAsJson(), r = [];
|
|
785
788
|
let s = 0;
|
|
786
|
-
switch (
|
|
789
|
+
switch (e) {
|
|
787
790
|
case G:
|
|
788
791
|
s = n.keyLength;
|
|
789
792
|
break;
|
|
@@ -795,17 +798,17 @@ function Dt(e) {
|
|
|
795
798
|
s = n.partitionKeyLength;
|
|
796
799
|
break;
|
|
797
800
|
case B:
|
|
798
|
-
case
|
|
801
|
+
case ee:
|
|
799
802
|
s = n.superPartitionKeyLength + n.partitionKeyLength;
|
|
800
803
|
break;
|
|
801
804
|
}
|
|
802
|
-
switch (
|
|
805
|
+
switch (e) {
|
|
803
806
|
case G:
|
|
804
807
|
case Z:
|
|
805
808
|
case M:
|
|
806
|
-
for (let i of
|
|
807
|
-
if (
|
|
808
|
-
const a =
|
|
809
|
+
for (let i of t.listInputFields()) {
|
|
810
|
+
if (e === M) {
|
|
811
|
+
const a = te(i);
|
|
809
812
|
if (a) i = a;
|
|
810
813
|
else continue;
|
|
811
814
|
}
|
|
@@ -815,13 +818,13 @@ function Dt(e) {
|
|
|
815
818
|
break;
|
|
816
819
|
case H:
|
|
817
820
|
case B:
|
|
818
|
-
case
|
|
819
|
-
for (const i of
|
|
820
|
-
const o = [...JSON.parse(i)], a =
|
|
821
|
+
case ee:
|
|
822
|
+
for (const i of t.listInputFields()) {
|
|
823
|
+
const o = [...JSON.parse(i)], a = t.resolve({ field: i, assertFieldType: "Input" });
|
|
821
824
|
if (a !== void 0)
|
|
822
825
|
for (let l of a.listInputFields()) {
|
|
823
|
-
if (
|
|
824
|
-
const f =
|
|
826
|
+
if (e === B) {
|
|
827
|
+
const f = te(l);
|
|
825
828
|
if (f) l = f;
|
|
826
829
|
else continue;
|
|
827
830
|
}
|
|
@@ -833,10 +836,10 @@ function Dt(e) {
|
|
|
833
836
|
}
|
|
834
837
|
return { data: r, keyLength: s };
|
|
835
838
|
}
|
|
836
|
-
function
|
|
837
|
-
const
|
|
838
|
-
if (!
|
|
839
|
-
const { data: n, keyLength: r } =
|
|
839
|
+
function pt(t) {
|
|
840
|
+
const e = De(t);
|
|
841
|
+
if (!e) return;
|
|
842
|
+
const { data: n, keyLength: r } = e, s = [];
|
|
840
843
|
for (let i = 0; i < r; ++i)
|
|
841
844
|
s.push(/* @__PURE__ */ new Set());
|
|
842
845
|
for (const i of n) {
|
|
@@ -847,22 +850,22 @@ function pe(e) {
|
|
|
847
850
|
}
|
|
848
851
|
return s.map((i) => Array.from(i.values()));
|
|
849
852
|
}
|
|
850
|
-
const C = "1.13.
|
|
851
|
-
function
|
|
852
|
-
return
|
|
853
|
+
const C = "1.13.5";
|
|
854
|
+
function ke(t) {
|
|
855
|
+
return t.__renderLambda === !0;
|
|
853
856
|
}
|
|
854
|
-
function U(
|
|
855
|
-
if (
|
|
856
|
-
return
|
|
857
|
+
function U(t) {
|
|
858
|
+
if (t !== void 0)
|
|
859
|
+
return ke(t) ? t.handle : t;
|
|
857
860
|
}
|
|
858
|
-
function A(
|
|
859
|
-
if (
|
|
860
|
-
return typeof
|
|
861
|
+
function A(t) {
|
|
862
|
+
if (t !== void 0)
|
|
863
|
+
return typeof t == "string" ? { __renderLambda: !0, handle: t, retentive: !1 } : t;
|
|
861
864
|
}
|
|
862
|
-
function
|
|
863
|
-
if (
|
|
865
|
+
function ft(t) {
|
|
866
|
+
if (t.v3 !== void 0) {
|
|
864
867
|
const {
|
|
865
|
-
initialArgs:
|
|
868
|
+
initialArgs: e,
|
|
866
869
|
initialUiState: n,
|
|
867
870
|
inputsValid: r,
|
|
868
871
|
outputs: s,
|
|
@@ -870,9 +873,9 @@ function fe(e) {
|
|
|
870
873
|
sdkVersion: o,
|
|
871
874
|
sections: a,
|
|
872
875
|
title: l
|
|
873
|
-
} =
|
|
876
|
+
} = t.v3, { code: c } = t;
|
|
874
877
|
return {
|
|
875
|
-
initialArgs:
|
|
878
|
+
initialArgs: e,
|
|
876
879
|
initialUiState: n,
|
|
877
880
|
inputsValid: r,
|
|
878
881
|
outputs: s,
|
|
@@ -882,14 +885,14 @@ function fe(e) {
|
|
|
882
885
|
title: l,
|
|
883
886
|
code: c
|
|
884
887
|
};
|
|
885
|
-
} else if (
|
|
886
|
-
const { sdkVersion:
|
|
887
|
-
if (
|
|
888
|
+
} else if (t.inputsValid !== void 0) {
|
|
889
|
+
const { sdkVersion: e, renderingMode: n, outputs: r, inputsValid: s, sections: i, initialArgs: o, code: a } = t, l = Object.keys(t);
|
|
890
|
+
if (e === void 0 || n === void 0 || r === void 0 || s === void 0 || i === void 0 || o === void 0)
|
|
888
891
|
throw new Error(
|
|
889
|
-
`Malformed config v2. SDK version ${
|
|
892
|
+
`Malformed config v2. SDK version ${e}; Fields = ${l.join(", ")}`
|
|
890
893
|
);
|
|
891
894
|
return {
|
|
892
|
-
sdkVersion:
|
|
895
|
+
sdkVersion: e,
|
|
893
896
|
renderingMode: n,
|
|
894
897
|
initialArgs: o,
|
|
895
898
|
outputs: Object.fromEntries(
|
|
@@ -900,14 +903,14 @@ function fe(e) {
|
|
|
900
903
|
initialUiState: void 0,
|
|
901
904
|
code: a
|
|
902
905
|
};
|
|
903
|
-
} else if (
|
|
904
|
-
const { sdkVersion:
|
|
906
|
+
} else if (t.renderingMode !== void 0) {
|
|
907
|
+
const { sdkVersion: e, canRun: n, renderingMode: r, outputs: s, sections: i, initialArgs: o, code: a } = t, l = Object.keys(t);
|
|
905
908
|
if (r === void 0 || s === void 0 || n === void 0 || i === void 0 || o === void 0)
|
|
906
909
|
throw new Error(
|
|
907
|
-
`Malformed config v1. SDK version ${
|
|
910
|
+
`Malformed config v1. SDK version ${e}; Fields = ${l.join(", ")}`
|
|
908
911
|
);
|
|
909
912
|
return {
|
|
910
|
-
sdkVersion:
|
|
913
|
+
sdkVersion: e ?? "unknown",
|
|
911
914
|
renderingMode: r,
|
|
912
915
|
initialArgs: o,
|
|
913
916
|
outputs: Object.fromEntries(
|
|
@@ -919,19 +922,19 @@ function fe(e) {
|
|
|
919
922
|
code: a
|
|
920
923
|
};
|
|
921
924
|
} else {
|
|
922
|
-
const { sdkVersion:
|
|
925
|
+
const { sdkVersion: e } = t, n = Object.keys(t);
|
|
923
926
|
throw new Error(
|
|
924
|
-
`Config format not supported: SDK = ${
|
|
927
|
+
`Config format not supported: SDK = ${e}; Fields = ${n.join(", ")}`
|
|
925
928
|
);
|
|
926
929
|
}
|
|
927
930
|
}
|
|
928
931
|
class h {
|
|
929
|
-
constructor(
|
|
930
|
-
this._renderingMode =
|
|
932
|
+
constructor(e, n, r, s, i, o, a) {
|
|
933
|
+
this._renderingMode = e, this._initialArgs = n, this._initialUiState = r, this._outputs = s, this._inputsValid = i, this._sections = o, this._title = a;
|
|
931
934
|
}
|
|
932
|
-
static create(
|
|
935
|
+
static create(e = "Heavy") {
|
|
933
936
|
return new h(
|
|
934
|
-
|
|
937
|
+
e,
|
|
935
938
|
void 0,
|
|
936
939
|
{},
|
|
937
940
|
{},
|
|
@@ -940,16 +943,16 @@ class h {
|
|
|
940
943
|
void 0
|
|
941
944
|
);
|
|
942
945
|
}
|
|
943
|
-
output(
|
|
946
|
+
output(e, n, r = {}) {
|
|
944
947
|
if (typeof n == "function") {
|
|
945
|
-
const s = `output#${
|
|
948
|
+
const s = `output#${e}`;
|
|
946
949
|
return O(s, () => n(new D())), new h(
|
|
947
950
|
this._renderingMode,
|
|
948
951
|
this._initialArgs,
|
|
949
952
|
this._initialUiState,
|
|
950
953
|
{
|
|
951
954
|
...this._outputs,
|
|
952
|
-
[
|
|
955
|
+
[e]: {
|
|
953
956
|
__renderLambda: !0,
|
|
954
957
|
handle: s,
|
|
955
958
|
...r
|
|
@@ -966,7 +969,7 @@ class h {
|
|
|
966
969
|
this._initialUiState,
|
|
967
970
|
{
|
|
968
971
|
...this._outputs,
|
|
969
|
-
[
|
|
972
|
+
[e]: n
|
|
970
973
|
},
|
|
971
974
|
this._inputsValid,
|
|
972
975
|
this._sections,
|
|
@@ -974,15 +977,15 @@ class h {
|
|
|
974
977
|
);
|
|
975
978
|
}
|
|
976
979
|
/** Shortcut for {@link output} with retentive flag set to true. */
|
|
977
|
-
retentiveOutput(
|
|
978
|
-
return this.output(
|
|
980
|
+
retentiveOutput(e, n) {
|
|
981
|
+
return this.output(e, n, { retentive: !0 });
|
|
979
982
|
}
|
|
980
983
|
/** @deprecated */
|
|
981
|
-
canRun(
|
|
982
|
-
return this.inputsValid(
|
|
984
|
+
canRun(e) {
|
|
985
|
+
return this.inputsValid(e);
|
|
983
986
|
}
|
|
984
|
-
argsValid(
|
|
985
|
-
return typeof
|
|
987
|
+
argsValid(e) {
|
|
988
|
+
return typeof e == "function" ? (O("inputsValid", () => e(new D())), new h(
|
|
986
989
|
this._renderingMode,
|
|
987
990
|
this._initialArgs,
|
|
988
991
|
this._initialUiState,
|
|
@@ -998,16 +1001,16 @@ class h {
|
|
|
998
1001
|
this._initialArgs,
|
|
999
1002
|
this._initialUiState,
|
|
1000
1003
|
this._outputs,
|
|
1001
|
-
|
|
1004
|
+
e,
|
|
1002
1005
|
this._sections,
|
|
1003
1006
|
this._title
|
|
1004
1007
|
);
|
|
1005
1008
|
}
|
|
1006
|
-
inputsValid(
|
|
1007
|
-
return this.argsValid(
|
|
1009
|
+
inputsValid(e) {
|
|
1010
|
+
return this.argsValid(e);
|
|
1008
1011
|
}
|
|
1009
|
-
sections(
|
|
1010
|
-
return Array.isArray(
|
|
1012
|
+
sections(e) {
|
|
1013
|
+
return Array.isArray(e) ? this.sections(k(e)) : typeof e == "function" ? (O("sections", () => e(new D())), new h(
|
|
1011
1014
|
this._renderingMode,
|
|
1012
1015
|
this._initialArgs,
|
|
1013
1016
|
this._initialUiState,
|
|
@@ -1021,12 +1024,12 @@ class h {
|
|
|
1021
1024
|
this._initialUiState,
|
|
1022
1025
|
this._outputs,
|
|
1023
1026
|
this._inputsValid,
|
|
1024
|
-
|
|
1027
|
+
e,
|
|
1025
1028
|
this._title
|
|
1026
1029
|
);
|
|
1027
1030
|
}
|
|
1028
|
-
title(
|
|
1029
|
-
return O("title", () =>
|
|
1031
|
+
title(e) {
|
|
1032
|
+
return O("title", () => e(new D())), new h(
|
|
1030
1033
|
this._renderingMode,
|
|
1031
1034
|
this._initialArgs,
|
|
1032
1035
|
this._initialUiState,
|
|
@@ -1040,10 +1043,10 @@ class h {
|
|
|
1040
1043
|
* Sets initial args for the block, this value must be specified.
|
|
1041
1044
|
* @deprecated use {@link withArgs}
|
|
1042
1045
|
* */
|
|
1043
|
-
initialArgs(
|
|
1046
|
+
initialArgs(e) {
|
|
1044
1047
|
return new h(
|
|
1045
1048
|
this._renderingMode,
|
|
1046
|
-
|
|
1049
|
+
e,
|
|
1047
1050
|
this._initialUiState,
|
|
1048
1051
|
this._outputs,
|
|
1049
1052
|
this._inputsValid,
|
|
@@ -1052,10 +1055,10 @@ class h {
|
|
|
1052
1055
|
);
|
|
1053
1056
|
}
|
|
1054
1057
|
/** Sets initial args for the block, this value must be specified. */
|
|
1055
|
-
withArgs(
|
|
1058
|
+
withArgs(e) {
|
|
1056
1059
|
return new h(
|
|
1057
1060
|
this._renderingMode,
|
|
1058
|
-
|
|
1061
|
+
e,
|
|
1059
1062
|
this._initialUiState,
|
|
1060
1063
|
this._outputs,
|
|
1061
1064
|
this._inputsValid,
|
|
@@ -1064,11 +1067,11 @@ class h {
|
|
|
1064
1067
|
);
|
|
1065
1068
|
}
|
|
1066
1069
|
/** Defines type and sets initial value for block UiState. */
|
|
1067
|
-
withUiState(
|
|
1070
|
+
withUiState(e) {
|
|
1068
1071
|
return new h(
|
|
1069
1072
|
this._renderingMode,
|
|
1070
1073
|
this._initialArgs,
|
|
1071
|
-
|
|
1074
|
+
e,
|
|
1072
1075
|
this._outputs,
|
|
1073
1076
|
this._inputsValid,
|
|
1074
1077
|
this._sections,
|
|
@@ -1080,7 +1083,7 @@ class h {
|
|
|
1080
1083
|
* other features provided by the platforma to the block. */
|
|
1081
1084
|
done() {
|
|
1082
1085
|
if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
|
|
1083
|
-
const
|
|
1086
|
+
const e = {
|
|
1084
1087
|
v3: {
|
|
1085
1088
|
sdkVersion: C,
|
|
1086
1089
|
renderingMode: this._renderingMode,
|
|
@@ -1101,35 +1104,36 @@ class h {
|
|
|
1101
1104
|
Object.entries(this._outputs).map(([n, r]) => [n, U(r)])
|
|
1102
1105
|
)
|
|
1103
1106
|
};
|
|
1104
|
-
return
|
|
1107
|
+
return _e() ? re({ sdkVersion: C }) : { config: e };
|
|
1105
1108
|
}
|
|
1106
1109
|
}
|
|
1107
|
-
function
|
|
1110
|
+
function ht(t, e, n, r) {
|
|
1108
1111
|
var o, a;
|
|
1109
|
-
const s =
|
|
1110
|
-
for (const l of
|
|
1112
|
+
const s = t.resultPool.getData().entries.map((l) => l.obj).filter(W).filter((l) => l.spec.name === "pl7.app/label" && l.spec.axesSpec.length === 1), i = /* @__PURE__ */ new Map();
|
|
1113
|
+
for (const l of e)
|
|
1111
1114
|
for (const c of l.spec.axesSpec) {
|
|
1112
1115
|
const f = J(c);
|
|
1113
|
-
for (const
|
|
1114
|
-
|
|
1116
|
+
for (const w of s)
|
|
1117
|
+
me(f, J(w.spec.axesSpec[0])) && i.set(w.id, w);
|
|
1115
1118
|
}
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1119
|
+
if (![...e, ...i.values()].find((l) => !l.data.getIsReadyOrError()))
|
|
1120
|
+
return t.createPTable({
|
|
1121
|
+
src: {
|
|
1122
|
+
type: "outer",
|
|
1123
|
+
primary: {
|
|
1124
|
+
type: "full",
|
|
1125
|
+
entries: e.map((l) => ({ type: "column", column: l }))
|
|
1126
|
+
},
|
|
1127
|
+
secondary: Array.from(i.values()).map((l) => ({ type: "column", column: l }))
|
|
1122
1128
|
},
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
sorting: ((a = n == null ? void 0 : n.pTableParams) == null ? void 0 : a.sorting) ?? []
|
|
1127
|
-
});
|
|
1129
|
+
filters: [...((o = n == null ? void 0 : n.pTableParams) == null ? void 0 : o.filters) ?? [], ...r ?? []],
|
|
1130
|
+
sorting: ((a = n == null ? void 0 : n.pTableParams) == null ? void 0 : a.sorting) ?? []
|
|
1131
|
+
});
|
|
1128
1132
|
}
|
|
1129
|
-
function
|
|
1130
|
-
const r =
|
|
1133
|
+
function gt(t, e, n) {
|
|
1134
|
+
const r = t.findLabels(e);
|
|
1131
1135
|
return {
|
|
1132
|
-
axis: J(
|
|
1136
|
+
axis: J(e),
|
|
1133
1137
|
options: n.map((s) => ({
|
|
1134
1138
|
value: s,
|
|
1135
1139
|
label: (r == null ? void 0 : r.get(s)) ?? s.toString()
|
|
@@ -1137,108 +1141,113 @@ function ge(e, t, n) {
|
|
|
1137
1141
|
defaultValue: n[0]
|
|
1138
1142
|
};
|
|
1139
1143
|
}
|
|
1140
|
-
class
|
|
1141
|
-
constructor(
|
|
1142
|
-
this.handle =
|
|
1144
|
+
class mt {
|
|
1145
|
+
constructor(e) {
|
|
1146
|
+
this.handle = e;
|
|
1143
1147
|
}
|
|
1144
|
-
async findColumns(
|
|
1145
|
-
return await platforma.pFrameDriver.findColumns(this.handle,
|
|
1148
|
+
async findColumns(e) {
|
|
1149
|
+
return await platforma.pFrameDriver.findColumns(this.handle, e);
|
|
1146
1150
|
}
|
|
1147
|
-
async getColumnSpec(
|
|
1148
|
-
return await platforma.pFrameDriver.getColumnSpec(this.handle,
|
|
1151
|
+
async getColumnSpec(e) {
|
|
1152
|
+
return await platforma.pFrameDriver.getColumnSpec(this.handle, e);
|
|
1149
1153
|
}
|
|
1150
1154
|
async listColumns() {
|
|
1151
1155
|
return await platforma.pFrameDriver.listColumns(this.handle);
|
|
1152
1156
|
}
|
|
1153
|
-
async calculateTableData(
|
|
1154
|
-
return await platforma.pFrameDriver.calculateTableData(this.handle,
|
|
1157
|
+
async calculateTableData(e) {
|
|
1158
|
+
return await platforma.pFrameDriver.calculateTableData(this.handle, e);
|
|
1155
1159
|
}
|
|
1156
|
-
async getUniqueValues(
|
|
1157
|
-
return await platforma.pFrameDriver.getUniqueValues(this.handle,
|
|
1160
|
+
async getUniqueValues(e) {
|
|
1161
|
+
return await platforma.pFrameDriver.getUniqueValues(this.handle, e);
|
|
1158
1162
|
}
|
|
1159
1163
|
}
|
|
1160
|
-
function
|
|
1161
|
-
return
|
|
1164
|
+
function Le(t) {
|
|
1165
|
+
return ne({
|
|
1162
1166
|
__isRef: !0,
|
|
1163
|
-
blockId: x(
|
|
1164
|
-
name: x(
|
|
1167
|
+
blockId: x(t, "blockId"),
|
|
1168
|
+
name: x(t, "name")
|
|
1165
1169
|
});
|
|
1166
1170
|
}
|
|
1167
|
-
function
|
|
1168
|
-
return
|
|
1169
|
-
ref:
|
|
1170
|
-
label: x(
|
|
1171
|
+
function yt(t) {
|
|
1172
|
+
return ne({
|
|
1173
|
+
ref: Le(x(t, "ref")),
|
|
1174
|
+
label: x(t, "label")
|
|
1171
1175
|
});
|
|
1172
1176
|
}
|
|
1173
|
-
const
|
|
1177
|
+
const bt = {
|
|
1174
1178
|
sdkVersion: C
|
|
1175
1179
|
};
|
|
1176
|
-
function
|
|
1177
|
-
return
|
|
1180
|
+
function _t() {
|
|
1181
|
+
return re({ sdkVersion: C });
|
|
1178
1182
|
}
|
|
1179
|
-
function
|
|
1183
|
+
function vt(t) {
|
|
1180
1184
|
if (typeof globalThis.getEnvironmentValue == "function")
|
|
1181
|
-
return globalThis.getEnvironmentValue(
|
|
1185
|
+
return globalThis.getEnvironmentValue(t);
|
|
1182
1186
|
}
|
|
1183
1187
|
export {
|
|
1184
|
-
|
|
1188
|
+
Me as Args,
|
|
1185
1189
|
h as BlockModel,
|
|
1186
|
-
|
|
1190
|
+
bt as CurrentSdkInfo,
|
|
1187
1191
|
g as FutureRef,
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1192
|
+
Be as It,
|
|
1193
|
+
ct as JsRenderInternal,
|
|
1194
|
+
Ue as MainOutputs,
|
|
1195
|
+
ye as OutputError,
|
|
1196
|
+
Ae as PAnnotationLabel,
|
|
1197
|
+
Pe as PAnnotationTrace,
|
|
1198
|
+
mt as PFrameImpl,
|
|
1193
1199
|
M as RT_BINARY_PARTITIONED,
|
|
1194
1200
|
B as RT_BINARY_SUPER_PARTITIONED,
|
|
1195
1201
|
Z as RT_JSON_PARTITIONED,
|
|
1196
|
-
|
|
1202
|
+
ee as RT_JSON_SUPER_PARTITIONED,
|
|
1197
1203
|
G as RT_RESOURCE_MAP,
|
|
1198
1204
|
H as RT_RESOURCE_MAP_PARTITIONED,
|
|
1199
1205
|
D as RenderCtx,
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1206
|
+
Oe as ResultPool,
|
|
1207
|
+
Je as StagingOutputs,
|
|
1208
|
+
Ce as Trace,
|
|
1209
|
+
Ie as TraceEntry,
|
|
1210
|
+
S as TreeNodeAccessor,
|
|
1211
|
+
$e as UiState,
|
|
1212
|
+
Ye as and,
|
|
1213
|
+
ht as createPlDataTable,
|
|
1214
|
+
gt as createPlDataTableSheet,
|
|
1215
|
+
Fe as deriveLabels,
|
|
1207
1216
|
U as downgradeCfgOrLambda,
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1217
|
+
ft as extractConfig,
|
|
1218
|
+
We as flatten,
|
|
1219
|
+
yt as fromPlOption,
|
|
1220
|
+
Le as fromPlRef,
|
|
1221
|
+
tt as getBlobContent,
|
|
1222
|
+
rt as getBlobContentAsJson,
|
|
1223
|
+
nt as getBlobContentAsString,
|
|
1224
|
+
st as getDownloadedBlobContent,
|
|
1225
|
+
vt as getEnvironmentValue,
|
|
1226
|
+
R as getFromCfg,
|
|
1218
1227
|
k as getImmediate,
|
|
1219
|
-
|
|
1228
|
+
ot as getImportProgress,
|
|
1220
1229
|
x as getJsonField,
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1230
|
+
at as getLastLogs,
|
|
1231
|
+
ut as getLogHandle,
|
|
1232
|
+
it as getOnDemandBlobContent,
|
|
1233
|
+
De as getPartitionKeysList,
|
|
1234
|
+
lt as getProgressLog,
|
|
1235
|
+
_t as getRawPlatformaInstance,
|
|
1236
|
+
Qe as getResourceField,
|
|
1237
|
+
Ze as getResourceValueAsJson,
|
|
1238
|
+
pt as getUniquePartitionKeys,
|
|
1239
|
+
ke as isConfigLambda,
|
|
1240
|
+
qe as isEmpty,
|
|
1241
|
+
Ne as isolate,
|
|
1242
|
+
Ke as makeArray,
|
|
1243
|
+
ne as makeObject,
|
|
1244
|
+
He as mapArrayValues,
|
|
1245
|
+
Ge as mapRecordValues,
|
|
1246
|
+
et as mapResourceFields,
|
|
1247
|
+
ze as not,
|
|
1248
|
+
Xe as or,
|
|
1249
|
+
dt as parseResourceMap,
|
|
1250
|
+
be as readOutput,
|
|
1251
|
+
je as wrapOutputs
|
|
1243
1252
|
};
|
|
1244
1253
|
//# sourceMappingURL=index.mjs.map
|