@lowdefy/operators 6.0.0 → 6.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/serverParser.js +18 -3
- package/dist/webParser.js +15 -2
- package/package.json +3 -3
package/dist/serverParser.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/ import { ConfigError, OperatorError } from '@lowdefy/errors';
|
|
16
16
|
import { serializer, type } from '@lowdefy/helpers';
|
|
17
17
|
let ServerParser = class ServerParser {
|
|
18
|
-
parse({ args, input, items, location, operatorPrefix = '_', payload, state, steps }) {
|
|
18
|
+
parse({ args, arrayIndices = [], error, input, items, location, operatorPrefix = '_', payload, state, steps }) {
|
|
19
19
|
if (type.isUndefined(input)) {
|
|
20
20
|
return {
|
|
21
21
|
output: input,
|
|
@@ -29,6 +29,20 @@ let ServerParser = class ServerParser {
|
|
|
29
29
|
throw new Error('Operator parser location must be a string.');
|
|
30
30
|
}
|
|
31
31
|
const errors = [];
|
|
32
|
+
// Operators that evaluate nested config (_function) re-enter the parser. Binding the frame here
|
|
33
|
+
// means they only pass what they change, so no frame field can be dropped on the way in.
|
|
34
|
+
const parser = {
|
|
35
|
+
parse: (callOptions)=>this.parse({
|
|
36
|
+
arrayIndices,
|
|
37
|
+
error,
|
|
38
|
+
items,
|
|
39
|
+
location,
|
|
40
|
+
payload,
|
|
41
|
+
state,
|
|
42
|
+
steps,
|
|
43
|
+
...callOptions
|
|
44
|
+
})
|
|
45
|
+
};
|
|
32
46
|
const reviver = (_, value)=>{
|
|
33
47
|
if (!type.isObject(value)) return value;
|
|
34
48
|
if (Object.keys(value).length !== 1) return value;
|
|
@@ -41,8 +55,9 @@ let ServerParser = class ServerParser {
|
|
|
41
55
|
try {
|
|
42
56
|
const res = this.operators[op]({
|
|
43
57
|
args,
|
|
44
|
-
arrayIndices
|
|
58
|
+
arrayIndices,
|
|
45
59
|
env: this.env,
|
|
60
|
+
error,
|
|
46
61
|
i18n: this.i18n,
|
|
47
62
|
items,
|
|
48
63
|
jsMap: this.jsMap,
|
|
@@ -52,7 +67,7 @@ let ServerParser = class ServerParser {
|
|
|
52
67
|
operatorPrefix,
|
|
53
68
|
operators: this.operators,
|
|
54
69
|
params,
|
|
55
|
-
parser
|
|
70
|
+
parser,
|
|
56
71
|
payload,
|
|
57
72
|
runtime: 'node',
|
|
58
73
|
secrets: this.secrets,
|
package/dist/webParser.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/ import { ConfigError, OperatorError } from '@lowdefy/errors';
|
|
16
16
|
import { applyArrayIndices, serializer, type } from '@lowdefy/helpers';
|
|
17
17
|
let WebParser = class WebParser {
|
|
18
|
-
parse({ actions, args, arrayIndices, event, input, location, operatorPrefix = '_' }) {
|
|
18
|
+
parse({ actions, args, arrayIndices, error, event, input, location, operatorPrefix = '_' }) {
|
|
19
19
|
if (type.isUndefined(input)) {
|
|
20
20
|
return {
|
|
21
21
|
output: input,
|
|
@@ -32,6 +32,18 @@ let WebParser = class WebParser {
|
|
|
32
32
|
throw new Error('Operator parser location must be a string.');
|
|
33
33
|
}
|
|
34
34
|
const errors = [];
|
|
35
|
+
// Operators that evaluate nested config (_function) re-enter the parser. Binding the frame here
|
|
36
|
+
// means they only pass what they change, so no frame field can be dropped on the way in.
|
|
37
|
+
const parser = {
|
|
38
|
+
parse: (callOptions)=>this.parse({
|
|
39
|
+
actions,
|
|
40
|
+
arrayIndices,
|
|
41
|
+
error,
|
|
42
|
+
event,
|
|
43
|
+
location,
|
|
44
|
+
...callOptions
|
|
45
|
+
})
|
|
46
|
+
};
|
|
35
47
|
const { apiResponses, basePath, home, i18n, inputs, lowdefyApp, lowdefyGlobal, menus, pageId, theme, user, _internal } = this.context._internal.lowdefy;
|
|
36
48
|
const reviver = (_, value)=>{
|
|
37
49
|
if (!type.isObject(value)) return value;
|
|
@@ -50,6 +62,7 @@ let WebParser = class WebParser {
|
|
|
50
62
|
arrayIndices,
|
|
51
63
|
apiResponses,
|
|
52
64
|
basePath,
|
|
65
|
+
error,
|
|
53
66
|
event,
|
|
54
67
|
eventLog: this.context.eventLog,
|
|
55
68
|
globals: _internal.globals,
|
|
@@ -66,7 +79,7 @@ let WebParser = class WebParser {
|
|
|
66
79
|
operators: this.operators,
|
|
67
80
|
pageId,
|
|
68
81
|
params,
|
|
69
|
-
parser
|
|
82
|
+
parser,
|
|
70
83
|
requests: this.context.requests,
|
|
71
84
|
runtime: 'browser',
|
|
72
85
|
state: this.context.state,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/operators",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"dist/*"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@lowdefy/errors": "6.
|
|
38
|
-
"@lowdefy/helpers": "6.
|
|
37
|
+
"@lowdefy/errors": "6.1.0",
|
|
38
|
+
"@lowdefy/helpers": "6.1.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@jest/globals": "28.1.3",
|