@syncular/server 0.0.6-96 → 0.1.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.
- package/README.md +1 -2
- package/dist/auth-leases.d.ts +85 -0
- package/dist/auth-leases.d.ts.map +1 -0
- package/dist/auth-leases.js +368 -0
- package/dist/auth-leases.js.map +1 -0
- package/dist/better-sqlite3.d.ts +22 -0
- package/dist/better-sqlite3.d.ts.map +1 -0
- package/dist/better-sqlite3.js +16 -0
- package/dist/better-sqlite3.js.map +1 -0
- package/dist/blobs/access.d.ts +35 -0
- package/dist/blobs/access.d.ts.map +1 -0
- package/dist/blobs/access.js +149 -0
- package/dist/blobs/access.js.map +1 -0
- package/dist/blobs/adapters/database.d.ts +26 -9
- package/dist/blobs/adapters/database.d.ts.map +1 -1
- package/dist/blobs/adapters/database.js +68 -23
- package/dist/blobs/adapters/database.js.map +1 -1
- package/dist/blobs/index.d.ts +1 -0
- package/dist/blobs/index.d.ts.map +1 -1
- package/dist/blobs/index.js +1 -0
- package/dist/blobs/index.js.map +1 -1
- package/dist/blobs/manager.d.ts +69 -44
- package/dist/blobs/manager.d.ts.map +1 -1
- package/dist/blobs/manager.js +250 -65
- package/dist/blobs/manager.js.map +1 -1
- package/dist/blobs/migrate.d.ts.map +1 -1
- package/dist/blobs/migrate.js +16 -8
- package/dist/blobs/migrate.js.map +1 -1
- package/dist/blobs/types.d.ts +4 -0
- package/dist/blobs/types.d.ts.map +1 -1
- package/dist/bun-sqlite.d.ts +19 -0
- package/dist/bun-sqlite.d.ts.map +1 -0
- package/dist/bun-sqlite.js +19 -0
- package/dist/bun-sqlite.js.map +1 -0
- package/dist/clients.d.ts +1 -0
- package/dist/clients.d.ts.map +1 -1
- package/dist/clients.js.map +1 -1
- package/dist/cloudflare/durable-object.d.ts +93 -0
- package/dist/cloudflare/durable-object.d.ts.map +1 -0
- package/dist/cloudflare/durable-object.js +210 -0
- package/dist/cloudflare/durable-object.js.map +1 -0
- package/dist/cloudflare/index.d.ts +22 -0
- package/dist/cloudflare/index.d.ts.map +1 -0
- package/dist/cloudflare/index.js +22 -0
- package/dist/cloudflare/index.js.map +1 -0
- package/dist/cloudflare/r2.d.ts +180 -0
- package/dist/cloudflare/r2.d.ts.map +1 -0
- package/dist/cloudflare/r2.js +258 -0
- package/dist/cloudflare/r2.js.map +1 -0
- package/dist/cloudflare/scope-cache.d.ts +54 -0
- package/dist/cloudflare/scope-cache.d.ts.map +1 -0
- package/dist/cloudflare/scope-cache.js +223 -0
- package/dist/cloudflare/scope-cache.js.map +1 -0
- package/dist/cloudflare/sentry.d.ts +47 -0
- package/dist/cloudflare/sentry.d.ts.map +1 -0
- package/dist/cloudflare/sentry.js +163 -0
- package/dist/cloudflare/sentry.js.map +1 -0
- package/dist/cloudflare/worker.d.ts +46 -0
- package/dist/cloudflare/worker.d.ts.map +1 -0
- package/dist/cloudflare/worker.js +63 -0
- package/dist/cloudflare/worker.js.map +1 -0
- package/dist/commit-integrity.d.ts +38 -0
- package/dist/commit-integrity.d.ts.map +1 -0
- package/dist/commit-integrity.js +260 -0
- package/dist/commit-integrity.js.map +1 -0
- package/dist/compaction.js.map +1 -1
- package/dist/crdt-yjs/index.d.ts +99 -0
- package/dist/crdt-yjs/index.d.ts.map +1 -0
- package/dist/crdt-yjs/index.js +629 -0
- package/dist/crdt-yjs/index.js.map +1 -0
- package/dist/d1.d.ts +13 -0
- package/dist/d1.d.ts.map +1 -0
- package/dist/d1.js +14 -0
- package/dist/d1.js.map +1 -0
- package/dist/dialect/base.d.ts +11 -1
- package/dist/dialect/base.d.ts.map +1 -1
- package/dist/dialect/base.js +42 -5
- package/dist/dialect/base.js.map +1 -1
- package/dist/dialect/helpers.d.ts +6 -0
- package/dist/dialect/helpers.d.ts.map +1 -1
- package/dist/dialect/helpers.js +24 -0
- package/dist/dialect/helpers.js.map +1 -1
- package/dist/dialect/types.d.ts +40 -0
- package/dist/dialect/types.d.ts.map +1 -1
- package/dist/encrypted-crdt.d.ts +67 -0
- package/dist/encrypted-crdt.d.ts.map +1 -0
- package/dist/encrypted-crdt.js +426 -0
- package/dist/encrypted-crdt.js.map +1 -0
- package/dist/errors.d.ts +10 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +13 -0
- package/dist/errors.js.map +1 -0
- package/dist/filesystem/index.d.ts +44 -0
- package/dist/filesystem/index.d.ts.map +1 -0
- package/dist/filesystem/index.js +164 -0
- package/dist/filesystem/index.js.map +1 -0
- package/dist/handlers/collection.d.ts +11 -3
- package/dist/handlers/collection.d.ts.map +1 -1
- package/dist/handlers/collection.js +34 -56
- package/dist/handlers/collection.js.map +1 -1
- package/dist/handlers/create-handler.d.ts +31 -7
- package/dist/handlers/create-handler.d.ts.map +1 -1
- package/dist/handlers/create-handler.js +332 -115
- package/dist/handlers/create-handler.js.map +1 -1
- package/dist/handlers/types.d.ts +86 -1
- package/dist/handlers/types.d.ts.map +1 -1
- package/dist/helpers/conflict.js.map +1 -1
- package/dist/helpers/emitted-change.js.map +1 -1
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +2 -0
- package/dist/helpers/index.js.map +1 -1
- package/dist/helpers/paginate.js.map +1 -1
- package/dist/helpers/scope-authorization.d.ts +7 -0
- package/dist/helpers/scope-authorization.d.ts.map +1 -0
- package/dist/helpers/scope-authorization.js +19 -0
- package/dist/helpers/scope-authorization.js.map +1 -0
- package/dist/helpers/scope-commit-index.d.ts +12 -0
- package/dist/helpers/scope-commit-index.d.ts.map +1 -0
- package/dist/helpers/scope-commit-index.js +35 -0
- package/dist/helpers/scope-commit-index.js.map +1 -0
- package/dist/helpers/scope-strings.js.map +1 -1
- package/dist/hono/api-key-auth.d.ts +49 -0
- package/dist/hono/api-key-auth.d.ts.map +1 -0
- package/dist/hono/api-key-auth.js +108 -0
- package/dist/hono/api-key-auth.js.map +1 -0
- package/dist/hono/audit-redaction.d.ts +20 -0
- package/dist/hono/audit-redaction.d.ts.map +1 -0
- package/dist/hono/audit-redaction.js +85 -0
- package/dist/hono/audit-redaction.js.map +1 -0
- package/dist/hono/blobs.d.ts +75 -0
- package/dist/hono/blobs.d.ts.map +1 -0
- package/dist/hono/blobs.js +586 -0
- package/dist/hono/blobs.js.map +1 -0
- package/dist/hono/console/gateway.d.ts +42 -0
- package/dist/hono/console/gateway.d.ts.map +1 -0
- package/dist/hono/console/gateway.js +2158 -0
- package/dist/hono/console/gateway.js.map +1 -0
- package/dist/hono/console/live-auth.d.ts +7 -0
- package/dist/hono/console/live-auth.d.ts.map +1 -0
- package/dist/hono/console/live-auth.js +39 -0
- package/dist/hono/console/live-auth.js.map +1 -0
- package/dist/hono/console/route-descriptor.d.ts +6 -0
- package/dist/hono/console/route-descriptor.d.ts.map +1 -0
- package/dist/hono/console/route-descriptor.js +16 -0
- package/dist/hono/console/route-descriptor.js.map +1 -0
- package/dist/hono/console/routes/api-keys.d.ts +8 -0
- package/dist/hono/console/routes/api-keys.d.ts.map +1 -0
- package/dist/hono/console/routes/api-keys.js +575 -0
- package/dist/hono/console/routes/api-keys.js.map +1 -0
- package/dist/hono/console/routes/clients.d.ts +8 -0
- package/dist/hono/console/routes/clients.d.ts.map +1 -0
- package/dist/hono/console/routes/clients.js +322 -0
- package/dist/hono/console/routes/clients.js.map +1 -0
- package/dist/hono/console/routes/commits.d.ts +8 -0
- package/dist/hono/console/routes/commits.d.ts.map +1 -0
- package/dist/hono/console/routes/commits.js +882 -0
- package/dist/hono/console/routes/commits.js.map +1 -0
- package/dist/hono/console/routes/context.d.ts +188 -0
- package/dist/hono/console/routes/context.d.ts.map +1 -0
- package/dist/hono/console/routes/context.js +633 -0
- package/dist/hono/console/routes/context.js.map +1 -0
- package/dist/hono/console/routes/events.d.ts +8 -0
- package/dist/hono/console/routes/events.d.ts.map +1 -0
- package/dist/hono/console/routes/events.js +501 -0
- package/dist/hono/console/routes/events.js.map +1 -0
- package/dist/hono/console/routes/maintenance.d.ts +8 -0
- package/dist/hono/console/routes/maintenance.d.ts.map +1 -0
- package/dist/hono/console/routes/maintenance.js +341 -0
- package/dist/hono/console/routes/maintenance.js.map +1 -0
- package/dist/hono/console/routes/shared.d.ts +174 -0
- package/dist/hono/console/routes/shared.d.ts.map +1 -0
- package/dist/hono/console/routes/shared.js +583 -0
- package/dist/hono/console/routes/shared.js.map +1 -0
- package/dist/hono/console/routes/stats.d.ts +8 -0
- package/dist/hono/console/routes/stats.d.ts.map +1 -0
- package/dist/hono/console/routes/stats.js +295 -0
- package/dist/hono/console/routes/stats.js.map +1 -0
- package/dist/hono/console/routes/storage.d.ts +8 -0
- package/dist/hono/console/routes/storage.d.ts.map +1 -0
- package/dist/hono/console/routes/storage.js +121 -0
- package/dist/hono/console/routes/storage.js.map +1 -0
- package/dist/hono/console/routes.d.ts +36 -0
- package/dist/hono/console/routes.d.ts.map +1 -0
- package/dist/hono/console/routes.js +112 -0
- package/dist/hono/console/routes.js.map +1 -0
- package/dist/hono/console/schema-errors.d.ts +2 -0
- package/dist/hono/console/schema-errors.d.ts.map +1 -0
- package/dist/hono/console/schema-errors.js +17 -0
- package/dist/hono/console/schema-errors.js.map +1 -0
- package/dist/hono/console/schemas.d.ts +1515 -0
- package/dist/hono/console/schemas.d.ts.map +1 -0
- package/dist/hono/console/schemas.js +661 -0
- package/dist/hono/console/schemas.js.map +1 -0
- package/dist/hono/console/types.d.ts +213 -0
- package/dist/hono/console/types.d.ts.map +1 -0
- package/dist/hono/console/types.js +2 -0
- package/dist/hono/console/types.js.map +1 -0
- package/dist/hono/console/ui.d.ts +38 -0
- package/dist/hono/console/ui.d.ts.map +1 -0
- package/dist/hono/console/ui.js +43 -0
- package/dist/hono/console/ui.js.map +1 -0
- package/dist/hono/create-server.d.ts +71 -0
- package/dist/hono/create-server.d.ts.map +1 -0
- package/dist/hono/create-server.js +121 -0
- package/dist/hono/create-server.js.map +1 -0
- package/dist/hono/errors.d.ts +13 -0
- package/dist/hono/errors.d.ts.map +1 -0
- package/dist/hono/errors.js +21 -0
- package/dist/hono/errors.js.map +1 -0
- package/dist/hono/index.d.ts +20 -0
- package/dist/hono/index.d.ts.map +1 -0
- package/dist/hono/index.js +31 -0
- package/dist/hono/index.js.map +1 -0
- package/dist/hono/openapi.d.ts +72 -0
- package/dist/hono/openapi.d.ts.map +1 -0
- package/dist/hono/openapi.js +99 -0
- package/dist/hono/openapi.js.map +1 -0
- package/dist/hono/proxy/connection-manager.d.ts +78 -0
- package/dist/hono/proxy/connection-manager.d.ts.map +1 -0
- package/dist/hono/proxy/connection-manager.js +251 -0
- package/dist/hono/proxy/connection-manager.js.map +1 -0
- package/dist/hono/proxy/index.d.ts +8 -0
- package/dist/hono/proxy/index.d.ts.map +1 -0
- package/dist/hono/proxy/index.js +8 -0
- package/dist/hono/proxy/index.js.map +1 -0
- package/dist/hono/proxy/routes.d.ts +86 -0
- package/dist/hono/proxy/routes.d.ts.map +1 -0
- package/dist/hono/proxy/routes.js +183 -0
- package/dist/hono/proxy/routes.js.map +1 -0
- package/dist/hono/rate-limit.d.ts +101 -0
- package/dist/hono/rate-limit.d.ts.map +1 -0
- package/dist/hono/rate-limit.js +184 -0
- package/dist/hono/rate-limit.js.map +1 -0
- package/dist/hono/realtime-sync-packs.d.ts +43 -0
- package/dist/hono/realtime-sync-packs.d.ts.map +1 -0
- package/dist/hono/realtime-sync-packs.js +219 -0
- package/dist/hono/realtime-sync-packs.js.map +1 -0
- package/dist/hono/routes/audit.d.ts +12 -0
- package/dist/hono/routes/audit.d.ts.map +1 -0
- package/dist/hono/routes/audit.js +385 -0
- package/dist/hono/routes/audit.js.map +1 -0
- package/dist/hono/routes/auth-leases.d.ts +8 -0
- package/dist/hono/routes/auth-leases.d.ts.map +1 -0
- package/dist/hono/routes/auth-leases.js +88 -0
- package/dist/hono/routes/auth-leases.js.map +1 -0
- package/dist/hono/routes/combined.d.ts +8 -0
- package/dist/hono/routes/combined.d.ts.map +1 -0
- package/dist/hono/routes/combined.js +392 -0
- package/dist/hono/routes/combined.js.map +1 -0
- package/dist/hono/routes/context.d.ts +314 -0
- package/dist/hono/routes/context.d.ts.map +1 -0
- package/dist/hono/routes/context.js +1147 -0
- package/dist/hono/routes/context.js.map +1 -0
- package/dist/hono/routes/health.d.ts +8 -0
- package/dist/hono/routes/health.d.ts.map +1 -0
- package/dist/hono/routes/health.js +16 -0
- package/dist/hono/routes/health.js.map +1 -0
- package/dist/hono/routes/realtime.d.ts +9 -0
- package/dist/hono/routes/realtime.d.ts.map +1 -0
- package/dist/hono/routes/realtime.js +626 -0
- package/dist/hono/routes/realtime.js.map +1 -0
- package/dist/hono/routes/shared.d.ts +689 -0
- package/dist/hono/routes/shared.d.ts.map +1 -0
- package/dist/hono/routes/shared.js +972 -0
- package/dist/hono/routes/shared.js.map +1 -0
- package/dist/hono/routes/snapshots.d.ts +10 -0
- package/dist/hono/routes/snapshots.d.ts.map +1 -0
- package/dist/hono/routes/snapshots.js +281 -0
- package/dist/hono/routes/snapshots.js.map +1 -0
- package/dist/hono/routes.d.ts +19 -0
- package/dist/hono/routes.d.ts.map +1 -0
- package/dist/hono/routes.js +37 -0
- package/dist/hono/routes.js.map +1 -0
- package/dist/hono/validation.d.ts +5 -0
- package/dist/hono/validation.d.ts.map +1 -0
- package/dist/hono/validation.js +47 -0
- package/dist/hono/validation.js.map +1 -0
- package/dist/hono/websocket-origin.d.ts +9 -0
- package/dist/hono/websocket-origin.d.ts.map +1 -0
- package/dist/hono/websocket-origin.js +96 -0
- package/dist/hono/websocket-origin.js.map +1 -0
- package/dist/hono/ws.d.ts +341 -0
- package/dist/hono/ws.d.ts.map +1 -0
- package/dist/hono/ws.js +711 -0
- package/dist/hono/ws.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/libsql.d.ts +29 -0
- package/dist/libsql.d.ts.map +1 -0
- package/dist/libsql.js +25 -0
- package/dist/libsql.js.map +1 -0
- package/dist/migrate.js.map +1 -1
- package/dist/neon.d.ts +21 -0
- package/dist/neon.d.ts.map +1 -0
- package/dist/neon.js +22 -0
- package/dist/neon.js.map +1 -0
- package/dist/notify.d.ts +30 -0
- package/dist/notify.d.ts.map +1 -1
- package/dist/notify.js +160 -41
- package/dist/notify.js.map +1 -1
- package/dist/pglite.d.ts +37 -0
- package/dist/pglite.d.ts.map +1 -0
- package/dist/pglite.js +37 -0
- package/dist/pglite.js.map +1 -0
- package/dist/plugins/index.d.ts +2 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +2 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/types.d.ts +73 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +30 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/postgres/index.d.ts +68 -0
- package/dist/postgres/index.d.ts.map +1 -0
- package/dist/postgres/index.js +924 -0
- package/dist/postgres/index.js.map +1 -0
- package/dist/proxy/collection.d.ts +0 -2
- package/dist/proxy/collection.d.ts.map +1 -1
- package/dist/proxy/collection.js +2 -17
- package/dist/proxy/collection.js.map +1 -1
- package/dist/proxy/handler.d.ts +1 -1
- package/dist/proxy/handler.d.ts.map +1 -1
- package/dist/proxy/handler.js +1 -2
- package/dist/proxy/handler.js.map +1 -1
- package/dist/proxy/index.d.ts +1 -1
- package/dist/proxy/index.d.ts.map +1 -1
- package/dist/proxy/index.js +1 -1
- package/dist/proxy/index.js.map +1 -1
- package/dist/proxy/mutation-detector.js.map +1 -1
- package/dist/proxy/oplog.d.ts.map +1 -1
- package/dist/proxy/oplog.js +32 -8
- package/dist/proxy/oplog.js.map +1 -1
- package/dist/prune.d.ts +8 -1
- package/dist/prune.d.ts.map +1 -1
- package/dist/prune.js +68 -28
- package/dist/prune.js.map +1 -1
- package/dist/pull.d.ts +31 -0
- package/dist/pull.d.ts.map +1 -1
- package/dist/pull.js +1011 -471
- package/dist/pull.js.map +1 -1
- package/dist/push.d.ts +36 -2
- package/dist/push.d.ts.map +1 -1
- package/dist/push.js +603 -358
- package/dist/push.js.map +1 -1
- package/dist/realtime/in-memory.js.map +1 -1
- package/dist/realtime/index.d.ts +2 -1
- package/dist/realtime/index.d.ts.map +1 -1
- package/dist/realtime/index.js +1 -0
- package/dist/realtime/index.js.map +1 -1
- package/dist/realtime/types.d.ts +12 -0
- package/dist/realtime/types.d.ts.map +1 -1
- package/dist/realtime/types.js +13 -1
- package/dist/realtime/types.js.map +1 -1
- package/dist/relay/client-role/forward-engine.d.ts +63 -0
- package/dist/relay/client-role/forward-engine.d.ts.map +1 -0
- package/dist/relay/client-role/forward-engine.js +267 -0
- package/dist/relay/client-role/forward-engine.js.map +1 -0
- package/dist/relay/client-role/index.d.ts +9 -0
- package/dist/relay/client-role/index.d.ts.map +1 -0
- package/dist/relay/client-role/index.js +9 -0
- package/dist/relay/client-role/index.js.map +1 -0
- package/dist/relay/client-role/pull-engine.d.ts +72 -0
- package/dist/relay/client-role/pull-engine.d.ts.map +1 -0
- package/dist/relay/client-role/pull-engine.js +249 -0
- package/dist/relay/client-role/pull-engine.js.map +1 -0
- package/dist/relay/client-role/sequence-mapper.d.ts +65 -0
- package/dist/relay/client-role/sequence-mapper.d.ts.map +1 -0
- package/dist/relay/client-role/sequence-mapper.js +161 -0
- package/dist/relay/client-role/sequence-mapper.js.map +1 -0
- package/dist/relay/evaluation/relay-paths.d.ts +41 -0
- package/dist/relay/evaluation/relay-paths.d.ts.map +1 -0
- package/dist/relay/evaluation/relay-paths.js +504 -0
- package/dist/relay/evaluation/relay-paths.js.map +1 -0
- package/dist/relay/evaluation/rust-boundary.d.ts +47 -0
- package/dist/relay/evaluation/rust-boundary.d.ts.map +1 -0
- package/dist/relay/evaluation/rust-boundary.js +220 -0
- package/dist/relay/evaluation/rust-boundary.js.map +1 -0
- package/dist/relay/index.d.ts +37 -0
- package/dist/relay/index.d.ts.map +1 -0
- package/dist/relay/index.js +44 -0
- package/dist/relay/index.js.map +1 -0
- package/dist/relay/migrate.d.ts +18 -0
- package/dist/relay/migrate.d.ts.map +1 -0
- package/dist/relay/migrate.js +99 -0
- package/dist/relay/migrate.js.map +1 -0
- package/dist/relay/mode-manager.d.ts +60 -0
- package/dist/relay/mode-manager.d.ts.map +1 -0
- package/dist/relay/mode-manager.js +114 -0
- package/dist/relay/mode-manager.js.map +1 -0
- package/dist/relay/realtime.d.ts +90 -0
- package/dist/relay/realtime.d.ts.map +1 -0
- package/dist/relay/realtime.js +147 -0
- package/dist/relay/realtime.js.map +1 -0
- package/dist/relay/relay.d.ts +190 -0
- package/dist/relay/relay.d.ts.map +1 -0
- package/dist/relay/relay.js +320 -0
- package/dist/relay/relay.js.map +1 -0
- package/dist/relay/schema.d.ts +158 -0
- package/dist/relay/schema.d.ts.map +1 -0
- package/dist/relay/schema.js +7 -0
- package/dist/relay/schema.js.map +1 -0
- package/dist/relay/server-role/index.d.ts +56 -0
- package/dist/relay/server-role/index.d.ts.map +1 -0
- package/dist/relay/server-role/index.js +193 -0
- package/dist/relay/server-role/index.js.map +1 -0
- package/dist/relay/server-role/pull.d.ts +27 -0
- package/dist/relay/server-role/pull.d.ts.map +1 -0
- package/dist/relay/server-role/pull.js +24 -0
- package/dist/relay/server-role/pull.js.map +1 -0
- package/dist/relay/server-role/push.d.ts +29 -0
- package/dist/relay/server-role/push.d.ts.map +1 -0
- package/dist/relay/server-role/push.js +122 -0
- package/dist/relay/server-role/push.js.map +1 -0
- package/dist/s3/index.d.ts +83 -0
- package/dist/s3/index.d.ts.map +1 -0
- package/dist/s3/index.js +223 -0
- package/dist/s3/index.js.map +1 -0
- package/dist/schema.d.ts +137 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +1 -0
- package/dist/schema.js.map +1 -1
- package/dist/service-worker/index.d.ts +114 -0
- package/dist/service-worker/index.d.ts.map +1 -0
- package/dist/service-worker/index.js +487 -0
- package/dist/service-worker/index.js.map +1 -0
- package/dist/snapshot-artifacts/sqlite-bun.d.ts +15 -0
- package/dist/snapshot-artifacts/sqlite-bun.d.ts.map +1 -0
- package/dist/snapshot-artifacts/sqlite-bun.js +128 -0
- package/dist/snapshot-artifacts/sqlite-bun.js.map +1 -0
- package/dist/snapshot-artifacts.d.ts +206 -0
- package/dist/snapshot-artifacts.d.ts.map +1 -0
- package/dist/snapshot-artifacts.js +545 -0
- package/dist/snapshot-artifacts.js.map +1 -0
- package/dist/snapshot-chunks/db-metadata.d.ts +18 -0
- package/dist/snapshot-chunks/db-metadata.d.ts.map +1 -1
- package/dist/snapshot-chunks/db-metadata.js +91 -63
- package/dist/snapshot-chunks/db-metadata.js.map +1 -1
- package/dist/snapshot-chunks/types.d.ts +2 -0
- package/dist/snapshot-chunks/types.d.ts.map +1 -1
- package/dist/snapshot-chunks.d.ts +33 -3
- package/dist/snapshot-chunks.d.ts.map +1 -1
- package/dist/snapshot-chunks.js +136 -55
- package/dist/snapshot-chunks.js.map +1 -1
- package/dist/sqlite/index.d.ts +53 -0
- package/dist/sqlite/index.d.ts.map +1 -0
- package/dist/sqlite/index.js +795 -0
- package/dist/sqlite/index.js.map +1 -0
- package/dist/sqlite3.d.ts +22 -0
- package/dist/sqlite3.d.ts.map +1 -0
- package/dist/sqlite3.js +99 -0
- package/dist/sqlite3.js.map +1 -0
- package/dist/stats.d.ts +8 -0
- package/dist/stats.d.ts.map +1 -1
- package/dist/stats.js +45 -13
- package/dist/stats.js.map +1 -1
- package/dist/subscriptions/cache.d.ts +3 -0
- package/dist/subscriptions/cache.d.ts.map +1 -1
- package/dist/subscriptions/cache.js +44 -0
- package/dist/subscriptions/cache.js.map +1 -1
- package/dist/subscriptions/resolve.d.ts +3 -1
- package/dist/subscriptions/resolve.d.ts.map +1 -1
- package/dist/subscriptions/resolve.js +90 -51
- package/dist/subscriptions/resolve.js.map +1 -1
- package/dist/sync.d.ts +3 -0
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +8 -4
- package/dist/sync.js.map +1 -1
- package/package.json +296 -7
- package/src/auth-leases.ts +649 -0
- package/src/better-sqlite3.ts +35 -0
- package/src/blobs/access.ts +244 -0
- package/src/blobs/adapters/database.ts +125 -43
- package/src/blobs/index.ts +1 -0
- package/src/blobs/manager.ts +366 -65
- package/src/blobs/migrate.ts +16 -8
- package/src/blobs/types.ts +4 -0
- package/src/bun-sqlite-ambient.d.ts +19 -0
- package/src/bun-sqlite.ts +27 -0
- package/src/clients.ts +1 -0
- package/src/cloudflare/durable-object.ts +289 -0
- package/src/cloudflare/index.ts +22 -0
- package/src/cloudflare/r2.ts +526 -0
- package/src/cloudflare/scope-cache.ts +341 -0
- package/src/cloudflare/sentry.ts +230 -0
- package/src/cloudflare/worker.ts +77 -0
- package/src/commit-integrity.ts +371 -0
- package/src/crdt-yjs/index.ts +931 -0
- package/src/d1.ts +16 -0
- package/src/dialect/base.ts +71 -5
- package/src/dialect/helpers.ts +31 -0
- package/src/dialect/types.ts +47 -0
- package/src/encrypted-crdt.ts +786 -0
- package/src/errors.ts +22 -0
- package/src/filesystem/index.ts +262 -0
- package/src/handlers/collection.ts +78 -78
- package/src/handlers/create-handler.ts +540 -147
- package/src/handlers/types.ts +116 -0
- package/src/helpers/index.ts +2 -0
- package/src/helpers/scope-authorization.ts +27 -0
- package/src/helpers/scope-commit-index.ts +52 -0
- package/src/hono/api-key-auth.ts +177 -0
- package/src/hono/audit-redaction.ts +135 -0
- package/src/hono/blobs.ts +851 -0
- package/src/hono/console/gateway.ts +3046 -0
- package/src/hono/console/live-auth.ts +46 -0
- package/src/hono/console/route-descriptor.ts +22 -0
- package/src/hono/console/routes/api-keys.ts +721 -0
- package/src/hono/console/routes/clients.ts +447 -0
- package/src/hono/console/routes/commits.ts +1137 -0
- package/src/hono/console/routes/context.ts +956 -0
- package/src/hono/console/routes/events.ts +669 -0
- package/src/hono/console/routes/maintenance.ts +461 -0
- package/src/hono/console/routes/shared.ts +816 -0
- package/src/hono/console/routes/stats.ts +392 -0
- package/src/hono/console/routes/storage.ts +159 -0
- package/src/hono/console/routes.ts +146 -0
- package/src/hono/console/schema-errors.ts +23 -0
- package/src/hono/console/schemas.ts +914 -0
- package/src/hono/console/types.ts +223 -0
- package/src/hono/console/ui.ts +100 -0
- package/src/hono/create-server.ts +230 -0
- package/src/hono/errors.ts +50 -0
- package/src/hono/index.ts +54 -0
- package/src/hono/openapi.ts +139 -0
- package/src/hono/proxy/connection-manager.ts +340 -0
- package/src/hono/proxy/index.ts +8 -0
- package/src/hono/proxy/routes.ts +272 -0
- package/src/hono/rate-limit.ts +319 -0
- package/src/hono/realtime-sync-packs.ts +354 -0
- package/src/hono/routes/audit.ts +499 -0
- package/src/hono/routes/auth-leases.ts +119 -0
- package/src/hono/routes/combined.ts +583 -0
- package/src/hono/routes/context.ts +1629 -0
- package/src/hono/routes/health.ts +26 -0
- package/src/hono/routes/realtime.ts +808 -0
- package/src/hono/routes/shared.ts +1626 -0
- package/src/hono/routes/snapshots.ts +345 -0
- package/src/hono/routes.ts +68 -0
- package/src/hono/validation.ts +81 -0
- package/src/hono/websocket-origin.ts +131 -0
- package/src/hono/ws.ts +1134 -0
- package/src/index.ts +6 -0
- package/src/libsql.ts +51 -0
- package/src/neon.ts +28 -0
- package/src/notify.ts +224 -44
- package/src/pglite.ts +68 -0
- package/src/plugins/index.ts +1 -0
- package/src/plugins/types.ts +144 -0
- package/src/postgres/index.ts +1291 -0
- package/src/proxy/collection.ts +5 -27
- package/src/proxy/handler.ts +2 -2
- package/src/proxy/index.ts +0 -2
- package/src/proxy/oplog.ts +41 -10
- package/src/prune.ts +137 -36
- package/src/pull.ts +1504 -591
- package/src/push.ts +881 -443
- package/src/realtime/index.ts +2 -0
- package/src/realtime/types.ts +35 -0
- package/src/relay/bun-types.d.ts +50 -0
- package/src/relay/client-role/forward-engine.ts +355 -0
- package/src/relay/client-role/index.ts +9 -0
- package/src/relay/client-role/pull-engine.ts +329 -0
- package/src/relay/client-role/sequence-mapper.ts +201 -0
- package/src/relay/evaluation/relay-paths.ts +699 -0
- package/src/relay/evaluation/rust-boundary.ts +464 -0
- package/src/relay/index.ts +50 -0
- package/src/relay/migrate.ts +113 -0
- package/src/relay/mode-manager.ts +142 -0
- package/src/relay/realtime.ts +207 -0
- package/src/relay/relay.ts +431 -0
- package/src/relay/schema.ts +171 -0
- package/src/relay/server-role/index.ts +338 -0
- package/src/relay/server-role/pull.ts +43 -0
- package/src/relay/server-role/push.ts +164 -0
- package/src/s3/index.ts +346 -0
- package/src/schema.ts +141 -1
- package/src/service-worker/index.ts +773 -0
- package/src/snapshot-artifacts/sqlite-bun.ts +168 -0
- package/src/snapshot-artifacts.ts +896 -0
- package/src/snapshot-chunks/db-metadata.ts +131 -72
- package/src/snapshot-chunks/types.ts +2 -0
- package/src/snapshot-chunks.ts +194 -70
- package/src/sqlite/index.ts +1064 -0
- package/src/sqlite3.ts +137 -0
- package/src/stats.ts +76 -13
- package/src/subscriptions/cache.ts +58 -0
- package/src/subscriptions/resolve.ts +99 -58
- package/src/sync.ts +16 -6
- package/src/blobs/adapters/database.test.ts +0 -67
- package/src/notify.test.ts +0 -520
- package/src/proxy/handler.test.ts +0 -126
- package/src/proxy/mutation-detector.test.ts +0 -71
- package/src/snapshot-chunks/db-metadata.test.ts +0 -172
- package/src/subscriptions/resolve.test.ts +0 -180
|
@@ -0,0 +1,689 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared private helpers, constants, option types, and zod schemas used by the
|
|
3
|
+
* sync route modules. Extracted verbatim from routes.ts.
|
|
4
|
+
*/
|
|
5
|
+
import { type ScopeValues, type StoredScopes, type SyncAuthLeaseCapabilities } from '@syncular/core';
|
|
6
|
+
import type { ScopeCacheBackend, ServerSnapshotBinaryMetadata, ServerSyncDialect, ServerTableHandler, SnapshotArtifactStorage, SnapshotChunkStorage, SqlFamily, SyncCoreDb, SyncRealtimeBroadcaster, SyncServerAuth, SyncServerPushPlugin } from '@syncular/server';
|
|
7
|
+
import { type AuthLeaseSigner, type CompactOptions, type PruneOptions, type PullResult } from '@syncular/server';
|
|
8
|
+
import type { Context, Hono } from 'hono';
|
|
9
|
+
import type { UpgradeWebSocket } from 'hono/ws';
|
|
10
|
+
import { type Kysely } from 'kysely';
|
|
11
|
+
import { z } from 'zod';
|
|
12
|
+
import type { SyncRateLimitConfig } from '../rate-limit';
|
|
13
|
+
import type { WebSocketConnectionManager, WebSocketRealtimeSubscription } from '../ws';
|
|
14
|
+
/**
|
|
15
|
+
* WeakMaps for storing Hono-instance-specific data without augmenting the type.
|
|
16
|
+
*/
|
|
17
|
+
declare const wsConnectionManagerMap: WeakMap<Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">, WebSocketConnectionManager>;
|
|
18
|
+
declare const realtimeUnsubscribeMap: WeakMap<Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">, () => void>;
|
|
19
|
+
export { realtimeUnsubscribeMap, wsConnectionManagerMap };
|
|
20
|
+
export interface SyncAuthResult extends SyncServerAuth {
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* WebSocket configuration for realtime sync.
|
|
24
|
+
*/
|
|
25
|
+
export interface SyncWebSocketConfig {
|
|
26
|
+
enabled?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Runtime-provided WebSocket upgrader (e.g. from `hono/bun`'s `createBunWebSocket()`).
|
|
29
|
+
*/
|
|
30
|
+
upgradeWebSocket?: UpgradeWebSocket;
|
|
31
|
+
heartbeatIntervalMs?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Maximum number of concurrent WebSocket connections across the entire process.
|
|
34
|
+
* Default: 5000
|
|
35
|
+
*/
|
|
36
|
+
maxConnectionsTotal?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Maximum number of concurrent WebSocket connections per clientId.
|
|
39
|
+
* Default: 3
|
|
40
|
+
*/
|
|
41
|
+
maxConnectionsPerClient?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Maximum inbound websocket message size in bytes.
|
|
44
|
+
* Default: 1 MiB.
|
|
45
|
+
*/
|
|
46
|
+
maxMessageBytes?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Maximum encoded sync-pack size sent directly over a websocket frame.
|
|
49
|
+
* Larger payloads fall back to explicit HTTP pull recovery.
|
|
50
|
+
* Default: 64 KiB.
|
|
51
|
+
*/
|
|
52
|
+
maxSyncPackBytes?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Maximum inbound websocket messages allowed per connection within one window.
|
|
55
|
+
* Default: 120 messages.
|
|
56
|
+
* Set to 0 or a negative value to disable rate limiting.
|
|
57
|
+
*/
|
|
58
|
+
maxMessagesPerWindow?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Maximum outbound sync notifications allowed without a newer client ACK.
|
|
61
|
+
* When exceeded, the server sends cursor-only resync-required frames until
|
|
62
|
+
* the client ACKs a caught-up cursor. Set to 0 to disable.
|
|
63
|
+
* Default: 64.
|
|
64
|
+
*/
|
|
65
|
+
maxInFlightSyncsPerConnection?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Recent outbound scope notifications retained for websocket reconnect
|
|
68
|
+
* replay before falling back to HTTP pull recovery. Set to 0 to disable.
|
|
69
|
+
* Default: 64.
|
|
70
|
+
*/
|
|
71
|
+
replayWindowSize?: number;
|
|
72
|
+
/**
|
|
73
|
+
* Window size in milliseconds for inbound websocket message rate limiting.
|
|
74
|
+
* Default: 10000 ms.
|
|
75
|
+
*/
|
|
76
|
+
messageRateWindowMs?: number;
|
|
77
|
+
/**
|
|
78
|
+
* Optional list of allowed websocket origins.
|
|
79
|
+
* - undefined: allow same-origin browser upgrades and origin-less non-browser clients
|
|
80
|
+
* - '*': allow all origins
|
|
81
|
+
* - string[]: exact origin match (scheme + host + port)
|
|
82
|
+
*/
|
|
83
|
+
allowedOrigins?: string[] | '*';
|
|
84
|
+
}
|
|
85
|
+
export type SyncCorsOriginResolver = (origin: string | undefined, context: Context) => boolean | string | null | undefined | Promise<boolean | string | null | undefined>;
|
|
86
|
+
export type SyncCorsOrigin = string | string[] | '*' | SyncCorsOriginResolver;
|
|
87
|
+
export interface SyncCorsOptions {
|
|
88
|
+
/**
|
|
89
|
+
* Hono-style origin config.
|
|
90
|
+
* - string / string[]: exact or wildcard origin patterns
|
|
91
|
+
* - '*': allow all origins
|
|
92
|
+
* - function: dynamic allow/deny decision
|
|
93
|
+
*/
|
|
94
|
+
origin?: SyncCorsOrigin;
|
|
95
|
+
/**
|
|
96
|
+
* Additional request headers to allow. These are appended to the built-in
|
|
97
|
+
* Syncular transport and tracing headers, not used as a replacement.
|
|
98
|
+
*/
|
|
99
|
+
allowHeaders?: string[];
|
|
100
|
+
/**
|
|
101
|
+
* Additional response headers exposed to the browser.
|
|
102
|
+
*/
|
|
103
|
+
exposeHeaders?: string[];
|
|
104
|
+
}
|
|
105
|
+
export interface SyncRoutesConfigWithRateLimit {
|
|
106
|
+
/**
|
|
107
|
+
* Optional browser CORS handling for sync routes.
|
|
108
|
+
* When configured, sync route responses and preflights include matching
|
|
109
|
+
* CORS headers directly from the generated sync app.
|
|
110
|
+
*/
|
|
111
|
+
cors?: SyncCorsOrigin | SyncCorsOptions;
|
|
112
|
+
/**
|
|
113
|
+
* Max commits per pull request.
|
|
114
|
+
* Default: 100
|
|
115
|
+
*/
|
|
116
|
+
maxPullLimitCommits?: number;
|
|
117
|
+
/**
|
|
118
|
+
* Max subscriptions per pull request.
|
|
119
|
+
* Default: 200
|
|
120
|
+
*/
|
|
121
|
+
maxSubscriptionsPerPull?: number;
|
|
122
|
+
/**
|
|
123
|
+
* Max snapshot rows per snapshot page.
|
|
124
|
+
* Default: 5000
|
|
125
|
+
*/
|
|
126
|
+
maxPullLimitSnapshotRows?: number;
|
|
127
|
+
/**
|
|
128
|
+
* Max snapshot pages per subscription per pull response.
|
|
129
|
+
* Default: 50
|
|
130
|
+
*/
|
|
131
|
+
maxPullMaxSnapshotPages?: number;
|
|
132
|
+
/**
|
|
133
|
+
* Gzip compression level for generated snapshot chunks.
|
|
134
|
+
*
|
|
135
|
+
* Default: 1, range: 0-9. Lower values reduce CPU and browser inflate time
|
|
136
|
+
* but increase response size.
|
|
137
|
+
*/
|
|
138
|
+
snapshotChunkGzipLevel?: number;
|
|
139
|
+
/**
|
|
140
|
+
* Max operations per pushed commit.
|
|
141
|
+
* Default: 200
|
|
142
|
+
*/
|
|
143
|
+
maxOperationsPerPush?: number;
|
|
144
|
+
/**
|
|
145
|
+
* Maximum JSON request body accepted by POST /.
|
|
146
|
+
* Default: 4 MiB.
|
|
147
|
+
*/
|
|
148
|
+
maxSyncRequestJsonBytes?: number;
|
|
149
|
+
/**
|
|
150
|
+
* Maximum binary sync-pack response body emitted by POST /.
|
|
151
|
+
* Default: 16 MiB.
|
|
152
|
+
*/
|
|
153
|
+
maxSyncBinaryPackBytes?: number;
|
|
154
|
+
/**
|
|
155
|
+
* Maximum snapshot chunk body emitted by GET /snapshot-chunks/:chunkId.
|
|
156
|
+
* Default: 64 MiB.
|
|
157
|
+
*/
|
|
158
|
+
maxSnapshotChunkResponseBytes?: number;
|
|
159
|
+
/**
|
|
160
|
+
* Maximum snapshot artifact body emitted by GET /snapshot-artifacts/:artifactId.
|
|
161
|
+
* Default: 256 MiB.
|
|
162
|
+
*/
|
|
163
|
+
maxSnapshotArtifactResponseBytes?: number;
|
|
164
|
+
/**
|
|
165
|
+
* Request/response payload snapshots recorded for console inspection.
|
|
166
|
+
*/
|
|
167
|
+
requestPayloadSnapshots?: {
|
|
168
|
+
/**
|
|
169
|
+
* Enable payload snapshot storage in `sync_request_payloads`.
|
|
170
|
+
* Default: false (opt-in).
|
|
171
|
+
*/
|
|
172
|
+
enabled?: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Max serialized payload size in bytes per request/response snapshot.
|
|
175
|
+
* Larger payloads are truncated with metadata.
|
|
176
|
+
* Default: 128 KiB.
|
|
177
|
+
*/
|
|
178
|
+
maxBytes?: number;
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Minimum Syncular client schema version accepted by this server.
|
|
182
|
+
* Clients with an older runtime must upgrade before continuing sync.
|
|
183
|
+
*/
|
|
184
|
+
requiredSchemaVersion?: number;
|
|
185
|
+
/**
|
|
186
|
+
* Latest Syncular client schema version known by this server.
|
|
187
|
+
* Newer values are informational and should not block older compatible
|
|
188
|
+
* clients.
|
|
189
|
+
*/
|
|
190
|
+
latestSchemaVersion?: number;
|
|
191
|
+
/**
|
|
192
|
+
* Rate limiting configuration.
|
|
193
|
+
* Set to false to disable all rate limiting.
|
|
194
|
+
*/
|
|
195
|
+
rateLimit?: SyncRateLimitConfig | false;
|
|
196
|
+
/**
|
|
197
|
+
* WebSocket realtime configuration.
|
|
198
|
+
*/
|
|
199
|
+
websocket?: SyncWebSocketConfig;
|
|
200
|
+
/**
|
|
201
|
+
* Optional pruning configuration. When enabled, the server periodically prunes
|
|
202
|
+
* old commit history based on active client cursors.
|
|
203
|
+
*/
|
|
204
|
+
prune?: {
|
|
205
|
+
/** Minimum time between prune runs. Default: 5 minutes. */
|
|
206
|
+
minIntervalMs?: number;
|
|
207
|
+
/** Pruning watermark options. */
|
|
208
|
+
options?: PruneOptions;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Optional compaction configuration. When enabled, the server periodically
|
|
212
|
+
* compacts older change history to reduce storage.
|
|
213
|
+
*/
|
|
214
|
+
compact?: {
|
|
215
|
+
/** Minimum time between compaction runs. Default: 30 minutes. */
|
|
216
|
+
minIntervalMs?: number;
|
|
217
|
+
/** Compaction options. */
|
|
218
|
+
options?: CompactOptions;
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* Optional multi-instance realtime broadcaster.
|
|
222
|
+
* When provided, instances publish/subscribe commit wakeups via the broadcaster.
|
|
223
|
+
*/
|
|
224
|
+
realtime?: {
|
|
225
|
+
broadcaster: SyncRealtimeBroadcaster;
|
|
226
|
+
/** Optional stable instance id (useful in tests). */
|
|
227
|
+
instanceId?: string;
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
export interface SyncAuthLeaseRoutesConfig<Auth extends SyncAuthResult = SyncAuthResult> {
|
|
231
|
+
/**
|
|
232
|
+
* Set false to keep route config around without exposing the issue endpoint.
|
|
233
|
+
* Providing this config enables POST /auth-leases/issue by default.
|
|
234
|
+
*/
|
|
235
|
+
enabled?: boolean;
|
|
236
|
+
issuer: string;
|
|
237
|
+
audience: string;
|
|
238
|
+
kid: string;
|
|
239
|
+
signer: AuthLeaseSigner;
|
|
240
|
+
publicKey: CryptoKey;
|
|
241
|
+
ttlMs?: number;
|
|
242
|
+
maxTtlMs?: number;
|
|
243
|
+
maxClockSkewMs?: number;
|
|
244
|
+
capabilities?: SyncAuthLeaseCapabilities;
|
|
245
|
+
nowMs?: () => number;
|
|
246
|
+
leaseId?: () => string;
|
|
247
|
+
subject?: (auth: Auth) => Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
248
|
+
}
|
|
249
|
+
export interface CreateSyncRoutesOptions<DB extends SyncCoreDb = SyncCoreDb, Auth extends SyncAuthResult = SyncAuthResult, F extends SqlFamily = SqlFamily> {
|
|
250
|
+
db: Kysely<DB>;
|
|
251
|
+
dialect: ServerSyncDialect<F>;
|
|
252
|
+
handlers: ServerTableHandler<DB, Auth>[];
|
|
253
|
+
snapshotBinary?: ServerSnapshotBinaryMetadata;
|
|
254
|
+
plugins?: SyncServerPushPlugin<DB, Auth>[];
|
|
255
|
+
authenticate: (c: Context) => Promise<Auth | null>;
|
|
256
|
+
sync?: SyncRoutesConfigWithRateLimit;
|
|
257
|
+
authLeases?: SyncAuthLeaseRoutesConfig<Auth>;
|
|
258
|
+
wsConnectionManager?: WebSocketConnectionManager;
|
|
259
|
+
/**
|
|
260
|
+
* Optional snapshot chunk storage adapter.
|
|
261
|
+
* When provided, stores snapshot chunk bodies in external storage
|
|
262
|
+
* (S3, R2, etc.) instead of inline in the database.
|
|
263
|
+
*/
|
|
264
|
+
chunkStorage?: SnapshotChunkStorage;
|
|
265
|
+
/**
|
|
266
|
+
* Optional scoped snapshot artifact body storage adapter.
|
|
267
|
+
* Artifact metadata is stored in SQL; bodies are always external.
|
|
268
|
+
*/
|
|
269
|
+
snapshotArtifactStorage?: SnapshotArtifactStorage;
|
|
270
|
+
/**
|
|
271
|
+
* Optional scope cache backend for resolveScopes() results.
|
|
272
|
+
* Request-local memoization is always applied for every pull.
|
|
273
|
+
*/
|
|
274
|
+
scopeCache?: ScopeCacheBackend;
|
|
275
|
+
/**
|
|
276
|
+
* Optional live emitter for console websocket activity feed.
|
|
277
|
+
* When provided, sync lifecycle events are published to `/console/events/live`.
|
|
278
|
+
*/
|
|
279
|
+
consoleLiveEmitter?: {
|
|
280
|
+
emit(event: {
|
|
281
|
+
type: 'sync' | 'push' | 'pull' | 'commit' | 'client_update';
|
|
282
|
+
timestamp: string;
|
|
283
|
+
data: Record<string, unknown>;
|
|
284
|
+
}): void;
|
|
285
|
+
};
|
|
286
|
+
/**
|
|
287
|
+
* Optional console schema readiness promise.
|
|
288
|
+
* When provided, request-event recording waits for this promise before writing.
|
|
289
|
+
*/
|
|
290
|
+
consoleSchemaReady?: Promise<void>;
|
|
291
|
+
}
|
|
292
|
+
export declare const snapshotChunkParamsSchema: z.ZodObject<{
|
|
293
|
+
chunkId: z.ZodString;
|
|
294
|
+
}, z.core.$strip>;
|
|
295
|
+
export declare const snapshotArtifactParamsSchema: z.ZodObject<{
|
|
296
|
+
artifactId: z.ZodString;
|
|
297
|
+
}, z.core.$strip>;
|
|
298
|
+
export declare const snapshotChunkQuerySchema: z.ZodObject<{
|
|
299
|
+
scopes: z.ZodOptional<z.ZodString>;
|
|
300
|
+
}, z.core.$strip>;
|
|
301
|
+
export declare const auditCommitListQuerySchema: z.ZodObject<{
|
|
302
|
+
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
303
|
+
beforeCommitSeq: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
304
|
+
actorId: z.ZodOptional<z.ZodString>;
|
|
305
|
+
table: z.ZodOptional<z.ZodString>;
|
|
306
|
+
from: z.ZodOptional<z.ZodString>;
|
|
307
|
+
to: z.ZodOptional<z.ZodString>;
|
|
308
|
+
}, z.core.$strip>;
|
|
309
|
+
export declare const auditCommitParamsSchema: z.ZodObject<{
|
|
310
|
+
commitSeq: z.ZodCoercedNumber<unknown>;
|
|
311
|
+
}, z.core.$strip>;
|
|
312
|
+
export declare const auditRowHistoryParamsSchema: z.ZodObject<{
|
|
313
|
+
table: z.ZodString;
|
|
314
|
+
rowId: z.ZodString;
|
|
315
|
+
}, z.core.$strip>;
|
|
316
|
+
export declare const auditRowHistoryQuerySchema: z.ZodObject<{
|
|
317
|
+
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
318
|
+
beforeCommitSeq: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
319
|
+
afterCommitSeq: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
320
|
+
}, z.core.$strip>;
|
|
321
|
+
export declare const auditDebugExportQuerySchema: z.ZodObject<{
|
|
322
|
+
limitCommits: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
323
|
+
limitEvents: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
324
|
+
from: z.ZodOptional<z.ZodString>;
|
|
325
|
+
to: z.ZodOptional<z.ZodString>;
|
|
326
|
+
}, z.core.$strip>;
|
|
327
|
+
export declare const auditCommitListResponseSchema: z.ZodObject<{
|
|
328
|
+
ok: z.ZodLiteral<true>;
|
|
329
|
+
commits: z.ZodArray<z.ZodObject<{
|
|
330
|
+
commitSeq: z.ZodNumber;
|
|
331
|
+
actorId: z.ZodString;
|
|
332
|
+
clientId: z.ZodString;
|
|
333
|
+
clientCommitId: z.ZodString;
|
|
334
|
+
createdAt: z.ZodString;
|
|
335
|
+
changeCount: z.ZodNumber;
|
|
336
|
+
affectedTables: z.ZodArray<z.ZodString>;
|
|
337
|
+
}, z.core.$strip>>;
|
|
338
|
+
nextCursor: z.ZodNullable<z.ZodNumber>;
|
|
339
|
+
}, z.core.$strip>;
|
|
340
|
+
declare const auditChangeSchema: z.ZodObject<{
|
|
341
|
+
changeId: z.ZodNumber;
|
|
342
|
+
table: z.ZodString;
|
|
343
|
+
rowId: z.ZodString;
|
|
344
|
+
op: z.ZodEnum<{
|
|
345
|
+
delete: "delete";
|
|
346
|
+
upsert: "upsert";
|
|
347
|
+
}>;
|
|
348
|
+
rowVersion: z.ZodNullable<z.ZodNumber>;
|
|
349
|
+
fields: z.ZodArray<z.ZodString>;
|
|
350
|
+
scopeFields: z.ZodArray<z.ZodString>;
|
|
351
|
+
changeKind: z.ZodEnum<{
|
|
352
|
+
app_row: "app_row";
|
|
353
|
+
blob_reference: "blob_reference";
|
|
354
|
+
delete: "delete";
|
|
355
|
+
encrypted_crdt_checkpoint: "encrypted_crdt_checkpoint";
|
|
356
|
+
encrypted_crdt_update: "encrypted_crdt_update";
|
|
357
|
+
encrypted_field_envelope: "encrypted_field_envelope";
|
|
358
|
+
}>;
|
|
359
|
+
sensitiveFields: z.ZodArray<z.ZodString>;
|
|
360
|
+
redaction: z.ZodObject<{
|
|
361
|
+
payload: z.ZodLiteral<"omitted">;
|
|
362
|
+
reason: z.ZodLiteral<"audit_redacted_by_default">;
|
|
363
|
+
}, z.core.$strip>;
|
|
364
|
+
}, z.core.$strip>;
|
|
365
|
+
export declare const auditCommitDetailResponseSchema: z.ZodObject<{
|
|
366
|
+
ok: z.ZodLiteral<true>;
|
|
367
|
+
commit: z.ZodObject<{
|
|
368
|
+
commitSeq: z.ZodNumber;
|
|
369
|
+
actorId: z.ZodString;
|
|
370
|
+
clientId: z.ZodString;
|
|
371
|
+
clientCommitId: z.ZodString;
|
|
372
|
+
createdAt: z.ZodString;
|
|
373
|
+
changeCount: z.ZodNumber;
|
|
374
|
+
affectedTables: z.ZodArray<z.ZodString>;
|
|
375
|
+
}, z.core.$strip>;
|
|
376
|
+
changes: z.ZodArray<z.ZodObject<{
|
|
377
|
+
changeId: z.ZodNumber;
|
|
378
|
+
table: z.ZodString;
|
|
379
|
+
rowId: z.ZodString;
|
|
380
|
+
op: z.ZodEnum<{
|
|
381
|
+
delete: "delete";
|
|
382
|
+
upsert: "upsert";
|
|
383
|
+
}>;
|
|
384
|
+
rowVersion: z.ZodNullable<z.ZodNumber>;
|
|
385
|
+
fields: z.ZodArray<z.ZodString>;
|
|
386
|
+
scopeFields: z.ZodArray<z.ZodString>;
|
|
387
|
+
changeKind: z.ZodEnum<{
|
|
388
|
+
app_row: "app_row";
|
|
389
|
+
blob_reference: "blob_reference";
|
|
390
|
+
delete: "delete";
|
|
391
|
+
encrypted_crdt_checkpoint: "encrypted_crdt_checkpoint";
|
|
392
|
+
encrypted_crdt_update: "encrypted_crdt_update";
|
|
393
|
+
encrypted_field_envelope: "encrypted_field_envelope";
|
|
394
|
+
}>;
|
|
395
|
+
sensitiveFields: z.ZodArray<z.ZodString>;
|
|
396
|
+
redaction: z.ZodObject<{
|
|
397
|
+
payload: z.ZodLiteral<"omitted">;
|
|
398
|
+
reason: z.ZodLiteral<"audit_redacted_by_default">;
|
|
399
|
+
}, z.core.$strip>;
|
|
400
|
+
}, z.core.$strip>>;
|
|
401
|
+
}, z.core.$strip>;
|
|
402
|
+
declare const auditDebugExportEventSchema: z.ZodObject<{
|
|
403
|
+
eventId: z.ZodNumber;
|
|
404
|
+
partitionId: z.ZodString;
|
|
405
|
+
requestId: z.ZodString;
|
|
406
|
+
traceId: z.ZodNullable<z.ZodString>;
|
|
407
|
+
spanId: z.ZodNullable<z.ZodString>;
|
|
408
|
+
eventType: z.ZodEnum<{
|
|
409
|
+
pull: "pull";
|
|
410
|
+
push: "push";
|
|
411
|
+
sync: "sync";
|
|
412
|
+
}>;
|
|
413
|
+
syncPath: z.ZodEnum<{
|
|
414
|
+
"http-combined": "http-combined";
|
|
415
|
+
"ws-push": "ws-push";
|
|
416
|
+
}>;
|
|
417
|
+
transportPath: z.ZodEnum<{
|
|
418
|
+
direct: "direct";
|
|
419
|
+
relay: "relay";
|
|
420
|
+
}>;
|
|
421
|
+
actorId: z.ZodString;
|
|
422
|
+
clientId: z.ZodString;
|
|
423
|
+
statusCode: z.ZodNumber;
|
|
424
|
+
outcome: z.ZodString;
|
|
425
|
+
responseStatus: z.ZodString;
|
|
426
|
+
errorCode: z.ZodNullable<z.ZodString>;
|
|
427
|
+
durationMs: z.ZodNumber;
|
|
428
|
+
commitSeq: z.ZodNullable<z.ZodNumber>;
|
|
429
|
+
operationCount: z.ZodNullable<z.ZodNumber>;
|
|
430
|
+
rowCount: z.ZodNullable<z.ZodNumber>;
|
|
431
|
+
subscriptionCount: z.ZodNullable<z.ZodNumber>;
|
|
432
|
+
scopesSummary: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
433
|
+
tables: z.ZodArray<z.ZodString>;
|
|
434
|
+
createdAt: z.ZodString;
|
|
435
|
+
}, z.core.$strip>;
|
|
436
|
+
export declare const auditDebugExportResponseSchema: z.ZodObject<{
|
|
437
|
+
ok: z.ZodLiteral<true>;
|
|
438
|
+
generatedAt: z.ZodString;
|
|
439
|
+
partitionId: z.ZodString;
|
|
440
|
+
limits: z.ZodObject<{
|
|
441
|
+
commits: z.ZodNumber;
|
|
442
|
+
requestEvents: z.ZodNumber;
|
|
443
|
+
}, z.core.$strip>;
|
|
444
|
+
truncated: z.ZodObject<{
|
|
445
|
+
commits: z.ZodBoolean;
|
|
446
|
+
requestEvents: z.ZodBoolean;
|
|
447
|
+
}, z.core.$strip>;
|
|
448
|
+
commits: z.ZodArray<z.ZodObject<{
|
|
449
|
+
commitSeq: z.ZodNumber;
|
|
450
|
+
actorId: z.ZodString;
|
|
451
|
+
clientId: z.ZodString;
|
|
452
|
+
clientCommitId: z.ZodString;
|
|
453
|
+
createdAt: z.ZodString;
|
|
454
|
+
changeCount: z.ZodNumber;
|
|
455
|
+
affectedTables: z.ZodArray<z.ZodString>;
|
|
456
|
+
changes: z.ZodArray<z.ZodObject<{
|
|
457
|
+
changeId: z.ZodNumber;
|
|
458
|
+
table: z.ZodString;
|
|
459
|
+
rowId: z.ZodString;
|
|
460
|
+
op: z.ZodEnum<{
|
|
461
|
+
delete: "delete";
|
|
462
|
+
upsert: "upsert";
|
|
463
|
+
}>;
|
|
464
|
+
rowVersion: z.ZodNullable<z.ZodNumber>;
|
|
465
|
+
fields: z.ZodArray<z.ZodString>;
|
|
466
|
+
scopeFields: z.ZodArray<z.ZodString>;
|
|
467
|
+
changeKind: z.ZodEnum<{
|
|
468
|
+
app_row: "app_row";
|
|
469
|
+
blob_reference: "blob_reference";
|
|
470
|
+
delete: "delete";
|
|
471
|
+
encrypted_crdt_checkpoint: "encrypted_crdt_checkpoint";
|
|
472
|
+
encrypted_crdt_update: "encrypted_crdt_update";
|
|
473
|
+
encrypted_field_envelope: "encrypted_field_envelope";
|
|
474
|
+
}>;
|
|
475
|
+
sensitiveFields: z.ZodArray<z.ZodString>;
|
|
476
|
+
redaction: z.ZodObject<{
|
|
477
|
+
payload: z.ZodLiteral<"omitted">;
|
|
478
|
+
reason: z.ZodLiteral<"audit_redacted_by_default">;
|
|
479
|
+
}, z.core.$strip>;
|
|
480
|
+
}, z.core.$strip>>;
|
|
481
|
+
}, z.core.$strip>>;
|
|
482
|
+
requestEvents: z.ZodArray<z.ZodObject<{
|
|
483
|
+
eventId: z.ZodNumber;
|
|
484
|
+
partitionId: z.ZodString;
|
|
485
|
+
requestId: z.ZodString;
|
|
486
|
+
traceId: z.ZodNullable<z.ZodString>;
|
|
487
|
+
spanId: z.ZodNullable<z.ZodString>;
|
|
488
|
+
eventType: z.ZodEnum<{
|
|
489
|
+
pull: "pull";
|
|
490
|
+
push: "push";
|
|
491
|
+
sync: "sync";
|
|
492
|
+
}>;
|
|
493
|
+
syncPath: z.ZodEnum<{
|
|
494
|
+
"http-combined": "http-combined";
|
|
495
|
+
"ws-push": "ws-push";
|
|
496
|
+
}>;
|
|
497
|
+
transportPath: z.ZodEnum<{
|
|
498
|
+
direct: "direct";
|
|
499
|
+
relay: "relay";
|
|
500
|
+
}>;
|
|
501
|
+
actorId: z.ZodString;
|
|
502
|
+
clientId: z.ZodString;
|
|
503
|
+
statusCode: z.ZodNumber;
|
|
504
|
+
outcome: z.ZodString;
|
|
505
|
+
responseStatus: z.ZodString;
|
|
506
|
+
errorCode: z.ZodNullable<z.ZodString>;
|
|
507
|
+
durationMs: z.ZodNumber;
|
|
508
|
+
commitSeq: z.ZodNullable<z.ZodNumber>;
|
|
509
|
+
operationCount: z.ZodNullable<z.ZodNumber>;
|
|
510
|
+
rowCount: z.ZodNullable<z.ZodNumber>;
|
|
511
|
+
subscriptionCount: z.ZodNullable<z.ZodNumber>;
|
|
512
|
+
scopesSummary: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
513
|
+
tables: z.ZodArray<z.ZodString>;
|
|
514
|
+
createdAt: z.ZodString;
|
|
515
|
+
}, z.core.$strip>>;
|
|
516
|
+
}, z.core.$strip>;
|
|
517
|
+
export declare const auditRowHistoryResponseSchema: z.ZodObject<{
|
|
518
|
+
ok: z.ZodLiteral<true>;
|
|
519
|
+
table: z.ZodString;
|
|
520
|
+
rowId: z.ZodString;
|
|
521
|
+
history: z.ZodArray<z.ZodObject<{
|
|
522
|
+
commitSeq: z.ZodNumber;
|
|
523
|
+
actorId: z.ZodString;
|
|
524
|
+
clientId: z.ZodString;
|
|
525
|
+
clientCommitId: z.ZodString;
|
|
526
|
+
createdAt: z.ZodString;
|
|
527
|
+
changeId: z.ZodNumber;
|
|
528
|
+
table: z.ZodString;
|
|
529
|
+
rowId: z.ZodString;
|
|
530
|
+
op: z.ZodEnum<{
|
|
531
|
+
delete: "delete";
|
|
532
|
+
upsert: "upsert";
|
|
533
|
+
}>;
|
|
534
|
+
rowVersion: z.ZodNullable<z.ZodNumber>;
|
|
535
|
+
fields: z.ZodArray<z.ZodString>;
|
|
536
|
+
scopeFields: z.ZodArray<z.ZodString>;
|
|
537
|
+
changeKind: z.ZodEnum<{
|
|
538
|
+
app_row: "app_row";
|
|
539
|
+
blob_reference: "blob_reference";
|
|
540
|
+
delete: "delete";
|
|
541
|
+
encrypted_crdt_checkpoint: "encrypted_crdt_checkpoint";
|
|
542
|
+
encrypted_crdt_update: "encrypted_crdt_update";
|
|
543
|
+
encrypted_field_envelope: "encrypted_field_envelope";
|
|
544
|
+
}>;
|
|
545
|
+
sensitiveFields: z.ZodArray<z.ZodString>;
|
|
546
|
+
redaction: z.ZodObject<{
|
|
547
|
+
payload: z.ZodLiteral<"omitted">;
|
|
548
|
+
reason: z.ZodLiteral<"audit_redacted_by_default">;
|
|
549
|
+
}, z.core.$strip>;
|
|
550
|
+
}, z.core.$strip>>;
|
|
551
|
+
nextCursor: z.ZodNullable<z.ZodNumber>;
|
|
552
|
+
}, z.core.$strip>;
|
|
553
|
+
export type AuditChangeResponse = z.infer<typeof auditChangeSchema>;
|
|
554
|
+
export type AuditDebugExportEvent = z.infer<typeof auditDebugExportEventSchema>;
|
|
555
|
+
export declare const DEFAULT_REQUEST_PAYLOAD_SNAPSHOT_MAX_BYTES: number;
|
|
556
|
+
export declare const DEFAULT_MAX_SYNC_REQUEST_JSON_BYTES: number;
|
|
557
|
+
export declare const DEFAULT_MAX_SYNC_BINARY_PACK_BYTES: number;
|
|
558
|
+
export declare const DEFAULT_MAX_SNAPSHOT_CHUNK_RESPONSE_BYTES: number;
|
|
559
|
+
export declare const DEFAULT_MAX_SNAPSHOT_ARTIFACT_RESPONSE_BYTES: number;
|
|
560
|
+
export type TraceContext = {
|
|
561
|
+
traceId: string | null;
|
|
562
|
+
spanId: string | null;
|
|
563
|
+
};
|
|
564
|
+
export type NormalizedSyncCorsConfig = {
|
|
565
|
+
resolveOrigin: (origin: string | undefined, context: Context) => Promise<string | null>;
|
|
566
|
+
staticAllowedOrigins?: string[] | '*';
|
|
567
|
+
allowHeaders: string[];
|
|
568
|
+
exposeHeaders: string[];
|
|
569
|
+
allowMethods: string[];
|
|
570
|
+
allowCredentials: boolean;
|
|
571
|
+
maxAgeSeconds: number;
|
|
572
|
+
};
|
|
573
|
+
export declare function applySyncCorsHeaders(args: {
|
|
574
|
+
headers: Headers;
|
|
575
|
+
allowedOrigin: string;
|
|
576
|
+
allowCredentials: boolean;
|
|
577
|
+
allowHeaders: string[];
|
|
578
|
+
exposeHeaders: string[];
|
|
579
|
+
allowMethods: string[];
|
|
580
|
+
maxAgeSeconds: number;
|
|
581
|
+
}): void;
|
|
582
|
+
export declare function createSyncCorsOriginDeniedResponse(origin: string): Response;
|
|
583
|
+
export declare function normalizeSyncCorsConfig(config: SyncRoutesConfigWithRateLimit['cors']): NormalizedSyncCorsConfig | null;
|
|
584
|
+
export declare function createOpaqueId(prefix: string): string;
|
|
585
|
+
export declare function readOriginHeader(c: Context): string | undefined;
|
|
586
|
+
export declare function readRequestId(c: Context): string;
|
|
587
|
+
export declare function readClientIdHint(c: Context): string;
|
|
588
|
+
export declare function readPositiveInteger(value: number | undefined, fallback: number): number;
|
|
589
|
+
export declare function readOptionalPositiveInteger(value: number | undefined): number | undefined;
|
|
590
|
+
declare class SyncJsonBodyLimitError extends Error {
|
|
591
|
+
readonly limit: string;
|
|
592
|
+
readonly observed: number;
|
|
593
|
+
readonly max: number;
|
|
594
|
+
constructor(limit: string, observed: number, max: number);
|
|
595
|
+
}
|
|
596
|
+
export declare function isSyncJsonBodyLimitError(error: unknown): error is SyncJsonBodyLimitError;
|
|
597
|
+
export declare function readRequestContentLength(c: Context): number | null | 'invalid';
|
|
598
|
+
export declare function readRequestBodyBytesWithLimit(request: Request, args: {
|
|
599
|
+
maxBytes: number;
|
|
600
|
+
limit: string;
|
|
601
|
+
}): Promise<Uint8Array>;
|
|
602
|
+
export declare function responseBodyOverLimit(c: Context, args: {
|
|
603
|
+
limit: string;
|
|
604
|
+
observed: number;
|
|
605
|
+
max: number;
|
|
606
|
+
message?: string;
|
|
607
|
+
}): Response | null;
|
|
608
|
+
export declare function syncValidationError(c: Context, target: string, issues: readonly {
|
|
609
|
+
path?: unknown;
|
|
610
|
+
message?: unknown;
|
|
611
|
+
}[]): Response;
|
|
612
|
+
export declare function readTraceContext(c: Context): TraceContext;
|
|
613
|
+
export declare function readTraceContextFromMessage(msg: Record<string, unknown>): TraceContext;
|
|
614
|
+
export declare function normalizeResponseStatus(statusCode: number, outcome: string): string;
|
|
615
|
+
export declare function firstPushErrorCode(results: unknown): string | null;
|
|
616
|
+
export declare function summarizeScopeValues(scopes: Record<string, string | string[]>): Record<string, string | string[]> | null;
|
|
617
|
+
export declare function summarizePullResponse(response: PullResult['response']): {
|
|
618
|
+
subscriptions: Array<{
|
|
619
|
+
id: string;
|
|
620
|
+
status: 'active' | 'revoked';
|
|
621
|
+
bootstrap: boolean;
|
|
622
|
+
nextCursor: number;
|
|
623
|
+
commitCount: number;
|
|
624
|
+
changeCount: number;
|
|
625
|
+
snapshotCount: number;
|
|
626
|
+
snapshotRowCount: number;
|
|
627
|
+
}>;
|
|
628
|
+
};
|
|
629
|
+
export declare function summarizePullResponseForRequestEvent(response: PullResult['response']): {
|
|
630
|
+
subscriptionCount: number;
|
|
631
|
+
activeSubscriptionCount: number;
|
|
632
|
+
revokedSubscriptionCount: number;
|
|
633
|
+
bootstrapSubscriptionCount: number;
|
|
634
|
+
commitCount: number;
|
|
635
|
+
changeCount: number;
|
|
636
|
+
snapshotPageCount: number;
|
|
637
|
+
snapshotInlineRowCount: number;
|
|
638
|
+
snapshotChunkCount: number;
|
|
639
|
+
snapshotChunkBytes: number;
|
|
640
|
+
snapshotArtifactCount: number;
|
|
641
|
+
snapshotArtifactBytes: number;
|
|
642
|
+
};
|
|
643
|
+
export declare function countPullRows(response: PullResult['response']): number;
|
|
644
|
+
export declare function readSnapshotScopeValues(c: Context, queryScopes: string | undefined): Record<string, string | string[]> | null;
|
|
645
|
+
export declare function parseScopesSummary(value: unknown): Record<string, string | string[]> | null;
|
|
646
|
+
export declare function normalizeRequestEventType(value: unknown): 'sync' | 'push' | 'pull';
|
|
647
|
+
export declare function isMissingRequestEventsTableError(error: unknown): boolean;
|
|
648
|
+
export declare function encodePayloadSnapshot(value: unknown, maxBytes: number): string;
|
|
649
|
+
export declare function emitConsoleLiveEvent(emitter: {
|
|
650
|
+
emit(event: {
|
|
651
|
+
type: 'sync' | 'push' | 'pull' | 'commit' | 'client_update';
|
|
652
|
+
timestamp: string;
|
|
653
|
+
data: Record<string, unknown>;
|
|
654
|
+
}): void;
|
|
655
|
+
} | undefined, type: 'sync' | 'push' | 'pull' | 'commit' | 'client_update', data: Record<string, unknown> | (() => Record<string, unknown>)): void;
|
|
656
|
+
export declare function isAuthLeaseRefreshRetriable(code: string): boolean;
|
|
657
|
+
export type RequestPayloadSnapshot = {
|
|
658
|
+
request: unknown;
|
|
659
|
+
response: unknown;
|
|
660
|
+
};
|
|
661
|
+
export declare function clampInt(value: number, min: number, max: number): number;
|
|
662
|
+
export declare function measureWebSocketMessageBytes(data: unknown): number;
|
|
663
|
+
export declare function readTransportPath(c: Context, queryValue?: string | null): 'direct' | 'relay';
|
|
664
|
+
export declare function scopeValuesToScopeKeys(scopes: unknown): string[];
|
|
665
|
+
export declare function selectRequiredAuditScopes(scopePatterns: readonly string[], allowedScopes: ScopeValues): ScopeValues | null;
|
|
666
|
+
export declare function parseStoredAuditScopes(value: unknown): StoredScopes;
|
|
667
|
+
export declare function applyPartitionToScopeKeys(partitionId: string, scopeKeys: readonly string[]): string[];
|
|
668
|
+
export declare function uniqueScopeKeys(scopeKeys: readonly string[]): string[];
|
|
669
|
+
export declare function parsePersistedRealtimeSubscriptions(value: unknown, partitionId: string): WebSocketRealtimeSubscription[];
|
|
670
|
+
export declare function normalizeScopeKeyForPartition(partitionId: string, scopeKey: string): string;
|
|
671
|
+
export declare function readCommitScopeKeys<DB extends SyncCoreDb>(db: Kysely<DB>, commitSeq: number, partitionId: string): Promise<string[]>;
|
|
672
|
+
export declare function readClientState<DB extends SyncCoreDb>(db: Kysely<DB>, partitionId: string, clientId: string): Promise<{
|
|
673
|
+
ownerActorId: string | null;
|
|
674
|
+
effectiveScopes: unknown;
|
|
675
|
+
realtimeSubscriptions: unknown;
|
|
676
|
+
cursor: number | null;
|
|
677
|
+
latestCommitSeq: number;
|
|
678
|
+
hasConflict: boolean;
|
|
679
|
+
}>;
|
|
680
|
+
export declare function recordRealtimeAck<DB extends SyncCoreDb>(args: {
|
|
681
|
+
db: Kysely<DB>;
|
|
682
|
+
dialect: ServerSyncDialect;
|
|
683
|
+
partitionId: string;
|
|
684
|
+
actorId: string;
|
|
685
|
+
clientId: string;
|
|
686
|
+
cursor: number;
|
|
687
|
+
realtimeSubscriptions?: unknown;
|
|
688
|
+
}): Promise<void>;
|
|
689
|
+
//# sourceMappingURL=shared.d.ts.map
|