jazz-tools 2.0.0-alpha.7 → 2.0.0-alpha.70
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 +135 -7
- package/bin/jazz-tools.js +101 -45
- 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 +34 -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/create-account-manager.d.ts +57 -0
- package/dist/accounts/create-account-manager.d.ts.map +1 -0
- package/dist/accounts/create-account-manager.js +17 -0
- package/dist/accounts/create-account-manager.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 +13 -0
- package/dist/backend/api.d.ts.map +1 -0
- package/dist/backend/api.js +13 -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 +123 -0
- package/dist/backend/create-jazz-context.d.ts.map +1 -0
- package/dist/backend/create-jazz-context.js +716 -0
- package/dist/backend/create-jazz-context.js.map +1 -0
- 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 +683 -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 -1
- package/dist/backend/index.d.ts.map +1 -1
- package/dist/backend/index.js +18 -1
- 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 +1387 -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 +39 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +471 -265
- package/dist/cli.js.map +1 -1
- package/dist/client/index.d.ts +10 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +7 -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 +54 -65
- 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 +130 -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-D3RK8wNj.js +5 -0
- package/dist/dev/inspector-overlay/embedded/assets/jazz-broker-worker-EyaWhBtz.js +5 -0
- package/dist/dev/inspector-overlay/embedded/assets/jazz_wasm-O10pptvY.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/jazz_wasm_bg-wI43fvvq.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 +190 -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 +21 -0
- package/dist/drivers/schema-wire.d.ts.map +1 -0
- package/dist/drivers/schema-wire.js +67 -0
- package/dist/drivers/schema-wire.js.map +1 -0
- package/dist/drivers/types.d.ts +315 -45
- package/dist/drivers/types.d.ts.map +1 -1
- package/dist/drivers/types.js +5 -4
- 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 +13 -0
- package/dist/expo/index.d.ts.map +1 -0
- package/dist/expo/index.js +12 -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 +23 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -11
- 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 +143 -115
- 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/index.d.ts +4 -145
- package/dist/permissions/index.d.ts.map +1 -1
- package/dist/permissions/index.js +10 -1185
- package/dist/permissions/index.js.map +1 -1
- 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 +48 -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 -10
- package/dist/react/create-jazz-client.d.ts.map +1 -1
- package/dist/react/create-jazz-client.js +1 -25
- package/dist/react/create-jazz-client.js.map +1 -1
- package/dist/react/index.d.ts +15 -6
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +10 -5
- 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 -13
- package/dist/react/provider.d.ts.map +1 -1
- package/dist/react/provider.js +25 -4
- 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 +10 -4
- package/dist/react-core/index.d.ts.map +1 -1
- package/dist/react-core/index.js +12 -2
- package/dist/react-core/index.js.map +1 -1
- package/dist/react-core/provider.d.ts +56 -12
- package/dist/react-core/provider.d.ts.map +1 -1
- package/dist/react-core/provider.js +128 -11
- 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 +21 -9
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js +17 -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 +20 -12
- package/dist/react-native/provider.d.ts.map +1 -1
- package/dist/react-native/provider.js +25 -4
- 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/removed-api.d.ts +87 -0
- package/dist/removed-api.d.ts.map +1 -0
- package/dist/removed-api.js +95 -0
- package/dist/removed-api.js.map +1 -0
- package/dist/removed-schema-api.d.ts +80 -0
- package/dist/removed-schema-api.d.ts.map +1 -0
- package/dist/removed-schema-api.js +128 -0
- package/dist/removed-schema-api.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 -13
- package/dist/runtime/client-session.d.ts.map +1 -1
- package/dist/runtime/client-session.js +212 -196
- package/dist/runtime/client-session.js.map +1 -1
- package/dist/runtime/client.d.ts +723 -190
- package/dist/runtime/client.d.ts.map +1 -1
- package/dist/runtime/client.js +1220 -416
- 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 +869 -201
- package/dist/runtime/db.d.ts.map +1 -1
- package/dist/runtime/db.js +3491 -758
- 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 -11
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +14 -10
- 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 +477 -185
- 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 +182 -39
- 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 +157 -43
- 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 +55 -0
- package/dist/schema-builders.d.ts.map +1 -0
- package/dist/schema-builders.js +33 -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/deprecated-session-hook.d.ts +8 -0
- package/dist/session/deprecated-session-hook.d.ts.map +1 -0
- package/dist/session/deprecated-session-hook.js +28 -0
- package/dist/session/deprecated-session-hook.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 +14 -0
- package/dist/solid/index.d.ts.map +1 -0
- package/dist/solid/index.js +10 -0
- package/dist/solid/index.ssr.js +10 -0
- package/dist/solid/provider.d.ts +36 -0
- package/dist/solid/provider.d.ts.map +1 -0
- package/dist/solid/provider.js +54 -0
- package/dist/solid/provider.js.map +1 -0
- package/dist/solid/provider.ssr.js +58 -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 +93 -13
- package/dist/subscriptions-orchestrator.d.ts.map +1 -1
- package/dist/subscriptions-orchestrator.js +392 -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/JazzSvelteProvider.svelte +160 -28
- package/dist/svelte/JazzSvelteProvider.svelte.d.ts +4 -3
- package/dist/svelte/JazzSvelteProvider.svelte.d.ts.map +1 -1
- package/dist/svelte/context.svelte.d.ts +30 -3
- package/dist/svelte/context.svelte.d.ts.map +1 -1
- package/dist/svelte/context.svelte.js +37 -3
- 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 -6
- package/dist/svelte/index.d.ts.map +1 -1
- package/dist/svelte/index.js +11 -6
- 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 +81 -0
- package/dist/thin/index.d.ts.map +1 -0
- package/dist/thin/index.js +221 -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/upgrade/aliases.d.ts +25 -0
- package/dist/upgrade/aliases.d.ts.map +1 -0
- package/dist/upgrade/aliases.js +80 -0
- package/dist/upgrade/aliases.js.map +1 -0
- package/dist/upgrade/app-json.d.ts +32 -0
- package/dist/upgrade/app-json.d.ts.map +1 -0
- package/dist/upgrade/app-json.js +145 -0
- package/dist/upgrade/app-json.js.map +1 -0
- package/dist/upgrade/constants.d.ts +25 -0
- package/dist/upgrade/constants.d.ts.map +1 -0
- package/dist/upgrade/constants.js +136 -0
- package/dist/upgrade/constants.js.map +1 -0
- package/dist/upgrade/edits.d.ts +10 -0
- package/dist/upgrade/edits.d.ts.map +1 -0
- package/dist/upgrade/edits.js +21 -0
- package/dist/upgrade/edits.js.map +1 -0
- package/dist/upgrade/errors.d.ts +12 -0
- package/dist/upgrade/errors.d.ts.map +1 -0
- package/dist/upgrade/errors.js +18 -0
- package/dist/upgrade/errors.js.map +1 -0
- package/dist/upgrade/extras.d.ts +42 -0
- package/dist/upgrade/extras.d.ts.map +1 -0
- package/dist/upgrade/extras.js +487 -0
- package/dist/upgrade/extras.js.map +1 -0
- package/dist/upgrade/fresh.d.ts +36 -0
- package/dist/upgrade/fresh.d.ts.map +1 -0
- package/dist/upgrade/fresh.js +154 -0
- package/dist/upgrade/fresh.js.map +1 -0
- package/dist/upgrade/index.d.ts +79 -0
- package/dist/upgrade/index.d.ts.map +1 -0
- package/dist/upgrade/index.js +806 -0
- package/dist/upgrade/index.js.map +1 -0
- package/dist/upgrade/json-only.d.ts +24 -0
- package/dist/upgrade/json-only.d.ts.map +1 -0
- package/dist/upgrade/json-only.js +124 -0
- package/dist/upgrade/json-only.js.map +1 -0
- package/dist/upgrade/names.d.ts +29 -0
- package/dist/upgrade/names.d.ts.map +1 -0
- package/dist/upgrade/names.js +105 -0
- package/dist/upgrade/names.js.map +1 -0
- package/dist/upgrade/payload-enums.d.ts +18 -0
- package/dist/upgrade/payload-enums.d.ts.map +1 -0
- package/dist/upgrade/payload-enums.js +52 -0
- package/dist/upgrade/payload-enums.js.map +1 -0
- package/dist/upgrade/permissions-check.d.ts +10 -0
- package/dist/upgrade/permissions-check.d.ts.map +1 -0
- package/dist/upgrade/permissions-check.js +85 -0
- package/dist/upgrade/permissions-check.js.map +1 -0
- package/dist/upgrade/program.d.ts +18 -0
- package/dist/upgrade/program.d.ts.map +1 -0
- package/dist/upgrade/program.js +56 -0
- package/dist/upgrade/program.js.map +1 -0
- package/dist/upgrade/project.d.ts +56 -0
- package/dist/upgrade/project.d.ts.map +1 -0
- package/dist/upgrade/project.js +254 -0
- package/dist/upgrade/project.js.map +1 -0
- package/dist/upgrade/rewrite.d.ts +34 -0
- package/dist/upgrade/rewrite.d.ts.map +1 -0
- package/dist/upgrade/rewrite.js +500 -0
- package/dist/upgrade/rewrite.js.map +1 -0
- package/dist/upgrade/schema-ts.d.ts +59 -0
- package/dist/upgrade/schema-ts.d.ts.map +1 -0
- package/dist/upgrade/schema-ts.js +582 -0
- package/dist/upgrade/schema-ts.js.map +1 -0
- package/dist/upgrade/snapshot.d.ts +11 -0
- package/dist/upgrade/snapshot.d.ts.map +1 -0
- package/dist/upgrade/snapshot.js +90 -0
- package/dist/upgrade/snapshot.js.map +1 -0
- package/dist/upgrade/upgrade-test-helpers.d.ts +12 -0
- package/dist/upgrade/upgrade-test-helpers.d.ts.map +1 -0
- package/dist/upgrade/upgrade-test-helpers.js +72 -0
- package/dist/upgrade/upgrade-test-helpers.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 +14 -0
- package/dist/vue/index.d.ts.map +1 -0
- package/dist/vue/index.js +11 -0
- package/dist/vue/index.js.map +1 -0
- package/dist/vue/provider.d.ts +83 -0
- package/dist/vue/provider.d.ts.map +1 -0
- package/dist/vue/provider.js +231 -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 +8 -0
- package/dist/web/lazy-local-first.d.ts.map +1 -0
- package/dist/web/lazy-local-first.js +13 -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 +301 -35
- 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/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 -925
- 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 -334
- 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 -195
- 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/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.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 -151
- 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 -84
- 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 -133
- 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 -150
- 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 -171
- 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 -985
- package/dist/runtime/cloud-server.integration.test.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 -1276
- 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 -389
- package/dist/runtime/row-transformer.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 -75
- 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 -226
- package/dist/runtime/value-converter.test.js.map +0 -1
- package/dist/runtime/worker-bridge.d.ts +0 -86
- package/dist/runtime/worker-bridge.d.ts.map +0 -1
- package/dist/runtime/worker-bridge.js +0 -250
- 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 -265
- 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 -194
- 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/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 -51
- 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 -154
- 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 -176
- 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/worker/jazz-worker.d.ts +0 -9
- package/dist/worker/jazz-worker.d.ts.map +0 -1
- package/dist/worker/jazz-worker.js +0 -516
- package/dist/worker/jazz-worker.js.map +0 -1
- package/dist/worker/jazz-worker.ts +0 -581
- 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,1112 @@
|
|
|
1
|
+
import { fetchFor, inProcessWebSocketFor } from "../in-process-transport.js";
|
|
2
|
+
import { httpStreamFallbackWebSocket } from "./http-stream-socket.js";
|
|
3
|
+
import { Utf8Decoder } from "../utf8.js";
|
|
4
|
+
import { httpUrlToWs } from "../url.js";
|
|
5
|
+
import { mapAuthReason } from "../auth-state.js";
|
|
6
|
+
import { canonicalAuthorSubject, isUsableSubject, parseCanonicalAuthorSubject, } from "../author-id.js";
|
|
7
|
+
import { parseJwtPayload, policyClaimsFromJwtPayload } from "../client-session.js";
|
|
8
|
+
import { PostcardReader, PostcardWriter } from "./native-codec.js";
|
|
9
|
+
import { SESSION_RENEWAL_HEADER, SESSION_RENEWAL_PRELUDE_FIELD, decodeRenewSoonFrame, encodeRenewFrame, isRenewSoonFrame, renewalUrlFor, sessionRefreshLockName, } from "./session-renewal-wire.js";
|
|
10
|
+
/** A valid structured server error received before wire negotiation completed. */
|
|
11
|
+
export class PreHelloWireError extends Error {
|
|
12
|
+
wireError;
|
|
13
|
+
constructor(wireError) {
|
|
14
|
+
super(`websocket ${wireError.code} before server hello: ${wireError.message}`);
|
|
15
|
+
this.name = "PreHelloWireError";
|
|
16
|
+
this.wireError = wireError;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Whether a server error asks this client to reconnect with backoff.
|
|
21
|
+
*
|
|
22
|
+
* `later` alone is not enough: an authentication or malformed-frame error can
|
|
23
|
+
* carry it too, and retrying those cannot succeed. Only the server's transient
|
|
24
|
+
* overload and bootstrap signals end the link without ending the client.
|
|
25
|
+
*/
|
|
26
|
+
export function isReconnectLaterWireError(error) {
|
|
27
|
+
return error.retry === "later" && (error.code === "not_ready" || error.code === "backpressure");
|
|
28
|
+
}
|
|
29
|
+
/** How the app's backend starts the message of a planned re-authentication. */
|
|
30
|
+
export const REAUTHENTICATE_WIRE_MESSAGE_PREFIX = "reauthenticate:";
|
|
31
|
+
/**
|
|
32
|
+
* Whether the server ended an admitted session because the expiry its app's
|
|
33
|
+
* auth gave it is near, asking the client to connect again so the app's
|
|
34
|
+
* `authenticate` decides with the client's current credential. It is an
|
|
35
|
+
* `auth_failed` error with `after_resume` retry whose message starts with
|
|
36
|
+
* {@link REAUTHENTICATE_WIRE_MESSAGE_PREFIX}: the core sends the same code
|
|
37
|
+
* and retry for other refusals (a session that no longer matches), which
|
|
38
|
+
* stay refusals. A client that doesn't know it treats it as a refused
|
|
39
|
+
* credential and asks its backend again.
|
|
40
|
+
*/
|
|
41
|
+
export function isReauthenticateWireError(error) {
|
|
42
|
+
if (error.code !== "auth_failed")
|
|
43
|
+
return false;
|
|
44
|
+
// A reason this client knows decides; one from a newer server does not.
|
|
45
|
+
if (error.reason !== undefined && !error.reason.startsWith("unknown:")) {
|
|
46
|
+
return error.reason === "reauthenticate";
|
|
47
|
+
}
|
|
48
|
+
return (error.retry === "after_resume" && error.message.startsWith(REAUTHENTICATE_WIRE_MESSAGE_PREFIX));
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Whether the carrier itself ended the link because the socket went away:
|
|
52
|
+
* closed, failed, or silent past {@link HEARTBEAT_SILENCE_MS}. These are
|
|
53
|
+
* network outages, which a client retries however long they last.
|
|
54
|
+
*/
|
|
55
|
+
export function isSocketDropWireError(error) {
|
|
56
|
+
return (error.retry === "later" &&
|
|
57
|
+
(error.code === "websocket_closed" ||
|
|
58
|
+
error.code === "websocket_error" ||
|
|
59
|
+
error.code === "websocket_silent"));
|
|
60
|
+
}
|
|
61
|
+
const KNOWN_WIRE_ERROR_CODES = new Set([
|
|
62
|
+
"unsupported_protocol_version",
|
|
63
|
+
"unsupported_feature",
|
|
64
|
+
"malformed_frame",
|
|
65
|
+
"auth_failed",
|
|
66
|
+
"backpressure",
|
|
67
|
+
"internal",
|
|
68
|
+
"not_ready",
|
|
69
|
+
]);
|
|
70
|
+
const KNOWN_WIRE_RETRIES = new Set(["never", "after_auth", "after_resume", "later"]);
|
|
71
|
+
/**
|
|
72
|
+
* How a link classifies the `error` a connection ended with, for hosts that
|
|
73
|
+
* cannot call the Rust link (the thin client). Rust decides this
|
|
74
|
+
* (`LinkFailure::from_wire_error`); this copy is held to the same table
|
|
75
|
+
* (`crates/jazz/layers/db/fixtures/link_wire_failure_v1.json`). Decided by
|
|
76
|
+
* `code`, never by `retry` alone: a malformed frame or a refused credential
|
|
77
|
+
* can carry `later`. A code or retry this client does not know came from a
|
|
78
|
+
* newer server: a refusal, retried, never a stop.
|
|
79
|
+
*/
|
|
80
|
+
export function classifyWireLinkFailure(error, admitted) {
|
|
81
|
+
if (isSocketDropWireError(error))
|
|
82
|
+
return "network";
|
|
83
|
+
if (isLocalProtocolWireError(error))
|
|
84
|
+
return "fatal";
|
|
85
|
+
// A code or retry from a newer server, even on `auth_failed`: native
|
|
86
|
+
// clients cannot decode it at all and retry it, so every host does.
|
|
87
|
+
if (!KNOWN_WIRE_ERROR_CODES.has(error.code) || !KNOWN_WIRE_RETRIES.has(error.retry)) {
|
|
88
|
+
return "refused";
|
|
89
|
+
}
|
|
90
|
+
if (error.code === "auth_failed") {
|
|
91
|
+
return isReauthenticateWireError(error) ? "reauthenticate" : "authRejected";
|
|
92
|
+
}
|
|
93
|
+
// `internal` with `later`: a runtime that cannot serve the session now.
|
|
94
|
+
if (isReconnectLaterWireError(error) || (error.code === "internal" && error.retry === "later")) {
|
|
95
|
+
if (admitted)
|
|
96
|
+
return "network";
|
|
97
|
+
return error.code === "not_ready" ? "serverNotReady" : "refused";
|
|
98
|
+
}
|
|
99
|
+
return "fatal";
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Whether the carrier itself ended the link for good: it could not handle
|
|
103
|
+
* what the server sent (`protocol_error`), or its socket ended in a way it
|
|
104
|
+
* does not retry (a `websocket_*` code without `later`). These are the
|
|
105
|
+
* carrier's codes, not a server's, so the link never sees them as unknown
|
|
106
|
+
* server codes: they stop the link.
|
|
107
|
+
*/
|
|
108
|
+
export function isLocalProtocolWireError(error) {
|
|
109
|
+
if (error.code === "protocol_error")
|
|
110
|
+
return true;
|
|
111
|
+
return ((error.code === "websocket_closed" ||
|
|
112
|
+
error.code === "websocket_error" ||
|
|
113
|
+
error.code === "websocket_silent") &&
|
|
114
|
+
!isSocketDropWireError(error));
|
|
115
|
+
}
|
|
116
|
+
export function isRetryablePreHelloWireError(error) {
|
|
117
|
+
return error instanceof PreHelloWireError && isReconnectLaterWireError(error.wireError);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* The sole Jazz wire-protocol version. This is distinct from independently
|
|
121
|
+
* versioned v1 storage, catalogue, and binding formats.
|
|
122
|
+
*/
|
|
123
|
+
export const WIRE_PROTOCOL_VERSION = 6;
|
|
124
|
+
export const MIN_WIRE_PROTOCOL_VERSION = WIRE_PROTOCOL_VERSION;
|
|
125
|
+
export const MAX_WIRE_PROTOCOL_VERSION = WIRE_PROTOCOL_VERSION;
|
|
126
|
+
export const FEATURE_PAYLOAD_ZSTD = 1 << 4;
|
|
127
|
+
export const FEATURE_AUTHORIZATION_SCOPE_VIEWS = 1 << 7;
|
|
128
|
+
export const FEATURE_AUXILIARY_CHUNKS = 1 << 8;
|
|
129
|
+
/**
|
|
130
|
+
* `FEATURE_HEARTBEAT` in `crates/jazz/layers/protocol/src/wire.rs`: the server
|
|
131
|
+
* sends a `Heartbeat` frame on its keepalive cadence (20 s). The WebSocket API
|
|
132
|
+
* shows neither pings nor partial messages, so this is how a carrier tells a
|
|
133
|
+
* link that went silently dead (a half-open TCP connection, a stalled proxy)
|
|
134
|
+
* from a quiet one. Every carrier asks for it; it never reaches the runtime
|
|
135
|
+
* above.
|
|
136
|
+
*/
|
|
137
|
+
export const FEATURE_HEARTBEAT = 1 << 11;
|
|
138
|
+
/**
|
|
139
|
+
* How long a heartbeat link may stay silent before the carrier gives it up.
|
|
140
|
+
* A message arrives whole, and a heartbeat queues behind the message being
|
|
141
|
+
* sent, so this also bounds the slowest link a full 2 MiB message survives:
|
|
142
|
+
* about 18 KB/s. A link slower than that is treated as gone.
|
|
143
|
+
*/
|
|
144
|
+
export const HEARTBEAT_SILENCE_MS = 120_000;
|
|
145
|
+
/**
|
|
146
|
+
* `FEATURE_TYPED_ERROR_REASON` in `crates/jazz/layers/protocol/src/wire.rs`:
|
|
147
|
+
* a client that offers it is told why a server refused its credential at the
|
|
148
|
+
* end of the `Error` frame's body, instead of only in the message. Every carrier
|
|
149
|
+
* offers it; the server never does, so it never reaches the runtime above.
|
|
150
|
+
*/
|
|
151
|
+
export const FEATURE_TYPED_ERROR_REASON = 1 << 14;
|
|
152
|
+
/**
|
|
153
|
+
* How long a connection may take from opening the socket to the server's
|
|
154
|
+
* hello. An attempt nobody answers (a proxy holding the upgrade for a
|
|
155
|
+
* backend that is down, packets dropped on the way) otherwise never ends,
|
|
156
|
+
* and the link, which reports an outage only when an attempt fails, would
|
|
157
|
+
* read "connecting" for as long as it hangs (#5225). A server that is still
|
|
158
|
+
* starting answers at once (`not_ready`), so this only bounds silence.
|
|
159
|
+
*/
|
|
160
|
+
export const HANDSHAKE_TIMEOUT_MS = 10_000;
|
|
161
|
+
/** A silence past the limit is confirmed after this long, so that messages
|
|
162
|
+
* a frozen page or a long task held back are delivered before it counts. */
|
|
163
|
+
const HEARTBEAT_CONFIRM_MS = 1_000;
|
|
164
|
+
const WIRE_FRAME_HEARTBEAT = 7;
|
|
165
|
+
/**
|
|
166
|
+
* `FEATURE_SERIALIZABLE_BRANCH_READS` in `crates/jazz/layers/protocol/src/wire.rs`:
|
|
167
|
+
* the server validates a serializable transaction's reads through a branch
|
|
168
|
+
* view at commit. Without it, the core refuses to commit such a transaction
|
|
169
|
+
* upstream rather than have it validated against the wrong rows (jazz#5806).
|
|
170
|
+
*/
|
|
171
|
+
export const FEATURE_SERIALIZABLE_BRANCH_READS = 1 << 12;
|
|
172
|
+
/**
|
|
173
|
+
* `FEATURE_TEXT_AFFIX_PREDICATES` in `crates/jazz/layers/protocol/src/wire.rs`:
|
|
174
|
+
* the server decodes the text prefix/suffix query predicates. Without it, the
|
|
175
|
+
* core refuses a read or commit using them rather than send what an older
|
|
176
|
+
* server cannot decode (and would drop the link over).
|
|
177
|
+
*/
|
|
178
|
+
export const FEATURE_TEXT_AFFIX_PREDICATES = 1 << 13;
|
|
179
|
+
export const CLIENT_WIRE_FEATURES = FEATURE_PAYLOAD_ZSTD |
|
|
180
|
+
FEATURE_AUTHORIZATION_SCOPE_VIEWS |
|
|
181
|
+
FEATURE_AUXILIARY_CHUNKS |
|
|
182
|
+
FEATURE_SERIALIZABLE_BRANCH_READS |
|
|
183
|
+
FEATURE_TEXT_AFFIX_PREDICATES;
|
|
184
|
+
// The server route accepts WebSocket messages up to one MiB. Reserve enough
|
|
185
|
+
// postcard framing bytes that a burst of otherwise-valid wire frames remains
|
|
186
|
+
// a valid WebSocket message.
|
|
187
|
+
const MAX_WEBSOCKET_BATCH_BYTES = 1 << 20;
|
|
188
|
+
const POSTCARD_FRAME_LENGTH_RESERVE = 5;
|
|
189
|
+
const POSTCARD_BATCH_LENGTH_RESERVE = 5;
|
|
190
|
+
// Keep these fixed protocol limits aligned with jazz::protocol_limits. The
|
|
191
|
+
// browser implementation cannot import the Rust core, so this boundary spells
|
|
192
|
+
// them out beside the matching postcard carrier decoder.
|
|
193
|
+
const MAX_WIRE_FRAME_BYTES = 2 * 1024 * 1024;
|
|
194
|
+
const MAX_WIRE_BATCH_FRAMES = 4_096;
|
|
195
|
+
export function webSocketUrl(serverUrl, appId) {
|
|
196
|
+
return httpUrlToWs(serverUrl, appId);
|
|
197
|
+
}
|
|
198
|
+
export function encodeWebSocketFrameBatch(frames) {
|
|
199
|
+
assertWebSocketFrameBatch(frames);
|
|
200
|
+
const writer = new PostcardWriter();
|
|
201
|
+
writer.vec((itemWriter, index) => itemWriter.bytes(frames[index]), frames.length);
|
|
202
|
+
const batch = writer.finish();
|
|
203
|
+
if (batch.byteLength > MAX_WIRE_FRAME_BYTES) {
|
|
204
|
+
throw new Error(`websocket frame batch exceeds maximum length of ${MAX_WIRE_FRAME_BYTES} bytes`);
|
|
205
|
+
}
|
|
206
|
+
return batch;
|
|
207
|
+
}
|
|
208
|
+
export function decodeWebSocketFrameBatch(batch) {
|
|
209
|
+
if (batch.byteLength > MAX_WIRE_FRAME_BYTES) {
|
|
210
|
+
throw new Error(`websocket frame batch exceeds maximum length of ${MAX_WIRE_FRAME_BYTES} bytes`);
|
|
211
|
+
}
|
|
212
|
+
const reader = new PostcardReader(batch);
|
|
213
|
+
const count = reader.u64();
|
|
214
|
+
if (count === 0 || count > MAX_WIRE_BATCH_FRAMES) {
|
|
215
|
+
throw new Error(`websocket frame batch exceeds frame-count limit of ${MAX_WIRE_BATCH_FRAMES}`);
|
|
216
|
+
}
|
|
217
|
+
// Do not use `readVec`: its Array.from({ length }) allocates against the
|
|
218
|
+
// untrusted count before a protocol adapter can apply this carrier limit.
|
|
219
|
+
const frames = [];
|
|
220
|
+
for (let index = 0; index < count; index += 1) {
|
|
221
|
+
frames.push(reader.bytesAtMost(MAX_WIRE_FRAME_BYTES, "websocket frame"));
|
|
222
|
+
}
|
|
223
|
+
assertReaderDone(reader, "websocket frame batch");
|
|
224
|
+
return frames;
|
|
225
|
+
}
|
|
226
|
+
function assertWebSocketFrameBatch(frames) {
|
|
227
|
+
if (frames.length === 0 || frames.length > MAX_WIRE_BATCH_FRAMES) {
|
|
228
|
+
throw new Error(`websocket frame batch exceeds frame-count limit of ${MAX_WIRE_BATCH_FRAMES}`);
|
|
229
|
+
}
|
|
230
|
+
for (const frame of frames) {
|
|
231
|
+
if (frame.byteLength > MAX_WIRE_FRAME_BYTES) {
|
|
232
|
+
throw new Error(`websocket frame exceeds maximum length of ${MAX_WIRE_FRAME_BYTES} bytes`);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
export function encodeWireClientHello(features = CLIENT_WIRE_FEATURES) {
|
|
237
|
+
assertWireFeatures(features, "client wire features");
|
|
238
|
+
const writer = new PostcardWriter();
|
|
239
|
+
writer.u64(0); // WireFrame::Hello
|
|
240
|
+
writer.u64(MIN_WIRE_PROTOCOL_VERSION); // min_protocol_version
|
|
241
|
+
writer.u64(MAX_WIRE_PROTOCOL_VERSION); // max_protocol_version
|
|
242
|
+
writer.u64(features);
|
|
243
|
+
writer.u64(0); // WirePeerRole::Client
|
|
244
|
+
// A client is not an authority. The server still binds its authenticated
|
|
245
|
+
// identity and a fresh server epoch, which the client uses to validate
|
|
246
|
+
// current-row receipts without asserting an authority of its own.
|
|
247
|
+
writer.none(); // WireHello::authority
|
|
248
|
+
return writer.finish();
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* A server's frames are told apart by their first byte, as the Rust client
|
|
252
|
+
* does (`CorpusReader::Client` in `crates/jazz/layers/db/src/sync.rs`): 0 is
|
|
253
|
+
* a `Hello`, 1 an `Error`, anything else a sync message or a part of one
|
|
254
|
+
* split across frames. A part starts with a marker byte (0xFF, or 0xFE for
|
|
255
|
+
* the last) and then arbitrary message bytes, so it must not be read as a
|
|
256
|
+
* postcard tag: `0xFE 0x00` reads as a non-minimal varint.
|
|
257
|
+
*/
|
|
258
|
+
const WIRE_HELLO_TAG = 0;
|
|
259
|
+
const WIRE_ERROR_TAG = 1;
|
|
260
|
+
/**
|
|
261
|
+
* Classify a `Hello`. Only the tag and version range are shared across wire
|
|
262
|
+
* versions; the rest of the body is read exactly when the range is this
|
|
263
|
+
* version's, and a foreign-version Hello is left to `decodeServerHello` to
|
|
264
|
+
* report as a version mismatch (SPEC 8 §8.1.1).
|
|
265
|
+
*/
|
|
266
|
+
export function isWireHello(frame) {
|
|
267
|
+
if (frame[0] !== WIRE_HELLO_TAG)
|
|
268
|
+
return false;
|
|
269
|
+
const reader = new PostcardReader(frame);
|
|
270
|
+
reader.u64();
|
|
271
|
+
const { min, max } = readWireHelloVersionRange(reader);
|
|
272
|
+
if (min === WIRE_PROTOCOL_VERSION && max === WIRE_PROTOCOL_VERSION) {
|
|
273
|
+
readWireHelloBodyAfterRangeExact(reader);
|
|
274
|
+
}
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
277
|
+
export function isWireError(frame) {
|
|
278
|
+
if (frame[0] !== WIRE_ERROR_TAG)
|
|
279
|
+
return false;
|
|
280
|
+
decodeWireError(frame);
|
|
281
|
+
return true;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Decode an `Error` frame. To a client that offered
|
|
285
|
+
* `FEATURE_TYPED_ERROR_REASON`, a server may end its body with the refusal's
|
|
286
|
+
* reason (`wire-error-reason-v1`); the message is length-prefixed, so it is
|
|
287
|
+
* read when bytes remain.
|
|
288
|
+
*/
|
|
289
|
+
export function decodeWireError(frame) {
|
|
290
|
+
const reader = new PostcardReader(frame);
|
|
291
|
+
const tag = reader.u64();
|
|
292
|
+
if (tag !== WIRE_ERROR_TAG)
|
|
293
|
+
throw new Error(`expected WireFrame::Error, got tag ${tag}`);
|
|
294
|
+
const error = {
|
|
295
|
+
code: wireErrorCodeName(reader.u64()),
|
|
296
|
+
retry: wireRetryName(reader.u64()),
|
|
297
|
+
message: reader.string(),
|
|
298
|
+
};
|
|
299
|
+
if (!reader.done())
|
|
300
|
+
error.reason = wireErrorReasonName(reader.u64());
|
|
301
|
+
assertReaderDone(reader, "WireFrame::Error");
|
|
302
|
+
return error;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Why the server refused this client's credential. A server that named its
|
|
306
|
+
* reason is taken at its word; an older one's message is read, as before.
|
|
307
|
+
*/
|
|
308
|
+
export function wireAuthFailureReason(error) {
|
|
309
|
+
if (error.code !== "auth_failed")
|
|
310
|
+
return null;
|
|
311
|
+
if (error.reason === "reauthenticate")
|
|
312
|
+
return "invalid";
|
|
313
|
+
const named = error.reason !== undefined && !error.reason.startsWith("unknown:");
|
|
314
|
+
return mapAuthReason(named ? error.reason : error.message);
|
|
315
|
+
}
|
|
316
|
+
export class WebSocketCarrier {
|
|
317
|
+
url;
|
|
318
|
+
socket;
|
|
319
|
+
onFrame;
|
|
320
|
+
onError;
|
|
321
|
+
onTerminal;
|
|
322
|
+
localFeatures;
|
|
323
|
+
opened;
|
|
324
|
+
resolveNegotiation;
|
|
325
|
+
rejectNegotiation;
|
|
326
|
+
negotiated = false;
|
|
327
|
+
/** Whether the prelude and Hello went out, after which frames may follow. */
|
|
328
|
+
helloSent = false;
|
|
329
|
+
/** Frames sent ahead before the Hello went out, oldest first (`sendAhead`). */
|
|
330
|
+
ahead = [];
|
|
331
|
+
closing = false;
|
|
332
|
+
terminated = false;
|
|
333
|
+
lastInbound = performance.now();
|
|
334
|
+
/** Messages received whose handling hasn't finished yet. */
|
|
335
|
+
handlingMessages = 0;
|
|
336
|
+
/**
|
|
337
|
+
* A socket's error and close that came while messages were still being
|
|
338
|
+
* handled, reported once the last of them is: the HTTP stream hands a
|
|
339
|
+
* backend's last message and its close over in one read, and a refusal
|
|
340
|
+
* (`auth_failed`, say after `jazz.revokeUser`) read after the close would
|
|
341
|
+
* count as a dropped connection, retried for good. With no message being
|
|
342
|
+
* handled, they are reported at once, from the event itself.
|
|
343
|
+
*/
|
|
344
|
+
afterMessages = [];
|
|
345
|
+
silenceTimer;
|
|
346
|
+
handshakeTimer;
|
|
347
|
+
/** Where to renew this session in place, when it rides on the app's cookie. */
|
|
348
|
+
renewalUrl;
|
|
349
|
+
renewalTimer;
|
|
350
|
+
constructor(options) {
|
|
351
|
+
this.url = options.endpointUrl;
|
|
352
|
+
const WebSocketCtor = options.WebSocket ?? inProcessWebSocketFor(this.url) ?? defaultWebSocketConstructor(this.url);
|
|
353
|
+
this.onFrame = options.onFrame;
|
|
354
|
+
this.onError = options.onError;
|
|
355
|
+
this.onTerminal = options.onTerminal;
|
|
356
|
+
this.localFeatures =
|
|
357
|
+
(options.features ?? CLIENT_WIRE_FEATURES) | FEATURE_HEARTBEAT | FEATURE_TYPED_ERROR_REASON;
|
|
358
|
+
this.renewalUrl = isCookieSessionAuth(options.authJson) ? renewalUrlFor(this.url) : null;
|
|
359
|
+
assertWireFeatures(this.localFeatures, "client wire features");
|
|
360
|
+
this.socket = new WebSocketCtor(this.url);
|
|
361
|
+
this.socket.binaryType = "arraybuffer";
|
|
362
|
+
this.watchHandshake(options.handshakeTimeoutMs ?? HANDSHAKE_TIMEOUT_MS);
|
|
363
|
+
this.opened = new Promise((resolve, reject) => {
|
|
364
|
+
this.resolveNegotiation = resolve;
|
|
365
|
+
this.rejectNegotiation = reject;
|
|
366
|
+
});
|
|
367
|
+
void waitForOpen(this.socket).then(() => {
|
|
368
|
+
if (this.closing)
|
|
369
|
+
return;
|
|
370
|
+
this.socket.send(encodeWebSocketPrelude(options.authJson ?? "{}", options.peerIdentity, options.requestedLink, this.renewalUrl !== null));
|
|
371
|
+
this.socket.send(encodeWebSocketFrameBatch([encodeWireClientHello(this.localFeatures)]));
|
|
372
|
+
this.helloSent = true;
|
|
373
|
+
for (const frames of this.ahead.splice(0))
|
|
374
|
+
this.write(frames);
|
|
375
|
+
}, (error) => {
|
|
376
|
+
this.reportTerminal({
|
|
377
|
+
code: "websocket_error",
|
|
378
|
+
retry: "later",
|
|
379
|
+
message: error instanceof Error ? error.message : String(error),
|
|
380
|
+
});
|
|
381
|
+
this.close();
|
|
382
|
+
});
|
|
383
|
+
const reportAfterMessages = (run) => {
|
|
384
|
+
if (this.handlingMessages === 0)
|
|
385
|
+
run();
|
|
386
|
+
else
|
|
387
|
+
this.afterMessages.push(run);
|
|
388
|
+
};
|
|
389
|
+
this.socket.addEventListener("message", (event) => {
|
|
390
|
+
this.lastInbound = performance.now();
|
|
391
|
+
this.handlingMessages += 1;
|
|
392
|
+
void this.handleMessage(event.data)
|
|
393
|
+
.catch((error) => {
|
|
394
|
+
this.reportTerminal({
|
|
395
|
+
code: "protocol_error",
|
|
396
|
+
retry: "never",
|
|
397
|
+
message: error instanceof Error ? error.message : String(error),
|
|
398
|
+
}, undefined, false);
|
|
399
|
+
this.close();
|
|
400
|
+
})
|
|
401
|
+
.finally(() => {
|
|
402
|
+
this.handlingMessages -= 1;
|
|
403
|
+
if (this.handlingMessages > 0)
|
|
404
|
+
return;
|
|
405
|
+
for (const run of this.afterMessages.splice(0))
|
|
406
|
+
run();
|
|
407
|
+
});
|
|
408
|
+
});
|
|
409
|
+
this.socket.addEventListener("error", (event) => reportAfterMessages(() => this.reportTerminal({
|
|
410
|
+
code: "websocket_error",
|
|
411
|
+
retry: "later",
|
|
412
|
+
// A native socket's error event says nothing; the HTTP stream and a
|
|
413
|
+
// backend client's failed upgrade hand an Error that does.
|
|
414
|
+
message: event instanceof Error ? event.message : "websocket transport error",
|
|
415
|
+
})));
|
|
416
|
+
this.socket.addEventListener("close", (event) => {
|
|
417
|
+
const close = websocketCloseDetails(event);
|
|
418
|
+
reportAfterMessages(() => this.reportTerminal({
|
|
419
|
+
code: "websocket_closed",
|
|
420
|
+
retry: "later",
|
|
421
|
+
message: `websocket closed (code=${close.code ?? "unknown"}, reason=${close.reason ?? "none"})`,
|
|
422
|
+
}));
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
async send(frame) {
|
|
426
|
+
await this.sendBatch([frame]);
|
|
427
|
+
}
|
|
428
|
+
async sendBatch(frames) {
|
|
429
|
+
await this.ready();
|
|
430
|
+
this.write(frames);
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Send `frames` right behind this connection's `Hello`, without waiting
|
|
434
|
+
* for the server's: the server reads nothing past a client's `Hello`
|
|
435
|
+
* until it admitted the connection and said hello itself, then reads on
|
|
436
|
+
* in order, and a connection it refuses never reads them (SPEC §8.1.2).
|
|
437
|
+
* Frames sent ahead go out in the order of the calls, also once
|
|
438
|
+
* negotiated (a `sendBatch` waiting for the server's `Hello` may go out
|
|
439
|
+
* after them). On a connection that closes before its `Hello` went out,
|
|
440
|
+
* they are dropped.
|
|
441
|
+
*/
|
|
442
|
+
sendAhead(frames) {
|
|
443
|
+
if (this.closing || this.terminated)
|
|
444
|
+
return;
|
|
445
|
+
if (this.helloSent)
|
|
446
|
+
this.write(frames);
|
|
447
|
+
else
|
|
448
|
+
this.ahead.push(frames);
|
|
449
|
+
}
|
|
450
|
+
/** Write `frames` to the socket, in as few batches as the limits allow. */
|
|
451
|
+
write(frames) {
|
|
452
|
+
let batch = [];
|
|
453
|
+
let batchBytes = POSTCARD_BATCH_LENGTH_RESERVE;
|
|
454
|
+
for (const frame of frames) {
|
|
455
|
+
const frameBytes = frame.byteLength + POSTCARD_FRAME_LENGTH_RESERVE;
|
|
456
|
+
if (batch.length > 0 &&
|
|
457
|
+
(batch.length >= MAX_WIRE_BATCH_FRAMES ||
|
|
458
|
+
batchBytes + frameBytes > MAX_WEBSOCKET_BATCH_BYTES)) {
|
|
459
|
+
this.socket.send(encodeWebSocketFrameBatch(batch));
|
|
460
|
+
batch = [];
|
|
461
|
+
batchBytes = POSTCARD_BATCH_LENGTH_RESERVE;
|
|
462
|
+
}
|
|
463
|
+
batch.push(frame);
|
|
464
|
+
batchBytes += frameBytes;
|
|
465
|
+
}
|
|
466
|
+
if (batch.length > 0) {
|
|
467
|
+
this.socket.send(encodeWebSocketFrameBatch(batch));
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
ready() {
|
|
471
|
+
return this.opened;
|
|
472
|
+
}
|
|
473
|
+
get hasNegotiated() {
|
|
474
|
+
return this.negotiated;
|
|
475
|
+
}
|
|
476
|
+
close() {
|
|
477
|
+
if (this.closing)
|
|
478
|
+
return;
|
|
479
|
+
this.closing = true;
|
|
480
|
+
this.ahead = [];
|
|
481
|
+
clearTimeout(this.silenceTimer);
|
|
482
|
+
clearTimeout(this.handshakeTimer);
|
|
483
|
+
clearTimeout(this.renewalTimer);
|
|
484
|
+
this.reportTerminal({
|
|
485
|
+
code: "websocket_closed",
|
|
486
|
+
retry: "never",
|
|
487
|
+
message: "websocket closed before server hello",
|
|
488
|
+
}, new Error("websocket closed before server hello"), false, false);
|
|
489
|
+
try {
|
|
490
|
+
this.socket.close();
|
|
491
|
+
}
|
|
492
|
+
catch {
|
|
493
|
+
// Node's undici WebSocket can throw while already closing; intentional
|
|
494
|
+
// shutdown should not be reported as a transport failure.
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
reportTerminal(error, negotiationError = new Error(error.message), notifyError = true, notifyTerminal = true) {
|
|
498
|
+
if (this.terminated)
|
|
499
|
+
return;
|
|
500
|
+
this.terminated = true;
|
|
501
|
+
clearTimeout(this.silenceTimer);
|
|
502
|
+
clearTimeout(this.handshakeTimer);
|
|
503
|
+
clearTimeout(this.renewalTimer);
|
|
504
|
+
this.rejectNegotiation(negotiationError);
|
|
505
|
+
if (notifyError)
|
|
506
|
+
this.onError?.(error);
|
|
507
|
+
if (notifyTerminal)
|
|
508
|
+
this.onTerminal?.(error);
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Give the attempt up when the server has not said hello within
|
|
512
|
+
* `timeoutMs`, as a dropped socket (`websocket_silent`), so the link
|
|
513
|
+
* retries and, past its reporting window, publishes the outage. The
|
|
514
|
+
* timeout is confirmed a moment later, so a hello that a frozen page held
|
|
515
|
+
* back is delivered before it counts.
|
|
516
|
+
*/
|
|
517
|
+
watchHandshake(timeoutMs) {
|
|
518
|
+
this.handshakeTimer = setTimeout(() => {
|
|
519
|
+
this.handshakeTimer = setTimeout(() => {
|
|
520
|
+
if (this.negotiated || this.terminated)
|
|
521
|
+
return;
|
|
522
|
+
this.reportTerminal({
|
|
523
|
+
code: "websocket_silent",
|
|
524
|
+
retry: "later",
|
|
525
|
+
message: `the server did not answer the connection within ${Math.round(timeoutMs / 1000)} s`,
|
|
526
|
+
});
|
|
527
|
+
this.close();
|
|
528
|
+
}, HEARTBEAT_CONFIRM_MS);
|
|
529
|
+
}, timeoutMs);
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Renew this session in place at the time the backend named: one ordinary
|
|
533
|
+
* request to the backend (where its auth may refresh the cookie), whose
|
|
534
|
+
* answer carries a ticket sent back over this socket. A renewal that
|
|
535
|
+
* fails does nothing: the backend then ends the session at its expiry
|
|
536
|
+
* and this client connects again, as without renewal.
|
|
537
|
+
*/
|
|
538
|
+
scheduleRenewal({ session, renewInMs }) {
|
|
539
|
+
clearTimeout(this.renewalTimer);
|
|
540
|
+
const url = this.renewalUrl;
|
|
541
|
+
if (!url)
|
|
542
|
+
return;
|
|
543
|
+
this.renewalTimer = setTimeout(() => {
|
|
544
|
+
this.renewalTimer = undefined;
|
|
545
|
+
if (this.closing || this.terminated)
|
|
546
|
+
return;
|
|
547
|
+
void requestSessionRenewal(url, session)
|
|
548
|
+
.then((ticket) => {
|
|
549
|
+
if (!ticket || this.closing || this.terminated)
|
|
550
|
+
return;
|
|
551
|
+
return this.send(encodeRenewFrame(ticket));
|
|
552
|
+
})
|
|
553
|
+
.catch(() => { });
|
|
554
|
+
}, Math.min(renewInMs, 2 ** 31 - 1));
|
|
555
|
+
}
|
|
556
|
+
/** Give the link up once the server has sent nothing, not even a
|
|
557
|
+
* heartbeat, for {@link HEARTBEAT_SILENCE_MS}. Checked against the time
|
|
558
|
+
* of the last message, so a timer the browser throttled judges the
|
|
559
|
+
* silence it actually saw; a silence past the limit is confirmed a moment
|
|
560
|
+
* later, after any messages a frozen page held back were delivered. */
|
|
561
|
+
watchSilence(confirming = false) {
|
|
562
|
+
clearTimeout(this.silenceTimer);
|
|
563
|
+
if (this.closing || this.terminated)
|
|
564
|
+
return;
|
|
565
|
+
const silentFor = performance.now() - this.lastInbound;
|
|
566
|
+
if (silentFor >= HEARTBEAT_SILENCE_MS && !confirming) {
|
|
567
|
+
this.silenceTimer = setTimeout(() => this.watchSilence(true), HEARTBEAT_CONFIRM_MS);
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
if (silentFor >= HEARTBEAT_SILENCE_MS) {
|
|
571
|
+
this.reportTerminal({
|
|
572
|
+
code: "websocket_silent",
|
|
573
|
+
retry: "later",
|
|
574
|
+
message: `the server sent nothing for ${Math.round(silentFor / 1000)} s, not even a heartbeat`,
|
|
575
|
+
});
|
|
576
|
+
this.close();
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
this.silenceTimer = setTimeout(() => this.watchSilence(), HEARTBEAT_SILENCE_MS - silentFor);
|
|
580
|
+
}
|
|
581
|
+
async handleMessage(data) {
|
|
582
|
+
for (const frame of decodeWebSocketFrameBatch(await bytesFromWebSocketMessage(data))) {
|
|
583
|
+
if (this.closing)
|
|
584
|
+
return;
|
|
585
|
+
if (isWireHello(frame)) {
|
|
586
|
+
if (this.negotiated)
|
|
587
|
+
continue;
|
|
588
|
+
this.negotiated = true;
|
|
589
|
+
clearTimeout(this.handshakeTimer);
|
|
590
|
+
const negotiation = decodeServerHello(frame, this.localFeatures);
|
|
591
|
+
if ((negotiation.features & FEATURE_HEARTBEAT) !== 0)
|
|
592
|
+
this.watchSilence();
|
|
593
|
+
this.resolveNegotiation({
|
|
594
|
+
...negotiation,
|
|
595
|
+
features: negotiation.features & ~FEATURE_HEARTBEAT & ~FEATURE_TYPED_ERROR_REASON,
|
|
596
|
+
});
|
|
597
|
+
continue;
|
|
598
|
+
}
|
|
599
|
+
if (this.negotiated && frame.byteLength === 1 && frame[0] === WIRE_FRAME_HEARTBEAT) {
|
|
600
|
+
continue;
|
|
601
|
+
}
|
|
602
|
+
// The backend's word on when to renew this session in place: only ever
|
|
603
|
+
// sent to a carrier that asked for it, and never handed to the core.
|
|
604
|
+
if (this.negotiated && this.renewalUrl && isRenewSoonFrame(frame)) {
|
|
605
|
+
this.scheduleRenewal(decodeRenewSoonFrame(frame));
|
|
606
|
+
continue;
|
|
607
|
+
}
|
|
608
|
+
if (!this.negotiated) {
|
|
609
|
+
if (isWireError(frame)) {
|
|
610
|
+
const error = decodeWireError(frame);
|
|
611
|
+
if (wireAuthFailureReason(error)) {
|
|
612
|
+
this.reportTerminal(error, new Error(`websocket authentication failed before server hello: ${error.message}`));
|
|
613
|
+
this.close();
|
|
614
|
+
return;
|
|
615
|
+
}
|
|
616
|
+
this.reportTerminal(error, new PreHelloWireError(error));
|
|
617
|
+
this.close();
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
this.reportTerminal({
|
|
621
|
+
code: "protocol_error",
|
|
622
|
+
retry: "never",
|
|
623
|
+
message: "websocket received semantic frame before server hello",
|
|
624
|
+
}, undefined, false);
|
|
625
|
+
this.close();
|
|
626
|
+
return;
|
|
627
|
+
}
|
|
628
|
+
if (isWireError(frame)) {
|
|
629
|
+
const error = decodeWireError(frame);
|
|
630
|
+
if (isReconnectLaterWireError(error)) {
|
|
631
|
+
this.reportTerminal(error);
|
|
632
|
+
this.close();
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
this.onError?.(error);
|
|
636
|
+
continue;
|
|
637
|
+
}
|
|
638
|
+
this.onFrame(frame);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
function decodeServerHello(frame, localFeatures = CLIENT_WIRE_FEATURES) {
|
|
643
|
+
const reader = new PostcardReader(frame);
|
|
644
|
+
if (reader.u64() !== 0)
|
|
645
|
+
throw new Error("expected WireFrame::Hello");
|
|
646
|
+
// The version range comes first in every wire version; the rest of the
|
|
647
|
+
// body is version-scoped, so check the range before reading it.
|
|
648
|
+
const { min, max } = readWireHelloVersionRange(reader);
|
|
649
|
+
if (min !== WIRE_PROTOCOL_VERSION || max !== WIRE_PROTOCOL_VERSION) {
|
|
650
|
+
throw new Error(`server must advertise exactly wire protocol ${WIRE_PROTOCOL_VERSION}, got ${min}..=${max}`);
|
|
651
|
+
}
|
|
652
|
+
const { features, role, authority } = readWireHelloBodyAfterRangeExact(reader);
|
|
653
|
+
const unsupportedFeatures = features & ~BigInt(localFeatures);
|
|
654
|
+
if (unsupportedFeatures !== 0n) {
|
|
655
|
+
throw new Error(`server accepted unsupported wire features 0x${unsupportedFeatures.toString(16)}`);
|
|
656
|
+
}
|
|
657
|
+
if (role !== 1)
|
|
658
|
+
throw new Error("expected WirePeerRole::Core server hello");
|
|
659
|
+
return { protocolVersion: WIRE_PROTOCOL_VERSION, features: Number(features), authority };
|
|
660
|
+
}
|
|
661
|
+
function assertWireFeatures(features, label) {
|
|
662
|
+
if (!Number.isSafeInteger(features) || features < 0 || features > 0xffff_ffff) {
|
|
663
|
+
throw new Error(`${label} must be an unsigned 32-bit integer, got ${features}`);
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
function readWireHelloVersionRange(reader) {
|
|
667
|
+
return { min: reader.u64(), max: reader.u64() };
|
|
668
|
+
}
|
|
669
|
+
function readWireHelloBodyAfterRangeExact(reader) {
|
|
670
|
+
const features = reader.u64BigInt();
|
|
671
|
+
const role = reader.u64();
|
|
672
|
+
const authority = reader.option((value) => {
|
|
673
|
+
const node = value.bytes();
|
|
674
|
+
if (node.byteLength !== 16) {
|
|
675
|
+
throw new Error(`WireHello.authority.node must be exactly 16 bytes, got ${node.byteLength}`);
|
|
676
|
+
}
|
|
677
|
+
return { node, epoch: value.u64BigInt() };
|
|
678
|
+
});
|
|
679
|
+
assertReaderDone(reader, "WireFrame::Hello");
|
|
680
|
+
return { features, role, authority };
|
|
681
|
+
}
|
|
682
|
+
function assertReaderDone(reader, payload) {
|
|
683
|
+
if (!reader.done())
|
|
684
|
+
throw new Error(`${payload} has trailing postcard bytes`);
|
|
685
|
+
}
|
|
686
|
+
function websocketCloseDetails(event) {
|
|
687
|
+
if (!event || typeof event !== "object")
|
|
688
|
+
return {};
|
|
689
|
+
const close = event;
|
|
690
|
+
return {
|
|
691
|
+
code: typeof close.code === "number" ? close.code : undefined,
|
|
692
|
+
reason: typeof close.reason === "string" ? close.reason : undefined,
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
export function encodeWebSocketPrelude(authJson, peerIdentity, requestedLink, renewal = false) {
|
|
696
|
+
const auth = JSON.parse(authJson);
|
|
697
|
+
const peerAuthor = new Utf8Decoder().decode(peerIdentity);
|
|
698
|
+
const sub = authSub(auth) ?? canonicalAuthorSubjectPart(peerAuthor) ?? peerAuthor;
|
|
699
|
+
return JSON.stringify({
|
|
700
|
+
peer_identity: peerAuthor,
|
|
701
|
+
...auth,
|
|
702
|
+
auth: { ...auth, sub },
|
|
703
|
+
sub,
|
|
704
|
+
...(requestedLink ? { requested_link: requestedLink } : {}),
|
|
705
|
+
// A core ignores unknown top-level fields; an app backend that renews
|
|
706
|
+
// sessions in place takes this out before the core sees the prelude.
|
|
707
|
+
...(renewal ? { [SESSION_RENEWAL_PRELUDE_FIELD]: 1 } : {}),
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
/**
|
|
711
|
+
* Whether `authJson` is a browser's sync session on the app's cookie: it
|
|
712
|
+
* states a backend session and no credential of its own, so the app's
|
|
713
|
+
* backend decides who it is from the request's cookies.
|
|
714
|
+
*/
|
|
715
|
+
function isCookieSessionAuth(authJson) {
|
|
716
|
+
if (!authJson)
|
|
717
|
+
return false;
|
|
718
|
+
try {
|
|
719
|
+
const auth = JSON.parse(authJson);
|
|
720
|
+
return (auth.backend_session != null &&
|
|
721
|
+
auth.jwt_token == null &&
|
|
722
|
+
auth.admin_secret == null &&
|
|
723
|
+
auth.backend_secret == null);
|
|
724
|
+
}
|
|
725
|
+
catch {
|
|
726
|
+
return false;
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* How long a renewal may hold the other windows back, at most: a request
|
|
731
|
+
* that hangs longer (a frozen page) lets them ask. Its own request is never
|
|
732
|
+
* aborted, so a rotated cookie the backend already set still lands.
|
|
733
|
+
*/
|
|
734
|
+
const SESSION_RENEWAL_TURN_MS = 30_000;
|
|
735
|
+
async function requestSessionRenewal(url, session) {
|
|
736
|
+
return oneWindowAtATime(sessionRefreshLockName(url), () => renewalRequest(url, session));
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* Run `request` while holding a Web Lock named `name`, so the windows (and
|
|
740
|
+
* workers) of one browser renew one after another: each request carries the
|
|
741
|
+
* cookie the one before it refreshed, and a single-use refresh token is
|
|
742
|
+
* spent once. Held for at most {@link SESSION_RENEWAL_TURN_MS}; without
|
|
743
|
+
* Web Locks, it just runs.
|
|
744
|
+
*/
|
|
745
|
+
async function oneWindowAtATime(name, request) {
|
|
746
|
+
const locks = globalThis.navigator?.locks;
|
|
747
|
+
if (!locks)
|
|
748
|
+
return request();
|
|
749
|
+
let started;
|
|
750
|
+
const run = () => (started ??= request());
|
|
751
|
+
try {
|
|
752
|
+
await locks.request(name, () => {
|
|
753
|
+
let turn;
|
|
754
|
+
return Promise.race([
|
|
755
|
+
run().catch(() => undefined),
|
|
756
|
+
new Promise((done) => {
|
|
757
|
+
turn = setTimeout(done, SESSION_RENEWAL_TURN_MS);
|
|
758
|
+
}),
|
|
759
|
+
]).finally(() => clearTimeout(turn));
|
|
760
|
+
});
|
|
761
|
+
}
|
|
762
|
+
catch {
|
|
763
|
+
// Locks unavailable here after all (an opaque origin): ask anyway.
|
|
764
|
+
}
|
|
765
|
+
return run();
|
|
766
|
+
}
|
|
767
|
+
async function renewalRequest(url, session) {
|
|
768
|
+
try {
|
|
769
|
+
const response = await fetchFor(url)(url, {
|
|
770
|
+
method: "POST",
|
|
771
|
+
credentials: "same-origin",
|
|
772
|
+
redirect: "error",
|
|
773
|
+
headers: { [SESSION_RENEWAL_HEADER]: session },
|
|
774
|
+
});
|
|
775
|
+
if (!response.ok)
|
|
776
|
+
return null;
|
|
777
|
+
const answer = (await response.json());
|
|
778
|
+
return typeof answer.renewal === "string" ? answer.renewal : null;
|
|
779
|
+
}
|
|
780
|
+
catch {
|
|
781
|
+
return null;
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
/** Project only policy metadata after the server has admitted this credential.
|
|
785
|
+
* This does not authenticate a JWT or grant a different native identity.
|
|
786
|
+
*/
|
|
787
|
+
export function policyClaimsForAdmittedWebSocket(authJson) {
|
|
788
|
+
const auth = JSON.parse(authJson);
|
|
789
|
+
if (auth.admin_secret)
|
|
790
|
+
return {};
|
|
791
|
+
if (typeof auth.backend_secret === "string") {
|
|
792
|
+
const session = auth.backend_session;
|
|
793
|
+
const claims = session && typeof session === "object" ? session.claims : undefined;
|
|
794
|
+
return claims && typeof claims === "object" && !Array.isArray(claims)
|
|
795
|
+
? claims
|
|
796
|
+
: {};
|
|
797
|
+
}
|
|
798
|
+
if (typeof auth.jwt_token !== "string")
|
|
799
|
+
return {};
|
|
800
|
+
const payload = parseJwtPayload(auth.jwt_token);
|
|
801
|
+
if (!payload)
|
|
802
|
+
return {};
|
|
803
|
+
if (payload.iss === "urn:jazz:local-first" || payload.iss === "urn:jazz:anonymous") {
|
|
804
|
+
const { jazz_pub_key: _proof, ...claims } = payload;
|
|
805
|
+
return policyClaimsFromJwtPayload(claims);
|
|
806
|
+
}
|
|
807
|
+
return policyClaimsFromJwtPayload(payload);
|
|
808
|
+
}
|
|
809
|
+
/**
|
|
810
|
+
* Pick the logical author asserted by a client WebSocket connection.
|
|
811
|
+
*
|
|
812
|
+
* `peerIdentity` on a native runtime is the verified logical author that
|
|
813
|
+
* opened its raw-core storage handle. A WebSocket still derives the assertion
|
|
814
|
+
* from the credential's full issuer and subject pair. An account-bound runtime
|
|
815
|
+
* retains its account only when that pair matches; the server independently
|
|
816
|
+
* verifies the registry assignment.
|
|
817
|
+
*
|
|
818
|
+
* An admin credential is the sessionless SYSTEM authority. Other credentials
|
|
819
|
+
* without a usable session subject retain the caller's transport identity and
|
|
820
|
+
* cannot accidentally fall back to the historical bare-sub wire representation.
|
|
821
|
+
*/
|
|
822
|
+
export function peerIdentityForWebSocketAuth(authJson, fallbackIdentity) {
|
|
823
|
+
const auth = JSON.parse(authJson);
|
|
824
|
+
// Admin and credential-only backend connections are trusted SYSTEM serving
|
|
825
|
+
// authorities. Their raw-core backend opens already use this identity, and
|
|
826
|
+
// the WebSocket prelude must agree: otherwise the server attaches remote query
|
|
827
|
+
// coverage as the adapter's incidental local fallback author and evaluates
|
|
828
|
+
// row policies for that author. Admin admission is always sessionless; a
|
|
829
|
+
// backend session remains an explicit end-user serving subject and is handled
|
|
830
|
+
// by `canonicalAuthorForWebSocketAuth`.
|
|
831
|
+
if (typeof auth.admin_secret === "string" ||
|
|
832
|
+
(typeof auth.backend_secret === "string" && !hasUsableBackendSession(auth))) {
|
|
833
|
+
return new TextEncoder().encode(canonicalAuthorSubject("urn:jazz:system", "system"));
|
|
834
|
+
}
|
|
835
|
+
const canonical = canonicalAuthorForWebSocketAuth(auth);
|
|
836
|
+
let existing = null;
|
|
837
|
+
try {
|
|
838
|
+
existing = parseCanonicalAuthorSubject(new Utf8Decoder({ fatal: true }).decode(fallbackIdentity));
|
|
839
|
+
}
|
|
840
|
+
catch {
|
|
841
|
+
// Non-author transport identities have no account association to preserve.
|
|
842
|
+
}
|
|
843
|
+
if (existing?.account_id && canonical) {
|
|
844
|
+
const credential = parseCanonicalAuthorSubject(canonical);
|
|
845
|
+
if (credential.issuer !== existing.issuer ||
|
|
846
|
+
credential.user_id !== existing.user_id ||
|
|
847
|
+
(credential.account_id !== undefined && credential.account_id !== existing.account_id)) {
|
|
848
|
+
throw new Error("WebSocket credential must match the context account identity");
|
|
849
|
+
}
|
|
850
|
+
return fallbackIdentity;
|
|
851
|
+
}
|
|
852
|
+
return canonical ? new TextEncoder().encode(canonical) : fallbackIdentity;
|
|
853
|
+
}
|
|
854
|
+
/**
|
|
855
|
+
* Normalize credentials at the native transport boundary. A backend open is
|
|
856
|
+
* SYSTEM unless it deliberately supplies a backend session; an incidental
|
|
857
|
+
* bearer token would otherwise make the server select Session admission while
|
|
858
|
+
* the local raw-core database remains SYSTEM.
|
|
859
|
+
*/
|
|
860
|
+
export function normalizeBackendWebSocketAuth(authJson) {
|
|
861
|
+
const auth = JSON.parse(authJson);
|
|
862
|
+
if (typeof auth.backend_secret === "string" &&
|
|
863
|
+
!auth.admin_secret &&
|
|
864
|
+
!hasUsableBackendSession(auth)) {
|
|
865
|
+
delete auth.jwt_token;
|
|
866
|
+
}
|
|
867
|
+
return JSON.stringify(auth);
|
|
868
|
+
}
|
|
869
|
+
function hasUsableBackendSession(auth) {
|
|
870
|
+
const session = auth.backend_session;
|
|
871
|
+
return (session !== null &&
|
|
872
|
+
typeof session === "object" &&
|
|
873
|
+
!Array.isArray(session) &&
|
|
874
|
+
typeof session.issuer === "string" &&
|
|
875
|
+
typeof session.user_id === "string" &&
|
|
876
|
+
isUsableSubject(session.issuer) &&
|
|
877
|
+
isUsableSubject(session.user_id));
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* Whether a credential names the principal it connects as (a user, or the
|
|
881
|
+
* system for admin and backend secrets). Without one, the connection uses the
|
|
882
|
+
* store's own identity (see `peerIdentityForWebSocketAuth`).
|
|
883
|
+
*/
|
|
884
|
+
export function webSocketAuthNamesPrincipal(authJson) {
|
|
885
|
+
const auth = JSON.parse(authJson);
|
|
886
|
+
return (typeof auth.admin_secret === "string" ||
|
|
887
|
+
typeof auth.backend_secret === "string" ||
|
|
888
|
+
canonicalAuthorForWebSocketAuth(auth) !== null);
|
|
889
|
+
}
|
|
890
|
+
function canonicalAuthorForWebSocketAuth(auth) {
|
|
891
|
+
// Admin admission is intentionally sessionless and takes precedence over
|
|
892
|
+
// every other field in the server route. Do not let an incidental (or
|
|
893
|
+
// attacker-controlled) bearer payload change its peer identity/cap bucket.
|
|
894
|
+
if (typeof auth.admin_secret === "string")
|
|
895
|
+
return null;
|
|
896
|
+
// `backend_session` is only accepted by the server together with a valid
|
|
897
|
+
// backend secret. It carries the same public Session wire fields as a
|
|
898
|
+
// server-side impersonation request, so it uses the same canonical author.
|
|
899
|
+
// It also has the server's highest session-authentication precedence.
|
|
900
|
+
if (typeof auth.backend_secret === "string" && hasUsableBackendSession(auth)) {
|
|
901
|
+
const session = auth.backend_session;
|
|
902
|
+
return canonicalAuthorSubject(session.issuer, session.user_id, session.account_id);
|
|
903
|
+
}
|
|
904
|
+
if (typeof auth.jwt_token === "string") {
|
|
905
|
+
const payload = parseJwtPayload(auth.jwt_token);
|
|
906
|
+
const issuer = typeof payload?.iss === "string" ? payload.iss : undefined;
|
|
907
|
+
const subject = payload?.sub;
|
|
908
|
+
if (typeof issuer === "string" &&
|
|
909
|
+
typeof subject === "string" &&
|
|
910
|
+
isUsableSubject(issuer) &&
|
|
911
|
+
isUsableSubject(subject)) {
|
|
912
|
+
return canonicalAuthorSubject(issuer, subject);
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
return null;
|
|
916
|
+
}
|
|
917
|
+
function canonicalAuthorSubjectPart(author) {
|
|
918
|
+
return parseCanonicalAuthorSubject(author)?.user_id ?? null;
|
|
919
|
+
}
|
|
920
|
+
export async function bytesFromWebSocketMessage(data) {
|
|
921
|
+
if (data instanceof ArrayBuffer)
|
|
922
|
+
return new Uint8Array(data);
|
|
923
|
+
if (ArrayBuffer.isView(data)) {
|
|
924
|
+
return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
|
|
925
|
+
}
|
|
926
|
+
if (typeof Blob !== "undefined" && data instanceof Blob) {
|
|
927
|
+
return new Uint8Array(await data.arrayBuffer());
|
|
928
|
+
}
|
|
929
|
+
throw new Error(`expected binary websocket message, got ${typeof data}`);
|
|
930
|
+
}
|
|
931
|
+
/** Same-origin endpoints fall back to the HTTP stream transport when the host
|
|
932
|
+
* can't upgrade WebSockets (see `http-stream-socket.ts`). */
|
|
933
|
+
function defaultWebSocketConstructor(url) {
|
|
934
|
+
const native = browserWebSocketConstructor();
|
|
935
|
+
return isSameOriginEndpoint(url) ? httpStreamFallbackWebSocket(native) : native;
|
|
936
|
+
}
|
|
937
|
+
function isSameOriginEndpoint(url) {
|
|
938
|
+
const location = globalThis.location;
|
|
939
|
+
if (!location?.host)
|
|
940
|
+
return false;
|
|
941
|
+
try {
|
|
942
|
+
return new URL(url).host === location.host;
|
|
943
|
+
}
|
|
944
|
+
catch {
|
|
945
|
+
return false;
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
function browserWebSocketConstructor() {
|
|
949
|
+
const candidate = globalThis.WebSocket;
|
|
950
|
+
if (!candidate) {
|
|
951
|
+
throw new Error("browser WebSocket is not available");
|
|
952
|
+
}
|
|
953
|
+
return candidate;
|
|
954
|
+
}
|
|
955
|
+
function wireErrorCodeName(tag) {
|
|
956
|
+
switch (tag) {
|
|
957
|
+
case 0:
|
|
958
|
+
return "unsupported_protocol_version";
|
|
959
|
+
case 1:
|
|
960
|
+
return "unsupported_feature";
|
|
961
|
+
case 2:
|
|
962
|
+
return "malformed_frame";
|
|
963
|
+
case 3:
|
|
964
|
+
return "auth_failed";
|
|
965
|
+
case 4:
|
|
966
|
+
return "backpressure";
|
|
967
|
+
case 5:
|
|
968
|
+
return "internal";
|
|
969
|
+
case 6:
|
|
970
|
+
return "not_ready";
|
|
971
|
+
default:
|
|
972
|
+
// A code from a newer server: still the server's refusal, which the
|
|
973
|
+
// link retries rather than a frame it failed to read.
|
|
974
|
+
return `unknown:${tag}`;
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
/** `WireErrorReason` tags (encoding `wire-error-reason-v1`). Append-only. */
|
|
978
|
+
const WIRE_ERROR_REASON_TAGS = {
|
|
979
|
+
expired: 0,
|
|
980
|
+
missing: 1,
|
|
981
|
+
invalid: 2,
|
|
982
|
+
disabled: 3,
|
|
983
|
+
revoked: 4,
|
|
984
|
+
reauthenticate: 5,
|
|
985
|
+
};
|
|
986
|
+
/**
|
|
987
|
+
* The features a client's `Hello` offered, from the websocket message that
|
|
988
|
+
* carries it; null when the message is not a lone `Hello`. A backend that
|
|
989
|
+
* relays a client (`createJazz`) reads this to answer the client in the
|
|
990
|
+
* encoding it reads.
|
|
991
|
+
*/
|
|
992
|
+
export function clientHelloFeatures(message) {
|
|
993
|
+
try {
|
|
994
|
+
const frames = decodeWebSocketFrameBatch(message);
|
|
995
|
+
if (frames.length !== 1 || frames[0][0] !== WIRE_HELLO_TAG)
|
|
996
|
+
return null;
|
|
997
|
+
const reader = new PostcardReader(frames[0]);
|
|
998
|
+
reader.u64(); // WireFrame::Hello
|
|
999
|
+
reader.u64(); // min_protocol_version
|
|
1000
|
+
reader.u64(); // max_protocol_version
|
|
1001
|
+
return reader.u64();
|
|
1002
|
+
}
|
|
1003
|
+
catch {
|
|
1004
|
+
return null;
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
/**
|
|
1008
|
+
* A websocket message refusing a client's credential (`auth_failed`), naming
|
|
1009
|
+
* `reason` when the client's `Hello` offered `FEATURE_TYPED_ERROR_REASON`
|
|
1010
|
+
* (`wire-error-reason-v1`) and as the plain `Error` every client reads
|
|
1011
|
+
* otherwise. `clientFeatures` undefined: the client's `Hello` has not been
|
|
1012
|
+
* seen, so the plain one.
|
|
1013
|
+
*/
|
|
1014
|
+
export function encodeAuthFailedBatch(retry, message, reason, clientFeatures) {
|
|
1015
|
+
const frame = new PostcardWriter();
|
|
1016
|
+
frame.u64(WIRE_ERROR_TAG);
|
|
1017
|
+
frame.u64(3); // WireErrorCode::AuthFailed
|
|
1018
|
+
frame.u64(retry === "never" ? 0 : 2);
|
|
1019
|
+
frame.string(message);
|
|
1020
|
+
if (clientFeatures !== undefined && (clientFeatures & FEATURE_TYPED_ERROR_REASON) !== 0) {
|
|
1021
|
+
frame.u64(WIRE_ERROR_REASON_TAGS[reason]);
|
|
1022
|
+
}
|
|
1023
|
+
return encodeWebSocketFrameBatch([frame.finish()]);
|
|
1024
|
+
}
|
|
1025
|
+
/** `WireErrorReason` (encoding `wire-error-reason-v1`). */
|
|
1026
|
+
function wireErrorReasonName(tag) {
|
|
1027
|
+
switch (tag) {
|
|
1028
|
+
case 0:
|
|
1029
|
+
return "expired";
|
|
1030
|
+
case 1:
|
|
1031
|
+
return "missing";
|
|
1032
|
+
case 2:
|
|
1033
|
+
return "invalid";
|
|
1034
|
+
case 3:
|
|
1035
|
+
return "disabled";
|
|
1036
|
+
case 4:
|
|
1037
|
+
return "revoked";
|
|
1038
|
+
case 5:
|
|
1039
|
+
return "reauthenticate";
|
|
1040
|
+
default:
|
|
1041
|
+
// A reason from a newer server: still a refusal, read from its message.
|
|
1042
|
+
return `unknown:${tag}`;
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
function wireRetryName(tag) {
|
|
1046
|
+
switch (tag) {
|
|
1047
|
+
case 0:
|
|
1048
|
+
return "never";
|
|
1049
|
+
case 1:
|
|
1050
|
+
return "after_auth";
|
|
1051
|
+
case 2:
|
|
1052
|
+
return "after_resume";
|
|
1053
|
+
case 3:
|
|
1054
|
+
return "later";
|
|
1055
|
+
default:
|
|
1056
|
+
return `unknown:${tag}`;
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
function waitForOpen(socket) {
|
|
1060
|
+
if (socket.readyState === 1)
|
|
1061
|
+
return Promise.resolve();
|
|
1062
|
+
return new Promise((resolve, reject) => {
|
|
1063
|
+
let settled = false;
|
|
1064
|
+
const settle = (callback) => {
|
|
1065
|
+
if (settled)
|
|
1066
|
+
return;
|
|
1067
|
+
settled = true;
|
|
1068
|
+
callback();
|
|
1069
|
+
};
|
|
1070
|
+
socket.addEventListener("open", () => settle(resolve));
|
|
1071
|
+
socket.addEventListener("error", (event) => settle(() => reject(event)));
|
|
1072
|
+
socket.addEventListener("close", () => settle(() => reject(new Error("websocket closed before open"))));
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
function authSub(auth) {
|
|
1076
|
+
const directSub = auth.sub;
|
|
1077
|
+
if (typeof directSub === "string" && isUsableSubject(directSub))
|
|
1078
|
+
return directSub;
|
|
1079
|
+
const jwtToken = auth.jwt_token;
|
|
1080
|
+
if (typeof jwtToken === "string") {
|
|
1081
|
+
const jwtSub = jwtSubject(jwtToken);
|
|
1082
|
+
if (jwtSub)
|
|
1083
|
+
return jwtSub;
|
|
1084
|
+
}
|
|
1085
|
+
const session = auth.backend_session;
|
|
1086
|
+
if (session && typeof session === "object") {
|
|
1087
|
+
const userId = session.user_id;
|
|
1088
|
+
if (typeof userId === "string" && isUsableSubject(userId))
|
|
1089
|
+
return userId;
|
|
1090
|
+
}
|
|
1091
|
+
return null;
|
|
1092
|
+
}
|
|
1093
|
+
function jwtSubject(jwtToken) {
|
|
1094
|
+
const parts = jwtToken.split(".");
|
|
1095
|
+
if (parts.length < 2)
|
|
1096
|
+
return null;
|
|
1097
|
+
try {
|
|
1098
|
+
const payload = JSON.parse(base64UrlDecode(parts[1]));
|
|
1099
|
+
return typeof payload.sub === "string" && isUsableSubject(payload.sub) ? payload.sub : null;
|
|
1100
|
+
}
|
|
1101
|
+
catch {
|
|
1102
|
+
return null;
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
function base64UrlDecode(value) {
|
|
1106
|
+
const normalized = value.replace(/-/g, "+").replace(/_/g, "/");
|
|
1107
|
+
const padded = normalized.padEnd(Math.ceil(normalized.length / 4) * 4, "=");
|
|
1108
|
+
if (typeof atob === "function")
|
|
1109
|
+
return atob(padded);
|
|
1110
|
+
return Buffer.from(padded, "base64").toString("binary");
|
|
1111
|
+
}
|
|
1112
|
+
//# sourceMappingURL=websocket.js.map
|