@protobase/server 0.12.10 → 0.12.11
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/dist/check-views.js +8 -1
- package/dist/view-access.js +1 -0
- package/package.json +4 -4
package/dist/check-views.js
CHANGED
|
@@ -26,6 +26,12 @@ const valueLabelErrors = (view, model) => Object.entries(view.fields).flatMap(([
|
|
|
26
26
|
if (field?.type !== "enum") return [`value labels of "${name}" need an enum field`];
|
|
27
27
|
return Object.keys(hints.valueLabels).filter((value) => !field.enumValues?.includes(value)).map((value) => `value label "${value}" is not a value of "${name}"`);
|
|
28
28
|
});
|
|
29
|
+
const valueColorErrors = (view, model) => Object.entries(view.fields).flatMap(([name, hints]) => {
|
|
30
|
+
if (!hints.valueColors) return [];
|
|
31
|
+
const field = model.fields[name];
|
|
32
|
+
if (field?.type !== "enum") return [`value colours of "${name}" need an enum field`];
|
|
33
|
+
return Object.keys(hints.valueColors).filter((value) => !field.enumValues?.includes(value)).map((value) => `value colour "${value}" is not a value of "${name}"`);
|
|
34
|
+
});
|
|
29
35
|
const linkErrors = (view, model, models, pages) => view.actions.flatMap(({ name, run }) => {
|
|
30
36
|
if (run?.kind !== "link") return [];
|
|
31
37
|
if ("href" in run) {
|
|
@@ -50,7 +56,7 @@ const widgetErrors = (view, model, fieldTypes) => Object.entries(view.fields).fl
|
|
|
50
56
|
});
|
|
51
57
|
/**
|
|
52
58
|
* Fails at startup when a view uses a sensitive field where it would show empty, a display or custom section names a
|
|
53
|
-
* field the resource does not have, labels values its enum does not have, shows a field with a field type of
|
|
59
|
+
* field the resource does not have, labels or colours values its enum does not have, shows a field with a field type of
|
|
54
60
|
* `fieldTypes` (each with the storage types it shows) that does not show it,
|
|
55
61
|
* has a related section that does not fit the resources, or a link to an address the app does not have.
|
|
56
62
|
*/
|
|
@@ -65,6 +71,7 @@ const checkViews = (registry, views, pages = [], fieldTypes = {}) => {
|
|
|
65
71
|
...sensitiveErrors(view, model),
|
|
66
72
|
...unknownFieldErrors(view, model),
|
|
67
73
|
...valueLabelErrors(view, model),
|
|
74
|
+
...valueColorErrors(view, model),
|
|
68
75
|
...widgetErrors(view, model, fieldTypes),
|
|
69
76
|
...related,
|
|
70
77
|
...linkErrors(view, model, models, pageNames)
|
package/dist/view-access.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/server",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.11",
|
|
4
4
|
"description": "The Protobase REST API as a Hono app, with Better Auth sign-in.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@better-auth/passkey": "^1.7.7",
|
|
33
|
-
"@protobase/layout": "0.12.
|
|
34
|
-
"@protobase/query": "0.12.
|
|
35
|
-
"@protobase/schema": "0.12.
|
|
33
|
+
"@protobase/layout": "0.12.11",
|
|
34
|
+
"@protobase/query": "0.12.11",
|
|
35
|
+
"@protobase/schema": "0.12.11",
|
|
36
36
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
37
37
|
"@sentry/core": "^11.7.0",
|
|
38
38
|
"@simplewebauthn/server": "^13.3.1",
|