@lowdefy/api 4.0.0-alpha.35 → 4.0.0-alpha.37
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.
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import createAuthorize from './createAuthorize.js';
|
|
16
16
|
import createReadConfigFile from './createReadConfigFile.js';
|
|
17
|
-
function createApiContext({ buildDirectory , config , connections , logger , operators , secrets , session , }) {
|
|
17
|
+
function createApiContext({ buildDirectory , config , connections , fileCache , logger , operators , secrets , session , }) {
|
|
18
18
|
const readConfigFile = createReadConfigFile({
|
|
19
|
-
buildDirectory
|
|
19
|
+
buildDirectory,
|
|
20
|
+
fileCache
|
|
20
21
|
});
|
|
21
22
|
return {
|
|
22
23
|
authorize: createAuthorize({
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/ import path from 'path';
|
|
16
16
|
import { cachedPromises } from '@lowdefy/helpers';
|
|
17
17
|
import { getFileExtension, readFile } from '@lowdefy/node-utils';
|
|
18
|
-
function createReadConfigFile({ buildDirectory }) {
|
|
18
|
+
function createReadConfigFile({ buildDirectory , fileCache }) {
|
|
19
19
|
async function readConfigFile(filePath) {
|
|
20
20
|
const fileContent = await readFile(path.resolve(buildDirectory, filePath));
|
|
21
21
|
if (getFileExtension(filePath) === 'json') {
|
|
@@ -23,6 +23,9 @@ function createReadConfigFile({ buildDirectory }) {
|
|
|
23
23
|
}
|
|
24
24
|
return fileContent;
|
|
25
25
|
}
|
|
26
|
-
return cachedPromises(
|
|
26
|
+
return cachedPromises({
|
|
27
|
+
cache: fileCache,
|
|
28
|
+
getter: readConfigFile
|
|
29
|
+
});
|
|
27
30
|
}
|
|
28
31
|
export default createReadConfigFile;
|
|
@@ -15,8 +15,11 @@
|
|
|
15
15
|
*/ async function getPageConfig({ authorize , readConfigFile }, { pageId }) {
|
|
16
16
|
const pageConfig = await readConfigFile(`pages/${pageId}/${pageId}.json`);
|
|
17
17
|
if (pageConfig && authorize(pageConfig)) {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
// eslint-disable-next-line no-unused-vars
|
|
19
|
+
const { auth , ...rest } = pageConfig;
|
|
20
|
+
return {
|
|
21
|
+
...rest
|
|
22
|
+
};
|
|
20
23
|
}
|
|
21
24
|
return null;
|
|
22
25
|
}
|
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.37",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@lowdefy/ajv": "4.0.0-alpha.
|
|
44
|
-
"@lowdefy/helpers": "4.0.0-alpha.
|
|
45
|
-
"@lowdefy/node-utils": "4.0.0-alpha.
|
|
46
|
-
"@lowdefy/nunjucks": "4.0.0-alpha.
|
|
47
|
-
"@lowdefy/operators": "4.0.0-alpha.
|
|
48
|
-
"@lowdefy/operators-js": "4.0.0-alpha.
|
|
43
|
+
"@lowdefy/ajv": "4.0.0-alpha.37",
|
|
44
|
+
"@lowdefy/helpers": "4.0.0-alpha.37",
|
|
45
|
+
"@lowdefy/node-utils": "4.0.0-alpha.37",
|
|
46
|
+
"@lowdefy/nunjucks": "4.0.0-alpha.37",
|
|
47
|
+
"@lowdefy/operators": "4.0.0-alpha.37",
|
|
48
|
+
"@lowdefy/operators-js": "4.0.0-alpha.37"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@jest/globals": "28.1.0",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "855e81894be16837be556de36a036215f1efe021"
|
|
61
61
|
}
|