jazz-tools 2.0.0-alpha.9 → 2.0.0-beta.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/LICENSE +21 -0
- package/README.md +136 -9
- package/bin/jazz-tools.js +95 -68
- package/dist/_dev/inspector-cache-runtime.d.ts +8 -0
- package/dist/_dev/inspector-cache-runtime.d.ts.map +1 -0
- package/dist/_dev/inspector-cache-runtime.js +246 -0
- package/dist/_dev/inspector-cache-runtime.js.map +1 -0
- package/dist/_dev/inspector-client.d.ts +15 -0
- package/dist/_dev/inspector-client.d.ts.map +1 -0
- package/dist/_dev/inspector-client.js +134 -0
- package/dist/_dev/inspector-client.js.map +1 -0
- package/dist/_dev/native-account-session.d.ts +23 -0
- package/dist/_dev/native-account-session.d.ts.map +1 -0
- package/dist/_dev/native-account-session.js +61 -0
- package/dist/_dev/native-account-session.js.map +1 -0
- package/dist/_dev/native-binding-codec.d.ts +9 -0
- package/dist/_dev/native-binding-codec.d.ts.map +1 -0
- package/dist/_dev/native-binding-codec.js +9 -0
- package/dist/_dev/native-binding-codec.js.map +1 -0
- package/dist/accounts/account-manager-core.d.ts +87 -0
- package/dist/accounts/account-manager-core.d.ts.map +1 -0
- package/dist/accounts/account-manager-core.js +236 -0
- package/dist/accounts/account-manager-core.js.map +1 -0
- package/dist/accounts/browser-host.d.ts +8 -0
- package/dist/accounts/browser-host.d.ts.map +1 -0
- package/dist/accounts/browser-host.js +16 -0
- package/dist/accounts/browser-host.js.map +1 -0
- package/dist/accounts/config-capability.d.ts +26 -0
- package/dist/accounts/config-capability.d.ts.map +1 -0
- package/dist/accounts/config-capability.js +58 -0
- package/dist/accounts/config-capability.js.map +1 -0
- package/dist/accounts/context.d.ts +14 -0
- package/dist/accounts/context.d.ts.map +1 -0
- package/dist/accounts/context.js +214 -0
- package/dist/accounts/context.js.map +1 -0
- package/dist/accounts/enrollment.d.ts +95 -0
- package/dist/accounts/enrollment.d.ts.map +1 -0
- package/dist/accounts/enrollment.js +314 -0
- package/dist/accounts/enrollment.js.map +1 -0
- package/dist/accounts/exports.d.ts +3 -0
- package/dist/accounts/exports.d.ts.map +1 -0
- package/dist/accounts/exports.js +5 -0
- package/dist/accounts/exports.js.map +1 -0
- package/dist/accounts/local-first.d.ts +17 -0
- package/dist/accounts/local-first.d.ts.map +1 -0
- package/dist/accounts/local-first.js +62 -0
- package/dist/accounts/local-first.js.map +1 -0
- package/dist/accounts/persistence.d.ts +79 -0
- package/dist/accounts/persistence.d.ts.map +1 -0
- package/dist/accounts/persistence.js +533 -0
- package/dist/accounts/persistence.js.map +1 -0
- package/dist/accounts/process-store.d.ts +27 -0
- package/dist/accounts/process-store.d.ts.map +1 -0
- package/dist/accounts/process-store.js +49 -0
- package/dist/accounts/process-store.js.map +1 -0
- package/dist/accounts/registry-client.d.ts +79 -0
- package/dist/accounts/registry-client.d.ts.map +1 -0
- package/dist/accounts/registry-client.js +153 -0
- package/dist/accounts/registry-client.js.map +1 -0
- package/dist/accounts/state.d.ts +76 -0
- package/dist/accounts/state.d.ts.map +1 -0
- package/dist/accounts/state.js +172 -0
- package/dist/accounts/state.js.map +1 -0
- package/dist/app-file-enums.d.ts +9 -0
- package/dist/app-file-enums.d.ts.map +1 -0
- package/dist/app-file-enums.js +34 -0
- package/dist/app-file-enums.js.map +1 -0
- package/dist/authoring.d.ts +9 -0
- package/dist/authoring.d.ts.map +1 -0
- package/dist/authoring.js +9 -0
- package/dist/authoring.js.map +1 -0
- package/dist/backend/admission.d.ts +28 -0
- package/dist/backend/admission.d.ts.map +1 -0
- package/dist/backend/admission.js +146 -0
- package/dist/backend/admission.js.map +1 -0
- package/dist/backend/api.d.ts +12 -0
- package/dist/backend/api.d.ts.map +1 -0
- package/dist/backend/api.js +11 -0
- package/dist/backend/api.js.map +1 -0
- package/dist/backend/backend-clients.d.ts +76 -0
- package/dist/backend/backend-clients.d.ts.map +1 -0
- package/dist/backend/backend-clients.js +237 -0
- package/dist/backend/backend-clients.js.map +1 -0
- package/dist/backend/backend-issuer.d.ts +6 -0
- package/dist/backend/backend-issuer.d.ts.map +1 -0
- package/dist/backend/backend-issuer.js +6 -0
- package/dist/backend/backend-issuer.js.map +1 -0
- package/dist/backend/backend-native.d.ts +40 -0
- package/dist/backend/backend-native.d.ts.map +1 -0
- package/dist/backend/backend-native.js +37 -0
- package/dist/backend/backend-native.js.map +1 -0
- package/dist/backend/blobs.d.ts +130 -0
- package/dist/backend/blobs.d.ts.map +1 -0
- package/dist/backend/blobs.js +132 -0
- package/dist/backend/blobs.js.map +1 -0
- package/dist/backend/core-transport.d.ts +61 -0
- package/dist/backend/core-transport.d.ts.map +1 -0
- package/dist/backend/core-transport.js +106 -0
- package/dist/backend/core-transport.js.map +1 -0
- package/dist/backend/create-jazz-context.d.ts +94 -28
- package/dist/backend/create-jazz-context.d.ts.map +1 -1
- package/dist/backend/create-jazz-context.js +661 -67
- package/dist/backend/create-jazz-context.js.map +1 -1
- package/dist/backend/create-jazz-session.d.ts +125 -0
- package/dist/backend/create-jazz-session.d.ts.map +1 -0
- package/dist/backend/create-jazz-session.js +528 -0
- package/dist/backend/create-jazz-session.js.map +1 -0
- package/dist/backend/create-jazz.d.ts +677 -0
- package/dist/backend/create-jazz.d.ts.map +1 -0
- package/dist/backend/create-jazz.js +4076 -0
- package/dist/backend/create-jazz.js.map +1 -0
- package/dist/backend/early-db.d.ts +29 -0
- package/dist/backend/early-db.d.ts.map +1 -0
- package/dist/backend/early-db.js +203 -0
- package/dist/backend/early-db.js.map +1 -0
- package/dist/backend/external-jwt.d.ts +27 -0
- package/dist/backend/external-jwt.d.ts.map +1 -0
- package/dist/backend/external-jwt.js +404 -0
- package/dist/backend/external-jwt.js.map +1 -0
- package/dist/backend/from-jwt.d.ts +64 -0
- package/dist/backend/from-jwt.d.ts.map +1 -0
- package/dist/backend/from-jwt.js +104 -0
- package/dist/backend/from-jwt.js.map +1 -0
- package/dist/backend/index.d.ts +6 -3
- package/dist/backend/index.d.ts.map +1 -1
- package/dist/backend/index.js +18 -2
- package/dist/backend/index.js.map +1 -1
- package/dist/backend/inspect-ui.d.ts +14 -0
- package/dist/backend/inspect-ui.d.ts.map +1 -0
- package/dist/backend/inspect-ui.js +156 -0
- package/dist/backend/inspect-ui.js.map +1 -0
- package/dist/backend/inspect.d.ts +133 -0
- package/dist/backend/inspect.d.ts.map +1 -0
- package/dist/backend/inspect.js +1001 -0
- package/dist/backend/inspect.js.map +1 -0
- package/dist/backend/inspector-ui/0.js +2 -0
- package/dist/backend/inspector-ui/1.js +2 -0
- package/dist/backend/inspector-ui/10.js +2 -0
- package/dist/backend/inspector-ui/11.js +2 -0
- package/dist/backend/inspector-ui/12.js +2 -0
- package/dist/backend/inspector-ui/13.js +2 -0
- package/dist/backend/inspector-ui/14.js +2 -0
- package/dist/backend/inspector-ui/15.js +2 -0
- package/dist/backend/inspector-ui/16.js +2 -0
- package/dist/backend/inspector-ui/17.js +2 -0
- package/dist/backend/inspector-ui/18.js +2 -0
- package/dist/backend/inspector-ui/19.js +2 -0
- package/dist/backend/inspector-ui/2.js +2 -0
- package/dist/backend/inspector-ui/20.js +2 -0
- package/dist/backend/inspector-ui/21.js +2 -0
- package/dist/backend/inspector-ui/3.js +2 -0
- package/dist/backend/inspector-ui/4.js +2 -0
- package/dist/backend/inspector-ui/5.js +2 -0
- package/dist/backend/inspector-ui/6.js +2 -0
- package/dist/backend/inspector-ui/7.js +2 -0
- package/dist/backend/inspector-ui/8.js +2 -0
- package/dist/backend/inspector-ui/9.js +2 -0
- package/dist/backend/inspector-ui-files.d.ts +4 -0
- package/dist/backend/inspector-ui-files.d.ts.map +1 -0
- package/dist/backend/inspector-ui-files.js +26 -0
- package/dist/backend/no-account-error.d.ts +23 -0
- package/dist/backend/no-account-error.d.ts.map +1 -0
- package/dist/backend/no-account-error.js +30 -0
- package/dist/backend/no-account-error.js.map +1 -0
- package/dist/backend/node-native.d.ts +3 -0
- package/dist/backend/node-native.d.ts.map +1 -0
- package/dist/backend/node-native.js +19 -0
- package/dist/backend/node-native.js.map +1 -0
- package/dist/backend/node-peers.d.ts +10 -0
- package/dist/backend/node-peers.d.ts.map +1 -0
- package/dist/backend/node-peers.js +37 -0
- package/dist/backend/node-peers.js.map +1 -0
- package/dist/backend/optional-peer.d.ts +9 -0
- package/dist/backend/optional-peer.d.ts.map +1 -0
- package/dist/backend/optional-peer.js +24 -0
- package/dist/backend/optional-peer.js.map +1 -0
- package/dist/backend/request-auth.d.ts +69 -0
- package/dist/backend/request-auth.d.ts.map +1 -0
- package/dist/backend/request-auth.js +122 -0
- package/dist/backend/request-auth.js.map +1 -0
- package/dist/backend/session-expiry.d.ts +61 -0
- package/dist/backend/session-expiry.d.ts.map +1 -0
- package/dist/backend/session-expiry.js +102 -0
- package/dist/backend/session-expiry.js.map +1 -0
- package/dist/backend/signing-key.d.ts +32 -0
- package/dist/backend/signing-key.d.ts.map +1 -0
- package/dist/backend/signing-key.js +63 -0
- package/dist/backend/signing-key.js.map +1 -0
- package/dist/backend/socket-deadline.d.ts +23 -0
- package/dist/backend/socket-deadline.d.ts.map +1 -0
- package/dist/backend/socket-deadline.js +70 -0
- package/dist/backend/socket-deadline.js.map +1 -0
- package/dist/backend/store-log.d.ts +3 -0
- package/dist/backend/store-log.d.ts.map +1 -0
- package/dist/backend/store-log.js +16 -0
- package/dist/backend/store-log.js.map +1 -0
- package/dist/backend/thin-relay.d.ts +66 -0
- package/dist/backend/thin-relay.d.ts.map +1 -0
- package/dist/backend/thin-relay.js +204 -0
- package/dist/backend/thin-relay.js.map +1 -0
- package/dist/backend/thin-session-client.d.ts +23 -0
- package/dist/backend/thin-session-client.d.ts.map +1 -0
- package/dist/backend/thin-session-client.js +69 -0
- package/dist/backend/thin-session-client.js.map +1 -0
- package/dist/backend/upgrade-status.d.ts +19 -0
- package/dist/backend/upgrade-status.d.ts.map +1 -0
- package/dist/backend/upgrade-status.js +55 -0
- package/dist/backend/upgrade-status.js.map +1 -0
- package/dist/backend/vercel-store.d.ts +345 -0
- package/dist/backend/vercel-store.d.ts.map +1 -0
- package/dist/backend/vercel-store.js +1388 -0
- package/dist/backend/vercel-store.js.map +1 -0
- package/dist/backend/workerd-backend.d.ts +36 -0
- package/dist/backend/workerd-backend.d.ts.map +1 -0
- package/dist/backend/workerd-backend.js +97 -0
- package/dist/backend/workerd-backend.js.map +1 -0
- package/dist/backend/workerd.d.ts +3 -0
- package/dist/backend/workerd.d.ts.map +1 -0
- package/dist/backend/workerd.js +39 -0
- package/dist/backend/workerd.js.map +1 -0
- package/dist/backend/ws-peer.d.ts +32 -0
- package/dist/backend/ws-peer.d.ts.map +1 -0
- package/dist/backend/ws-peer.js +41 -0
- package/dist/backend/ws-peer.js.map +1 -0
- package/dist/better-auth-adapter/fixtures/app.d.ts +151 -0
- package/dist/better-auth-adapter/fixtures/app.d.ts.map +1 -0
- package/dist/better-auth-adapter/fixtures/app.js +13 -0
- package/dist/better-auth-adapter/fixtures/app.js.map +1 -0
- package/dist/better-auth-adapter/fixtures/issuer-upgrade.d.ts +20 -0
- package/dist/better-auth-adapter/fixtures/issuer-upgrade.d.ts.map +1 -0
- package/dist/better-auth-adapter/fixtures/issuer-upgrade.js +27 -0
- package/dist/better-auth-adapter/fixtures/issuer-upgrade.js.map +1 -0
- package/dist/better-auth-adapter/index.d.ts +13 -0
- package/dist/better-auth-adapter/index.d.ts.map +1 -0
- package/dist/better-auth-adapter/index.js +406 -0
- package/dist/better-auth-adapter/index.js.map +1 -0
- package/dist/better-auth-adapter/indexes.d.ts +9 -0
- package/dist/better-auth-adapter/indexes.d.ts.map +1 -0
- package/dist/better-auth-adapter/indexes.js +40 -0
- package/dist/better-auth-adapter/indexes.js.map +1 -0
- package/dist/better-auth-adapter/schema.d.ts +88 -0
- package/dist/better-auth-adapter/schema.d.ts.map +1 -0
- package/dist/better-auth-adapter/schema.js +332 -0
- package/dist/better-auth-adapter/schema.js.map +1 -0
- package/dist/better-auth-adapter/types.d.ts +13 -0
- package/dist/better-auth-adapter/types.d.ts.map +1 -0
- package/dist/better-auth-adapter/types.js +2 -0
- package/dist/better-auth-adapter/types.js.map +1 -0
- package/dist/better-auth-adapter/utils.d.ts +53 -0
- package/dist/better-auth-adapter/utils.d.ts.map +1 -0
- package/dist/better-auth-adapter/utils.js +126 -0
- package/dist/better-auth-adapter/utils.js.map +1 -0
- package/dist/browser-benchmark-mode.d.ts +6 -0
- package/dist/browser-benchmark-mode.d.ts.map +1 -0
- package/dist/browser-benchmark-mode.js +13 -0
- package/dist/browser-benchmark-mode.js.map +1 -0
- package/dist/classic-api.d.ts +59 -0
- package/dist/classic-api.d.ts.map +1 -0
- package/dist/classic-api.js +122 -0
- package/dist/classic-api.js.map +1 -0
- package/dist/cli.d.ts +38 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +457 -265
- package/dist/cli.js.map +1 -1
- package/dist/client/index.d.ts +9 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +5 -0
- package/dist/client/index.js.map +1 -0
- package/dist/cloud/api.d.ts +11 -0
- package/dist/cloud/api.d.ts.map +1 -0
- package/dist/cloud/api.js +46 -0
- package/dist/cloud/api.js.map +1 -0
- package/dist/cloud/commands.d.ts +13 -0
- package/dist/cloud/commands.d.ts.map +1 -0
- package/dist/cloud/commands.js +425 -0
- package/dist/cloud/commands.js.map +1 -0
- package/dist/cloud/credentials.d.ts +49 -0
- package/dist/cloud/credentials.d.ts.map +1 -0
- package/dist/cloud/credentials.js +219 -0
- package/dist/cloud/credentials.js.map +1 -0
- package/dist/cloud/session.d.ts +57 -0
- package/dist/cloud/session.d.ts.map +1 -0
- package/dist/cloud/session.js +269 -0
- package/dist/cloud/session.js.map +1 -0
- package/dist/codegen/relation-analyzer.d.ts +5 -12
- package/dist/codegen/relation-analyzer.d.ts.map +1 -1
- package/dist/codegen/relation-analyzer.js +53 -64
- package/dist/codegen/relation-analyzer.js.map +1 -1
- package/dist/dev/app-files.d.ts +32 -0
- package/dist/dev/app-files.d.ts.map +1 -0
- package/dist/dev/app-files.js +72 -0
- package/dist/dev/app-files.js.map +1 -0
- package/dist/dev/catalogue-api.d.ts +147 -0
- package/dist/dev/catalogue-api.d.ts.map +1 -0
- package/dist/dev/catalogue-api.js +127 -0
- package/dist/dev/catalogue-api.js.map +1 -0
- package/dist/dev/catalogue.d.ts +69 -0
- package/dist/dev/catalogue.d.ts.map +1 -0
- package/dist/dev/catalogue.js +70 -0
- package/dist/dev/catalogue.js.map +1 -0
- package/dist/dev/codegen-napi.d.ts +139 -0
- package/dist/dev/codegen-napi.d.ts.map +1 -0
- package/dist/dev/codegen-napi.js +157 -0
- package/dist/dev/codegen-napi.js.map +1 -0
- package/dist/dev/dev-server.d.ts +62 -0
- package/dist/dev/dev-server.d.ts.map +1 -0
- package/dist/dev/dev-server.js +164 -0
- package/dist/dev/dev-server.js.map +1 -0
- package/dist/dev/index.d.ts +3 -0
- package/dist/dev/index.d.ts.map +1 -0
- package/dist/dev/index.js +3 -0
- package/dist/dev/index.js.map +1 -0
- package/dist/dev/inspector-overlay/browser-control-registry.d.ts +10 -0
- package/dist/dev/inspector-overlay/browser-control-registry.d.ts.map +1 -0
- package/dist/dev/inspector-overlay/browser-control-registry.js +188 -0
- package/dist/dev/inspector-overlay/browser-control-registry.js.map +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/ExportResult-C0ZojfNk.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/backend-0Idv0niF.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/backend-DHeT1LCS.css +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/create-legacy-browser-delegate-DeI8PAZ5.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/diag-api-3Z_Eel3W.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/esm-BB6DtWpZ.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/esm-B_xpsQL2.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/esm-CE7mSo95.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/esm-CcBEG-yV.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/esm-DZrCzNXM.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/esm-k373aadI.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/index-hYDvY1xo.js +5 -0
- package/dist/dev/inspector-overlay/embedded/assets/jazz-broker-worker-Ul47m6zU.js +5 -0
- package/dist/dev/inspector-overlay/embedded/assets/jazz_wasm-zkCtl8wp.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/jazz_wasm_bg-xKxGDG9o.wasm +0 -0
- package/dist/dev/inspector-overlay/embedded/assets/node-foreground-node-lease.browser-2mfp13Qb.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/src-4JwhxZaW.js +16 -0
- package/dist/dev/inspector-overlay/embedded/assets/src-Cq8gSOLx.css +1 -0
- package/dist/dev/inspector-overlay/embedded/backend.html +17 -0
- package/dist/dev/inspector-overlay/embedded/embedded.html +15 -0
- package/dist/dev/inspector-overlay/embedded/favicon.ico +0 -0
- package/dist/dev/inspector-overlay/host-bridge.d.ts +8 -0
- package/dist/dev/inspector-overlay/host-bridge.d.ts.map +1 -0
- package/dist/dev/inspector-overlay/host-bridge.js +139 -0
- package/dist/dev/inspector-overlay/host-bridge.js.map +1 -0
- package/dist/dev/inspector-overlay/inspector-host-types.d.ts +35 -0
- package/dist/dev/inspector-overlay/inspector-host-types.d.ts.map +1 -0
- package/dist/dev/inspector-overlay/inspector-host-types.js +10 -0
- package/dist/dev/inspector-overlay/inspector-host-types.js.map +1 -0
- package/dist/dev/inspector-overlay/loader.d.ts +24 -0
- package/dist/dev/inspector-overlay/loader.d.ts.map +1 -0
- package/dist/dev/inspector-overlay/loader.js +533 -0
- package/dist/dev/inspector-overlay/loader.js.map +1 -0
- package/dist/dev/migration-graph.d.ts +32 -0
- package/dist/dev/migration-graph.d.ts.map +1 -0
- package/dist/dev/migration-graph.js +136 -0
- package/dist/dev/migration-graph.js.map +1 -0
- package/dist/dev/migrations.d.ts +145 -0
- package/dist/dev/migrations.d.ts.map +1 -0
- package/dist/dev/migrations.js +700 -0
- package/dist/dev/migrations.js.map +1 -0
- package/dist/dev/project.d.ts +65 -0
- package/dist/dev/project.d.ts.map +1 -0
- package/dist/dev/project.js +179 -0
- package/dist/dev/project.js.map +1 -0
- package/dist/dev/schema-utils.d.ts +8 -0
- package/dist/dev/schema-utils.d.ts.map +1 -0
- package/dist/dev/schema-utils.js +75 -0
- package/dist/dev/schema-utils.js.map +1 -0
- package/dist/dev/schema-validation.d.ts +5 -0
- package/dist/dev/schema-validation.d.ts.map +1 -0
- package/dist/dev/schema-validation.js +11 -0
- package/dist/dev/schema-validation.js.map +1 -0
- package/dist/dev/ts-project.d.ts +77 -0
- package/dist/dev/ts-project.d.ts.map +1 -0
- package/dist/dev/ts-project.js +191 -0
- package/dist/dev/ts-project.js.map +1 -0
- package/dist/drivers/index.d.ts +1 -1
- package/dist/drivers/index.d.ts.map +1 -1
- package/dist/drivers/index.js.map +1 -1
- package/dist/drivers/schema-wire.d.ts +19 -3
- package/dist/drivers/schema-wire.d.ts.map +1 -1
- package/dist/drivers/schema-wire.js +61 -11
- package/dist/drivers/schema-wire.js.map +1 -1
- package/dist/drivers/types.d.ts +166 -29
- package/dist/drivers/types.d.ts.map +1 -1
- package/dist/drivers/types.js +5 -2
- package/dist/drivers/types.js.map +1 -1
- package/dist/dsl.d.ts +276 -121
- package/dist/dsl.d.ts.map +1 -1
- package/dist/dsl.js +196 -160
- package/dist/dsl.js.map +1 -1
- package/dist/durable-object/index.d.ts +26 -0
- package/dist/durable-object/index.d.ts.map +1 -0
- package/dist/durable-object/index.js +26 -0
- package/dist/durable-object/index.js.map +1 -0
- package/dist/e2ee/SODIUM-LICENSE.txt +36 -0
- package/dist/e2ee/SODIUM-SOURCES.json +4 -0
- package/dist/e2ee/browser.d.ts +18 -0
- package/dist/e2ee/browser.d.ts.map +1 -0
- package/dist/e2ee/browser.js +111 -0
- package/dist/e2ee/browser.js.map +1 -0
- package/dist/e2ee/context.d.ts +23 -0
- package/dist/e2ee/context.d.ts.map +1 -0
- package/dist/e2ee/context.js +49 -0
- package/dist/e2ee/context.js.map +1 -0
- package/dist/e2ee/crypto.d.ts +10 -0
- package/dist/e2ee/crypto.d.ts.map +1 -0
- package/dist/e2ee/crypto.js +22 -0
- package/dist/e2ee/crypto.js.map +1 -0
- package/dist/e2ee/envelope.d.ts +22 -0
- package/dist/e2ee/envelope.d.ts.map +1 -0
- package/dist/e2ee/envelope.js +52 -0
- package/dist/e2ee/envelope.js.map +1 -0
- package/dist/e2ee/index.d.ts +14 -0
- package/dist/e2ee/index.d.ts.map +1 -0
- package/dist/e2ee/index.js +3 -0
- package/dist/e2ee/index.js.map +1 -0
- package/dist/e2ee/large-value.d.ts +20 -0
- package/dist/e2ee/large-value.d.ts.map +1 -0
- package/dist/e2ee/large-value.js +204 -0
- package/dist/e2ee/large-value.js.map +1 -0
- package/dist/e2ee/native.d.ts +18 -0
- package/dist/e2ee/native.d.ts.map +1 -0
- package/dist/e2ee/native.js +91 -0
- package/dist/e2ee/native.js.map +1 -0
- package/dist/e2ee/record-frame.d.ts +3 -0
- package/dist/e2ee/record-frame.d.ts.map +1 -0
- package/dist/e2ee/record-frame.js +18 -0
- package/dist/e2ee/record-frame.js.map +1 -0
- package/dist/e2ee/signer.d.ts +10 -0
- package/dist/e2ee/signer.d.ts.map +1 -0
- package/dist/e2ee/signer.js +54 -0
- package/dist/e2ee/signer.js.map +1 -0
- package/dist/e2ee/sodium-browser.d.ts +2 -0
- package/dist/e2ee/sodium-browser.d.ts.map +1 -0
- package/dist/e2ee/sodium-browser.js +3432 -0
- package/dist/e2ee/sodium.d.ts +20 -0
- package/dist/e2ee/sodium.d.ts.map +1 -0
- package/dist/e2ee/sodium.js +165 -0
- package/dist/e2ee/sodium.js.map +1 -0
- package/dist/e2ee/types.d.ts +92 -0
- package/dist/e2ee/types.d.ts.map +1 -0
- package/dist/e2ee/types.js +2 -0
- package/dist/e2ee/types.js.map +1 -0
- package/dist/effect/backend/index.d.ts +8 -0
- package/dist/effect/backend/index.d.ts.map +1 -0
- package/dist/effect/backend/index.js +8 -0
- package/dist/effect/backend/index.js.map +1 -0
- package/dist/effect/errors.d.ts +53 -0
- package/dist/effect/errors.d.ts.map +1 -0
- package/dist/effect/errors.js +61 -0
- package/dist/effect/errors.js.map +1 -0
- package/dist/effect/index.d.ts +9 -0
- package/dist/effect/index.d.ts.map +1 -0
- package/dist/effect/index.js +9 -0
- package/dist/effect/index.js.map +1 -0
- package/dist/effect/jazz-backend.d.ts +69 -0
- package/dist/effect/jazz-backend.d.ts.map +1 -0
- package/dist/effect/jazz-backend.js +95 -0
- package/dist/effect/jazz-backend.js.map +1 -0
- package/dist/effect/jazz.d.ts +129 -0
- package/dist/effect/jazz.d.ts.map +1 -0
- package/dist/effect/jazz.js +182 -0
- package/dist/effect/jazz.js.map +1 -0
- package/dist/expo/create-account-manager.d.ts +28 -0
- package/dist/expo/create-account-manager.d.ts.map +1 -0
- package/dist/expo/create-account-manager.js +35 -0
- package/dist/expo/create-account-manager.js.map +1 -0
- package/dist/expo/create-jazz-session.d.ts +66 -0
- package/dist/expo/create-jazz-session.d.ts.map +1 -0
- package/dist/expo/create-jazz-session.js +96 -0
- package/dist/expo/create-jazz-session.js.map +1 -0
- package/dist/expo/index.d.ts +12 -0
- package/dist/expo/index.d.ts.map +1 -0
- package/dist/expo/index.js +10 -0
- package/dist/expo/index.js.map +1 -0
- package/dist/expo/metro.d.ts +20 -0
- package/dist/expo/metro.d.ts.map +1 -0
- package/dist/expo/metro.js +58 -0
- package/dist/expo/metro.js.map +1 -0
- package/dist/expo/polyfills.d.ts +2 -0
- package/dist/expo/polyfills.d.ts.map +1 -0
- package/dist/expo/polyfills.js +5 -0
- package/dist/expo/polyfills.js.map +1 -0
- package/dist/expo/provider.d.ts +10 -0
- package/dist/expo/provider.d.ts.map +1 -0
- package/dist/expo/provider.js +11 -0
- package/dist/expo/provider.js.map +1 -0
- package/dist/index.d.ts +21 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -12
- package/dist/index.js.map +1 -1
- package/dist/inspect/cli.d.ts +12 -0
- package/dist/inspect/cli.d.ts.map +1 -0
- package/dist/inspect/cli.js +320 -0
- package/dist/inspect/cli.js.map +1 -0
- package/dist/inspect/client.d.ts +67 -0
- package/dist/inspect/client.d.ts.map +1 -0
- package/dist/inspect/client.js +254 -0
- package/dist/inspect/client.js.map +1 -0
- package/dist/inspect/mcp.d.ts +28 -0
- package/dist/inspect/mcp.d.ts.map +1 -0
- package/dist/inspect/mcp.js +441 -0
- package/dist/inspect/mcp.js.map +1 -0
- package/dist/inspect/protocol.d.ts +317 -0
- package/dist/inspect/protocol.d.ts.map +1 -0
- package/dist/inspect/protocol.js +544 -0
- package/dist/inspect/protocol.js.map +1 -0
- package/dist/inspector/index.d.ts +10 -0
- package/dist/inspector/index.d.ts.map +1 -0
- package/dist/inspector/index.js +27 -0
- package/dist/inspector/index.js.map +1 -0
- package/dist/internal/inspector-query.d.ts +6 -0
- package/dist/internal/inspector-query.d.ts.map +1 -0
- package/dist/internal/inspector-query.js +20 -0
- package/dist/internal/inspector-query.js.map +1 -0
- package/dist/ir.d.ts +43 -7
- package/dist/ir.d.ts.map +1 -1
- package/dist/ir.js +509 -1
- package/dist/ir.js.map +1 -1
- package/dist/json-value.d.ts +6 -0
- package/dist/json-value.d.ts.map +1 -0
- package/dist/json-value.js +2 -0
- package/dist/json-value.js.map +1 -0
- package/dist/local-first/index.d.ts +18 -0
- package/dist/local-first/index.d.ts.map +1 -0
- package/dist/local-first/index.js +17 -0
- package/dist/local-first/index.js.map +1 -0
- package/dist/local-first-auth/browser.d.ts +18 -0
- package/dist/local-first-auth/browser.d.ts.map +1 -0
- package/dist/local-first-auth/browser.js +26 -0
- package/dist/local-first-auth/browser.js.map +1 -0
- package/dist/local-first-auth/encoding.d.ts +10 -0
- package/dist/local-first-auth/encoding.d.ts.map +1 -0
- package/dist/local-first-auth/encoding.js +38 -0
- package/dist/local-first-auth/encoding.js.map +1 -0
- package/dist/local-first-auth/identity.d.ts +73 -0
- package/dist/local-first-auth/identity.d.ts.map +1 -0
- package/dist/local-first-auth/identity.js +258 -0
- package/dist/local-first-auth/identity.js.map +1 -0
- package/dist/local-first-auth/index.d.ts +6 -0
- package/dist/local-first-auth/index.d.ts.map +1 -0
- package/dist/local-first-auth/index.js +4 -0
- package/dist/local-first-auth/index.js.map +1 -0
- package/dist/local-first-auth/passkey.d.ts +22 -0
- package/dist/local-first-auth/passkey.d.ts.map +1 -0
- package/dist/local-first-auth/passkey.js +116 -0
- package/dist/local-first-auth/passkey.js.map +1 -0
- package/dist/local-first-auth/recovery-phrase.d.ts +10 -0
- package/dist/local-first-auth/recovery-phrase.d.ts.map +1 -0
- package/dist/local-first-auth/recovery-phrase.js +59 -0
- package/dist/local-first-auth/recovery-phrase.js.map +1 -0
- package/dist/local-first-auth/secret.d.ts +25 -0
- package/dist/local-first-auth/secret.d.ts.map +1 -0
- package/dist/local-first-auth/secret.js +68 -0
- package/dist/local-first-auth/secret.js.map +1 -0
- package/dist/local-first-auth/server.d.ts +13 -0
- package/dist/local-first-auth/server.d.ts.map +1 -0
- package/dist/local-first-auth/server.js +32 -0
- package/dist/local-first-auth/server.js.map +1 -0
- package/dist/local-first-auth/store.d.ts +51 -0
- package/dist/local-first-auth/store.d.ts.map +1 -0
- package/dist/local-first-auth/store.js +112 -0
- package/dist/local-first-auth/store.js.map +1 -0
- package/dist/magic-columns.d.ts +40 -0
- package/dist/magic-columns.d.ts.map +1 -0
- package/dist/magic-columns.js +110 -0
- package/dist/magic-columns.js.map +1 -0
- package/dist/migration-namespace.d.ts +12 -0
- package/dist/migration-namespace.d.ts.map +1 -0
- package/dist/migration-namespace.js +13 -0
- package/dist/migration-namespace.js.map +1 -0
- package/dist/migrations.d.ts +286 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +188 -0
- package/dist/migrations.js.map +1 -0
- package/dist/module-interop.d.ts +17 -0
- package/dist/module-interop.d.ts.map +1 -0
- package/dist/module-interop.js +32 -0
- package/dist/module-interop.js.map +1 -0
- package/dist/observed-jazz-client.d.ts +15 -0
- package/dist/observed-jazz-client.d.ts.map +1 -0
- package/dist/observed-jazz-client.js +47 -0
- package/dist/observed-jazz-client.js.map +1 -0
- package/dist/passkey-backup.d.ts +3 -0
- package/dist/passkey-backup.d.ts.map +1 -0
- package/dist/passkey-backup.js +2 -0
- package/dist/passkey-backup.js.map +1 -0
- package/dist/passphrase.d.ts +2 -0
- package/dist/passphrase.d.ts.map +1 -0
- package/dist/passphrase.js +2 -0
- package/dist/passphrase.js.map +1 -0
- package/dist/permissions/__fixtures__/big-label-better-auth.d.ts +89 -0
- package/dist/permissions/__fixtures__/big-label-better-auth.d.ts.map +1 -0
- package/dist/permissions/__fixtures__/big-label-better-auth.js +62 -0
- package/dist/permissions/__fixtures__/big-label-better-auth.js.map +1 -0
- package/dist/permissions/__fixtures__/big-label.d.ts +332 -0
- package/dist/permissions/__fixtures__/big-label.d.ts.map +1 -0
- package/dist/permissions/__fixtures__/big-label.js +177 -0
- package/dist/permissions/__fixtures__/big-label.js.map +1 -0
- package/dist/permissions/__fixtures__/chat-react.d.ts +112 -0
- package/dist/permissions/__fixtures__/chat-react.d.ts.map +1 -0
- package/dist/permissions/__fixtures__/chat-react.js +51 -0
- package/dist/permissions/__fixtures__/chat-react.js.map +1 -0
- package/dist/permissions/compile.d.ts +182 -0
- package/dist/permissions/compile.d.ts.map +1 -0
- package/dist/permissions/compile.js +715 -0
- package/dist/permissions/compile.js.map +1 -0
- package/dist/permissions/dsl.d.ts +158 -0
- package/dist/permissions/dsl.d.ts.map +1 -0
- package/dist/permissions/dsl.js +391 -0
- package/dist/permissions/dsl.js.map +1 -0
- package/dist/permissions/relation.d.ts +84 -0
- package/dist/permissions/relation.d.ts.map +1 -0
- package/dist/permissions/relation.js +150 -0
- package/dist/permissions/relation.js.map +1 -0
- package/dist/permissions/types.d.ts +357 -0
- package/dist/permissions/types.d.ts.map +1 -0
- package/dist/permissions/types.js +5 -0
- package/dist/permissions/types.js.map +1 -0
- package/dist/printer/app-json.d.ts +96 -0
- package/dist/printer/app-json.d.ts.map +1 -0
- package/dist/printer/app-json.js +18 -0
- package/dist/printer/app-json.js.map +1 -0
- package/dist/printer/cli.d.ts +15 -0
- package/dist/printer/cli.d.ts.map +1 -0
- package/dist/printer/cli.js +76 -0
- package/dist/printer/cli.js.map +1 -0
- package/dist/printer/defs.d.ts +11 -0
- package/dist/printer/defs.d.ts.map +1 -0
- package/dist/printer/defs.js +123 -0
- package/dist/printer/defs.js.map +1 -0
- package/dist/printer/expr.d.ts +281 -0
- package/dist/printer/expr.d.ts.map +1 -0
- package/dist/printer/expr.js +940 -0
- package/dist/printer/expr.js.map +1 -0
- package/dist/printer/format.d.ts +17 -0
- package/dist/printer/format.d.ts.map +1 -0
- package/dist/printer/format.js +315 -0
- package/dist/printer/format.js.map +1 -0
- package/dist/printer/index.d.ts +31 -0
- package/dist/printer/index.d.ts.map +1 -0
- package/dist/printer/index.js +51 -0
- package/dist/printer/index.js.map +1 -0
- package/dist/printer/migrations.d.ts +28 -0
- package/dist/printer/migrations.d.ts.map +1 -0
- package/dist/printer/migrations.js +179 -0
- package/dist/printer/migrations.js.map +1 -0
- package/dist/printer/names.d.ts +17 -0
- package/dist/printer/names.d.ts.map +1 -0
- package/dist/printer/names.js +124 -0
- package/dist/printer/names.js.map +1 -0
- package/dist/printer/permissions.d.ts +60 -0
- package/dist/printer/permissions.d.ts.map +1 -0
- package/dist/printer/permissions.js +1167 -0
- package/dist/printer/permissions.js.map +1 -0
- package/dist/printer/schema.d.ts +18 -0
- package/dist/printer/schema.d.ts.map +1 -0
- package/dist/printer/schema.js +132 -0
- package/dist/printer/schema.js.map +1 -0
- package/dist/prosemirror/anchors.d.ts +30 -0
- package/dist/prosemirror/anchors.d.ts.map +1 -0
- package/dist/prosemirror/anchors.js +28 -0
- package/dist/prosemirror/anchors.js.map +1 -0
- package/dist/prosemirror/index.d.ts +7 -0
- package/dist/prosemirror/index.d.ts.map +1 -0
- package/dist/prosemirror/index.js +7 -0
- package/dist/prosemirror/index.js.map +1 -0
- package/dist/prosemirror/markdown.d.ts +95 -0
- package/dist/prosemirror/markdown.d.ts.map +1 -0
- package/dist/prosemirror/markdown.js +428 -0
- package/dist/prosemirror/markdown.js.map +1 -0
- package/dist/prosemirror/overlays.d.ts +69 -0
- package/dist/prosemirror/overlays.d.ts.map +1 -0
- package/dist/prosemirror/overlays.js +143 -0
- package/dist/prosemirror/overlays.js.map +1 -0
- package/dist/prosemirror/presence.d.ts +39 -0
- package/dist/prosemirror/presence.d.ts.map +1 -0
- package/dist/prosemirror/presence.js +88 -0
- package/dist/prosemirror/presence.js.map +1 -0
- package/dist/prosemirror/sync.d.ts +60 -0
- package/dist/prosemirror/sync.d.ts.map +1 -0
- package/dist/prosemirror/sync.js +196 -0
- package/dist/prosemirror/sync.js.map +1 -0
- package/dist/prosemirror/text-map.d.ts +21 -0
- package/dist/prosemirror/text-map.d.ts.map +1 -0
- package/dist/prosemirror/text-map.js +85 -0
- package/dist/prosemirror/text-map.js.map +1 -0
- package/dist/react/create-jazz-client.d.ts +2 -11
- package/dist/react/create-jazz-client.d.ts.map +1 -1
- package/dist/react/create-jazz-client.js +1 -47
- package/dist/react/create-jazz-client.js.map +1 -1
- package/dist/react/index.d.ts +14 -7
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +8 -6
- package/dist/react/index.js.map +1 -1
- package/dist/react/provider-props.d.ts +7 -0
- package/dist/react/provider-props.d.ts.map +1 -0
- package/dist/react/provider-props.js +15 -0
- package/dist/react/provider-props.js.map +1 -0
- package/dist/react/provider.d.ts +19 -15
- package/dist/react/provider.d.ts.map +1 -1
- package/dist/react/provider.js +25 -5
- package/dist/react/provider.js.map +1 -1
- package/dist/react/use-all.d.ts +1 -1
- package/dist/react/use-all.d.ts.map +1 -1
- package/dist/react/use-all.js +1 -1
- package/dist/react/use-all.js.map +1 -1
- package/dist/react/use-one.d.ts +2 -0
- package/dist/react/use-one.d.ts.map +1 -0
- package/dist/react/use-one.js +2 -0
- package/dist/react/use-one.js.map +1 -0
- package/dist/react-core/index.d.ts +9 -4
- package/dist/react-core/index.d.ts.map +1 -1
- package/dist/react-core/index.js +10 -2
- package/dist/react-core/index.js.map +1 -1
- package/dist/react-core/provider.d.ts +48 -12
- package/dist/react-core/provider.d.ts.map +1 -1
- package/dist/react-core/provider.js +117 -13
- package/dist/react-core/provider.js.map +1 -1
- package/dist/react-core/session-context.d.ts +7 -0
- package/dist/react-core/session-context.d.ts.map +1 -0
- package/dist/react-core/session-context.js +8 -0
- package/dist/react-core/session-context.js.map +1 -0
- package/dist/react-core/session.d.ts +63 -0
- package/dist/react-core/session.d.ts.map +1 -0
- package/dist/react-core/session.js +97 -0
- package/dist/react-core/session.js.map +1 -0
- package/dist/react-core/use-all.d.ts +95 -3
- package/dist/react-core/use-all.d.ts.map +1 -1
- package/dist/react-core/use-all.js +126 -52
- package/dist/react-core/use-all.js.map +1 -1
- package/dist/react-core/use-auth-state.d.ts +13 -0
- package/dist/react-core/use-auth-state.d.ts.map +1 -0
- package/dist/react-core/use-auth-state.js +15 -0
- package/dist/react-core/use-auth-state.js.map +1 -0
- package/dist/react-core/use-one.d.ts +58 -0
- package/dist/react-core/use-one.d.ts.map +1 -0
- package/dist/react-core/use-one.js +19 -0
- package/dist/react-core/use-one.js.map +1 -0
- package/dist/react-core/use-sync-status.d.ts +8 -0
- package/dist/react-core/use-sync-status.d.ts.map +1 -0
- package/dist/react-core/use-sync-status.js +12 -0
- package/dist/react-core/use-sync-status.js.map +1 -0
- package/dist/react-native/abort-signal.d.ts +9 -0
- package/dist/react-native/abort-signal.d.ts.map +1 -0
- package/dist/react-native/abort-signal.js +51 -0
- package/dist/react-native/abort-signal.js.map +1 -0
- package/dist/react-native/account-session.d.ts +11 -0
- package/dist/react-native/account-session.d.ts.map +1 -0
- package/dist/react-native/account-session.js +59 -0
- package/dist/react-native/account-session.js.map +1 -0
- package/dist/react-native/create-account-manager.d.ts +28 -0
- package/dist/react-native/create-account-manager.d.ts.map +1 -0
- package/dist/react-native/create-account-manager.js +30 -0
- package/dist/react-native/create-account-manager.js.map +1 -0
- package/dist/react-native/create-db.d.ts +8 -0
- package/dist/react-native/create-db.d.ts.map +1 -0
- package/dist/react-native/create-db.js +9 -0
- package/dist/react-native/create-db.js.map +1 -0
- package/dist/react-native/create-jazz-client.d.ts +12 -10
- package/dist/react-native/create-jazz-client.d.ts.map +1 -1
- package/dist/react-native/create-jazz-client.js +6 -21
- package/dist/react-native/create-jazz-client.js.map +1 -1
- package/dist/react-native/create-jazz-session.d.ts +66 -0
- package/dist/react-native/create-jazz-session.d.ts.map +1 -0
- package/dist/react-native/create-jazz-session.js +96 -0
- package/dist/react-native/create-jazz-session.js.map +1 -0
- package/dist/react-native/errors.d.ts +6 -0
- package/dist/react-native/errors.d.ts.map +1 -0
- package/dist/react-native/errors.js +6 -0
- package/dist/react-native/errors.js.map +1 -0
- package/dist/react-native/index.d.ts +19 -9
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js +13 -7
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/native-foreground-db.d.ts +227 -0
- package/dist/react-native/native-foreground-db.d.ts.map +1 -0
- package/dist/react-native/native-foreground-db.js +905 -0
- package/dist/react-native/native-foreground-db.js.map +1 -0
- package/dist/react-native/native-relay.d.ts +7 -0
- package/dist/react-native/native-relay.d.ts.map +1 -0
- package/dist/react-native/native-relay.js +14 -0
- package/dist/react-native/native-relay.js.map +1 -0
- package/dist/react-native/provider.d.ts +19 -13
- package/dist/react-native/provider.d.ts.map +1 -1
- package/dist/react-native/provider.js +25 -5
- package/dist/react-native/provider.js.map +1 -1
- package/dist/react-native/runtime-source.d.ts +62 -0
- package/dist/react-native/runtime-source.d.ts.map +1 -0
- package/dist/react-native/runtime-source.js +314 -0
- package/dist/react-native/runtime-source.js.map +1 -0
- package/dist/react-native/use-all.d.ts +1 -1
- package/dist/react-native/use-all.d.ts.map +1 -1
- package/dist/react-native/use-all.js +1 -1
- package/dist/react-native/use-all.js.map +1 -1
- package/dist/react-native/use-one.d.ts +2 -0
- package/dist/react-native/use-one.d.ts.map +1 -0
- package/dist/react-native/use-one.js +2 -0
- package/dist/react-native/use-one.js.map +1 -0
- package/dist/reconcile-array.d.ts +45 -0
- package/dist/reconcile-array.d.ts.map +1 -0
- package/dist/reconcile-array.js +252 -0
- package/dist/reconcile-array.js.map +1 -0
- package/dist/relationships.d.ts +18 -0
- package/dist/relationships.d.ts.map +1 -0
- package/dist/relationships.js +28 -0
- package/dist/relationships.js.map +1 -0
- package/dist/runtime/auth-renewal-backoff.d.ts +14 -0
- package/dist/runtime/auth-renewal-backoff.d.ts.map +1 -0
- package/dist/runtime/auth-renewal-backoff.js +23 -0
- package/dist/runtime/auth-renewal-backoff.js.map +1 -0
- package/dist/runtime/auth-request-deadline.d.ts +3 -0
- package/dist/runtime/auth-request-deadline.d.ts.map +1 -0
- package/dist/runtime/auth-request-deadline.js +24 -0
- package/dist/runtime/auth-request-deadline.js.map +1 -0
- package/dist/runtime/auth-secret-codec.d.ts +21 -0
- package/dist/runtime/auth-secret-codec.d.ts.map +1 -0
- package/dist/runtime/auth-secret-codec.js +32 -0
- package/dist/runtime/auth-secret-codec.js.map +1 -0
- package/dist/runtime/auth-secret-store.d.ts +7 -0
- package/dist/runtime/auth-secret-store.d.ts.map +1 -0
- package/dist/runtime/auth-secret-store.js +12 -0
- package/dist/runtime/auth-secret-store.js.map +1 -0
- package/dist/runtime/auth-state.d.ts +47 -0
- package/dist/runtime/auth-state.d.ts.map +1 -0
- package/dist/runtime/auth-state.js +161 -0
- package/dist/runtime/auth-state.js.map +1 -0
- package/dist/runtime/author-id.d.ts +42 -0
- package/dist/runtime/author-id.d.ts.map +1 -0
- package/dist/runtime/author-id.js +172 -0
- package/dist/runtime/author-id.js.map +1 -0
- package/dist/runtime/authority-changed-error.d.ts +56 -0
- package/dist/runtime/authority-changed-error.d.ts.map +1 -0
- package/dist/runtime/authority-changed-error.js +74 -0
- package/dist/runtime/authority-changed-error.js.map +1 -0
- package/dist/runtime/backlog-rows.d.ts +3 -0
- package/dist/runtime/backlog-rows.d.ts.map +1 -0
- package/dist/runtime/backlog-rows.js +7 -0
- package/dist/runtime/backlog-rows.js.map +1 -0
- package/dist/runtime/browser-physical-database-epoch.d.ts +37 -0
- package/dist/runtime/browser-physical-database-epoch.d.ts.map +1 -0
- package/dist/runtime/browser-physical-database-epoch.js +89 -0
- package/dist/runtime/browser-physical-database-epoch.js.map +1 -0
- package/dist/runtime/browser-storage-invalidation.d.ts +8 -0
- package/dist/runtime/browser-storage-invalidation.d.ts.map +1 -0
- package/dist/runtime/browser-storage-invalidation.js +20 -0
- package/dist/runtime/browser-storage-invalidation.js.map +1 -0
- package/dist/runtime/browser-store-generation.d.ts +15 -0
- package/dist/runtime/browser-store-generation.d.ts.map +1 -0
- package/dist/runtime/browser-store-generation.js +48 -0
- package/dist/runtime/browser-store-generation.js.map +1 -0
- package/dist/runtime/browser-worker-assets.d.ts +31 -0
- package/dist/runtime/browser-worker-assets.d.ts.map +1 -0
- package/dist/runtime/browser-worker-assets.js +40 -0
- package/dist/runtime/browser-worker-assets.js.map +1 -0
- package/dist/runtime/browser-worker-assets.metro.d.ts +28 -0
- package/dist/runtime/browser-worker-assets.metro.d.ts.map +1 -0
- package/dist/runtime/browser-worker-assets.metro.js +52 -0
- package/dist/runtime/browser-worker-assets.metro.js.map +1 -0
- package/dist/runtime/browser-worker-assets.native.d.ts +7 -0
- package/dist/runtime/browser-worker-assets.native.d.ts.map +1 -0
- package/dist/runtime/browser-worker-assets.native.js +8 -0
- package/dist/runtime/browser-worker-assets.native.js.map +1 -0
- package/dist/runtime/browser-worker-config.d.ts +78 -0
- package/dist/runtime/browser-worker-config.d.ts.map +1 -0
- package/dist/runtime/browser-worker-config.js +299 -0
- package/dist/runtime/browser-worker-config.js.map +1 -0
- package/dist/runtime/client-config-key.d.ts +6 -0
- package/dist/runtime/client-config-key.d.ts.map +1 -0
- package/dist/runtime/client-config-key.js +83 -0
- package/dist/runtime/client-config-key.js.map +1 -0
- package/dist/runtime/client-migrations.d.ts +27 -0
- package/dist/runtime/client-migrations.d.ts.map +1 -0
- package/dist/runtime/client-migrations.js +25 -0
- package/dist/runtime/client-migrations.js.map +1 -0
- package/dist/runtime/client-registry.d.ts +21 -0
- package/dist/runtime/client-registry.d.ts.map +1 -0
- package/dist/runtime/client-registry.js +169 -0
- package/dist/runtime/client-registry.js.map +1 -0
- package/dist/runtime/client-scope.d.ts +38 -0
- package/dist/runtime/client-scope.d.ts.map +1 -0
- package/dist/runtime/client-scope.js +64 -0
- package/dist/runtime/client-scope.js.map +1 -0
- package/dist/runtime/client-session.d.ts +56 -14
- package/dist/runtime/client-session.d.ts.map +1 -1
- package/dist/runtime/client-session.js +211 -195
- package/dist/runtime/client-session.js.map +1 -1
- package/dist/runtime/client.d.ts +721 -194
- package/dist/runtime/client.d.ts.map +1 -1
- package/dist/runtime/client.js +1213 -434
- package/dist/runtime/client.js.map +1 -1
- package/dist/runtime/column-transforms.d.ts +26 -0
- package/dist/runtime/column-transforms.d.ts.map +1 -0
- package/dist/runtime/column-transforms.js +186 -0
- package/dist/runtime/column-transforms.js.map +1 -0
- package/dist/runtime/connection-manager/browser-connection-manager.d.ts +178 -0
- package/dist/runtime/connection-manager/browser-connection-manager.d.ts.map +1 -0
- package/dist/runtime/connection-manager/browser-connection-manager.js +1030 -0
- package/dist/runtime/connection-manager/browser-connection-manager.js.map +1 -0
- package/dist/runtime/connection-manager/direct-connection-manager.d.ts +28 -0
- package/dist/runtime/connection-manager/direct-connection-manager.d.ts.map +1 -0
- package/dist/runtime/connection-manager/direct-connection-manager.js +202 -0
- package/dist/runtime/connection-manager/direct-connection-manager.js.map +1 -0
- package/dist/runtime/connection-manager/index.d.ts +5 -0
- package/dist/runtime/connection-manager/index.d.ts.map +1 -0
- package/dist/runtime/connection-manager/index.js +4 -0
- package/dist/runtime/connection-manager/index.js.map +1 -0
- package/dist/runtime/connection-manager/types.d.ts +174 -0
- package/dist/runtime/connection-manager/types.d.ts.map +1 -0
- package/dist/runtime/connection-manager/types.js +396 -0
- package/dist/runtime/connection-manager/types.js.map +1 -0
- package/dist/runtime/context.d.ts +100 -30
- package/dist/runtime/context.d.ts.map +1 -1
- package/dist/runtime/context.js.map +1 -1
- package/dist/runtime/core-tick-failed-error.d.ts +31 -0
- package/dist/runtime/core-tick-failed-error.d.ts.map +1 -0
- package/dist/runtime/core-tick-failed-error.js +45 -0
- package/dist/runtime/core-tick-failed-error.js.map +1 -0
- package/dist/runtime/credentialed-transport.d.ts +42 -0
- package/dist/runtime/credentialed-transport.d.ts.map +1 -0
- package/dist/runtime/credentialed-transport.js +178 -0
- package/dist/runtime/credentialed-transport.js.map +1 -0
- package/dist/runtime/db-access-context.d.ts +14 -0
- package/dist/runtime/db-access-context.d.ts.map +1 -0
- package/dist/runtime/db-access-context.js +26 -0
- package/dist/runtime/db-access-context.js.map +1 -0
- package/dist/runtime/db-internal-session.d.ts +7 -0
- package/dist/runtime/db-internal-session.d.ts.map +1 -0
- package/dist/runtime/db-internal-session.js +21 -0
- package/dist/runtime/db-internal-session.js.map +1 -0
- package/dist/runtime/db-replaced-error.d.ts +21 -0
- package/dist/runtime/db-replaced-error.d.ts.map +1 -0
- package/dist/runtime/db-replaced-error.js +22 -0
- package/dist/runtime/db-replaced-error.js.map +1 -0
- package/dist/runtime/db.d.ts +857 -215
- package/dist/runtime/db.d.ts.map +1 -1
- package/dist/runtime/db.js +3474 -834
- package/dist/runtime/db.js.map +1 -1
- package/dist/runtime/default-create-db.d.ts +5 -0
- package/dist/runtime/default-create-db.d.ts.map +1 -0
- package/dist/runtime/default-create-db.js +7 -0
- package/dist/runtime/default-create-db.js.map +1 -0
- package/dist/runtime/default-runtime-source.d.ts +41 -0
- package/dist/runtime/default-runtime-source.d.ts.map +1 -0
- package/dist/runtime/default-runtime-source.js +326 -0
- package/dist/runtime/default-runtime-source.js.map +1 -0
- package/dist/runtime/delete-local-first-store.d.ts +12 -0
- package/dist/runtime/delete-local-first-store.d.ts.map +1 -0
- package/dist/runtime/delete-local-first-store.js +12 -0
- package/dist/runtime/delete-local-first-store.js.map +1 -0
- package/dist/runtime/deterministic-bytes.d.ts +6 -0
- package/dist/runtime/deterministic-bytes.d.ts.map +1 -0
- package/dist/runtime/deterministic-bytes.js +18 -0
- package/dist/runtime/deterministic-bytes.js.map +1 -0
- package/dist/runtime/graceful-shutdown-error.d.ts +17 -0
- package/dist/runtime/graceful-shutdown-error.d.ts.map +1 -0
- package/dist/runtime/graceful-shutdown-error.js +31 -0
- package/dist/runtime/graceful-shutdown-error.js.map +1 -0
- package/dist/runtime/hex.d.ts +21 -0
- package/dist/runtime/hex.d.ts.map +1 -0
- package/dist/runtime/hex.js +62 -0
- package/dist/runtime/hex.js.map +1 -0
- package/dist/runtime/history-relation.d.ts +8 -0
- package/dist/runtime/history-relation.d.ts.map +1 -0
- package/dist/runtime/history-relation.js +44 -0
- package/dist/runtime/history-relation.js.map +1 -0
- package/dist/runtime/in-process-transport.d.ts +18 -0
- package/dist/runtime/in-process-transport.d.ts.map +1 -0
- package/dist/runtime/in-process-transport.js +32 -0
- package/dist/runtime/in-process-transport.js.map +1 -0
- package/dist/runtime/index.d.ts +22 -13
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +14 -12
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/indexeddb-page-store.d.ts +214 -0
- package/dist/runtime/indexeddb-page-store.d.ts.map +1 -0
- package/dist/runtime/indexeddb-page-store.js +848 -0
- package/dist/runtime/indexeddb-page-store.js.map +1 -0
- package/dist/runtime/introspection-fetch.d.ts +18 -0
- package/dist/runtime/introspection-fetch.d.ts.map +1 -0
- package/dist/runtime/introspection-fetch.js +12 -0
- package/dist/runtime/introspection-fetch.js.map +1 -0
- package/dist/runtime/json-schema-evaluate.d.ts +55 -0
- package/dist/runtime/json-schema-evaluate.d.ts.map +1 -0
- package/dist/runtime/json-schema-evaluate.js +946 -0
- package/dist/runtime/json-schema-evaluate.js.map +1 -0
- package/dist/runtime/json-schema-formats.d.ts +14 -0
- package/dist/runtime/json-schema-formats.d.ts.map +1 -0
- package/dist/runtime/json-schema-formats.js +555 -0
- package/dist/runtime/json-schema-formats.js.map +1 -0
- package/dist/runtime/json-schema-json.d.ts +41 -0
- package/dist/runtime/json-schema-json.d.ts.map +1 -0
- package/dist/runtime/json-schema-json.js +309 -0
- package/dist/runtime/json-schema-json.js.map +1 -0
- package/dist/runtime/json-schema-metaschemas.d.ts +1403 -0
- package/dist/runtime/json-schema-metaschemas.d.ts.map +1 -0
- package/dist/runtime/json-schema-metaschemas.js +64 -0
- package/dist/runtime/json-schema-metaschemas.js.map +1 -0
- package/dist/runtime/json-schema-regex.d.ts +32 -0
- package/dist/runtime/json-schema-regex.d.ts.map +1 -0
- package/dist/runtime/json-schema-regex.js +895 -0
- package/dist/runtime/json-schema-regex.js.map +1 -0
- package/dist/runtime/json-schema-validator.d.ts +50 -0
- package/dist/runtime/json-schema-validator.d.ts.map +1 -0
- package/dist/runtime/json-schema-validator.js +404 -0
- package/dist/runtime/json-schema-validator.js.map +1 -0
- package/dist/runtime/json-text.js.map +1 -1
- package/dist/runtime/local-first-token.d.ts +11 -0
- package/dist/runtime/local-first-token.d.ts.map +1 -0
- package/dist/runtime/local-first-token.js +20 -0
- package/dist/runtime/local-first-token.js.map +1 -0
- package/dist/runtime/local-first-unavailable.d.ts +40 -0
- package/dist/runtime/local-first-unavailable.d.ts.map +1 -0
- package/dist/runtime/local-first-unavailable.js +81 -0
- package/dist/runtime/local-first-unavailable.js.map +1 -0
- package/dist/runtime/local-first-upgrade.d.ts +36 -0
- package/dist/runtime/local-first-upgrade.d.ts.map +1 -0
- package/dist/runtime/local-first-upgrade.js +31 -0
- package/dist/runtime/local-first-upgrade.js.map +1 -0
- package/dist/runtime/local-write-observer.d.ts +5 -0
- package/dist/runtime/local-write-observer.d.ts.map +1 -0
- package/dist/runtime/local-write-observer.js +31 -0
- package/dist/runtime/local-write-observer.js.map +1 -0
- package/dist/runtime/metro-setup-error.d.ts +20 -0
- package/dist/runtime/metro-setup-error.d.ts.map +1 -0
- package/dist/runtime/metro-setup-error.js +22 -0
- package/dist/runtime/metro-setup-error.js.map +1 -0
- package/dist/runtime/native-artifact-compatibility.d.ts +12 -0
- package/dist/runtime/native-artifact-compatibility.d.ts.map +1 -0
- package/dist/runtime/native-artifact-compatibility.js +26 -0
- package/dist/runtime/native-artifact-compatibility.js.map +1 -0
- package/dist/runtime/native-artifact-fingerprint-napi.d.ts +2 -0
- package/dist/runtime/native-artifact-fingerprint-napi.d.ts.map +1 -0
- package/dist/runtime/native-artifact-fingerprint-napi.js +3 -0
- package/dist/runtime/native-artifact-fingerprint-napi.js.map +1 -0
- package/dist/runtime/native-artifact-fingerprint-wasm.d.ts +2 -0
- package/dist/runtime/native-artifact-fingerprint-wasm.d.ts.map +1 -0
- package/dist/runtime/native-artifact-fingerprint-wasm.js +3 -0
- package/dist/runtime/native-artifact-fingerprint-wasm.js.map +1 -0
- package/dist/runtime/native-artifact-fingerprints.d.ts +5 -0
- package/dist/runtime/native-artifact-fingerprints.d.ts.map +1 -0
- package/dist/runtime/native-artifact-fingerprints.js +7 -0
- package/dist/runtime/native-artifact-fingerprints.js.map +1 -0
- package/dist/runtime/native-artifact-mismatch-error.d.ts +25 -0
- package/dist/runtime/native-artifact-mismatch-error.d.ts.map +1 -0
- package/dist/runtime/native-artifact-mismatch-error.js +34 -0
- package/dist/runtime/native-artifact-mismatch-error.js.map +1 -0
- package/dist/runtime/native-runtime/attached-browser-worker-connection.d.ts +23 -0
- package/dist/runtime/native-runtime/attached-browser-worker-connection.d.ts.map +1 -0
- package/dist/runtime/native-runtime/attached-browser-worker-connection.js +45 -0
- package/dist/runtime/native-runtime/attached-browser-worker-connection.js.map +1 -0
- package/dist/runtime/native-runtime/auxiliary-receive-deadline.d.ts +15 -0
- package/dist/runtime/native-runtime/auxiliary-receive-deadline.d.ts.map +1 -0
- package/dist/runtime/native-runtime/auxiliary-receive-deadline.js +64 -0
- package/dist/runtime/native-runtime/auxiliary-receive-deadline.js.map +1 -0
- package/dist/runtime/native-runtime/broker-worker-load-failure.d.ts +34 -0
- package/dist/runtime/native-runtime/broker-worker-load-failure.d.ts.map +1 -0
- package/dist/runtime/native-runtime/broker-worker-load-failure.js +61 -0
- package/dist/runtime/native-runtime/broker-worker-load-failure.js.map +1 -0
- package/dist/runtime/native-runtime/browser-follower-connection.d.ts +109 -0
- package/dist/runtime/native-runtime/browser-follower-connection.d.ts.map +1 -0
- package/dist/runtime/native-runtime/browser-follower-connection.js +558 -0
- package/dist/runtime/native-runtime/browser-follower-connection.js.map +1 -0
- package/dist/runtime/native-runtime/browser-shared-worker-connection.d.ts +130 -0
- package/dist/runtime/native-runtime/browser-shared-worker-connection.d.ts.map +1 -0
- package/dist/runtime/native-runtime/browser-shared-worker-connection.js +988 -0
- package/dist/runtime/native-runtime/browser-shared-worker-connection.js.map +1 -0
- package/dist/runtime/native-runtime/browser-worker-protocol.d.ts +527 -0
- package/dist/runtime/native-runtime/browser-worker-protocol.d.ts.map +1 -0
- package/dist/runtime/native-runtime/browser-worker-protocol.js +296 -0
- package/dist/runtime/native-runtime/browser-worker-protocol.js.map +1 -0
- package/dist/runtime/native-runtime/browser-worker-transport.d.ts +56 -0
- package/dist/runtime/native-runtime/browser-worker-transport.d.ts.map +1 -0
- package/dist/runtime/native-runtime/browser-worker-transport.js +305 -0
- package/dist/runtime/native-runtime/browser-worker-transport.js.map +1 -0
- package/dist/runtime/native-runtime/exact-integer.d.ts +7 -0
- package/dist/runtime/native-runtime/exact-integer.d.ts.map +1 -0
- package/dist/runtime/native-runtime/exact-integer.js +18 -0
- package/dist/runtime/native-runtime/exact-integer.js.map +1 -0
- package/dist/runtime/native-runtime/http-stream-socket.d.ts +103 -0
- package/dist/runtime/native-runtime/http-stream-socket.d.ts.map +1 -0
- package/dist/runtime/native-runtime/http-stream-socket.js +554 -0
- package/dist/runtime/native-runtime/http-stream-socket.js.map +1 -0
- package/dist/runtime/native-runtime/inspector-control-lifecycle.d.ts +4 -0
- package/dist/runtime/native-runtime/inspector-control-lifecycle.d.ts.map +1 -0
- package/dist/runtime/native-runtime/inspector-control-lifecycle.js +33 -0
- package/dist/runtime/native-runtime/inspector-control-lifecycle.js.map +1 -0
- package/dist/runtime/native-runtime/native-codec.d.ts +172 -0
- package/dist/runtime/native-runtime/native-codec.d.ts.map +1 -0
- package/dist/runtime/native-runtime/native-codec.js +629 -0
- package/dist/runtime/native-runtime/native-codec.js.map +1 -0
- package/dist/runtime/native-runtime/native-error-code.d.ts +39 -0
- package/dist/runtime/native-runtime/native-error-code.d.ts.map +1 -0
- package/dist/runtime/native-runtime/native-error-code.js +64 -0
- package/dist/runtime/native-runtime/native-error-code.js.map +1 -0
- package/dist/runtime/native-runtime/native-row-codec.d.ts +161 -0
- package/dist/runtime/native-runtime/native-row-codec.d.ts.map +1 -0
- package/dist/runtime/native-runtime/native-row-codec.js +903 -0
- package/dist/runtime/native-runtime/native-row-codec.js.map +1 -0
- package/dist/runtime/native-runtime/native-row-descriptor-key.d.ts +15 -0
- package/dist/runtime/native-runtime/native-row-descriptor-key.d.ts.map +1 -0
- package/dist/runtime/native-runtime/native-row-descriptor-key.js +25 -0
- package/dist/runtime/native-runtime/native-row-descriptor-key.js.map +1 -0
- package/dist/runtime/native-runtime/native-runtime-adapter.d.ts +913 -0
- package/dist/runtime/native-runtime/native-runtime-adapter.d.ts.map +1 -0
- package/dist/runtime/native-runtime/native-runtime-adapter.js +5999 -0
- package/dist/runtime/native-runtime/native-runtime-adapter.js.map +1 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.browser.d.ts +17 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.browser.d.ts.map +1 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.browser.js +4 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.browser.js.map +1 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.d.ts +19 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.d.ts.map +1 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.js +297 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.js.map +1 -0
- package/dist/runtime/native-runtime/row-values-transport.d.ts +2 -0
- package/dist/runtime/native-runtime/row-values-transport.d.ts.map +1 -0
- package/dist/runtime/native-runtime/row-values-transport.js +21 -0
- package/dist/runtime/native-runtime/row-values-transport.js.map +1 -0
- package/dist/runtime/native-runtime/schema-codec.d.ts +10 -0
- package/dist/runtime/native-runtime/schema-codec.d.ts.map +1 -0
- package/dist/runtime/native-runtime/schema-codec.js +13 -0
- package/dist/runtime/native-runtime/schema-codec.js.map +1 -0
- package/dist/runtime/native-runtime/session-renewal-wire.d.ts +48 -0
- package/dist/runtime/native-runtime/session-renewal-wire.d.ts.map +1 -0
- package/dist/runtime/native-runtime/session-renewal-wire.js +107 -0
- package/dist/runtime/native-runtime/session-renewal-wire.js.map +1 -0
- package/dist/runtime/native-runtime/stream-endpoint-memory.d.ts +34 -0
- package/dist/runtime/native-runtime/stream-endpoint-memory.d.ts.map +1 -0
- package/dist/runtime/native-runtime/stream-endpoint-memory.js +146 -0
- package/dist/runtime/native-runtime/stream-endpoint-memory.js.map +1 -0
- package/dist/runtime/native-runtime/websocket.d.ts +327 -0
- package/dist/runtime/native-runtime/websocket.d.ts.map +1 -0
- package/dist/runtime/native-runtime/websocket.js +1112 -0
- package/dist/runtime/native-runtime/websocket.js.map +1 -0
- package/dist/runtime/newer-build-reload.d.ts +30 -0
- package/dist/runtime/newer-build-reload.d.ts.map +1 -0
- package/dist/runtime/newer-build-reload.js +59 -0
- package/dist/runtime/newer-build-reload.js.map +1 -0
- package/dist/runtime/page-cache.d.ts +44 -0
- package/dist/runtime/page-cache.d.ts.map +1 -0
- package/dist/runtime/page-cache.js +104 -0
- package/dist/runtime/page-cache.js.map +1 -0
- package/dist/runtime/page-handle.d.ts +83 -0
- package/dist/runtime/page-handle.d.ts.map +1 -0
- package/dist/runtime/page-handle.js +151 -0
- package/dist/runtime/page-handle.js.map +1 -0
- package/dist/runtime/passkey-backup.d.ts +3 -0
- package/dist/runtime/passkey-backup.d.ts.map +1 -0
- package/dist/runtime/passkey-backup.js +2 -0
- package/dist/runtime/passkey-backup.js.map +1 -0
- package/dist/runtime/platform-url.d.ts +10 -0
- package/dist/runtime/platform-url.d.ts.map +1 -0
- package/dist/runtime/platform-url.js +3 -0
- package/dist/runtime/platform-url.js.map +1 -0
- package/dist/runtime/platform-url.native.d.ts +6 -0
- package/dist/runtime/platform-url.native.d.ts.map +1 -0
- package/dist/runtime/platform-url.native.js +38 -0
- package/dist/runtime/platform-url.native.js.map +1 -0
- package/dist/runtime/query-adapter.d.ts +7 -15
- package/dist/runtime/query-adapter.d.ts.map +1 -1
- package/dist/runtime/query-adapter.js +390 -110
- package/dist/runtime/query-adapter.js.map +1 -1
- package/dist/runtime/query-builder-shape.d.ts +75 -0
- package/dist/runtime/query-builder-shape.d.ts.map +1 -0
- package/dist/runtime/query-builder-shape.js +225 -0
- package/dist/runtime/query-builder-shape.js.map +1 -0
- package/dist/runtime/query-column-name.d.ts +3 -0
- package/dist/runtime/query-column-name.d.ts.map +1 -0
- package/dist/runtime/query-column-name.js +10 -0
- package/dist/runtime/query-column-name.js.map +1 -0
- package/dist/runtime/query-output-table.d.ts +5 -0
- package/dist/runtime/query-output-table.d.ts.map +1 -0
- package/dist/runtime/query-output-table.js +30 -0
- package/dist/runtime/query-output-table.js.map +1 -0
- package/dist/runtime/recovery-phrase.d.ts +3 -0
- package/dist/runtime/recovery-phrase.d.ts.map +1 -0
- package/dist/runtime/recovery-phrase.js +2 -0
- package/dist/runtime/recovery-phrase.js.map +1 -0
- package/dist/runtime/remote-link-state.d.ts +20 -0
- package/dist/runtime/remote-link-state.d.ts.map +1 -0
- package/dist/runtime/remote-link-state.js +5 -0
- package/dist/runtime/remote-link-state.js.map +1 -0
- package/dist/runtime/removed-provider-props.d.ts +17 -0
- package/dist/runtime/removed-provider-props.d.ts.map +1 -0
- package/dist/runtime/removed-provider-props.js +16 -0
- package/dist/runtime/removed-provider-props.js.map +1 -0
- package/dist/runtime/row-transformer.d.ts +17 -3
- package/dist/runtime/row-transformer.d.ts.map +1 -1
- package/dist/runtime/row-transformer.js +163 -38
- package/dist/runtime/row-transformer.js.map +1 -1
- package/dist/runtime/run-cleanup-steps.d.ts +5 -0
- package/dist/runtime/run-cleanup-steps.d.ts.map +1 -0
- package/dist/runtime/run-cleanup-steps.js +19 -0
- package/dist/runtime/run-cleanup-steps.js.map +1 -0
- package/dist/runtime/runtime-closed-error.d.ts +9 -0
- package/dist/runtime/runtime-closed-error.d.ts.map +1 -0
- package/dist/runtime/runtime-closed-error.js +12 -0
- package/dist/runtime/runtime-closed-error.js.map +1 -0
- package/dist/runtime/runtime-config.d.ts +13 -0
- package/dist/runtime/runtime-config.d.ts.map +1 -0
- package/dist/runtime/runtime-config.js +115 -0
- package/dist/runtime/runtime-config.js.map +1 -0
- package/dist/runtime/runtime-entropy.d.ts +14 -0
- package/dist/runtime/runtime-entropy.d.ts.map +1 -0
- package/dist/runtime/runtime-entropy.js +43 -0
- package/dist/runtime/runtime-entropy.js.map +1 -0
- package/dist/runtime/runtime-source.d.ts +206 -0
- package/dist/runtime/runtime-source.d.ts.map +1 -0
- package/dist/runtime/runtime-source.js +64 -0
- package/dist/runtime/runtime-source.js.map +1 -0
- package/dist/runtime/schema-metadata.d.ts +22 -0
- package/dist/runtime/schema-metadata.d.ts.map +1 -0
- package/dist/runtime/schema-metadata.js +70 -0
- package/dist/runtime/schema-metadata.js.map +1 -0
- package/dist/runtime/select-projection.d.ts +5 -0
- package/dist/runtime/select-projection.d.ts.map +1 -0
- package/dist/runtime/select-projection.js +47 -0
- package/dist/runtime/select-projection.js.map +1 -0
- package/dist/runtime/snapshot-ref.d.ts +24 -0
- package/dist/runtime/snapshot-ref.d.ts.map +1 -0
- package/dist/runtime/snapshot-ref.js +43 -0
- package/dist/runtime/snapshot-ref.js.map +1 -0
- package/dist/runtime/store-held-by-another-tab-error.d.ts +53 -0
- package/dist/runtime/store-held-by-another-tab-error.d.ts.map +1 -0
- package/dist/runtime/store-held-by-another-tab-error.js +55 -0
- package/dist/runtime/store-held-by-another-tab-error.js.map +1 -0
- package/dist/runtime/streaming-source.d.ts +4 -0
- package/dist/runtime/streaming-source.d.ts.map +1 -0
- package/dist/runtime/streaming-source.js +53 -0
- package/dist/runtime/streaming-source.js.map +1 -0
- package/dist/runtime/structural-values.d.ts +6 -0
- package/dist/runtime/structural-values.d.ts.map +1 -0
- package/dist/runtime/structural-values.js +51 -0
- package/dist/runtime/structural-values.js.map +1 -0
- package/dist/runtime/subscription-manager.d.ts +103 -14
- package/dist/runtime/subscription-manager.d.ts.map +1 -1
- package/dist/runtime/subscription-manager.js +1051 -25
- package/dist/runtime/subscription-manager.js.map +1 -1
- package/dist/runtime/sync-status.d.ts +178 -0
- package/dist/runtime/sync-status.d.ts.map +1 -0
- package/dist/runtime/sync-status.js +163 -0
- package/dist/runtime/sync-status.js.map +1 -0
- package/dist/runtime/sync-telemetry.d.ts +35 -0
- package/dist/runtime/sync-telemetry.d.ts.map +1 -0
- package/dist/runtime/sync-telemetry.js +354 -0
- package/dist/runtime/sync-telemetry.js.map +1 -0
- package/dist/runtime/system-identity.d.ts +5 -0
- package/dist/runtime/system-identity.d.ts.map +1 -0
- package/dist/runtime/system-identity.js +10 -0
- package/dist/runtime/system-identity.js.map +1 -0
- package/dist/runtime/telemetry-env.d.ts +2 -0
- package/dist/runtime/telemetry-env.d.ts.map +1 -0
- package/dist/runtime/telemetry-env.js +16 -0
- package/dist/runtime/telemetry-env.js.map +1 -0
- package/dist/runtime/telemetry-env.native.d.ts +3 -0
- package/dist/runtime/telemetry-env.native.d.ts.map +1 -0
- package/dist/runtime/telemetry-env.native.js +7 -0
- package/dist/runtime/telemetry-env.native.js.map +1 -0
- package/dist/runtime/text-anchors.d.ts +58 -0
- package/dist/runtime/text-anchors.d.ts.map +1 -0
- package/dist/runtime/text-anchors.js +9 -0
- package/dist/runtime/text-anchors.js.map +1 -0
- package/dist/runtime/unsupported-storage-codecs-error.d.ts +53 -0
- package/dist/runtime/unsupported-storage-codecs-error.d.ts.map +1 -0
- package/dist/runtime/unsupported-storage-codecs-error.js +74 -0
- package/dist/runtime/unsupported-storage-codecs-error.js.map +1 -0
- package/dist/runtime/url.d.ts +32 -0
- package/dist/runtime/url.d.ts.map +1 -0
- package/dist/runtime/url.js +96 -0
- package/dist/runtime/url.js.map +1 -0
- package/dist/runtime/utf8.d.ts +10 -0
- package/dist/runtime/utf8.d.ts.map +1 -0
- package/dist/runtime/utf8.js +93 -0
- package/dist/runtime/utf8.js.map +1 -0
- package/dist/runtime/util.d.ts +18 -0
- package/dist/runtime/util.d.ts.map +1 -0
- package/dist/runtime/util.js +59 -0
- package/dist/runtime/util.js.map +1 -0
- package/dist/runtime/value-converter.d.ts +9 -17
- package/dist/runtime/value-converter.d.ts.map +1 -1
- package/dist/runtime/value-converter.js +156 -42
- package/dist/runtime/value-converter.js.map +1 -1
- package/dist/runtime/wasm-loader.d.ts +6 -0
- package/dist/runtime/wasm-loader.d.ts.map +1 -0
- package/dist/runtime/wasm-loader.js +127 -0
- package/dist/runtime/wasm-loader.js.map +1 -0
- package/dist/runtime/write-preparation.d.ts +24 -0
- package/dist/runtime/write-preparation.d.ts.map +1 -0
- package/dist/runtime/write-preparation.js +63 -0
- package/dist/runtime/write-preparation.js.map +1 -0
- package/dist/runtime/write-row.d.ts +8 -0
- package/dist/runtime/write-row.d.ts.map +1 -0
- package/dist/runtime/write-row.js +17 -0
- package/dist/runtime/write-row.js.map +1 -0
- package/dist/schema-builders.d.ts +48 -0
- package/dist/schema-builders.d.ts.map +1 -0
- package/dist/schema-builders.js +26 -0
- package/dist/schema-builders.js.map +1 -0
- package/dist/schema-dsl/define-schema.d.ts +32 -0
- package/dist/schema-dsl/define-schema.d.ts.map +1 -0
- package/dist/schema-dsl/define-schema.js +80 -0
- package/dist/schema-dsl/define-schema.js.map +1 -0
- package/dist/schema-dsl/readable-app.d.ts +30 -0
- package/dist/schema-dsl/readable-app.d.ts.map +1 -0
- package/dist/schema-dsl/readable-app.js +139 -0
- package/dist/schema-dsl/readable-app.js.map +1 -0
- package/dist/schema-dsl/table.d.ts +101 -0
- package/dist/schema-dsl/table.d.ts.map +1 -0
- package/dist/schema-dsl/table.js +153 -0
- package/dist/schema-dsl/table.js.map +1 -0
- package/dist/schema-errors.d.ts +6 -0
- package/dist/schema-errors.d.ts.map +1 -0
- package/dist/schema-errors.js +6 -0
- package/dist/schema-errors.js.map +1 -0
- package/dist/schema-loader.d.ts +16 -0
- package/dist/schema-loader.d.ts.map +1 -0
- package/dist/schema-loader.js +108 -0
- package/dist/schema-loader.js.map +1 -0
- package/dist/schema-name.d.ts +2 -0
- package/dist/schema-name.d.ts.map +1 -0
- package/dist/schema-name.js +19 -0
- package/dist/schema-name.js.map +1 -0
- package/dist/schema-namespace.d.ts +7 -0
- package/dist/schema-namespace.d.ts.map +1 -0
- package/dist/schema-namespace.js +7 -0
- package/dist/schema-namespace.js.map +1 -0
- package/dist/schema-permissions.d.ts +12 -0
- package/dist/schema-permissions.d.ts.map +1 -0
- package/dist/schema-permissions.js +17 -0
- package/dist/schema-permissions.js.map +1 -0
- package/dist/schema-source.d.ts +11 -0
- package/dist/schema-source.d.ts.map +1 -0
- package/dist/schema-source.js +53 -0
- package/dist/schema-source.js.map +1 -0
- package/dist/schema.d.ts +95 -38
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +1 -16
- package/dist/schema.js.map +1 -1
- package/dist/session/backend-watch.d.ts +186 -0
- package/dist/session/backend-watch.d.ts.map +1 -0
- package/dist/session/backend-watch.js +698 -0
- package/dist/session/backend-watch.js.map +1 -0
- package/dist/session/config-options.d.ts +15 -0
- package/dist/session/config-options.d.ts.map +1 -0
- package/dist/session/config-options.js +55 -0
- package/dist/session/config-options.js.map +1 -0
- package/dist/session/consumer.d.ts +3 -0
- package/dist/session/consumer.d.ts.map +1 -0
- package/dist/session/consumer.js +3 -0
- package/dist/session/consumer.js.map +1 -0
- package/dist/session/create-jazz-session.d.ts +123 -0
- package/dist/session/create-jazz-session.d.ts.map +1 -0
- package/dist/session/create-jazz-session.js +542 -0
- package/dist/session/create-jazz-session.js.map +1 -0
- package/dist/session/follow-user.d.ts +72 -0
- package/dist/session/follow-user.d.ts.map +1 -0
- package/dist/session/follow-user.js +147 -0
- package/dist/session/follow-user.js.map +1 -0
- package/dist/session/jazz-session.d.ts +234 -0
- package/dist/session/jazz-session.d.ts.map +1 -0
- package/dist/session/jazz-session.js +528 -0
- package/dist/session/jazz-session.js.map +1 -0
- package/dist/session/native-backend-watch.d.ts +4 -0
- package/dist/session/native-backend-watch.d.ts.map +1 -0
- package/dist/session/native-backend-watch.js +14 -0
- package/dist/session/native-backend-watch.js.map +1 -0
- package/dist/session/no-kept-device-account-error.d.ts +6 -0
- package/dist/session/no-kept-device-account-error.d.ts.map +1 -0
- package/dist/session/no-kept-device-account-error.js +8 -0
- package/dist/session/no-kept-device-account-error.js.map +1 -0
- package/dist/session/replica-ledger.d.ts +164 -0
- package/dist/session/replica-ledger.d.ts.map +1 -0
- package/dist/session/replica-ledger.js +496 -0
- package/dist/session/replica-ledger.js.map +1 -0
- package/dist/session/state.d.ts +135 -0
- package/dist/session/state.d.ts.map +1 -0
- package/dist/session/state.js +535 -0
- package/dist/session/state.js.map +1 -0
- package/dist/shared/index.d.ts +20 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +17 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/solid/create-solid-jazz-client-internal.d.ts +13 -0
- package/dist/solid/create-solid-jazz-client-internal.d.ts.map +1 -0
- package/dist/solid/create-solid-jazz-client-internal.js +82 -0
- package/dist/solid/create-solid-jazz-client-internal.js.map +1 -0
- package/dist/solid/create-solid-jazz-client-internal.ssr.js +101 -0
- package/dist/solid/create-solid-jazz-client-internal.ssr.js.map +1 -0
- package/dist/solid/create-solid-jazz-client.d.ts +24 -0
- package/dist/solid/create-solid-jazz-client.d.ts.map +1 -0
- package/dist/solid/create-solid-jazz-client.js +42 -0
- package/dist/solid/create-solid-jazz-client.js.map +1 -0
- package/dist/solid/create-solid-jazz-client.ssr.js +45 -0
- package/dist/solid/create-solid-jazz-client.ssr.js.map +1 -0
- package/dist/solid/index.d.ts +13 -0
- package/dist/solid/index.d.ts.map +1 -0
- package/dist/solid/index.js +9 -0
- package/dist/solid/index.ssr.js +9 -0
- package/dist/solid/provider.d.ts +25 -0
- package/dist/solid/provider.d.ts.map +1 -0
- package/dist/solid/provider.js +48 -0
- package/dist/solid/provider.js.map +1 -0
- package/dist/solid/provider.ssr.js +48 -0
- package/dist/solid/provider.ssr.js.map +1 -0
- package/dist/solid/session-context.d.ts +14 -0
- package/dist/solid/session-context.d.ts.map +1 -0
- package/dist/solid/session-context.js +6 -0
- package/dist/solid/session-context.js.map +1 -0
- package/dist/solid/session-context.ssr.js +10 -0
- package/dist/solid/session-context.ssr.js.map +1 -0
- package/dist/solid/session.d.ts +55 -0
- package/dist/solid/session.d.ts.map +1 -0
- package/dist/solid/session.js +130 -0
- package/dist/solid/session.js.map +1 -0
- package/dist/solid/session.ssr.js +156 -0
- package/dist/solid/session.ssr.js.map +1 -0
- package/dist/solid/solid-jazz-client-store.d.ts +11 -0
- package/dist/solid/solid-jazz-client-store.d.ts.map +1 -0
- package/dist/solid/solid-jazz-client-store.js +38 -0
- package/dist/solid/solid-jazz-client-store.js.map +1 -0
- package/dist/solid/solid-jazz-client-store.ssr.js +39 -0
- package/dist/solid/solid-jazz-client-store.ssr.js.map +1 -0
- package/dist/solid/use-all.d.ts +18 -0
- package/dist/solid/use-all.d.ts.map +1 -0
- package/dist/solid/use-all.js +71 -0
- package/dist/solid/use-all.js.map +1 -0
- package/dist/solid/use-all.ssr.js +84 -0
- package/dist/solid/use-all.ssr.js.map +1 -0
- package/dist/solid/use-one.d.ts +18 -0
- package/dist/solid/use-one.d.ts.map +1 -0
- package/dist/solid/use-one.js +27 -0
- package/dist/solid/use-one.js.map +1 -0
- package/dist/solid/use-one.ssr.js +27 -0
- package/dist/solid/use-one.ssr.js.map +1 -0
- package/dist/solid/use-sync-status.d.ts +8 -0
- package/dist/solid/use-sync-status.d.ts.map +1 -0
- package/dist/solid/use-sync-status.js +13 -0
- package/dist/solid/use-sync-status.js.map +1 -0
- package/dist/solid/use-sync-status.ssr.js +20 -0
- package/dist/solid/use-sync-status.ssr.js.map +1 -0
- package/dist/subscription-store-internal.d.ts +11 -0
- package/dist/subscription-store-internal.d.ts.map +1 -0
- package/dist/subscription-store-internal.js +18 -0
- package/dist/subscription-store-internal.js.map +1 -0
- package/dist/subscriptions-orchestrator.d.ts +92 -14
- package/dist/subscriptions-orchestrator.d.ts.map +1 -1
- package/dist/subscriptions-orchestrator.js +390 -75
- package/dist/subscriptions-orchestrator.js.map +1 -1
- package/dist/svelte/JazzProvider.svelte +110 -0
- package/dist/svelte/JazzProvider.svelte.d.ts +24 -0
- package/dist/svelte/JazzProvider.svelte.d.ts.map +1 -0
- package/dist/svelte/JazzSvelteClientProvider.svelte +83 -0
- package/dist/svelte/JazzSvelteClientProvider.svelte.d.ts +15 -0
- package/dist/svelte/JazzSvelteClientProvider.svelte.d.ts.map +1 -0
- package/dist/svelte/context.svelte.d.ts +19 -3
- package/dist/svelte/context.svelte.d.ts.map +1 -1
- package/dist/svelte/context.svelte.js +21 -5
- package/dist/svelte/create-jazz-client.d.ts +2 -8
- package/dist/svelte/create-jazz-client.d.ts.map +1 -1
- package/dist/svelte/create-jazz-client.js +1 -17
- package/dist/svelte/index.d.ts +14 -7
- package/dist/svelte/index.d.ts.map +1 -1
- package/dist/svelte/index.js +10 -7
- package/dist/svelte/query-subscription.svelte.d.ts +60 -0
- package/dist/svelte/query-subscription.svelte.d.ts.map +1 -0
- package/dist/svelte/query-subscription.svelte.js +135 -0
- package/dist/svelte/session-state.d.ts +27 -0
- package/dist/svelte/session-state.d.ts.map +1 -0
- package/dist/svelte/session-state.js +49 -0
- package/dist/svelte/sync-status.d.ts +11 -0
- package/dist/svelte/sync-status.d.ts.map +1 -0
- package/dist/svelte/sync-status.js +15 -0
- package/dist/testing/fixtures/with-bigint/schema.d.ts +18 -0
- package/dist/testing/fixtures/with-bigint/schema.d.ts.map +1 -0
- package/dist/testing/fixtures/with-bigint/schema.js +15 -0
- package/dist/testing/fixtures/with-bigint/schema.js.map +1 -0
- package/dist/testing/index.d.ts +6 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +5 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/policy-test-app.d.ts +129 -0
- package/dist/testing/policy-test-app.d.ts.map +1 -0
- package/dist/testing/policy-test-app.js +229 -0
- package/dist/testing/policy-test-app.js.map +1 -0
- package/dist/testing/test-app.d.ts +272 -0
- package/dist/testing/test-app.d.ts.map +1 -0
- package/dist/testing/test-app.js +62 -0
- package/dist/testing/test-app.js.map +1 -0
- package/dist/testing/test-jazz.d.ts +119 -0
- package/dist/testing/test-jazz.d.ts.map +1 -0
- package/dist/testing/test-jazz.js +162 -0
- package/dist/testing/test-jazz.js.map +1 -0
- package/dist/testing/test-jwt-issuer.d.ts +19 -0
- package/dist/testing/test-jwt-issuer.d.ts.map +1 -0
- package/dist/testing/test-jwt-issuer.js +40 -0
- package/dist/testing/test-jwt-issuer.js.map +1 -0
- package/dist/text-field/index.d.ts +40 -0
- package/dist/text-field/index.d.ts.map +1 -0
- package/dist/text-field/index.js +129 -0
- package/dist/text-field/index.js.map +1 -0
- package/dist/thin/index.d.ts +80 -0
- package/dist/thin/index.d.ts.map +1 -0
- package/dist/thin/index.js +219 -0
- package/dist/thin/index.js.map +1 -0
- package/dist/thin/self-signed-token.d.ts +13 -0
- package/dist/thin/self-signed-token.d.ts.map +1 -0
- package/dist/thin/self-signed-token.js +100 -0
- package/dist/thin/self-signed-token.js.map +1 -0
- package/dist/thin/thin-runtime-source.d.ts +19 -0
- package/dist/thin/thin-runtime-source.d.ts.map +1 -0
- package/dist/thin/thin-runtime-source.js +66 -0
- package/dist/thin/thin-runtime-source.js.map +1 -0
- package/dist/thin/thin-runtime.d.ts +294 -0
- package/dist/thin/thin-runtime.d.ts.map +1 -0
- package/dist/thin/thin-runtime.js +1492 -0
- package/dist/thin/thin-runtime.js.map +1 -0
- package/dist/thin/wire.d.ts +160 -0
- package/dist/thin/wire.d.ts.map +1 -0
- package/dist/thin/wire.js +304 -0
- package/dist/thin/wire.js.map +1 -0
- package/dist/typed-app.d.ts +644 -0
- package/dist/typed-app.d.ts.map +1 -0
- package/dist/typed-app.js +549 -0
- package/dist/typed-app.js.map +1 -0
- package/dist/vue/create-jazz-client.d.ts +3 -0
- package/dist/vue/create-jazz-client.d.ts.map +1 -0
- package/dist/vue/create-jazz-client.js +2 -0
- package/dist/vue/create-jazz-client.js.map +1 -0
- package/dist/vue/index.d.ts +13 -0
- package/dist/vue/index.d.ts.map +1 -0
- package/dist/vue/index.js +9 -0
- package/dist/vue/index.js.map +1 -0
- package/dist/vue/provider.d.ts +50 -0
- package/dist/vue/provider.d.ts.map +1 -0
- package/dist/vue/provider.js +97 -0
- package/dist/vue/provider.js.map +1 -0
- package/dist/vue/session-key.d.ts +15 -0
- package/dist/vue/session-key.d.ts.map +1 -0
- package/dist/vue/session-key.js +7 -0
- package/dist/vue/session-key.js.map +1 -0
- package/dist/vue/session.d.ts +40 -0
- package/dist/vue/session.d.ts.map +1 -0
- package/dist/vue/session.js +112 -0
- package/dist/vue/session.js.map +1 -0
- package/dist/vue/use-all.d.ts +61 -0
- package/dist/vue/use-all.d.ts.map +1 -0
- package/dist/vue/use-all.js +104 -0
- package/dist/vue/use-all.js.map +1 -0
- package/dist/vue/use-one.d.ts +24 -0
- package/dist/vue/use-one.d.ts.map +1 -0
- package/dist/vue/use-one.js +17 -0
- package/dist/vue/use-one.js.map +1 -0
- package/dist/vue/use-sync-status.d.ts +9 -0
- package/dist/vue/use-sync-status.d.ts.map +1 -0
- package/dist/vue/use-sync-status.js +16 -0
- package/dist/vue/use-sync-status.js.map +1 -0
- package/dist/web/create-jazz-client.d.ts +12 -0
- package/dist/web/create-jazz-client.d.ts.map +1 -0
- package/dist/web/create-jazz-client.js +35 -0
- package/dist/web/create-jazz-client.js.map +1 -0
- package/dist/web/lazy-local-first.d.ts +5 -0
- package/dist/web/lazy-local-first.d.ts.map +1 -0
- package/dist/web/lazy-local-first.js +8 -0
- package/dist/web/lazy-local-first.js.map +1 -0
- package/dist/web/registered-jazz-client.d.ts +15 -0
- package/dist/web/registered-jazz-client.d.ts.map +1 -0
- package/dist/web/registered-jazz-client.js +35 -0
- package/dist/web/registered-jazz-client.js.map +1 -0
- package/dist/where-operators.d.ts +13 -0
- package/dist/where-operators.d.ts.map +1 -0
- package/dist/where-operators.js +66 -0
- package/dist/where-operators.js.map +1 -0
- package/dist/window-client-storage.d.ts +7 -0
- package/dist/window-client-storage.d.ts.map +1 -0
- package/dist/window-client-storage.js +27 -0
- package/dist/window-client-storage.js.map +1 -0
- package/dist/worker/jazz-broker-worker-core.d.ts +34 -0
- package/dist/worker/jazz-broker-worker-core.d.ts.map +1 -0
- package/dist/worker/jazz-broker-worker-core.js +2241 -0
- package/dist/worker/jazz-broker-worker-core.js.map +1 -0
- package/dist/worker/jazz-broker-worker.d.ts +3 -0
- package/dist/worker/jazz-broker-worker.d.ts.map +1 -0
- package/dist/worker/jazz-broker-worker.js +5 -0
- package/dist/worker/jazz_wasm_bg.wasm +0 -0
- package/dist/worker/mutation-error-delivery.d.ts +8 -0
- package/dist/worker/mutation-error-delivery.d.ts.map +1 -0
- package/dist/worker/mutation-error-delivery.js +10 -0
- package/dist/worker/mutation-error-delivery.js.map +1 -0
- package/dist/worker/runtime-admission.d.ts +34 -0
- package/dist/worker/runtime-admission.d.ts.map +1 -0
- package/dist/worker/runtime-admission.js +60 -0
- package/dist/worker/runtime-admission.js.map +1 -0
- package/dist/worker/vite-dev-broker.d.ts +2 -0
- package/dist/worker/vite-dev-broker.d.ts.map +1 -0
- package/dist/worker/vite-dev-broker.js +8 -0
- package/dist/worker/vite-dev-broker.js.map +1 -0
- package/package.json +299 -37
- package/bin/native/.gitkeep +0 -0
- package/bin/native/jazz-tools-darwin-arm64 +0 -0
- package/bin/native/jazz-tools-darwin-x64 +0 -0
- package/bin/native/jazz-tools-linux-arm64 +0 -0
- package/bin/native/jazz-tools-linux-x64 +0 -0
- package/bin/native/jazz-tools-windows-x64.exe +0 -0
- package/dist/backend/create-jazz-context.test.d.ts +0 -2
- package/dist/backend/create-jazz-context.test.d.ts.map +0 -1
- package/dist/backend/create-jazz-context.test.js +0 -141
- package/dist/backend/create-jazz-context.test.js.map +0 -1
- package/dist/cli.test.d.ts +0 -2
- package/dist/cli.test.d.ts.map +0 -1
- package/dist/cli.test.js +0 -154
- package/dist/cli.test.js.map +0 -1
- package/dist/codegen/codegen.test.d.ts +0 -2
- package/dist/codegen/codegen.test.d.ts.map +0 -1
- package/dist/codegen/codegen.test.js +0 -914
- package/dist/codegen/codegen.test.js.map +0 -1
- package/dist/codegen/index.d.ts +0 -18
- package/dist/codegen/index.d.ts.map +0 -1
- package/dist/codegen/index.js +0 -22
- package/dist/codegen/index.js.map +0 -1
- package/dist/codegen/query-builder-generator.d.ts +0 -26
- package/dist/codegen/query-builder-generator.d.ts.map +0 -1
- package/dist/codegen/query-builder-generator.js +0 -342
- package/dist/codegen/query-builder-generator.js.map +0 -1
- package/dist/codegen/schema-reader.d.ts +0 -12
- package/dist/codegen/schema-reader.d.ts.map +0 -1
- package/dist/codegen/schema-reader.js +0 -180
- package/dist/codegen/schema-reader.js.map +0 -1
- package/dist/codegen/type-generator.d.ts +0 -29
- package/dist/codegen/type-generator.d.ts.map +0 -1
- package/dist/codegen/type-generator.js +0 -296
- package/dist/codegen/type-generator.js.map +0 -1
- package/dist/dev-tools/dev-tools.d.ts +0 -15
- package/dist/dev-tools/dev-tools.d.ts.map +0 -1
- package/dist/dev-tools/dev-tools.js +0 -297
- package/dist/dev-tools/dev-tools.js.map +0 -1
- package/dist/dev-tools/extension-panel.d.ts +0 -19
- package/dist/dev-tools/extension-panel.d.ts.map +0 -1
- package/dist/dev-tools/extension-panel.js +0 -419
- package/dist/dev-tools/extension-panel.js.map +0 -1
- package/dist/dev-tools/index.d.ts +0 -3
- package/dist/dev-tools/index.d.ts.map +0 -1
- package/dist/dev-tools/index.js +0 -3
- package/dist/dev-tools/index.js.map +0 -1
- package/dist/dev-tools/protocol.d.ts +0 -49
- package/dist/dev-tools/protocol.d.ts.map +0 -1
- package/dist/dev-tools/protocol.js +0 -40
- package/dist/dev-tools/protocol.js.map +0 -1
- package/dist/dsl.test.d.ts +0 -2
- package/dist/dsl.test.d.ts.map +0 -1
- package/dist/dsl.test.js +0 -51
- package/dist/dsl.test.js.map +0 -1
- package/dist/permissions/index.d.ts +0 -146
- package/dist/permissions/index.d.ts.map +0 -1
- package/dist/permissions/index.js +0 -1211
- package/dist/permissions/index.js.map +0 -1
- package/dist/permissions/index.test.d.ts +0 -2
- package/dist/permissions/index.test.d.ts.map +0 -1
- package/dist/permissions/index.test.js +0 -830
- package/dist/permissions/index.test.js.map +0 -1
- package/dist/permissions/type-inference.test.d.ts +0 -2
- package/dist/permissions/type-inference.test.d.ts.map +0 -1
- package/dist/permissions/type-inference.test.js +0 -149
- package/dist/permissions/type-inference.test.js.map +0 -1
- package/dist/react/create-jazz-client.integration.test.d.ts +0 -2
- package/dist/react/create-jazz-client.integration.test.d.ts.map +0 -1
- package/dist/react/create-jazz-client.integration.test.js +0 -82
- package/dist/react/create-jazz-client.integration.test.js.map +0 -1
- package/dist/react/create-jazz-client.test.d.ts +0 -2
- package/dist/react/create-jazz-client.test.d.ts.map +0 -1
- package/dist/react/create-jazz-client.test.js +0 -135
- package/dist/react/create-jazz-client.test.js.map +0 -1
- package/dist/react/synthetic-user-switcher.d.ts +0 -9
- package/dist/react/synthetic-user-switcher.d.ts.map +0 -1
- package/dist/react/synthetic-user-switcher.js +0 -65
- package/dist/react/synthetic-user-switcher.js.map +0 -1
- package/dist/react/synthetic-users.d.ts +0 -2
- package/dist/react/synthetic-users.d.ts.map +0 -1
- package/dist/react/synthetic-users.js +0 -2
- package/dist/react/synthetic-users.js.map +0 -1
- package/dist/react/synthetic-users.test.d.ts +0 -2
- package/dist/react/synthetic-users.test.d.ts.map +0 -1
- package/dist/react/synthetic-users.test.js +0 -43
- package/dist/react/synthetic-users.test.js.map +0 -1
- package/dist/react/use-link-external-identity.d.ts +0 -25
- package/dist/react/use-link-external-identity.d.ts.map +0 -1
- package/dist/react/use-link-external-identity.js +0 -45
- package/dist/react/use-link-external-identity.js.map +0 -1
- package/dist/react-native/create-jazz-client.test.d.ts +0 -2
- package/dist/react-native/create-jazz-client.test.d.ts.map +0 -1
- package/dist/react-native/create-jazz-client.test.js +0 -162
- package/dist/react-native/create-jazz-client.test.js.map +0 -1
- package/dist/react-native/create-jazz-rn-runtime.d.ts +0 -13
- package/dist/react-native/create-jazz-rn-runtime.d.ts.map +0 -1
- package/dist/react-native/create-jazz-rn-runtime.js +0 -7
- package/dist/react-native/create-jazz-rn-runtime.js.map +0 -1
- package/dist/react-native/db.d.ts +0 -16
- package/dist/react-native/db.d.ts.map +0 -1
- package/dist/react-native/db.js +0 -50
- package/dist/react-native/db.js.map +0 -1
- package/dist/react-native/db.test.d.ts +0 -2
- package/dist/react-native/db.test.d.ts.map +0 -1
- package/dist/react-native/db.test.js +0 -148
- package/dist/react-native/db.test.js.map +0 -1
- package/dist/react-native/jazz-rn-runtime-adapter.d.ts +0 -56
- package/dist/react-native/jazz-rn-runtime-adapter.d.ts.map +0 -1
- package/dist/react-native/jazz-rn-runtime-adapter.js +0 -192
- package/dist/react-native/jazz-rn-runtime-adapter.js.map +0 -1
- package/dist/react-native/jazz-rn-runtime-adapter.test.d.ts +0 -2
- package/dist/react-native/jazz-rn-runtime-adapter.test.d.ts.map +0 -1
- package/dist/react-native/jazz-rn-runtime-adapter.test.js +0 -165
- package/dist/react-native/jazz-rn-runtime-adapter.test.js.map +0 -1
- package/dist/runtime/client-session.test.d.ts +0 -2
- package/dist/runtime/client-session.test.d.ts.map +0 -1
- package/dist/runtime/client-session.test.js +0 -84
- package/dist/runtime/client-session.test.js.map +0 -1
- package/dist/runtime/client.for-request.test.d.ts +0 -2
- package/dist/runtime/client.for-request.test.d.ts.map +0 -1
- package/dist/runtime/client.for-request.test.js +0 -191
- package/dist/runtime/client.for-request.test.js.map +0 -1
- package/dist/runtime/cloud-server.integration.test.d.ts +0 -2
- package/dist/runtime/cloud-server.integration.test.d.ts.map +0 -1
- package/dist/runtime/cloud-server.integration.test.js +0 -1210
- package/dist/runtime/cloud-server.integration.test.js.map +0 -1
- package/dist/runtime/dynamic-query.d.ts +0 -10
- package/dist/runtime/dynamic-query.d.ts.map +0 -1
- package/dist/runtime/dynamic-query.js +0 -11
- package/dist/runtime/dynamic-query.js.map +0 -1
- package/dist/runtime/leader-lock.d.ts +0 -15
- package/dist/runtime/leader-lock.d.ts.map +0 -1
- package/dist/runtime/leader-lock.js +0 -49
- package/dist/runtime/leader-lock.js.map +0 -1
- package/dist/runtime/local-auth.d.ts +0 -32
- package/dist/runtime/local-auth.d.ts.map +0 -1
- package/dist/runtime/local-auth.js +0 -93
- package/dist/runtime/local-auth.js.map +0 -1
- package/dist/runtime/local-auth.test.d.ts +0 -2
- package/dist/runtime/local-auth.test.d.ts.map +0 -1
- package/dist/runtime/local-auth.test.js +0 -50
- package/dist/runtime/local-auth.test.js.map +0 -1
- package/dist/runtime/query-adapter.test.d.ts +0 -5
- package/dist/runtime/query-adapter.test.d.ts.map +0 -1
- package/dist/runtime/query-adapter.test.js +0 -1249
- package/dist/runtime/query-adapter.test.js.map +0 -1
- package/dist/runtime/row-transformer.test.d.ts +0 -5
- package/dist/runtime/row-transformer.test.d.ts.map +0 -1
- package/dist/runtime/row-transformer.test.js +0 -385
- package/dist/runtime/row-transformer.test.js.map +0 -1
- package/dist/runtime/schema-fetch.d.ts +0 -17
- package/dist/runtime/schema-fetch.d.ts.map +0 -1
- package/dist/runtime/schema-fetch.js +0 -33
- package/dist/runtime/schema-fetch.js.map +0 -1
- package/dist/runtime/schema-fetch.test.d.ts +0 -2
- package/dist/runtime/schema-fetch.test.d.ts.map +0 -1
- package/dist/runtime/schema-fetch.test.js +0 -87
- package/dist/runtime/schema-fetch.test.js.map +0 -1
- package/dist/runtime/subscription-manager.test.d.ts +0 -5
- package/dist/runtime/subscription-manager.test.d.ts.map +0 -1
- package/dist/runtime/subscription-manager.test.js +0 -120
- package/dist/runtime/subscription-manager.test.js.map +0 -1
- package/dist/runtime/sync-transport.d.ts +0 -163
- package/dist/runtime/sync-transport.d.ts.map +0 -1
- package/dist/runtime/sync-transport.js +0 -477
- package/dist/runtime/sync-transport.js.map +0 -1
- package/dist/runtime/sync-transport.test.d.ts +0 -2
- package/dist/runtime/sync-transport.test.d.ts.map +0 -1
- package/dist/runtime/sync-transport.test.js +0 -310
- package/dist/runtime/sync-transport.test.js.map +0 -1
- package/dist/runtime/tab-leader-election.d.ts +0 -97
- package/dist/runtime/tab-leader-election.d.ts.map +0 -1
- package/dist/runtime/tab-leader-election.js +0 -339
- package/dist/runtime/tab-leader-election.js.map +0 -1
- package/dist/runtime/tab-leader-election.test.d.ts +0 -2
- package/dist/runtime/tab-leader-election.test.d.ts.map +0 -1
- package/dist/runtime/tab-leader-election.test.js +0 -278
- package/dist/runtime/tab-leader-election.test.js.map +0 -1
- package/dist/runtime/testing/wasm-runtime-test-utils.d.ts +0 -13
- package/dist/runtime/testing/wasm-runtime-test-utils.d.ts.map +0 -1
- package/dist/runtime/testing/wasm-runtime-test-utils.js +0 -76
- package/dist/runtime/testing/wasm-runtime-test-utils.js.map +0 -1
- package/dist/runtime/utils.d.ts +0 -2
- package/dist/runtime/utils.d.ts.map +0 -1
- package/dist/runtime/utils.js +0 -16
- package/dist/runtime/utils.js.map +0 -1
- package/dist/runtime/value-converter.test.d.ts +0 -5
- package/dist/runtime/value-converter.test.d.ts.map +0 -1
- package/dist/runtime/value-converter.test.js +0 -222
- package/dist/runtime/value-converter.test.js.map +0 -1
- package/dist/runtime/worker-bridge.d.ts +0 -82
- package/dist/runtime/worker-bridge.d.ts.map +0 -1
- package/dist/runtime/worker-bridge.js +0 -308
- package/dist/runtime/worker-bridge.js.map +0 -1
- package/dist/runtime/worker-bridge.race-harness.test.d.ts +0 -2
- package/dist/runtime/worker-bridge.race-harness.test.d.ts.map +0 -1
- package/dist/runtime/worker-bridge.race-harness.test.js +0 -284
- package/dist/runtime/worker-bridge.race-harness.test.js.map +0 -1
- package/dist/runtime/worker-bridge.test.d.ts +0 -2
- package/dist/runtime/worker-bridge.test.d.ts.map +0 -1
- package/dist/runtime/worker-bridge.test.js +0 -233
- package/dist/runtime/worker-bridge.test.js.map +0 -1
- package/dist/sql-gen.d.ts +0 -4
- package/dist/sql-gen.d.ts.map +0 -1
- package/dist/sql-gen.js +0 -163
- package/dist/sql-gen.js.map +0 -1
- package/dist/sql-gen.test.d.ts +0 -2
- package/dist/sql-gen.test.d.ts.map +0 -1
- package/dist/sql-gen.test.js +0 -412
- package/dist/sql-gen.test.js.map +0 -1
- package/dist/subscriptions-orchestrator.integration.test.d.ts +0 -2
- package/dist/subscriptions-orchestrator.integration.test.d.ts.map +0 -1
- package/dist/subscriptions-orchestrator.integration.test.js +0 -192
- package/dist/subscriptions-orchestrator.integration.test.js.map +0 -1
- package/dist/subscriptions-orchestrator.test.d.ts +0 -2
- package/dist/subscriptions-orchestrator.test.d.ts.map +0 -1
- package/dist/subscriptions-orchestrator.test.js +0 -367
- package/dist/subscriptions-orchestrator.test.js.map +0 -1
- package/dist/svelte/JazzSvelteProvider.svelte +0 -49
- package/dist/svelte/JazzSvelteProvider.svelte.d.ts +0 -13
- package/dist/svelte/JazzSvelteProvider.svelte.d.ts.map +0 -1
- package/dist/svelte/SyntheticUserSwitcher.svelte +0 -121
- package/dist/svelte/SyntheticUserSwitcher.svelte.d.ts +0 -11
- package/dist/svelte/SyntheticUserSwitcher.svelte.d.ts.map +0 -1
- package/dist/svelte/context.test.d.ts +0 -2
- package/dist/svelte/context.test.d.ts.map +0 -1
- package/dist/svelte/context.test.js +0 -55
- package/dist/svelte/create-jazz-client.test.d.ts +0 -2
- package/dist/svelte/create-jazz-client.test.d.ts.map +0 -1
- package/dist/svelte/create-jazz-client.test.js +0 -50
- package/dist/svelte/use-all.svelte.d.ts +0 -32
- package/dist/svelte/use-all.svelte.d.ts.map +0 -1
- package/dist/svelte/use-all.svelte.js +0 -61
- package/dist/svelte/use-all.test.d.ts +0 -2
- package/dist/svelte/use-all.test.d.ts.map +0 -1
- package/dist/svelte/use-all.test.js +0 -158
- package/dist/svelte/use-link-external-identity.d.ts +0 -25
- package/dist/svelte/use-link-external-identity.d.ts.map +0 -1
- package/dist/svelte/use-link-external-identity.js +0 -33
- package/dist/svelte/use-link-external-identity.test.d.ts +0 -2
- package/dist/svelte/use-link-external-identity.test.d.ts.map +0 -1
- package/dist/svelte/use-link-external-identity.test.js +0 -97
- package/dist/synthetic-user-switcher.d.ts +0 -16
- package/dist/synthetic-user-switcher.d.ts.map +0 -1
- package/dist/synthetic-user-switcher.js +0 -134
- package/dist/synthetic-user-switcher.js.map +0 -1
- package/dist/synthetic-users.d.ts +0 -32
- package/dist/synthetic-users.d.ts.map +0 -1
- package/dist/synthetic-users.js +0 -124
- package/dist/synthetic-users.js.map +0 -1
- package/dist/testing/fixtures/basic/app.d.ts +0 -55
- package/dist/testing/fixtures/basic/app.d.ts.map +0 -1
- package/dist/testing/fixtures/basic/app.js +0 -174
- package/dist/testing/fixtures/basic/app.js.map +0 -1
- package/dist/testing/fixtures/basic/current.d.ts +0 -2
- package/dist/testing/fixtures/basic/current.d.ts.map +0 -1
- package/dist/testing/fixtures/basic/current.js +0 -6
- package/dist/testing/fixtures/basic/current.js.map +0 -1
- package/dist/testing/index.test.d.ts +0 -2
- package/dist/testing/index.test.d.ts.map +0 -1
- package/dist/testing/index.test.js +0 -234
- package/dist/testing/index.test.js.map +0 -1
- package/dist/testing/local-jazz-server.d.ts +0 -34
- package/dist/testing/local-jazz-server.d.ts.map +0 -1
- package/dist/testing/local-jazz-server.js +0 -313
- package/dist/testing/local-jazz-server.js.map +0 -1
- package/dist/testing/relation-ir-test-helpers.d.ts +0 -3
- package/dist/testing/relation-ir-test-helpers.d.ts.map +0 -1
- package/dist/testing/relation-ir-test-helpers.js +0 -258
- package/dist/testing/relation-ir-test-helpers.js.map +0 -1
- package/dist/worker/jazz-worker.d.ts +0 -9
- package/dist/worker/jazz-worker.d.ts.map +0 -1
- package/dist/worker/jazz-worker.js +0 -555
- package/dist/worker/jazz-worker.js.map +0 -1
- package/dist/worker/jazz-worker.ts +0 -630
- package/dist/worker/worker-protocol.d.ts +0 -136
- package/dist/worker/worker-protocol.d.ts.map +0 -1
- package/dist/worker/worker-protocol.js +0 -7
- package/dist/worker/worker-protocol.js.map +0 -1
|
@@ -0,0 +1,1001 @@
|
|
|
1
|
+
// The Inspector and agent debug access, served by the app's own backend.
|
|
2
|
+
//
|
|
3
|
+
// Every way in ends here: the Inspector UI the backend serves, the
|
|
4
|
+
// `jazz-tools inspect` CLI and the `jazz-tools inspect mcp` server all call the one
|
|
5
|
+
// JSON API at `<basePath>/inspect/api`. A request is let in by exactly one of:
|
|
6
|
+
//
|
|
7
|
+
// - the app's `inspect` hook, which decides from the request (usually the
|
|
8
|
+
// person's own sign-in, or an infrastructure gate in front of the app) who
|
|
9
|
+
// is inspecting and whether they may write;
|
|
10
|
+
// - an agent token a person minted after passing the hook, which is
|
|
11
|
+
// time-limited, read-only unless the person allowed writes, can be limited
|
|
12
|
+
// to some tables, and has redacted columns hidden;
|
|
13
|
+
// - with no hook at all, the local development default: a request from this
|
|
14
|
+
// machine to a backend running with NODE_ENV=development.
|
|
15
|
+
//
|
|
16
|
+
// Whoever is let in reads and writes with the backend's own authority (every
|
|
17
|
+
// row, permissions not checked) unless they ask to act as a user. That is
|
|
18
|
+
// the point of the Inspector, and it is why the hook must be narrow.
|
|
19
|
+
import { NoJazzAccountError } from "./no-account-error.js";
|
|
20
|
+
import { accountAppId } from "../accounts/local-first.js";
|
|
21
|
+
import { endpointScope } from "../runtime/client-scope.js";
|
|
22
|
+
import { createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
|
23
|
+
import { historySourceTable, historyTableName } from "../runtime/history-relation.js";
|
|
24
|
+
import { INSPECT_API_PATH, INSPECT_ERRORS, INSPECT_PATH, INSPECT_PROTOCOL_VERSION, INSPECT_TOKEN_PREFIX, InspectError, MAX_ANSWER_BYTES, buildQueryJson, fromJsonForColumn, inspectorLink, cleanTokenLabel, fromJsonValue, isLoopbackHost, policyClauses, readsClaims, renderPolicy, rowLimit, summarizeLargeValue, toJsonValue, } from "../inspect/protocol.js";
|
|
25
|
+
const DEFAULT_TOKEN_TTL_SECONDS = 3600;
|
|
26
|
+
const DEFAULT_MAX_TOKEN_TTL_SECONDS = 24 * 3600;
|
|
27
|
+
const MAX_REQUEST_BYTES = 1024 * 1024;
|
|
28
|
+
const REDACTED = "[redacted]";
|
|
29
|
+
const PROVENANCE = ["$createdBy", "$createdAt", "$updatedBy", "$updatedAt"];
|
|
30
|
+
function defaultAudit(event) {
|
|
31
|
+
const parts = [
|
|
32
|
+
// The label is the agent's own text: quoted, so it can't forge a line.
|
|
33
|
+
`jazz inspect: ${event.by} (${event.via}${event.label ? ` ${JSON.stringify(event.label)}` : ""})`,
|
|
34
|
+
event.op,
|
|
35
|
+
event.table,
|
|
36
|
+
event.as && `as ${event.as}`,
|
|
37
|
+
event.rows !== undefined && `${event.rows} row(s)`,
|
|
38
|
+
event.error && `refused: ${event.error}`,
|
|
39
|
+
].filter(Boolean);
|
|
40
|
+
console.info(parts.join(" "));
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Check `options` and read them as the Inspector applies them. createJazz
|
|
44
|
+
* calls it when it starts and on each reload, so bad options fail there,
|
|
45
|
+
* not on the next Inspector call.
|
|
46
|
+
*/
|
|
47
|
+
export function inspectorSettings(options) {
|
|
48
|
+
const maxTtl = options.maxTokenTtlSeconds ?? DEFAULT_MAX_TOKEN_TTL_SECONDS;
|
|
49
|
+
if (!Number.isSafeInteger(maxTtl) || maxTtl < 60) {
|
|
50
|
+
throw new Error("createJazz: inspector.maxTokenTtlSeconds must be at least 60");
|
|
51
|
+
}
|
|
52
|
+
let issuedAfter;
|
|
53
|
+
if (options.tokensIssuedAfter !== undefined) {
|
|
54
|
+
const at = new Date(options.tokensIssuedAfter).getTime();
|
|
55
|
+
if (Number.isNaN(at)) {
|
|
56
|
+
throw new Error("createJazz: inspector.tokensIssuedAfter must be a date");
|
|
57
|
+
}
|
|
58
|
+
issuedAfter = Math.floor(at / 1000);
|
|
59
|
+
}
|
|
60
|
+
if (options.tokenSecret !== undefined && !options.tokenSecret.trim()) {
|
|
61
|
+
throw new Error("createJazz: inspector.tokenSecret is empty");
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
redact: new Map(Object.entries(options.redact ?? {}).map(([table, columns]) => [table, new Set(columns)])),
|
|
65
|
+
audit: options.audit ?? defaultAudit,
|
|
66
|
+
issuedAfter,
|
|
67
|
+
maxTtl,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export function createInspector(deps) {
|
|
71
|
+
const now = deps.now ?? (() => Date.now());
|
|
72
|
+
const env = deps.env ?? process.env;
|
|
73
|
+
// The options follow a reload of createJazz: they are read again whenever
|
|
74
|
+
// the options object changes.
|
|
75
|
+
let settingsOf;
|
|
76
|
+
function settings() {
|
|
77
|
+
const options = deps.options;
|
|
78
|
+
if (settingsOf?.options !== options) {
|
|
79
|
+
settingsOf = { options, settings: inspectorSettings(options) };
|
|
80
|
+
}
|
|
81
|
+
return settingsOf.settings;
|
|
82
|
+
}
|
|
83
|
+
settings();
|
|
84
|
+
const audit = (event) => settings().audit(event);
|
|
85
|
+
// The signing key follows the secret: a reload that rotates it revokes
|
|
86
|
+
// every token signed with the old one.
|
|
87
|
+
let keyOf;
|
|
88
|
+
async function tokenKey() {
|
|
89
|
+
const secret = await deps.tokenSecret();
|
|
90
|
+
if (secret === null)
|
|
91
|
+
return null;
|
|
92
|
+
if (keyOf?.secret !== secret) {
|
|
93
|
+
keyOf = {
|
|
94
|
+
secret,
|
|
95
|
+
key: createHmac("sha256", secret).update(`jazz-inspect-token-v1\0${deps.appId}`).digest(),
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
return keyOf.key;
|
|
99
|
+
}
|
|
100
|
+
// ---------------------------------------------------------------- admission
|
|
101
|
+
/**
|
|
102
|
+
* The local development default: no hook, NODE_ENV=development, and a
|
|
103
|
+
* request from this machine. "This machine" is the socket's peer address,
|
|
104
|
+
* which only a host that hands Jazz its Node request knows (`attach()`,
|
|
105
|
+
* `nodeHandler`). The Host header can't stand in for it: anyone who reaches
|
|
106
|
+
* a dev server listening on every interface (as `next dev` does) can send
|
|
107
|
+
* `Host: localhost`. So on other hosts the default is off, and says so.
|
|
108
|
+
*/
|
|
109
|
+
function devAllowed(request) {
|
|
110
|
+
if (env.NODE_ENV !== "development")
|
|
111
|
+
return false;
|
|
112
|
+
// A proxy in front of the backend makes every request look local.
|
|
113
|
+
for (const header of ["x-forwarded-for", "x-forwarded-host", "x-real-ip", "forwarded"]) {
|
|
114
|
+
if (request.headers.has(header))
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
// A browser names the page a request comes from. A dev proxy that adds
|
|
118
|
+
// no forwarding headers (Vite's `server.proxy` with `changeOrigin`, on a
|
|
119
|
+
// dev server started with `--host`) passes another machine's request on
|
|
120
|
+
// from 127.0.0.1 with a loopback Host, but keeps the browser's Origin
|
|
121
|
+
// and Sec-Fetch-Site: only a page on this machine is let in.
|
|
122
|
+
const origin = request.headers.get("origin");
|
|
123
|
+
if (origin !== null) {
|
|
124
|
+
let originHost;
|
|
125
|
+
try {
|
|
126
|
+
originHost = new URL(origin).hostname;
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
if (!isLoopbackHost(originHost))
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
if (request.headers.get("sec-fetch-site") === "cross-site")
|
|
135
|
+
return false;
|
|
136
|
+
const remote = deps.remoteAddress(request);
|
|
137
|
+
if (remote === undefined)
|
|
138
|
+
return "no_peer";
|
|
139
|
+
if (!isLoopbackAddress(remote))
|
|
140
|
+
return false;
|
|
141
|
+
const host = request.headers.get("host") ?? new URL(request.url).host;
|
|
142
|
+
let hostname;
|
|
143
|
+
try {
|
|
144
|
+
hostname = new URL(`http://${host}`).hostname;
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
return isLoopbackHost(hostname);
|
|
150
|
+
}
|
|
151
|
+
async function admit(request) {
|
|
152
|
+
const authorization = request.headers.get("authorization");
|
|
153
|
+
if (authorization?.startsWith(`Bearer ${INSPECT_TOKEN_PREFIX}`)) {
|
|
154
|
+
return verifyToken(authorization.slice("Bearer ".length));
|
|
155
|
+
}
|
|
156
|
+
if (deps.hook) {
|
|
157
|
+
let grant;
|
|
158
|
+
try {
|
|
159
|
+
grant = await deps.hook(request);
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
// Its reason is the app's (a sign-in service's error, a stack), and
|
|
163
|
+
// this caller isn't let in: it goes to the log, not the answer.
|
|
164
|
+
console.error("jazz inspect: the app's inspect hook threw", error);
|
|
165
|
+
throw new InspectError("failed", "the app's inspect hook failed; the backend's log has the error");
|
|
166
|
+
}
|
|
167
|
+
if (!grant)
|
|
168
|
+
throw new InspectError("unauthorized", "the app's inspect hook refused this request");
|
|
169
|
+
if (typeof grant.by !== "string" || !grant.by.trim()) {
|
|
170
|
+
throw new InspectError("failed", "the app's inspect hook returned a grant without `by`");
|
|
171
|
+
}
|
|
172
|
+
return { by: grant.by, via: "hook", write: grant.write === true };
|
|
173
|
+
}
|
|
174
|
+
const dev = devAllowed(request);
|
|
175
|
+
if (dev === true)
|
|
176
|
+
return { by: "local development", via: "dev", write: true };
|
|
177
|
+
if (dev === "no_peer") {
|
|
178
|
+
throw new InspectError("unauthorized", "Local inspection without an `inspect` hook is not supported on this host yet: it doesn't tell Jazz the request's peer address, and the Host header proves nothing (anyone who reaches a dev server listening on every interface can send `Host: localhost`). Serve Jazz through `attach()` or `nodeHandler`, or pass an `inspect` hook that names who may inspect from your own sign-in");
|
|
179
|
+
}
|
|
180
|
+
throw new InspectError("unauthorized", "Inspecting this app needs an `inspect` hook in createJazz (or, in local development, NODE_ENV=development and a request from this machine)");
|
|
181
|
+
}
|
|
182
|
+
async function mintToken(admitted, request) {
|
|
183
|
+
// A token is a person's delegation: another token can't make one.
|
|
184
|
+
if (admitted.via === "token") {
|
|
185
|
+
throw new InspectError("forbidden", "an agent token can't mint tokens; a person must approve");
|
|
186
|
+
}
|
|
187
|
+
if (request.write && !admitted.write) {
|
|
188
|
+
throw new InspectError("forbidden", "you may not write, so you can't grant writes");
|
|
189
|
+
}
|
|
190
|
+
const ttl = request.ttlSeconds ?? DEFAULT_TOKEN_TTL_SECONDS;
|
|
191
|
+
const { maxTtl } = settings();
|
|
192
|
+
if (!Number.isSafeInteger(ttl) || ttl < 60 || ttl > maxTtl) {
|
|
193
|
+
throw new InspectError("bad_request", `ttlSeconds must be between 60 and ${maxTtl}`);
|
|
194
|
+
}
|
|
195
|
+
const tables = request.tables;
|
|
196
|
+
if (tables !== undefined) {
|
|
197
|
+
if (!Array.isArray(tables) || tables.length === 0) {
|
|
198
|
+
throw new InspectError("bad_request", "tables must list at least one table");
|
|
199
|
+
}
|
|
200
|
+
const schema = deps.schema();
|
|
201
|
+
for (const table of tables) {
|
|
202
|
+
if (typeof table !== "string" || !Object.hasOwn(schema, table)) {
|
|
203
|
+
throw new InspectError("bad_request", `no table ${JSON.stringify(table)}`);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
const key = await tokenKey();
|
|
208
|
+
if (!key) {
|
|
209
|
+
throw new InspectError("not_supported", "Agent tokens on this store need a signing secret shared by every backend instance: set `inspector: { tokenSecret }` in createJazz");
|
|
210
|
+
}
|
|
211
|
+
const iat = Math.floor(now() / 1000);
|
|
212
|
+
const claims = {
|
|
213
|
+
v: 1,
|
|
214
|
+
app: deps.appId,
|
|
215
|
+
by: admitted.by,
|
|
216
|
+
write: request.write === true,
|
|
217
|
+
...(tables ? { tables: [...new Set(tables)] } : {}),
|
|
218
|
+
...(cleanTokenLabel(request.label) ? { label: cleanTokenLabel(request.label) } : {}),
|
|
219
|
+
iat,
|
|
220
|
+
exp: iat + ttl,
|
|
221
|
+
jti: randomUUID(),
|
|
222
|
+
};
|
|
223
|
+
const payload = Buffer.from(JSON.stringify(claims)).toString("base64url");
|
|
224
|
+
const mac = createHmac("sha256", key).update(payload).digest("base64url");
|
|
225
|
+
return {
|
|
226
|
+
token: `${INSPECT_TOKEN_PREFIX}${payload}.${mac}`,
|
|
227
|
+
expiresAt: claims.exp,
|
|
228
|
+
tokenId: claims.jti,
|
|
229
|
+
...(claims.label ? { label: claims.label } : {}),
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
async function verifyToken(token) {
|
|
233
|
+
const refused = (why) => new InspectError("unauthorized", `agent token refused: ${why}`);
|
|
234
|
+
const key = await tokenKey();
|
|
235
|
+
if (!key)
|
|
236
|
+
throw refused("this backend has no token signing secret");
|
|
237
|
+
const body = token.slice(INSPECT_TOKEN_PREFIX.length);
|
|
238
|
+
const [payload, mac, extra] = body.split(".");
|
|
239
|
+
if (!payload || !mac || extra !== undefined || body.length > 4096)
|
|
240
|
+
throw refused("malformed");
|
|
241
|
+
const expected = Buffer.from(createHmac("sha256", key).update(payload).digest("base64url"));
|
|
242
|
+
const given = Buffer.from(mac);
|
|
243
|
+
if (expected.length !== given.length || !timingSafeEqual(expected, given)) {
|
|
244
|
+
throw refused("not signed by this backend");
|
|
245
|
+
}
|
|
246
|
+
let claims;
|
|
247
|
+
try {
|
|
248
|
+
claims = JSON.parse(Buffer.from(payload, "base64url").toString("utf8"));
|
|
249
|
+
}
|
|
250
|
+
catch {
|
|
251
|
+
throw refused("malformed");
|
|
252
|
+
}
|
|
253
|
+
const at = Math.floor(now() / 1000);
|
|
254
|
+
if (claims.v !== 1 || claims.app !== deps.appId)
|
|
255
|
+
throw refused("for another app");
|
|
256
|
+
if (typeof claims.exp !== "number" || claims.exp <= at)
|
|
257
|
+
throw refused("expired");
|
|
258
|
+
const { issuedAfter } = settings();
|
|
259
|
+
if (issuedAfter !== undefined && claims.iat < issuedAfter)
|
|
260
|
+
throw refused("revoked");
|
|
261
|
+
return {
|
|
262
|
+
by: claims.by,
|
|
263
|
+
via: "token",
|
|
264
|
+
write: claims.write === true,
|
|
265
|
+
...(claims.tables ? { tables: claims.tables } : {}),
|
|
266
|
+
expiresAt: claims.exp,
|
|
267
|
+
tokenId: claims.jti,
|
|
268
|
+
...(typeof claims.label === "string" && claims.label ? { label: claims.label } : {}),
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
// ---------------------------------------------------------------- reads and writes
|
|
272
|
+
/** Where browsers reach this Jazz: its public URL, else this request's origin and basePath. */
|
|
273
|
+
function endpointUrl(request) {
|
|
274
|
+
if (deps.publicUrls[0])
|
|
275
|
+
return deps.publicUrls[0];
|
|
276
|
+
return `${new URL(request.url).origin}${deps.basePath}`;
|
|
277
|
+
}
|
|
278
|
+
function inspectorUrl(request) {
|
|
279
|
+
return `${endpointUrl(request)}${INSPECT_PATH}/`;
|
|
280
|
+
}
|
|
281
|
+
function tableOf(name) {
|
|
282
|
+
if (typeof name !== "string" || !name)
|
|
283
|
+
throw new InspectError("bad_request", "name a table");
|
|
284
|
+
const schema = deps.schema();
|
|
285
|
+
const source = historySourceTable(name) ?? name;
|
|
286
|
+
const table = Object.hasOwn(schema, source) ? schema[source] : undefined;
|
|
287
|
+
if (!table)
|
|
288
|
+
throw new InspectError("not_found", `no table ${JSON.stringify(name)}`);
|
|
289
|
+
return {
|
|
290
|
+
source,
|
|
291
|
+
columns: new Map(table.columns.map((column) => [column.name, column.column_type])),
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
function checkTable(admitted, name) {
|
|
295
|
+
const { source } = tableOf(name);
|
|
296
|
+
if (admitted.tables && !admitted.tables.includes(source)) {
|
|
297
|
+
throw new InspectError("forbidden", `this token is limited to ${admitted.tables.join(", ")}`);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
function redactedFor(admitted, table) {
|
|
301
|
+
if (admitted.via !== "token")
|
|
302
|
+
return undefined;
|
|
303
|
+
return settings().redact.get(historySourceTable(table) ?? table);
|
|
304
|
+
}
|
|
305
|
+
function queryBuilder(table, json) {
|
|
306
|
+
return {
|
|
307
|
+
_table: table,
|
|
308
|
+
_schema: deps.schema(),
|
|
309
|
+
_build: () => json,
|
|
310
|
+
_rowType: undefined,
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
function tableProxy(table) {
|
|
314
|
+
return {
|
|
315
|
+
_table: table,
|
|
316
|
+
_schema: deps.schema(),
|
|
317
|
+
_rowType: undefined,
|
|
318
|
+
_initType: undefined,
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
let claimsReadFor;
|
|
322
|
+
/** Whether the app's permissions read anything from `session.claims`. */
|
|
323
|
+
function permissionsReadClaims() {
|
|
324
|
+
if (!claimsReadFor || claimsReadFor.permissions !== deps.permissions) {
|
|
325
|
+
claimsReadFor = { permissions: deps.permissions, reads: readsClaims(deps.permissions) };
|
|
326
|
+
}
|
|
327
|
+
return claimsReadFor.reads;
|
|
328
|
+
}
|
|
329
|
+
async function dbFor(as) {
|
|
330
|
+
if (as === undefined)
|
|
331
|
+
return { db: deps.db() };
|
|
332
|
+
const user = typeof as === "string" ? { userId: as } : as;
|
|
333
|
+
if (!user || typeof user.userId !== "string" || !user.userId) {
|
|
334
|
+
throw new InspectError("bad_request", "as must name a user id");
|
|
335
|
+
}
|
|
336
|
+
if (user.claims !== undefined &&
|
|
337
|
+
(user.claims === null || typeof user.claims !== "object" || Array.isArray(user.claims))) {
|
|
338
|
+
throw new InspectError("bad_request", "as.claims must be an object of the user's claims");
|
|
339
|
+
}
|
|
340
|
+
// A user's claims come from their sign-in, which the Inspector doesn't
|
|
341
|
+
// have: viewing as them without claims sees what a session with none
|
|
342
|
+
// would, and policies that read claims then quietly allow less.
|
|
343
|
+
const warning = user.claims === undefined && permissionsReadClaims()
|
|
344
|
+
? `This app's permissions read session claims, and none were given for ${user.userId}, so this ran as a session with no claims: rows or writes a claim would allow are missing or refused. Pass the user's claims with as: { userId, claims } (CLI: --claims '<json>'; MCP: claims; Inspector: the claims field next to "View as user").`
|
|
345
|
+
: undefined;
|
|
346
|
+
try {
|
|
347
|
+
return {
|
|
348
|
+
db: await deps.dbAs(user),
|
|
349
|
+
as: user.userId,
|
|
350
|
+
...(user.claims ? { asClaims: Object.keys(user.claims).sort() } : {}),
|
|
351
|
+
...(warning ? { warning } : {}),
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
catch (error) {
|
|
355
|
+
// Viewing as a user who never signed in: there is no one to be.
|
|
356
|
+
if (error instanceof NoJazzAccountError)
|
|
357
|
+
throw new InspectError("not_found", error.message);
|
|
358
|
+
throw error;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
async function readRows(admitted, query, as, options = {}) {
|
|
362
|
+
if (!query || typeof query !== "object") {
|
|
363
|
+
throw new InspectError("bad_request", "query needs { table, ... }");
|
|
364
|
+
}
|
|
365
|
+
checkTable(admitted, query.table);
|
|
366
|
+
const hidden = redactedFor(admitted, query.table);
|
|
367
|
+
if (hidden) {
|
|
368
|
+
const named = [
|
|
369
|
+
...Object.keys(query.where ?? {}),
|
|
370
|
+
...(query.orderBy ?? []).map(([column]) => column),
|
|
371
|
+
].filter((column) => hidden.has(column));
|
|
372
|
+
if (named.length) {
|
|
373
|
+
throw new InspectError("forbidden", `${named.join(", ")} ${named.length === 1 ? "is" : "are"} redacted for agents: a token can't filter or sort by ${named.length === 1 ? "it" : "them"}`);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
const limit = rowLimit(query.limit);
|
|
377
|
+
const { columns } = tableOf(query.table);
|
|
378
|
+
// One more than the limit, to tell whether more matched.
|
|
379
|
+
let json = buildQueryJson(query, limit + 1, (column, value) => fromJsonForColumn(columns.get(column), value));
|
|
380
|
+
// Only `from`–`to` of one bytes or text value: the store reads just the
|
|
381
|
+
// chunks that part covers.
|
|
382
|
+
if (options.part) {
|
|
383
|
+
const { column, from, to } = options.part;
|
|
384
|
+
json = JSON.stringify({
|
|
385
|
+
...JSON.parse(json),
|
|
386
|
+
select: [column],
|
|
387
|
+
partialSelect: { [column]: { from, to } },
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
const summarize = options.summarize ?? true;
|
|
391
|
+
const { db, as: asUser, asClaims, warning } = await dbFor(as);
|
|
392
|
+
const found = await db.all(queryBuilder(query.table, json), {
|
|
393
|
+
tier: "remote",
|
|
394
|
+
});
|
|
395
|
+
let truncated = found.length > limit;
|
|
396
|
+
const rows = [];
|
|
397
|
+
let bytes = 0;
|
|
398
|
+
for (const row of found.slice(0, limit)) {
|
|
399
|
+
const shown = toJsonValue(row);
|
|
400
|
+
if (hidden)
|
|
401
|
+
for (const column of hidden)
|
|
402
|
+
if (column in shown)
|
|
403
|
+
shown[column] = REDACTED;
|
|
404
|
+
// A large value is summarized, so its row is listed (`get` with
|
|
405
|
+
// `column` answers the value itself).
|
|
406
|
+
if (summarize) {
|
|
407
|
+
for (const [column, value] of Object.entries(shown)) {
|
|
408
|
+
shown[column] = summarizeLargeValue(value);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
let size = JSON.stringify(shown).length;
|
|
412
|
+
// Always the first row: a row that exists is never answered as none.
|
|
413
|
+
// Should it alone be larger than an answer carries (many values just
|
|
414
|
+
// under the limit), summarize its largest values until it fits.
|
|
415
|
+
if (rows.length === 0 && size > MAX_ANSWER_BYTES) {
|
|
416
|
+
const bySize = Object.entries(shown)
|
|
417
|
+
.filter(([column]) => column !== "id")
|
|
418
|
+
.map(([column, value]) => [column, JSON.stringify(value)?.length ?? 0])
|
|
419
|
+
.sort((a, b) => b[1] - a[1]);
|
|
420
|
+
for (const [column] of bySize) {
|
|
421
|
+
if (size <= MAX_ANSWER_BYTES)
|
|
422
|
+
break;
|
|
423
|
+
shown[column] = summarizeLargeValue(shown[column], 0);
|
|
424
|
+
size = JSON.stringify(shown).length;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
bytes += size;
|
|
428
|
+
if (bytes > MAX_ANSWER_BYTES && rows.length > 0) {
|
|
429
|
+
truncated = true;
|
|
430
|
+
break;
|
|
431
|
+
}
|
|
432
|
+
rows.push(shown);
|
|
433
|
+
}
|
|
434
|
+
return {
|
|
435
|
+
rows,
|
|
436
|
+
truncated,
|
|
437
|
+
...(asUser ? { as: asUser } : {}),
|
|
438
|
+
...(asClaims ? { asClaims } : {}),
|
|
439
|
+
...(warning ? { warning } : {}),
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
async function write(admitted, ops, as) {
|
|
443
|
+
if (!admitted.write) {
|
|
444
|
+
throw new InspectError("forbidden", admitted.via === "token"
|
|
445
|
+
? "this token is read-only; ask for one that allows writes"
|
|
446
|
+
: "you may read but not write (the inspect hook's grant has no `write: true`)");
|
|
447
|
+
}
|
|
448
|
+
if (!Array.isArray(ops) || ops.length === 0 || ops.length > 1000) {
|
|
449
|
+
throw new InspectError("bad_request", "ops must list between 1 and 1000 writes");
|
|
450
|
+
}
|
|
451
|
+
const prepared = ops.map((op) => {
|
|
452
|
+
if (!op || typeof op !== "object" || !["insert", "update", "delete"].includes(op.kind)) {
|
|
453
|
+
throw new InspectError("bad_request", `each op needs kind: "insert", "update" or "delete" (got ${String(JSON.stringify(op && typeof op === "object" ? (op.kind ?? null) : op)).slice(0, 60)})`);
|
|
454
|
+
}
|
|
455
|
+
if (typeof op.table !== "string" || !op.table) {
|
|
456
|
+
throw new InspectError("bad_request", `${op.kind} needs a table`);
|
|
457
|
+
}
|
|
458
|
+
if (historySourceTable(op.table) !== undefined) {
|
|
459
|
+
throw new InspectError("bad_request", `${op.table} is a history table and is read-only`);
|
|
460
|
+
}
|
|
461
|
+
checkTable(admitted, op.table);
|
|
462
|
+
const { columns } = tableOf(op.table);
|
|
463
|
+
if (op.kind === "delete") {
|
|
464
|
+
if (typeof op.id !== "string")
|
|
465
|
+
throw new InspectError("bad_request", "delete needs an id");
|
|
466
|
+
return { op, values: undefined };
|
|
467
|
+
}
|
|
468
|
+
if (!op.values || typeof op.values !== "object" || Array.isArray(op.values)) {
|
|
469
|
+
throw new InspectError("bad_request", `${op.kind} needs values`);
|
|
470
|
+
}
|
|
471
|
+
if (op.kind === "update" && typeof op.id !== "string") {
|
|
472
|
+
throw new InspectError("bad_request", "update needs an id");
|
|
473
|
+
}
|
|
474
|
+
const hidden = redactedFor(admitted, op.table);
|
|
475
|
+
const values = {};
|
|
476
|
+
for (const [column, value] of Object.entries(op.values)) {
|
|
477
|
+
if (!columns.has(column)) {
|
|
478
|
+
throw new InspectError("bad_request", `${op.table} has no column ${column}`);
|
|
479
|
+
}
|
|
480
|
+
if (hidden?.has(column)) {
|
|
481
|
+
throw new InspectError("forbidden", `${op.table}.${column} is redacted for agents`);
|
|
482
|
+
}
|
|
483
|
+
values[column] = fromJsonForColumn(columns.get(column), value);
|
|
484
|
+
}
|
|
485
|
+
return { op, values };
|
|
486
|
+
});
|
|
487
|
+
const { db, as: asUser, asClaims, warning } = await dbFor(as);
|
|
488
|
+
const ids = [];
|
|
489
|
+
let result;
|
|
490
|
+
try {
|
|
491
|
+
result = await db.transaction((tx) => {
|
|
492
|
+
for (const { op, values } of prepared) {
|
|
493
|
+
const table = tableProxy(op.table);
|
|
494
|
+
if (op.kind === "insert") {
|
|
495
|
+
const inserted = tx.insert(table, values, op.id ? { id: op.id } : undefined);
|
|
496
|
+
ids.push(String(inserted.id ?? op.id ?? ""));
|
|
497
|
+
}
|
|
498
|
+
else if (op.kind === "update") {
|
|
499
|
+
tx.update(table, op.id, values);
|
|
500
|
+
ids.push(op.id);
|
|
501
|
+
}
|
|
502
|
+
else {
|
|
503
|
+
tx.delete(table, op.id);
|
|
504
|
+
ids.push(op.id);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
// The answer says the write stands: the core accepted it.
|
|
509
|
+
await result.wait({ tier: "global" });
|
|
510
|
+
}
|
|
511
|
+
catch (error) {
|
|
512
|
+
if (error instanceof InspectError)
|
|
513
|
+
throw error;
|
|
514
|
+
throw new InspectError("forbidden", `the write was refused: ${errorMessage(error)}${warning ? `. ${warning}` : ""}`);
|
|
515
|
+
}
|
|
516
|
+
return {
|
|
517
|
+
ids,
|
|
518
|
+
...(asUser ? { as: asUser } : {}),
|
|
519
|
+
...(asClaims ? { asClaims } : {}),
|
|
520
|
+
...(warning ? { warning } : {}),
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
/** `get` with `column`: one value of one row, whole or `from`–`to` of it. */
|
|
524
|
+
async function getValue(admitted, body, url) {
|
|
525
|
+
const column = body.column;
|
|
526
|
+
if (typeof column !== "string" || !column) {
|
|
527
|
+
throw new InspectError("bad_request", "column must name a column");
|
|
528
|
+
}
|
|
529
|
+
for (const bound of [body.from, body.to]) {
|
|
530
|
+
if (bound !== undefined && (!Number.isSafeInteger(bound) || bound < 0)) {
|
|
531
|
+
throw new InspectError("bad_request", "from and to must be whole numbers of at least 0");
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
const type = tableOf(body.table).columns.get(column);
|
|
535
|
+
if (!type)
|
|
536
|
+
throw new InspectError("not_found", `${body.table} has no column ${column}`);
|
|
537
|
+
const ranged = type.type === "Bytea" || type.type === "Text";
|
|
538
|
+
const unit = type.type === "Bytea" ? "bytes" : "UTF-16 code units";
|
|
539
|
+
const partLimit = type.type === "Bytea" ? MAX_PART_BYTES : MAX_PART_TEXT;
|
|
540
|
+
const where = { table: body.table, where: { id: body.id }, select: [column], limit: 1 };
|
|
541
|
+
const read = (part) => readRows(admitted, where, body.as, {
|
|
542
|
+
summarize: false,
|
|
543
|
+
...(part ? { part: { column, ...part } } : {}),
|
|
544
|
+
}).then((answer) => {
|
|
545
|
+
const row = answer.rows[0];
|
|
546
|
+
if (!row)
|
|
547
|
+
throw new InspectError("not_found", `${body.table} has no row ${body.id} to read`);
|
|
548
|
+
return { answer, value: row[column] };
|
|
549
|
+
});
|
|
550
|
+
const answerWith = (found, extra = {}) => ({
|
|
551
|
+
answer: {
|
|
552
|
+
value: found.value,
|
|
553
|
+
...extra,
|
|
554
|
+
...(found.answer.warning ? { warning: found.answer.warning } : {}),
|
|
555
|
+
inspectorUrl: inspectorLink(url, { table: body.table, row: body.id, as: body.as }),
|
|
556
|
+
},
|
|
557
|
+
event: { table: body.table, rows: 1, as: found.answer.as, asClaims: found.answer.asClaims },
|
|
558
|
+
});
|
|
559
|
+
if (body.from !== undefined || body.to !== undefined) {
|
|
560
|
+
if (!ranged) {
|
|
561
|
+
throw new InspectError("bad_request", `from and to are for a bytes or text column; ${column} is neither`);
|
|
562
|
+
}
|
|
563
|
+
const from = body.from ?? 0;
|
|
564
|
+
if (body.to === undefined) {
|
|
565
|
+
throw new InspectError("bad_request", `give to as well: the part ends there (${column}'s size is in its row's $large summary)`);
|
|
566
|
+
}
|
|
567
|
+
if (body.to < from)
|
|
568
|
+
throw new InspectError("bad_request", "to must not be before from");
|
|
569
|
+
if (body.to - from > partLimit) {
|
|
570
|
+
throw new InspectError("bad_request", `a part is at most ${partLimit} ${unit}: ask for ${column} in smaller parts`);
|
|
571
|
+
}
|
|
572
|
+
// A partial select clamps a range past the end of the value
|
|
573
|
+
// (#5502); a part shorter than asked for ran past it. An empty part
|
|
574
|
+
// is past the end when the unit before it is too: a probe the store
|
|
575
|
+
// refuses for splitting a character starts inside the value.
|
|
576
|
+
const found = await read({ from, to: body.to });
|
|
577
|
+
const length = partLength(found.value);
|
|
578
|
+
const unitBefore = async () => {
|
|
579
|
+
try {
|
|
580
|
+
return partLength((await read({ from: from - 1, to: from })).value);
|
|
581
|
+
}
|
|
582
|
+
catch (error) {
|
|
583
|
+
if (splitsCharacter(error))
|
|
584
|
+
return 1;
|
|
585
|
+
throw error;
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
const pastEnd = length !== undefined &&
|
|
589
|
+
(length < body.to - from || (from === body.to && from > 0 && (await unitBefore()) === 0));
|
|
590
|
+
if (pastEnd) {
|
|
591
|
+
throw new InspectError("bad_request", `${from}–${body.to} is past the end of ${column} (its size is in its row's $large summary)`);
|
|
592
|
+
}
|
|
593
|
+
return answerWith(found, { from, to: body.to });
|
|
594
|
+
}
|
|
595
|
+
if (ranged) {
|
|
596
|
+
// Not the whole value to find out it's too large: a part one past what
|
|
597
|
+
// an answer carries is either that long (too large) or clamped to a
|
|
598
|
+
// value that fits.
|
|
599
|
+
const probe = await read({ from: 0, to: partLimit + 1 });
|
|
600
|
+
if ((partLength(probe.value) ?? 0) > partLimit) {
|
|
601
|
+
throw new InspectError("bad_request", `${column} is longer than one answer carries (${partLimit} ${unit}): ask for it in parts with from and to`);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
const found = await read();
|
|
605
|
+
const encoded = JSON.stringify(found.value) ?? "";
|
|
606
|
+
if (encoded.length > MAX_ANSWER_BYTES) {
|
|
607
|
+
throw new InspectError("bad_request", `${column} is larger than one answer carries; parts (from and to) are for bytes and text columns only`);
|
|
608
|
+
}
|
|
609
|
+
const size = typeof found.value === "string"
|
|
610
|
+
? found.value.length
|
|
611
|
+
: type.type === "Bytea" && found.value
|
|
612
|
+
? fromJsonValue(found.value).length
|
|
613
|
+
: undefined;
|
|
614
|
+
return answerWith(found, size !== undefined ? { size } : {});
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* Which read-policy clause let `as` see each row `query` matches with the
|
|
618
|
+
* backend's authority, or that none did. The clauses are the arms of the
|
|
619
|
+
* table's policy's top-level `or`.
|
|
620
|
+
*/
|
|
621
|
+
async function explain(admitted, query, as) {
|
|
622
|
+
if (as === undefined) {
|
|
623
|
+
throw new InspectError("bad_request", "explain needs as: the user to explain for");
|
|
624
|
+
}
|
|
625
|
+
if (!query || typeof query !== "object" || typeof query.table !== "string") {
|
|
626
|
+
throw new InspectError("bad_request", "query needs { table, ... }");
|
|
627
|
+
}
|
|
628
|
+
if (historySourceTable(query.table) !== undefined) {
|
|
629
|
+
throw new InspectError("bad_request", "explain needs a table, not its history");
|
|
630
|
+
}
|
|
631
|
+
checkTable(admitted, query.table);
|
|
632
|
+
if (deps.schema()[query.table]?.branchBy?.length) {
|
|
633
|
+
throw new InspectError("not_supported", "explain for a table with branches is not supported yet");
|
|
634
|
+
}
|
|
635
|
+
// Every row the query matches, whoever may see it; then, as the user,
|
|
636
|
+
// which clauses hold for each.
|
|
637
|
+
const read = await readRows(admitted, query, undefined);
|
|
638
|
+
const { db, as: asUser, asClaims, warning } = await dbFor(as);
|
|
639
|
+
const policies = deps.permissions?.[query.table];
|
|
640
|
+
const policy = policies?.select?.using ?? policies?.select?.with_check;
|
|
641
|
+
const clauses = policyClauses(policy);
|
|
642
|
+
const ids = read.rows.map((row) => String(row.id));
|
|
643
|
+
const engine = db.explainReadClauses(tableProxy(query.table), ids);
|
|
644
|
+
// The clause numbers are the engine's, the text ours: both must split
|
|
645
|
+
// the same policy.
|
|
646
|
+
if (engine.clauses !== clauses.length) {
|
|
647
|
+
throw new InspectError("failed", `the read policy this backend was given for ${query.table} has ${clauses.length} clause(s), but the store judges reads by one with ${engine.clauses}: explain can't say which is which`);
|
|
648
|
+
}
|
|
649
|
+
const found = new Map(engine.rows.map((row) => [row.id, row.holds]));
|
|
650
|
+
// A table-scoped token doesn't see the app's permissions (see `schema`),
|
|
651
|
+
// so it gets the clauses' numbers without their text. Nor which clause
|
|
652
|
+
// let a row through, for it or a token with redacted columns here: a
|
|
653
|
+
// clause's verdict tells about what it reads (a redacted column's
|
|
654
|
+
// value, a table outside the token's scope).
|
|
655
|
+
const scoped = admitted.via === "token" && admitted.tables !== undefined;
|
|
656
|
+
const showPolicy = !scoped;
|
|
657
|
+
const showWhy = !scoped && !redactedFor(admitted, query.table);
|
|
658
|
+
const answer = {
|
|
659
|
+
table: query.table,
|
|
660
|
+
as: asUser,
|
|
661
|
+
clauses: clauses.map((clause, index) => ({
|
|
662
|
+
index,
|
|
663
|
+
...(showPolicy ? { text: renderPolicy(clause) } : {}),
|
|
664
|
+
})),
|
|
665
|
+
rows: read.rows.flatMap((row) => {
|
|
666
|
+
const holds = found.get(String(row.id));
|
|
667
|
+
// Gone between the two reads.
|
|
668
|
+
if (!holds)
|
|
669
|
+
return [];
|
|
670
|
+
const by = holds.flatMap((held, index) => (held ? [index] : []));
|
|
671
|
+
return [{ id: String(row.id), allowed: by.length > 0, ...(showWhy ? { by } : {}), row }];
|
|
672
|
+
}),
|
|
673
|
+
truncated: read.truncated,
|
|
674
|
+
...(policy === undefined
|
|
675
|
+
? { note: `${query.table} has no read policy, so every row is denied` }
|
|
676
|
+
: {}),
|
|
677
|
+
...(warning ? { warning } : {}),
|
|
678
|
+
};
|
|
679
|
+
return { answer, as: asUser, asClaims };
|
|
680
|
+
}
|
|
681
|
+
function schemaAnswer(admitted) {
|
|
682
|
+
const schema = deps.schema();
|
|
683
|
+
const tables = {};
|
|
684
|
+
for (const [name, table] of Object.entries(schema)) {
|
|
685
|
+
if (admitted.tables && !admitted.tables.includes(name))
|
|
686
|
+
continue;
|
|
687
|
+
const hidden = redactedFor(admitted, name);
|
|
688
|
+
tables[name] = {
|
|
689
|
+
...table,
|
|
690
|
+
...(hidden ? { redacted: [...hidden] } : {}),
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
return {
|
|
694
|
+
tables,
|
|
695
|
+
// What agents may query besides each table: its row history.
|
|
696
|
+
history: Object.keys(tables).map(historyTableName),
|
|
697
|
+
provenanceColumns: PROVENANCE,
|
|
698
|
+
...(admitted.via === "token" && admitted.tables ? {} : { permissions: deps.permissions }),
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
async function answer(request, admitted, body) {
|
|
702
|
+
const url = inspectorUrl(request);
|
|
703
|
+
switch (body.op) {
|
|
704
|
+
case "whoami": {
|
|
705
|
+
const whoami = {
|
|
706
|
+
appId: deps.appId,
|
|
707
|
+
clientAppId: accountAppId(endpointScope(endpointUrl(request))),
|
|
708
|
+
by: admitted.by,
|
|
709
|
+
via: admitted.via,
|
|
710
|
+
write: admitted.write,
|
|
711
|
+
...(admitted.tables ? { tables: admitted.tables } : {}),
|
|
712
|
+
...(admitted.expiresAt ? { expiresAt: admitted.expiresAt } : {}),
|
|
713
|
+
...(admitted.label ? { label: admitted.label } : {}),
|
|
714
|
+
maxTokenTtlSeconds: settings().maxTtl,
|
|
715
|
+
inspectorUrl: url,
|
|
716
|
+
protocol: INSPECT_PROTOCOL_VERSION,
|
|
717
|
+
};
|
|
718
|
+
return { answer: whoami, event: {} };
|
|
719
|
+
}
|
|
720
|
+
case "schema":
|
|
721
|
+
return { answer: schemaAnswer(admitted), event: {} };
|
|
722
|
+
case "query": {
|
|
723
|
+
const read = await readRows(admitted, body.query, body.as);
|
|
724
|
+
return {
|
|
725
|
+
answer: {
|
|
726
|
+
rows: read.rows,
|
|
727
|
+
truncated: read.truncated,
|
|
728
|
+
...(read.warning ? { warning: read.warning } : {}),
|
|
729
|
+
inspectorUrl: inspectorLink(url, {
|
|
730
|
+
query: body.query,
|
|
731
|
+
as: body.as,
|
|
732
|
+
}),
|
|
733
|
+
},
|
|
734
|
+
event: {
|
|
735
|
+
table: body.query.table,
|
|
736
|
+
rows: read.rows.length,
|
|
737
|
+
as: read.as,
|
|
738
|
+
asClaims: read.asClaims,
|
|
739
|
+
},
|
|
740
|
+
};
|
|
741
|
+
}
|
|
742
|
+
case "get": {
|
|
743
|
+
if (typeof body.id !== "string")
|
|
744
|
+
throw new InspectError("bad_request", "get needs an id");
|
|
745
|
+
if (body.column !== undefined)
|
|
746
|
+
return getValue(admitted, body, url);
|
|
747
|
+
const read = await readRows(admitted, {
|
|
748
|
+
table: body.table,
|
|
749
|
+
where: { id: body.id },
|
|
750
|
+
select: ["*", ...PROVENANCE],
|
|
751
|
+
limit: 1,
|
|
752
|
+
}, body.as);
|
|
753
|
+
return {
|
|
754
|
+
answer: {
|
|
755
|
+
row: read.rows[0] ?? null,
|
|
756
|
+
...(read.warning ? { warning: read.warning } : {}),
|
|
757
|
+
inspectorUrl: inspectorLink(url, {
|
|
758
|
+
table: body.table,
|
|
759
|
+
row: body.id,
|
|
760
|
+
as: body.as,
|
|
761
|
+
}),
|
|
762
|
+
},
|
|
763
|
+
event: {
|
|
764
|
+
table: body.table,
|
|
765
|
+
rows: read.rows.length,
|
|
766
|
+
as: read.as,
|
|
767
|
+
asClaims: read.asClaims,
|
|
768
|
+
},
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
case "history": {
|
|
772
|
+
if (typeof body.table !== "string" || !body.table) {
|
|
773
|
+
throw new InspectError("bad_request", "history needs a table");
|
|
774
|
+
}
|
|
775
|
+
if (typeof body.id !== "string") {
|
|
776
|
+
throw new InspectError("bad_request", "history needs an id");
|
|
777
|
+
}
|
|
778
|
+
const query = {
|
|
779
|
+
table: historyTableName(body.table),
|
|
780
|
+
where: { id: body.id },
|
|
781
|
+
select: ["*", "$updatedBy", "$updatedAt"],
|
|
782
|
+
orderBy: [["$acceptedAt", "asc"]],
|
|
783
|
+
limit: body.limit ?? 100,
|
|
784
|
+
};
|
|
785
|
+
const read = await readRows(admitted, query, undefined);
|
|
786
|
+
return {
|
|
787
|
+
answer: {
|
|
788
|
+
versions: read.rows,
|
|
789
|
+
truncated: read.truncated,
|
|
790
|
+
inspectorUrl: inspectorLink(url, { query, row: body.id }),
|
|
791
|
+
},
|
|
792
|
+
event: { table: body.table, rows: read.rows.length },
|
|
793
|
+
};
|
|
794
|
+
}
|
|
795
|
+
case "write": {
|
|
796
|
+
const done = await write(admitted, body.ops, body.as);
|
|
797
|
+
return {
|
|
798
|
+
answer: { ids: done.ids, ...(done.warning ? { warning: done.warning } : {}) },
|
|
799
|
+
event: {
|
|
800
|
+
table: [...new Set(body.ops.map((op) => op.table))].join(","),
|
|
801
|
+
rows: done.ids.length,
|
|
802
|
+
as: done.as,
|
|
803
|
+
asClaims: done.asClaims,
|
|
804
|
+
write: true,
|
|
805
|
+
},
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
case "sessions":
|
|
809
|
+
// Who is connected is about the whole app, not one table.
|
|
810
|
+
if (admitted.tables) {
|
|
811
|
+
throw new InspectError("forbidden", `this token is limited to ${admitted.tables.join(", ")}; listing sessions needs one for the whole app`);
|
|
812
|
+
}
|
|
813
|
+
return {
|
|
814
|
+
answer: {
|
|
815
|
+
// Each backend instance knows only the sessions it serves.
|
|
816
|
+
scope: "this backend instance",
|
|
817
|
+
sessions: deps.sessions(),
|
|
818
|
+
},
|
|
819
|
+
event: {},
|
|
820
|
+
};
|
|
821
|
+
case "explain": {
|
|
822
|
+
const explained = await explain(admitted, body.query, body.as);
|
|
823
|
+
return {
|
|
824
|
+
answer: {
|
|
825
|
+
...explained.answer,
|
|
826
|
+
inspectorUrl: inspectorLink(url, { query: body.query, as: body.as }),
|
|
827
|
+
},
|
|
828
|
+
event: {
|
|
829
|
+
table: body.query?.table,
|
|
830
|
+
rows: explained.answer.rows.length,
|
|
831
|
+
as: explained.as,
|
|
832
|
+
asClaims: explained.asClaims,
|
|
833
|
+
},
|
|
834
|
+
};
|
|
835
|
+
}
|
|
836
|
+
case "link": {
|
|
837
|
+
if (body.query)
|
|
838
|
+
checkTable(admitted, body.query.table);
|
|
839
|
+
else if (body.table)
|
|
840
|
+
checkTable(admitted, body.table);
|
|
841
|
+
return {
|
|
842
|
+
answer: {
|
|
843
|
+
inspectorUrl: inspectorLink(url, {
|
|
844
|
+
query: body.query,
|
|
845
|
+
table: body.table,
|
|
846
|
+
row: body.row,
|
|
847
|
+
as: body.as,
|
|
848
|
+
}),
|
|
849
|
+
},
|
|
850
|
+
event: {},
|
|
851
|
+
};
|
|
852
|
+
}
|
|
853
|
+
case "mint_token": {
|
|
854
|
+
const minted = await mintToken(admitted, body);
|
|
855
|
+
return {
|
|
856
|
+
answer: { token: minted.token, expiresAt: minted.expiresAt },
|
|
857
|
+
event: {
|
|
858
|
+
tokenId: minted.tokenId,
|
|
859
|
+
write: body.write === true,
|
|
860
|
+
...(minted.label ? { label: minted.label } : {}),
|
|
861
|
+
},
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
default:
|
|
865
|
+
throw new InspectError("bad_request", `unknown op ${JSON.stringify(body.op)}`);
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
function errorResponse(error) {
|
|
869
|
+
return Response.json({ error: error.code, message: error.message }, {
|
|
870
|
+
status: INSPECT_ERRORS[error.code],
|
|
871
|
+
headers: { "Cache-Control": "no-store" },
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
async function handleApi(request) {
|
|
875
|
+
if (request.method !== "POST") {
|
|
876
|
+
return new Response(null, { status: 405, headers: { Allow: "POST" } });
|
|
877
|
+
}
|
|
878
|
+
// A form or a plain-text POST from another page can't be JSON: this
|
|
879
|
+
// keeps cross-site requests that a browser sends without asking out.
|
|
880
|
+
if (!request.headers.get("content-type")?.toLowerCase().startsWith("application/json")) {
|
|
881
|
+
return errorResponse(new InspectError("bad_request", "send application/json"));
|
|
882
|
+
}
|
|
883
|
+
let admitted;
|
|
884
|
+
try {
|
|
885
|
+
admitted = await admit(request);
|
|
886
|
+
}
|
|
887
|
+
catch (error) {
|
|
888
|
+
const refused = asInspectError(error);
|
|
889
|
+
audit({
|
|
890
|
+
at: now(),
|
|
891
|
+
by: "?",
|
|
892
|
+
via: request.headers.get("authorization")?.startsWith(`Bearer ${INSPECT_TOKEN_PREFIX}`)
|
|
893
|
+
? "token"
|
|
894
|
+
: deps.hook
|
|
895
|
+
? "hook"
|
|
896
|
+
: "dev",
|
|
897
|
+
op: "whoami",
|
|
898
|
+
write: false,
|
|
899
|
+
error: refused.code,
|
|
900
|
+
});
|
|
901
|
+
return errorResponse(refused);
|
|
902
|
+
}
|
|
903
|
+
let body;
|
|
904
|
+
try {
|
|
905
|
+
const text = await request.text();
|
|
906
|
+
if (text.length > MAX_REQUEST_BYTES)
|
|
907
|
+
throw new InspectError("too_large", "request too large");
|
|
908
|
+
body = JSON.parse(text);
|
|
909
|
+
if (!body || typeof body !== "object" || typeof body.op !== "string") {
|
|
910
|
+
throw new InspectError("bad_request", "send { op, ... }");
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
catch (error) {
|
|
914
|
+
return errorResponse(error instanceof InspectError ? error : new InspectError("bad_request", "invalid JSON"));
|
|
915
|
+
}
|
|
916
|
+
const base = {
|
|
917
|
+
at: now(),
|
|
918
|
+
by: admitted.by,
|
|
919
|
+
via: admitted.via,
|
|
920
|
+
op: body.op,
|
|
921
|
+
write: false,
|
|
922
|
+
...(admitted.tokenId ? { tokenId: admitted.tokenId } : {}),
|
|
923
|
+
...(admitted.label ? { label: admitted.label } : {}),
|
|
924
|
+
};
|
|
925
|
+
try {
|
|
926
|
+
const { answer: result, event } = await answer(request, admitted, body);
|
|
927
|
+
audit(clean({ ...base, ...event }));
|
|
928
|
+
return Response.json(result, {
|
|
929
|
+
headers: { "Cache-Control": "no-store" },
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
catch (error) {
|
|
933
|
+
const failed = asInspectError(error);
|
|
934
|
+
audit(clean({ ...base, write: body.op === "write", error: failed.code }));
|
|
935
|
+
if (!(error instanceof InspectError))
|
|
936
|
+
console.error("jazz inspect: call failed", error);
|
|
937
|
+
return errorResponse(failed);
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
return {
|
|
941
|
+
/** Answer a request for `path` (below `basePath`), which starts with `/inspect`. */
|
|
942
|
+
async handle(request, path) {
|
|
943
|
+
if (path === INSPECT_API_PATH)
|
|
944
|
+
return handleApi(request);
|
|
945
|
+
if (path === INSPECT_PATH || path.startsWith(`${INSPECT_PATH}/`)) {
|
|
946
|
+
if (request.method !== "GET" && request.method !== "HEAD") {
|
|
947
|
+
return new Response(null, { status: 405 });
|
|
948
|
+
}
|
|
949
|
+
const served = await deps.serveUi(request, path.slice(INSPECT_PATH.length));
|
|
950
|
+
return (served ??
|
|
951
|
+
new Response("This jazz-tools build has no Inspector UI. The API at " +
|
|
952
|
+
`${deps.basePath}${INSPECT_API_PATH} works: try \`npx jazz-tools inspect\`.`, {
|
|
953
|
+
status: 404,
|
|
954
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" },
|
|
955
|
+
}));
|
|
956
|
+
}
|
|
957
|
+
return new Response("Not found", { status: 404 });
|
|
958
|
+
},
|
|
959
|
+
// For tests.
|
|
960
|
+
mintToken,
|
|
961
|
+
verifyToken,
|
|
962
|
+
};
|
|
963
|
+
}
|
|
964
|
+
/** The most of a bytes value `get` answers at once: its base64 stays within an answer. */
|
|
965
|
+
const MAX_PART_BYTES = 512 * 1024;
|
|
966
|
+
/** The most UTF-16 code units of a text value `get` answers at once. */
|
|
967
|
+
const MAX_PART_TEXT = 256 * 1024;
|
|
968
|
+
/** The store refused a range for splitting a code point or surrogate pair. */
|
|
969
|
+
function splitsCharacter(error) {
|
|
970
|
+
return /splits a (surrogate pair|code point)/.test(error instanceof Error ? error.message : String(error));
|
|
971
|
+
}
|
|
972
|
+
/** The length of a part of a text (UTF-16 code units) or bytes value. */
|
|
973
|
+
function partLength(value) {
|
|
974
|
+
if (typeof value === "string")
|
|
975
|
+
return value.length;
|
|
976
|
+
const bytes = fromJsonValue(value);
|
|
977
|
+
return bytes instanceof Uint8Array ? bytes.length : undefined;
|
|
978
|
+
}
|
|
979
|
+
function asInspectError(error) {
|
|
980
|
+
if (error instanceof InspectError)
|
|
981
|
+
return error;
|
|
982
|
+
// Whoever got this far may read every row, so the runtime's reason (an
|
|
983
|
+
// unknown column, a bad operator) is theirs to see.
|
|
984
|
+
return new InspectError("failed", errorMessage(error));
|
|
985
|
+
}
|
|
986
|
+
function errorMessage(error) {
|
|
987
|
+
return error instanceof Error ? error.message : String(error);
|
|
988
|
+
}
|
|
989
|
+
function clean(event) {
|
|
990
|
+
return Object.fromEntries(Object.entries(event).filter(([, value]) => value !== undefined && value !== ""));
|
|
991
|
+
}
|
|
992
|
+
function isLoopbackAddress(address) {
|
|
993
|
+
return (address === "::1" ||
|
|
994
|
+
/^127\.\d+\.\d+\.\d+$/.test(address) ||
|
|
995
|
+
/^::ffff:127\.\d+\.\d+\.\d+$/.test(address));
|
|
996
|
+
}
|
|
997
|
+
/** A random secret for stores that keep one beside their data. */
|
|
998
|
+
export function newTokenSecret() {
|
|
999
|
+
return randomBytes(32).toString("base64url");
|
|
1000
|
+
}
|
|
1001
|
+
//# sourceMappingURL=inspect.js.map
|