@lowdefy/actions-core 4.0.0-alpha.16 → 4.0.0-alpha.19

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,24 @@
1
+ /*
2
+ Copyright 2020-2022 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
+ */ async function Fetch({ globals , params }) {
16
+ const { fetch } = globals;
17
+ const { url , options , responseFunction } = params;
18
+ const res = await fetch(url, options);
19
+ if (responseFunction) {
20
+ return res[responseFunction]();
21
+ }
22
+ return res;
23
+ }
24
+ export default Fetch;
@@ -13,7 +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({ document , params , window }) {
16
+ function ScrollTo({ globals , params }) {
17
+ const { document , window } = globals;
17
18
  if (!type.isObject(params)) {
18
19
  throw new Error(`Invalid ScrollTo, check action params. Received "${JSON.stringify(params)}".`);
19
20
  }
package/dist/actions.js CHANGED
@@ -17,6 +17,7 @@ export { default as Link } from './actions/Link.js';
17
17
  export { default as Login } from './actions/Login.js';
18
18
  export { default as Logout } from './actions/Logout.js';
19
19
  export { default as DisplayMessage } from './actions/DisplayMessage.js';
20
+ export { default as Fetch } from './actions/Fetch.js';
20
21
  export { default as Request } from './actions/Request.js';
21
22
  export { default as Reset } from './actions/Reset.js';
22
23
  export { default as ResetValidation } from './actions/ResetValidation.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/actions-core",
3
- "version": "4.0.0-alpha.16",
3
+ "version": "4.0.0-alpha.19",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -46,7 +46,7 @@
46
46
  "test": "yarn node --experimental-vm-modules $(yarn bin jest)"
47
47
  },
48
48
  "dependencies": {
49
- "@lowdefy/helpers": "4.0.0-alpha.16"
49
+ "@lowdefy/helpers": "4.0.0-alpha.19"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@jest/globals": "28.1.0",
@@ -59,5 +59,5 @@
59
59
  "publishConfig": {
60
60
  "access": "public"
61
61
  },
62
- "gitHead": "91459befdeb9b22aaba40e8c51d6a173a11ea939"
62
+ "gitHead": "5240a074f7225295a8c92aaf0236b7680c296b57"
63
63
  }