@platforma-sdk/workflow-tengo 4.2.3 → 4.3.1
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/tengo/lib/pframes.bundle.lib.tengo +126 -20
- package/dist/tengo/tpl/check_network.download_blob.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.download_blob_from_storage.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.run_hello_world.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.run_hello_world_py.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.upload_blob.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.upload_template.plj.gz +0 -0
- 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_info.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-for-ui.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.slice-data.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/dist/tengo/tpl/workflow.query-anchored.plj.gz +0 -0
- package/package.json +1 -1
|
@@ -52,6 +52,14 @@ strings := import("@platforma-sdk/workflow-tengo:strings")
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
55
63
|
|
|
56
64
|
|
|
57
65
|
|
|
@@ -75,8 +83,8 @@ createBuilder := func(ctx) {
|
|
|
75
83
|
ignoreMissingDomains: false
|
|
76
84
|
}
|
|
77
85
|
|
|
78
|
-
addSingleInner := func(id, ...
|
|
79
|
-
ll.assert(len(
|
|
86
|
+
addSingleInner := func(id, ...ops) {
|
|
87
|
+
ll.assert(len(ops) <= 2, "addSingle accepts at most two optional arguments")
|
|
80
88
|
|
|
81
89
|
decodedId := undefined
|
|
82
90
|
if is_string(id) {
|
|
@@ -87,8 +95,31 @@ createBuilder := func(ctx) {
|
|
|
87
95
|
ll.panic("Invalid column ID type. Expected string or object.")
|
|
88
96
|
}
|
|
89
97
|
|
|
98
|
+
queryKey := undefined
|
|
99
|
+
if len(ops) > 0 {
|
|
100
|
+
if !is_string(ops[0]) {
|
|
101
|
+
ll.panic("Invalid queryKey type. Expected single string option, got ", ops[0])
|
|
102
|
+
}
|
|
103
|
+
queryKey = ops[0]
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if len(ops) == 2 {
|
|
107
|
+
if !is_map(ops[1]) {
|
|
108
|
+
ll.panic("Invalid options type. Expected map got ", ops[1])
|
|
109
|
+
}
|
|
110
|
+
if !is_undefined(ops[1].overrides) {
|
|
111
|
+
|
|
112
|
+
decodedId = maps.deepMerge(decodedId, ops[1].overrides)
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
queryOpts := undefined
|
|
117
|
+
if len(ops) > 1 {
|
|
118
|
+
queryOpts = ops[1]
|
|
119
|
+
}
|
|
120
|
+
|
|
90
121
|
isFiltered := is_map(decodedId) && !is_undefined(decodedId.source) && !is_undefined(decodedId.axisFilters)
|
|
91
|
-
if isFiltered &&
|
|
122
|
+
if isFiltered && !is_undefined(queryKey) {
|
|
92
123
|
ll.panic("FilteredPColumnId cannot be used with a queryKey.")
|
|
93
124
|
}
|
|
94
125
|
|
|
@@ -104,24 +135,55 @@ createBuilder := func(ctx) {
|
|
|
104
135
|
}
|
|
105
136
|
|
|
106
137
|
keyToUse := defaultKey
|
|
107
|
-
if
|
|
108
|
-
keyToUse = queryKey
|
|
138
|
+
if !is_undefined(queryKey) {
|
|
139
|
+
keyToUse = queryKey
|
|
109
140
|
}
|
|
110
141
|
|
|
111
142
|
queries[keyToUse] = valueToStore
|
|
112
143
|
}
|
|
113
144
|
|
|
114
|
-
addMultiInner := func(query, ...
|
|
115
|
-
ll.assert(len(
|
|
145
|
+
addMultiInner := func(query, ...ops) {
|
|
146
|
+
ll.assert(len(ops) <= 2, "addMulti accepts at most two optional arguments")
|
|
147
|
+
|
|
148
|
+
decodedQuery := undefined
|
|
149
|
+
if is_string(query) {
|
|
150
|
+
decodedQuery = json.decode(query)
|
|
151
|
+
} else if is_map(query) {
|
|
152
|
+
decodedQuery = query
|
|
153
|
+
} else {
|
|
154
|
+
ll.panic("Invalid query type. Expected string or object.")
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
queryKey := undefined
|
|
158
|
+
if len(ops) > 0 {
|
|
159
|
+
if !is_string(ops[0]) {
|
|
160
|
+
ll.panic("Invalid queryKey type. Expected single string option, got ", ops[0])
|
|
161
|
+
}
|
|
162
|
+
queryKey = ops[0]
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if len(ops) == 2 {
|
|
166
|
+
if !is_map(ops[1]) {
|
|
167
|
+
ll.panic("Invalid options type. Expected map got ", ops[1])
|
|
168
|
+
}
|
|
169
|
+
if !is_undefined(ops[1].overrides) {
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
decodedQuery = maps.deepMerge(decodedQuery, ops[1].overrides)
|
|
173
|
+
}
|
|
174
|
+
}
|
|
116
175
|
|
|
176
|
+
|
|
177
|
+
decodedQuery.matchStrategy = "expectMultiple"
|
|
178
|
+
|
|
117
179
|
keyToUse := undefined
|
|
118
|
-
if
|
|
119
|
-
keyToUse = queryKey
|
|
180
|
+
if !is_undefined(queryKey) {
|
|
181
|
+
keyToUse = queryKey
|
|
120
182
|
} else {
|
|
121
183
|
keyToUse = canonical.encode(query)
|
|
122
184
|
}
|
|
123
185
|
|
|
124
|
-
queries[keyToUse] =
|
|
186
|
+
queries[keyToUse] = decodedQuery
|
|
125
187
|
}
|
|
126
188
|
|
|
127
189
|
self := undefined
|
|
@@ -314,9 +376,24 @@ pColumnBundleUnmarshaller := func() {
|
|
|
314
376
|
|
|
315
377
|
result := bResultUnmarshaller.parse(value.getValue(), parser)
|
|
316
378
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
379
|
+
if is_array(result) {
|
|
380
|
+
arr := []
|
|
381
|
+
for i, r in result {
|
|
382
|
+
k := resultKey + string(i)
|
|
383
|
+
el := {
|
|
384
|
+
key: k,
|
|
385
|
+
spec: r.spec,
|
|
386
|
+
data: r.data
|
|
387
|
+
}
|
|
388
|
+
pool[k] = el
|
|
389
|
+
arr = append(arr, el)
|
|
390
|
+
}
|
|
391
|
+
pool[resultKey] = arr
|
|
392
|
+
} else {
|
|
393
|
+
pool[resultKey] = {
|
|
394
|
+
spec: result.spec,
|
|
395
|
+
data: result.data
|
|
396
|
+
}
|
|
320
397
|
}
|
|
321
398
|
}
|
|
322
399
|
|
|
@@ -325,6 +402,19 @@ pColumnBundleUnmarshaller := func() {
|
|
|
325
402
|
|
|
326
403
|
axisHeaderOverrides := []
|
|
327
404
|
|
|
405
|
+
get := func(resultKey) {
|
|
406
|
+
if !is_string(resultKey) {
|
|
407
|
+
resultKey = canonical.encode(resultKey)
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
result := pool[resultKey]
|
|
411
|
+
if is_undefined(result) {
|
|
412
|
+
ll.panic("Column not found: %v. Pool: %v", resultKey, maps.getKeys(pool))
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
return result
|
|
416
|
+
}
|
|
417
|
+
|
|
328
418
|
bundle := undefined
|
|
329
419
|
bundle = ll.toStrict({
|
|
330
420
|
|
|
@@ -332,15 +422,26 @@ pColumnBundleUnmarshaller := func() {
|
|
|
332
422
|
|
|
333
423
|
|
|
334
424
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
425
|
+
|
|
426
|
+
getColumns: func(resultKey) {
|
|
427
|
+
result := get(resultKey)
|
|
428
|
+
if !is_array(result) {
|
|
429
|
+
ll.panic("Expected a multi-column result, got a single column: %v. User getColumn() instead.", resultKey)
|
|
338
430
|
}
|
|
431
|
+
return result
|
|
432
|
+
},
|
|
433
|
+
|
|
339
434
|
|
|
340
|
-
|
|
341
|
-
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
getColumn: func(resultKey) {
|
|
440
|
+
result := get(resultKey)
|
|
441
|
+
if is_array(result) {
|
|
442
|
+
ll.panic("Cannot get a single column from a multi-column result: %v. Use getColumns() instead.", resultKey)
|
|
342
443
|
}
|
|
343
|
-
return
|
|
444
|
+
return result
|
|
344
445
|
},
|
|
345
446
|
|
|
346
447
|
|
|
@@ -358,7 +459,12 @@ pColumnBundleUnmarshaller := func() {
|
|
|
358
459
|
ll.panic("Column not found in bundle: " + columnKey)
|
|
359
460
|
}
|
|
360
461
|
|
|
361
|
-
|
|
462
|
+
result := pool[columnKey]
|
|
463
|
+
if is_array(result) {
|
|
464
|
+
ll.panic("Cannot get a single column from a multi-column result: " + columnKey + ". Use get() instead.")
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
baseSpec := result.spec
|
|
362
468
|
|
|
363
469
|
|
|
364
470
|
if !is_undefined(columnAxisFilters) && len(columnAxisFilters) > 0 {
|
|
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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|