@lowdefy/server-e2e 5.5.0 → 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
CHANGED
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import path from 'path';
|
|
18
|
-
import { createApiContext } from '@lowdefy/api';
|
|
19
|
-
import { serializer } from '@lowdefy/helpers';
|
|
18
|
+
import { createApiContext, redactErrorResponse } from '@lowdefy/api';
|
|
20
19
|
import { v4 as uuid } from 'uuid';
|
|
21
20
|
|
|
22
21
|
import appMeta from '../build/appMeta.js';
|
|
@@ -66,13 +65,7 @@ function apiWrapper(handler) {
|
|
|
66
65
|
return response;
|
|
67
66
|
} catch (error) {
|
|
68
67
|
await context.handleError(error);
|
|
69
|
-
|
|
70
|
-
if (serialized?.['~e']) {
|
|
71
|
-
delete serialized['~e'].received;
|
|
72
|
-
delete serialized['~e'].stack;
|
|
73
|
-
delete serialized['~e'].configKey;
|
|
74
|
-
}
|
|
75
|
-
res.status(500).json(serialized);
|
|
68
|
+
res.status(500).json(redactErrorResponse(context, error));
|
|
76
69
|
}
|
|
77
70
|
};
|
|
78
71
|
}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import { isReserved, setKey } from '@lowdefy/helpers';
|
|
17
18
|
import { getSecretsFromEnv } from '@lowdefy/node-utils';
|
|
18
19
|
|
|
19
20
|
import createLogger from './log/createLogger.js';
|
|
@@ -26,7 +27,13 @@ function getE2eSecrets() {
|
|
|
26
27
|
const e2eOverrides = {};
|
|
27
28
|
Object.keys(process.env).forEach((key) => {
|
|
28
29
|
if (key.startsWith('LOWDEFY_E2E_SECRET_')) {
|
|
29
|
-
|
|
30
|
+
const name = key.replace('LOWDEFY_E2E_SECRET_', '');
|
|
31
|
+
if (isReserved(name)) {
|
|
32
|
+
throw new Error(
|
|
33
|
+
`Environment variable "${key}" names a reserved secret "${name}". Rename the secret.`
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
setKey(e2eOverrides, name, process.env[key]);
|
|
30
37
|
}
|
|
31
38
|
});
|
|
32
39
|
|
|
@@ -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-e2e",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Lowdefy e2e testing server with cookie-based user injection",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -39,26 +39,26 @@
|
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@ant-design/cssinjs": "2.1.2",
|
|
42
|
-
"@lowdefy/actions-core": "5.
|
|
43
|
-
"@lowdefy/api": "5.
|
|
44
|
-
"@lowdefy/block-utils": "5.
|
|
45
|
-
"@lowdefy/blocks-antd": "5.
|
|
46
|
-
"@lowdefy/blocks-antd-x": "5.
|
|
47
|
-
"@lowdefy/blocks-basic": "5.
|
|
48
|
-
"@lowdefy/blocks-loaders": "5.
|
|
49
|
-
"@lowdefy/blocks-markdown": "5.
|
|
50
|
-
"@lowdefy/blocks-tiptap": "5.
|
|
51
|
-
"@lowdefy/client": "5.
|
|
52
|
-
"@lowdefy/connection-axios-http": "5.
|
|
53
|
-
"@lowdefy/connection-mongodb": "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-js": "5.
|
|
60
|
-
"@lowdefy/operators-nunjucks": "5.
|
|
61
|
-
"@lowdefy/operators-uuid": "5.
|
|
42
|
+
"@lowdefy/actions-core": "5.6.0",
|
|
43
|
+
"@lowdefy/api": "5.6.0",
|
|
44
|
+
"@lowdefy/block-utils": "5.6.0",
|
|
45
|
+
"@lowdefy/blocks-antd": "5.6.0",
|
|
46
|
+
"@lowdefy/blocks-antd-x": "5.6.0",
|
|
47
|
+
"@lowdefy/blocks-basic": "5.6.0",
|
|
48
|
+
"@lowdefy/blocks-loaders": "5.6.0",
|
|
49
|
+
"@lowdefy/blocks-markdown": "5.6.0",
|
|
50
|
+
"@lowdefy/blocks-tiptap": "5.6.0",
|
|
51
|
+
"@lowdefy/client": "5.6.0",
|
|
52
|
+
"@lowdefy/connection-axios-http": "5.6.0",
|
|
53
|
+
"@lowdefy/connection-mongodb": "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-js": "5.6.0",
|
|
60
|
+
"@lowdefy/operators-nunjucks": "5.6.0",
|
|
61
|
+
"@lowdefy/operators-uuid": "5.6.0",
|
|
62
62
|
"@tailwindcss/postcss": "4.2.1",
|
|
63
63
|
"antd": "6.3.1",
|
|
64
64
|
"dayjs": "1.11.19",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@jest/globals": "28.1.3",
|
|
75
|
-
"@lowdefy/build": "5.
|
|
75
|
+
"@lowdefy/build": "5.6.0",
|
|
76
76
|
"@next/eslint-plugin-next": "16.1.6",
|
|
77
77
|
"@tailwindcss/postcss": "4.2.1",
|
|
78
78
|
"jest": "28.1.3",
|
package/package.original.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/server-e2e",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Lowdefy e2e testing server with cookie-based user injection",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -50,26 +50,26 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@ant-design/cssinjs": "2.1.2",
|
|
53
|
-
"@lowdefy/actions-core": "5.
|
|
54
|
-
"@lowdefy/api": "5.
|
|
55
|
-
"@lowdefy/block-utils": "5.
|
|
56
|
-
"@lowdefy/blocks-antd": "5.
|
|
57
|
-
"@lowdefy/blocks-antd-x": "5.
|
|
58
|
-
"@lowdefy/blocks-basic": "5.
|
|
59
|
-
"@lowdefy/blocks-loaders": "5.
|
|
60
|
-
"@lowdefy/blocks-markdown": "5.
|
|
61
|
-
"@lowdefy/blocks-tiptap": "5.
|
|
62
|
-
"@lowdefy/client": "5.
|
|
63
|
-
"@lowdefy/connection-axios-http": "5.
|
|
64
|
-
"@lowdefy/connection-mongodb": "5.
|
|
65
|
-
"@lowdefy/errors": "5.
|
|
66
|
-
"@lowdefy/helpers": "5.
|
|
67
|
-
"@lowdefy/layout": "5.
|
|
68
|
-
"@lowdefy/logger": "5.
|
|
69
|
-
"@lowdefy/node-utils": "5.
|
|
70
|
-
"@lowdefy/operators-js": "5.
|
|
71
|
-
"@lowdefy/operators-nunjucks": "5.
|
|
72
|
-
"@lowdefy/operators-uuid": "5.
|
|
53
|
+
"@lowdefy/actions-core": "5.6.0",
|
|
54
|
+
"@lowdefy/api": "5.6.0",
|
|
55
|
+
"@lowdefy/block-utils": "5.6.0",
|
|
56
|
+
"@lowdefy/blocks-antd": "5.6.0",
|
|
57
|
+
"@lowdefy/blocks-antd-x": "5.6.0",
|
|
58
|
+
"@lowdefy/blocks-basic": "5.6.0",
|
|
59
|
+
"@lowdefy/blocks-loaders": "5.6.0",
|
|
60
|
+
"@lowdefy/blocks-markdown": "5.6.0",
|
|
61
|
+
"@lowdefy/blocks-tiptap": "5.6.0",
|
|
62
|
+
"@lowdefy/client": "5.6.0",
|
|
63
|
+
"@lowdefy/connection-axios-http": "5.6.0",
|
|
64
|
+
"@lowdefy/connection-mongodb": "5.6.0",
|
|
65
|
+
"@lowdefy/errors": "5.6.0",
|
|
66
|
+
"@lowdefy/helpers": "5.6.0",
|
|
67
|
+
"@lowdefy/layout": "5.6.0",
|
|
68
|
+
"@lowdefy/logger": "5.6.0",
|
|
69
|
+
"@lowdefy/node-utils": "5.6.0",
|
|
70
|
+
"@lowdefy/operators-js": "5.6.0",
|
|
71
|
+
"@lowdefy/operators-nunjucks": "5.6.0",
|
|
72
|
+
"@lowdefy/operators-uuid": "5.6.0",
|
|
73
73
|
"@tailwindcss/postcss": "4.2.1",
|
|
74
74
|
"antd": "6.3.1",
|
|
75
75
|
"dayjs": "1.11.19",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@jest/globals": "28.1.3",
|
|
86
|
-
"@lowdefy/build": "5.
|
|
86
|
+
"@lowdefy/build": "5.6.0",
|
|
87
87
|
"@next/eslint-plugin-next": "16.1.6",
|
|
88
88
|
"@tailwindcss/postcss": "4.2.1",
|
|
89
89
|
"jest": "28.1.3",
|
|
@@ -95,11 +95,6 @@
|
|
|
95
95
|
"engines": {
|
|
96
96
|
"node": ">=18"
|
|
97
97
|
},
|
|
98
|
-
"pnpm": {
|
|
99
|
-
"onlyBuiltDependencies": [
|
|
100
|
-
"better-sqlite3"
|
|
101
|
-
]
|
|
102
|
-
},
|
|
103
98
|
"publishConfig": {
|
|
104
99
|
"access": "public"
|
|
105
100
|
}
|
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`} />
|