@lowdefy/operators-js 4.0.2 → 4.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.
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ function js(operatorContext) {
|
|
16
|
+
const { jsMap, operators, location, params } = operatorContext;
|
|
17
|
+
try {
|
|
18
|
+
return jsMap[params]({
|
|
19
|
+
actions: (p)=>operators._actions({
|
|
20
|
+
...operatorContext,
|
|
21
|
+
params: p
|
|
22
|
+
}),
|
|
23
|
+
event: (p)=>operators._event({
|
|
24
|
+
...operatorContext,
|
|
25
|
+
params: p
|
|
26
|
+
}),
|
|
27
|
+
input: (p)=>operators._input({
|
|
28
|
+
...operatorContext,
|
|
29
|
+
params: p
|
|
30
|
+
}),
|
|
31
|
+
location: (p)=>operators._location({
|
|
32
|
+
...operatorContext,
|
|
33
|
+
params: p
|
|
34
|
+
}),
|
|
35
|
+
lowdefyGlobal: (p)=>operators._global({
|
|
36
|
+
...operatorContext,
|
|
37
|
+
params: p
|
|
38
|
+
}),
|
|
39
|
+
request: (p)=>operators._request({
|
|
40
|
+
...operatorContext,
|
|
41
|
+
params: p
|
|
42
|
+
}),
|
|
43
|
+
state: (p)=>operators._state({
|
|
44
|
+
...operatorContext,
|
|
45
|
+
params: p
|
|
46
|
+
}),
|
|
47
|
+
urlQuery: (p)=>operators._url_query({
|
|
48
|
+
...operatorContext,
|
|
49
|
+
params: p
|
|
50
|
+
}),
|
|
51
|
+
user: (p)=>operators._user({
|
|
52
|
+
...operatorContext,
|
|
53
|
+
params: p
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
} catch (error) {
|
|
57
|
+
throw new Error(`Operator Error: ${error.message} at ${location}. Received function: ${jsMap[params].toString()}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export default js;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ function js(operatorContext) {
|
|
16
|
+
const { jsMap, operators, location, params } = operatorContext;
|
|
17
|
+
try {
|
|
18
|
+
return jsMap[params]({
|
|
19
|
+
payload: (p)=>operators._payload({
|
|
20
|
+
...operatorContext,
|
|
21
|
+
params: p
|
|
22
|
+
}),
|
|
23
|
+
secret: (p)=>operators._secret({
|
|
24
|
+
...operatorContext,
|
|
25
|
+
params: p
|
|
26
|
+
}),
|
|
27
|
+
user: (p)=>operators._user({
|
|
28
|
+
...operatorContext,
|
|
29
|
+
params: p
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
} catch (error) {
|
|
33
|
+
throw new Error(`Operator Error: ${error.message} at ${location}. Received function: ${jsMap[params].toString()}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export default js;
|
package/dist/operatorsClient.js
CHANGED
|
@@ -53,6 +53,7 @@ export { default as _event_log } from './operators/client/event_log.js';
|
|
|
53
53
|
export { default as _event } from './operators/client/event.js';
|
|
54
54
|
export { default as _global } from './operators/client/global.js';
|
|
55
55
|
export { default as _input } from './operators/client/input.js';
|
|
56
|
+
export { default as _js } from './operators/client/js.js';
|
|
56
57
|
export { default as _location } from './operators/client/location.js';
|
|
57
58
|
export { default as _media } from './operators/client/media.js';
|
|
58
59
|
export { default as _menu } from './operators/client/menu.js';
|
package/dist/operatorsServer.js
CHANGED
|
@@ -48,5 +48,6 @@ export { default as _uri } from './operators/shared/uri.js';
|
|
|
48
48
|
export { default as _user } from './operators/shared/user.js';
|
|
49
49
|
export { default as _base64 } from './operators/server/base64.js';
|
|
50
50
|
export { default as _hash } from './operators/server/hash.js';
|
|
51
|
+
export { default as _js } from './operators/server/js.js';
|
|
51
52
|
export { default as _payload } from './operators/server/payload.js';
|
|
52
53
|
export { default as _secret } from './operators/server/secret.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/operators-js",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"dist/*"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@lowdefy/helpers": "4.0
|
|
46
|
-
"@lowdefy/operators": "4.0
|
|
45
|
+
"@lowdefy/helpers": "4.1.0",
|
|
46
|
+
"@lowdefy/operators": "4.1.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@jest/globals": "28.1.3",
|