@lowdefy/actions-core 4.0.0-rc.8 → 4.0.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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
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.
@@ -12,7 +12,7 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ function CallMethod({ methods: { callMethod } , params }) {
15
+ */ function CallMethod({ methods: { callMethod }, params }) {
16
16
  return callMethod(params);
17
17
  }
18
18
  export default CallMethod;
@@ -0,0 +1,20 @@
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 CopyToClipboard({ globals, params }) {
16
+ const { window } = globals;
17
+ const { copy } = params;
18
+ window.navigator.clipboard.writeText(copy);
19
+ }
20
+ export default CopyToClipboard;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
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 DisplayMessage({ methods: { displayMessage } , params }) {
16
+ function DisplayMessage({ methods: { displayMessage }, params }) {
17
17
  if (!type.isObject(params)) {
18
18
  throw new Error(`Invalid DisplayMessage, check action params. Params must be an object, received "${JSON.stringify(params)}".`);
19
19
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
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.
@@ -12,9 +12,9 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ async function Fetch({ globals , params }) {
16
- const { fetch } = globals;
17
- const { url , options , responseFunction } = params;
15
+ */ async function Fetch({ globals, params }) {
16
+ const { fetch } = globals;
17
+ const { url, options, responseFunction } = params;
18
18
  const res = await fetch(url, options);
19
19
  if (responseFunction) {
20
20
  return res[responseFunction]();
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
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.
@@ -17,7 +17,7 @@
17
17
  2: 'POSITION_UNAVAILABLE',
18
18
  3: 'TIMEOUT'
19
19
  };
20
- async function GeolocationCurrentPosition({ globals , params }) {
20
+ async function GeolocationCurrentPosition({ globals, params }) {
21
21
  try {
22
22
  const position = await new Promise((resolve, reject)=>{
23
23
  globals.window.navigator.geolocation.getCurrentPosition(resolve, reject, params);
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
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 Link({ methods: { link } , params }) {
16
+ function Link({ methods: { link }, params }) {
17
17
  const linkParams = type.isString(params) ? {
18
18
  pageId: params
19
19
  } : params;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
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.
@@ -12,7 +12,7 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ function Login({ methods: { login } , params }) {
15
+ */ function Login({ methods: { login }, params }) {
16
16
  return login(params);
17
17
  }
18
18
  export default Login;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
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.
@@ -12,7 +12,7 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ function Logout({ methods: { logout } , params }) {
15
+ */ function Logout({ methods: { logout }, params }) {
16
16
  return logout(params);
17
17
  }
18
18
  export default Logout;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
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.
@@ -12,7 +12,7 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ async function Request({ methods: { request } , params }) {
16
- return await request(params);
15
+ */ function Request({ methods: { request }, params }) {
16
+ return request(params);
17
17
  }
18
18
  export default Request;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
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.
@@ -12,7 +12,7 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ function Reset({ methods: { reset } }) {
15
+ */ function Reset({ methods: { reset } }) {
16
16
  reset();
17
17
  }
18
18
  export default Reset;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
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.
@@ -12,7 +12,7 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ function ResetValidation({ methods: { resetValidation } , params }) {
15
+ */ function ResetValidation({ methods: { resetValidation }, params }) {
16
16
  resetValidation(params);
17
17
  }
18
18
  export default ResetValidation;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
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,8 +13,8 @@
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 ScrollTo({ globals , params }) {
17
- const { document , window } = globals;
16
+ function ScrollTo({ globals, params }) {
17
+ const { document, window } = globals;
18
18
  if (!type.isObject(params)) {
19
19
  throw new Error(`Invalid ScrollTo, check action params. Received "${JSON.stringify(params)}".`);
20
20
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
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.
@@ -12,7 +12,7 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ function SetGlobal({ methods: { setGlobal } , params }) {
15
+ */ function SetGlobal({ methods: { setGlobal }, params }) {
16
16
  setGlobal(params);
17
17
  }
18
18
  export default SetGlobal;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
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.
@@ -12,7 +12,7 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ function SetState({ methods: { setState } , params }) {
15
+ */ function SetState({ methods: { setState }, params }) {
16
16
  setState(params);
17
17
  }
18
18
  export default SetState;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
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 { type } from '@lowdefy/helpers';
16
16
  let ThrowActionError = class ThrowActionError extends Error {
17
- constructor(message, { blockId , metaData , pageId }){
17
+ constructor(message, { blockId, metaData, pageId }){
18
18
  super(message);
19
19
  this.blockId = blockId;
20
20
  this.metaData = metaData;
@@ -22,7 +22,7 @@ let ThrowActionError = class ThrowActionError extends Error {
22
22
  this.pageId = pageId;
23
23
  }
24
24
  };
25
- function Throw({ methods: { getBlockId , getPageId } , params }) {
25
+ function Throw({ methods: { getBlockId, getPageId }, params }) {
26
26
  if (!type.isObject(params)) {
27
27
  throw new Error(`Throw action params should be an object. Received "${JSON.stringify(params)}".`);
28
28
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
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.
@@ -12,7 +12,7 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ function UpdateSession({ methods: { updateSession } }) {
15
+ */ function UpdateSession({ methods: { updateSession } }) {
16
16
  return updateSession();
17
17
  }
18
18
  export default UpdateSession;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
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.
@@ -12,7 +12,7 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ function Validate({ methods: { validate } , params }) {
15
+ */ function Validate({ methods: { validate }, params }) {
16
16
  return validate(params);
17
17
  }
18
18
  export default Validate;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
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, wait } from '@lowdefy/helpers';
16
- function Wait({ params }) {
16
+ function Wait({ params }) {
17
17
  if (type.isNone(params) || !type.isInt(params.ms)) {
18
18
  throw new Error(`Wait action "ms" param should be an integer.`);
19
19
  }
package/dist/actions.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
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,6 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ export { default as CallMethod } from './actions/CallMethod.js';
16
+ export { default as CopyToClipboard } from './actions/CopyToClipboard.js';
16
17
  export { default as Link } from './actions/Link.js';
17
18
  export { default as Login } from './actions/Login.js';
18
19
  export { default as Logout } from './actions/Logout.js';
package/dist/types.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/actions-core",
3
- "version": "4.0.0-rc.8",
3
+ "version": "4.0.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -42,25 +42,23 @@
42
42
  "files": [
43
43
  "dist/*"
44
44
  ],
45
- "scripts": {
46
- "build": "swc src --out-dir dist --config-file ../../../../.swcrc --delete-dir-on-start --copy-files",
47
- "clean": "rm -rf dist",
48
- "prepublishOnly": "pnpm build",
49
- "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
50
- },
51
45
  "dependencies": {
52
- "@lowdefy/helpers": "4.0.0-rc.8"
46
+ "@lowdefy/helpers": "4.0.0"
53
47
  },
54
48
  "devDependencies": {
55
- "@jest/globals": "28.1.0",
56
- "@swc/cli": "0.1.59",
57
- "@swc/core": "1.3.24",
58
- "@swc/jest": "0.2.24",
59
- "jest": "28.1.0",
60
- "jest-environment-jsdom": "28.1.0"
49
+ "@jest/globals": "28.1.3",
50
+ "@swc/cli": "0.1.63",
51
+ "@swc/core": "1.3.99",
52
+ "@swc/jest": "0.2.29",
53
+ "jest": "28.1.3",
54
+ "jest-environment-jsdom": "28.1.3"
61
55
  },
62
56
  "publishConfig": {
63
57
  "access": "public"
64
58
  },
65
- "gitHead": "db883daef0443647439b6fe2db845b846ffb6d4e"
66
- }
59
+ "scripts": {
60
+ "build": "swc src --out-dir dist --config-file ../../../../.swcrc --delete-dir-on-start --copy-files",
61
+ "clean": "rm -rf dist",
62
+ "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
63
+ }
64
+ }