@platforma-sdk/workflow-tengo 2.13.6 → 2.14.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 +1 -0
- package/dist/index.mjs +1 -0
- package/dist/tengo/lib/tpl.lib.tengo +1 -1
- package/dist/tengo/lib/waiter.lib.tengo +59 -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_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/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.map-pframe.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.process-pcolumn-data.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.xsv-export-pframe.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 +1 -1
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 = "pframes.export-single-pcolumn" | "pframes.import-dir" | "pframes.map-pframe" | "workdir.save" | "workflow.build-ctx" | "exec.R.create-renv" | "exec.python.install-deps" | "pframes.export-multiple-pcolumns" | "exec.python.create-venv" | "exec.monetization_to_json" | "exec.exec" | "pframes.xsv-export-pframe" | "pframes.xsv-import-map" | "pframes.process-pcolumn-data" | "pframes.export-pframe";
|
|
2
|
+
declare type TplName = "pframes.export-single-pcolumn" | "pframes.import-dir" | "pframes.map-pframe" | "waiter.waiter" | "workdir.save" | "workflow.build-ctx" | "exec.R.create-renv" | "exec.python.install-deps" | "pframes.export-multiple-pcolumns" | "exec.python.create-venv" | "exec.monetization_to_json" | "exec.exec" | "pframes.xsv-export-pframe" | "pframes.xsv-import-map" | "pframes.process-pcolumn-data" | "pframes.export-pframe";
|
|
3
3
|
declare const Templates: Record<TplName, TemplateFromFile>;
|
|
4
4
|
export { Templates };
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ module.exports = { Templates: {
|
|
|
2
2
|
'pframes.export-single-pcolumn': { type: 'from-file', path: require.resolve('./tengo/tpl/pframes.export-single-pcolumn.plj.gz') },
|
|
3
3
|
'pframes.import-dir': { type: 'from-file', path: require.resolve('./tengo/tpl/pframes.import-dir.plj.gz') },
|
|
4
4
|
'pframes.map-pframe': { type: 'from-file', path: require.resolve('./tengo/tpl/pframes.map-pframe.plj.gz') },
|
|
5
|
+
'waiter.waiter': { type: 'from-file', path: require.resolve('./tengo/tpl/waiter.waiter.plj.gz') },
|
|
5
6
|
'workdir.save': { type: 'from-file', path: require.resolve('./tengo/tpl/workdir.save.plj.gz') },
|
|
6
7
|
'workflow.build-ctx': { type: 'from-file', path: require.resolve('./tengo/tpl/workflow.build-ctx.plj.gz') },
|
|
7
8
|
'exec.R.create-renv': { type: 'from-file', path: require.resolve('./tengo/tpl/exec.R.create-renv.plj.gz') },
|
package/dist/index.mjs
CHANGED
|
@@ -3,6 +3,7 @@ export const Templates = {
|
|
|
3
3
|
'pframes.export-single-pcolumn': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/pframes.export-single-pcolumn.plj.gz') },
|
|
4
4
|
'pframes.import-dir': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/pframes.import-dir.plj.gz') },
|
|
5
5
|
'pframes.map-pframe': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/pframes.map-pframe.plj.gz') },
|
|
6
|
+
'waiter.waiter': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/waiter.waiter.plj.gz') },
|
|
6
7
|
'workdir.save': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/workdir.save.plj.gz') },
|
|
7
8
|
'workflow.build-ctx': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/workflow.build-ctx.plj.gz') },
|
|
8
9
|
'exec.R.create-renv': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/exec.R.create-renv.plj.gz') },
|
|
@@ -177,7 +177,7 @@ tpl := func() {
|
|
|
177
177
|
},
|
|
178
178
|
|
|
179
179
|
/**
|
|
180
|
-
* In ephemeral template, body will only be executed when corresponding
|
|
180
|
+
* In ephemeral template, body will only be executed when corresponding inputs state is
|
|
181
181
|
* reached.
|
|
182
182
|
*
|
|
183
183
|
* Signature:
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
fmt := import("fmt")
|
|
2
|
+
ll := import("@platforma-sdk/workflow-tengo:ll")
|
|
3
|
+
render := import("@platforma-sdk/workflow-tengo:render")
|
|
4
|
+
validation := import("@platforma-sdk/workflow-tengo:validation")
|
|
5
|
+
assets := import("@platforma-sdk/workflow-tengo:assets")
|
|
6
|
+
|
|
7
|
+
waiterTpl := assets.importTemplate("@platforma-sdk/workflow-tengo:waiter.waiter")
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Create new waiter, that will wait for all resources given to wait() and pass <pass> to <output> afterwards.
|
|
11
|
+
*
|
|
12
|
+
* @param pass: smart.field | smart.resource - reference to something that should be passed to the output
|
|
13
|
+
* once all waits get ready.
|
|
14
|
+
*/
|
|
15
|
+
builder := func(pass) {
|
|
16
|
+
self := undefined
|
|
17
|
+
|
|
18
|
+
/** type: smart.reference[] */
|
|
19
|
+
whatToWait := []
|
|
20
|
+
|
|
21
|
+
self = ll.toStrict({
|
|
22
|
+
/**
|
|
23
|
+
* Wait for given reference to become ready.
|
|
24
|
+
*
|
|
25
|
+
* @param ref: smart.field | smart.resource - reference to resource to wait for ResourceReady
|
|
26
|
+
* state before passing <pass> to the output of waiter
|
|
27
|
+
*/
|
|
28
|
+
wait: func(ref) {
|
|
29
|
+
validation.assertJsonSchema(ref, validation.reference, "waiter.builder.wait(ref): ref should be a reference to resource or field")
|
|
30
|
+
whatToWait = append(whatToWait, ref)
|
|
31
|
+
|
|
32
|
+
return self
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
build: func() {
|
|
36
|
+
waits := {}
|
|
37
|
+
for i, v in whatToWait {
|
|
38
|
+
waits[fmt.sprintf("input_%d", i)] = v
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
tpl := render.createEphemeral(waiterTpl, {
|
|
42
|
+
"pass": pass,
|
|
43
|
+
"trigger": waits
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
return ll.toStrict({
|
|
47
|
+
output: func() {
|
|
48
|
+
return tpl.output("output")
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
return self
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export ll.toStrict({
|
|
58
|
+
builder: builder
|
|
59
|
+
})
|
|
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
|