@lowdefy/engine 4.0.0-alpha.6 → 4.0.0-alpha.9

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.
Files changed (41) hide show
  1. package/dist/Actions.js +29 -17
  2. package/dist/Blocks.js +29 -27
  3. package/dist/Events.js +4 -3
  4. package/dist/Requests.js +2 -5
  5. package/dist/State.js +1 -1
  6. package/dist/actions/createCallMethod.js +29 -0
  7. package/dist/actions/{Request.js → createDisplayMessage.js} +6 -9
  8. package/dist/actions/createGetActions.js +27 -0
  9. package/dist/actions/{Logout.js → createGetBlockId.js} +6 -4
  10. package/dist/actions/createGetEvent.js +27 -0
  11. package/dist/actions/createGetGlobal.js +27 -0
  12. package/dist/actions/createGetInput.js +27 -0
  13. package/dist/actions/{Login.js → createGetPageId.js} +6 -4
  14. package/dist/actions/createGetRequestDetails.js +27 -0
  15. package/dist/actions/createGetState.js +27 -0
  16. package/dist/actions/createGetUrlQuery.js +27 -0
  17. package/dist/actions/createGetUser.js +27 -0
  18. package/dist/actions/createLink.js +20 -0
  19. package/dist/actions/createLogin.js +20 -0
  20. package/dist/actions/createLogout.js +20 -0
  21. package/dist/actions/{Message.js → createRequest.js} +11 -9
  22. package/dist/actions/{Reset.js → createReset.js} +8 -6
  23. package/dist/actions/{ResetValidation.js → createResetValidation.js} +6 -4
  24. package/dist/actions/{SetGlobal.js → createSetGlobal.js} +11 -9
  25. package/dist/actions/{SetState.js → createSetState.js} +10 -8
  26. package/dist/actions/{Validate.js → createValidate.js} +10 -8
  27. package/dist/actions/getActionMethods.js +61 -0
  28. package/dist/actions/getFromObject.js +42 -0
  29. package/dist/createLink.js +46 -23
  30. package/dist/getBlockMatcher.js +1 -1
  31. package/dist/getContext.js +30 -12
  32. package/dist/index.js +1 -1
  33. package/package.json +7 -6
  34. package/dist/actions/CallMethod.js +0 -28
  35. package/dist/actions/JsAction.js +0 -54
  36. package/dist/actions/Link.js +0 -27
  37. package/dist/actions/ScrollTo.js +0 -25
  38. package/dist/actions/Throw.js +0 -39
  39. package/dist/actions/Wait.js +0 -22
  40. package/dist/actions/index.js +0 -46
  41. package/dist/getFieldValues.js +0 -35
@@ -1,39 +0,0 @@
1
- /*
2
- Copyright 2020-2021 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
- */ import { type } from '@lowdefy/helpers';
16
- let ThrowActionError = class ThrowActionError extends Error {
17
- constructor(message, { blockId , context , metaData }){
18
- super(message);
19
- this.blockId = blockId;
20
- this.metaData = metaData;
21
- this.name = 'ThrowError';
22
- this.pageId = context.pageId;
23
- }
24
- };
25
- function Throw({ blockId , context , params ={} }) {
26
- if (params.throw === false || type.isNone(params.throw)) {
27
- return;
28
- }
29
- if (params.throw === true) {
30
- throw new ThrowActionError(params.message, {
31
- blockId,
32
- context,
33
- metaData: params.metaData
34
- });
35
- }
36
- throw new Error(`Invalid Throw, check action params. Received "${JSON.stringify(params)}".`);
37
- }
38
- export default Throw;
39
- export { Throw, ThrowActionError };
@@ -1,22 +0,0 @@
1
- /*
2
- Copyright 2020-2021 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
- */ import { type, wait } from '@lowdefy/helpers';
16
- async function Wait({ params }) {
17
- if (!type.isInt(params.ms)) {
18
- throw new Error(`Wait action "ms" param should be an integer.`);
19
- }
20
- return wait(params.ms);
21
- }
22
- export default Wait;
@@ -1,46 +0,0 @@
1
- /*
2
- Copyright 2020-2021 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
- */ import CallMethod from './CallMethod.js';
16
- import JsAction from './JsAction.js';
17
- import Link from './Link.js';
18
- import Login from './Login.js';
19
- import Logout from './Logout.js';
20
- import Message from './Message.js';
21
- import Request from './Request.js';
22
- import Reset from './Reset.js';
23
- import ResetValidation from './ResetValidation.js';
24
- import ScrollTo from './ScrollTo.js';
25
- import SetGlobal from './SetGlobal.js';
26
- import SetState from './SetState.js';
27
- import Throw from './Throw.js';
28
- import Validate from './Validate.js';
29
- import Wait from './Wait.js';
30
- export default {
31
- CallMethod,
32
- JsAction,
33
- Link,
34
- Login,
35
- Logout,
36
- Message,
37
- Request,
38
- Reset,
39
- ResetValidation,
40
- ScrollTo,
41
- SetGlobal,
42
- SetState,
43
- Throw,
44
- Validate,
45
- Wait
46
- };
@@ -1,35 +0,0 @@
1
- /*
2
- Copyright 2020-2021 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
- */ import { serializer } from '@lowdefy/helpers';
16
- function getFieldValues(operatorName, ...args) {
17
- const result = new Set();
18
- function reviver(key, value) {
19
- if (key === operatorName) {
20
- result.add(value);
21
- }
22
- return value;
23
- }
24
- [
25
- ...args
26
- ].forEach((element)=>{
27
- serializer.deserializeFromString(serializer.serializeToString(element), {
28
- reviver
29
- });
30
- });
31
- return [
32
- ...result
33
- ];
34
- }
35
- export default getFieldValues;