@protobase/server 0.42.0 → 0.43.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.
Files changed (50) hide show
  1. package/dist/aggregate-groups.js +1 -1
  2. package/dist/aggregate-service.js +3 -3
  3. package/dist/aggregate-splits.js +1 -1
  4. package/dist/ai/generate-route.js +1 -1
  5. package/dist/assistant/batch-approval.js +55 -0
  6. package/dist/assistant/batch-write-args.js +63 -0
  7. package/dist/assistant/batch-write-tool.d.ts +7 -0
  8. package/dist/assistant/batch-write-tool.js +115 -0
  9. package/dist/assistant/record-tool-args.js +14 -1
  10. package/dist/assistant/record-tools.js +16 -8
  11. package/dist/assistant/records.d.ts +11 -1
  12. package/dist/assistant/records.js +8 -5
  13. package/dist/batch/reorder.js +1 -1
  14. package/dist/batch/run-batch.d.ts +26 -0
  15. package/dist/batch/run-batch.js +2 -2
  16. package/dist/batch/schema.d.ts +221 -0
  17. package/dist/comments/mentionable.js +1 -1
  18. package/dist/comments/read-comments.js +1 -1
  19. package/dist/create-admin.js +1 -1
  20. package/dist/error-handler.js +1 -1
  21. package/dist/files/download.js +4 -4
  22. package/dist/files/present.js +1 -1
  23. package/dist/functions/records.d.ts +1 -1
  24. package/dist/functions/records.js +5 -2
  25. package/dist/history/read-history.js +3 -3
  26. package/dist/index.d.ts +5 -2
  27. package/dist/index.js +3 -2
  28. package/dist/jobs/run-job.d.ts +1 -1
  29. package/dist/list-photos.js +2 -2
  30. package/dist/list-service.js +3 -3
  31. package/dist/map-service.js +1 -1
  32. package/dist/mcp/mcp-tools.d.ts +3 -6
  33. package/dist/mcp/mcp-tools.js +3 -1
  34. package/dist/package.js +1 -1
  35. package/dist/read-service.js +7 -4
  36. package/dist/realtime/change-checker.js +1 -1
  37. package/dist/records.d.ts +5 -0
  38. package/dist/rest/rest-context.js +1 -1
  39. package/dist/reveal-service.js +1 -1
  40. package/dist/routes/batch.js +1 -1
  41. package/dist/routes/collection.js +1 -1
  42. package/dist/routes/record.js +4 -5
  43. package/dist/row-permissions.js +1 -1
  44. package/dist/sql-parts.d.ts +4 -0
  45. package/dist/sql-parts.js +1 -1
  46. package/dist/write-pipeline.js +5 -5
  47. package/dist/write-shared.d.ts +13 -0
  48. package/dist/write-shared.js +2 -2
  49. package/dist/write-update.js +1 -1
  50. package/package.json +4 -4
@@ -0,0 +1,4 @@
1
+ import "./types.js";
2
+ import "./registry.js";
3
+ import { FieldModel, ResourceModel } from "@protobase/schema";
4
+ import "kysely";
package/dist/sql-parts.js CHANGED
@@ -1,5 +1,5 @@
1
- import { compileFilter } from "@protobase/query";
2
1
  import { sql } from "kysely";
2
+ import { compileFilter } from "@protobase/query";
3
3
  //#region src/sql-parts.ts
4
4
  const etagAlias = "__pb_etag";
