@lowdefy/server-dev 5.5.1 → 5.6.0
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/server/apiWrapper.js +2 -9
- package/lib/server/log/createHandleError.js +9 -0
- package/package.json +30 -30
- package/package.original.json +30 -35
- package/pages/_document.js +5 -3
package/lib/server/apiWrapper.js
CHANGED
|
@@ -15,9 +15,8 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import fs from 'fs';
|
|
17
17
|
import path from 'path';
|
|
18
|
-
import { createApiContext } from '@lowdefy/api';
|
|
18
|
+
import { createApiContext, redactErrorResponse } from '@lowdefy/api';
|
|
19
19
|
import { getSecretsFromEnv } from '@lowdefy/node-utils';
|
|
20
|
-
import { serializer } from '@lowdefy/helpers';
|
|
21
20
|
import { v4 as uuid } from 'uuid';
|
|
22
21
|
|
|
23
22
|
import agents from '../../build/plugins/agents.js';
|
|
@@ -102,13 +101,7 @@ function apiWrapper(handler) {
|
|
|
102
101
|
return response;
|
|
103
102
|
} catch (error) {
|
|
104
103
|
await context.handleError(error);
|
|
105
|
-
|
|
106
|
-
if (serialized?.['~e']) {
|
|
107
|
-
delete serialized['~e'].received;
|
|
108
|
-
delete serialized['~e'].stack;
|
|
109
|
-
delete serialized['~e'].configKey;
|
|
110
|
-
}
|
|
111
|
-
res.status(500).json(serialized);
|
|
104
|
+
res.status(500).json(redactErrorResponse(context, error));
|
|
112
105
|
}
|
|
113
106
|
};
|
|
114
107
|
}
|
|
@@ -19,6 +19,15 @@ import { LowdefyInternalError, loadAndResolveErrorLocation } from '@lowdefy/erro
|
|
|
19
19
|
function createHandleError({ context }) {
|
|
20
20
|
return async function handleError(error) {
|
|
21
21
|
try {
|
|
22
|
+
// Set first, not after the log call: this function is the server's error
|
|
23
|
+
// sink, so reaching it is what makes the error already-logged, and the catch
|
|
24
|
+
// below guarantees something is written even when the steps here fail. The
|
|
25
|
+
// client reads `handled` to decide whether to POST the error to
|
|
26
|
+
// /api/client-error, so a later throw skipping this assignment would have it
|
|
27
|
+
// logged a second time. Not keyed on `source`, which a LowdefyInternalError
|
|
28
|
+
// never gets - location resolution is skipped for it below.
|
|
29
|
+
error.handled = true;
|
|
30
|
+
|
|
22
31
|
// For internal lowdefy errors, don't resolve config location
|
|
23
32
|
const location =
|
|
24
33
|
error instanceof LowdefyInternalError
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/server-dev",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -36,35 +36,35 @@
|
|
|
36
36
|
".npmrc"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@lowdefy/actions-core": "5.
|
|
40
|
-
"@lowdefy/api": "5.
|
|
41
|
-
"@lowdefy/block-utils": "5.
|
|
42
|
-
"@lowdefy/blocks-aggrid": "5.
|
|
43
|
-
"@lowdefy/blocks-antd": "5.
|
|
44
|
-
"@lowdefy/blocks-antd-x": "5.
|
|
45
|
-
"@lowdefy/blocks-basic": "5.
|
|
46
|
-
"@lowdefy/blocks-echarts": "5.
|
|
47
|
-
"@lowdefy/blocks-loaders": "5.
|
|
48
|
-
"@lowdefy/blocks-markdown": "5.
|
|
49
|
-
"@lowdefy/blocks-tiptap": "5.
|
|
50
|
-
"@lowdefy/build": "5.
|
|
51
|
-
"@lowdefy/client": "5.
|
|
52
|
-
"@lowdefy/connection-axios-http": "5.
|
|
53
|
-
"@lowdefy/engine": "5.
|
|
54
|
-
"@lowdefy/errors": "5.
|
|
55
|
-
"@lowdefy/helpers": "5.
|
|
56
|
-
"@lowdefy/layout": "5.
|
|
57
|
-
"@lowdefy/logger": "5.
|
|
58
|
-
"@lowdefy/node-utils": "5.
|
|
59
|
-
"@lowdefy/operators-change-case": "5.
|
|
60
|
-
"@lowdefy/operators-dayjs": "5.
|
|
61
|
-
"@lowdefy/operators-diff": "5.
|
|
62
|
-
"@lowdefy/operators-js": "5.
|
|
63
|
-
"@lowdefy/operators-mql": "5.
|
|
64
|
-
"@lowdefy/operators-nunjucks": "5.
|
|
65
|
-
"@lowdefy/operators-uuid": "5.
|
|
66
|
-
"@lowdefy/operators-yaml": "5.
|
|
67
|
-
"@lowdefy/plugin-next-auth": "5.
|
|
39
|
+
"@lowdefy/actions-core": "5.6.0",
|
|
40
|
+
"@lowdefy/api": "5.6.0",
|
|
41
|
+
"@lowdefy/block-utils": "5.6.0",
|
|
42
|
+
"@lowdefy/blocks-aggrid": "5.6.0",
|
|
43
|
+
"@lowdefy/blocks-antd": "5.6.0",
|
|
44
|
+
"@lowdefy/blocks-antd-x": "5.6.0",
|
|
45
|
+
"@lowdefy/blocks-basic": "5.6.0",
|
|
46
|
+
"@lowdefy/blocks-echarts": "5.6.0",
|
|
47
|
+
"@lowdefy/blocks-loaders": "5.6.0",
|
|
48
|
+
"@lowdefy/blocks-markdown": "5.6.0",
|
|
49
|
+
"@lowdefy/blocks-tiptap": "5.6.0",
|
|
50
|
+
"@lowdefy/build": "5.6.0",
|
|
51
|
+
"@lowdefy/client": "5.6.0",
|
|
52
|
+
"@lowdefy/connection-axios-http": "5.6.0",
|
|
53
|
+
"@lowdefy/engine": "5.6.0",
|
|
54
|
+
"@lowdefy/errors": "5.6.0",
|
|
55
|
+
"@lowdefy/helpers": "5.6.0",
|
|
56
|
+
"@lowdefy/layout": "5.6.0",
|
|
57
|
+
"@lowdefy/logger": "5.6.0",
|
|
58
|
+
"@lowdefy/node-utils": "5.6.0",
|
|
59
|
+
"@lowdefy/operators-change-case": "5.6.0",
|
|
60
|
+
"@lowdefy/operators-dayjs": "5.6.0",
|
|
61
|
+
"@lowdefy/operators-diff": "5.6.0",
|
|
62
|
+
"@lowdefy/operators-js": "5.6.0",
|
|
63
|
+
"@lowdefy/operators-mql": "5.6.0",
|
|
64
|
+
"@lowdefy/operators-nunjucks": "5.6.0",
|
|
65
|
+
"@lowdefy/operators-uuid": "5.6.0",
|
|
66
|
+
"@lowdefy/operators-yaml": "5.6.0",
|
|
67
|
+
"@lowdefy/plugin-next-auth": "5.6.0",
|
|
68
68
|
"@ant-design/cssinjs": "2.1.2",
|
|
69
69
|
"@ant-design/x": "2.7.0",
|
|
70
70
|
"antd": "6.3.1",
|
package/package.original.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/server-dev",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -44,35 +44,35 @@
|
|
|
44
44
|
"prepublishOnly": "pnpm build"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@lowdefy/actions-core": "5.
|
|
48
|
-
"@lowdefy/api": "5.
|
|
49
|
-
"@lowdefy/block-utils": "5.
|
|
50
|
-
"@lowdefy/blocks-aggrid": "5.
|
|
51
|
-
"@lowdefy/blocks-antd": "5.
|
|
52
|
-
"@lowdefy/blocks-antd-x": "5.
|
|
53
|
-
"@lowdefy/blocks-basic": "5.
|
|
54
|
-
"@lowdefy/blocks-echarts": "5.
|
|
55
|
-
"@lowdefy/blocks-loaders": "5.
|
|
56
|
-
"@lowdefy/blocks-markdown": "5.
|
|
57
|
-
"@lowdefy/blocks-tiptap": "5.
|
|
58
|
-
"@lowdefy/build": "5.
|
|
59
|
-
"@lowdefy/client": "5.
|
|
60
|
-
"@lowdefy/connection-axios-http": "5.
|
|
61
|
-
"@lowdefy/engine": "5.
|
|
62
|
-
"@lowdefy/errors": "5.
|
|
63
|
-
"@lowdefy/helpers": "5.
|
|
64
|
-
"@lowdefy/layout": "5.
|
|
65
|
-
"@lowdefy/logger": "5.
|
|
66
|
-
"@lowdefy/node-utils": "5.
|
|
67
|
-
"@lowdefy/operators-change-case": "5.
|
|
68
|
-
"@lowdefy/operators-dayjs": "5.
|
|
69
|
-
"@lowdefy/operators-diff": "5.
|
|
70
|
-
"@lowdefy/operators-js": "5.
|
|
71
|
-
"@lowdefy/operators-mql": "5.
|
|
72
|
-
"@lowdefy/operators-nunjucks": "5.
|
|
73
|
-
"@lowdefy/operators-uuid": "5.
|
|
74
|
-
"@lowdefy/operators-yaml": "5.
|
|
75
|
-
"@lowdefy/plugin-next-auth": "5.
|
|
47
|
+
"@lowdefy/actions-core": "5.6.0",
|
|
48
|
+
"@lowdefy/api": "5.6.0",
|
|
49
|
+
"@lowdefy/block-utils": "5.6.0",
|
|
50
|
+
"@lowdefy/blocks-aggrid": "5.6.0",
|
|
51
|
+
"@lowdefy/blocks-antd": "5.6.0",
|
|
52
|
+
"@lowdefy/blocks-antd-x": "5.6.0",
|
|
53
|
+
"@lowdefy/blocks-basic": "5.6.0",
|
|
54
|
+
"@lowdefy/blocks-echarts": "5.6.0",
|
|
55
|
+
"@lowdefy/blocks-loaders": "5.6.0",
|
|
56
|
+
"@lowdefy/blocks-markdown": "5.6.0",
|
|
57
|
+
"@lowdefy/blocks-tiptap": "5.6.0",
|
|
58
|
+
"@lowdefy/build": "5.6.0",
|
|
59
|
+
"@lowdefy/client": "5.6.0",
|
|
60
|
+
"@lowdefy/connection-axios-http": "5.6.0",
|
|
61
|
+
"@lowdefy/engine": "5.6.0",
|
|
62
|
+
"@lowdefy/errors": "5.6.0",
|
|
63
|
+
"@lowdefy/helpers": "5.6.0",
|
|
64
|
+
"@lowdefy/layout": "5.6.0",
|
|
65
|
+
"@lowdefy/logger": "5.6.0",
|
|
66
|
+
"@lowdefy/node-utils": "5.6.0",
|
|
67
|
+
"@lowdefy/operators-change-case": "5.6.0",
|
|
68
|
+
"@lowdefy/operators-dayjs": "5.6.0",
|
|
69
|
+
"@lowdefy/operators-diff": "5.6.0",
|
|
70
|
+
"@lowdefy/operators-js": "5.6.0",
|
|
71
|
+
"@lowdefy/operators-mql": "5.6.0",
|
|
72
|
+
"@lowdefy/operators-nunjucks": "5.6.0",
|
|
73
|
+
"@lowdefy/operators-uuid": "5.6.0",
|
|
74
|
+
"@lowdefy/operators-yaml": "5.6.0",
|
|
75
|
+
"@lowdefy/plugin-next-auth": "5.6.0",
|
|
76
76
|
"@ant-design/cssinjs": "2.1.2",
|
|
77
77
|
"@ant-design/x": "2.7.0",
|
|
78
78
|
"antd": "6.3.1",
|
|
@@ -103,11 +103,6 @@
|
|
|
103
103
|
"engines": {
|
|
104
104
|
"node": ">=18"
|
|
105
105
|
},
|
|
106
|
-
"pnpm": {
|
|
107
|
-
"onlyBuiltDependencies": [
|
|
108
|
-
"better-sqlite3"
|
|
109
|
-
]
|
|
110
|
-
},
|
|
111
106
|
"publishConfig": {
|
|
112
107
|
"access": "public"
|
|
113
108
|
}
|
package/pages/_document.js
CHANGED
|
@@ -64,8 +64,10 @@ class LowdefyDocument extends Document {
|
|
|
64
64
|
__html: `(function(){var s=document.createElement("style");s.id="__lf-layer-order";s.textContent="@layer theme, base, antd, components, utilities;";document.head.prepend(s);new MutationObserver(function(){if(document.head.firstChild!==s)document.head.prepend(s)}).observe(document.head,{childList:true})})();`,
|
|
65
65
|
}}
|
|
66
66
|
/>
|
|
67
|
-
{/* Synchronous pre-hydration
|
|
68
|
-
|
|
67
|
+
{/* Synchronous pre-hydration script setting the <html> background and
|
|
68
|
+
color-scheme — prevents a mode-mismatch flash of the page and of
|
|
69
|
+
browser chrome (scrollbars, form controls) on page navigation.
|
|
70
|
+
Mirrors useDarkMode.js resolution order:
|
|
69
71
|
configDarkMode → localStorage → prefers-color-scheme. Uses the user's
|
|
70
72
|
configured colorBgLayout tokens when present (theme.antd.darkToken and
|
|
71
73
|
theme.antd.lightToken), falling back to #000 in dark and no inline style
|
|
@@ -76,7 +78,7 @@ class LowdefyDocument extends Document {
|
|
|
76
78
|
darkBg
|
|
77
79
|
)};var lb=${safeScriptJson(
|
|
78
80
|
lightBg
|
|
79
|
-
)};var d;if(c==="dark")d=true;else if(c==="light")d=false;else{try{var p=localStorage.getItem("lowdefy_darkMode");if(p==="dark")d=true;else if(p==="light")d=false;else d=window.matchMedia("(prefers-color-scheme:dark)").matches}catch(e){d=window.matchMedia("(prefers-color-scheme:dark)").matches}}var bg=d?db:lb;if(bg)document.documentElement.style.backgroundColor=bg})();`,
|
|
81
|
+
)};var d;if(c==="dark")d=true;else if(c==="light")d=false;else{try{var p=localStorage.getItem("lowdefy_darkMode");if(p==="dark")d=true;else if(p==="light")d=false;else d=window.matchMedia("(prefers-color-scheme:dark)").matches}catch(e){d=window.matchMedia("(prefers-color-scheme:dark)").matches}}var bg=d?db:lb;document.documentElement.style.colorScheme=d?"dark":"light";if(bg)document.documentElement.style.backgroundColor=bg})();`,
|
|
80
82
|
}}
|
|
81
83
|
/>
|
|
82
84
|
<link rel="manifest" href={`${basePath}/manifest.webmanifest`} />
|