@protobase/server 0.43.0 → 0.43.1

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.
@@ -1,5 +1,5 @@
1
1
  const shownResources = 20;
2
- const lineLength = 240;
2
+ const valueLength = 80;
3
3
  const nameLength = 60;
4
4
  const unicodeEscape = (char) => {
5
5
  const code = char.codePointAt(0);
@@ -9,10 +9,15 @@ const escaped = (json) => json.replace(/[\p{Cc}\p{Cf}\u2028\u2029`<>]/gu, unicod
9
9
  const cut = (text, length) => text.length > length ? `${text.slice(0, length - 1)}…` : text;
10
10
  const quoted = (value, length) => cut(escaped(JSON.stringify(value) ?? "null"), length);
11
11
  const plural = (count, word) => `${count} ${word}${count === 1 ? "" : "s"}`;
12
+ const counted = (value, length) => {
13
+ const text = escaped(JSON.stringify(value) ?? "null");
14
+ return text.length > length ? `${text.slice(0, length)}… (${plural(text.length - length, "more character")})` : text;
15
+ };
16
+ const fieldsOf = (data) => `{${Object.entries(data).map(([name, value]) => `${counted(name, nameLength)}:${counted(value, valueLength)}`).join(",")}}`;
12
17
  const lineOf = (operation, index) => {
13
18
  const target = operation.op === "create" ? quoted(operation.resource, nameLength) : `${quoted(operation.resource, nameLength)} ${quoted(operation.key, nameLength)}`;
14
- const values = operation.op === "delete" ? "" : ` ${quoted(operation.data, lineLength)}`;
15
- return cut(`${index + 1}. ${operation.op} ${target}${values}`, lineLength);
19
+ const values = operation.op === "delete" ? "" : ` ${fieldsOf(operation.data)}`;
20
+ return `${index + 1}. ${operation.op} ${target}${values}`;
16
21
  };
17
22
  const countsOf = (operations) => {
18
23
  const counts = /* @__PURE__ */ new Map();
package/dist/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.43.0";
2
+ var version = "0.43.1";
3
3
  //#endregion
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/server",
3
- "version": "0.43.0",
3
+ "version": "0.43.1",
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": {
@@ -36,9 +36,9 @@
36
36
  "@better-auth/passkey": "^1.7.12",
37
37
  "@better-auth/sso": "^1.7.12",
38
38
  "@modelcontextprotocol/server": "^2.3.1",
39
- "@protobase/layout": "0.43.0",
40
- "@protobase/query": "0.43.0",
41
- "@protobase/schema": "0.43.0",
39
+ "@protobase/layout": "0.43.1",
40
+ "@protobase/query": "0.43.1",
41
+ "@protobase/schema": "0.43.1",
42
42
  "@react-email/render": "^2.1.0",
43
43
  "@scalar/hono-api-reference": "^0.12.10",
44
44
  "@sentry/core": "^11.7.0",