@lowdefy/engine 4.0.0-rc.0 → 4.0.0-rc.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/Actions.js +4 -4
- package/dist/Blocks.js +2 -2
- package/dist/Events.js +1 -1
- package/dist/Requests.js +1 -1
- package/dist/State.js +1 -1
- package/dist/actions/createCallMethod.js +1 -1
- package/dist/actions/createDisplayMessage.js +1 -1
- package/dist/actions/createGetActions.js +1 -1
- package/dist/actions/createGetBlockId.js +1 -1
- package/dist/actions/createGetEvent.js +1 -1
- package/dist/actions/createGetGlobal.js +1 -1
- package/dist/actions/createGetInput.js +1 -1
- package/dist/actions/createGetPageId.js +1 -1
- package/dist/actions/createGetRequestDetails.js +1 -1
- package/dist/actions/createGetState.js +1 -1
- package/dist/actions/createGetUrlQuery.js +1 -1
- package/dist/actions/createGetUser.js +1 -1
- package/dist/actions/createLink.js +1 -1
- package/dist/actions/createLogin.js +1 -1
- package/dist/actions/createLogout.js +1 -1
- package/dist/actions/createRequest.js +1 -1
- package/dist/actions/createReset.js +1 -1
- package/dist/actions/createResetValidation.js +1 -1
- package/dist/actions/createSetGlobal.js +1 -1
- package/dist/actions/createSetState.js +1 -1
- package/dist/actions/createValidate.js +1 -1
- package/dist/actions/getActionMethods.js +1 -1
- package/dist/actions/getFromObject.js +1 -1
- package/dist/createLink.js +6 -2
- package/dist/getBlockMatcher.js +1 -1
- package/dist/getContext.js +3 -3
- package/dist/index.js +1 -1
- package/package.json +11 -11
package/dist/Actions.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 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.
|
|
@@ -184,17 +184,17 @@ let Actions = class Actions {
|
|
|
184
184
|
index,
|
|
185
185
|
type: action.type
|
|
186
186
|
};
|
|
187
|
-
const { output: parsedMessages , errors:
|
|
187
|
+
const { output: parsedMessages , errors: parserErrors1 } = this.context._internal.parser.parse({
|
|
188
188
|
actions: responses,
|
|
189
189
|
event,
|
|
190
190
|
arrayIndices,
|
|
191
191
|
input: action.messages,
|
|
192
192
|
location: block.blockId
|
|
193
193
|
});
|
|
194
|
-
if (
|
|
194
|
+
if (parserErrors1.length > 0) {
|
|
195
195
|
// this condition is very unlikely since parser errors usually occur in the first parse.
|
|
196
196
|
throw {
|
|
197
|
-
error:
|
|
197
|
+
error: parserErrors1[0],
|
|
198
198
|
type: action.type,
|
|
199
199
|
index
|
|
200
200
|
};
|
package/dist/Blocks.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */ /*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 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.
|
|
@@ -299,7 +299,7 @@ let Blocks = class Blocks {
|
|
|
299
299
|
status: 'error',
|
|
300
300
|
message: type.isString(block.requiredEval.output) ? block.requiredEval.output : 'This field is required'
|
|
301
301
|
};
|
|
302
|
-
const validation = block.
|
|
302
|
+
const validation = block.requiredEval.output === false ? block.validate : [
|
|
303
303
|
requiredValidation,
|
|
304
304
|
...block.validate
|
|
305
305
|
];
|
package/dist/Events.js
CHANGED
package/dist/Requests.js
CHANGED
package/dist/State.js
CHANGED
package/dist/createLink.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 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.
|
|
@@ -22,9 +22,10 @@ function createLink({ backLink , disabledLink , lowdefy , newOriginLink , noLink
|
|
|
22
22
|
!props.pageId,
|
|
23
23
|
!props.back,
|
|
24
24
|
!props.home,
|
|
25
|
+
!props.href,
|
|
25
26
|
!props.url
|
|
26
27
|
].filter((v)=>!v).length > 1) {
|
|
27
|
-
throw Error(`Invalid Link: To avoid ambiguity, only one of 'back', 'home', 'pageId' or 'url' can be defined.`);
|
|
28
|
+
throw Error(`Invalid Link: To avoid ambiguity, only one of 'back', 'home', 'href', 'pageId' or 'url' can be defined.`);
|
|
28
29
|
}
|
|
29
30
|
if (props.back === true) {
|
|
30
31
|
// Cannot set input or urlQuery on back
|
|
@@ -52,6 +53,9 @@ function createLink({ backLink , disabledLink , lowdefy , newOriginLink , noLink
|
|
|
52
53
|
}
|
|
53
54
|
});
|
|
54
55
|
}
|
|
56
|
+
if (type.isString(props.href)) {
|
|
57
|
+
return newOriginLink(props);
|
|
58
|
+
}
|
|
55
59
|
if (type.isString(props.url)) {
|
|
56
60
|
const protocol = props.url.includes(':') ? '' : 'https://';
|
|
57
61
|
return newOriginLink({
|
package/dist/getBlockMatcher.js
CHANGED
package/dist/getContext.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 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.
|
|
@@ -17,7 +17,7 @@ import Actions from './Actions.js';
|
|
|
17
17
|
import Blocks from './Blocks.js';
|
|
18
18
|
import Requests from './Requests.js';
|
|
19
19
|
import State from './State.js';
|
|
20
|
-
const blockData = ({ areas , blockId , blocks , events , field , id , layout , pageId , properties , requests , required , style , type , validate , visible
|
|
20
|
+
const blockData = ({ areas , blockId , blocks , events , field , id , layout , pageId , properties , requests , required , style , type , validate , visible })=>({
|
|
21
21
|
areas,
|
|
22
22
|
blockId,
|
|
23
23
|
blocks,
|
|
@@ -37,7 +37,7 @@ const blockData = ({ areas , blockId , blocks , events , field , id , layout , p
|
|
|
37
37
|
function getContext({ config , lowdefy , resetContext ={
|
|
38
38
|
reset: false,
|
|
39
39
|
setReset: ()=>undefined
|
|
40
|
-
}
|
|
40
|
+
} }) {
|
|
41
41
|
if (!config) {
|
|
42
42
|
throw new Error('A page must be provided to get context.');
|
|
43
43
|
}
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/engine",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -36,22 +36,22 @@
|
|
|
36
36
|
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@lowdefy/helpers": "4.0.0-rc.
|
|
40
|
-
"@lowdefy/operators": "4.0.0-rc.
|
|
39
|
+
"@lowdefy/helpers": "4.0.0-rc.1",
|
|
40
|
+
"@lowdefy/operators": "4.0.0-rc.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@jest/globals": "28.1.0",
|
|
44
|
-
"@lowdefy/actions-core": "4.0.0-rc.
|
|
45
|
-
"@lowdefy/build": "4.0.0-rc.
|
|
46
|
-
"@lowdefy/operators-js": "4.0.0-rc.
|
|
47
|
-
"@lowdefy/operators-mql": "4.0.0-rc.
|
|
48
|
-
"@swc/cli": "0.1.
|
|
49
|
-
"@swc/core": "1.
|
|
50
|
-
"@swc/jest": "0.2.
|
|
44
|
+
"@lowdefy/actions-core": "4.0.0-rc.1",
|
|
45
|
+
"@lowdefy/build": "4.0.0-rc.1",
|
|
46
|
+
"@lowdefy/operators-js": "4.0.0-rc.1",
|
|
47
|
+
"@lowdefy/operators-mql": "4.0.0-rc.1",
|
|
48
|
+
"@swc/cli": "0.1.59",
|
|
49
|
+
"@swc/core": "1.3.24",
|
|
50
|
+
"@swc/jest": "0.2.24",
|
|
51
51
|
"jest": "28.1.0"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "ecc4f16c19eede929eda177db524cf13a8053379"
|
|
57
57
|
}
|