@protobase/server 0.21.8 → 0.21.9

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.
@@ -47,10 +47,16 @@ const valueColorErrors = (view, model) => Object.entries(view.fields).flatMap(([
47
47
  return Object.keys(hints.valueColors).filter((value) => !field.enumValues?.includes(value)).map((value) => `value colour "${value}" is not a value of "${name}"`);
48
48
  });
49
49
  const textHints = ["multiline", "markdown"];
50
+ const textFormats = /* @__PURE__ */ new Set([
51
+ "email",
52
+ "phone",
53
+ "url"
54
+ ]);
50
55
  const textHintErrors = (view, model) => Object.entries(view.fields).flatMap(([name, hints]) => {
51
56
  const field = model.fields[name];
52
57
  if (!field || field.type === "text") return [];
53
- return textHints.filter((hint) => hints[hint]).map((hint) => `${hint} "${name}" needs a text field, not ${field.type}`);
58
+ const format = hints.format !== void 0 && textFormats.has(hints.format) ? [`format('${hints.format}') of "${name}" needs a text field, not ${field.type}`] : [];
59
+ return [...textHints.filter((hint) => hints[hint]).map((hint) => `${hint} "${name}" needs a text field, not ${field.type}`), ...format];
54
60
  });
55
61
  const linkErrors = (view, model, models, pages) => view.actions.flatMap(({ name, label, run }) => {
56
62
  if (run?.kind !== "link") return [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/server",
3
- "version": "0.21.8",
3
+ "version": "0.21.9",
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.21.8",
34
- "@protobase/query": "0.21.8",
35
- "@protobase/schema": "0.21.8",
33
+ "@protobase/layout": "0.21.9",
34
+ "@protobase/query": "0.21.9",
35
+ "@protobase/schema": "0.21.9",
36
36
  "@react-email/render": "^2.1.0",
37
37
  "@scalar/hono-api-reference": "^0.12.10",
38
38
  "@sentry/core": "^11.7.0",