@platforma-sdk/workflow-tengo 3.0.0 → 3.0.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/path.lib.tengo +4 -1
- package/dist/tengo/lib/regexp.lib.tengo +36 -0
- package/dist/tengo/lib/tpl.state-await.lib.tengo +2 -1
- package/dist/tengo/lib/validation.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.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/dist/tengo/tpl/workflow.query-anchored.plj.gz +0 -0
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ ll := import("@platforma-sdk/workflow-tengo:ll")
|
|
|
2
2
|
text := import("text")
|
|
3
3
|
slices := import("@platforma-sdk/workflow-tengo:slices")
|
|
4
4
|
validation := import("@platforma-sdk/workflow-tengo:validation")
|
|
5
|
+
regexp := import("@platforma-sdk/workflow-tengo:regexp")
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
|
|
@@ -116,7 +117,9 @@ getExtension := func(path, ...sep) {
|
|
|
116
117
|
sep = _sepOrDefault(sep...)
|
|
117
118
|
|
|
118
119
|
nPoints := 1
|
|
119
|
-
|
|
120
|
+
|
|
121
|
+
archiveRegexp := regexp.compile(`\.(gz|xz|bzip|zstd)$`)
|
|
122
|
+
if archiveRegexp.match(path) {
|
|
120
123
|
nPoints = 2
|
|
121
124
|
}
|
|
122
125
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
ll := import("@platforma-sdk/workflow-tengo:ll")
|
|
4
|
+
text := import("text")
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
compiledCache := {}
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
compile := func(pattern) {
|
|
17
|
+
|
|
18
|
+
if !is_undefined(compiledCache[pattern]) {
|
|
19
|
+
return compiledCache[pattern]
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
compiled := text.re_compile(pattern)
|
|
24
|
+
if is_error(compiled) {
|
|
25
|
+
ll.panic("Error compiling regexp: %v", compiled)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
compiledCache[pattern] = compiled
|
|
30
|
+
|
|
31
|
+
return compiled
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export ll.toStrict({
|
|
35
|
+
compile: compile
|
|
36
|
+
})
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
tx := import("tx")
|
|
7
7
|
ll := import("@platforma-sdk/workflow-tengo:ll")
|
|
8
8
|
text := import("text")
|
|
9
|
+
regexp := import("@platforma-sdk/workflow-tengo:regexp")
|
|
9
10
|
|
|
10
11
|
createContext := func() {
|
|
11
12
|
return {
|
|
@@ -72,7 +73,7 @@ awaitOneState := func(field, path, state) {
|
|
|
72
73
|
return true
|
|
73
74
|
}
|
|
74
75
|
} else {
|
|
75
|
-
regex :=
|
|
76
|
+
regex := regexp.compile(step.match)
|
|
76
77
|
if is_error(regex) {
|
|
77
78
|
ll.panic("Error parsing regex %v: %v", step.match, regex)
|
|
78
79
|
}
|
|
@@ -4,6 +4,7 @@ text := import("text")
|
|
|
4
4
|
maps := import("@platforma-sdk/workflow-tengo:maps")
|
|
5
5
|
enum := import("enum")
|
|
6
6
|
smart := import("@platforma-sdk/workflow-tengo:smart")
|
|
7
|
+
regexp := import("@platforma-sdk/workflow-tengo:regexp")
|
|
7
8
|
|
|
8
9
|
json := import("json")
|
|
9
10
|
|
|
@@ -89,13 +90,13 @@ _validateTypes := func(js, tags, keyPath, ...stack) {
|
|
|
89
90
|
return success
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
if k == "alphanumeric" && ((is_string(js) &&
|
|
93
|
+
if k == "alphanumeric" && ((is_string(js) && regexp.compile("^[[:alnum:]]*$").match(js)) || is_int(js)) {
|
|
93
94
|
return success
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
if k == "string" && is_string(js) {
|
|
97
98
|
regex := tags.tags["regex"]
|
|
98
|
-
if !is_undefined(regex) && !
|
|
99
|
+
if !is_undefined(regex) && !regexp.compile(regex).match(js) {
|
|
99
100
|
return fail(keyPath, "value %q does not conform regex %q", js, regex)
|
|
100
101
|
}
|
|
101
102
|
|
|
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
|