@platforma-sdk/model 1.2.28 → 1.2.30
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/env_value.d.ts +2 -0
- package/dist/env_value.d.ts.map +1 -0
- package/dist/index.d.ts +2 -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 +94 -84
- package/dist/index.mjs.map +1 -1
- package/dist/internal.d.ts +2 -9
- package/dist/internal.d.ts.map +1 -1
- package/dist/raw_globals.d.ts +3 -0
- package/dist/raw_globals.d.ts.map +1 -0
- package/dist/version.d.ts +1 -1
- package/package.json +3 -2
- package/src/env_value.ts +6 -0
- package/src/global.d.ts +12 -0
- package/src/index.ts +2 -0
- package/src/internal.ts +10 -15
- package/src/raw_globals.ts +7 -0
- package/src/version.ts +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var l = (e, t, n) =>
|
|
4
|
-
import { isPColumn as O, mapPObjectData as w, mapValueInVOE as x, mapPTableDef as
|
|
1
|
+
var D = Object.defineProperty;
|
|
2
|
+
var I = (e, t, n) => t in e ? D(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var l = (e, t, n) => I(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { isPColumn as O, mapPObjectData as w, mapValueInVOE as x, mapPTableDef as B } from "@milaboratories/pl-model-common";
|
|
5
5
|
export * from "@milaboratories/pl-model-common";
|
|
6
|
-
class
|
|
6
|
+
class E 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
|
|
12
|
-
if (!e.ok) throw new
|
|
11
|
+
function T(e) {
|
|
12
|
+
if (!e.ok) throw new E(e.errors, e.moreErrors);
|
|
13
13
|
return e.value;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function M(e) {
|
|
16
16
|
return new Proxy(e, {
|
|
17
17
|
get(t, n) {
|
|
18
|
-
return
|
|
18
|
+
return T(t[n]);
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
function i(e) {
|
|
23
|
-
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null ?
|
|
23
|
+
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null ? h(e) : e;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function d(e) {
|
|
26
26
|
return { type: "GetFromCtx", variable: e };
|
|
27
27
|
}
|
|
28
28
|
function K(e) {
|
|
@@ -31,8 +31,8 @@ function K(e) {
|
|
|
31
31
|
cfg: e
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
const W =
|
|
35
|
-
function
|
|
34
|
+
const W = d("$args"), z = d("$it"), U = d("$prod"), q = d("$staging"), Q = d("$ui");
|
|
35
|
+
function h(e) {
|
|
36
36
|
return { type: "Immediate", value: e };
|
|
37
37
|
}
|
|
38
38
|
function C(e) {
|
|
@@ -51,7 +51,7 @@ function X(...e) {
|
|
|
51
51
|
template: t
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function p(e, t) {
|
|
55
55
|
return {
|
|
56
56
|
type: "GetJsonField",
|
|
57
57
|
source: i(e),
|
|
@@ -149,25 +149,25 @@ function ct() {
|
|
|
149
149
|
};
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function gt(e) {
|
|
153
153
|
return {
|
|
154
154
|
type: "GetDownloadedBlobContent",
|
|
155
155
|
source: i(e)
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function dt(e) {
|
|
159
159
|
return {
|
|
160
160
|
type: "GetOnDemandBlobContent",
|
|
161
161
|
source: i(e)
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function ht(e) {
|
|
165
165
|
return {
|
|
166
166
|
type: "GetImportProgress",
|
|
167
167
|
source: i(e)
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function pt(e, t) {
|
|
171
171
|
return {
|
|
172
172
|
type: "GetLastLogs",
|
|
173
173
|
source: i(e),
|
|
@@ -187,29 +187,30 @@ function mt(e) {
|
|
|
187
187
|
source: i(e)
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
|
-
function
|
|
191
|
-
return typeof getPlatforma < "u" || typeof platforma < "u";
|
|
190
|
+
function L() {
|
|
191
|
+
return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
|
|
192
192
|
}
|
|
193
|
-
function
|
|
194
|
-
if (typeof getPlatforma == "function")
|
|
195
|
-
|
|
193
|
+
function _(e) {
|
|
194
|
+
if (e && typeof globalThis.getPlatforma == "function")
|
|
195
|
+
return globalThis.getPlatforma(e);
|
|
196
|
+
if (typeof globalThis.platforma < "u") return globalThis.platforma;
|
|
196
197
|
throw new Error("Can't get platforma instance.");
|
|
197
198
|
}
|
|
198
|
-
function
|
|
199
|
-
if (typeof cfgRenderCtx < "u") return cfgRenderCtx;
|
|
199
|
+
function k() {
|
|
200
|
+
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
200
201
|
}
|
|
201
202
|
function s() {
|
|
202
|
-
if (typeof cfgRenderCtx < "u") return cfgRenderCtx;
|
|
203
|
+
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
203
204
|
throw new Error("Not in config rendering context");
|
|
204
205
|
}
|
|
205
206
|
function f(e, t) {
|
|
206
|
-
const n =
|
|
207
|
+
const n = k();
|
|
207
208
|
if (n === void 0) return !1;
|
|
208
209
|
if (e in n.callbackRegistry) throw new Error(`Callback with key ${e} already registered.`);
|
|
209
210
|
return n.callbackRegistry[e] = t, !0;
|
|
210
211
|
}
|
|
211
212
|
const m = /* @__PURE__ */ new Map();
|
|
212
|
-
function
|
|
213
|
+
function j(e, t) {
|
|
213
214
|
e in s().callbackRegistry || (s().callbackRegistry[e] = (n) => {
|
|
214
215
|
for (const r of m.get(e))
|
|
215
216
|
r(n);
|
|
@@ -219,7 +220,7 @@ class a {
|
|
|
219
220
|
constructor(t, n = (r) => r) {
|
|
220
221
|
l(this, "isResolved", !1);
|
|
221
222
|
l(this, "resolvedValue");
|
|
222
|
-
this.handle = t, this.postProcess = n,
|
|
223
|
+
this.handle = t, this.postProcess = n, j(t, (r) => {
|
|
223
224
|
this.resolvedValue = n(r), this.isResolved = !0;
|
|
224
225
|
});
|
|
225
226
|
}
|
|
@@ -236,10 +237,10 @@ class a {
|
|
|
236
237
|
return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
|
|
237
238
|
}
|
|
238
239
|
}
|
|
239
|
-
function
|
|
240
|
-
return e === void 0 ? void 0 : new
|
|
240
|
+
function A(e) {
|
|
241
|
+
return e === void 0 ? void 0 : new g(e);
|
|
241
242
|
}
|
|
242
|
-
class
|
|
243
|
+
class g {
|
|
243
244
|
constructor(t) {
|
|
244
245
|
this.handle = t;
|
|
245
246
|
}
|
|
@@ -247,7 +248,7 @@ class d {
|
|
|
247
248
|
return this.resolveWithCommon({}, ...t);
|
|
248
249
|
}
|
|
249
250
|
resolveWithCommon(t, ...n) {
|
|
250
|
-
return
|
|
251
|
+
return A(s().resolveWithCommon(this.handle, t, ...n));
|
|
251
252
|
}
|
|
252
253
|
get resourceType() {
|
|
253
254
|
return s().getResourceType(this.handle);
|
|
@@ -265,7 +266,7 @@ class d {
|
|
|
265
266
|
return s().getIsFinal(this.handle);
|
|
266
267
|
}
|
|
267
268
|
getError() {
|
|
268
|
-
return
|
|
269
|
+
return A(s().getError(this.handle));
|
|
269
270
|
}
|
|
270
271
|
listInputFields() {
|
|
271
272
|
return s().listInputFields(this.handle);
|
|
@@ -320,7 +321,7 @@ class d {
|
|
|
320
321
|
if (r === void 0) return;
|
|
321
322
|
const o = {};
|
|
322
323
|
for (const [c, R] of Object.entries(r))
|
|
323
|
-
o[c] = w(R, (
|
|
324
|
+
o[c] = w(R, (S) => new g(S));
|
|
324
325
|
return o;
|
|
325
326
|
}
|
|
326
327
|
getFileContentAsBase64() {
|
|
@@ -383,32 +384,32 @@ class d {
|
|
|
383
384
|
return new a(s().getLogHandle(this.handle));
|
|
384
385
|
}
|
|
385
386
|
}
|
|
386
|
-
const
|
|
387
|
-
function
|
|
387
|
+
const F = "staging", P = "main";
|
|
388
|
+
function v(e) {
|
|
388
389
|
return typeof e == "object" && e !== null && "__awaited_futures__" in e;
|
|
389
390
|
}
|
|
390
|
-
function
|
|
391
|
+
function b(e, t, n) {
|
|
391
392
|
if (t.has(n)) return;
|
|
392
393
|
if (t.add(n), typeof n === "object")
|
|
393
|
-
if (
|
|
394
|
+
if (v(n)) n.__awaited_futures__.forEach((o) => e.add(o));
|
|
394
395
|
else if (Array.isArray(n))
|
|
395
|
-
for (const o of n)
|
|
396
|
+
for (const o of n) b(e, t, o);
|
|
396
397
|
else
|
|
397
398
|
for (const [, o] of Object.entries(n))
|
|
398
|
-
o !== n &&
|
|
399
|
+
o !== n && b(e, t, o);
|
|
399
400
|
}
|
|
400
|
-
function
|
|
401
|
+
function H(e) {
|
|
401
402
|
const t = /* @__PURE__ */ new Set();
|
|
402
|
-
return
|
|
403
|
+
return b(t, /* @__PURE__ */ new Set(), e), t;
|
|
403
404
|
}
|
|
404
405
|
const yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
405
406
|
__proto__: null,
|
|
406
|
-
MainAccessorName:
|
|
407
|
-
StagingAccessorName:
|
|
408
|
-
getAllFutureAwaits:
|
|
409
|
-
isFutureAwait:
|
|
407
|
+
MainAccessorName: P,
|
|
408
|
+
StagingAccessorName: F,
|
|
409
|
+
getAllFutureAwaits: H,
|
|
410
|
+
isFutureAwait: v
|
|
410
411
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
411
|
-
class
|
|
412
|
+
class J {
|
|
412
413
|
constructor() {
|
|
413
414
|
l(this, "ctx", s());
|
|
414
415
|
}
|
|
@@ -423,7 +424,7 @@ class G {
|
|
|
423
424
|
ref: n.ref,
|
|
424
425
|
obj: {
|
|
425
426
|
...n.obj,
|
|
426
|
-
data: new
|
|
427
|
+
data: new g(n.obj.data)
|
|
427
428
|
}
|
|
428
429
|
}))
|
|
429
430
|
};
|
|
@@ -436,7 +437,7 @@ class G {
|
|
|
436
437
|
ref: n.ref,
|
|
437
438
|
obj: {
|
|
438
439
|
...n.obj,
|
|
439
|
-
data: x(n.obj.data, (r) => new
|
|
440
|
+
data: x(n.obj.data, (r) => new g(r))
|
|
440
441
|
}
|
|
441
442
|
}))
|
|
442
443
|
};
|
|
@@ -450,15 +451,15 @@ class y {
|
|
|
450
451
|
l(this, "ctx");
|
|
451
452
|
l(this, "args");
|
|
452
453
|
l(this, "uiState");
|
|
453
|
-
l(this, "resultPool", new
|
|
454
|
+
l(this, "resultPool", new J());
|
|
454
455
|
this.ctx = s(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : void 0;
|
|
455
456
|
}
|
|
456
457
|
getNamedAccessor(t) {
|
|
457
458
|
const n = this.ctx.getAccessorHandleByName(t);
|
|
458
|
-
return n ? new
|
|
459
|
+
return n ? new g(n) : void 0;
|
|
459
460
|
}
|
|
460
461
|
get prerun() {
|
|
461
|
-
return this.getNamedAccessor(
|
|
462
|
+
return this.getNamedAccessor(F);
|
|
462
463
|
}
|
|
463
464
|
/**
|
|
464
465
|
* @deprecated use prerun
|
|
@@ -473,7 +474,7 @@ class y {
|
|
|
473
474
|
return this.precalc;
|
|
474
475
|
}
|
|
475
476
|
get outputs() {
|
|
476
|
-
return this.getNamedAccessor(
|
|
477
|
+
return this.getNamedAccessor(P);
|
|
477
478
|
}
|
|
478
479
|
/**
|
|
479
480
|
* @deprecated use outputs
|
|
@@ -493,17 +494,17 @@ class y {
|
|
|
493
494
|
},
|
|
494
495
|
filters: t.filters ?? [],
|
|
495
496
|
sorting: t.sorting ?? []
|
|
496
|
-
} : n = t, this.ctx.createPTable(
|
|
497
|
+
} : n = t, this.ctx.createPTable(B(n, (r) => w(r, (o) => o.handle)));
|
|
497
498
|
}
|
|
498
499
|
getBlockLabel(t) {
|
|
499
500
|
return this.ctx.getBlockLabel(t);
|
|
500
501
|
}
|
|
501
502
|
}
|
|
502
|
-
const
|
|
503
|
+
const V = "1.2.30";
|
|
503
504
|
function wt(e) {
|
|
504
505
|
return typeof e == "string";
|
|
505
506
|
}
|
|
506
|
-
function
|
|
507
|
+
function bt(e) {
|
|
507
508
|
if (e.inputsValid !== void 0) return e;
|
|
508
509
|
{
|
|
509
510
|
if (e.canRun === void 0)
|
|
@@ -522,8 +523,8 @@ class u {
|
|
|
522
523
|
t,
|
|
523
524
|
void 0,
|
|
524
525
|
{},
|
|
525
|
-
|
|
526
|
-
|
|
526
|
+
h(!0),
|
|
527
|
+
h([])
|
|
527
528
|
);
|
|
528
529
|
}
|
|
529
530
|
output(t, n) {
|
|
@@ -574,7 +575,7 @@ class u {
|
|
|
574
575
|
return this.argsValid(t);
|
|
575
576
|
}
|
|
576
577
|
sections(t) {
|
|
577
|
-
return Array.isArray(t) ? this.sections(
|
|
578
|
+
return Array.isArray(t) ? this.sections(h(t)) : typeof t == "function" ? (f("sections", () => t(new y())), new u(
|
|
578
579
|
this._renderingMode,
|
|
579
580
|
this._initialArgs,
|
|
580
581
|
this._outputs,
|
|
@@ -604,17 +605,17 @@ class u {
|
|
|
604
605
|
done() {
|
|
605
606
|
if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
|
|
606
607
|
const t = {
|
|
607
|
-
sdkVersion:
|
|
608
|
+
sdkVersion: V,
|
|
608
609
|
renderingMode: this._renderingMode,
|
|
609
610
|
initialArgs: this._initialArgs,
|
|
610
611
|
inputsValid: this._inputsValid,
|
|
611
612
|
sections: this._sections,
|
|
612
613
|
outputs: this._outputs
|
|
613
614
|
};
|
|
614
|
-
return
|
|
615
|
+
return L() ? _(t) : { config: t };
|
|
615
616
|
}
|
|
616
617
|
}
|
|
617
|
-
class
|
|
618
|
+
class At {
|
|
618
619
|
constructor(t) {
|
|
619
620
|
this.handle = t;
|
|
620
621
|
}
|
|
@@ -634,22 +635,29 @@ class bt {
|
|
|
634
635
|
return await platforma.pFrameDriver.getUniqueValues(this.handle, t);
|
|
635
636
|
}
|
|
636
637
|
}
|
|
637
|
-
function
|
|
638
|
+
function G(e) {
|
|
638
639
|
return C({
|
|
639
640
|
__isRef: !0,
|
|
640
|
-
blockId:
|
|
641
|
-
name:
|
|
641
|
+
blockId: p(e, "blockId"),
|
|
642
|
+
name: p(e, "name")
|
|
642
643
|
});
|
|
643
644
|
}
|
|
644
645
|
function Ct(e) {
|
|
645
646
|
return C({
|
|
646
|
-
ref:
|
|
647
|
-
label:
|
|
647
|
+
ref: G(p(e, "ref")),
|
|
648
|
+
label: p(e, "label")
|
|
648
649
|
});
|
|
649
650
|
}
|
|
650
651
|
const _t = {
|
|
651
|
-
sdkVersion:
|
|
652
|
+
sdkVersion: V
|
|
652
653
|
};
|
|
654
|
+
function Ft() {
|
|
655
|
+
return _();
|
|
656
|
+
}
|
|
657
|
+
function Pt(e) {
|
|
658
|
+
if (typeof globalThis.getEnvironmentValue == "function")
|
|
659
|
+
return globalThis.getEnvironmentValue(e);
|
|
660
|
+
}
|
|
653
661
|
export {
|
|
654
662
|
W as Args,
|
|
655
663
|
u as BlockModel,
|
|
@@ -658,29 +666,31 @@ export {
|
|
|
658
666
|
z as It,
|
|
659
667
|
yt as JsRenderInternal,
|
|
660
668
|
U as MainOutputs,
|
|
661
|
-
|
|
662
|
-
|
|
669
|
+
E as OutputError,
|
|
670
|
+
At as PFrameImpl,
|
|
663
671
|
y as RenderCtx,
|
|
664
|
-
|
|
672
|
+
J as ResultPool,
|
|
665
673
|
q as StagingOutputs,
|
|
666
|
-
|
|
674
|
+
g as TreeNodeAccessor,
|
|
667
675
|
Q as UiState,
|
|
668
676
|
rt as and,
|
|
669
677
|
tt as flatten,
|
|
670
678
|
Ct as fromPlOption,
|
|
671
|
-
|
|
679
|
+
G as fromPlRef,
|
|
672
680
|
ut as getBlobContent,
|
|
673
681
|
ct as getBlobContentAsJson,
|
|
674
682
|
lt as getBlobContentAsString,
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
683
|
+
gt as getDownloadedBlobContent,
|
|
684
|
+
Pt as getEnvironmentValue,
|
|
685
|
+
d as getFromCfg,
|
|
686
|
+
h as getImmediate,
|
|
687
|
+
ht as getImportProgress,
|
|
688
|
+
p as getJsonField,
|
|
689
|
+
pt as getLastLogs,
|
|
681
690
|
mt as getLogHandle,
|
|
682
|
-
|
|
691
|
+
dt as getOnDemandBlobContent,
|
|
683
692
|
ft as getProgressLog,
|
|
693
|
+
Ft as getRawPlatformaInstance,
|
|
684
694
|
it as getResourceField,
|
|
685
695
|
ot as getResourceValueAsJson,
|
|
686
696
|
et as isEmpty,
|
|
@@ -691,10 +701,10 @@ export {
|
|
|
691
701
|
Z as mapArrayValues,
|
|
692
702
|
Y as mapRecordValues,
|
|
693
703
|
at as mapResourceFields,
|
|
694
|
-
|
|
704
|
+
bt as normalizeBlockConfig,
|
|
695
705
|
nt as not,
|
|
696
706
|
st as or,
|
|
697
|
-
|
|
698
|
-
|
|
707
|
+
T as readOutput,
|
|
708
|
+
M as wrapOutputs
|
|
699
709
|
};
|
|
700
710
|
//# sourceMappingURL=index.mjs.map
|