@platforma-sdk/workflow-tengo 3.0.3 → 3.1.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/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/index.mjs +2 -1
- package/dist/tengo/lib/canonical.lib.tengo +73 -0
- package/dist/tengo/lib/exec.monetization.lib.tengo +3 -1
- package/dist/tengo/lib/exec.monetization_internal.lib.tengo +2 -1
- package/dist/tengo/lib/maps.lib.tengo +1 -1
- package/dist/tengo/lib/pframes.builder.lib.tengo +5 -1
- package/dist/tengo/lib/pframes.bundle.lib.tengo +544 -0
- package/dist/tengo/lib/pframes.constants.lib.tengo +5 -1
- package/dist/tengo/lib/pframes.lib.tengo +3 -0
- package/dist/tengo/lib/pframes.spec.lib.tengo +224 -1
- package/dist/tengo/lib/pframes.xsv-import-file.lib.tengo +3 -3
- package/dist/tengo/lib/pframes.xsv.lib.tengo +79 -4
- package/dist/tengo/lib/sets.lib.tengo +2 -0
- package/dist/tengo/lib/slices.lib.tengo +4 -1
- package/dist/tengo/lib/smart.lib.tengo +24 -6
- package/dist/tengo/lib/tpl.base.lib.tengo +582 -0
- package/dist/tengo/lib/tpl.lib.tengo +6 -567
- package/dist/tengo/lib/tpl.light.lib.tengo +9 -0
- package/dist/tengo/lib/workdir.proc.lib.tengo +1 -1
- package/dist/tengo/lib/workflow.lib.tengo +41 -2
- package/dist/tengo/lib/workflow.model.lib.tengo +3 -2
- 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 +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
declare type TemplateFromFile = { readonly type: "from-file"; readonly path: string; };
|
|
2
|
-
declare type TplName = "ll.get-field" | "
|
|
2
|
+
declare type TplName = "ll.get-field" | "pframes.export-single-pcolumn" | "pframes.import-dir" | "pframes.remove-nulls" | "waiter.waiter" | "workdir.save" | "workflow.build-ctx" | "workflow.query-anchored" | "exec.R.create-renv" | "exec.python.install-deps" | "pframes.export-multiple-pcolumns" | "exec.python.create-venv" | "exec.monetization_to_json" | "exec.exec" | "exec.monetization_info" | "pframes.xsv-export-pframe" | "pframes.xsv-import-if-not-null" | "pframes.xsv-import-map" | "pframes.process-pcolumn-data" | "pframes.slice-data" | "pframes.export-pframe" | "pframes.export-pframe-for-ui";
|
|
3
3
|
declare const Templates: Record<TplName, TemplateFromFile>;
|
|
4
4
|
export { Templates };
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
module.exports = { Templates: {
|
|
2
2
|
'll.get-field': { type: 'from-file', path: require.resolve('./tengo/tpl/ll.get-field.plj.gz') },
|
|
3
|
-
'workflow.query-anchored': { type: 'from-file', path: require.resolve('./tengo/tpl/workflow.query-anchored.plj.gz') },
|
|
4
3
|
'pframes.export-single-pcolumn': { type: 'from-file', path: require.resolve('./tengo/tpl/pframes.export-single-pcolumn.plj.gz') },
|
|
5
4
|
'pframes.import-dir': { type: 'from-file', path: require.resolve('./tengo/tpl/pframes.import-dir.plj.gz') },
|
|
6
5
|
'pframes.remove-nulls': { type: 'from-file', path: require.resolve('./tengo/tpl/pframes.remove-nulls.plj.gz') },
|
|
7
6
|
'waiter.waiter': { type: 'from-file', path: require.resolve('./tengo/tpl/waiter.waiter.plj.gz') },
|
|
8
7
|
'workdir.save': { type: 'from-file', path: require.resolve('./tengo/tpl/workdir.save.plj.gz') },
|
|
9
8
|
'workflow.build-ctx': { type: 'from-file', path: require.resolve('./tengo/tpl/workflow.build-ctx.plj.gz') },
|
|
9
|
+
'workflow.query-anchored': { type: 'from-file', path: require.resolve('./tengo/tpl/workflow.query-anchored.plj.gz') },
|
|
10
10
|
'exec.R.create-renv': { type: 'from-file', path: require.resolve('./tengo/tpl/exec.R.create-renv.plj.gz') },
|
|
11
11
|
'exec.python.install-deps': { type: 'from-file', path: require.resolve('./tengo/tpl/exec.python.install-deps.plj.gz') },
|
|
12
12
|
'pframes.export-multiple-pcolumns': { type: 'from-file', path: require.resolve('./tengo/tpl/pframes.export-multiple-pcolumns.plj.gz') },
|
|
@@ -18,6 +18,7 @@ module.exports = { Templates: {
|
|
|
18
18
|
'pframes.xsv-import-if-not-null': { type: 'from-file', path: require.resolve('./tengo/tpl/pframes.xsv-import-if-not-null.plj.gz') },
|
|
19
19
|
'pframes.xsv-import-map': { type: 'from-file', path: require.resolve('./tengo/tpl/pframes.xsv-import-map.plj.gz') },
|
|
20
20
|
'pframes.process-pcolumn-data': { type: 'from-file', path: require.resolve('./tengo/tpl/pframes.process-pcolumn-data.plj.gz') },
|
|
21
|
+
'pframes.slice-data': { type: 'from-file', path: require.resolve('./tengo/tpl/pframes.slice-data.plj.gz') },
|
|
21
22
|
'pframes.export-pframe': { type: 'from-file', path: require.resolve('./tengo/tpl/pframes.export-pframe.plj.gz') },
|
|
22
23
|
'pframes.export-pframe-for-ui': { type: 'from-file', path: require.resolve('./tengo/tpl/pframes.export-pframe-for-ui.plj.gz') }
|
|
23
24
|
}};
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { resolve } from 'node:path';
|
|
2
2
|
export const Templates = {
|
|
3
3
|
'll.get-field': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/ll.get-field.plj.gz') },
|
|
4
|
-
'workflow.query-anchored': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/workflow.query-anchored.plj.gz') },
|
|
5
4
|
'pframes.export-single-pcolumn': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/pframes.export-single-pcolumn.plj.gz') },
|
|
6
5
|
'pframes.import-dir': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/pframes.import-dir.plj.gz') },
|
|
7
6
|
'pframes.remove-nulls': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/pframes.remove-nulls.plj.gz') },
|
|
8
7
|
'waiter.waiter': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/waiter.waiter.plj.gz') },
|
|
9
8
|
'workdir.save': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/workdir.save.plj.gz') },
|
|
10
9
|
'workflow.build-ctx': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/workflow.build-ctx.plj.gz') },
|
|
10
|
+
'workflow.query-anchored': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/workflow.query-anchored.plj.gz') },
|
|
11
11
|
'exec.R.create-renv': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/exec.R.create-renv.plj.gz') },
|
|
12
12
|
'exec.python.install-deps': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/exec.python.install-deps.plj.gz') },
|
|
13
13
|
'pframes.export-multiple-pcolumns': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/pframes.export-multiple-pcolumns.plj.gz') },
|
|
@@ -19,6 +19,7 @@ export const Templates = {
|
|
|
19
19
|
'pframes.xsv-import-if-not-null': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/pframes.xsv-import-if-not-null.plj.gz') },
|
|
20
20
|
'pframes.xsv-import-map': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/pframes.xsv-import-map.plj.gz') },
|
|
21
21
|
'pframes.process-pcolumn-data': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/pframes.process-pcolumn-data.plj.gz') },
|
|
22
|
+
'pframes.slice-data': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/pframes.slice-data.plj.gz') },
|
|
22
23
|
'pframes.export-pframe': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/pframes.export-pframe.plj.gz') },
|
|
23
24
|
'pframes.export-pframe-for-ui': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/pframes.export-pframe-for-ui.plj.gz') }
|
|
24
25
|
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
ll := import("@platforma-sdk/workflow-tengo:ll")
|
|
2
|
+
maps := import("@platforma-sdk/workflow-tengo:maps")
|
|
3
|
+
json := import("json")
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
encode := func(obj) {
|
|
13
|
+
if is_map(obj) || ll.isStrict(obj) {
|
|
14
|
+
|
|
15
|
+
_obj := obj
|
|
16
|
+
if ll.isStrict(obj) {
|
|
17
|
+
_obj = ll.fromStrict(obj)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
sortedKeys := maps.getKeys(_obj)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
result := "{"
|
|
25
|
+
|
|
26
|
+
for i, key in sortedKeys {
|
|
27
|
+
value := _obj[key]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
if i > 0 {
|
|
31
|
+
result = result + ","
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
result = result + json.encode(key) + ":"
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
if is_map(value) || is_array(value) || ll.isStrict(value) {
|
|
39
|
+
result = result + encode(value)
|
|
40
|
+
} else {
|
|
41
|
+
result = result + json.encode(value)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return result + "}"
|
|
46
|
+
} else if is_array(obj) {
|
|
47
|
+
|
|
48
|
+
result := "["
|
|
49
|
+
|
|
50
|
+
for i, value in obj {
|
|
51
|
+
|
|
52
|
+
if i > 0 {
|
|
53
|
+
result = result + ","
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
if is_map(value) || is_array(value) || ll.isStrict(value) {
|
|
58
|
+
result = result + encode(value)
|
|
59
|
+
} else {
|
|
60
|
+
result = result + json.encode(value)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return result + "]"
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
return json.encode(obj)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export ll.toStrict({
|
|
72
|
+
encode: encode
|
|
73
|
+
})
|
|
@@ -7,6 +7,8 @@ render := import("@platforma-sdk/workflow-tengo:render")
|
|
|
7
7
|
smart := import("@platforma-sdk/workflow-tengo:smart")
|
|
8
8
|
validation := import("@platforma-sdk/workflow-tengo:validation")
|
|
9
9
|
|
|
10
|
+
mznInfoTpl := assets.importTemplate("@platforma-sdk/workflow-tengo:exec.monetization_info")
|
|
11
|
+
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
|
|
@@ -119,7 +121,7 @@ builder := func(productKey) {
|
|
|
119
121
|
|
|
120
122
|
|
|
121
123
|
result := render.create(
|
|
122
|
-
|
|
124
|
+
mznInfoTpl,
|
|
123
125
|
{
|
|
124
126
|
date: date, // solely for deduplication
|
|
125
127
|
monetization: monetization.toJson(mnz),
|
|
@@ -218,9 +218,10 @@ setUrl := func(mnz, url) {
|
|
|
218
218
|
run := func(mnz, wd, queue) {
|
|
219
219
|
_validateIsReady(mnz)
|
|
220
220
|
|
|
221
|
+
mnzSw := assets.importSoftware("@platforma-open/milaboratories.software-small-binaries:mnz-client")
|
|
222
|
+
|
|
221
223
|
exprType := feats.commandExpressions ? constants.ARG_TYPE_EXPRESSION : constants.ARG_TYPE_VAR
|
|
222
224
|
|
|
223
|
-
mnzSw := assets.importSoftware("@platforma-open/milaboratories.software-small-binaries:mnz-client")
|
|
224
225
|
builder := runcmd.builder(wd)
|
|
225
226
|
builder.envTyped("MI_LICENSE", exprType, "{secrets.MI_LICENSE}")
|
|
226
227
|
|
|
@@ -2,7 +2,8 @@ ll := import("@platforma-sdk/workflow-tengo:ll")
|
|
|
2
2
|
oop := import("@platforma-sdk/workflow-tengo:oop")
|
|
3
3
|
smart := import("@platforma-sdk/workflow-tengo:smart")
|
|
4
4
|
pConstants := import("@platforma-sdk/workflow-tengo:pframes.constants")
|
|
5
|
-
|
|
5
|
+
pSpec := import("@platforma-sdk/workflow-tengo:pframes.spec")
|
|
6
|
+
validation := import("@platforma-sdk/workflow-tengo:validation")
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
|
@@ -15,6 +16,9 @@ pFrameBuilder := func() {
|
|
|
15
16
|
|
|
16
17
|
add: func(column, spec, data) {
|
|
17
18
|
if (!is_undefined(spec)) {
|
|
19
|
+
if !smart.isReference(spec) {
|
|
20
|
+
validation.assertType(spec, pSpec.P_OBJECT_SPEC_SCHEMA)
|
|
21
|
+
}
|
|
18
22
|
r.createInputField(column + ".spec").setRefOrJson(spec)
|
|
19
23
|
}
|
|
20
24
|
if (!is_undefined(data)) {
|