5
5
  const tableId = (model) => {
@@ -1,16 +1,16 @@
1
1
  import { HttpProblem, badRequest } from "./problem.js";
2
2
  import { tenantScope } from "./tenant.js";
3
3
  import { requestAccess, requireOperation, targetFilter, writableFields } from "./request-access.js";
4
+ import { actorSettings, wakeDispatch } from "./changes/actor.js";
5
+ import { isDatabaseError } from "./error-handler.js";
6
+ import { writeTransaction } from "./transactions.js";
4
7
  import { bindingOf, pendingBinding } from "./encryption/binding.js";
5
8
  import { deleteRecord, fetchRecord, insertRecord, restoreRecord, updateRecord } from "./records.js";
6
- import { writeTransaction } from "./transactions.js";
7
- import { blockedDelete } from "./blocked-delete.js";
8
- import { isDatabaseError } from "./error-handler.js";
9
9
  import { attachFiles } from "./files/attach.js";
10
+ import { assertWritten, checkParents, checkPrecondition, decide, denied, firstKeyField, keyOf, missing, notifier, shown } from "./write-shared.js";
11
+ import { blockedDelete } from "./blocked-delete.js";
10
12
  import { encryptedValuesOf, hasEncryptedValues, sealValues } from "./encryption/seal-values.js";
11
- import { actorSettings, wakeDispatch } from "./changes/actor.js";
12
13
  import { validateBody } from "./validate-body.js";
13
- import { assertWritten, checkParents, checkPrecondition, decide, denied, firstKeyField, keyOf, missing, notifier, shown } from "./write-shared.js";
14
14
  import { applyUpdate, planUpdate } from "./write-update.js";
15
15
  import { checkRankAfter } from "./rank-after.js";
16
16
  //#region src/write-pipeline.ts
@@ -0,0 +1,13 @@
1
+ import { Row } from "./types.js";
2
+ import "./registry.js";
3
+ import "./deps.js";
4
+ import "./records.js";
5
+ import "./request-access.js";
6
+ import "@protobase/schema";
7
+ import { Db } from "@protobase/query";
8
+ //#region src/write-shared.d.ts
9
+ export type WriteResult = {
10
+ record: Row;
11
+ etag: string;
12
+ };
13
+ //#endregion
@@ -3,11 +3,11 @@ import { forbidden, notFound, preconditionFailed, preconditionRequired } from ".
3
3
  import { tenantScope } from "./tenant.js";
4
4
  import { andFilters, recordDecision } from "./request-access.js";
5
5
  import { ifMatchSatisfied } from "./etag.js";
6
- import { presentFiles } from "./files/present.js";
7
6
  import { pickFields } from "./rows.js";
8
7
  import { fetchRecord } from "./records.js";
9
- import { parentGuard } from "./parent-access.js";
10
8
  import { scheduleRemovedFiles } from "./files/attach.js";
9
+ import { parentGuard } from "./parent-access.js";
10
+ import { presentFiles } from "./files/present.js";
11
11
  //#region src/write-shared.ts
12
12
  const missing = (entry) => notFound(`No ${entry.name} with this key`);
13
13
  const checkPrecondition = (current, ifMatch, required) => {
@@ -4,9 +4,9 @@ import { targetFilter } from "./request-access.js";
4
4
  import { bindingOf } from "./encryption/binding.js";
5
5
  import { fetchRecord, updateRecord } from "./records.js";
6
6
  import { attachFiles } from "./files/attach.js";
7
+ import { assertWritten, checkParents, checkPrecondition, decide, denied, firstKeyField, missing, notifier } from "./write-shared.js";
7
8
  import { sealValues } from "./encryption/seal-values.js";
8
9
  import { validateBody } from "./validate-body.js";
9
- import { assertWritten, checkParents, checkPrecondition, decide, denied, firstKeyField, missing, notifier } from "./write-shared.js";
10
10
  //#region src/write-update.ts
11
11
  /**
12
12
  * Everything an update needs before it writes: the row (locked, inside the caller's tenant and row filters), the ETag
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/server",
3
- "version": "0.42.0",
3
+ "version": "0.43.0",
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.42.0",
40
- "@protobase/query": "0.42.0",
41
- "@protobase/schema": "0.42.0",
39
+ "@protobase/layout": "0.43.0",
40
+ "@protobase/query": "0.43.0",
41
+ "@protobase/schema": "0.43.0",
42
42
  "@react-email/render": "^2.1.0",
43
43
  "@scalar/hono-api-reference": "^0.12.10",
44
44
  "@sentry/core": "^11.7.0",