@lowdefy/server 4.0.0-alpha.35 → 4.0.0-alpha.36
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/lib/fileCache.js +21 -0
- package/package.json +14 -14
- package/pages/404.js +3 -0
- package/pages/[pageId].js +2 -0
- package/pages/api/auth/[...nextauth].js +4 -2
- package/pages/api/request/[pageId]/[requestId].js +2 -0
- package/pages/index.js +2 -0
- package/public/.DS_Store +0 -0
package/lib/fileCache.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { LRUCache } from '@lowdefy/helpers';
|
|
18
|
+
|
|
19
|
+
const fileCache = new LRUCache({ maxSize: 100 });
|
|
20
|
+
|
|
21
|
+
export default fileCache;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/server",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.36",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -43,17 +43,17 @@
|
|
|
43
43
|
"next": "next"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@lowdefy/actions-core": "4.0.0-alpha.
|
|
47
|
-
"@lowdefy/api": "4.0.0-alpha.
|
|
48
|
-
"@lowdefy/blocks-antd": "4.0.0-alpha.
|
|
49
|
-
"@lowdefy/blocks-basic": "4.0.0-alpha.
|
|
50
|
-
"@lowdefy/blocks-loaders": "4.0.0-alpha.
|
|
51
|
-
"@lowdefy/client": "4.0.0-alpha.
|
|
52
|
-
"@lowdefy/helpers": "4.0.0-alpha.
|
|
53
|
-
"@lowdefy/layout": "4.0.0-alpha.
|
|
54
|
-
"@lowdefy/node-utils": "4.0.0-alpha.
|
|
55
|
-
"@lowdefy/operators-js": "4.0.0-alpha.
|
|
56
|
-
"@lowdefy/plugin-next-auth": "4.0.0-alpha.
|
|
46
|
+
"@lowdefy/actions-core": "4.0.0-alpha.36",
|
|
47
|
+
"@lowdefy/api": "4.0.0-alpha.36",
|
|
48
|
+
"@lowdefy/blocks-antd": "4.0.0-alpha.36",
|
|
49
|
+
"@lowdefy/blocks-basic": "4.0.0-alpha.36",
|
|
50
|
+
"@lowdefy/blocks-loaders": "4.0.0-alpha.36",
|
|
51
|
+
"@lowdefy/client": "4.0.0-alpha.36",
|
|
52
|
+
"@lowdefy/helpers": "4.0.0-alpha.36",
|
|
53
|
+
"@lowdefy/layout": "4.0.0-alpha.36",
|
|
54
|
+
"@lowdefy/node-utils": "4.0.0-alpha.36",
|
|
55
|
+
"@lowdefy/operators-js": "4.0.0-alpha.36",
|
|
56
|
+
"@lowdefy/plugin-next-auth": "4.0.0-alpha.36",
|
|
57
57
|
"next": "12.3.1",
|
|
58
58
|
"next-auth": "4.10.3",
|
|
59
59
|
"process": "0.11.10",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"react-icons": "4.3.1"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@lowdefy/build": "4.0.0-alpha.
|
|
65
|
+
"@lowdefy/build": "4.0.0-alpha.36",
|
|
66
66
|
"@next/eslint-plugin-next": "12.1.6",
|
|
67
67
|
"less": "4.1.2",
|
|
68
68
|
"less-loader": "11.0.0",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"publishConfig": {
|
|
76
76
|
"access": "public"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "d4b0fa0998d56ee812cb08d9676515cbac84a9cf"
|
|
79
79
|
}
|
package/pages/404.js
CHANGED
|
@@ -17,6 +17,7 @@ import path from 'path';
|
|
|
17
17
|
import { createApiContext, getPageConfig, getRootConfig } from '@lowdefy/api';
|
|
18
18
|
|
|
19
19
|
import config from '../build/config.json';
|
|
20
|
+
import fileCache from '../lib/fileCache.js';
|
|
20
21
|
import Page from '../lib/Page.js';
|
|
21
22
|
|
|
22
23
|
export async function getStaticProps() {
|
|
@@ -24,6 +25,8 @@ export async function getStaticProps() {
|
|
|
24
25
|
const apiContext = createApiContext({
|
|
25
26
|
buildDirectory: path.join(process.cwd(), 'build'),
|
|
26
27
|
config,
|
|
28
|
+
fileCache,
|
|
29
|
+
logger: console,
|
|
27
30
|
});
|
|
28
31
|
|
|
29
32
|
const [rootConfig, pageConfig] = await Promise.all([
|
package/pages/[pageId].js
CHANGED
|
@@ -18,6 +18,7 @@ import path from 'path';
|
|
|
18
18
|
import { createApiContext, getPageConfig, getRootConfig } from '@lowdefy/api';
|
|
19
19
|
|
|
20
20
|
import config from '../build/config.json';
|
|
21
|
+
import fileCache from '../lib/fileCache.js';
|
|
21
22
|
import getServerSession from '../lib/auth/getServerSession.js';
|
|
22
23
|
import Page from '../lib/Page.js';
|
|
23
24
|
|
|
@@ -28,6 +29,7 @@ export async function getServerSideProps(context) {
|
|
|
28
29
|
const apiContext = createApiContext({
|
|
29
30
|
buildDirectory: path.join(process.cwd(), 'build'),
|
|
30
31
|
config,
|
|
32
|
+
fileCache,
|
|
31
33
|
logger: console,
|
|
32
34
|
session,
|
|
33
35
|
});
|
|
@@ -17,16 +17,18 @@
|
|
|
17
17
|
import NextAuth from 'next-auth';
|
|
18
18
|
import { createApiContext, getNextAuthConfig } from '@lowdefy/api';
|
|
19
19
|
|
|
20
|
-
import authJson from '../../../build/auth.json';
|
|
21
|
-
import config from '../../../build/config.json';
|
|
22
20
|
import adapters from '../../../build/plugins/auth/adapters.js';
|
|
21
|
+
import authJson from '../../../build/auth.json';
|
|
23
22
|
import callbacks from '../../../build/plugins/auth/callbacks.js';
|
|
23
|
+
import config from '../../../build/config.json';
|
|
24
24
|
import events from '../../../build/plugins/auth/events.js';
|
|
25
|
+
import fileCache from '../../../lib/fileCache.js';
|
|
25
26
|
import providers from '../../../build/plugins/auth/providers.js';
|
|
26
27
|
|
|
27
28
|
export const authOptions = getNextAuthConfig(
|
|
28
29
|
createApiContext({
|
|
29
30
|
config,
|
|
31
|
+
fileCache,
|
|
30
32
|
logger: console,
|
|
31
33
|
}),
|
|
32
34
|
{ authJson, plugins: { adapters, callbacks, events, providers } }
|
|
@@ -22,6 +22,7 @@ import config from '../../../../build/config.json';
|
|
|
22
22
|
import connections from '../../../../build/plugins/connections.js';
|
|
23
23
|
import getServerSession from '../../../../lib/auth/getServerSession.js';
|
|
24
24
|
import operators from '../../../../build/plugins/operators/server.js';
|
|
25
|
+
import fileCache from '../../../../lib/fileCache.js';
|
|
25
26
|
|
|
26
27
|
export default async function handler(req, res) {
|
|
27
28
|
try {
|
|
@@ -34,6 +35,7 @@ export default async function handler(req, res) {
|
|
|
34
35
|
buildDirectory: path.join(process.cwd(), 'build'),
|
|
35
36
|
config,
|
|
36
37
|
connections,
|
|
38
|
+
fileCache,
|
|
37
39
|
// logger: console,
|
|
38
40
|
logger: { debug: () => {} },
|
|
39
41
|
operators,
|
package/pages/index.js
CHANGED
|
@@ -18,6 +18,7 @@ import path from 'path';
|
|
|
18
18
|
import { createApiContext, getPageConfig, getRootConfig } from '@lowdefy/api';
|
|
19
19
|
|
|
20
20
|
import config from '../build/config.json';
|
|
21
|
+
import fileCache from '../lib/fileCache.js';
|
|
21
22
|
import getServerSession from '../lib/auth/getServerSession.js';
|
|
22
23
|
import Page from '../lib/Page.js';
|
|
23
24
|
|
|
@@ -28,6 +29,7 @@ export async function getServerSideProps(context) {
|
|
|
28
29
|
const apiContext = createApiContext({
|
|
29
30
|
buildDirectory: path.join(process.cwd(), 'build'),
|
|
30
31
|
config,
|
|
32
|
+
fileCache,
|
|
31
33
|
logger: console,
|
|
32
34
|
session,
|
|
33
35
|
});
|
package/public/.DS_Store
DELETED
|
Binary file
|