@platforma-sdk/workflow-tengo 2.14.0 → 2.15.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/README.md +17 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/dist/index.mjs +3 -1
- package/dist/tengo/lib/assets.lib.tengo +28 -28
- package/dist/tengo/lib/assets.swinfo.lib.tengo +24 -24
- package/dist/tengo/lib/constants.lib.tengo +6 -3
- package/dist/tengo/lib/exec.R.internal.lib.tengo +2 -2
- package/dist/tengo/lib/exec.R.lib.tengo +41 -41
- package/dist/tengo/lib/exec.descriptor.lib.tengo +3 -3
- package/dist/tengo/lib/exec.internal.lib.tengo +41 -41
- package/dist/tengo/lib/exec.lib.tengo +289 -289
- package/dist/tengo/lib/exec.limits.lib.tengo +49 -49
- package/dist/tengo/lib/exec.monetization.lib.tengo +1 -1
- package/dist/tengo/lib/exec.monetization_internal.lib.tengo +38 -38
- package/dist/tengo/lib/exec.package.lib.tengo +53 -53
- package/dist/tengo/lib/exec.python.internal.lib.tengo +1 -1
- package/dist/tengo/lib/exec.python.lib.tengo +37 -37
- package/dist/tengo/lib/exec.runcmd.lib.tengo +138 -138
- package/dist/tengo/lib/exec.runenv.lib.tengo +18 -18
- package/dist/tengo/lib/exec.stream.lib.tengo +25 -25
- package/dist/tengo/lib/feats.lib.tengo +3 -3
- package/dist/tengo/lib/file.internal.lib.tengo +31 -31
- package/dist/tengo/lib/file.lib.tengo +29 -29
- package/dist/tengo/lib/ll.get-future-field-default.lib.tengo +137 -0
- package/dist/tengo/lib/ll.lib.tengo +129 -129
- package/dist/tengo/lib/maps.lib.tengo +38 -38
- package/dist/tengo/lib/objects.lib.tengo +6 -6
- package/dist/tengo/lib/oop.lib.tengo +11 -11
- package/dist/tengo/lib/path.lib.tengo +60 -60
- package/dist/tengo/lib/pframes.builder.lib.tengo +3 -3
- package/dist/tengo/lib/pframes.constants.lib.tengo +20 -20
- package/dist/tengo/lib/pframes.export-pcolumn.lib.tengo +5 -5
- package/dist/tengo/lib/pframes.lib.tengo +206 -198
- package/dist/tengo/lib/pframes.ll.lib.tengo +59 -59
- package/dist/tengo/lib/pframes.pcolumn.lib.tengo +18 -18
- package/dist/tengo/lib/pframes.remove-nulls.lib.tengo +36 -0
- package/dist/tengo/lib/pframes.spec.lib.tengo +83 -83
- package/dist/tengo/lib/pframes.util.lib.tengo +176 -176
- package/dist/tengo/lib/pframes.xsv-import-file.lib.tengo +160 -0
- package/dist/tengo/lib/pframes.xsv.lib.tengo +84 -167
- package/dist/tengo/lib/render.lib.tengo +100 -45
- package/dist/tengo/lib/sets.lib.tengo +44 -44
- package/dist/tengo/lib/slices.lib.tengo +126 -126
- package/dist/tengo/lib/smart.lib.tengo +654 -507
- package/dist/tengo/lib/test.lib.tengo +120 -120
- package/dist/tengo/lib/tpl.lib.tengo +206 -170
- package/dist/tengo/lib/tpl.state-await.lib.tengo +17 -17
- package/dist/tengo/lib/tpl.util.lib.tengo +5 -5
- package/dist/tengo/lib/units.lib.tengo +2 -2
- package/dist/tengo/lib/validation.lib.tengo +130 -130
- package/dist/tengo/lib/waiter.lib.tengo +13 -13
- package/dist/tengo/lib/workdir.lib.tengo +126 -126
- package/dist/tengo/lib/workdir.proc.lib.tengo +47 -47
- package/dist/tengo/lib/workdir.save.lib.tengo +53 -53
- package/dist/tengo/lib/workflow.bobject.lib.tengo +11 -11
- package/dist/tengo/lib/workflow.bquery.lib.tengo +40 -40
- package/dist/tengo/lib/workflow.constants.lib.tengo +1 -1
- package/dist/tengo/lib/workflow.context.lib.tengo +16 -16
- package/dist/tengo/lib/workflow.lib.tengo +76 -76
- package/dist/tengo/tpl/exec.R.create-renv.plj.gz +0 -0
- package/dist/tengo/tpl/exec.exec.plj.gz +0 -0
- package/dist/tengo/tpl/exec.monetization_to_json.plj.gz +0 -0
- package/dist/tengo/tpl/exec.python.create-venv.plj.gz +0 -0
- package/dist/tengo/tpl/exec.python.install-deps.plj.gz +0 -0
- package/dist/tengo/tpl/ll.get-field.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.export-multiple-pcolumns.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.export-pframe.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.export-single-pcolumn.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.import-dir.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.process-pcolumn-data.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.remove-nulls.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.xsv-export-pframe.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.xsv-import-if-not-null.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.xsv-import-map.plj.gz +0 -0
- package/dist/tengo/tpl/waiter.waiter.plj.gz +0 -0
- package/dist/tengo/tpl/workdir.save.plj.gz +0 -0
- package/dist/tengo/tpl/workflow.build-ctx.plj.gz +0 -0
- package/package.json +2 -2
- package/dist/tengo/tpl/pframes.map-pframe.plj.gz +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
4
|
|
|
5
5
|
tx := import("tx")
|
|
6
6
|
ll := import("@platforma-sdk/workflow-tengo:ll")
|
|
@@ -17,30 +17,30 @@ bobject := import("@platforma-sdk/workflow-tengo:workflow.bobject")
|
|
|
17
17
|
bquery := import("@platforma-sdk/workflow-tengo:workflow.bquery")
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
self := import("@platforma-sdk/workflow-tengo:tpl")
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
_RESULTS_FIELD_NAME := "result"
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
_INPUT_CONTEXT_FIELD_NAME := "context"
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
_OUTPUT_CONTEXT_FIELD_NAME := "context"
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
|
|
33
|
+
|
|
34
34
|
_PREPARED_INPUTS_PREFIX := "prepared/"
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
40
|
self.defineOutputs([_RESULTS_FIELD_NAME, _OUTPUT_CONTEXT_FIELD_NAME])
|
|
41
41
|
|
|
42
42
|
_isProduction := func() {
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
return self.rawInputs().isProduction.getValueAsJson() == true
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -48,28 +48,28 @@ _isStaging := func() {
|
|
|
48
48
|
return !_isProduction()
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
|
|
52
|
+
|
|
53
53
|
|
|
54
54
|
_args := undefined
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
59
|
args := func() {
|
|
60
60
|
if is_undefined(_args) {
|
|
61
|
-
|
|
61
|
+
|
|
62
62
|
inputs := self.inputs()
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
|
|
65
65
|
_args = inputs.args
|
|
66
66
|
if is_undefined(_args) || smart.isReference(_args) {
|
|
67
67
|
ll.panic("Unexpected args type: %v", _args)
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
|
|
71
71
|
for k, v in inputs {
|
|
72
|
-
|
|
72
|
+
|
|
73
73
|
if text.has_prefix(k, _PREPARED_INPUTS_PREFIX) {
|
|
74
74
|
|
|
75
75
|
name := text.trim_prefix(k, _PREPARED_INPUTS_PREFIX)
|
|
@@ -85,9 +85,9 @@ args := func() {
|
|
|
85
85
|
|
|
86
86
|
_blockId := undefined
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
91
|
blockId := func() {
|
|
92
92
|
if _blockId == undefined {
|
|
93
93
|
_blockId = self.inputs().blockId
|
|
@@ -99,9 +99,9 @@ blockId := func() {
|
|
|
99
99
|
|
|
100
100
|
__parentContext := undefined
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
105
|
_parentContext := func() {
|
|
106
106
|
if __parentContext == undefined {
|
|
107
107
|
__parentContext = self.inputs()[_INPUT_CONTEXT_FIELD_NAME]
|
|
@@ -112,9 +112,9 @@ _parentContext := func() {
|
|
|
112
112
|
return __parentContext
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
118
|
_buildOutputs := func(results) {
|
|
119
119
|
ll.assert(ll.isMap(results), "expected to see map result from body function")
|
|
120
120
|
ll.assert(
|
|
@@ -128,30 +128,30 @@ _buildOutputs := func(results) {
|
|
|
128
128
|
ll.assert(ll.isMap(results.outputs), "expected a map in outputs returned from workflow.body")
|
|
129
129
|
ll.assert(ll.isMap(results.exports), "expected a map in exports returned from workflow.body")
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
|
|
132
132
|
o := results.outputs
|
|
133
|
-
|
|
133
|
+
|
|
134
134
|
e := results.exports
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
|
|
137
137
|
resBuilder := smart.mapBuilder()
|
|
138
138
|
for name, value in o {
|
|
139
139
|
ll.assert(!is_undefined(value), "value is undefined for output ", name)
|
|
140
140
|
resBuilder.add(name, value)
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
|
|
144
144
|
eData := {}
|
|
145
145
|
eData[constants.NO_PREFIX_EXPORT] = {}
|
|
146
146
|
|
|
147
147
|
for name, value in e {
|
|
148
|
-
|
|
148
|
+
|
|
149
149
|
if smart.isReference(value) {
|
|
150
150
|
eData[name] = value
|
|
151
151
|
continue
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
|
|
155
155
|
ll.assert(
|
|
156
156
|
sets.fromSlice(["spec", "data"]) == sets.fromMapKeys(value),
|
|
157
157
|
"expected spec and data export structure"
|
|
@@ -167,7 +167,7 @@ _buildOutputs := func(results) {
|
|
|
167
167
|
eData[constants.NO_PREFIX_EXPORT][name + ".data"] = value.data
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
|
|
171
171
|
ctxBuilder := render.createEphemeral(
|
|
172
172
|
assets.importTemplate("@platforma-sdk/workflow-tengo:workflow.build-ctx"),
|
|
173
173
|
{
|
|
@@ -177,7 +177,7 @@ _buildOutputs := func(results) {
|
|
|
177
177
|
}
|
|
178
178
|
)
|
|
179
179
|
|
|
180
|
-
|
|
180
|
+
|
|
181
181
|
tplOutputs := {}
|
|
182
182
|
tplOutputs[_RESULTS_FIELD_NAME] = resBuilder.build()
|
|
183
183
|
tplOutputs[_OUTPUT_CONTEXT_FIELD_NAME] = ctxBuilder.output("ctx")
|
|
@@ -185,22 +185,22 @@ _buildOutputs := func(results) {
|
|
|
185
185
|
return tplOutputs
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
194
|
query := func(spec, ...options) {
|
|
195
195
|
return bquery.create(spec, _parentContext(), options...)
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
204
|
resolve := func(ref, ...options) {
|
|
205
205
|
r := bquery.resolve(ref, _parentContext(), options...)
|
|
206
206
|
|
|
@@ -211,14 +211,14 @@ resolve := func(ref, ...options) {
|
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
|
|
214
|
-
|
|
214
|
+
|
|
215
215
|
_preRunTpl := undefined
|
|
216
216
|
|
|
217
217
|
_prepare := func(cb) {
|
|
218
218
|
self.prepare(func(_){
|
|
219
219
|
raw := cb(args())
|
|
220
220
|
prefixed := {}
|
|
221
|
-
|
|
221
|
+
|
|
222
222
|
for k, v in raw {
|
|
223
223
|
prefixed[_PREPARED_INPUTS_PREFIX + k] = v
|
|
224
224
|
}
|
|
@@ -226,12 +226,12 @@ _prepare := func(cb) {
|
|
|
226
226
|
})
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
235
|
prepare := func(cb) {
|
|
236
236
|
if !_isProduction() {
|
|
237
237
|
return
|
|
@@ -239,12 +239,12 @@ prepare := func(cb) {
|
|
|
239
239
|
_prepare(cb)
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
248
|
preparePreRun := func(cb) {
|
|
249
249
|
if !_isStaging() {
|
|
250
250
|
return
|
|
@@ -252,9 +252,9 @@ preparePreRun := func(cb) {
|
|
|
252
252
|
_prepare(cb)
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
258
|
setPreRun := func(tplId) {
|
|
259
259
|
ll.assert(is_undefined(_preRunTpl), "pre run template is already set")
|
|
260
260
|
|
|
@@ -262,18 +262,18 @@ setPreRun := func(tplId) {
|
|
|
262
262
|
_preRunTpl = tplId
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
268
|
validateArgs := func(argsSchema) {
|
|
269
269
|
self.validateInputs({
|
|
270
270
|
args: argsSchema
|
|
271
271
|
})
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
277
|
body := func(bodyFn) {
|
|
278
278
|
|
|
279
279
|
if _isProduction() {
|
|
@@ -288,13 +288,13 @@ body := func(bodyFn) {
|
|
|
288
288
|
|
|
289
289
|
} else if !is_undefined(_preRunTpl) {
|
|
290
290
|
|
|
291
|
-
|
|
291
|
+
|
|
292
292
|
|
|
293
293
|
self.delegate(_preRunTpl, { isProduction: true }, [_RESULTS_FIELD_NAME, _OUTPUT_CONTEXT_FIELD_NAME])
|
|
294
294
|
|
|
295
295
|
} else {
|
|
296
296
|
|
|
297
|
-
|
|
297
|
+
|
|
298
298
|
|
|
299
299
|
self.body(func(_) {
|
|
300
300
|
return _buildOutputs({
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-sdk/workflow-tengo",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.15.0",
|
|
4
4
|
"description": "Tengo SDK library",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@platforma-open/milaboratories.software-small-binaries": "^1.15.13"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@platforma-sdk/tengo-builder": "^1.
|
|
23
|
+
"@platforma-sdk/tengo-builder": "^1.19.0"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"type-check": "pl-tengo check",
|
|
Binary file
|