@lowdefy/server-dev 0.0.0-experimental-20240115131502 → 0.0.0-experimental-20241107140648
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/client/App.js +3 -1
- package/lib/client/Page.js +13 -2
- package/lib/client/Reload.js +1 -1
- package/lib/client/RestartingPage.js +1 -1
- package/lib/client/auth/Auth.js +1 -1
- package/lib/client/auth/AuthConfigured.js +1 -1
- package/lib/client/auth/AuthNotConfigured.js +1 -1
- package/lib/client/setPageId.js +1 -1
- package/lib/client/utils/request.js +1 -1
- package/lib/client/utils/useMutateCache.js +1 -1
- package/lib/client/utils/usePageConfig.js +1 -1
- package/lib/client/utils/useRootConfig.js +1 -1
- package/lib/client/utils/waitForRestartedServer.js +1 -1
- package/lib/server/apiWrapper.js +3 -1
- package/lib/server/auth/getAuthOptions.js +1 -1
- package/lib/server/auth/getServerSession.js +1 -1
- package/lib/server/fileCache.js +1 -1
- package/lib/server/log/createLogger.js +1 -1
- package/lib/server/log/logError.js +1 -1
- package/lib/server/log/logRequest.js +1 -1
- package/manager/getContext.mjs +1 -1
- package/manager/processes/initialBuild.mjs +1 -1
- package/manager/processes/installPlugins.mjs +1 -1
- package/manager/processes/lowdefyBuild.mjs +1 -1
- package/manager/processes/nextBuild.mjs +1 -1
- package/manager/processes/readDotEnv.mjs +1 -1
- package/manager/processes/reloadClients.mjs +1 -1
- package/manager/processes/restartServer.mjs +1 -1
- package/manager/processes/shutdownServer.mjs +1 -1
- package/manager/processes/startServer.mjs +2 -1
- package/manager/processes/startWatchers.mjs +1 -1
- package/manager/run.mjs +1 -1
- package/manager/utils/BatchChanges.mjs +1 -1
- package/manager/utils/createCustomPluginTypesMap.mjs +1 -1
- package/manager/utils/createLogger.mjs +1 -1
- package/manager/utils/createStdOutLineHandler.mjs +1 -1
- package/manager/utils/getLowdefyVersion.mjs +1 -1
- package/manager/utils/getNextBin.mjs +1 -1
- package/manager/utils/setupWatcher.mjs +1 -1
- package/manager/watchers/envWatcher.mjs +1 -1
- package/manager/watchers/lowdefyBuildWatcher.mjs +1 -1
- package/manager/watchers/nextBuildWatcher.mjs +3 -1
- package/package.json +29 -28
- package/package.original.json +31 -29
- package/pages/404.js +1 -1
- package/pages/[pageId].js +1 -1
- package/pages/_app.js +1 -1
- package/pages/_document.js +1 -1
- package/pages/api/auth/[...nextauth].js +1 -1
- package/pages/api/dev-tools.js +22 -0
- package/pages/api/endpoints/[endpointId].js +32 -0
- package/pages/api/license.js +2 -2
- package/pages/api/page/[pageId].js +1 -1
- package/pages/api/ping.js +1 -1
- package/pages/api/reload.js +1 -1
- package/pages/api/request/[pageId]/[requestId].js +1 -1
- package/pages/api/root.js +1 -1
- package/pages/index.js +1 -1
package/lib/client/App.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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.
|
|
@@ -30,6 +30,7 @@ import actions from '../../build/plugins/actions.js';
|
|
|
30
30
|
import blocks from '../../build/plugins/blocks.js';
|
|
31
31
|
import icons from '../../build/plugins/icons.js';
|
|
32
32
|
import operators from '../../build/plugins/operators/client.js';
|
|
33
|
+
import jsMap from '../../build/plugins/operators/clientJsMap.js';
|
|
33
34
|
|
|
34
35
|
const App = ({ auth, lowdefy }) => {
|
|
35
36
|
const router = useRouter();
|
|
@@ -49,6 +50,7 @@ const App = ({ auth, lowdefy }) => {
|
|
|
49
50
|
config={{
|
|
50
51
|
rootConfig,
|
|
51
52
|
}}
|
|
53
|
+
jsMap={jsMap}
|
|
52
54
|
lowdefy={lowdefy}
|
|
53
55
|
pageId={pageId}
|
|
54
56
|
resetContext={resetContext}
|
package/lib/client/Page.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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.
|
|
@@ -20,7 +20,17 @@ import Client from '@lowdefy/client';
|
|
|
20
20
|
import RestartingPage from './RestartingPage.js';
|
|
21
21
|
import usePageConfig from './utils/usePageConfig.js';
|
|
22
22
|
|
|
23
|
-
const Page = ({
|
|
23
|
+
const Page = ({
|
|
24
|
+
auth,
|
|
25
|
+
Components,
|
|
26
|
+
config,
|
|
27
|
+
jsMap,
|
|
28
|
+
lowdefy,
|
|
29
|
+
pageId,
|
|
30
|
+
resetContext,
|
|
31
|
+
router,
|
|
32
|
+
types,
|
|
33
|
+
}) => {
|
|
24
34
|
const { data: pageConfig } = usePageConfig(pageId, router.basePath);
|
|
25
35
|
|
|
26
36
|
if (!pageConfig) {
|
|
@@ -38,6 +48,7 @@ const Page = ({ auth, Components, config, lowdefy, pageId, resetContext, router,
|
|
|
38
48
|
...config,
|
|
39
49
|
pageConfig,
|
|
40
50
|
}}
|
|
51
|
+
jsMap={jsMap}
|
|
41
52
|
lowdefy={lowdefy}
|
|
42
53
|
resetContext={resetContext}
|
|
43
54
|
router={router}
|
package/lib/client/Reload.js
CHANGED
package/lib/client/auth/Auth.js
CHANGED
package/lib/client/setPageId.js
CHANGED
package/lib/server/apiWrapper.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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.
|
|
@@ -26,6 +26,7 @@ import getServerSession from './auth/getServerSession.js';
|
|
|
26
26
|
import logError from './log/logError.js';
|
|
27
27
|
import logRequest from './log/logRequest.js';
|
|
28
28
|
import operators from '../../build/plugins/operators/server.js';
|
|
29
|
+
import jsMap from '../../build/plugins/operators/serverJsMap.js';
|
|
29
30
|
import getAuthOptions from './auth/getAuthOptions.js';
|
|
30
31
|
|
|
31
32
|
const secrets = getSecretsFromEnv();
|
|
@@ -40,6 +41,7 @@ function apiWrapper(handler) {
|
|
|
40
41
|
connections,
|
|
41
42
|
fileCache,
|
|
42
43
|
headers: req?.headers,
|
|
44
|
+
jsMap,
|
|
43
45
|
logger: console,
|
|
44
46
|
operators,
|
|
45
47
|
req,
|
package/lib/server/fileCache.js
CHANGED
package/manager/getContext.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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.
|
|
@@ -28,6 +28,7 @@ function startServer(context) {
|
|
|
28
28
|
processOptions: {
|
|
29
29
|
env: {
|
|
30
30
|
...process.env,
|
|
31
|
+
LOWDEFY_DIRECTORY_CONFIG: context.directories.config,
|
|
31
32
|
PORT: context.options.port,
|
|
32
33
|
},
|
|
33
34
|
},
|
package/manager/run.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
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.
|
|
@@ -35,7 +35,9 @@ const trackedFiles = [
|
|
|
35
35
|
'build/plugins/connections.js',
|
|
36
36
|
'build/plugins/icons.js',
|
|
37
37
|
'build/plugins/operators/client.js',
|
|
38
|
+
'build/plugins/operators/clientJsMap.js',
|
|
38
39
|
'build/plugins/operators/server.js',
|
|
40
|
+
'build/plugins/operators/serverJsMap.js',
|
|
39
41
|
'build/plugins/styles.less',
|
|
40
42
|
'public/styles.less',
|
|
41
43
|
'package.json',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/server-dev",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-20241107140648",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -36,33 +36,34 @@
|
|
|
36
36
|
".npmrc"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@lowdefy/actions-core": "0.0.0-experimental-
|
|
40
|
-
"@lowdefy/api": "0.0.0-experimental-
|
|
41
|
-
"@lowdefy/block-utils": "0.0.0-experimental-
|
|
42
|
-
"@lowdefy/blocks-aggrid": "0.0.0-experimental-
|
|
43
|
-
"@lowdefy/blocks-antd": "0.0.0-experimental-
|
|
44
|
-
"@lowdefy/blocks-basic": "0.0.0-experimental-
|
|
45
|
-
"@lowdefy/blocks-color-selectors": "0.0.0-experimental-
|
|
46
|
-
"@lowdefy/blocks-echarts": "0.0.0-experimental-
|
|
47
|
-
"@lowdefy/blocks-loaders": "0.0.0-experimental-
|
|
48
|
-
"@lowdefy/blocks-markdown": "0.0.0-experimental-
|
|
49
|
-
"@lowdefy/blocks-qr": "0.0.0-experimental-
|
|
50
|
-
"@lowdefy/build": "0.0.0-experimental-
|
|
51
|
-
"@lowdefy/client": "0.0.0-experimental-
|
|
52
|
-
"@lowdefy/connection-axios-http": "0.0.0-experimental-
|
|
53
|
-
"@lowdefy/engine": "0.0.0-experimental-
|
|
54
|
-
"@lowdefy/helpers": "0.0.0-experimental-
|
|
55
|
-
"@lowdefy/layout": "0.0.0-experimental-
|
|
56
|
-
"@lowdefy/node-utils": "0.0.0-experimental-
|
|
57
|
-
"@lowdefy/operators-change-case": "0.0.0-experimental-
|
|
58
|
-
"@lowdefy/operators-diff": "0.0.0-experimental-
|
|
59
|
-
"@lowdefy/operators-js": "0.0.0-experimental-
|
|
60
|
-
"@lowdefy/operators-moment": "0.0.0-experimental-
|
|
61
|
-
"@lowdefy/operators-mql": "0.0.0-experimental-
|
|
62
|
-
"@lowdefy/operators-nunjucks": "0.0.0-experimental-
|
|
63
|
-
"@lowdefy/operators-uuid": "0.0.0-experimental-
|
|
64
|
-
"@lowdefy/operators-yaml": "0.0.0-experimental-
|
|
65
|
-
"@lowdefy/plugin-
|
|
39
|
+
"@lowdefy/actions-core": "0.0.0-experimental-20241107140648",
|
|
40
|
+
"@lowdefy/api": "0.0.0-experimental-20241107140648",
|
|
41
|
+
"@lowdefy/block-utils": "0.0.0-experimental-20241107140648",
|
|
42
|
+
"@lowdefy/blocks-aggrid": "0.0.0-experimental-20241107140648",
|
|
43
|
+
"@lowdefy/blocks-antd": "0.0.0-experimental-20241107140648",
|
|
44
|
+
"@lowdefy/blocks-basic": "0.0.0-experimental-20241107140648",
|
|
45
|
+
"@lowdefy/blocks-color-selectors": "0.0.0-experimental-20241107140648",
|
|
46
|
+
"@lowdefy/blocks-echarts": "0.0.0-experimental-20241107140648",
|
|
47
|
+
"@lowdefy/blocks-loaders": "0.0.0-experimental-20241107140648",
|
|
48
|
+
"@lowdefy/blocks-markdown": "0.0.0-experimental-20241107140648",
|
|
49
|
+
"@lowdefy/blocks-qr": "0.0.0-experimental-20241107140648",
|
|
50
|
+
"@lowdefy/build": "0.0.0-experimental-20241107140648",
|
|
51
|
+
"@lowdefy/client": "0.0.0-experimental-20241107140648",
|
|
52
|
+
"@lowdefy/connection-axios-http": "0.0.0-experimental-20241107140648",
|
|
53
|
+
"@lowdefy/engine": "0.0.0-experimental-20241107140648",
|
|
54
|
+
"@lowdefy/helpers": "0.0.0-experimental-20241107140648",
|
|
55
|
+
"@lowdefy/layout": "0.0.0-experimental-20241107140648",
|
|
56
|
+
"@lowdefy/node-utils": "0.0.0-experimental-20241107140648",
|
|
57
|
+
"@lowdefy/operators-change-case": "0.0.0-experimental-20241107140648",
|
|
58
|
+
"@lowdefy/operators-diff": "0.0.0-experimental-20241107140648",
|
|
59
|
+
"@lowdefy/operators-js": "0.0.0-experimental-20241107140648",
|
|
60
|
+
"@lowdefy/operators-moment": "0.0.0-experimental-20241107140648",
|
|
61
|
+
"@lowdefy/operators-mql": "0.0.0-experimental-20241107140648",
|
|
62
|
+
"@lowdefy/operators-nunjucks": "0.0.0-experimental-20241107140648",
|
|
63
|
+
"@lowdefy/operators-uuid": "0.0.0-experimental-20241107140648",
|
|
64
|
+
"@lowdefy/operators-yaml": "0.0.0-experimental-20241107140648",
|
|
65
|
+
"@lowdefy/plugin-aws": "0.0.0-experimental-20241107140648",
|
|
66
|
+
"@lowdefy/plugin-next-auth": "0.0.0-experimental-20241107140648",
|
|
66
67
|
"chokidar": "3.5.3",
|
|
67
68
|
"dotenv": "16.3.1",
|
|
68
69
|
"next": "13.5.4",
|
package/package.original.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/server-dev",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-20241107140648",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -39,36 +39,38 @@
|
|
|
39
39
|
"build": "cp package.json package.original.json || copy package.json package.original.json",
|
|
40
40
|
"start": "node manager/run.mjs",
|
|
41
41
|
"lint": "next lint",
|
|
42
|
-
"next": "next"
|
|
42
|
+
"next": "next",
|
|
43
|
+
"prepublishOnly": "pnpm build"
|
|
43
44
|
},
|
|
44
45
|
"dependencies": {
|
|
45
|
-
"@lowdefy/actions-core": "0.0.0-experimental-
|
|
46
|
-
"@lowdefy/api": "0.0.0-experimental-
|
|
47
|
-
"@lowdefy/block-utils": "0.0.0-experimental-
|
|
48
|
-
"@lowdefy/blocks-aggrid": "0.0.0-experimental-
|
|
49
|
-
"@lowdefy/blocks-antd": "0.0.0-experimental-
|
|
50
|
-
"@lowdefy/blocks-basic": "0.0.0-experimental-
|
|
51
|
-
"@lowdefy/blocks-color-selectors": "0.0.0-experimental-
|
|
52
|
-
"@lowdefy/blocks-echarts": "0.0.0-experimental-
|
|
53
|
-
"@lowdefy/blocks-loaders": "0.0.0-experimental-
|
|
54
|
-
"@lowdefy/blocks-markdown": "0.0.0-experimental-
|
|
55
|
-
"@lowdefy/blocks-qr": "0.0.0-experimental-
|
|
56
|
-
"@lowdefy/build": "0.0.0-experimental-
|
|
57
|
-
"@lowdefy/client": "0.0.0-experimental-
|
|
58
|
-
"@lowdefy/connection-axios-http": "0.0.0-experimental-
|
|
59
|
-
"@lowdefy/engine": "0.0.0-experimental-
|
|
60
|
-
"@lowdefy/helpers": "0.0.0-experimental-
|
|
61
|
-
"@lowdefy/layout": "0.0.0-experimental-
|
|
62
|
-
"@lowdefy/node-utils": "0.0.0-experimental-
|
|
63
|
-
"@lowdefy/operators-change-case": "0.0.0-experimental-
|
|
64
|
-
"@lowdefy/operators-diff": "0.0.0-experimental-
|
|
65
|
-
"@lowdefy/operators-js": "0.0.0-experimental-
|
|
66
|
-
"@lowdefy/operators-moment": "0.0.0-experimental-
|
|
67
|
-
"@lowdefy/operators-mql": "0.0.0-experimental-
|
|
68
|
-
"@lowdefy/operators-nunjucks": "0.0.0-experimental-
|
|
69
|
-
"@lowdefy/operators-uuid": "0.0.0-experimental-
|
|
70
|
-
"@lowdefy/operators-yaml": "0.0.0-experimental-
|
|
71
|
-
"@lowdefy/plugin-
|
|
46
|
+
"@lowdefy/actions-core": "0.0.0-experimental-20241107140648",
|
|
47
|
+
"@lowdefy/api": "0.0.0-experimental-20241107140648",
|
|
48
|
+
"@lowdefy/block-utils": "0.0.0-experimental-20241107140648",
|
|
49
|
+
"@lowdefy/blocks-aggrid": "0.0.0-experimental-20241107140648",
|
|
50
|
+
"@lowdefy/blocks-antd": "0.0.0-experimental-20241107140648",
|
|
51
|
+
"@lowdefy/blocks-basic": "0.0.0-experimental-20241107140648",
|
|
52
|
+
"@lowdefy/blocks-color-selectors": "0.0.0-experimental-20241107140648",
|
|
53
|
+
"@lowdefy/blocks-echarts": "0.0.0-experimental-20241107140648",
|
|
54
|
+
"@lowdefy/blocks-loaders": "0.0.0-experimental-20241107140648",
|
|
55
|
+
"@lowdefy/blocks-markdown": "0.0.0-experimental-20241107140648",
|
|
56
|
+
"@lowdefy/blocks-qr": "0.0.0-experimental-20241107140648",
|
|
57
|
+
"@lowdefy/build": "0.0.0-experimental-20241107140648",
|
|
58
|
+
"@lowdefy/client": "0.0.0-experimental-20241107140648",
|
|
59
|
+
"@lowdefy/connection-axios-http": "0.0.0-experimental-20241107140648",
|
|
60
|
+
"@lowdefy/engine": "0.0.0-experimental-20241107140648",
|
|
61
|
+
"@lowdefy/helpers": "0.0.0-experimental-20241107140648",
|
|
62
|
+
"@lowdefy/layout": "0.0.0-experimental-20241107140648",
|
|
63
|
+
"@lowdefy/node-utils": "0.0.0-experimental-20241107140648",
|
|
64
|
+
"@lowdefy/operators-change-case": "0.0.0-experimental-20241107140648",
|
|
65
|
+
"@lowdefy/operators-diff": "0.0.0-experimental-20241107140648",
|
|
66
|
+
"@lowdefy/operators-js": "0.0.0-experimental-20241107140648",
|
|
67
|
+
"@lowdefy/operators-moment": "0.0.0-experimental-20241107140648",
|
|
68
|
+
"@lowdefy/operators-mql": "0.0.0-experimental-20241107140648",
|
|
69
|
+
"@lowdefy/operators-nunjucks": "0.0.0-experimental-20241107140648",
|
|
70
|
+
"@lowdefy/operators-uuid": "0.0.0-experimental-20241107140648",
|
|
71
|
+
"@lowdefy/operators-yaml": "0.0.0-experimental-20241107140648",
|
|
72
|
+
"@lowdefy/plugin-aws": "0.0.0-experimental-20241107140648",
|
|
73
|
+
"@lowdefy/plugin-next-auth": "0.0.0-experimental-20241107140648",
|
|
72
74
|
"chokidar": "3.5.3",
|
|
73
75
|
"dotenv": "16.3.1",
|
|
74
76
|
"next": "13.5.4",
|
package/pages/404.js
CHANGED
package/pages/[pageId].js
CHANGED
package/pages/_app.js
CHANGED
package/pages/_document.js
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
*/
|
|
16
|
+
import apiWrapper from '../../lib/server/apiWrapper.js';
|
|
17
|
+
|
|
18
|
+
async function handler({ req, res }) {
|
|
19
|
+
res.status(200).json({ directories: { config: process.env.LOWDEFY_DIRECTORY_CONFIG } });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default apiWrapper(handler);
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { callEndpoint } from '@lowdefy/api';
|
|
18
|
+
|
|
19
|
+
import apiWrapper from '../../../lib/server/apiWrapper.js';
|
|
20
|
+
|
|
21
|
+
async function handler({ context, req, res }) {
|
|
22
|
+
if (req.method !== 'POST') {
|
|
23
|
+
throw new Error('Only POST requests are supported.');
|
|
24
|
+
}
|
|
25
|
+
const { endpointId } = req.query;
|
|
26
|
+
const { blockId, payload, pageId } = req.body;
|
|
27
|
+
context.logger.info({ event: 'call_api_endpoint', blockId, endpointId, pageId });
|
|
28
|
+
const response = await callEndpoint(context, { blockId, endpointId, pageId, payload });
|
|
29
|
+
res.status(200).json(response);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default apiWrapper(handler);
|
package/pages/api/license.js
CHANGED
|
@@ -15,8 +15,8 @@ async function handler({ req, res }) {
|
|
|
15
15
|
throw new Error('Only GET requests are supported.');
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
const
|
|
19
|
-
return res.status(200).json(
|
|
18
|
+
const { code, entitlements } = await validateLicense();
|
|
19
|
+
return res.status(200).json({ code, entitlements });
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export default apiWrapper(handler);
|
package/pages/api/ping.js
CHANGED
package/pages/api/reload.js
CHANGED
package/pages/api/root.js
CHANGED
package/pages/index.js
CHANGED