@lowdefy/operators 4.0.0-rc.9 → 4.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/buildParser.js +3 -3
- package/dist/getFromArray.js +2 -2
- package/dist/getFromObject.js +2 -2
- package/dist/index.js +1 -1
- package/dist/runClass.js +4 -4
- package/dist/runInstance.js +2 -2
- package/dist/serverParser.js +3 -3
- package/dist/webParser.js +6 -6
- package/package.json +14 -16
package/dist/buildParser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
let BuildParser = class BuildParser {
|
|
17
17
|
// TODO: Look at logging here
|
|
18
18
|
// TODO: Remove console.error = () => {}; from tests
|
|
19
|
-
parse({ args
|
|
19
|
+
parse({ args, input, location, operatorPrefix = '_' }) {
|
|
20
20
|
if (type.isUndefined(input)) {
|
|
21
21
|
return {
|
|
22
22
|
output: input,
|
|
@@ -71,7 +71,7 @@ let BuildParser = class BuildParser {
|
|
|
71
71
|
errors
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
-
constructor({ env
|
|
74
|
+
constructor({ env, payload, secrets, user, operators, verbose }){
|
|
75
75
|
this.env = env;
|
|
76
76
|
this.operators = operators;
|
|
77
77
|
this.parse = this.parse.bind(this);
|
package/dist/getFromArray.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
-
function getFromArray({ params
|
|
16
|
+
function getFromArray({ params, array, key, operator, location }) {
|
|
17
17
|
if (params === true) return array;
|
|
18
18
|
if (type.isString(params)) {
|
|
19
19
|
return array.find((item)=>item[key] === params);
|
package/dist/getFromObject.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { applyArrayIndices, get, serializer, type } from '@lowdefy/helpers';
|
|
16
|
-
function getFromObject({ params
|
|
16
|
+
function getFromObject({ params, object, arrayIndices, operator, location }) {
|
|
17
17
|
if (params === true) params = {
|
|
18
18
|
all: true
|
|
19
19
|
};
|
package/dist/index.js
CHANGED
package/dist/runClass.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
-
const runClass = ({ location
|
|
16
|
+
const runClass = ({ location, meta, methodName, operator, params, functions, defaultFunction })=>{
|
|
17
17
|
if (!methodName) {
|
|
18
18
|
if (meta[params]) {
|
|
19
19
|
methodName = params;
|
|
@@ -69,8 +69,8 @@ const runClass = ({ location , meta , methodName , operator , params , functions
|
|
|
69
69
|
}
|
|
70
70
|
try {
|
|
71
71
|
return functions[methodName](...args);
|
|
72
|
-
} catch (
|
|
73
|
-
throw new Error(`Operator Error: ${operator}.${methodName} - ${
|
|
72
|
+
} catch (e) {
|
|
73
|
+
throw new Error(`Operator Error: ${operator}.${methodName} - ${e.message} Received: {"${operator}.${methodName}":${JSON.stringify(params)}} at ${location}.`);
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
export default runClass;
|
package/dist/runInstance.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
-
const runInstance = ({ location
|
|
16
|
+
const runInstance = ({ location, meta, methodName, operator, params, instanceType })=>{
|
|
17
17
|
if (!meta[methodName]) {
|
|
18
18
|
throw new Error(`Operator Error: ${operator}.${methodName} is not supported, use one of the following: ${Object.keys(meta).join(', ')}.
|
|
19
19
|
Received: {"${operator}.${methodName}":${JSON.stringify(params)}} at ${location}.`);
|
package/dist/serverParser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
let ServerParser = class ServerParser {
|
|
17
17
|
// TODO: Look at logging here
|
|
18
18
|
// TODO: Remove console.error = () => {}; from tests
|
|
19
|
-
parse({ args
|
|
19
|
+
parse({ args, input, location, operatorPrefix = '_' }) {
|
|
20
20
|
if (type.isUndefined(input)) {
|
|
21
21
|
return {
|
|
22
22
|
output: input,
|
|
@@ -72,7 +72,7 @@ let ServerParser = class ServerParser {
|
|
|
72
72
|
errors
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
-
constructor({ env
|
|
75
|
+
constructor({ env, payload, secrets, user, operators, verbose }){
|
|
76
76
|
this.env = env;
|
|
77
77
|
this.operators = operators;
|
|
78
78
|
this.payload = payload;
|
package/dist/webParser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { applyArrayIndices, serializer, type } from '@lowdefy/helpers';
|
|
16
16
|
let WebParser = class WebParser {
|
|
17
|
-
parse({ actions
|
|
17
|
+
parse({ actions, args, arrayIndices, event, input, location, operatorPrefix = '_' }) {
|
|
18
18
|
if (type.isUndefined(input)) {
|
|
19
19
|
return {
|
|
20
20
|
output: input,
|
|
@@ -31,7 +31,7 @@ let WebParser = class WebParser {
|
|
|
31
31
|
throw new Error('Operator parser location must be a string.');
|
|
32
32
|
}
|
|
33
33
|
const errors = [];
|
|
34
|
-
const { basePath
|
|
34
|
+
const { basePath, home, inputs, lowdefyGlobal, menus, pageId, user, _internal } = this.context._internal.lowdefy;
|
|
35
35
|
const reviver = (_, value)=>{
|
|
36
36
|
if (!type.isObject(value)) return value;
|
|
37
37
|
// TODO: pass ~k in errors.
|
|
@@ -54,8 +54,8 @@ let WebParser = class WebParser {
|
|
|
54
54
|
home,
|
|
55
55
|
input: inputs[this.context.id],
|
|
56
56
|
location: applyArrayIndices(arrayIndices, location),
|
|
57
|
-
lowdefyGlobal
|
|
58
|
-
menus
|
|
57
|
+
lowdefyGlobal,
|
|
58
|
+
menus,
|
|
59
59
|
methodName,
|
|
60
60
|
operatorPrefix,
|
|
61
61
|
operators: this.operators,
|
|
@@ -81,7 +81,7 @@ let WebParser = class WebParser {
|
|
|
81
81
|
errors
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
constructor({ context
|
|
84
|
+
constructor({ context, operators }){
|
|
85
85
|
this.context = context;
|
|
86
86
|
this.operators = operators;
|
|
87
87
|
this.parse = this.parse.bind(this);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/operators",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -33,25 +33,23 @@
|
|
|
33
33
|
"files": [
|
|
34
34
|
"dist/*"
|
|
35
35
|
],
|
|
36
|
-
"scripts": {
|
|
37
|
-
"build": "swc src --out-dir dist --config-file ../../.swcrc --delete-dir-on-start",
|
|
38
|
-
"clean": "rm -rf dist",
|
|
39
|
-
"prepublishOnly": "pnpm build",
|
|
40
|
-
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --testTimeout=10000"
|
|
41
|
-
},
|
|
42
36
|
"dependencies": {
|
|
43
|
-
"@lowdefy/helpers": "4.0.
|
|
37
|
+
"@lowdefy/helpers": "4.0.1"
|
|
44
38
|
},
|
|
45
39
|
"devDependencies": {
|
|
46
|
-
"@jest/globals": "28.1.
|
|
47
|
-
"@swc/cli": "0.1.
|
|
48
|
-
"@swc/core": "1.3.
|
|
49
|
-
"@swc/jest": "0.2.
|
|
50
|
-
"jest": "28.1.
|
|
51
|
-
"jest-environment-jsdom": "28.1.
|
|
40
|
+
"@jest/globals": "28.1.3",
|
|
41
|
+
"@swc/cli": "0.1.63",
|
|
42
|
+
"@swc/core": "1.3.99",
|
|
43
|
+
"@swc/jest": "0.2.29",
|
|
44
|
+
"jest": "28.1.3",
|
|
45
|
+
"jest-environment-jsdom": "28.1.3"
|
|
52
46
|
},
|
|
53
47
|
"publishConfig": {
|
|
54
48
|
"access": "public"
|
|
55
49
|
},
|
|
56
|
-
"
|
|
57
|
-
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "swc src --out-dir dist --config-file ../../.swcrc --delete-dir-on-start",
|
|
52
|
+
"clean": "rm -rf dist",
|
|
53
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --testTimeout=10000"
|
|
54
|
+
}
|
|
55
|
+
}
|