@platforma-sdk/model 1.8.19 → 1.10.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/bconfig/container.d.ts +46 -0
- package/dist/bconfig/container.d.ts.map +1 -0
- package/dist/bconfig/index.d.ts +7 -0
- package/dist/bconfig/index.d.ts.map +1 -0
- package/dist/bconfig/lambdas.d.ts +33 -0
- package/dist/bconfig/lambdas.d.ts.map +1 -0
- package/dist/bconfig/normalization.d.ts +13 -0
- package/dist/bconfig/normalization.d.ts.map +1 -0
- package/dist/bconfig/types.d.ts +11 -0
- package/dist/bconfig/types.d.ts.map +1 -0
- package/dist/bconfig/utils.d.ts +7 -0
- package/dist/bconfig/utils.d.ts.map +1 -0
- package/dist/bconfig/v3.d.ts +30 -0
- package/dist/bconfig/v3.d.ts.map +1 -0
- package/dist/builder.d.ts +45 -65
- package/dist/builder.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +510 -271
- package/dist/index.mjs.map +1 -1
- package/dist/internal.d.ts +3 -2
- package/dist/internal.d.ts.map +1 -1
- package/dist/platforma.d.ts +3 -2
- package/dist/platforma.d.ts.map +1 -1
- package/dist/raw_globals.d.ts.map +1 -1
- package/dist/render/accessor.d.ts +47 -0
- package/dist/render/accessor.d.ts.map +1 -1
- package/dist/render/api.d.ts +2 -0
- package/dist/render/api.d.ts.map +1 -1
- package/dist/render/index.d.ts +1 -0
- package/dist/render/index.d.ts.map +1 -1
- package/dist/render/internal.d.ts +4 -0
- package/dist/render/internal.d.ts.map +1 -1
- package/dist/render/traversal_ops.d.ts +5 -2
- package/dist/render/traversal_ops.d.ts.map +1 -1
- package/dist/render/util/index.d.ts +2 -0
- package/dist/render/util/index.d.ts.map +1 -0
- package/dist/render/util/resource_map.d.ts +15 -0
- package/dist/render/util/resource_map.d.ts.map +1 -0
- package/dist/version.d.ts +1 -1
- package/package.json +3 -3
- package/src/bconfig/container.ts +58 -0
- package/src/bconfig/index.ts +6 -0
- package/src/bconfig/lambdas.ts +44 -0
- package/src/bconfig/normalization.ts +120 -0
- package/src/bconfig/types.ts +18 -0
- package/src/bconfig/utils.ts +8 -0
- package/src/bconfig/v3.ts +46 -0
- package/src/builder.ts +165 -141
- package/src/global.d.ts +1 -1
- package/src/index.ts +1 -0
- package/src/internal.ts +1 -2
- package/src/platforma.ts +1 -2
- package/src/raw_globals.ts +2 -1
- package/src/render/accessor.ts +136 -0
- package/src/render/api.ts +22 -10
- package/src/render/index.ts +1 -0
- package/src/render/internal.ts +12 -0
- package/src/render/traversal_ops.ts +5 -2
- package/src/render/util/index.ts +1 -0
- package/src/render/util/resource_map.ts +74 -0
- package/src/typing.test.ts +5 -4
package/dist/index.mjs
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { isPColumn as
|
|
1
|
+
var M = Object.defineProperty;
|
|
2
|
+
var U = (e, t, n) => t in e ? M(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var f = (e, t, n) => U(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { isPColumn as D, mapPObjectData as A, mapValueInVOE as B, isPColumnSpec as $, mapPTableDef as J, getAxisId as O, matchAxisId as N } from "@milaboratories/pl-model-common";
|
|
5
5
|
export * from "@milaboratories/pl-model-common";
|
|
6
6
|
class G extends Error {
|
|
7
7
|
constructor(t, n) {
|
|
8
8
|
super(`${t.length}${n ? "+" : ""} errors, first error: ` + t[0]), this.errors = t, this.moreErrors = n;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function H(e) {
|
|
12
12
|
if (!e.ok) throw new G(e.errors, e.moreErrors);
|
|
13
13
|
return e.value;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function it(e) {
|
|
16
16
|
return new Proxy(e, {
|
|
17
17
|
get(t, n) {
|
|
18
|
-
return
|
|
18
|
+
return H(t[n]);
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null ?
|
|
22
|
+
function c(e) {
|
|
23
|
+
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null ? C(e) : e;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function v(e) {
|
|
26
26
|
return { type: "GetFromCtx", variable: e };
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function rt(e) {
|
|
29
29
|
return {
|
|
30
30
|
type: "Isolate",
|
|
31
31
|
cfg: e
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
const
|
|
35
|
-
function
|
|
34
|
+
const st = v("$args"), ot = v("$it"), at = v("$prod"), ut = v("$staging"), lt = v("$ui");
|
|
35
|
+
function C(e) {
|
|
36
36
|
return { type: "Immediate", value: e };
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function k(e) {
|
|
39
39
|
const t = {};
|
|
40
|
-
for (const [n,
|
|
40
|
+
for (const [n, i] of Object.entries(e)) t[n] = c(i);
|
|
41
41
|
return {
|
|
42
42
|
type: "MakeObject",
|
|
43
43
|
template: t
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function ct(...e) {
|
|
47
47
|
const t = [];
|
|
48
|
-
for (const n of e) t.push(
|
|
48
|
+
for (const n of e) t.push(c(n));
|
|
49
49
|
return {
|
|
50
50
|
type: "MakeArray",
|
|
51
51
|
template: t
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function S(e, t) {
|
|
55
55
|
return {
|
|
56
56
|
type: "GetJsonField",
|
|
57
|
-
source:
|
|
58
|
-
field:
|
|
57
|
+
source: c(e),
|
|
58
|
+
field: c(t)
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function dt(e, t, n = "$it") {
|
|
62
62
|
return {
|
|
63
63
|
type: "MapRecordValues",
|
|
64
64
|
source: e,
|
|
@@ -66,7 +66,7 @@ function it(e, t, n = "$it") {
|
|
|
66
66
|
itVar: n
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function pt(e, t, n = "$it") {
|
|
70
70
|
return {
|
|
71
71
|
type: "MapArrayValues",
|
|
72
72
|
source: e,
|
|
@@ -74,54 +74,54 @@ function ot(e, t, n = "$it") {
|
|
|
74
74
|
itVar: n
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function ht(e) {
|
|
78
78
|
return {
|
|
79
79
|
type: "Flatten",
|
|
80
80
|
source: e
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function ft(e) {
|
|
84
84
|
return {
|
|
85
85
|
type: "IsEmpty",
|
|
86
86
|
arg: e
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function gt(e) {
|
|
90
90
|
return {
|
|
91
91
|
type: "Not",
|
|
92
92
|
operand: e
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function mt(e, t) {
|
|
96
96
|
return {
|
|
97
97
|
type: "And",
|
|
98
98
|
operand1: e,
|
|
99
99
|
operand2: t
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function yt(e, t) {
|
|
103
103
|
return {
|
|
104
104
|
type: "Or",
|
|
105
105
|
operand1: e,
|
|
106
106
|
operand2: t
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function bt(e, t) {
|
|
110
110
|
return {
|
|
111
111
|
type: "GetResourceField",
|
|
112
|
-
source:
|
|
113
|
-
field:
|
|
112
|
+
source: c(e),
|
|
113
|
+
field: c(t)
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function vt() {
|
|
117
117
|
return function(e) {
|
|
118
118
|
return {
|
|
119
119
|
type: "GetResourceValueAsJson",
|
|
120
|
-
source:
|
|
120
|
+
source: c(e)
|
|
121
121
|
};
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function _t(e, t, n = "$it") {
|
|
125
125
|
return {
|
|
126
126
|
type: "MapResourceFields",
|
|
127
127
|
source: e,
|
|
@@ -129,65 +129,65 @@ function ht(e, t, n = "$it") {
|
|
|
129
129
|
itVar: n
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function wt(e) {
|
|
133
133
|
return {
|
|
134
134
|
type: "GetBlobContent",
|
|
135
|
-
source:
|
|
135
|
+
source: c(e)
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function Ct(e) {
|
|
139
139
|
return {
|
|
140
140
|
type: "GetBlobContentAsString",
|
|
141
|
-
source:
|
|
141
|
+
source: c(e)
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function At() {
|
|
145
145
|
return function(e) {
|
|
146
146
|
return {
|
|
147
147
|
type: "GetBlobContentAsJson",
|
|
148
|
-
source:
|
|
148
|
+
source: c(e)
|
|
149
149
|
};
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function St(e) {
|
|
153
153
|
return {
|
|
154
154
|
type: "GetDownloadedBlobContent",
|
|
155
|
-
source:
|
|
155
|
+
source: c(e)
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function Ft(e) {
|
|
159
159
|
return {
|
|
160
160
|
type: "GetOnDemandBlobContent",
|
|
161
|
-
source:
|
|
161
|
+
source: c(e)
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function It(e) {
|
|
165
165
|
return {
|
|
166
166
|
type: "GetImportProgress",
|
|
167
|
-
source:
|
|
167
|
+
source: c(e)
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function Rt(e, t) {
|
|
171
171
|
return {
|
|
172
172
|
type: "GetLastLogs",
|
|
173
|
-
source:
|
|
173
|
+
source: c(e),
|
|
174
174
|
lines: t
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function Ot(e, t) {
|
|
178
178
|
return {
|
|
179
179
|
type: "GetProgressLog",
|
|
180
|
-
source:
|
|
180
|
+
source: c(e),
|
|
181
181
|
patternToSearch: t
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function Vt(e) {
|
|
185
185
|
return {
|
|
186
186
|
type: "GetLogHandle",
|
|
187
|
-
source:
|
|
187
|
+
source: c(e)
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function K() {
|
|
191
191
|
return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
|
|
192
192
|
}
|
|
193
193
|
function x(e) {
|
|
@@ -196,92 +196,119 @@ function x(e) {
|
|
|
196
196
|
if (typeof globalThis.platforma < "u") return globalThis.platforma;
|
|
197
197
|
throw new Error("Can't get platforma instance.");
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function W() {
|
|
200
200
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
201
201
|
}
|
|
202
|
-
function
|
|
202
|
+
function o() {
|
|
203
203
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
204
204
|
throw new Error("Not in config rendering context");
|
|
205
205
|
}
|
|
206
|
-
function
|
|
207
|
-
const n =
|
|
206
|
+
function _(e, t) {
|
|
207
|
+
const n = W();
|
|
208
208
|
if (n === void 0) return !1;
|
|
209
209
|
if (e in n.callbackRegistry) throw new Error(`Callback with key ${e} already registered.`);
|
|
210
210
|
return n.callbackRegistry[e] = t, !0;
|
|
211
211
|
}
|
|
212
|
-
const
|
|
213
|
-
function
|
|
214
|
-
e in
|
|
215
|
-
for (const
|
|
216
|
-
|
|
217
|
-
},
|
|
218
|
-
}
|
|
219
|
-
class
|
|
220
|
-
constructor(t, n = (
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
this.handle = t, this.postProcess = n,
|
|
224
|
-
this.resolvedValue = n(
|
|
212
|
+
const F = /* @__PURE__ */ new Map();
|
|
213
|
+
function q(e, t) {
|
|
214
|
+
e in o().callbackRegistry || (o().callbackRegistry[e] = (n) => {
|
|
215
|
+
for (const i of F.get(e))
|
|
216
|
+
i(n);
|
|
217
|
+
}, F.set(e, [])), F.get(e).push(t);
|
|
218
|
+
}
|
|
219
|
+
class h {
|
|
220
|
+
constructor(t, n = (i) => i) {
|
|
221
|
+
f(this, "isResolved", !1);
|
|
222
|
+
f(this, "resolvedValue");
|
|
223
|
+
this.handle = t, this.postProcess = n, q(t, (i) => {
|
|
224
|
+
this.resolvedValue = n(i), this.isResolved = !0;
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
227
|
map(t) {
|
|
228
|
-
return new
|
|
228
|
+
return new h(this.handle, (n) => t(this.postProcess(n)));
|
|
229
229
|
}
|
|
230
230
|
mapDefined(t) {
|
|
231
|
-
return new
|
|
232
|
-
const
|
|
233
|
-
return
|
|
231
|
+
return new h(this.handle, (n) => {
|
|
232
|
+
const i = this.postProcess(n);
|
|
233
|
+
return i ? t(i) : void 0;
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
236
|
toJSON() {
|
|
237
237
|
return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
|
-
function
|
|
241
|
-
return e === void 0 ? void 0 : new
|
|
240
|
+
function V(e) {
|
|
241
|
+
return e === void 0 ? void 0 : new m(e);
|
|
242
242
|
}
|
|
243
|
-
class
|
|
243
|
+
class m {
|
|
244
244
|
constructor(t) {
|
|
245
245
|
this.handle = t;
|
|
246
246
|
}
|
|
247
247
|
resolve(...t) {
|
|
248
|
+
const n = t.map(
|
|
249
|
+
(i) => ({
|
|
250
|
+
assertFieldType: "Input",
|
|
251
|
+
...typeof i == "string" ? { field: i } : i
|
|
252
|
+
})
|
|
253
|
+
);
|
|
254
|
+
return this.resolveWithCommon({}, ...n);
|
|
255
|
+
}
|
|
256
|
+
resolveOutput(...t) {
|
|
257
|
+
const n = t.map(
|
|
258
|
+
(i) => ({
|
|
259
|
+
assertFieldType: "Output",
|
|
260
|
+
...typeof i == "string" ? { field: i } : i
|
|
261
|
+
})
|
|
262
|
+
);
|
|
263
|
+
return this.resolveWithCommon({}, ...n);
|
|
264
|
+
}
|
|
265
|
+
resolveInput(...t) {
|
|
266
|
+
const n = t.map(
|
|
267
|
+
(i) => ({
|
|
268
|
+
assertFieldType: "Input",
|
|
269
|
+
...typeof i == "string" ? { field: i } : i
|
|
270
|
+
})
|
|
271
|
+
);
|
|
272
|
+
return this.resolveWithCommon({}, ...n);
|
|
273
|
+
}
|
|
274
|
+
resolveAny(...t) {
|
|
248
275
|
return this.resolveWithCommon({}, ...t);
|
|
249
276
|
}
|
|
250
277
|
resolveWithCommon(t, ...n) {
|
|
251
|
-
return
|
|
278
|
+
return V(o().resolveWithCommon(this.handle, t, ...n));
|
|
252
279
|
}
|
|
253
280
|
get resourceType() {
|
|
254
|
-
return
|
|
281
|
+
return o().getResourceType(this.handle);
|
|
255
282
|
}
|
|
256
283
|
getInputsLocked() {
|
|
257
|
-
return
|
|
284
|
+
return o().getInputsLocked(this.handle);
|
|
258
285
|
}
|
|
259
286
|
getOutputsLocked() {
|
|
260
|
-
return
|
|
287
|
+
return o().getOutputsLocked(this.handle);
|
|
261
288
|
}
|
|
262
289
|
getIsReadyOrError() {
|
|
263
|
-
return
|
|
290
|
+
return o().getIsReadyOrError(this.handle);
|
|
264
291
|
}
|
|
265
292
|
getIsFinal() {
|
|
266
|
-
return
|
|
293
|
+
return o().getIsFinal(this.handle);
|
|
267
294
|
}
|
|
268
295
|
getError() {
|
|
269
|
-
return
|
|
296
|
+
return V(o().getError(this.handle));
|
|
270
297
|
}
|
|
271
298
|
listInputFields() {
|
|
272
|
-
return
|
|
299
|
+
return o().listInputFields(this.handle);
|
|
273
300
|
}
|
|
274
301
|
listOutputFields() {
|
|
275
|
-
return
|
|
302
|
+
return o().listOutputFields(this.handle);
|
|
276
303
|
}
|
|
277
304
|
listDynamicFields() {
|
|
278
|
-
return
|
|
305
|
+
return o().listDynamicFields(this.handle);
|
|
279
306
|
}
|
|
280
307
|
getKeyValueBase64(t) {
|
|
281
|
-
return
|
|
308
|
+
return o().getKeyValueBase64(this.handle, t);
|
|
282
309
|
}
|
|
283
310
|
getKeyValueAsString(t) {
|
|
284
|
-
return
|
|
311
|
+
return o().getKeyValueAsString(this.handle, t);
|
|
285
312
|
}
|
|
286
313
|
getKeyValueAsJson(t) {
|
|
287
314
|
const n = this.getKeyValueAsString(t);
|
|
@@ -289,10 +316,10 @@ class p {
|
|
|
289
316
|
return JSON.parse(n);
|
|
290
317
|
}
|
|
291
318
|
getDataBase64() {
|
|
292
|
-
return
|
|
319
|
+
return o().getDataBase64(this.handle);
|
|
293
320
|
}
|
|
294
321
|
getDataAsString() {
|
|
295
|
-
return
|
|
322
|
+
return o().getDataAsString(this.handle);
|
|
296
323
|
}
|
|
297
324
|
getDataAsJson() {
|
|
298
325
|
const t = this.getDataAsString();
|
|
@@ -303,36 +330,36 @@ class p {
|
|
|
303
330
|
*
|
|
304
331
|
*/
|
|
305
332
|
getPColumns(t = !1, n = "") {
|
|
306
|
-
const
|
|
307
|
-
return
|
|
308
|
-
if (!
|
|
309
|
-
return
|
|
333
|
+
const i = this.parsePObjectCollection(t, n);
|
|
334
|
+
return i === void 0 ? void 0 : Object.entries(i).map(([, s]) => {
|
|
335
|
+
if (!D(s)) throw new Error(`not a PColumn (kind = ${s.spec.kind})`);
|
|
336
|
+
return s;
|
|
310
337
|
});
|
|
311
338
|
}
|
|
312
339
|
/**
|
|
313
340
|
*
|
|
314
341
|
*/
|
|
315
342
|
parsePObjectCollection(t = !1, n = "") {
|
|
316
|
-
const
|
|
343
|
+
const i = o().parsePObjectCollection(
|
|
317
344
|
this.handle,
|
|
318
345
|
t,
|
|
319
346
|
n
|
|
320
347
|
);
|
|
321
|
-
if (
|
|
322
|
-
const
|
|
323
|
-
for (const [
|
|
324
|
-
|
|
325
|
-
return
|
|
348
|
+
if (i === void 0) return;
|
|
349
|
+
const r = {};
|
|
350
|
+
for (const [s, u] of Object.entries(i))
|
|
351
|
+
r[s] = A(u, (a) => new m(a));
|
|
352
|
+
return r;
|
|
326
353
|
}
|
|
327
354
|
getFileContentAsBase64() {
|
|
328
|
-
return new
|
|
355
|
+
return new h(o().getBlobContentAsBase64(this.handle));
|
|
329
356
|
}
|
|
330
357
|
getFileContentAsString() {
|
|
331
|
-
return new
|
|
358
|
+
return new h(o().getBlobContentAsString(this.handle));
|
|
332
359
|
}
|
|
333
360
|
getFileContentAsJson() {
|
|
334
|
-
return new
|
|
335
|
-
|
|
361
|
+
return new h(
|
|
362
|
+
o().getBlobContentAsString(this.handle)
|
|
336
363
|
).mapDefined((t) => JSON.parse(t));
|
|
337
364
|
}
|
|
338
365
|
/**
|
|
@@ -351,7 +378,7 @@ class p {
|
|
|
351
378
|
* @returns downloaded file handle
|
|
352
379
|
*/
|
|
353
380
|
getFileHandle() {
|
|
354
|
-
return new
|
|
381
|
+
return new h(o().getDownloadedBlobContentHandle(this.handle));
|
|
355
382
|
}
|
|
356
383
|
/**
|
|
357
384
|
* @deprecated use getFileHandle
|
|
@@ -363,7 +390,7 @@ class p {
|
|
|
363
390
|
* @returns downloaded file handle
|
|
364
391
|
*/
|
|
365
392
|
getRemoteFileHandle() {
|
|
366
|
-
return new
|
|
393
|
+
return new h(o().getOnDemandBlobContentHandle(this.handle));
|
|
367
394
|
}
|
|
368
395
|
/**
|
|
369
396
|
* @deprecated use getRemoteFileHandle
|
|
@@ -372,49 +399,75 @@ class p {
|
|
|
372
399
|
return this.getRemoteFileHandle();
|
|
373
400
|
}
|
|
374
401
|
getImportProgress() {
|
|
375
|
-
return new
|
|
402
|
+
return new h(o().getImportProgress(this.handle));
|
|
376
403
|
}
|
|
377
404
|
getLastLogs(t) {
|
|
378
|
-
return new
|
|
405
|
+
return new h(o().getLastLogs(this.handle, t));
|
|
379
406
|
}
|
|
380
407
|
getProgressLog(t) {
|
|
381
|
-
return new
|
|
408
|
+
return new h(o().getProgressLog(this.handle, t));
|
|
382
409
|
}
|
|
383
410
|
getLogHandle() {
|
|
384
|
-
return new
|
|
411
|
+
return new h(o().getLogHandle(this.handle));
|
|
412
|
+
}
|
|
413
|
+
allFieldsResolved(t = "Input") {
|
|
414
|
+
switch (t) {
|
|
415
|
+
case "Input":
|
|
416
|
+
return this.getInputsLocked() && this.listInputFields().every(
|
|
417
|
+
(n) => this.resolve({ field: n, assertFieldType: "Input" }) !== void 0
|
|
418
|
+
);
|
|
419
|
+
case "Output":
|
|
420
|
+
return this.getOutputsLocked() && this.listOutputFields().every(
|
|
421
|
+
(n) => this.resolve({ field: n, assertFieldType: "Output" }) !== void 0
|
|
422
|
+
);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
mapFields(t, n) {
|
|
426
|
+
const { fieldType: i, requireLocked: r, skipUnresolved: s } = {
|
|
427
|
+
fieldType: "Input",
|
|
428
|
+
requireLocked: !0,
|
|
429
|
+
skipUnresolved: !1,
|
|
430
|
+
...n
|
|
431
|
+
}, u = t;
|
|
432
|
+
if (r && (i === "Input" && !this.getInputsLocked() || i === "Output" && !this.getOutputsLocked()))
|
|
433
|
+
return;
|
|
434
|
+
let d = (i === "Input" ? this.listInputFields() : i === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
|
|
435
|
+
(l) => [l, this.resolve({ field: l, assertFieldType: i })]
|
|
436
|
+
);
|
|
437
|
+
return s && (d = d.filter((l) => l[1] !== void 0)), d.map(([l, g]) => u(l, g));
|
|
385
438
|
}
|
|
386
439
|
}
|
|
387
|
-
const
|
|
388
|
-
function
|
|
440
|
+
const L = "staging", T = "main";
|
|
441
|
+
function j(e) {
|
|
389
442
|
return typeof e == "object" && e !== null && "__awaited_futures__" in e;
|
|
390
443
|
}
|
|
391
|
-
function
|
|
444
|
+
function R(e, t, n) {
|
|
392
445
|
if (t.has(n)) return;
|
|
393
446
|
if (t.add(n), typeof n === "object")
|
|
394
|
-
if (
|
|
447
|
+
if (j(n)) n.__awaited_futures__.forEach((r) => e.add(r));
|
|
395
448
|
else if (Array.isArray(n))
|
|
396
|
-
for (const
|
|
449
|
+
for (const r of n) R(e, t, r);
|
|
397
450
|
else
|
|
398
|
-
for (const [,
|
|
399
|
-
|
|
451
|
+
for (const [, r] of Object.entries(n))
|
|
452
|
+
r !== n && R(e, t, r);
|
|
400
453
|
}
|
|
401
|
-
function
|
|
454
|
+
function z(e) {
|
|
402
455
|
const t = /* @__PURE__ */ new Set();
|
|
403
|
-
return
|
|
456
|
+
return R(t, /* @__PURE__ */ new Set(), e), t;
|
|
404
457
|
}
|
|
405
|
-
const
|
|
458
|
+
const Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
406
459
|
__proto__: null,
|
|
407
|
-
MainAccessorName:
|
|
408
|
-
StagingAccessorName:
|
|
409
|
-
getAllFutureAwaits:
|
|
410
|
-
isFutureAwait:
|
|
460
|
+
MainAccessorName: T,
|
|
461
|
+
StagingAccessorName: L,
|
|
462
|
+
getAllFutureAwaits: z,
|
|
463
|
+
isFutureAwait: j
|
|
411
464
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
412
|
-
class
|
|
465
|
+
class Q {
|
|
413
466
|
constructor() {
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
var
|
|
417
|
-
return ((
|
|
467
|
+
f(this, "ctx", o());
|
|
468
|
+
f(this, "defaultLabelFn", (t, n) => {
|
|
469
|
+
var i;
|
|
470
|
+
return ((i = t.annotations) == null ? void 0 : i["pl7.app/label"]) ?? "Unlabelled";
|
|
418
471
|
});
|
|
419
472
|
}
|
|
420
473
|
/**
|
|
@@ -424,9 +477,9 @@ class U {
|
|
|
424
477
|
return this.ctx.calculateOptions(t);
|
|
425
478
|
}
|
|
426
479
|
getOptions(t, n = this.defaultLabelFn) {
|
|
427
|
-
return this.getSpecs().entries.filter((
|
|
428
|
-
ref:
|
|
429
|
-
label: n(
|
|
480
|
+
return this.getSpecs().entries.filter((i) => t(i.obj)).map((i) => ({
|
|
481
|
+
ref: i.ref,
|
|
482
|
+
label: n(i.obj, i.ref)
|
|
430
483
|
}));
|
|
431
484
|
}
|
|
432
485
|
/**
|
|
@@ -443,7 +496,7 @@ class U {
|
|
|
443
496
|
ref: n.ref,
|
|
444
497
|
obj: {
|
|
445
498
|
...n.obj,
|
|
446
|
-
data: new
|
|
499
|
+
data: new m(n.obj.data)
|
|
447
500
|
}
|
|
448
501
|
}))
|
|
449
502
|
};
|
|
@@ -462,7 +515,7 @@ class U {
|
|
|
462
515
|
ref: n.ref,
|
|
463
516
|
obj: {
|
|
464
517
|
...n.obj,
|
|
465
|
-
data:
|
|
518
|
+
data: B(n.obj.data, (i) => new m(i))
|
|
466
519
|
}
|
|
467
520
|
}))
|
|
468
521
|
};
|
|
@@ -482,9 +535,12 @@ class U {
|
|
|
482
535
|
*/
|
|
483
536
|
getDataByRef(t) {
|
|
484
537
|
var n;
|
|
485
|
-
return (n = this.getData().entries.find(
|
|
486
|
-
(
|
|
487
|
-
)) == null ? void 0 : n.obj
|
|
538
|
+
return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (n = this.getData().entries.find(
|
|
539
|
+
(i) => i.ref.blockId === t.blockId && i.ref.name === t.name
|
|
540
|
+
)) == null ? void 0 : n.obj : A(
|
|
541
|
+
this.ctx.getDataFromResultPoolByRef(t.blockId, t.name),
|
|
542
|
+
(i) => new m(i)
|
|
543
|
+
);
|
|
488
544
|
}
|
|
489
545
|
/**
|
|
490
546
|
* @param ref a Ref
|
|
@@ -492,9 +548,9 @@ class U {
|
|
|
492
548
|
*/
|
|
493
549
|
getSpecByRef(t) {
|
|
494
550
|
var n;
|
|
495
|
-
return (n = this.getSpecs().entries.find(
|
|
496
|
-
(
|
|
497
|
-
)) == null ? void 0 : n.obj;
|
|
551
|
+
return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (n = this.getSpecs().entries.find(
|
|
552
|
+
(i) => i.ref.blockId === t.blockId && i.ref.name === t.name
|
|
553
|
+
)) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(t.blockId, t.name);
|
|
498
554
|
}
|
|
499
555
|
/**
|
|
500
556
|
* @param spec object specification
|
|
@@ -502,23 +558,23 @@ class U {
|
|
|
502
558
|
*/
|
|
503
559
|
findDataWithCompatibleSpec(t) {
|
|
504
560
|
const n = [];
|
|
505
|
-
t: for (const
|
|
506
|
-
if (
|
|
561
|
+
t: for (const i of this.getData().entries) {
|
|
562
|
+
if (!$(i.obj.spec))
|
|
507
563
|
continue;
|
|
508
|
-
const
|
|
509
|
-
if (t.name ===
|
|
510
|
-
for (let
|
|
511
|
-
const
|
|
512
|
-
if (
|
|
564
|
+
const r = i.obj.spec;
|
|
565
|
+
if (t.name === r.name && t.valueType === r.valueType && t.axesSpec.length === r.axesSpec.length && P(t.domain, r.domain)) {
|
|
566
|
+
for (let s = 0; s < t.axesSpec.length; ++s) {
|
|
567
|
+
const u = t.axesSpec[s], a = r.axesSpec[s];
|
|
568
|
+
if (u.name !== a.name || u.type !== a.type || !P(u.domain, a.domain))
|
|
513
569
|
continue t;
|
|
514
570
|
}
|
|
515
|
-
n.push(
|
|
571
|
+
n.push(i.obj);
|
|
516
572
|
}
|
|
517
573
|
}
|
|
518
574
|
return n;
|
|
519
575
|
}
|
|
520
576
|
}
|
|
521
|
-
function
|
|
577
|
+
function P(e, t) {
|
|
522
578
|
if (e === void 0) return t === void 0;
|
|
523
579
|
if (t === void 0) return !0;
|
|
524
580
|
for (const n in t)
|
|
@@ -527,18 +583,18 @@ function D(e, t) {
|
|
|
527
583
|
}
|
|
528
584
|
class w {
|
|
529
585
|
constructor() {
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
this.ctx =
|
|
586
|
+
f(this, "ctx");
|
|
587
|
+
f(this, "args");
|
|
588
|
+
f(this, "uiState");
|
|
589
|
+
f(this, "resultPool", new Q());
|
|
590
|
+
this.ctx = o(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : void 0;
|
|
535
591
|
}
|
|
536
592
|
getNamedAccessor(t) {
|
|
537
593
|
const n = this.ctx.getAccessorHandleByName(t);
|
|
538
|
-
return n ? new
|
|
594
|
+
return n ? new m(n) : void 0;
|
|
539
595
|
}
|
|
540
596
|
get prerun() {
|
|
541
|
-
return this.getNamedAccessor(
|
|
597
|
+
return this.getNamedAccessor(L);
|
|
542
598
|
}
|
|
543
599
|
/**
|
|
544
600
|
* @deprecated use prerun
|
|
@@ -553,7 +609,7 @@ class w {
|
|
|
553
609
|
return this.precalc;
|
|
554
610
|
}
|
|
555
611
|
get outputs() {
|
|
556
|
-
return this.getNamedAccessor(
|
|
612
|
+
return this.getNamedAccessor(T);
|
|
557
613
|
}
|
|
558
614
|
/**
|
|
559
615
|
* @deprecated use outputs
|
|
@@ -562,120 +618,286 @@ class w {
|
|
|
562
618
|
return this.outputs;
|
|
563
619
|
}
|
|
564
620
|
createPFrame(t) {
|
|
565
|
-
return this.ctx.createPFrame(t.map((n) => A(n, (
|
|
621
|
+
return this.ctx.createPFrame(t.map((n) => A(n, (i) => i.handle)));
|
|
566
622
|
}
|
|
567
623
|
createPTable(t) {
|
|
568
624
|
var n;
|
|
569
625
|
return "columns" in t ? n = {
|
|
570
626
|
src: {
|
|
571
627
|
type: "inner",
|
|
572
|
-
entries: t.columns.map((
|
|
628
|
+
entries: t.columns.map((i) => ({ type: "column", column: i }))
|
|
573
629
|
},
|
|
574
630
|
filters: t.filters ?? [],
|
|
575
631
|
sorting: t.sorting ?? []
|
|
576
|
-
} : n = t, this.ctx.createPTable(
|
|
632
|
+
} : n = t, this.ctx.createPTable(J(n, (i) => A(i, (r) => r.handle)));
|
|
577
633
|
}
|
|
634
|
+
/** @deprecated scheduled for removal from SDK */
|
|
578
635
|
getBlockLabel(t) {
|
|
579
636
|
return this.ctx.getBlockLabel(t);
|
|
580
637
|
}
|
|
638
|
+
getCurrentUnstableMarker() {
|
|
639
|
+
if (!(typeof this.ctx.getCurrentUnstableMarker > "u"))
|
|
640
|
+
return this.ctx.getCurrentUnstableMarker();
|
|
641
|
+
}
|
|
581
642
|
}
|
|
582
|
-
const
|
|
583
|
-
function
|
|
584
|
-
|
|
643
|
+
const X = "PColumnData/ResourceMap", Y = "PColumnData/Partitioned/ResourceMap";
|
|
644
|
+
function E(e, t, n, i = [], r) {
|
|
645
|
+
if (e === void 0) return !1;
|
|
646
|
+
switch (e.resourceType.name) {
|
|
647
|
+
case X: {
|
|
648
|
+
let s = e.getInputsLocked();
|
|
649
|
+
for (const u of e.listInputFields()) {
|
|
650
|
+
const a = e.resolve({ field: u, assertFieldType: "Input" }), d = [...i, ...JSON.parse(u)], l = a === void 0 ? void 0 : t(a);
|
|
651
|
+
l === void 0 && (s = !1), (l !== void 0 || r) && n.push({ key: d, value: l });
|
|
652
|
+
}
|
|
653
|
+
return s;
|
|
654
|
+
}
|
|
655
|
+
case Y: {
|
|
656
|
+
let s = e.getInputsLocked();
|
|
657
|
+
for (const u of e.listInputFields()) {
|
|
658
|
+
const a = e.resolve({ field: u, assertFieldType: "Input" });
|
|
659
|
+
if (a === void 0) s = !1;
|
|
660
|
+
else {
|
|
661
|
+
const d = [...i, ...JSON.parse(u)], l = E(a, t, n, d, r);
|
|
662
|
+
s = s && l;
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
return s;
|
|
666
|
+
}
|
|
667
|
+
default:
|
|
668
|
+
throw new Error(`Unknown resource type: ${e.resourceType.name}`);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
function Dt(e, t, n = !1) {
|
|
672
|
+
const i = [];
|
|
673
|
+
return { isComplete: E(e, t, i, [], n), data: i };
|
|
674
|
+
}
|
|
675
|
+
const b = "1.10.0";
|
|
676
|
+
function Z(e) {
|
|
677
|
+
return e.__renderLambda === !0;
|
|
585
678
|
}
|
|
586
|
-
function
|
|
587
|
-
if (e
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
return
|
|
679
|
+
function I(e) {
|
|
680
|
+
if (e !== void 0)
|
|
681
|
+
return Z(e) ? e.handle : e;
|
|
682
|
+
}
|
|
683
|
+
function y(e) {
|
|
684
|
+
if (e !== void 0)
|
|
685
|
+
return typeof e == "string" ? { __renderLambda: !0, handle: e, retentive: !1 } : e;
|
|
686
|
+
}
|
|
687
|
+
function kt(e) {
|
|
688
|
+
if (e.v3 !== void 0) {
|
|
689
|
+
const {
|
|
690
|
+
initialArgs: t,
|
|
691
|
+
initialUiState: n,
|
|
692
|
+
inputsValid: i,
|
|
693
|
+
outputs: r,
|
|
694
|
+
renderingMode: s,
|
|
695
|
+
sdkVersion: u,
|
|
696
|
+
sections: a,
|
|
697
|
+
title: d
|
|
698
|
+
} = e.v3, { code: l } = e;
|
|
699
|
+
return {
|
|
700
|
+
initialArgs: t,
|
|
701
|
+
initialUiState: n,
|
|
702
|
+
inputsValid: i,
|
|
703
|
+
outputs: r,
|
|
704
|
+
renderingMode: s,
|
|
705
|
+
sdkVersion: u,
|
|
706
|
+
sections: a,
|
|
707
|
+
title: d,
|
|
708
|
+
code: l
|
|
709
|
+
};
|
|
710
|
+
} else if (e.inputsValid !== void 0) {
|
|
711
|
+
const { sdkVersion: t, renderingMode: n, outputs: i, inputsValid: r, sections: s, initialArgs: u, code: a } = e, d = Object.keys(e);
|
|
712
|
+
if (t === void 0 || n === void 0 || i === void 0 || r === void 0 || s === void 0 || u === void 0)
|
|
713
|
+
throw new Error(
|
|
714
|
+
`Malformed config v2. SDK version ${t}; Fields = ${d.join(", ")}`
|
|
715
|
+
);
|
|
716
|
+
return {
|
|
717
|
+
sdkVersion: t,
|
|
718
|
+
renderingMode: n,
|
|
719
|
+
initialArgs: u,
|
|
720
|
+
outputs: Object.fromEntries(
|
|
721
|
+
Object.entries(i).map(([l, g]) => [l, y(g)])
|
|
722
|
+
),
|
|
723
|
+
inputsValid: y(r),
|
|
724
|
+
sections: y(s),
|
|
725
|
+
initialUiState: void 0,
|
|
726
|
+
code: a
|
|
727
|
+
};
|
|
728
|
+
} else if (e.renderingMode !== void 0) {
|
|
729
|
+
const { sdkVersion: t, canRun: n, renderingMode: i, outputs: r, sections: s, initialArgs: u, code: a } = e, d = Object.keys(e);
|
|
730
|
+
if (i === void 0 || r === void 0 || n === void 0 || s === void 0 || u === void 0)
|
|
731
|
+
throw new Error(
|
|
732
|
+
`Malformed config v1. SDK version ${t}; Fields = ${d.join(", ")}`
|
|
733
|
+
);
|
|
734
|
+
return {
|
|
735
|
+
sdkVersion: t ?? "unknown",
|
|
736
|
+
renderingMode: i,
|
|
737
|
+
initialArgs: u,
|
|
738
|
+
outputs: Object.fromEntries(
|
|
739
|
+
Object.entries(r).map(([l, g]) => [l, y(g)])
|
|
740
|
+
),
|
|
741
|
+
inputsValid: y(n),
|
|
742
|
+
sections: y(s),
|
|
743
|
+
initialUiState: void 0,
|
|
744
|
+
code: a
|
|
745
|
+
};
|
|
746
|
+
} else {
|
|
747
|
+
const { sdkVersion: t } = e, n = Object.keys(e);
|
|
748
|
+
throw new Error(
|
|
749
|
+
`Config format not supported: SDK = ${t}; Fields = ${n.join(", ")}`
|
|
750
|
+
);
|
|
593
751
|
}
|
|
594
752
|
}
|
|
595
|
-
class
|
|
596
|
-
constructor(t, n, r,
|
|
597
|
-
this._renderingMode = t, this._initialArgs = n, this._outputs = r, this._inputsValid =
|
|
753
|
+
class p {
|
|
754
|
+
constructor(t, n, i, r, s, u, a) {
|
|
755
|
+
this._renderingMode = t, this._initialArgs = n, this._initialUiState = i, this._outputs = r, this._inputsValid = s, this._sections = u, this._title = a;
|
|
598
756
|
}
|
|
599
|
-
/** Initiates configuration builder */
|
|
600
757
|
static create(t = "Heavy") {
|
|
601
|
-
return new
|
|
758
|
+
return new p(
|
|
602
759
|
t,
|
|
603
760
|
void 0,
|
|
604
761
|
{},
|
|
605
|
-
|
|
606
|
-
|
|
762
|
+
{},
|
|
763
|
+
C(!0),
|
|
764
|
+
C([]),
|
|
765
|
+
void 0
|
|
607
766
|
);
|
|
608
767
|
}
|
|
609
|
-
output(t, n) {
|
|
768
|
+
output(t, n, i = {}) {
|
|
610
769
|
if (typeof n == "function") {
|
|
611
770
|
const r = `output#${t}`;
|
|
612
|
-
return
|
|
771
|
+
return _(r, () => n(new w())), new p(
|
|
613
772
|
this._renderingMode,
|
|
614
773
|
this._initialArgs,
|
|
774
|
+
this._initialUiState,
|
|
615
775
|
{
|
|
616
776
|
...this._outputs,
|
|
617
|
-
[t]:
|
|
777
|
+
[t]: {
|
|
778
|
+
__renderLambda: !0,
|
|
779
|
+
handle: r,
|
|
780
|
+
...i
|
|
781
|
+
}
|
|
618
782
|
},
|
|
619
783
|
this._inputsValid,
|
|
620
|
-
this._sections
|
|
784
|
+
this._sections,
|
|
785
|
+
this._title
|
|
621
786
|
);
|
|
622
787
|
} else
|
|
623
|
-
return new
|
|
788
|
+
return new p(
|
|
624
789
|
this._renderingMode,
|
|
625
790
|
this._initialArgs,
|
|
791
|
+
this._initialUiState,
|
|
626
792
|
{
|
|
627
793
|
...this._outputs,
|
|
628
794
|
[t]: n
|
|
629
795
|
},
|
|
630
796
|
this._inputsValid,
|
|
631
|
-
this._sections
|
|
797
|
+
this._sections,
|
|
798
|
+
this._title
|
|
632
799
|
);
|
|
633
800
|
}
|
|
801
|
+
/** Shortcut for {@link output} with retentive flag set to true. */
|
|
802
|
+
retentiveOutput(t, n) {
|
|
803
|
+
return this.output(t, n, { retentive: !0 });
|
|
804
|
+
}
|
|
634
805
|
/** @deprecated */
|
|
635
806
|
canRun(t) {
|
|
636
807
|
return this.inputsValid(t);
|
|
637
808
|
}
|
|
638
809
|
argsValid(t) {
|
|
639
|
-
return typeof t == "function" ? (
|
|
810
|
+
return typeof t == "function" ? (_("inputsValid", () => t(new w())), new p(
|
|
640
811
|
this._renderingMode,
|
|
641
812
|
this._initialArgs,
|
|
813
|
+
this._initialUiState,
|
|
642
814
|
this._outputs,
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
815
|
+
{
|
|
816
|
+
__renderLambda: !0,
|
|
817
|
+
handle: "inputsValid"
|
|
818
|
+
},
|
|
819
|
+
this._sections,
|
|
820
|
+
this._title
|
|
821
|
+
)) : new p(
|
|
646
822
|
this._renderingMode,
|
|
647
823
|
this._initialArgs,
|
|
824
|
+
this._initialUiState,
|
|
648
825
|
this._outputs,
|
|
649
826
|
t,
|
|
650
|
-
this._sections
|
|
827
|
+
this._sections,
|
|
828
|
+
this._title
|
|
651
829
|
);
|
|
652
830
|
}
|
|
653
831
|
inputsValid(t) {
|
|
654
832
|
return this.argsValid(t);
|
|
655
833
|
}
|
|
656
834
|
sections(t) {
|
|
657
|
-
return Array.isArray(t) ? this.sections(
|
|
835
|
+
return Array.isArray(t) ? this.sections(C(t)) : typeof t == "function" ? (_("sections", () => t(new w())), new p(
|
|
658
836
|
this._renderingMode,
|
|
659
837
|
this._initialArgs,
|
|
838
|
+
this._initialUiState,
|
|
660
839
|
this._outputs,
|
|
661
840
|
this._inputsValid,
|
|
662
|
-
"sections"
|
|
663
|
-
|
|
841
|
+
{ __renderLambda: !0, handle: "sections" },
|
|
842
|
+
this._title
|
|
843
|
+
)) : new p(
|
|
664
844
|
this._renderingMode,
|
|
665
845
|
this._initialArgs,
|
|
846
|
+
this._initialUiState,
|
|
666
847
|
this._outputs,
|
|
667
848
|
this._inputsValid,
|
|
668
|
-
t
|
|
849
|
+
t,
|
|
850
|
+
this._title
|
|
669
851
|
);
|
|
670
852
|
}
|
|
671
|
-
|
|
853
|
+
title(t) {
|
|
854
|
+
return _("title", () => t(new w())), new p(
|
|
855
|
+
this._renderingMode,
|
|
856
|
+
this._initialArgs,
|
|
857
|
+
this._initialUiState,
|
|
858
|
+
this._outputs,
|
|
859
|
+
this._inputsValid,
|
|
860
|
+
this._sections,
|
|
861
|
+
{ __renderLambda: !0, handle: "title" }
|
|
862
|
+
);
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* Sets initial args for the block, this value must be specified.
|
|
866
|
+
* @deprecated use {@link withArgs}
|
|
867
|
+
* */
|
|
672
868
|
initialArgs(t) {
|
|
673
|
-
return new
|
|
869
|
+
return new p(
|
|
674
870
|
this._renderingMode,
|
|
675
871
|
t,
|
|
872
|
+
this._initialUiState,
|
|
676
873
|
this._outputs,
|
|
677
874
|
this._inputsValid,
|
|
678
|
-
this._sections
|
|
875
|
+
this._sections,
|
|
876
|
+
this._title
|
|
877
|
+
);
|
|
878
|
+
}
|
|
879
|
+
/** Sets initial args for the block, this value must be specified. */
|
|
880
|
+
withArgs(t) {
|
|
881
|
+
return new p(
|
|
882
|
+
this._renderingMode,
|
|
883
|
+
t,
|
|
884
|
+
this._initialUiState,
|
|
885
|
+
this._outputs,
|
|
886
|
+
this._inputsValid,
|
|
887
|
+
this._sections,
|
|
888
|
+
this._title
|
|
889
|
+
);
|
|
890
|
+
}
|
|
891
|
+
/** Defines type and sets initial value for block UiState. */
|
|
892
|
+
withUiState(t) {
|
|
893
|
+
return new p(
|
|
894
|
+
this._renderingMode,
|
|
895
|
+
this._initialArgs,
|
|
896
|
+
t,
|
|
897
|
+
this._outputs,
|
|
898
|
+
this._inputsValid,
|
|
899
|
+
this._sections,
|
|
900
|
+
this._title
|
|
679
901
|
);
|
|
680
902
|
}
|
|
681
903
|
/** Renders all provided block settings into a pre-configured platforma API
|
|
@@ -684,32 +906,45 @@ class g {
|
|
|
684
906
|
done() {
|
|
685
907
|
if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
|
|
686
908
|
const t = {
|
|
687
|
-
|
|
909
|
+
v3: {
|
|
910
|
+
sdkVersion: b,
|
|
911
|
+
renderingMode: this._renderingMode,
|
|
912
|
+
initialArgs: this._initialArgs,
|
|
913
|
+
initialUiState: this._initialUiState,
|
|
914
|
+
inputsValid: this._inputsValid,
|
|
915
|
+
sections: this._sections,
|
|
916
|
+
title: this._title,
|
|
917
|
+
outputs: this._outputs
|
|
918
|
+
},
|
|
919
|
+
// fields below are added to allow previous desktop versions read generated configs
|
|
920
|
+
sdkVersion: b,
|
|
688
921
|
renderingMode: this._renderingMode,
|
|
689
922
|
initialArgs: this._initialArgs,
|
|
690
|
-
inputsValid: this._inputsValid,
|
|
691
|
-
sections: this._sections,
|
|
692
|
-
outputs:
|
|
923
|
+
inputsValid: I(this._inputsValid),
|
|
924
|
+
sections: I(this._sections),
|
|
925
|
+
outputs: Object.fromEntries(
|
|
926
|
+
Object.entries(this._outputs).map(([n, i]) => [n, I(i)])
|
|
927
|
+
)
|
|
693
928
|
};
|
|
694
|
-
return
|
|
929
|
+
return K() ? x({ sdkVersion: b }) : { config: t };
|
|
695
930
|
}
|
|
696
931
|
}
|
|
697
|
-
function
|
|
698
|
-
var
|
|
699
|
-
const
|
|
700
|
-
for (const
|
|
701
|
-
for (const
|
|
702
|
-
const
|
|
703
|
-
for (const
|
|
704
|
-
|
|
932
|
+
function xt(e, t, n) {
|
|
933
|
+
var s, u;
|
|
934
|
+
const i = e.resultPool.getData().entries.map((a) => a.obj).filter(D).filter((a) => a.spec.name === "pl7.app/label" && a.spec.axesSpec.length === 1), r = [];
|
|
935
|
+
for (const a of t)
|
|
936
|
+
for (const d of a.spec.axesSpec) {
|
|
937
|
+
const l = O(d);
|
|
938
|
+
for (const g of i)
|
|
939
|
+
N(l, O(g.spec.axesSpec[0])) && r.push(g);
|
|
705
940
|
}
|
|
706
941
|
return e.createPTable({
|
|
707
|
-
columns: [...t, ...
|
|
708
|
-
filters: (
|
|
709
|
-
sorting: (
|
|
942
|
+
columns: [...t, ...r],
|
|
943
|
+
filters: (s = n == null ? void 0 : n.pTableParams) == null ? void 0 : s.filters,
|
|
944
|
+
sorting: (u = n == null ? void 0 : n.pTableParams) == null ? void 0 : u.sorting
|
|
710
945
|
});
|
|
711
946
|
}
|
|
712
|
-
class
|
|
947
|
+
class Lt {
|
|
713
948
|
constructor(t) {
|
|
714
949
|
this.handle = t;
|
|
715
950
|
}
|
|
@@ -729,77 +964,81 @@ class xt {
|
|
|
729
964
|
return await platforma.pFrameDriver.getUniqueValues(this.handle, t);
|
|
730
965
|
}
|
|
731
966
|
}
|
|
732
|
-
function
|
|
733
|
-
return
|
|
967
|
+
function tt(e) {
|
|
968
|
+
return k({
|
|
734
969
|
__isRef: !0,
|
|
735
|
-
blockId:
|
|
736
|
-
name:
|
|
970
|
+
blockId: S(e, "blockId"),
|
|
971
|
+
name: S(e, "name")
|
|
737
972
|
});
|
|
738
973
|
}
|
|
739
|
-
function
|
|
740
|
-
return
|
|
741
|
-
ref:
|
|
742
|
-
label:
|
|
974
|
+
function Tt(e) {
|
|
975
|
+
return k({
|
|
976
|
+
ref: tt(S(e, "ref")),
|
|
977
|
+
label: S(e, "label")
|
|
743
978
|
});
|
|
744
979
|
}
|
|
745
|
-
const
|
|
746
|
-
sdkVersion:
|
|
980
|
+
const jt = {
|
|
981
|
+
sdkVersion: b
|
|
747
982
|
};
|
|
748
|
-
function
|
|
749
|
-
return x();
|
|
983
|
+
function Et() {
|
|
984
|
+
return x({ sdkVersion: b });
|
|
750
985
|
}
|
|
751
|
-
function
|
|
986
|
+
function Mt(e) {
|
|
752
987
|
if (typeof globalThis.getEnvironmentValue == "function")
|
|
753
988
|
return globalThis.getEnvironmentValue(e);
|
|
754
989
|
}
|
|
755
990
|
export {
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
991
|
+
st as Args,
|
|
992
|
+
p as BlockModel,
|
|
993
|
+
jt as CurrentSdkInfo,
|
|
994
|
+
h as FutureRef,
|
|
995
|
+
ot as It,
|
|
996
|
+
Pt as JsRenderInternal,
|
|
997
|
+
at as MainOutputs,
|
|
763
998
|
G as OutputError,
|
|
764
|
-
|
|
999
|
+
Lt as PFrameImpl,
|
|
765
1000
|
w as RenderCtx,
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
1001
|
+
Y as ResourceMapResourcePartitionedTypeName,
|
|
1002
|
+
X as ResourceMapResourceTypeName,
|
|
1003
|
+
Q as ResultPool,
|
|
1004
|
+
ut as StagingOutputs,
|
|
1005
|
+
m as TreeNodeAccessor,
|
|
1006
|
+
lt as UiState,
|
|
1007
|
+
mt as and,
|
|
1008
|
+
xt as createPlDataTable,
|
|
1009
|
+
I as downgradeCfgOrLambda,
|
|
1010
|
+
kt as extractConfig,
|
|
1011
|
+
ht as flatten,
|
|
1012
|
+
Tt as fromPlOption,
|
|
1013
|
+
tt as fromPlRef,
|
|
1014
|
+
wt as getBlobContent,
|
|
1015
|
+
At as getBlobContentAsJson,
|
|
1016
|
+
Ct as getBlobContentAsString,
|
|
1017
|
+
St as getDownloadedBlobContent,
|
|
1018
|
+
Mt as getEnvironmentValue,
|
|
1019
|
+
v as getFromCfg,
|
|
1020
|
+
C as getImmediate,
|
|
1021
|
+
It as getImportProgress,
|
|
1022
|
+
S as getJsonField,
|
|
1023
|
+
Rt as getLastLogs,
|
|
1024
|
+
Vt as getLogHandle,
|
|
1025
|
+
Ft as getOnDemandBlobContent,
|
|
1026
|
+
Ot as getProgressLog,
|
|
1027
|
+
Et as getRawPlatformaInstance,
|
|
1028
|
+
bt as getResourceField,
|
|
1029
|
+
vt as getResourceValueAsJson,
|
|
1030
|
+
Z as isConfigLambda,
|
|
1031
|
+
ft as isEmpty,
|
|
1032
|
+
rt as isolate,
|
|
1033
|
+
ct as makeArray,
|
|
1034
|
+
k as makeObject,
|
|
1035
|
+
pt as mapArrayValues,
|
|
1036
|
+
dt as mapRecordValues,
|
|
1037
|
+
_t as mapResourceFields,
|
|
1038
|
+
gt as not,
|
|
1039
|
+
yt as or,
|
|
1040
|
+
Dt as parseResourceMap,
|
|
1041
|
+
H as readOutput,
|
|
1042
|
+
it as wrapOutputs
|
|
804
1043
|
};
|
|
805
1044
|
//# sourceMappingURL=index.mjs.map
|