@lowdefy/api 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.
- package/dist/context/createApiContext.js +1 -1
- package/dist/context/createAuthorize.js +1 -1
- package/dist/context/createContext.js +1 -1
- package/dist/context/errors.js +1 -1
- package/dist/context/readConfigFile.js +1 -1
- package/dist/index.js +1 -1
- package/dist/routes/page/getPageConfig.js +6 -4
- package/dist/routes/request/authorizeRequest.js +1 -1
- package/dist/routes/request/callRequest.js +2 -2
- package/dist/routes/request/callRequestResolver.js +1 -1
- package/dist/routes/request/checkConnectionRead.js +1 -1
- package/dist/routes/request/checkConnectionWrite.js +1 -1
- package/dist/routes/request/evaluateOperators.js +2 -3
- package/dist/routes/request/getConnection.js +1 -1
- package/dist/routes/request/getConnectionConfig.js +1 -1
- package/dist/routes/request/getRequestConfig.js +1 -1
- package/dist/routes/request/getRequestResolver.js +1 -1
- package/dist/routes/request/validateSchemas.js +1 -1
- package/dist/routes/rootConfig/getHomeAndMenus.js +1 -1
- package/dist/routes/rootConfig/getLowdefyGlobal.js +1 -1
- package/dist/routes/rootConfig/getRootConfig.js +1 -1
- package/dist/routes/rootConfig/menus/filterMenuList.js +1 -1
- package/dist/routes/rootConfig/menus/filterMenus.js +1 -1
- package/dist/routes/rootConfig/menus/getMenus.js +1 -1
- package/dist/test/testContext.js +4 -1
- package/package.json +12 -10
package/dist/context/errors.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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,10 +12,12 @@
|
|
|
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
|
-
*/
|
|
16
|
-
async function getPageConfig({ authorize , readConfigFile }, { pageId }) {
|
|
15
|
+
*/ async function getPageConfig({ authorize , readConfigFile }, { pageId }) {
|
|
17
16
|
const pageConfig = await readConfigFile(`pages/${pageId}/${pageId}.json`);
|
|
18
|
-
if (pageConfig && authorize(pageConfig))
|
|
17
|
+
if (pageConfig && authorize(pageConfig)) {
|
|
18
|
+
delete pageConfig.auth;
|
|
19
|
+
return pageConfig;
|
|
20
|
+
}
|
|
19
21
|
return null;
|
|
20
22
|
}
|
|
21
23
|
export default getPageConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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.
|
|
@@ -50,7 +50,7 @@ async function callRequest(context, { pageId , payload , requestId }) {
|
|
|
50
50
|
connection,
|
|
51
51
|
requestConfig
|
|
52
52
|
});
|
|
53
|
-
const { connectionProperties , requestProperties } =
|
|
53
|
+
const { connectionProperties , requestProperties } = evaluateOperators(context, {
|
|
54
54
|
connectionConfig,
|
|
55
55
|
payload: serializer.deserialize(payload),
|
|
56
56
|
requestConfig
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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,14 +14,13 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { NodeParser } from '@lowdefy/operators';
|
|
16
16
|
import { RequestError } from '../../context/errors.js';
|
|
17
|
-
|
|
17
|
+
function evaluateOperators({ operators , secrets , user }, { connectionConfig , payload , requestConfig }) {
|
|
18
18
|
const operatorsParser = new NodeParser({
|
|
19
19
|
operators,
|
|
20
20
|
payload,
|
|
21
21
|
secrets,
|
|
22
22
|
user
|
|
23
23
|
});
|
|
24
|
-
await operatorsParser.init();
|
|
25
24
|
const { output: connectionProperties , errors: connectionErrors } = operatorsParser.parse({
|
|
26
25
|
input: connectionConfig.properties || {},
|
|
27
26
|
location: connectionConfig.connectionId
|
package/dist/test/testContext.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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.
|
|
@@ -18,6 +18,8 @@ function testContext({ config ={} , connections ={} , headers ={} , host ='host'
|
|
|
18
18
|
error: ()=>{},
|
|
19
19
|
info: ()=>{},
|
|
20
20
|
warn: ()=>{}
|
|
21
|
+
} , operators ={
|
|
22
|
+
_test: ()=>'test'
|
|
21
23
|
} , readConfigFile , roles , secrets ={} , setHeader , user , protocol ='https' , } = {}) {
|
|
22
24
|
const authenticated = user && !!user.sub;
|
|
23
25
|
return {
|
|
@@ -31,6 +33,7 @@ function testContext({ config ={} , connections ={} , headers ={} , host ='host'
|
|
|
31
33
|
headers,
|
|
32
34
|
host,
|
|
33
35
|
logger,
|
|
36
|
+
operators,
|
|
34
37
|
protocol,
|
|
35
38
|
readConfigFile,
|
|
36
39
|
secrets,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/api",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.9",
|
|
4
4
|
"licence": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -38,23 +38,25 @@
|
|
|
38
38
|
"clean": "rm -rf dist",
|
|
39
39
|
"prepare": "yarn build",
|
|
40
40
|
"swc": "swc src --out-dir dist --config-file ../../.swcrc --delete-dir-on-start",
|
|
41
|
-
"test": "
|
|
41
|
+
"test": "yarn node --experimental-vm-modules $(yarn bin jest)"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@lowdefy/ajv": "4.0.0-alpha.
|
|
45
|
-
"@lowdefy/helpers": "4.0.0-alpha.
|
|
46
|
-
"@lowdefy/node-utils": "4.0.0-alpha.
|
|
47
|
-
"@lowdefy/nunjucks": "4.0.0-alpha.
|
|
48
|
-
"@lowdefy/operators": "4.0.0-alpha.
|
|
44
|
+
"@lowdefy/ajv": "4.0.0-alpha.9",
|
|
45
|
+
"@lowdefy/helpers": "4.0.0-alpha.9",
|
|
46
|
+
"@lowdefy/node-utils": "4.0.0-alpha.9",
|
|
47
|
+
"@lowdefy/nunjucks": "4.0.0-alpha.9",
|
|
48
|
+
"@lowdefy/operators": "4.0.0-alpha.9"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
+
"@jest/globals": "27.5.1",
|
|
52
|
+
"@lowdefy/operators-js": "4.0.0-alpha.9",
|
|
51
53
|
"@swc/cli": "0.1.55",
|
|
52
|
-
"@swc/core": "1.2.
|
|
54
|
+
"@swc/core": "1.2.135",
|
|
53
55
|
"@swc/jest": "0.2.17",
|
|
54
|
-
"jest": "27.
|
|
56
|
+
"jest": "27.5.1"
|
|
55
57
|
},
|
|
56
58
|
"publishConfig": {
|
|
57
59
|
"access": "public"
|
|
58
60
|
},
|
|
59
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "98b544eca231bdcfca6c3a8601a891835d5ce571"
|
|
60
62
|
}
|