jazz-tools 2.0.0-alpha.9 → 2.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +134 -7
- package/bin/jazz-tools.js +95 -68
- package/dist/_dev/inspector-cache-runtime.d.ts +8 -0
- package/dist/_dev/inspector-cache-runtime.d.ts.map +1 -0
- package/dist/_dev/inspector-cache-runtime.js +246 -0
- package/dist/_dev/inspector-cache-runtime.js.map +1 -0
- package/dist/_dev/inspector-client.d.ts +15 -0
- package/dist/_dev/inspector-client.d.ts.map +1 -0
- package/dist/_dev/inspector-client.js +134 -0
- package/dist/_dev/inspector-client.js.map +1 -0
- package/dist/_dev/native-account-session.d.ts +23 -0
- package/dist/_dev/native-account-session.d.ts.map +1 -0
- package/dist/_dev/native-account-session.js +61 -0
- package/dist/_dev/native-account-session.js.map +1 -0
- package/dist/_dev/native-binding-codec.d.ts +9 -0
- package/dist/_dev/native-binding-codec.d.ts.map +1 -0
- package/dist/_dev/native-binding-codec.js +9 -0
- package/dist/_dev/native-binding-codec.js.map +1 -0
- package/dist/accounts/account-manager-core.d.ts +87 -0
- package/dist/accounts/account-manager-core.d.ts.map +1 -0
- package/dist/accounts/account-manager-core.js +236 -0
- package/dist/accounts/account-manager-core.js.map +1 -0
- package/dist/accounts/browser-host.d.ts +8 -0
- package/dist/accounts/browser-host.d.ts.map +1 -0
- package/dist/accounts/browser-host.js +16 -0
- package/dist/accounts/browser-host.js.map +1 -0
- package/dist/accounts/config-capability.d.ts +26 -0
- package/dist/accounts/config-capability.d.ts.map +1 -0
- package/dist/accounts/config-capability.js +58 -0
- package/dist/accounts/config-capability.js.map +1 -0
- package/dist/accounts/context.d.ts +14 -0
- package/dist/accounts/context.d.ts.map +1 -0
- package/dist/accounts/context.js +214 -0
- package/dist/accounts/context.js.map +1 -0
- package/dist/accounts/enrollment.d.ts +95 -0
- package/dist/accounts/enrollment.d.ts.map +1 -0
- package/dist/accounts/enrollment.js +314 -0
- package/dist/accounts/enrollment.js.map +1 -0
- package/dist/accounts/exports.d.ts +3 -0
- package/dist/accounts/exports.d.ts.map +1 -0
- package/dist/accounts/exports.js +5 -0
- package/dist/accounts/exports.js.map +1 -0
- package/dist/accounts/local-first.d.ts +17 -0
- package/dist/accounts/local-first.d.ts.map +1 -0
- package/dist/accounts/local-first.js +62 -0
- package/dist/accounts/local-first.js.map +1 -0
- package/dist/accounts/persistence.d.ts +79 -0
- package/dist/accounts/persistence.d.ts.map +1 -0
- package/dist/accounts/persistence.js +533 -0
- package/dist/accounts/persistence.js.map +1 -0
- package/dist/accounts/process-store.d.ts +27 -0
- package/dist/accounts/process-store.d.ts.map +1 -0
- package/dist/accounts/process-store.js +49 -0
- package/dist/accounts/process-store.js.map +1 -0
- package/dist/accounts/registry-client.d.ts +79 -0
- package/dist/accounts/registry-client.d.ts.map +1 -0
- package/dist/accounts/registry-client.js +153 -0
- package/dist/accounts/registry-client.js.map +1 -0
- package/dist/accounts/state.d.ts +76 -0
- package/dist/accounts/state.d.ts.map +1 -0
- package/dist/accounts/state.js +172 -0
- package/dist/accounts/state.js.map +1 -0
- package/dist/app-file-enums.d.ts +9 -0
- package/dist/app-file-enums.d.ts.map +1 -0
- package/dist/app-file-enums.js +34 -0
- package/dist/app-file-enums.js.map +1 -0
- package/dist/authoring.d.ts +9 -0
- package/dist/authoring.d.ts.map +1 -0
- package/dist/authoring.js +9 -0
- package/dist/authoring.js.map +1 -0
- package/dist/backend/admission.d.ts +28 -0
- package/dist/backend/admission.d.ts.map +1 -0
- package/dist/backend/admission.js +146 -0
- package/dist/backend/admission.js.map +1 -0
- package/dist/backend/api.d.ts +12 -0
- package/dist/backend/api.d.ts.map +1 -0
- package/dist/backend/api.js +11 -0
- package/dist/backend/api.js.map +1 -0
- package/dist/backend/backend-clients.d.ts +76 -0
- package/dist/backend/backend-clients.d.ts.map +1 -0
- package/dist/backend/backend-clients.js +237 -0
- package/dist/backend/backend-clients.js.map +1 -0
- package/dist/backend/backend-issuer.d.ts +6 -0
- package/dist/backend/backend-issuer.d.ts.map +1 -0
- package/dist/backend/backend-issuer.js +6 -0
- package/dist/backend/backend-issuer.js.map +1 -0
- package/dist/backend/backend-native.d.ts +40 -0
- package/dist/backend/backend-native.d.ts.map +1 -0
- package/dist/backend/backend-native.js +37 -0
- package/dist/backend/backend-native.js.map +1 -0
- package/dist/backend/blobs.d.ts +130 -0
- package/dist/backend/blobs.d.ts.map +1 -0
- package/dist/backend/blobs.js +132 -0
- package/dist/backend/blobs.js.map +1 -0
- package/dist/backend/core-transport.d.ts +61 -0
- package/dist/backend/core-transport.d.ts.map +1 -0
- package/dist/backend/core-transport.js +106 -0
- package/dist/backend/core-transport.js.map +1 -0
- package/dist/backend/create-jazz-context.d.ts +94 -28
- package/dist/backend/create-jazz-context.d.ts.map +1 -1
- package/dist/backend/create-jazz-context.js +661 -67
- package/dist/backend/create-jazz-context.js.map +1 -1
- package/dist/backend/create-jazz-session.d.ts +125 -0
- package/dist/backend/create-jazz-session.d.ts.map +1 -0
- package/dist/backend/create-jazz-session.js +528 -0
- package/dist/backend/create-jazz-session.js.map +1 -0
- package/dist/backend/create-jazz.d.ts +677 -0
- package/dist/backend/create-jazz.d.ts.map +1 -0
- package/dist/backend/create-jazz.js +4076 -0
- package/dist/backend/create-jazz.js.map +1 -0
- package/dist/backend/early-db.d.ts +29 -0
- package/dist/backend/early-db.d.ts.map +1 -0
- package/dist/backend/early-db.js +203 -0
- package/dist/backend/early-db.js.map +1 -0
- package/dist/backend/external-jwt.d.ts +27 -0
- package/dist/backend/external-jwt.d.ts.map +1 -0
- package/dist/backend/external-jwt.js +404 -0
- package/dist/backend/external-jwt.js.map +1 -0
- package/dist/backend/from-jwt.d.ts +64 -0
- package/dist/backend/from-jwt.d.ts.map +1 -0
- package/dist/backend/from-jwt.js +104 -0
- package/dist/backend/from-jwt.js.map +1 -0
- package/dist/backend/index.d.ts +6 -3
- package/dist/backend/index.d.ts.map +1 -1
- package/dist/backend/index.js +18 -2
- package/dist/backend/index.js.map +1 -1
- package/dist/backend/inspect-ui.d.ts +14 -0
- package/dist/backend/inspect-ui.d.ts.map +1 -0
- package/dist/backend/inspect-ui.js +156 -0
- package/dist/backend/inspect-ui.js.map +1 -0
- package/dist/backend/inspect.d.ts +133 -0
- package/dist/backend/inspect.d.ts.map +1 -0
- package/dist/backend/inspect.js +1001 -0
- package/dist/backend/inspect.js.map +1 -0
- package/dist/backend/inspector-ui/0.js +2 -0
- package/dist/backend/inspector-ui/1.js +2 -0
- package/dist/backend/inspector-ui/10.js +2 -0
- package/dist/backend/inspector-ui/11.js +2 -0
- package/dist/backend/inspector-ui/12.js +2 -0
- package/dist/backend/inspector-ui/13.js +2 -0
- package/dist/backend/inspector-ui/14.js +2 -0
- package/dist/backend/inspector-ui/15.js +2 -0
- package/dist/backend/inspector-ui/16.js +2 -0
- package/dist/backend/inspector-ui/17.js +2 -0
- package/dist/backend/inspector-ui/18.js +2 -0
- package/dist/backend/inspector-ui/19.js +2 -0
- package/dist/backend/inspector-ui/2.js +2 -0
- package/dist/backend/inspector-ui/20.js +2 -0
- package/dist/backend/inspector-ui/21.js +2 -0
- package/dist/backend/inspector-ui/3.js +2 -0
- package/dist/backend/inspector-ui/4.js +2 -0
- package/dist/backend/inspector-ui/5.js +2 -0
- package/dist/backend/inspector-ui/6.js +2 -0
- package/dist/backend/inspector-ui/7.js +2 -0
- package/dist/backend/inspector-ui/8.js +2 -0
- package/dist/backend/inspector-ui/9.js +2 -0
- package/dist/backend/inspector-ui-files.d.ts +4 -0
- package/dist/backend/inspector-ui-files.d.ts.map +1 -0
- package/dist/backend/inspector-ui-files.js +26 -0
- package/dist/backend/no-account-error.d.ts +23 -0
- package/dist/backend/no-account-error.d.ts.map +1 -0
- package/dist/backend/no-account-error.js +30 -0
- package/dist/backend/no-account-error.js.map +1 -0
- package/dist/backend/node-native.d.ts +3 -0
- package/dist/backend/node-native.d.ts.map +1 -0
- package/dist/backend/node-native.js +19 -0
- package/dist/backend/node-native.js.map +1 -0
- package/dist/backend/node-peers.d.ts +10 -0
- package/dist/backend/node-peers.d.ts.map +1 -0
- package/dist/backend/node-peers.js +37 -0
- package/dist/backend/node-peers.js.map +1 -0
- package/dist/backend/optional-peer.d.ts +9 -0
- package/dist/backend/optional-peer.d.ts.map +1 -0
- package/dist/backend/optional-peer.js +24 -0
- package/dist/backend/optional-peer.js.map +1 -0
- package/dist/backend/request-auth.d.ts +69 -0
- package/dist/backend/request-auth.d.ts.map +1 -0
- package/dist/backend/request-auth.js +122 -0
- package/dist/backend/request-auth.js.map +1 -0
- package/dist/backend/session-expiry.d.ts +61 -0
- package/dist/backend/session-expiry.d.ts.map +1 -0
- package/dist/backend/session-expiry.js +102 -0
- package/dist/backend/session-expiry.js.map +1 -0
- package/dist/backend/signing-key.d.ts +32 -0
- package/dist/backend/signing-key.d.ts.map +1 -0
- package/dist/backend/signing-key.js +63 -0
- package/dist/backend/signing-key.js.map +1 -0
- package/dist/backend/socket-deadline.d.ts +23 -0
- package/dist/backend/socket-deadline.d.ts.map +1 -0
- package/dist/backend/socket-deadline.js +70 -0
- package/dist/backend/socket-deadline.js.map +1 -0
- package/dist/backend/store-log.d.ts +3 -0
- package/dist/backend/store-log.d.ts.map +1 -0
- package/dist/backend/store-log.js +16 -0
- package/dist/backend/store-log.js.map +1 -0
- package/dist/backend/thin-relay.d.ts +66 -0
- package/dist/backend/thin-relay.d.ts.map +1 -0
- package/dist/backend/thin-relay.js +204 -0
- package/dist/backend/thin-relay.js.map +1 -0
- package/dist/backend/thin-session-client.d.ts +23 -0
- package/dist/backend/thin-session-client.d.ts.map +1 -0
- package/dist/backend/thin-session-client.js +69 -0
- package/dist/backend/thin-session-client.js.map +1 -0
- package/dist/backend/upgrade-status.d.ts +19 -0
- package/dist/backend/upgrade-status.d.ts.map +1 -0
- package/dist/backend/upgrade-status.js +55 -0
- package/dist/backend/upgrade-status.js.map +1 -0
- package/dist/backend/vercel-store.d.ts +345 -0
- package/dist/backend/vercel-store.d.ts.map +1 -0
- package/dist/backend/vercel-store.js +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 +38 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +457 -265
- package/dist/cli.js.map +1 -1
- package/dist/client/index.d.ts +9 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +5 -0
- package/dist/client/index.js.map +1 -0
- package/dist/cloud/api.d.ts +11 -0
- package/dist/cloud/api.d.ts.map +1 -0
- package/dist/cloud/api.js +46 -0
- package/dist/cloud/api.js.map +1 -0
- package/dist/cloud/commands.d.ts +13 -0
- package/dist/cloud/commands.d.ts.map +1 -0
- package/dist/cloud/commands.js +425 -0
- package/dist/cloud/commands.js.map +1 -0
- package/dist/cloud/credentials.d.ts +49 -0
- package/dist/cloud/credentials.d.ts.map +1 -0
- package/dist/cloud/credentials.js +219 -0
- package/dist/cloud/credentials.js.map +1 -0
- package/dist/cloud/session.d.ts +57 -0
- package/dist/cloud/session.d.ts.map +1 -0
- package/dist/cloud/session.js +269 -0
- package/dist/cloud/session.js.map +1 -0
- package/dist/codegen/relation-analyzer.d.ts +5 -12
- package/dist/codegen/relation-analyzer.d.ts.map +1 -1
- package/dist/codegen/relation-analyzer.js +53 -64
- package/dist/codegen/relation-analyzer.js.map +1 -1
- package/dist/dev/app-files.d.ts +32 -0
- package/dist/dev/app-files.d.ts.map +1 -0
- package/dist/dev/app-files.js +72 -0
- package/dist/dev/app-files.js.map +1 -0
- package/dist/dev/catalogue-api.d.ts +147 -0
- package/dist/dev/catalogue-api.d.ts.map +1 -0
- package/dist/dev/catalogue-api.js +127 -0
- package/dist/dev/catalogue-api.js.map +1 -0
- package/dist/dev/catalogue.d.ts +69 -0
- package/dist/dev/catalogue.d.ts.map +1 -0
- package/dist/dev/catalogue.js +70 -0
- package/dist/dev/catalogue.js.map +1 -0
- package/dist/dev/codegen-napi.d.ts +139 -0
- package/dist/dev/codegen-napi.d.ts.map +1 -0
- package/dist/dev/codegen-napi.js +157 -0
- package/dist/dev/codegen-napi.js.map +1 -0
- package/dist/dev/dev-server.d.ts +62 -0
- package/dist/dev/dev-server.d.ts.map +1 -0
- package/dist/dev/dev-server.js +164 -0
- package/dist/dev/dev-server.js.map +1 -0
- package/dist/dev/index.d.ts +3 -0
- package/dist/dev/index.d.ts.map +1 -0
- package/dist/dev/index.js +3 -0
- package/dist/dev/index.js.map +1 -0
- package/dist/dev/inspector-overlay/browser-control-registry.d.ts +10 -0
- package/dist/dev/inspector-overlay/browser-control-registry.d.ts.map +1 -0
- package/dist/dev/inspector-overlay/browser-control-registry.js +188 -0
- package/dist/dev/inspector-overlay/browser-control-registry.js.map +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/ExportResult-C0ZojfNk.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/backend-0Idv0niF.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/backend-DHeT1LCS.css +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/create-legacy-browser-delegate-DeI8PAZ5.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/diag-api-3Z_Eel3W.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/esm-BB6DtWpZ.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/esm-B_xpsQL2.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/esm-CE7mSo95.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/esm-CcBEG-yV.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/esm-DZrCzNXM.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/esm-k373aadI.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/index-DUKUt96e.js +5 -0
- package/dist/dev/inspector-overlay/embedded/assets/jazz-broker-worker-C_mr9Omd.js +5 -0
- package/dist/dev/inspector-overlay/embedded/assets/jazz_wasm-BOvbCHn3.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/jazz_wasm_bg-BG8gazqt.wasm +0 -0
- package/dist/dev/inspector-overlay/embedded/assets/node-foreground-node-lease.browser-2mfp13Qb.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/src-4JwhxZaW.js +16 -0
- package/dist/dev/inspector-overlay/embedded/assets/src-Cq8gSOLx.css +1 -0
- package/dist/dev/inspector-overlay/embedded/backend.html +17 -0
- package/dist/dev/inspector-overlay/embedded/embedded.html +15 -0
- package/dist/dev/inspector-overlay/embedded/favicon.ico +0 -0
- package/dist/dev/inspector-overlay/host-bridge.d.ts +8 -0
- package/dist/dev/inspector-overlay/host-bridge.d.ts.map +1 -0
- package/dist/dev/inspector-overlay/host-bridge.js +139 -0
- package/dist/dev/inspector-overlay/host-bridge.js.map +1 -0
- package/dist/dev/inspector-overlay/inspector-host-types.d.ts +35 -0
- package/dist/dev/inspector-overlay/inspector-host-types.d.ts.map +1 -0
- package/dist/dev/inspector-overlay/inspector-host-types.js +10 -0
- package/dist/dev/inspector-overlay/inspector-host-types.js.map +1 -0
- package/dist/dev/inspector-overlay/loader.d.ts +24 -0
- package/dist/dev/inspector-overlay/loader.d.ts.map +1 -0
- package/dist/dev/inspector-overlay/loader.js +533 -0
- package/dist/dev/inspector-overlay/loader.js.map +1 -0
- package/dist/dev/migration-graph.d.ts +32 -0
- package/dist/dev/migration-graph.d.ts.map +1 -0
- package/dist/dev/migration-graph.js +136 -0
- package/dist/dev/migration-graph.js.map +1 -0
- package/dist/dev/migrations.d.ts +145 -0
- package/dist/dev/migrations.d.ts.map +1 -0
- package/dist/dev/migrations.js +700 -0
- package/dist/dev/migrations.js.map +1 -0
- package/dist/dev/project.d.ts +65 -0
- package/dist/dev/project.d.ts.map +1 -0
- package/dist/dev/project.js +179 -0
- package/dist/dev/project.js.map +1 -0
- package/dist/dev/schema-utils.d.ts +8 -0
- package/dist/dev/schema-utils.d.ts.map +1 -0
- package/dist/dev/schema-utils.js +75 -0
- package/dist/dev/schema-utils.js.map +1 -0
- package/dist/dev/schema-validation.d.ts +5 -0
- package/dist/dev/schema-validation.d.ts.map +1 -0
- package/dist/dev/schema-validation.js +11 -0
- package/dist/dev/schema-validation.js.map +1 -0
- package/dist/dev/ts-project.d.ts +77 -0
- package/dist/dev/ts-project.d.ts.map +1 -0
- package/dist/dev/ts-project.js +191 -0
- package/dist/dev/ts-project.js.map +1 -0
- package/dist/drivers/index.d.ts +1 -1
- package/dist/drivers/index.d.ts.map +1 -1
- package/dist/drivers/index.js.map +1 -1
- package/dist/drivers/schema-wire.d.ts +19 -3
- package/dist/drivers/schema-wire.d.ts.map +1 -1
- package/dist/drivers/schema-wire.js +61 -11
- package/dist/drivers/schema-wire.js.map +1 -1
- package/dist/drivers/types.d.ts +166 -29
- package/dist/drivers/types.d.ts.map +1 -1
- package/dist/drivers/types.js +5 -2
- package/dist/drivers/types.js.map +1 -1
- package/dist/dsl.d.ts +276 -121
- package/dist/dsl.d.ts.map +1 -1
- package/dist/dsl.js +196 -160
- package/dist/dsl.js.map +1 -1
- package/dist/durable-object/index.d.ts +26 -0
- package/dist/durable-object/index.d.ts.map +1 -0
- package/dist/durable-object/index.js +26 -0
- package/dist/durable-object/index.js.map +1 -0
- package/dist/e2ee/SODIUM-LICENSE.txt +36 -0
- package/dist/e2ee/SODIUM-SOURCES.json +4 -0
- package/dist/e2ee/browser.d.ts +18 -0
- package/dist/e2ee/browser.d.ts.map +1 -0
- package/dist/e2ee/browser.js +111 -0
- package/dist/e2ee/browser.js.map +1 -0
- package/dist/e2ee/context.d.ts +23 -0
- package/dist/e2ee/context.d.ts.map +1 -0
- package/dist/e2ee/context.js +49 -0
- package/dist/e2ee/context.js.map +1 -0
- package/dist/e2ee/crypto.d.ts +10 -0
- package/dist/e2ee/crypto.d.ts.map +1 -0
- package/dist/e2ee/crypto.js +22 -0
- package/dist/e2ee/crypto.js.map +1 -0
- package/dist/e2ee/envelope.d.ts +22 -0
- package/dist/e2ee/envelope.d.ts.map +1 -0
- package/dist/e2ee/envelope.js +52 -0
- package/dist/e2ee/envelope.js.map +1 -0
- package/dist/e2ee/index.d.ts +14 -0
- package/dist/e2ee/index.d.ts.map +1 -0
- package/dist/e2ee/index.js +3 -0
- package/dist/e2ee/index.js.map +1 -0
- package/dist/e2ee/large-value.d.ts +20 -0
- package/dist/e2ee/large-value.d.ts.map +1 -0
- package/dist/e2ee/large-value.js +204 -0
- package/dist/e2ee/large-value.js.map +1 -0
- package/dist/e2ee/native.d.ts +18 -0
- package/dist/e2ee/native.d.ts.map +1 -0
- package/dist/e2ee/native.js +91 -0
- package/dist/e2ee/native.js.map +1 -0
- package/dist/e2ee/record-frame.d.ts +3 -0
- package/dist/e2ee/record-frame.d.ts.map +1 -0
- package/dist/e2ee/record-frame.js +18 -0
- package/dist/e2ee/record-frame.js.map +1 -0
- package/dist/e2ee/signer.d.ts +10 -0
- package/dist/e2ee/signer.d.ts.map +1 -0
- package/dist/e2ee/signer.js +54 -0
- package/dist/e2ee/signer.js.map +1 -0
- package/dist/e2ee/sodium-browser.d.ts +2 -0
- package/dist/e2ee/sodium-browser.d.ts.map +1 -0
- package/dist/e2ee/sodium-browser.js +3432 -0
- package/dist/e2ee/sodium.d.ts +20 -0
- package/dist/e2ee/sodium.d.ts.map +1 -0
- package/dist/e2ee/sodium.js +165 -0
- package/dist/e2ee/sodium.js.map +1 -0
- package/dist/e2ee/types.d.ts +92 -0
- package/dist/e2ee/types.d.ts.map +1 -0
- package/dist/e2ee/types.js +2 -0
- package/dist/e2ee/types.js.map +1 -0
- package/dist/effect/backend/index.d.ts +8 -0
- package/dist/effect/backend/index.d.ts.map +1 -0
- package/dist/effect/backend/index.js +8 -0
- package/dist/effect/backend/index.js.map +1 -0
- package/dist/effect/errors.d.ts +53 -0
- package/dist/effect/errors.d.ts.map +1 -0
- package/dist/effect/errors.js +61 -0
- package/dist/effect/errors.js.map +1 -0
- package/dist/effect/index.d.ts +9 -0
- package/dist/effect/index.d.ts.map +1 -0
- package/dist/effect/index.js +9 -0
- package/dist/effect/index.js.map +1 -0
- package/dist/effect/jazz-backend.d.ts +69 -0
- package/dist/effect/jazz-backend.d.ts.map +1 -0
- package/dist/effect/jazz-backend.js +95 -0
- package/dist/effect/jazz-backend.js.map +1 -0
- package/dist/effect/jazz.d.ts +129 -0
- package/dist/effect/jazz.d.ts.map +1 -0
- package/dist/effect/jazz.js +182 -0
- package/dist/effect/jazz.js.map +1 -0
- package/dist/expo/create-account-manager.d.ts +28 -0
- package/dist/expo/create-account-manager.d.ts.map +1 -0
- package/dist/expo/create-account-manager.js +35 -0
- package/dist/expo/create-account-manager.js.map +1 -0
- package/dist/expo/create-jazz-session.d.ts +66 -0
- package/dist/expo/create-jazz-session.d.ts.map +1 -0
- package/dist/expo/create-jazz-session.js +96 -0
- package/dist/expo/create-jazz-session.js.map +1 -0
- package/dist/expo/index.d.ts +12 -0
- package/dist/expo/index.d.ts.map +1 -0
- package/dist/expo/index.js +10 -0
- package/dist/expo/index.js.map +1 -0
- package/dist/expo/metro.d.ts +20 -0
- package/dist/expo/metro.d.ts.map +1 -0
- package/dist/expo/metro.js +58 -0
- package/dist/expo/metro.js.map +1 -0
- package/dist/expo/polyfills.d.ts +2 -0
- package/dist/expo/polyfills.d.ts.map +1 -0
- package/dist/expo/polyfills.js +5 -0
- package/dist/expo/polyfills.js.map +1 -0
- package/dist/expo/provider.d.ts +10 -0
- package/dist/expo/provider.d.ts.map +1 -0
- package/dist/expo/provider.js +11 -0
- package/dist/expo/provider.js.map +1 -0
- package/dist/index.d.ts +21 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -12
- package/dist/index.js.map +1 -1
- package/dist/inspect/cli.d.ts +12 -0
- package/dist/inspect/cli.d.ts.map +1 -0
- package/dist/inspect/cli.js +320 -0
- package/dist/inspect/cli.js.map +1 -0
- package/dist/inspect/client.d.ts +67 -0
- package/dist/inspect/client.d.ts.map +1 -0
- package/dist/inspect/client.js +254 -0
- package/dist/inspect/client.js.map +1 -0
- package/dist/inspect/mcp.d.ts +28 -0
- package/dist/inspect/mcp.d.ts.map +1 -0
- package/dist/inspect/mcp.js +441 -0
- package/dist/inspect/mcp.js.map +1 -0
- package/dist/inspect/protocol.d.ts +317 -0
- package/dist/inspect/protocol.d.ts.map +1 -0
- package/dist/inspect/protocol.js +544 -0
- package/dist/inspect/protocol.js.map +1 -0
- package/dist/inspector/index.d.ts +10 -0
- package/dist/inspector/index.d.ts.map +1 -0
- package/dist/inspector/index.js +27 -0
- package/dist/inspector/index.js.map +1 -0
- package/dist/internal/inspector-query.d.ts +6 -0
- package/dist/internal/inspector-query.d.ts.map +1 -0
- package/dist/internal/inspector-query.js +20 -0
- package/dist/internal/inspector-query.js.map +1 -0
- package/dist/ir.d.ts +43 -7
- package/dist/ir.d.ts.map +1 -1
- package/dist/ir.js +509 -1
- package/dist/ir.js.map +1 -1
- package/dist/json-value.d.ts +6 -0
- package/dist/json-value.d.ts.map +1 -0
- package/dist/json-value.js +2 -0
- package/dist/json-value.js.map +1 -0
- package/dist/local-first/index.d.ts +18 -0
- package/dist/local-first/index.d.ts.map +1 -0
- package/dist/local-first/index.js +17 -0
- package/dist/local-first/index.js.map +1 -0
- package/dist/local-first-auth/browser.d.ts +18 -0
- package/dist/local-first-auth/browser.d.ts.map +1 -0
- package/dist/local-first-auth/browser.js +26 -0
- package/dist/local-first-auth/browser.js.map +1 -0
- package/dist/local-first-auth/encoding.d.ts +10 -0
- package/dist/local-first-auth/encoding.d.ts.map +1 -0
- package/dist/local-first-auth/encoding.js +38 -0
- package/dist/local-first-auth/encoding.js.map +1 -0
- package/dist/local-first-auth/identity.d.ts +73 -0
- package/dist/local-first-auth/identity.d.ts.map +1 -0
- package/dist/local-first-auth/identity.js +258 -0
- package/dist/local-first-auth/identity.js.map +1 -0
- package/dist/local-first-auth/index.d.ts +6 -0
- package/dist/local-first-auth/index.d.ts.map +1 -0
- package/dist/local-first-auth/index.js +4 -0
- package/dist/local-first-auth/index.js.map +1 -0
- package/dist/local-first-auth/passkey.d.ts +22 -0
- package/dist/local-first-auth/passkey.d.ts.map +1 -0
- package/dist/local-first-auth/passkey.js +116 -0
- package/dist/local-first-auth/passkey.js.map +1 -0
- package/dist/local-first-auth/recovery-phrase.d.ts +10 -0
- package/dist/local-first-auth/recovery-phrase.d.ts.map +1 -0
- package/dist/local-first-auth/recovery-phrase.js +59 -0
- package/dist/local-first-auth/recovery-phrase.js.map +1 -0
- package/dist/local-first-auth/secret.d.ts +25 -0
- package/dist/local-first-auth/secret.d.ts.map +1 -0
- package/dist/local-first-auth/secret.js +68 -0
- package/dist/local-first-auth/secret.js.map +1 -0
- package/dist/local-first-auth/server.d.ts +13 -0
- package/dist/local-first-auth/server.d.ts.map +1 -0
- package/dist/local-first-auth/server.js +32 -0
- package/dist/local-first-auth/server.js.map +1 -0
- package/dist/local-first-auth/store.d.ts +51 -0
- package/dist/local-first-auth/store.d.ts.map +1 -0
- package/dist/local-first-auth/store.js +112 -0
- package/dist/local-first-auth/store.js.map +1 -0
- package/dist/magic-columns.d.ts +40 -0
- package/dist/magic-columns.d.ts.map +1 -0
- package/dist/magic-columns.js +110 -0
- package/dist/magic-columns.js.map +1 -0
- package/dist/migration-namespace.d.ts +12 -0
- package/dist/migration-namespace.d.ts.map +1 -0
- package/dist/migration-namespace.js +13 -0
- package/dist/migration-namespace.js.map +1 -0
- package/dist/migrations.d.ts +286 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +188 -0
- package/dist/migrations.js.map +1 -0
- package/dist/module-interop.d.ts +17 -0
- package/dist/module-interop.d.ts.map +1 -0
- package/dist/module-interop.js +32 -0
- package/dist/module-interop.js.map +1 -0
- package/dist/observed-jazz-client.d.ts +15 -0
- package/dist/observed-jazz-client.d.ts.map +1 -0
- package/dist/observed-jazz-client.js +47 -0
- package/dist/observed-jazz-client.js.map +1 -0
- package/dist/passkey-backup.d.ts +3 -0
- package/dist/passkey-backup.d.ts.map +1 -0
- package/dist/passkey-backup.js +2 -0
- package/dist/passkey-backup.js.map +1 -0
- package/dist/passphrase.d.ts +2 -0
- package/dist/passphrase.d.ts.map +1 -0
- package/dist/passphrase.js +2 -0
- package/dist/passphrase.js.map +1 -0
- package/dist/permissions/__fixtures__/big-label-better-auth.d.ts +89 -0
- package/dist/permissions/__fixtures__/big-label-better-auth.d.ts.map +1 -0
- package/dist/permissions/__fixtures__/big-label-better-auth.js +62 -0
- package/dist/permissions/__fixtures__/big-label-better-auth.js.map +1 -0
- package/dist/permissions/__fixtures__/big-label.d.ts +332 -0
- package/dist/permissions/__fixtures__/big-label.d.ts.map +1 -0
- package/dist/permissions/__fixtures__/big-label.js +177 -0
- package/dist/permissions/__fixtures__/big-label.js.map +1 -0
- package/dist/permissions/__fixtures__/chat-react.d.ts +112 -0
- package/dist/permissions/__fixtures__/chat-react.d.ts.map +1 -0
- package/dist/permissions/__fixtures__/chat-react.js +51 -0
- package/dist/permissions/__fixtures__/chat-react.js.map +1 -0
- package/dist/permissions/compile.d.ts +182 -0
- package/dist/permissions/compile.d.ts.map +1 -0
- package/dist/permissions/compile.js +715 -0
- package/dist/permissions/compile.js.map +1 -0
- package/dist/permissions/dsl.d.ts +158 -0
- package/dist/permissions/dsl.d.ts.map +1 -0
- package/dist/permissions/dsl.js +391 -0
- package/dist/permissions/dsl.js.map +1 -0
- package/dist/permissions/relation.d.ts +84 -0
- package/dist/permissions/relation.d.ts.map +1 -0
- package/dist/permissions/relation.js +150 -0
- package/dist/permissions/relation.js.map +1 -0
- package/dist/permissions/types.d.ts +357 -0
- package/dist/permissions/types.d.ts.map +1 -0
- package/dist/permissions/types.js +5 -0
- package/dist/permissions/types.js.map +1 -0
- package/dist/printer/app-json.d.ts +96 -0
- package/dist/printer/app-json.d.ts.map +1 -0
- package/dist/printer/app-json.js +18 -0
- package/dist/printer/app-json.js.map +1 -0
- package/dist/printer/cli.d.ts +15 -0
- package/dist/printer/cli.d.ts.map +1 -0
- package/dist/printer/cli.js +76 -0
- package/dist/printer/cli.js.map +1 -0
- package/dist/printer/defs.d.ts +11 -0
- package/dist/printer/defs.d.ts.map +1 -0
- package/dist/printer/defs.js +123 -0
- package/dist/printer/defs.js.map +1 -0
- package/dist/printer/expr.d.ts +281 -0
- package/dist/printer/expr.d.ts.map +1 -0
- package/dist/printer/expr.js +940 -0
- package/dist/printer/expr.js.map +1 -0
- package/dist/printer/format.d.ts +17 -0
- package/dist/printer/format.d.ts.map +1 -0
- package/dist/printer/format.js +315 -0
- package/dist/printer/format.js.map +1 -0
- package/dist/printer/index.d.ts +31 -0
- package/dist/printer/index.d.ts.map +1 -0
- package/dist/printer/index.js +51 -0
- package/dist/printer/index.js.map +1 -0
- package/dist/printer/migrations.d.ts +28 -0
- package/dist/printer/migrations.d.ts.map +1 -0
- package/dist/printer/migrations.js +179 -0
- package/dist/printer/migrations.js.map +1 -0
- package/dist/printer/names.d.ts +17 -0
- package/dist/printer/names.d.ts.map +1 -0
- package/dist/printer/names.js +124 -0
- package/dist/printer/names.js.map +1 -0
- package/dist/printer/permissions.d.ts +60 -0
- package/dist/printer/permissions.d.ts.map +1 -0
- package/dist/printer/permissions.js +1167 -0
- package/dist/printer/permissions.js.map +1 -0
- package/dist/printer/schema.d.ts +18 -0
- package/dist/printer/schema.d.ts.map +1 -0
- package/dist/printer/schema.js +132 -0
- package/dist/printer/schema.js.map +1 -0
- package/dist/prosemirror/anchors.d.ts +30 -0
- package/dist/prosemirror/anchors.d.ts.map +1 -0
- package/dist/prosemirror/anchors.js +28 -0
- package/dist/prosemirror/anchors.js.map +1 -0
- package/dist/prosemirror/index.d.ts +7 -0
- package/dist/prosemirror/index.d.ts.map +1 -0
- package/dist/prosemirror/index.js +7 -0
- package/dist/prosemirror/index.js.map +1 -0
- package/dist/prosemirror/markdown.d.ts +95 -0
- package/dist/prosemirror/markdown.d.ts.map +1 -0
- package/dist/prosemirror/markdown.js +428 -0
- package/dist/prosemirror/markdown.js.map +1 -0
- package/dist/prosemirror/overlays.d.ts +69 -0
- package/dist/prosemirror/overlays.d.ts.map +1 -0
- package/dist/prosemirror/overlays.js +143 -0
- package/dist/prosemirror/overlays.js.map +1 -0
- package/dist/prosemirror/presence.d.ts +39 -0
- package/dist/prosemirror/presence.d.ts.map +1 -0
- package/dist/prosemirror/presence.js +88 -0
- package/dist/prosemirror/presence.js.map +1 -0
- package/dist/prosemirror/sync.d.ts +60 -0
- package/dist/prosemirror/sync.d.ts.map +1 -0
- package/dist/prosemirror/sync.js +196 -0
- package/dist/prosemirror/sync.js.map +1 -0
- package/dist/prosemirror/text-map.d.ts +21 -0
- package/dist/prosemirror/text-map.d.ts.map +1 -0
- package/dist/prosemirror/text-map.js +85 -0
- package/dist/prosemirror/text-map.js.map +1 -0
- package/dist/react/create-jazz-client.d.ts +2 -11
- package/dist/react/create-jazz-client.d.ts.map +1 -1
- package/dist/react/create-jazz-client.js +1 -47
- package/dist/react/create-jazz-client.js.map +1 -1
- package/dist/react/index.d.ts +14 -7
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +8 -6
- package/dist/react/index.js.map +1 -1
- package/dist/react/provider-props.d.ts +7 -0
- package/dist/react/provider-props.d.ts.map +1 -0
- package/dist/react/provider-props.js +15 -0
- package/dist/react/provider-props.js.map +1 -0
- package/dist/react/provider.d.ts +19 -15
- package/dist/react/provider.d.ts.map +1 -1
- package/dist/react/provider.js +25 -5
- package/dist/react/provider.js.map +1 -1
- package/dist/react/use-all.d.ts +1 -1
- package/dist/react/use-all.d.ts.map +1 -1
- package/dist/react/use-all.js +1 -1
- package/dist/react/use-all.js.map +1 -1
- package/dist/react/use-one.d.ts +2 -0
- package/dist/react/use-one.d.ts.map +1 -0
- package/dist/react/use-one.js +2 -0
- package/dist/react/use-one.js.map +1 -0
- package/dist/react-core/index.d.ts +9 -4
- package/dist/react-core/index.d.ts.map +1 -1
- package/dist/react-core/index.js +10 -2
- package/dist/react-core/index.js.map +1 -1
- package/dist/react-core/provider.d.ts +48 -12
- package/dist/react-core/provider.d.ts.map +1 -1
- package/dist/react-core/provider.js +117 -13
- package/dist/react-core/provider.js.map +1 -1
- package/dist/react-core/session-context.d.ts +7 -0
- package/dist/react-core/session-context.d.ts.map +1 -0
- package/dist/react-core/session-context.js +8 -0
- package/dist/react-core/session-context.js.map +1 -0
- package/dist/react-core/session.d.ts +63 -0
- package/dist/react-core/session.d.ts.map +1 -0
- package/dist/react-core/session.js +97 -0
- package/dist/react-core/session.js.map +1 -0
- package/dist/react-core/use-all.d.ts +95 -3
- package/dist/react-core/use-all.d.ts.map +1 -1
- package/dist/react-core/use-all.js +126 -52
- package/dist/react-core/use-all.js.map +1 -1
- package/dist/react-core/use-auth-state.d.ts +13 -0
- package/dist/react-core/use-auth-state.d.ts.map +1 -0
- package/dist/react-core/use-auth-state.js +15 -0
- package/dist/react-core/use-auth-state.js.map +1 -0
- package/dist/react-core/use-one.d.ts +58 -0
- package/dist/react-core/use-one.d.ts.map +1 -0
- package/dist/react-core/use-one.js +19 -0
- package/dist/react-core/use-one.js.map +1 -0
- package/dist/react-core/use-sync-status.d.ts +8 -0
- package/dist/react-core/use-sync-status.d.ts.map +1 -0
- package/dist/react-core/use-sync-status.js +12 -0
- package/dist/react-core/use-sync-status.js.map +1 -0
- package/dist/react-native/abort-signal.d.ts +9 -0
- package/dist/react-native/abort-signal.d.ts.map +1 -0
- package/dist/react-native/abort-signal.js +51 -0
- package/dist/react-native/abort-signal.js.map +1 -0
- package/dist/react-native/account-session.d.ts +11 -0
- package/dist/react-native/account-session.d.ts.map +1 -0
- package/dist/react-native/account-session.js +59 -0
- package/dist/react-native/account-session.js.map +1 -0
- package/dist/react-native/create-account-manager.d.ts +28 -0
- package/dist/react-native/create-account-manager.d.ts.map +1 -0
- package/dist/react-native/create-account-manager.js +30 -0
- package/dist/react-native/create-account-manager.js.map +1 -0
- package/dist/react-native/create-db.d.ts +8 -0
- package/dist/react-native/create-db.d.ts.map +1 -0
- package/dist/react-native/create-db.js +9 -0
- package/dist/react-native/create-db.js.map +1 -0
- package/dist/react-native/create-jazz-client.d.ts +12 -10
- package/dist/react-native/create-jazz-client.d.ts.map +1 -1
- package/dist/react-native/create-jazz-client.js +6 -21
- package/dist/react-native/create-jazz-client.js.map +1 -1
- package/dist/react-native/create-jazz-session.d.ts +66 -0
- package/dist/react-native/create-jazz-session.d.ts.map +1 -0
- package/dist/react-native/create-jazz-session.js +96 -0
- package/dist/react-native/create-jazz-session.js.map +1 -0
- package/dist/react-native/errors.d.ts +6 -0
- package/dist/react-native/errors.d.ts.map +1 -0
- package/dist/react-native/errors.js +6 -0
- package/dist/react-native/errors.js.map +1 -0
- package/dist/react-native/index.d.ts +19 -9
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js +13 -7
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/native-foreground-db.d.ts +227 -0
- package/dist/react-native/native-foreground-db.d.ts.map +1 -0
- package/dist/react-native/native-foreground-db.js +905 -0
- package/dist/react-native/native-foreground-db.js.map +1 -0
- package/dist/react-native/native-relay.d.ts +7 -0
- package/dist/react-native/native-relay.d.ts.map +1 -0
- package/dist/react-native/native-relay.js +14 -0
- package/dist/react-native/native-relay.js.map +1 -0
- package/dist/react-native/provider.d.ts +19 -13
- package/dist/react-native/provider.d.ts.map +1 -1
- package/dist/react-native/provider.js +25 -5
- package/dist/react-native/provider.js.map +1 -1
- package/dist/react-native/runtime-source.d.ts +62 -0
- package/dist/react-native/runtime-source.d.ts.map +1 -0
- package/dist/react-native/runtime-source.js +314 -0
- package/dist/react-native/runtime-source.js.map +1 -0
- package/dist/react-native/use-all.d.ts +1 -1
- package/dist/react-native/use-all.d.ts.map +1 -1
- package/dist/react-native/use-all.js +1 -1
- package/dist/react-native/use-all.js.map +1 -1
- package/dist/react-native/use-one.d.ts +2 -0
- package/dist/react-native/use-one.d.ts.map +1 -0
- package/dist/react-native/use-one.js +2 -0
- package/dist/react-native/use-one.js.map +1 -0
- package/dist/reconcile-array.d.ts +45 -0
- package/dist/reconcile-array.d.ts.map +1 -0
- package/dist/reconcile-array.js +252 -0
- package/dist/reconcile-array.js.map +1 -0
- package/dist/relationships.d.ts +18 -0
- package/dist/relationships.d.ts.map +1 -0
- package/dist/relationships.js +28 -0
- package/dist/relationships.js.map +1 -0
- package/dist/runtime/auth-renewal-backoff.d.ts +14 -0
- package/dist/runtime/auth-renewal-backoff.d.ts.map +1 -0
- package/dist/runtime/auth-renewal-backoff.js +23 -0
- package/dist/runtime/auth-renewal-backoff.js.map +1 -0
- package/dist/runtime/auth-request-deadline.d.ts +3 -0
- package/dist/runtime/auth-request-deadline.d.ts.map +1 -0
- package/dist/runtime/auth-request-deadline.js +24 -0
- package/dist/runtime/auth-request-deadline.js.map +1 -0
- package/dist/runtime/auth-secret-codec.d.ts +21 -0
- package/dist/runtime/auth-secret-codec.d.ts.map +1 -0
- package/dist/runtime/auth-secret-codec.js +32 -0
- package/dist/runtime/auth-secret-codec.js.map +1 -0
- package/dist/runtime/auth-secret-store.d.ts +7 -0
- package/dist/runtime/auth-secret-store.d.ts.map +1 -0
- package/dist/runtime/auth-secret-store.js +12 -0
- package/dist/runtime/auth-secret-store.js.map +1 -0
- package/dist/runtime/auth-state.d.ts +47 -0
- package/dist/runtime/auth-state.d.ts.map +1 -0
- package/dist/runtime/auth-state.js +161 -0
- package/dist/runtime/auth-state.js.map +1 -0
- package/dist/runtime/author-id.d.ts +42 -0
- package/dist/runtime/author-id.d.ts.map +1 -0
- package/dist/runtime/author-id.js +172 -0
- package/dist/runtime/author-id.js.map +1 -0
- package/dist/runtime/authority-changed-error.d.ts +56 -0
- package/dist/runtime/authority-changed-error.d.ts.map +1 -0
- package/dist/runtime/authority-changed-error.js +74 -0
- package/dist/runtime/authority-changed-error.js.map +1 -0
- package/dist/runtime/backlog-rows.d.ts +3 -0
- package/dist/runtime/backlog-rows.d.ts.map +1 -0
- package/dist/runtime/backlog-rows.js +7 -0
- package/dist/runtime/backlog-rows.js.map +1 -0
- package/dist/runtime/browser-physical-database-epoch.d.ts +37 -0
- package/dist/runtime/browser-physical-database-epoch.d.ts.map +1 -0
- package/dist/runtime/browser-physical-database-epoch.js +89 -0
- package/dist/runtime/browser-physical-database-epoch.js.map +1 -0
- package/dist/runtime/browser-storage-invalidation.d.ts +8 -0
- package/dist/runtime/browser-storage-invalidation.d.ts.map +1 -0
- package/dist/runtime/browser-storage-invalidation.js +20 -0
- package/dist/runtime/browser-storage-invalidation.js.map +1 -0
- package/dist/runtime/browser-store-generation.d.ts +15 -0
- package/dist/runtime/browser-store-generation.d.ts.map +1 -0
- package/dist/runtime/browser-store-generation.js +48 -0
- package/dist/runtime/browser-store-generation.js.map +1 -0
- package/dist/runtime/browser-worker-assets.d.ts +31 -0
- package/dist/runtime/browser-worker-assets.d.ts.map +1 -0
- package/dist/runtime/browser-worker-assets.js +40 -0
- package/dist/runtime/browser-worker-assets.js.map +1 -0
- package/dist/runtime/browser-worker-assets.metro.d.ts +28 -0
- package/dist/runtime/browser-worker-assets.metro.d.ts.map +1 -0
- package/dist/runtime/browser-worker-assets.metro.js +52 -0
- package/dist/runtime/browser-worker-assets.metro.js.map +1 -0
- package/dist/runtime/browser-worker-assets.native.d.ts +7 -0
- package/dist/runtime/browser-worker-assets.native.d.ts.map +1 -0
- package/dist/runtime/browser-worker-assets.native.js +8 -0
- package/dist/runtime/browser-worker-assets.native.js.map +1 -0
- package/dist/runtime/browser-worker-config.d.ts +78 -0
- package/dist/runtime/browser-worker-config.d.ts.map +1 -0
- package/dist/runtime/browser-worker-config.js +299 -0
- package/dist/runtime/browser-worker-config.js.map +1 -0
- package/dist/runtime/client-config-key.d.ts +6 -0
- package/dist/runtime/client-config-key.d.ts.map +1 -0
- package/dist/runtime/client-config-key.js +83 -0
- package/dist/runtime/client-config-key.js.map +1 -0
- package/dist/runtime/client-migrations.d.ts +27 -0
- package/dist/runtime/client-migrations.d.ts.map +1 -0
- package/dist/runtime/client-migrations.js +25 -0
- package/dist/runtime/client-migrations.js.map +1 -0
- package/dist/runtime/client-registry.d.ts +21 -0
- package/dist/runtime/client-registry.d.ts.map +1 -0
- package/dist/runtime/client-registry.js +169 -0
- package/dist/runtime/client-registry.js.map +1 -0
- package/dist/runtime/client-scope.d.ts +38 -0
- package/dist/runtime/client-scope.d.ts.map +1 -0
- package/dist/runtime/client-scope.js +64 -0
- package/dist/runtime/client-scope.js.map +1 -0
- package/dist/runtime/client-session.d.ts +56 -14
- package/dist/runtime/client-session.d.ts.map +1 -1
- package/dist/runtime/client-session.js +211 -195
- package/dist/runtime/client-session.js.map +1 -1
- package/dist/runtime/client.d.ts +721 -194
- package/dist/runtime/client.d.ts.map +1 -1
- package/dist/runtime/client.js +1213 -434
- package/dist/runtime/client.js.map +1 -1
- package/dist/runtime/column-transforms.d.ts +26 -0
- package/dist/runtime/column-transforms.d.ts.map +1 -0
- package/dist/runtime/column-transforms.js +186 -0
- package/dist/runtime/column-transforms.js.map +1 -0
- package/dist/runtime/connection-manager/browser-connection-manager.d.ts +178 -0
- package/dist/runtime/connection-manager/browser-connection-manager.d.ts.map +1 -0
- package/dist/runtime/connection-manager/browser-connection-manager.js +1030 -0
- package/dist/runtime/connection-manager/browser-connection-manager.js.map +1 -0
- package/dist/runtime/connection-manager/direct-connection-manager.d.ts +28 -0
- package/dist/runtime/connection-manager/direct-connection-manager.d.ts.map +1 -0
- package/dist/runtime/connection-manager/direct-connection-manager.js +202 -0
- package/dist/runtime/connection-manager/direct-connection-manager.js.map +1 -0
- package/dist/runtime/connection-manager/index.d.ts +5 -0
- package/dist/runtime/connection-manager/index.d.ts.map +1 -0
- package/dist/runtime/connection-manager/index.js +4 -0
- package/dist/runtime/connection-manager/index.js.map +1 -0
- package/dist/runtime/connection-manager/types.d.ts +174 -0
- package/dist/runtime/connection-manager/types.d.ts.map +1 -0
- package/dist/runtime/connection-manager/types.js +396 -0
- package/dist/runtime/connection-manager/types.js.map +1 -0
- package/dist/runtime/context.d.ts +100 -30
- package/dist/runtime/context.d.ts.map +1 -1
- package/dist/runtime/context.js.map +1 -1
- package/dist/runtime/core-tick-failed-error.d.ts +31 -0
- package/dist/runtime/core-tick-failed-error.d.ts.map +1 -0
- package/dist/runtime/core-tick-failed-error.js +45 -0
- package/dist/runtime/core-tick-failed-error.js.map +1 -0
- package/dist/runtime/credentialed-transport.d.ts +42 -0
- package/dist/runtime/credentialed-transport.d.ts.map +1 -0
- package/dist/runtime/credentialed-transport.js +178 -0
- package/dist/runtime/credentialed-transport.js.map +1 -0
- package/dist/runtime/db-access-context.d.ts +14 -0
- package/dist/runtime/db-access-context.d.ts.map +1 -0
- package/dist/runtime/db-access-context.js +26 -0
- package/dist/runtime/db-access-context.js.map +1 -0
- package/dist/runtime/db-internal-session.d.ts +7 -0
- package/dist/runtime/db-internal-session.d.ts.map +1 -0
- package/dist/runtime/db-internal-session.js +21 -0
- package/dist/runtime/db-internal-session.js.map +1 -0
- package/dist/runtime/db-replaced-error.d.ts +21 -0
- package/dist/runtime/db-replaced-error.d.ts.map +1 -0
- package/dist/runtime/db-replaced-error.js +22 -0
- package/dist/runtime/db-replaced-error.js.map +1 -0
- package/dist/runtime/db.d.ts +857 -215
- package/dist/runtime/db.d.ts.map +1 -1
- package/dist/runtime/db.js +3474 -834
- package/dist/runtime/db.js.map +1 -1
- package/dist/runtime/default-create-db.d.ts +5 -0
- package/dist/runtime/default-create-db.d.ts.map +1 -0
- package/dist/runtime/default-create-db.js +7 -0
- package/dist/runtime/default-create-db.js.map +1 -0
- package/dist/runtime/default-runtime-source.d.ts +41 -0
- package/dist/runtime/default-runtime-source.d.ts.map +1 -0
- package/dist/runtime/default-runtime-source.js +326 -0
- package/dist/runtime/default-runtime-source.js.map +1 -0
- package/dist/runtime/delete-local-first-store.d.ts +12 -0
- package/dist/runtime/delete-local-first-store.d.ts.map +1 -0
- package/dist/runtime/delete-local-first-store.js +12 -0
- package/dist/runtime/delete-local-first-store.js.map +1 -0
- package/dist/runtime/deterministic-bytes.d.ts +6 -0
- package/dist/runtime/deterministic-bytes.d.ts.map +1 -0
- package/dist/runtime/deterministic-bytes.js +18 -0
- package/dist/runtime/deterministic-bytes.js.map +1 -0
- package/dist/runtime/graceful-shutdown-error.d.ts +17 -0
- package/dist/runtime/graceful-shutdown-error.d.ts.map +1 -0
- package/dist/runtime/graceful-shutdown-error.js +31 -0
- package/dist/runtime/graceful-shutdown-error.js.map +1 -0
- package/dist/runtime/hex.d.ts +21 -0
- package/dist/runtime/hex.d.ts.map +1 -0
- package/dist/runtime/hex.js +62 -0
- package/dist/runtime/hex.js.map +1 -0
- package/dist/runtime/history-relation.d.ts +8 -0
- package/dist/runtime/history-relation.d.ts.map +1 -0
- package/dist/runtime/history-relation.js +44 -0
- package/dist/runtime/history-relation.js.map +1 -0
- package/dist/runtime/in-process-transport.d.ts +18 -0
- package/dist/runtime/in-process-transport.d.ts.map +1 -0
- package/dist/runtime/in-process-transport.js +32 -0
- package/dist/runtime/in-process-transport.js.map +1 -0
- package/dist/runtime/index.d.ts +22 -13
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +14 -12
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/indexeddb-page-store.d.ts +214 -0
- package/dist/runtime/indexeddb-page-store.d.ts.map +1 -0
- package/dist/runtime/indexeddb-page-store.js +848 -0
- package/dist/runtime/indexeddb-page-store.js.map +1 -0
- package/dist/runtime/introspection-fetch.d.ts +18 -0
- package/dist/runtime/introspection-fetch.d.ts.map +1 -0
- package/dist/runtime/introspection-fetch.js +12 -0
- package/dist/runtime/introspection-fetch.js.map +1 -0
- package/dist/runtime/json-schema-evaluate.d.ts +55 -0
- package/dist/runtime/json-schema-evaluate.d.ts.map +1 -0
- package/dist/runtime/json-schema-evaluate.js +946 -0
- package/dist/runtime/json-schema-evaluate.js.map +1 -0
- package/dist/runtime/json-schema-formats.d.ts +14 -0
- package/dist/runtime/json-schema-formats.d.ts.map +1 -0
- package/dist/runtime/json-schema-formats.js +555 -0
- package/dist/runtime/json-schema-formats.js.map +1 -0
- package/dist/runtime/json-schema-json.d.ts +41 -0
- package/dist/runtime/json-schema-json.d.ts.map +1 -0
- package/dist/runtime/json-schema-json.js +309 -0
- package/dist/runtime/json-schema-json.js.map +1 -0
- package/dist/runtime/json-schema-metaschemas.d.ts +1403 -0
- package/dist/runtime/json-schema-metaschemas.d.ts.map +1 -0
- package/dist/runtime/json-schema-metaschemas.js +64 -0
- package/dist/runtime/json-schema-metaschemas.js.map +1 -0
- package/dist/runtime/json-schema-regex.d.ts +32 -0
- package/dist/runtime/json-schema-regex.d.ts.map +1 -0
- package/dist/runtime/json-schema-regex.js +895 -0
- package/dist/runtime/json-schema-regex.js.map +1 -0
- package/dist/runtime/json-schema-validator.d.ts +50 -0
- package/dist/runtime/json-schema-validator.d.ts.map +1 -0
- package/dist/runtime/json-schema-validator.js +404 -0
- package/dist/runtime/json-schema-validator.js.map +1 -0
- package/dist/runtime/json-text.js.map +1 -1
- package/dist/runtime/local-first-token.d.ts +11 -0
- package/dist/runtime/local-first-token.d.ts.map +1 -0
- package/dist/runtime/local-first-token.js +20 -0
- package/dist/runtime/local-first-token.js.map +1 -0
- package/dist/runtime/local-first-unavailable.d.ts +40 -0
- package/dist/runtime/local-first-unavailable.d.ts.map +1 -0
- package/dist/runtime/local-first-unavailable.js +81 -0
- package/dist/runtime/local-first-unavailable.js.map +1 -0
- package/dist/runtime/local-first-upgrade.d.ts +36 -0
- package/dist/runtime/local-first-upgrade.d.ts.map +1 -0
- package/dist/runtime/local-first-upgrade.js +31 -0
- package/dist/runtime/local-first-upgrade.js.map +1 -0
- package/dist/runtime/local-write-observer.d.ts +5 -0
- package/dist/runtime/local-write-observer.d.ts.map +1 -0
- package/dist/runtime/local-write-observer.js +31 -0
- package/dist/runtime/local-write-observer.js.map +1 -0
- package/dist/runtime/metro-setup-error.d.ts +20 -0
- package/dist/runtime/metro-setup-error.d.ts.map +1 -0
- package/dist/runtime/metro-setup-error.js +22 -0
- package/dist/runtime/metro-setup-error.js.map +1 -0
- package/dist/runtime/native-artifact-compatibility.d.ts +12 -0
- package/dist/runtime/native-artifact-compatibility.d.ts.map +1 -0
- package/dist/runtime/native-artifact-compatibility.js +26 -0
- package/dist/runtime/native-artifact-compatibility.js.map +1 -0
- package/dist/runtime/native-artifact-fingerprint-napi.d.ts +2 -0
- package/dist/runtime/native-artifact-fingerprint-napi.d.ts.map +1 -0
- package/dist/runtime/native-artifact-fingerprint-napi.js +3 -0
- package/dist/runtime/native-artifact-fingerprint-napi.js.map +1 -0
- package/dist/runtime/native-artifact-fingerprint-wasm.d.ts +2 -0
- package/dist/runtime/native-artifact-fingerprint-wasm.d.ts.map +1 -0
- package/dist/runtime/native-artifact-fingerprint-wasm.js +3 -0
- package/dist/runtime/native-artifact-fingerprint-wasm.js.map +1 -0
- package/dist/runtime/native-artifact-fingerprints.d.ts +5 -0
- package/dist/runtime/native-artifact-fingerprints.d.ts.map +1 -0
- package/dist/runtime/native-artifact-fingerprints.js +7 -0
- package/dist/runtime/native-artifact-fingerprints.js.map +1 -0
- package/dist/runtime/native-artifact-mismatch-error.d.ts +25 -0
- package/dist/runtime/native-artifact-mismatch-error.d.ts.map +1 -0
- package/dist/runtime/native-artifact-mismatch-error.js +34 -0
- package/dist/runtime/native-artifact-mismatch-error.js.map +1 -0
- package/dist/runtime/native-runtime/attached-browser-worker-connection.d.ts +23 -0
- package/dist/runtime/native-runtime/attached-browser-worker-connection.d.ts.map +1 -0
- package/dist/runtime/native-runtime/attached-browser-worker-connection.js +45 -0
- package/dist/runtime/native-runtime/attached-browser-worker-connection.js.map +1 -0
- package/dist/runtime/native-runtime/auxiliary-receive-deadline.d.ts +15 -0
- package/dist/runtime/native-runtime/auxiliary-receive-deadline.d.ts.map +1 -0
- package/dist/runtime/native-runtime/auxiliary-receive-deadline.js +64 -0
- package/dist/runtime/native-runtime/auxiliary-receive-deadline.js.map +1 -0
- package/dist/runtime/native-runtime/broker-worker-load-failure.d.ts +34 -0
- package/dist/runtime/native-runtime/broker-worker-load-failure.d.ts.map +1 -0
- package/dist/runtime/native-runtime/broker-worker-load-failure.js +61 -0
- package/dist/runtime/native-runtime/broker-worker-load-failure.js.map +1 -0
- package/dist/runtime/native-runtime/browser-follower-connection.d.ts +109 -0
- package/dist/runtime/native-runtime/browser-follower-connection.d.ts.map +1 -0
- package/dist/runtime/native-runtime/browser-follower-connection.js +558 -0
- package/dist/runtime/native-runtime/browser-follower-connection.js.map +1 -0
- package/dist/runtime/native-runtime/browser-shared-worker-connection.d.ts +130 -0
- package/dist/runtime/native-runtime/browser-shared-worker-connection.d.ts.map +1 -0
- package/dist/runtime/native-runtime/browser-shared-worker-connection.js +988 -0
- package/dist/runtime/native-runtime/browser-shared-worker-connection.js.map +1 -0
- package/dist/runtime/native-runtime/browser-worker-protocol.d.ts +527 -0
- package/dist/runtime/native-runtime/browser-worker-protocol.d.ts.map +1 -0
- package/dist/runtime/native-runtime/browser-worker-protocol.js +296 -0
- package/dist/runtime/native-runtime/browser-worker-protocol.js.map +1 -0
- package/dist/runtime/native-runtime/browser-worker-transport.d.ts +56 -0
- package/dist/runtime/native-runtime/browser-worker-transport.d.ts.map +1 -0
- package/dist/runtime/native-runtime/browser-worker-transport.js +305 -0
- package/dist/runtime/native-runtime/browser-worker-transport.js.map +1 -0
- package/dist/runtime/native-runtime/exact-integer.d.ts +7 -0
- package/dist/runtime/native-runtime/exact-integer.d.ts.map +1 -0
- package/dist/runtime/native-runtime/exact-integer.js +18 -0
- package/dist/runtime/native-runtime/exact-integer.js.map +1 -0
- package/dist/runtime/native-runtime/http-stream-socket.d.ts +103 -0
- package/dist/runtime/native-runtime/http-stream-socket.d.ts.map +1 -0
- package/dist/runtime/native-runtime/http-stream-socket.js +554 -0
- package/dist/runtime/native-runtime/http-stream-socket.js.map +1 -0
- package/dist/runtime/native-runtime/inspector-control-lifecycle.d.ts +4 -0
- package/dist/runtime/native-runtime/inspector-control-lifecycle.d.ts.map +1 -0
- package/dist/runtime/native-runtime/inspector-control-lifecycle.js +33 -0
- package/dist/runtime/native-runtime/inspector-control-lifecycle.js.map +1 -0
- package/dist/runtime/native-runtime/native-codec.d.ts +172 -0
- package/dist/runtime/native-runtime/native-codec.d.ts.map +1 -0
- package/dist/runtime/native-runtime/native-codec.js +629 -0
- package/dist/runtime/native-runtime/native-codec.js.map +1 -0
- package/dist/runtime/native-runtime/native-error-code.d.ts +39 -0
- package/dist/runtime/native-runtime/native-error-code.d.ts.map +1 -0
- package/dist/runtime/native-runtime/native-error-code.js +64 -0
- package/dist/runtime/native-runtime/native-error-code.js.map +1 -0
- package/dist/runtime/native-runtime/native-row-codec.d.ts +161 -0
- package/dist/runtime/native-runtime/native-row-codec.d.ts.map +1 -0
- package/dist/runtime/native-runtime/native-row-codec.js +903 -0
- package/dist/runtime/native-runtime/native-row-codec.js.map +1 -0
- package/dist/runtime/native-runtime/native-row-descriptor-key.d.ts +15 -0
- package/dist/runtime/native-runtime/native-row-descriptor-key.d.ts.map +1 -0
- package/dist/runtime/native-runtime/native-row-descriptor-key.js +25 -0
- package/dist/runtime/native-runtime/native-row-descriptor-key.js.map +1 -0
- package/dist/runtime/native-runtime/native-runtime-adapter.d.ts +913 -0
- package/dist/runtime/native-runtime/native-runtime-adapter.d.ts.map +1 -0
- package/dist/runtime/native-runtime/native-runtime-adapter.js +5999 -0
- package/dist/runtime/native-runtime/native-runtime-adapter.js.map +1 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.browser.d.ts +17 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.browser.d.ts.map +1 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.browser.js +4 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.browser.js.map +1 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.d.ts +19 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.d.ts.map +1 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.js +297 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.js.map +1 -0
- package/dist/runtime/native-runtime/row-values-transport.d.ts +2 -0
- package/dist/runtime/native-runtime/row-values-transport.d.ts.map +1 -0
- package/dist/runtime/native-runtime/row-values-transport.js +21 -0
- package/dist/runtime/native-runtime/row-values-transport.js.map +1 -0
- package/dist/runtime/native-runtime/schema-codec.d.ts +10 -0
- package/dist/runtime/native-runtime/schema-codec.d.ts.map +1 -0
- package/dist/runtime/native-runtime/schema-codec.js +13 -0
- package/dist/runtime/native-runtime/schema-codec.js.map +1 -0
- package/dist/runtime/native-runtime/session-renewal-wire.d.ts +48 -0
- package/dist/runtime/native-runtime/session-renewal-wire.d.ts.map +1 -0
- package/dist/runtime/native-runtime/session-renewal-wire.js +107 -0
- package/dist/runtime/native-runtime/session-renewal-wire.js.map +1 -0
- package/dist/runtime/native-runtime/stream-endpoint-memory.d.ts +34 -0
- package/dist/runtime/native-runtime/stream-endpoint-memory.d.ts.map +1 -0
- package/dist/runtime/native-runtime/stream-endpoint-memory.js +146 -0
- package/dist/runtime/native-runtime/stream-endpoint-memory.js.map +1 -0
- package/dist/runtime/native-runtime/websocket.d.ts +327 -0
- package/dist/runtime/native-runtime/websocket.d.ts.map +1 -0
- package/dist/runtime/native-runtime/websocket.js +1112 -0
- package/dist/runtime/native-runtime/websocket.js.map +1 -0
- package/dist/runtime/newer-build-reload.d.ts +30 -0
- package/dist/runtime/newer-build-reload.d.ts.map +1 -0
- package/dist/runtime/newer-build-reload.js +59 -0
- package/dist/runtime/newer-build-reload.js.map +1 -0
- package/dist/runtime/page-cache.d.ts +44 -0
- package/dist/runtime/page-cache.d.ts.map +1 -0
- package/dist/runtime/page-cache.js +104 -0
- package/dist/runtime/page-cache.js.map +1 -0
- package/dist/runtime/page-handle.d.ts +83 -0
- package/dist/runtime/page-handle.d.ts.map +1 -0
- package/dist/runtime/page-handle.js +151 -0
- package/dist/runtime/page-handle.js.map +1 -0
- package/dist/runtime/passkey-backup.d.ts +3 -0
- package/dist/runtime/passkey-backup.d.ts.map +1 -0
- package/dist/runtime/passkey-backup.js +2 -0
- package/dist/runtime/passkey-backup.js.map +1 -0
- package/dist/runtime/platform-url.d.ts +10 -0
- package/dist/runtime/platform-url.d.ts.map +1 -0
- package/dist/runtime/platform-url.js +3 -0
- package/dist/runtime/platform-url.js.map +1 -0
- package/dist/runtime/platform-url.native.d.ts +6 -0
- package/dist/runtime/platform-url.native.d.ts.map +1 -0
- package/dist/runtime/platform-url.native.js +38 -0
- package/dist/runtime/platform-url.native.js.map +1 -0
- package/dist/runtime/query-adapter.d.ts +7 -15
- package/dist/runtime/query-adapter.d.ts.map +1 -1
- package/dist/runtime/query-adapter.js +390 -110
- package/dist/runtime/query-adapter.js.map +1 -1
- package/dist/runtime/query-builder-shape.d.ts +75 -0
- package/dist/runtime/query-builder-shape.d.ts.map +1 -0
- package/dist/runtime/query-builder-shape.js +225 -0
- package/dist/runtime/query-builder-shape.js.map +1 -0
- package/dist/runtime/query-column-name.d.ts +3 -0
- package/dist/runtime/query-column-name.d.ts.map +1 -0
- package/dist/runtime/query-column-name.js +10 -0
- package/dist/runtime/query-column-name.js.map +1 -0
- package/dist/runtime/query-output-table.d.ts +5 -0
- package/dist/runtime/query-output-table.d.ts.map +1 -0
- package/dist/runtime/query-output-table.js +30 -0
- package/dist/runtime/query-output-table.js.map +1 -0
- package/dist/runtime/recovery-phrase.d.ts +3 -0
- package/dist/runtime/recovery-phrase.d.ts.map +1 -0
- package/dist/runtime/recovery-phrase.js +2 -0
- package/dist/runtime/recovery-phrase.js.map +1 -0
- package/dist/runtime/remote-link-state.d.ts +20 -0
- package/dist/runtime/remote-link-state.d.ts.map +1 -0
- package/dist/runtime/remote-link-state.js +5 -0
- package/dist/runtime/remote-link-state.js.map +1 -0
- package/dist/runtime/removed-provider-props.d.ts +17 -0
- package/dist/runtime/removed-provider-props.d.ts.map +1 -0
- package/dist/runtime/removed-provider-props.js +16 -0
- package/dist/runtime/removed-provider-props.js.map +1 -0
- package/dist/runtime/row-transformer.d.ts +17 -3
- package/dist/runtime/row-transformer.d.ts.map +1 -1
- package/dist/runtime/row-transformer.js +163 -38
- package/dist/runtime/row-transformer.js.map +1 -1
- package/dist/runtime/run-cleanup-steps.d.ts +5 -0
- package/dist/runtime/run-cleanup-steps.d.ts.map +1 -0
- package/dist/runtime/run-cleanup-steps.js +19 -0
- package/dist/runtime/run-cleanup-steps.js.map +1 -0
- package/dist/runtime/runtime-closed-error.d.ts +9 -0
- package/dist/runtime/runtime-closed-error.d.ts.map +1 -0
- package/dist/runtime/runtime-closed-error.js +12 -0
- package/dist/runtime/runtime-closed-error.js.map +1 -0
- package/dist/runtime/runtime-config.d.ts +13 -0
- package/dist/runtime/runtime-config.d.ts.map +1 -0
- package/dist/runtime/runtime-config.js +115 -0
- package/dist/runtime/runtime-config.js.map +1 -0
- package/dist/runtime/runtime-entropy.d.ts +14 -0
- package/dist/runtime/runtime-entropy.d.ts.map +1 -0
- package/dist/runtime/runtime-entropy.js +43 -0
- package/dist/runtime/runtime-entropy.js.map +1 -0
- package/dist/runtime/runtime-source.d.ts +206 -0
- package/dist/runtime/runtime-source.d.ts.map +1 -0
- package/dist/runtime/runtime-source.js +64 -0
- package/dist/runtime/runtime-source.js.map +1 -0
- package/dist/runtime/schema-metadata.d.ts +22 -0
- package/dist/runtime/schema-metadata.d.ts.map +1 -0
- package/dist/runtime/schema-metadata.js +70 -0
- package/dist/runtime/schema-metadata.js.map +1 -0
- package/dist/runtime/select-projection.d.ts +5 -0
- package/dist/runtime/select-projection.d.ts.map +1 -0
- package/dist/runtime/select-projection.js +47 -0
- package/dist/runtime/select-projection.js.map +1 -0
- package/dist/runtime/snapshot-ref.d.ts +24 -0
- package/dist/runtime/snapshot-ref.d.ts.map +1 -0
- package/dist/runtime/snapshot-ref.js +43 -0
- package/dist/runtime/snapshot-ref.js.map +1 -0
- package/dist/runtime/store-held-by-another-tab-error.d.ts +53 -0
- package/dist/runtime/store-held-by-another-tab-error.d.ts.map +1 -0
- package/dist/runtime/store-held-by-another-tab-error.js +55 -0
- package/dist/runtime/store-held-by-another-tab-error.js.map +1 -0
- package/dist/runtime/streaming-source.d.ts +4 -0
- package/dist/runtime/streaming-source.d.ts.map +1 -0
- package/dist/runtime/streaming-source.js +53 -0
- package/dist/runtime/streaming-source.js.map +1 -0
- package/dist/runtime/structural-values.d.ts +6 -0
- package/dist/runtime/structural-values.d.ts.map +1 -0
- package/dist/runtime/structural-values.js +51 -0
- package/dist/runtime/structural-values.js.map +1 -0
- package/dist/runtime/subscription-manager.d.ts +103 -14
- package/dist/runtime/subscription-manager.d.ts.map +1 -1
- package/dist/runtime/subscription-manager.js +1051 -25
- package/dist/runtime/subscription-manager.js.map +1 -1
- package/dist/runtime/sync-status.d.ts +178 -0
- package/dist/runtime/sync-status.d.ts.map +1 -0
- package/dist/runtime/sync-status.js +163 -0
- package/dist/runtime/sync-status.js.map +1 -0
- package/dist/runtime/sync-telemetry.d.ts +35 -0
- package/dist/runtime/sync-telemetry.d.ts.map +1 -0
- package/dist/runtime/sync-telemetry.js +354 -0
- package/dist/runtime/sync-telemetry.js.map +1 -0
- package/dist/runtime/system-identity.d.ts +5 -0
- package/dist/runtime/system-identity.d.ts.map +1 -0
- package/dist/runtime/system-identity.js +10 -0
- package/dist/runtime/system-identity.js.map +1 -0
- package/dist/runtime/telemetry-env.d.ts +2 -0
- package/dist/runtime/telemetry-env.d.ts.map +1 -0
- package/dist/runtime/telemetry-env.js +16 -0
- package/dist/runtime/telemetry-env.js.map +1 -0
- package/dist/runtime/telemetry-env.native.d.ts +3 -0
- package/dist/runtime/telemetry-env.native.d.ts.map +1 -0
- package/dist/runtime/telemetry-env.native.js +7 -0
- package/dist/runtime/telemetry-env.native.js.map +1 -0
- package/dist/runtime/text-anchors.d.ts +58 -0
- package/dist/runtime/text-anchors.d.ts.map +1 -0
- package/dist/runtime/text-anchors.js +9 -0
- package/dist/runtime/text-anchors.js.map +1 -0
- package/dist/runtime/unsupported-storage-codecs-error.d.ts +53 -0
- package/dist/runtime/unsupported-storage-codecs-error.d.ts.map +1 -0
- package/dist/runtime/unsupported-storage-codecs-error.js +74 -0
- package/dist/runtime/unsupported-storage-codecs-error.js.map +1 -0
- package/dist/runtime/url.d.ts +32 -0
- package/dist/runtime/url.d.ts.map +1 -0
- package/dist/runtime/url.js +96 -0
- package/dist/runtime/url.js.map +1 -0
- package/dist/runtime/utf8.d.ts +10 -0
- package/dist/runtime/utf8.d.ts.map +1 -0
- package/dist/runtime/utf8.js +93 -0
- package/dist/runtime/utf8.js.map +1 -0
- package/dist/runtime/util.d.ts +18 -0
- package/dist/runtime/util.d.ts.map +1 -0
- package/dist/runtime/util.js +59 -0
- package/dist/runtime/util.js.map +1 -0
- package/dist/runtime/value-converter.d.ts +9 -17
- package/dist/runtime/value-converter.d.ts.map +1 -1
- package/dist/runtime/value-converter.js +156 -42
- package/dist/runtime/value-converter.js.map +1 -1
- package/dist/runtime/wasm-loader.d.ts +6 -0
- package/dist/runtime/wasm-loader.d.ts.map +1 -0
- package/dist/runtime/wasm-loader.js +127 -0
- package/dist/runtime/wasm-loader.js.map +1 -0
- package/dist/runtime/write-preparation.d.ts +24 -0
- package/dist/runtime/write-preparation.d.ts.map +1 -0
- package/dist/runtime/write-preparation.js +63 -0
- package/dist/runtime/write-preparation.js.map +1 -0
- package/dist/runtime/write-row.d.ts +8 -0
- package/dist/runtime/write-row.d.ts.map +1 -0
- package/dist/runtime/write-row.js +17 -0
- package/dist/runtime/write-row.js.map +1 -0
- package/dist/schema-builders.d.ts +48 -0
- package/dist/schema-builders.d.ts.map +1 -0
- package/dist/schema-builders.js +26 -0
- package/dist/schema-builders.js.map +1 -0
- package/dist/schema-dsl/define-schema.d.ts +32 -0
- package/dist/schema-dsl/define-schema.d.ts.map +1 -0
- package/dist/schema-dsl/define-schema.js +80 -0
- package/dist/schema-dsl/define-schema.js.map +1 -0
- package/dist/schema-dsl/readable-app.d.ts +30 -0
- package/dist/schema-dsl/readable-app.d.ts.map +1 -0
- package/dist/schema-dsl/readable-app.js +139 -0
- package/dist/schema-dsl/readable-app.js.map +1 -0
- package/dist/schema-dsl/table.d.ts +101 -0
- package/dist/schema-dsl/table.d.ts.map +1 -0
- package/dist/schema-dsl/table.js +153 -0
- package/dist/schema-dsl/table.js.map +1 -0
- package/dist/schema-errors.d.ts +6 -0
- package/dist/schema-errors.d.ts.map +1 -0
- package/dist/schema-errors.js +6 -0
- package/dist/schema-errors.js.map +1 -0
- package/dist/schema-loader.d.ts +16 -0
- package/dist/schema-loader.d.ts.map +1 -0
- package/dist/schema-loader.js +108 -0
- package/dist/schema-loader.js.map +1 -0
- package/dist/schema-name.d.ts +2 -0
- package/dist/schema-name.d.ts.map +1 -0
- package/dist/schema-name.js +19 -0
- package/dist/schema-name.js.map +1 -0
- package/dist/schema-namespace.d.ts +7 -0
- package/dist/schema-namespace.d.ts.map +1 -0
- package/dist/schema-namespace.js +7 -0
- package/dist/schema-namespace.js.map +1 -0
- package/dist/schema-permissions.d.ts +12 -0
- package/dist/schema-permissions.d.ts.map +1 -0
- package/dist/schema-permissions.js +17 -0
- package/dist/schema-permissions.js.map +1 -0
- package/dist/schema-source.d.ts +11 -0
- package/dist/schema-source.d.ts.map +1 -0
- package/dist/schema-source.js +53 -0
- package/dist/schema-source.js.map +1 -0
- package/dist/schema.d.ts +95 -38
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +1 -16
- package/dist/schema.js.map +1 -1
- package/dist/session/backend-watch.d.ts +186 -0
- package/dist/session/backend-watch.d.ts.map +1 -0
- package/dist/session/backend-watch.js +698 -0
- package/dist/session/backend-watch.js.map +1 -0
- package/dist/session/config-options.d.ts +15 -0
- package/dist/session/config-options.d.ts.map +1 -0
- package/dist/session/config-options.js +55 -0
- package/dist/session/config-options.js.map +1 -0
- package/dist/session/consumer.d.ts +3 -0
- package/dist/session/consumer.d.ts.map +1 -0
- package/dist/session/consumer.js +3 -0
- package/dist/session/consumer.js.map +1 -0
- package/dist/session/create-jazz-session.d.ts +123 -0
- package/dist/session/create-jazz-session.d.ts.map +1 -0
- package/dist/session/create-jazz-session.js +542 -0
- package/dist/session/create-jazz-session.js.map +1 -0
- package/dist/session/follow-user.d.ts +72 -0
- package/dist/session/follow-user.d.ts.map +1 -0
- package/dist/session/follow-user.js +147 -0
- package/dist/session/follow-user.js.map +1 -0
- package/dist/session/jazz-session.d.ts +234 -0
- package/dist/session/jazz-session.d.ts.map +1 -0
- package/dist/session/jazz-session.js +528 -0
- package/dist/session/jazz-session.js.map +1 -0
- package/dist/session/native-backend-watch.d.ts +4 -0
- package/dist/session/native-backend-watch.d.ts.map +1 -0
- package/dist/session/native-backend-watch.js +14 -0
- package/dist/session/native-backend-watch.js.map +1 -0
- package/dist/session/no-kept-device-account-error.d.ts +6 -0
- package/dist/session/no-kept-device-account-error.d.ts.map +1 -0
- package/dist/session/no-kept-device-account-error.js +8 -0
- package/dist/session/no-kept-device-account-error.js.map +1 -0
- package/dist/session/replica-ledger.d.ts +164 -0
- package/dist/session/replica-ledger.d.ts.map +1 -0
- package/dist/session/replica-ledger.js +496 -0
- package/dist/session/replica-ledger.js.map +1 -0
- package/dist/session/state.d.ts +135 -0
- package/dist/session/state.d.ts.map +1 -0
- package/dist/session/state.js +535 -0
- package/dist/session/state.js.map +1 -0
- package/dist/shared/index.d.ts +20 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +17 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/solid/create-solid-jazz-client-internal.d.ts +13 -0
- package/dist/solid/create-solid-jazz-client-internal.d.ts.map +1 -0
- package/dist/solid/create-solid-jazz-client-internal.js +82 -0
- package/dist/solid/create-solid-jazz-client-internal.js.map +1 -0
- package/dist/solid/create-solid-jazz-client-internal.ssr.js +101 -0
- package/dist/solid/create-solid-jazz-client-internal.ssr.js.map +1 -0
- package/dist/solid/create-solid-jazz-client.d.ts +24 -0
- package/dist/solid/create-solid-jazz-client.d.ts.map +1 -0
- package/dist/solid/create-solid-jazz-client.js +42 -0
- package/dist/solid/create-solid-jazz-client.js.map +1 -0
- package/dist/solid/create-solid-jazz-client.ssr.js +45 -0
- package/dist/solid/create-solid-jazz-client.ssr.js.map +1 -0
- package/dist/solid/index.d.ts +13 -0
- package/dist/solid/index.d.ts.map +1 -0
- package/dist/solid/index.js +9 -0
- package/dist/solid/index.ssr.js +9 -0
- package/dist/solid/provider.d.ts +25 -0
- package/dist/solid/provider.d.ts.map +1 -0
- package/dist/solid/provider.js +48 -0
- package/dist/solid/provider.js.map +1 -0
- package/dist/solid/provider.ssr.js +48 -0
- package/dist/solid/provider.ssr.js.map +1 -0
- package/dist/solid/session-context.d.ts +14 -0
- package/dist/solid/session-context.d.ts.map +1 -0
- package/dist/solid/session-context.js +6 -0
- package/dist/solid/session-context.js.map +1 -0
- package/dist/solid/session-context.ssr.js +10 -0
- package/dist/solid/session-context.ssr.js.map +1 -0
- package/dist/solid/session.d.ts +55 -0
- package/dist/solid/session.d.ts.map +1 -0
- package/dist/solid/session.js +130 -0
- package/dist/solid/session.js.map +1 -0
- package/dist/solid/session.ssr.js +156 -0
- package/dist/solid/session.ssr.js.map +1 -0
- package/dist/solid/solid-jazz-client-store.d.ts +11 -0
- package/dist/solid/solid-jazz-client-store.d.ts.map +1 -0
- package/dist/solid/solid-jazz-client-store.js +38 -0
- package/dist/solid/solid-jazz-client-store.js.map +1 -0
- package/dist/solid/solid-jazz-client-store.ssr.js +39 -0
- package/dist/solid/solid-jazz-client-store.ssr.js.map +1 -0
- package/dist/solid/use-all.d.ts +18 -0
- package/dist/solid/use-all.d.ts.map +1 -0
- package/dist/solid/use-all.js +71 -0
- package/dist/solid/use-all.js.map +1 -0
- package/dist/solid/use-all.ssr.js +84 -0
- package/dist/solid/use-all.ssr.js.map +1 -0
- package/dist/solid/use-one.d.ts +18 -0
- package/dist/solid/use-one.d.ts.map +1 -0
- package/dist/solid/use-one.js +27 -0
- package/dist/solid/use-one.js.map +1 -0
- package/dist/solid/use-one.ssr.js +27 -0
- package/dist/solid/use-one.ssr.js.map +1 -0
- package/dist/solid/use-sync-status.d.ts +8 -0
- package/dist/solid/use-sync-status.d.ts.map +1 -0
- package/dist/solid/use-sync-status.js +13 -0
- package/dist/solid/use-sync-status.js.map +1 -0
- package/dist/solid/use-sync-status.ssr.js +20 -0
- package/dist/solid/use-sync-status.ssr.js.map +1 -0
- package/dist/subscription-store-internal.d.ts +11 -0
- package/dist/subscription-store-internal.d.ts.map +1 -0
- package/dist/subscription-store-internal.js +18 -0
- package/dist/subscription-store-internal.js.map +1 -0
- package/dist/subscriptions-orchestrator.d.ts +92 -14
- package/dist/subscriptions-orchestrator.d.ts.map +1 -1
- package/dist/subscriptions-orchestrator.js +390 -75
- package/dist/subscriptions-orchestrator.js.map +1 -1
- package/dist/svelte/JazzProvider.svelte +110 -0
- package/dist/svelte/JazzProvider.svelte.d.ts +24 -0
- package/dist/svelte/JazzProvider.svelte.d.ts.map +1 -0
- package/dist/svelte/JazzSvelteClientProvider.svelte +83 -0
- package/dist/svelte/JazzSvelteClientProvider.svelte.d.ts +15 -0
- package/dist/svelte/JazzSvelteClientProvider.svelte.d.ts.map +1 -0
- package/dist/svelte/context.svelte.d.ts +19 -3
- package/dist/svelte/context.svelte.d.ts.map +1 -1
- package/dist/svelte/context.svelte.js +21 -5
- package/dist/svelte/create-jazz-client.d.ts +2 -8
- package/dist/svelte/create-jazz-client.d.ts.map +1 -1
- package/dist/svelte/create-jazz-client.js +1 -17
- package/dist/svelte/index.d.ts +14 -7
- package/dist/svelte/index.d.ts.map +1 -1
- package/dist/svelte/index.js +10 -7
- package/dist/svelte/query-subscription.svelte.d.ts +60 -0
- package/dist/svelte/query-subscription.svelte.d.ts.map +1 -0
- package/dist/svelte/query-subscription.svelte.js +135 -0
- package/dist/svelte/session-state.d.ts +27 -0
- package/dist/svelte/session-state.d.ts.map +1 -0
- package/dist/svelte/session-state.js +49 -0
- package/dist/svelte/sync-status.d.ts +11 -0
- package/dist/svelte/sync-status.d.ts.map +1 -0
- package/dist/svelte/sync-status.js +15 -0
- package/dist/testing/fixtures/with-bigint/schema.d.ts +18 -0
- package/dist/testing/fixtures/with-bigint/schema.d.ts.map +1 -0
- package/dist/testing/fixtures/with-bigint/schema.js +15 -0
- package/dist/testing/fixtures/with-bigint/schema.js.map +1 -0
- package/dist/testing/index.d.ts +6 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +5 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/policy-test-app.d.ts +129 -0
- package/dist/testing/policy-test-app.d.ts.map +1 -0
- package/dist/testing/policy-test-app.js +229 -0
- package/dist/testing/policy-test-app.js.map +1 -0
- package/dist/testing/test-app.d.ts +272 -0
- package/dist/testing/test-app.d.ts.map +1 -0
- package/dist/testing/test-app.js +62 -0
- package/dist/testing/test-app.js.map +1 -0
- package/dist/testing/test-jazz.d.ts +119 -0
- package/dist/testing/test-jazz.d.ts.map +1 -0
- package/dist/testing/test-jazz.js +162 -0
- package/dist/testing/test-jazz.js.map +1 -0
- package/dist/testing/test-jwt-issuer.d.ts +19 -0
- package/dist/testing/test-jwt-issuer.d.ts.map +1 -0
- package/dist/testing/test-jwt-issuer.js +40 -0
- package/dist/testing/test-jwt-issuer.js.map +1 -0
- package/dist/text-field/index.d.ts +40 -0
- package/dist/text-field/index.d.ts.map +1 -0
- package/dist/text-field/index.js +129 -0
- package/dist/text-field/index.js.map +1 -0
- package/dist/thin/index.d.ts +80 -0
- package/dist/thin/index.d.ts.map +1 -0
- package/dist/thin/index.js +219 -0
- package/dist/thin/index.js.map +1 -0
- package/dist/thin/self-signed-token.d.ts +13 -0
- package/dist/thin/self-signed-token.d.ts.map +1 -0
- package/dist/thin/self-signed-token.js +100 -0
- package/dist/thin/self-signed-token.js.map +1 -0
- package/dist/thin/thin-runtime-source.d.ts +19 -0
- package/dist/thin/thin-runtime-source.d.ts.map +1 -0
- package/dist/thin/thin-runtime-source.js +66 -0
- package/dist/thin/thin-runtime-source.js.map +1 -0
- package/dist/thin/thin-runtime.d.ts +294 -0
- package/dist/thin/thin-runtime.d.ts.map +1 -0
- package/dist/thin/thin-runtime.js +1492 -0
- package/dist/thin/thin-runtime.js.map +1 -0
- package/dist/thin/wire.d.ts +160 -0
- package/dist/thin/wire.d.ts.map +1 -0
- package/dist/thin/wire.js +304 -0
- package/dist/thin/wire.js.map +1 -0
- package/dist/typed-app.d.ts +644 -0
- package/dist/typed-app.d.ts.map +1 -0
- package/dist/typed-app.js +549 -0
- package/dist/typed-app.js.map +1 -0
- package/dist/vue/create-jazz-client.d.ts +3 -0
- package/dist/vue/create-jazz-client.d.ts.map +1 -0
- package/dist/vue/create-jazz-client.js +2 -0
- package/dist/vue/create-jazz-client.js.map +1 -0
- package/dist/vue/index.d.ts +13 -0
- package/dist/vue/index.d.ts.map +1 -0
- package/dist/vue/index.js +9 -0
- package/dist/vue/index.js.map +1 -0
- package/dist/vue/provider.d.ts +50 -0
- package/dist/vue/provider.d.ts.map +1 -0
- package/dist/vue/provider.js +97 -0
- package/dist/vue/provider.js.map +1 -0
- package/dist/vue/session-key.d.ts +15 -0
- package/dist/vue/session-key.d.ts.map +1 -0
- package/dist/vue/session-key.js +7 -0
- package/dist/vue/session-key.js.map +1 -0
- package/dist/vue/session.d.ts +40 -0
- package/dist/vue/session.d.ts.map +1 -0
- package/dist/vue/session.js +112 -0
- package/dist/vue/session.js.map +1 -0
- package/dist/vue/use-all.d.ts +61 -0
- package/dist/vue/use-all.d.ts.map +1 -0
- package/dist/vue/use-all.js +104 -0
- package/dist/vue/use-all.js.map +1 -0
- package/dist/vue/use-one.d.ts +24 -0
- package/dist/vue/use-one.d.ts.map +1 -0
- package/dist/vue/use-one.js +17 -0
- package/dist/vue/use-one.js.map +1 -0
- package/dist/vue/use-sync-status.d.ts +9 -0
- package/dist/vue/use-sync-status.d.ts.map +1 -0
- package/dist/vue/use-sync-status.js +16 -0
- package/dist/vue/use-sync-status.js.map +1 -0
- package/dist/web/create-jazz-client.d.ts +12 -0
- package/dist/web/create-jazz-client.d.ts.map +1 -0
- package/dist/web/create-jazz-client.js +35 -0
- package/dist/web/create-jazz-client.js.map +1 -0
- package/dist/web/lazy-local-first.d.ts +5 -0
- package/dist/web/lazy-local-first.d.ts.map +1 -0
- package/dist/web/lazy-local-first.js +8 -0
- package/dist/web/lazy-local-first.js.map +1 -0
- package/dist/web/registered-jazz-client.d.ts +15 -0
- package/dist/web/registered-jazz-client.d.ts.map +1 -0
- package/dist/web/registered-jazz-client.js +35 -0
- package/dist/web/registered-jazz-client.js.map +1 -0
- package/dist/where-operators.d.ts +13 -0
- package/dist/where-operators.d.ts.map +1 -0
- package/dist/where-operators.js +66 -0
- package/dist/where-operators.js.map +1 -0
- package/dist/window-client-storage.d.ts +7 -0
- package/dist/window-client-storage.d.ts.map +1 -0
- package/dist/window-client-storage.js +27 -0
- package/dist/window-client-storage.js.map +1 -0
- package/dist/worker/jazz-broker-worker-core.d.ts +34 -0
- package/dist/worker/jazz-broker-worker-core.d.ts.map +1 -0
- package/dist/worker/jazz-broker-worker-core.js +2241 -0
- package/dist/worker/jazz-broker-worker-core.js.map +1 -0
- package/dist/worker/jazz-broker-worker.d.ts +3 -0
- package/dist/worker/jazz-broker-worker.d.ts.map +1 -0
- package/dist/worker/jazz-broker-worker.js +5 -0
- package/dist/worker/jazz_wasm_bg.wasm +0 -0
- package/dist/worker/mutation-error-delivery.d.ts +8 -0
- package/dist/worker/mutation-error-delivery.d.ts.map +1 -0
- package/dist/worker/mutation-error-delivery.js +10 -0
- package/dist/worker/mutation-error-delivery.js.map +1 -0
- package/dist/worker/runtime-admission.d.ts +34 -0
- package/dist/worker/runtime-admission.d.ts.map +1 -0
- package/dist/worker/runtime-admission.js +60 -0
- package/dist/worker/runtime-admission.js.map +1 -0
- package/dist/worker/vite-dev-broker.d.ts +2 -0
- package/dist/worker/vite-dev-broker.d.ts.map +1 -0
- package/dist/worker/vite-dev-broker.js +8 -0
- package/dist/worker/vite-dev-broker.js.map +1 -0
- package/package.json +299 -37
- package/bin/native/.gitkeep +0 -0
- package/bin/native/jazz-tools-darwin-arm64 +0 -0
- package/bin/native/jazz-tools-darwin-x64 +0 -0
- package/bin/native/jazz-tools-linux-arm64 +0 -0
- package/bin/native/jazz-tools-linux-x64 +0 -0
- package/bin/native/jazz-tools-windows-x64.exe +0 -0
- package/dist/backend/create-jazz-context.test.d.ts +0 -2
- package/dist/backend/create-jazz-context.test.d.ts.map +0 -1
- package/dist/backend/create-jazz-context.test.js +0 -141
- package/dist/backend/create-jazz-context.test.js.map +0 -1
- package/dist/cli.test.d.ts +0 -2
- package/dist/cli.test.d.ts.map +0 -1
- package/dist/cli.test.js +0 -154
- package/dist/cli.test.js.map +0 -1
- package/dist/codegen/codegen.test.d.ts +0 -2
- package/dist/codegen/codegen.test.d.ts.map +0 -1
- package/dist/codegen/codegen.test.js +0 -914
- package/dist/codegen/codegen.test.js.map +0 -1
- package/dist/codegen/index.d.ts +0 -18
- package/dist/codegen/index.d.ts.map +0 -1
- package/dist/codegen/index.js +0 -22
- package/dist/codegen/index.js.map +0 -1
- package/dist/codegen/query-builder-generator.d.ts +0 -26
- package/dist/codegen/query-builder-generator.d.ts.map +0 -1
- package/dist/codegen/query-builder-generator.js +0 -342
- package/dist/codegen/query-builder-generator.js.map +0 -1
- package/dist/codegen/schema-reader.d.ts +0 -12
- package/dist/codegen/schema-reader.d.ts.map +0 -1
- package/dist/codegen/schema-reader.js +0 -180
- package/dist/codegen/schema-reader.js.map +0 -1
- package/dist/codegen/type-generator.d.ts +0 -29
- package/dist/codegen/type-generator.d.ts.map +0 -1
- package/dist/codegen/type-generator.js +0 -296
- package/dist/codegen/type-generator.js.map +0 -1
- package/dist/dev-tools/dev-tools.d.ts +0 -15
- package/dist/dev-tools/dev-tools.d.ts.map +0 -1
- package/dist/dev-tools/dev-tools.js +0 -297
- package/dist/dev-tools/dev-tools.js.map +0 -1
- package/dist/dev-tools/extension-panel.d.ts +0 -19
- package/dist/dev-tools/extension-panel.d.ts.map +0 -1
- package/dist/dev-tools/extension-panel.js +0 -419
- package/dist/dev-tools/extension-panel.js.map +0 -1
- package/dist/dev-tools/index.d.ts +0 -3
- package/dist/dev-tools/index.d.ts.map +0 -1
- package/dist/dev-tools/index.js +0 -3
- package/dist/dev-tools/index.js.map +0 -1
- package/dist/dev-tools/protocol.d.ts +0 -49
- package/dist/dev-tools/protocol.d.ts.map +0 -1
- package/dist/dev-tools/protocol.js +0 -40
- package/dist/dev-tools/protocol.js.map +0 -1
- package/dist/dsl.test.d.ts +0 -2
- package/dist/dsl.test.d.ts.map +0 -1
- package/dist/dsl.test.js +0 -51
- package/dist/dsl.test.js.map +0 -1
- package/dist/permissions/index.d.ts +0 -146
- package/dist/permissions/index.d.ts.map +0 -1
- package/dist/permissions/index.js +0 -1211
- package/dist/permissions/index.js.map +0 -1
- package/dist/permissions/index.test.d.ts +0 -2
- package/dist/permissions/index.test.d.ts.map +0 -1
- package/dist/permissions/index.test.js +0 -830
- package/dist/permissions/index.test.js.map +0 -1
- package/dist/permissions/type-inference.test.d.ts +0 -2
- package/dist/permissions/type-inference.test.d.ts.map +0 -1
- package/dist/permissions/type-inference.test.js +0 -149
- package/dist/permissions/type-inference.test.js.map +0 -1
- package/dist/react/create-jazz-client.integration.test.d.ts +0 -2
- package/dist/react/create-jazz-client.integration.test.d.ts.map +0 -1
- package/dist/react/create-jazz-client.integration.test.js +0 -82
- package/dist/react/create-jazz-client.integration.test.js.map +0 -1
- package/dist/react/create-jazz-client.test.d.ts +0 -2
- package/dist/react/create-jazz-client.test.d.ts.map +0 -1
- package/dist/react/create-jazz-client.test.js +0 -135
- package/dist/react/create-jazz-client.test.js.map +0 -1
- package/dist/react/synthetic-user-switcher.d.ts +0 -9
- package/dist/react/synthetic-user-switcher.d.ts.map +0 -1
- package/dist/react/synthetic-user-switcher.js +0 -65
- package/dist/react/synthetic-user-switcher.js.map +0 -1
- package/dist/react/synthetic-users.d.ts +0 -2
- package/dist/react/synthetic-users.d.ts.map +0 -1
- package/dist/react/synthetic-users.js +0 -2
- package/dist/react/synthetic-users.js.map +0 -1
- package/dist/react/synthetic-users.test.d.ts +0 -2
- package/dist/react/synthetic-users.test.d.ts.map +0 -1
- package/dist/react/synthetic-users.test.js +0 -43
- package/dist/react/synthetic-users.test.js.map +0 -1
- package/dist/react/use-link-external-identity.d.ts +0 -25
- package/dist/react/use-link-external-identity.d.ts.map +0 -1
- package/dist/react/use-link-external-identity.js +0 -45
- package/dist/react/use-link-external-identity.js.map +0 -1
- package/dist/react-native/create-jazz-client.test.d.ts +0 -2
- package/dist/react-native/create-jazz-client.test.d.ts.map +0 -1
- package/dist/react-native/create-jazz-client.test.js +0 -162
- package/dist/react-native/create-jazz-client.test.js.map +0 -1
- package/dist/react-native/create-jazz-rn-runtime.d.ts +0 -13
- package/dist/react-native/create-jazz-rn-runtime.d.ts.map +0 -1
- package/dist/react-native/create-jazz-rn-runtime.js +0 -7
- package/dist/react-native/create-jazz-rn-runtime.js.map +0 -1
- package/dist/react-native/db.d.ts +0 -16
- package/dist/react-native/db.d.ts.map +0 -1
- package/dist/react-native/db.js +0 -50
- package/dist/react-native/db.js.map +0 -1
- package/dist/react-native/db.test.d.ts +0 -2
- package/dist/react-native/db.test.d.ts.map +0 -1
- package/dist/react-native/db.test.js +0 -148
- package/dist/react-native/db.test.js.map +0 -1
- package/dist/react-native/jazz-rn-runtime-adapter.d.ts +0 -56
- package/dist/react-native/jazz-rn-runtime-adapter.d.ts.map +0 -1
- package/dist/react-native/jazz-rn-runtime-adapter.js +0 -192
- package/dist/react-native/jazz-rn-runtime-adapter.js.map +0 -1
- package/dist/react-native/jazz-rn-runtime-adapter.test.d.ts +0 -2
- package/dist/react-native/jazz-rn-runtime-adapter.test.d.ts.map +0 -1
- package/dist/react-native/jazz-rn-runtime-adapter.test.js +0 -165
- package/dist/react-native/jazz-rn-runtime-adapter.test.js.map +0 -1
- package/dist/runtime/client-session.test.d.ts +0 -2
- package/dist/runtime/client-session.test.d.ts.map +0 -1
- package/dist/runtime/client-session.test.js +0 -84
- package/dist/runtime/client-session.test.js.map +0 -1
- package/dist/runtime/client.for-request.test.d.ts +0 -2
- package/dist/runtime/client.for-request.test.d.ts.map +0 -1
- package/dist/runtime/client.for-request.test.js +0 -191
- package/dist/runtime/client.for-request.test.js.map +0 -1
- package/dist/runtime/cloud-server.integration.test.d.ts +0 -2
- package/dist/runtime/cloud-server.integration.test.d.ts.map +0 -1
- package/dist/runtime/cloud-server.integration.test.js +0 -1210
- package/dist/runtime/cloud-server.integration.test.js.map +0 -1
- package/dist/runtime/dynamic-query.d.ts +0 -10
- package/dist/runtime/dynamic-query.d.ts.map +0 -1
- package/dist/runtime/dynamic-query.js +0 -11
- package/dist/runtime/dynamic-query.js.map +0 -1
- package/dist/runtime/leader-lock.d.ts +0 -15
- package/dist/runtime/leader-lock.d.ts.map +0 -1
- package/dist/runtime/leader-lock.js +0 -49
- package/dist/runtime/leader-lock.js.map +0 -1
- package/dist/runtime/local-auth.d.ts +0 -32
- package/dist/runtime/local-auth.d.ts.map +0 -1
- package/dist/runtime/local-auth.js +0 -93
- package/dist/runtime/local-auth.js.map +0 -1
- package/dist/runtime/local-auth.test.d.ts +0 -2
- package/dist/runtime/local-auth.test.d.ts.map +0 -1
- package/dist/runtime/local-auth.test.js +0 -50
- package/dist/runtime/local-auth.test.js.map +0 -1
- package/dist/runtime/query-adapter.test.d.ts +0 -5
- package/dist/runtime/query-adapter.test.d.ts.map +0 -1
- package/dist/runtime/query-adapter.test.js +0 -1249
- package/dist/runtime/query-adapter.test.js.map +0 -1
- package/dist/runtime/row-transformer.test.d.ts +0 -5
- package/dist/runtime/row-transformer.test.d.ts.map +0 -1
- package/dist/runtime/row-transformer.test.js +0 -385
- package/dist/runtime/row-transformer.test.js.map +0 -1
- package/dist/runtime/schema-fetch.d.ts +0 -17
- package/dist/runtime/schema-fetch.d.ts.map +0 -1
- package/dist/runtime/schema-fetch.js +0 -33
- package/dist/runtime/schema-fetch.js.map +0 -1
- package/dist/runtime/schema-fetch.test.d.ts +0 -2
- package/dist/runtime/schema-fetch.test.d.ts.map +0 -1
- package/dist/runtime/schema-fetch.test.js +0 -87
- package/dist/runtime/schema-fetch.test.js.map +0 -1
- package/dist/runtime/subscription-manager.test.d.ts +0 -5
- package/dist/runtime/subscription-manager.test.d.ts.map +0 -1
- package/dist/runtime/subscription-manager.test.js +0 -120
- package/dist/runtime/subscription-manager.test.js.map +0 -1
- package/dist/runtime/sync-transport.d.ts +0 -163
- package/dist/runtime/sync-transport.d.ts.map +0 -1
- package/dist/runtime/sync-transport.js +0 -477
- package/dist/runtime/sync-transport.js.map +0 -1
- package/dist/runtime/sync-transport.test.d.ts +0 -2
- package/dist/runtime/sync-transport.test.d.ts.map +0 -1
- package/dist/runtime/sync-transport.test.js +0 -310
- package/dist/runtime/sync-transport.test.js.map +0 -1
- package/dist/runtime/tab-leader-election.d.ts +0 -97
- package/dist/runtime/tab-leader-election.d.ts.map +0 -1
- package/dist/runtime/tab-leader-election.js +0 -339
- package/dist/runtime/tab-leader-election.js.map +0 -1
- package/dist/runtime/tab-leader-election.test.d.ts +0 -2
- package/dist/runtime/tab-leader-election.test.d.ts.map +0 -1
- package/dist/runtime/tab-leader-election.test.js +0 -278
- package/dist/runtime/tab-leader-election.test.js.map +0 -1
- package/dist/runtime/testing/wasm-runtime-test-utils.d.ts +0 -13
- package/dist/runtime/testing/wasm-runtime-test-utils.d.ts.map +0 -1
- package/dist/runtime/testing/wasm-runtime-test-utils.js +0 -76
- package/dist/runtime/testing/wasm-runtime-test-utils.js.map +0 -1
- package/dist/runtime/utils.d.ts +0 -2
- package/dist/runtime/utils.d.ts.map +0 -1
- package/dist/runtime/utils.js +0 -16
- package/dist/runtime/utils.js.map +0 -1
- package/dist/runtime/value-converter.test.d.ts +0 -5
- package/dist/runtime/value-converter.test.d.ts.map +0 -1
- package/dist/runtime/value-converter.test.js +0 -222
- package/dist/runtime/value-converter.test.js.map +0 -1
- package/dist/runtime/worker-bridge.d.ts +0 -82
- package/dist/runtime/worker-bridge.d.ts.map +0 -1
- package/dist/runtime/worker-bridge.js +0 -308
- package/dist/runtime/worker-bridge.js.map +0 -1
- package/dist/runtime/worker-bridge.race-harness.test.d.ts +0 -2
- package/dist/runtime/worker-bridge.race-harness.test.d.ts.map +0 -1
- package/dist/runtime/worker-bridge.race-harness.test.js +0 -284
- package/dist/runtime/worker-bridge.race-harness.test.js.map +0 -1
- package/dist/runtime/worker-bridge.test.d.ts +0 -2
- package/dist/runtime/worker-bridge.test.d.ts.map +0 -1
- package/dist/runtime/worker-bridge.test.js +0 -233
- package/dist/runtime/worker-bridge.test.js.map +0 -1
- package/dist/sql-gen.d.ts +0 -4
- package/dist/sql-gen.d.ts.map +0 -1
- package/dist/sql-gen.js +0 -163
- package/dist/sql-gen.js.map +0 -1
- package/dist/sql-gen.test.d.ts +0 -2
- package/dist/sql-gen.test.d.ts.map +0 -1
- package/dist/sql-gen.test.js +0 -412
- package/dist/sql-gen.test.js.map +0 -1
- package/dist/subscriptions-orchestrator.integration.test.d.ts +0 -2
- package/dist/subscriptions-orchestrator.integration.test.d.ts.map +0 -1
- package/dist/subscriptions-orchestrator.integration.test.js +0 -192
- package/dist/subscriptions-orchestrator.integration.test.js.map +0 -1
- package/dist/subscriptions-orchestrator.test.d.ts +0 -2
- package/dist/subscriptions-orchestrator.test.d.ts.map +0 -1
- package/dist/subscriptions-orchestrator.test.js +0 -367
- package/dist/subscriptions-orchestrator.test.js.map +0 -1
- package/dist/svelte/JazzSvelteProvider.svelte +0 -49
- package/dist/svelte/JazzSvelteProvider.svelte.d.ts +0 -13
- package/dist/svelte/JazzSvelteProvider.svelte.d.ts.map +0 -1
- package/dist/svelte/SyntheticUserSwitcher.svelte +0 -121
- package/dist/svelte/SyntheticUserSwitcher.svelte.d.ts +0 -11
- package/dist/svelte/SyntheticUserSwitcher.svelte.d.ts.map +0 -1
- package/dist/svelte/context.test.d.ts +0 -2
- package/dist/svelte/context.test.d.ts.map +0 -1
- package/dist/svelte/context.test.js +0 -55
- package/dist/svelte/create-jazz-client.test.d.ts +0 -2
- package/dist/svelte/create-jazz-client.test.d.ts.map +0 -1
- package/dist/svelte/create-jazz-client.test.js +0 -50
- package/dist/svelte/use-all.svelte.d.ts +0 -32
- package/dist/svelte/use-all.svelte.d.ts.map +0 -1
- package/dist/svelte/use-all.svelte.js +0 -61
- package/dist/svelte/use-all.test.d.ts +0 -2
- package/dist/svelte/use-all.test.d.ts.map +0 -1
- package/dist/svelte/use-all.test.js +0 -158
- package/dist/svelte/use-link-external-identity.d.ts +0 -25
- package/dist/svelte/use-link-external-identity.d.ts.map +0 -1
- package/dist/svelte/use-link-external-identity.js +0 -33
- package/dist/svelte/use-link-external-identity.test.d.ts +0 -2
- package/dist/svelte/use-link-external-identity.test.d.ts.map +0 -1
- package/dist/svelte/use-link-external-identity.test.js +0 -97
- package/dist/synthetic-user-switcher.d.ts +0 -16
- package/dist/synthetic-user-switcher.d.ts.map +0 -1
- package/dist/synthetic-user-switcher.js +0 -134
- package/dist/synthetic-user-switcher.js.map +0 -1
- package/dist/synthetic-users.d.ts +0 -32
- package/dist/synthetic-users.d.ts.map +0 -1
- package/dist/synthetic-users.js +0 -124
- package/dist/synthetic-users.js.map +0 -1
- package/dist/testing/fixtures/basic/app.d.ts +0 -55
- package/dist/testing/fixtures/basic/app.d.ts.map +0 -1
- package/dist/testing/fixtures/basic/app.js +0 -174
- package/dist/testing/fixtures/basic/app.js.map +0 -1
- package/dist/testing/fixtures/basic/current.d.ts +0 -2
- package/dist/testing/fixtures/basic/current.d.ts.map +0 -1
- package/dist/testing/fixtures/basic/current.js +0 -6
- package/dist/testing/fixtures/basic/current.js.map +0 -1
- package/dist/testing/index.test.d.ts +0 -2
- package/dist/testing/index.test.d.ts.map +0 -1
- package/dist/testing/index.test.js +0 -234
- package/dist/testing/index.test.js.map +0 -1
- package/dist/testing/local-jazz-server.d.ts +0 -34
- package/dist/testing/local-jazz-server.d.ts.map +0 -1
- package/dist/testing/local-jazz-server.js +0 -313
- package/dist/testing/local-jazz-server.js.map +0 -1
- package/dist/testing/relation-ir-test-helpers.d.ts +0 -3
- package/dist/testing/relation-ir-test-helpers.d.ts.map +0 -1
- package/dist/testing/relation-ir-test-helpers.js +0 -258
- package/dist/testing/relation-ir-test-helpers.js.map +0 -1
- package/dist/worker/jazz-worker.d.ts +0 -9
- package/dist/worker/jazz-worker.d.ts.map +0 -1
- package/dist/worker/jazz-worker.js +0 -555
- package/dist/worker/jazz-worker.js.map +0 -1
- package/dist/worker/jazz-worker.ts +0 -630
- package/dist/worker/worker-protocol.d.ts +0 -136
- package/dist/worker/worker-protocol.d.ts.map +0 -1
- package/dist/worker/worker-protocol.js +0 -7
- package/dist/worker/worker-protocol.js.map +0 -1
package/dist/runtime/client.js
CHANGED
|
@@ -1,584 +1,1363 @@
|
|
|
1
|
+
import { runtimeRandomBytes } from "./runtime-entropy.js";
|
|
2
|
+
import { UnsupportedSnapshotError } from "./snapshot-ref.js";
|
|
3
|
+
import { normalizeRuntimeSchema } from "../drivers/schema-wire.js";
|
|
4
|
+
import { TRUSTED_RESERVED_SESSION_TOKEN_FIELD, resolveClientSessionStateSync, trustedReservedSessionToken, } from "./client-session.js";
|
|
5
|
+
import { getTrustedReservedSession, setTrustedReservedSession } from "./db-internal-session.js";
|
|
6
|
+
import { isRenewableAuthFailure, mapAuthReason } from "./auth-state.js";
|
|
7
|
+
import { httpUrlToWs } from "./url.js";
|
|
8
|
+
import { toError } from "./util.js";
|
|
9
|
+
import { parseUuidBytes } from "./hex.js";
|
|
10
|
+
function serializeRuntimeSession(session) {
|
|
11
|
+
const token = trustedReservedSessionToken(session);
|
|
12
|
+
return {
|
|
13
|
+
account_id: session.account_id,
|
|
14
|
+
issuer: session.issuer,
|
|
15
|
+
user_id: session.user_id,
|
|
16
|
+
claims: session.claims,
|
|
17
|
+
authMode: session.authMode,
|
|
18
|
+
...(token ? { [TRUSTED_RESERVED_SESSION_TOKEN_FIELD]: token } : {}),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function encodeBranchColumnValue(value) {
|
|
22
|
+
const envelope = (tag, payload) => {
|
|
23
|
+
const encoded = new Uint8Array(2 + payload.length);
|
|
24
|
+
encoded.set([1, tag]); // frozen branch-column codec version and scalar tag
|
|
25
|
+
encoded.set(payload, 2);
|
|
26
|
+
return encoded;
|
|
27
|
+
};
|
|
28
|
+
switch (value.type) {
|
|
29
|
+
case "Integer":
|
|
30
|
+
if (!Number.isSafeInteger(value.value) ||
|
|
31
|
+
value.value < -0x80000000 ||
|
|
32
|
+
value.value > 0x7fffffff) {
|
|
33
|
+
throw new Error("branch Integer values must be signed 32-bit integers");
|
|
34
|
+
}
|
|
35
|
+
{
|
|
36
|
+
const payload = new Uint8Array(4);
|
|
37
|
+
new DataView(payload.buffer).setInt32(0, value.value, true);
|
|
38
|
+
return envelope(4, payload); // Value::I32
|
|
39
|
+
}
|
|
40
|
+
case "BigInt": {
|
|
41
|
+
if (typeof value.value === "number" && !Number.isSafeInteger(value.value)) {
|
|
42
|
+
throw new Error("branch BigInt values supplied as numbers must be safe integers");
|
|
43
|
+
}
|
|
44
|
+
const integer = BigInt(value.value);
|
|
45
|
+
if (integer < -(1n << 63n) || integer > (1n << 63n) - 1n) {
|
|
46
|
+
throw new Error("branch BigInt values must be signed 64-bit integers");
|
|
47
|
+
}
|
|
48
|
+
const payload = new Uint8Array(8);
|
|
49
|
+
new DataView(payload.buffer).setBigInt64(0, integer, true);
|
|
50
|
+
return envelope(5, payload); // Value::I64
|
|
51
|
+
}
|
|
52
|
+
case "Uuid": {
|
|
53
|
+
const bytes = parseUuidBytes(value.value);
|
|
54
|
+
if (!bytes)
|
|
55
|
+
throw new Error(`invalid branch UUID ${value.value}`);
|
|
56
|
+
return envelope(7, bytes); // Value::Uuid
|
|
57
|
+
}
|
|
58
|
+
case "Text": {
|
|
59
|
+
const text = new TextEncoder().encode(value.value);
|
|
60
|
+
const payload = new Uint8Array(1 + text.length);
|
|
61
|
+
payload[0] = 0; // stored-scalar Primitive case
|
|
62
|
+
payload.set(text, 1);
|
|
63
|
+
return envelope(6, payload); // Value::String
|
|
64
|
+
}
|
|
65
|
+
default:
|
|
66
|
+
throw new Error(`branch columns currently require Integer, BigInt, Text, or Uuid values; got ${value.type}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function encodeBranchSelector(value) {
|
|
70
|
+
return {
|
|
71
|
+
values: Object.fromEntries(Object.entries(value.values).map(([name, branchValue]) => [
|
|
72
|
+
name,
|
|
73
|
+
Array.from(encodeBranchColumnValue(branchValue)),
|
|
74
|
+
])),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function encodeBranchViewBase(base) {
|
|
78
|
+
return base?.kind === "current"
|
|
79
|
+
? { Current: encodeBranchSelector(base.branch) }
|
|
80
|
+
: base?.kind === "snapshot"
|
|
81
|
+
? { Snapshot: { branch: encodeBranchSelector(base.branch), snapshot: base.snapshot } }
|
|
82
|
+
: undefined;
|
|
83
|
+
}
|
|
84
|
+
/** Generate a coordination-free UUIDv7 identity for a new mutable transaction. */
|
|
85
|
+
export function createOpenTransactionId() {
|
|
86
|
+
const bytes = runtimeRandomBytes(16);
|
|
87
|
+
const timestamp = Date.now();
|
|
88
|
+
bytes[0] = Math.floor(timestamp / 2 ** 40) & 0xff;
|
|
89
|
+
bytes[1] = Math.floor(timestamp / 2 ** 32) & 0xff;
|
|
90
|
+
bytes[2] = Math.floor(timestamp / 2 ** 24) & 0xff;
|
|
91
|
+
bytes[3] = Math.floor(timestamp / 2 ** 16) & 0xff;
|
|
92
|
+
bytes[4] = Math.floor(timestamp / 2 ** 8) & 0xff;
|
|
93
|
+
bytes[5] = timestamp & 0xff;
|
|
94
|
+
bytes[6] = (bytes[6] & 0x0f) | 0x70;
|
|
95
|
+
bytes[8] = (bytes[8] & 0x3f) | 0x80;
|
|
96
|
+
const hex = [...bytes].map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
97
|
+
return hex;
|
|
98
|
+
}
|
|
1
99
|
/**
|
|
2
|
-
*
|
|
100
|
+
* Product-facing policy for reads. It deliberately does not change write durability.
|
|
3
101
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
102
|
+
* There are two tiers: `LocalFirst` and `Remote`. A local-first read can also
|
|
103
|
+
* wait a bounded time for the server on its initial load; see
|
|
104
|
+
* {@link QueryExecutionOptions.firstLoadRemoteWaitMs}.
|
|
6
105
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
106
|
+
export const ReadTier = {
|
|
107
|
+
/**
|
|
108
|
+
* Cached local knowledge and pending writes; still syncs while connected.
|
|
109
|
+
* Set `firstLoadRemoteWaitMs` to let the initial load wait for the server first.
|
|
110
|
+
*/
|
|
111
|
+
LocalFirst: "local-first",
|
|
112
|
+
/** Current remote query scope, without pending local writes; waits offline. */
|
|
113
|
+
Remote: "remote",
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* @internal A local-first read's server wait in whole milliseconds, or
|
|
117
|
+
* `undefined` when the caller gave none. An explicit `0` stays `0`: it opts
|
|
118
|
+
* out of the client default wait. Throws for a value that is not a
|
|
119
|
+
* non-negative number of milliseconds.
|
|
120
|
+
*/
|
|
121
|
+
export function normalizeFirstLoadRemoteWaitMs(value) {
|
|
122
|
+
if (value === undefined || value === null)
|
|
123
|
+
return undefined;
|
|
124
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
|
|
125
|
+
throw new Error("firstLoadRemoteWaitMs must be a non-negative number of milliseconds.");
|
|
17
126
|
}
|
|
127
|
+
return Math.floor(value);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* How long a read that names no tier waits for the server on its first load
|
|
131
|
+
* in browsers and React Native, when a server is configured. It never waits
|
|
132
|
+
* offline or after `db.disconnect()`; pass `firstLoadRemoteWaitMs: 0` to show
|
|
133
|
+
* local data at once.
|
|
134
|
+
*/
|
|
135
|
+
export const DEFAULT_CLIENT_FIRST_LOAD_REMOTE_WAIT_MS = 5_000;
|
|
136
|
+
// Keep removed names here solely to provide migration guidance at the public API boundary.
|
|
137
|
+
const REMOVED_READ_TIERS = {
|
|
138
|
+
edge: 'The "edge" tier was removed. Use ReadTier.Remote ("remote") for server-confirmed reads.',
|
|
139
|
+
"remote-if-possible": 'The "remote-if-possible" tier was removed. Use ReadTier.LocalFirst with firstLoadRemoteWaitMs, or ReadTier.Remote for server-confirmed reads.',
|
|
140
|
+
"local-first-unless-empty": 'The "local-first-unless-empty" tier was removed. Use ReadTier.LocalFirst with firstLoadRemoteWaitMs.',
|
|
141
|
+
local: 'The "local" read tier was removed. Use ReadTier.LocalFirst ("local-first"); write waits keep "local".',
|
|
142
|
+
global: 'The "global" read tier was removed. Use ReadTier.Remote ("remote"); write waits keep "global".',
|
|
143
|
+
core: 'The "core" read tier was removed. Use ReadTier.Remote ("remote").',
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* @internal Throw for anything but a product read tier. Read options accept
|
|
147
|
+
* only `ReadTier.LocalFirst` and `ReadTier.Remote`; removed names get a
|
|
148
|
+
* migration message.
|
|
149
|
+
*/
|
|
150
|
+
export function rejectRemovedReadTier(tier) {
|
|
151
|
+
if (tier === undefined || tier === null || isPublicQueryReadTier(tier))
|
|
152
|
+
return;
|
|
153
|
+
const removed = typeof tier === "string" ? REMOVED_READ_TIERS[tier] : undefined;
|
|
154
|
+
throw new Error(removed ?? `Unknown read tier ${JSON.stringify(tier)}; expected "local-first" or "remote".`);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Copy the product-facing subset of query options before crossing a public
|
|
158
|
+
* JavaScript boundary. TypeScript declarations are useful guidance, but a
|
|
159
|
+
* caller can always supply an object through `as any` (or plain JavaScript).
|
|
160
|
+
* In particular, transport propagation and own-write delivery are runtime
|
|
161
|
+
* controls, not product API switches.
|
|
162
|
+
*
|
|
163
|
+
* @internal Db uses the analogous conversion when it lowers typed builders.
|
|
164
|
+
*/
|
|
165
|
+
export function publicQueryExecutionOptions(options) {
|
|
166
|
+
if (!options)
|
|
167
|
+
return undefined;
|
|
168
|
+
const candidate = options;
|
|
169
|
+
rejectRemovedReadTier(candidate.tier);
|
|
170
|
+
const result = {};
|
|
171
|
+
if (isPublicQueryReadTier(candidate.tier))
|
|
172
|
+
result.tier = candidate.tier;
|
|
173
|
+
const firstLoadRemoteWaitMs = normalizeFirstLoadRemoteWaitMs(candidate.firstLoadRemoteWaitMs);
|
|
174
|
+
if (firstLoadRemoteWaitMs !== undefined)
|
|
175
|
+
result.firstLoadRemoteWaitMs = firstLoadRemoteWaitMs;
|
|
176
|
+
if (candidate.branch !== undefined)
|
|
177
|
+
result.branch = candidate.branch;
|
|
178
|
+
// The runtime ignores a Remote read's wait; the types reject it.
|
|
179
|
+
return result;
|
|
180
|
+
}
|
|
181
|
+
/** @internal `local-only` is deliberately excluded from the product surface. */
|
|
182
|
+
export function isPublicQueryReadTier(value) {
|
|
183
|
+
return value === ReadTier.LocalFirst || value === ReadTier.Remote;
|
|
184
|
+
}
|
|
185
|
+
export function resolveEffectiveQueryExecutionOptions(context, options) {
|
|
186
|
+
const clientRuntime = isBrowserRuntime() || isReactNativeRuntime();
|
|
187
|
+
const tier = options?.tier ?? (context.serverUrl && !clientRuntime ? ReadTier.Remote : ReadTier.LocalFirst);
|
|
188
|
+
if (tier !== "local-only")
|
|
189
|
+
rejectRemovedReadTier(tier);
|
|
190
|
+
// A client read that names no tier is local first, but its first load
|
|
191
|
+
// waits briefly for the server so it does not show a stale or empty cache.
|
|
192
|
+
const defaultWaitMs = options?.tier === undefined && context.serverUrl && clientRuntime
|
|
193
|
+
? DEFAULT_CLIENT_FIRST_LOAD_REMOTE_WAIT_MS
|
|
194
|
+
: undefined;
|
|
195
|
+
const requestedWaitMs = tier === ReadTier.LocalFirst
|
|
196
|
+
? (normalizeFirstLoadRemoteWaitMs(options?.firstLoadRemoteWaitMs) ?? defaultWaitMs)
|
|
197
|
+
: undefined;
|
|
198
|
+
const firstLoadRemoteWaitMs = requestedWaitMs !== undefined && requestedWaitMs > 0 ? requestedWaitMs : undefined;
|
|
18
199
|
return {
|
|
19
|
-
|
|
20
|
-
|
|
200
|
+
tier,
|
|
201
|
+
...(firstLoadRemoteWaitMs !== undefined ? { firstLoadRemoteWaitMs } : {}),
|
|
202
|
+
visibility: options?.visibility ?? "public",
|
|
203
|
+
branch: options?.branch,
|
|
204
|
+
...(options?.splices?.length ? { splices: options.splices } : {}),
|
|
205
|
+
...(options?.backlogRows !== undefined ? { backlogRows: options.backlogRows } : {}),
|
|
21
206
|
};
|
|
22
207
|
}
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
|
|
208
|
+
function isBrowserRuntime() {
|
|
209
|
+
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
210
|
+
}
|
|
211
|
+
function isReactNativeRuntime() {
|
|
212
|
+
return typeof navigator !== "undefined" && navigator.product === "ReactNative";
|
|
213
|
+
}
|
|
214
|
+
function getScheduler() {
|
|
215
|
+
if ("scheduler" in globalThis) {
|
|
216
|
+
return (task) => {
|
|
217
|
+
// See: https://developer.mozilla.org/en-US/docs/Web/API/Scheduler/postTask
|
|
218
|
+
// @ts-ignore Scheduler is not yet provided by the dom library
|
|
219
|
+
void globalThis.scheduler.postTask(task, { priority: "user-visible" });
|
|
220
|
+
};
|
|
26
221
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
222
|
+
// Wrap rather than returning queueMicrotask directly: the native function
|
|
223
|
+
// throws "Illegal invocation" when called without globalThis as receiver.
|
|
224
|
+
return (task) => queueMicrotask(task);
|
|
30
225
|
}
|
|
31
|
-
function
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return fromMethod;
|
|
226
|
+
function encodeQueryExecutionOptions(options) {
|
|
227
|
+
const payload = {};
|
|
228
|
+
if (options.openTransactionId) {
|
|
229
|
+
payload.transaction_id = options.openTransactionId;
|
|
36
230
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
231
|
+
if (options.firstLoadRemoteWaitMs !== undefined && options.firstLoadRemoteWaitMs > 0) {
|
|
232
|
+
payload.first_load_remote_wait_ms = options.firstLoadRemoteWaitMs;
|
|
233
|
+
}
|
|
234
|
+
if (options.branch) {
|
|
235
|
+
const base = options.branch.base;
|
|
236
|
+
payload.read_view = {
|
|
237
|
+
source: {
|
|
238
|
+
BranchView: {
|
|
239
|
+
head: encodeBranchSelector(options.branch.head),
|
|
240
|
+
base: encodeBranchViewBase(base),
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
};
|
|
40
244
|
}
|
|
41
|
-
if (
|
|
42
|
-
|
|
245
|
+
if (options.splices?.length)
|
|
246
|
+
payload.splices = options.splices;
|
|
247
|
+
if (options.backlogRows !== undefined)
|
|
248
|
+
payload.backlog_rows = options.backlogRows;
|
|
249
|
+
if (!payload.transaction_id &&
|
|
250
|
+
!payload.first_load_remote_wait_ms &&
|
|
251
|
+
!payload.read_view &&
|
|
252
|
+
!payload.splices &&
|
|
253
|
+
payload.backlog_rows === undefined) {
|
|
254
|
+
return undefined;
|
|
43
255
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
256
|
+
return JSON.stringify(payload);
|
|
257
|
+
}
|
|
258
|
+
function committedTxId(result) {
|
|
259
|
+
if (result.kind !== "committed") {
|
|
260
|
+
throw new Error(`Runtime returned staged transaction ${result.openTransactionId} for an ordinary write`);
|
|
48
261
|
}
|
|
49
|
-
return
|
|
262
|
+
return result.txId;
|
|
50
263
|
}
|
|
51
|
-
function
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (typeof atob === "function") {
|
|
55
|
-
return atob(padded);
|
|
264
|
+
function normalizeUpdatedAt(updatedAt) {
|
|
265
|
+
if (updatedAt === undefined) {
|
|
266
|
+
return undefined;
|
|
56
267
|
}
|
|
57
|
-
if (
|
|
58
|
-
|
|
268
|
+
if (!Number.isFinite(updatedAt) || !Number.isInteger(updatedAt) || updatedAt < 0) {
|
|
269
|
+
throw new Error("Invalid updatedAt override. Expected a non-negative integer.");
|
|
59
270
|
}
|
|
60
|
-
|
|
271
|
+
return updatedAt;
|
|
61
272
|
}
|
|
62
|
-
function
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
throw new Error("Missing or invalid Authorization header");
|
|
273
|
+
function rejectionFromRuntimeWaitError(error) {
|
|
274
|
+
if (!error || typeof error !== "object") {
|
|
275
|
+
return null;
|
|
66
276
|
}
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
throw new Error("Invalid JWT format");
|
|
277
|
+
const candidate = error;
|
|
278
|
+
if (candidate.kind !== "rejected") {
|
|
279
|
+
return null;
|
|
71
280
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
281
|
+
if (typeof candidate.code !== "string" ||
|
|
282
|
+
typeof candidate.reason !== "string" ||
|
|
283
|
+
typeof candidate.transactionId !== "string") {
|
|
284
|
+
return null;
|
|
75
285
|
}
|
|
76
|
-
|
|
77
|
-
|
|
286
|
+
return new PersistedWriteRejectedError(candidate.transactionId, candidate.code, candidate.reason);
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Error returned when a write fails to be persisted at a given durability tier.
|
|
290
|
+
*/
|
|
291
|
+
export class PersistedWriteRejectedError extends Error {
|
|
292
|
+
transactionId;
|
|
293
|
+
code;
|
|
294
|
+
reason;
|
|
295
|
+
name = "PersistedWriteRejectedError";
|
|
296
|
+
constructor(transactionId, code, reason) {
|
|
297
|
+
super(`Persisted transaction ${transactionId} was rejected (${code}): ${reason}`);
|
|
298
|
+
this.transactionId = transactionId;
|
|
299
|
+
this.code = code;
|
|
300
|
+
this.reason = reason;
|
|
78
301
|
}
|
|
79
|
-
|
|
80
|
-
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Error returned when waiting for a write reaches the `timeoutMs` its caller
|
|
305
|
+
* set. The write itself is not rejected: it stays queued and may still be
|
|
306
|
+
* persisted, so retrying it can duplicate it.
|
|
307
|
+
*/
|
|
308
|
+
export class WriteWaitTimeoutError extends Error {
|
|
309
|
+
tier;
|
|
310
|
+
timeoutMs;
|
|
311
|
+
name = "WriteWaitTimeoutError";
|
|
312
|
+
code = "timeout";
|
|
313
|
+
constructor(tier, timeoutMs) {
|
|
314
|
+
super(`Waiting for the write to reach the ${tier} tier timed out after ${timeoutMs} ms; ` +
|
|
315
|
+
"it is still queued and may yet be persisted");
|
|
316
|
+
this.tier = tier;
|
|
317
|
+
this.timeoutMs = timeoutMs;
|
|
81
318
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
319
|
+
}
|
|
320
|
+
/** Longest delay `setTimeout` honours; longer ones fire at once. */
|
|
321
|
+
const MAX_WRITE_WAIT_TIMEOUT_MS = 2_147_483_647;
|
|
322
|
+
/** @internal Validate a caller's `timeoutMs` before any wait work starts. */
|
|
323
|
+
export function validateWriteWaitTimeout(timeoutMs) {
|
|
324
|
+
if (timeoutMs === undefined)
|
|
325
|
+
return;
|
|
326
|
+
if (typeof timeoutMs !== "number" ||
|
|
327
|
+
!Number.isFinite(timeoutMs) ||
|
|
328
|
+
timeoutMs < 0 ||
|
|
329
|
+
timeoutMs > MAX_WRITE_WAIT_TIMEOUT_MS) {
|
|
330
|
+
// Like an unknown tier, a bad timeout must not read as a rejected write.
|
|
331
|
+
throw new TypeError(`wait timeoutMs must be a number of milliseconds from 0 to ${MAX_WRITE_WAIT_TIMEOUT_MS}. ` +
|
|
332
|
+
"The write was already applied: do not retry it.");
|
|
85
333
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return
|
|
334
|
+
}
|
|
335
|
+
const writeWaitReadiness = new WeakMap();
|
|
336
|
+
/** @internal Configure host readiness without delaying native wait registration. */
|
|
337
|
+
export function setWriteWaitReadiness(handle, ready) {
|
|
338
|
+
writeWaitReadiness.set(handle, ready);
|
|
339
|
+
return handle;
|
|
340
|
+
}
|
|
341
|
+
function copyWriteWaitReadiness(source, target) {
|
|
342
|
+
const ready = writeWaitReadiness.get(source);
|
|
343
|
+
if (ready)
|
|
344
|
+
writeWaitReadiness.set(target, ready);
|
|
345
|
+
return target;
|
|
346
|
+
}
|
|
347
|
+
/** Validate JavaScript callers before passing a wait tier to the runtime. */
|
|
348
|
+
function resolveWriteWaitTier(tier) {
|
|
349
|
+
if (tier === "local" || tier === "global")
|
|
350
|
+
return tier;
|
|
351
|
+
const message = tier === "edge"
|
|
352
|
+
? 'The "edge" write tier was removed. Use wait({ tier: "global" }) instead.'
|
|
353
|
+
: `Unknown wait tier ${JSON.stringify(tier)}; expected "local" or "global".`;
|
|
354
|
+
// Choosing a wait tier happens after applying the write. Rejecting the wait
|
|
355
|
+
// must not be mistaken for a rejected write and prompt a duplicate insert.
|
|
356
|
+
throw new TypeError(`${message} The write was already applied: do not retry it.`);
|
|
92
357
|
}
|
|
93
358
|
/**
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* Created by `JazzClient.forSession()`. Allows backend applications
|
|
97
|
-
* to perform operations as a specific user via header-based authentication.
|
|
359
|
+
* Returned by upsert, update, delete, and transaction operations.
|
|
360
|
+
* Allows waiting for the write to be persisted at a given durability tier.
|
|
98
361
|
*/
|
|
99
|
-
export class
|
|
100
|
-
client;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
this.
|
|
362
|
+
export class WriteHandle {
|
|
363
|
+
#client;
|
|
364
|
+
value;
|
|
365
|
+
txId;
|
|
366
|
+
constructor(txId, client, value = undefined) {
|
|
367
|
+
this.value = value;
|
|
368
|
+
this.txId = Promise.resolve(txId);
|
|
369
|
+
// Fire-and-forget callers may wait later, or never. Observe rejection now
|
|
370
|
+
// without replacing txId: a later wait must still receive the original error.
|
|
371
|
+
this.txId.catch(() => { });
|
|
372
|
+
this.#client = client;
|
|
105
373
|
}
|
|
106
374
|
/**
|
|
107
|
-
*
|
|
375
|
+
* Wait for the write to be persisted at a given durability tier.
|
|
376
|
+
*
|
|
377
|
+
* Rejects with a {@link PersistedWriteRejectedError} if the write is rejected,
|
|
378
|
+
* or a {@link WriteWaitTimeoutError} once `timeoutMs` passes. Without
|
|
379
|
+
* `timeoutMs`, a Global wait lasts through network outages and reconnects.
|
|
108
380
|
*/
|
|
109
|
-
async
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
table,
|
|
115
|
-
values,
|
|
116
|
-
schema_context: this.client.getSchemaContext(),
|
|
117
|
-
}, this.session);
|
|
118
|
-
if (!response.ok) {
|
|
119
|
-
throw new Error(`Create failed: ${response.statusText}`);
|
|
120
|
-
}
|
|
121
|
-
const result = await response.json();
|
|
122
|
-
return result.object_id;
|
|
381
|
+
async wait(options) {
|
|
382
|
+
const tier = resolveWriteWaitTier(options.tier);
|
|
383
|
+
validateWriteWaitTimeout(options.timeoutMs);
|
|
384
|
+
const ready = writeWaitReadiness.get(this)?.(tier);
|
|
385
|
+
return (await this.#client.waitForTransaction(this.txId, tier, ready, options.timeoutMs));
|
|
123
386
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
schema_context: this.client.getSchemaContext(),
|
|
137
|
-
}, this.session);
|
|
138
|
-
if (!response.ok) {
|
|
139
|
-
throw new Error(`Update failed: ${response.statusText}`);
|
|
140
|
-
}
|
|
387
|
+
client() {
|
|
388
|
+
return this.#client;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Returned by insert operations and auto-committed transactions.
|
|
393
|
+
* Allows getting the inserted value and waiting for the write
|
|
394
|
+
* to be persisted at a given durability tier.
|
|
395
|
+
*/
|
|
396
|
+
export class WriteResult extends WriteHandle {
|
|
397
|
+
constructor(value, txId, client) {
|
|
398
|
+
super(txId, client, value);
|
|
141
399
|
}
|
|
142
400
|
/**
|
|
143
|
-
*
|
|
401
|
+
* Wait for the write to be persisted at a given durability tier.
|
|
402
|
+
*
|
|
403
|
+
* Rejects with a {@link PersistedWriteRejectedError} if the write is rejected,
|
|
404
|
+
* or a {@link WriteWaitTimeoutError} once `timeoutMs` passes.
|
|
405
|
+
* @returns the inserted row.
|
|
144
406
|
*/
|
|
145
|
-
async
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
407
|
+
async wait(options) {
|
|
408
|
+
await super.wait(options);
|
|
409
|
+
return this.value;
|
|
410
|
+
}
|
|
411
|
+
mapValue(transformValue) {
|
|
412
|
+
return copyWriteWaitReadiness(this, new WriteResult(transformValue(this.value), this.txId, this.client()));
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* The `txId` of a transaction that wrote nothing: it committed nothing, so
|
|
417
|
+
* it has no transaction id.
|
|
418
|
+
*/
|
|
419
|
+
export class EmptyTransactionError extends Error {
|
|
420
|
+
name = "EmptyTransactionError";
|
|
421
|
+
code = "empty_transaction";
|
|
422
|
+
constructor() {
|
|
423
|
+
super("This transaction wrote nothing, so it has no transaction id");
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Returned by a `db.transaction(callback)` whose callback wrote nothing: the
|
|
428
|
+
* transaction was rolled back, as there was nothing to commit, so `wait()`
|
|
429
|
+
* resolves at once with the callback's value. It has no transaction id:
|
|
430
|
+
* `txId` rejects.
|
|
431
|
+
*/
|
|
432
|
+
export class EmptyTransactionWriteResult extends WriteResult {
|
|
433
|
+
constructor(value, client) {
|
|
434
|
+
super(value, Promise.reject(new EmptyTransactionError()), client);
|
|
156
435
|
}
|
|
436
|
+
async wait(options) {
|
|
437
|
+
resolveWriteWaitTier(options.tier);
|
|
438
|
+
validateWriteWaitTimeout(options.timeoutMs);
|
|
439
|
+
return this.value;
|
|
440
|
+
}
|
|
441
|
+
mapValue(transformValue) {
|
|
442
|
+
return new EmptyTransactionWriteResult(transformValue(this.value), this.client());
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Returned by explicitly-committed serializable transactions.
|
|
447
|
+
*
|
|
448
|
+
* Serializable transactions are accepted or rejected by the global authority, so
|
|
449
|
+
* callers do not choose a durability tier when waiting for confirmation.
|
|
450
|
+
*/
|
|
451
|
+
export class SerializableWriteHandle extends WriteHandle {
|
|
157
452
|
/**
|
|
158
|
-
*
|
|
453
|
+
* Wait for the serializable transaction to be accepted or rejected by the authority.
|
|
454
|
+
*
|
|
455
|
+
* Rejects with a {@link PersistedWriteRejectedError} if the transaction is rejected,
|
|
456
|
+
* or a {@link WriteWaitTimeoutError} once `timeoutMs` passes. Without
|
|
457
|
+
* `timeoutMs`, the wait lasts through network outages and reconnects.
|
|
159
458
|
*/
|
|
160
|
-
async
|
|
161
|
-
|
|
459
|
+
async wait(options = {}) {
|
|
460
|
+
validateWriteWaitTimeout(options.timeoutMs);
|
|
461
|
+
await this.client().waitForSerializableTransaction(this.txId, options.timeoutMs);
|
|
162
462
|
}
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Returned by auto-committed serializable transactions.
|
|
466
|
+
*/
|
|
467
|
+
export class SerializableWriteResult extends WriteResult {
|
|
163
468
|
/**
|
|
164
|
-
*
|
|
469
|
+
* Wait for the serializable transaction to be accepted or rejected by the authority.
|
|
470
|
+
*
|
|
471
|
+
* Rejects with a {@link PersistedWriteRejectedError} if the transaction is rejected,
|
|
472
|
+
* or a {@link WriteWaitTimeoutError} once `timeoutMs` passes.
|
|
473
|
+
* @returns the callback result.
|
|
165
474
|
*/
|
|
166
|
-
|
|
167
|
-
|
|
475
|
+
async wait(options = {}) {
|
|
476
|
+
validateWriteWaitTimeout(options.timeoutMs);
|
|
477
|
+
await this.client().waitForSerializableTransaction(this.txId, options.timeoutMs);
|
|
478
|
+
return this.value;
|
|
479
|
+
}
|
|
480
|
+
mapValue(transformValue) {
|
|
481
|
+
return copyWriteWaitReadiness(this, new SerializableWriteResult(transformValue(this.value), this.txId, this.client()));
|
|
168
482
|
}
|
|
169
483
|
}
|
|
484
|
+
const credentialRenewal = new WeakMap();
|
|
170
485
|
/**
|
|
171
|
-
*
|
|
486
|
+
* @internal Tell a client whether something renews its credential after a
|
|
487
|
+
* refusal. Without it, a refusal ends the client's Global waits (#3923).
|
|
172
488
|
*/
|
|
489
|
+
export function setCredentialRenewal(client, renews) {
|
|
490
|
+
credentialRenewal.set(client, renews);
|
|
491
|
+
}
|
|
492
|
+
/** @internal Report a refusal that reached the host rather than the client's runtime. */
|
|
493
|
+
export function reportCredentialRefusal(client, reason) {
|
|
494
|
+
if (client instanceof JazzClient)
|
|
495
|
+
client.handleCredentialRefusal(reason);
|
|
496
|
+
}
|
|
497
|
+
/** @internal Explicit opening path without per-client ambient state. */
|
|
498
|
+
export function beginClientTransactionAfter(client, kind, session, attribution, reservedId, prerequisite) {
|
|
499
|
+
return client.openTransaction(kind, session, attribution, reservedId, prerequisite);
|
|
500
|
+
}
|
|
501
|
+
/** High-level Jazz client. */
|
|
173
502
|
export class JazzClient {
|
|
503
|
+
transactionPreparations = new Map();
|
|
504
|
+
committedWriteObserver;
|
|
174
505
|
runtime;
|
|
175
|
-
|
|
176
|
-
serverClientId = generateClientId();
|
|
177
|
-
subscriptions = new Map();
|
|
506
|
+
scheduler;
|
|
178
507
|
context;
|
|
179
508
|
resolvedSession;
|
|
180
|
-
|
|
509
|
+
shutdownPromise = null;
|
|
510
|
+
discarded = false;
|
|
511
|
+
writesRefused = null;
|
|
512
|
+
/** Facade-owned subscription releases, fenced against terminal reentrancy. */
|
|
513
|
+
activeSubscriptionReleases = new Map();
|
|
514
|
+
registerSubscriptionRelease(handle, release) {
|
|
515
|
+
this.activeSubscriptionReleases.set(handle, release);
|
|
516
|
+
}
|
|
517
|
+
releaseSubscription(handle) {
|
|
518
|
+
const release = this.activeSubscriptionReleases.get(handle);
|
|
519
|
+
// Subscription ids are opaque facade results. Once their owner is gone,
|
|
520
|
+
// duplicate public calls are intentionally no-ops rather than raw native
|
|
521
|
+
// unsubscriptions (which could double-release a terminal handle).
|
|
522
|
+
release?.();
|
|
523
|
+
}
|
|
524
|
+
resolveSessionFromContext() {
|
|
525
|
+
return resolveClientSessionStateSync({
|
|
526
|
+
appId: this.context.appId,
|
|
527
|
+
accountId: this.context.accountId,
|
|
528
|
+
jwtToken: this.context.jwtToken,
|
|
529
|
+
cookieSession: this.context.cookieSession,
|
|
530
|
+
trustedReservedSession: getTrustedReservedSession(this.context),
|
|
531
|
+
}).internalSession;
|
|
532
|
+
}
|
|
533
|
+
buildTransportAuthPayload() {
|
|
534
|
+
const payload = { jwt_token: this.context.backendSecret ? null : (this.context.jwtToken ?? null) };
|
|
535
|
+
// A backend open is a separate trusted-serving credential. Do not send an
|
|
536
|
+
// incidental admin secret alongside it: server admission gives admin
|
|
537
|
+
// precedence, which would turn this runtime's SYSTEM backend authority
|
|
538
|
+
// into its adapter fallback wire identity.
|
|
539
|
+
if (this.context.adminSecret && !this.context.backendSecret) {
|
|
540
|
+
payload.admin_secret = this.context.adminSecret;
|
|
541
|
+
}
|
|
542
|
+
if (this.context.backendSecret) {
|
|
543
|
+
payload.backend_secret = this.context.backendSecret;
|
|
544
|
+
if (this.context.cookieSession) {
|
|
545
|
+
payload.backend_session = this.context.cookieSession;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
return payload;
|
|
549
|
+
}
|
|
550
|
+
constructor(runtime, context, runtimeOptions) {
|
|
181
551
|
this.runtime = runtime;
|
|
552
|
+
this.scheduler = getScheduler();
|
|
182
553
|
this.context = context;
|
|
183
|
-
this.resolvedSession =
|
|
184
|
-
this.
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
554
|
+
this.resolvedSession = this.resolveSessionFromContext();
|
|
555
|
+
this.runtime.useSession?.(this.resolvedSession);
|
|
556
|
+
const onAuthFailure = runtimeOptions?.onAuthFailure;
|
|
557
|
+
this.runtime.onAuthFailure((rawReason) => {
|
|
558
|
+
const reason = mapAuthReason(rawReason);
|
|
559
|
+
this.handleCredentialRefusal(reason);
|
|
560
|
+
onAuthFailure?.(reason);
|
|
561
|
+
});
|
|
562
|
+
const onAuthRestored = runtimeOptions?.onAuthRestored;
|
|
563
|
+
if (onAuthRestored)
|
|
564
|
+
this.runtime.onAuthRestored?.(onAuthRestored);
|
|
565
|
+
this.runtime.onMutationError((event) => {
|
|
566
|
+
console.error("Unhandled Jazz mutation error", event);
|
|
195
567
|
});
|
|
196
568
|
}
|
|
197
569
|
/**
|
|
198
|
-
*
|
|
570
|
+
* Create client from a pre-constructed runtime.
|
|
199
571
|
*
|
|
200
|
-
*
|
|
572
|
+
* RuntimeSource implementations use this after selecting the platform runtime.
|
|
573
|
+
*
|
|
574
|
+
* @param runtime A runtime implementing the Runtime interface
|
|
575
|
+
* @param context Application context
|
|
201
576
|
* @returns Connected JazzClient instance
|
|
202
577
|
*/
|
|
203
|
-
static
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
578
|
+
static connectWithRuntime(runtime, context, runtimeOptions) {
|
|
579
|
+
return new JazzClient(runtime, context, runtimeOptions);
|
|
580
|
+
}
|
|
581
|
+
/** @internal See {@link Runtime.serveThinTransaction}. */
|
|
582
|
+
serveThinTransaction(request) {
|
|
583
|
+
if (!this.runtime.serveThinTransaction)
|
|
584
|
+
return Promise.reject(new Error("this runtime serves no thin transactions"));
|
|
585
|
+
return this.runtime.serveThinTransaction(request);
|
|
586
|
+
}
|
|
587
|
+
/** @internal See {@link Runtime.releaseThinTransactions}. */
|
|
588
|
+
async releaseThinTransactions() {
|
|
589
|
+
await this.runtime.releaseThinTransactions?.();
|
|
590
|
+
}
|
|
591
|
+
captureSnapshot() {
|
|
592
|
+
if (!this.runtime.captureSnapshot)
|
|
593
|
+
return Promise.reject(new UnsupportedSnapshotError());
|
|
594
|
+
return this.runtime.captureSnapshot();
|
|
595
|
+
}
|
|
596
|
+
beginTransaction(kind, session, attribution, reservedId) {
|
|
597
|
+
return this.openTransaction(kind, session, attribution, reservedId);
|
|
598
|
+
}
|
|
599
|
+
/** @internal Explicit prerequisite opening; named so unused clients can be tree-shaken. */
|
|
600
|
+
openTransaction(kind, session, attribution, reservedId, prerequisite) {
|
|
601
|
+
const id = reservedId ?? createOpenTransactionId();
|
|
602
|
+
if (prerequisite) {
|
|
603
|
+
const context = this.writeContext(session, attribution);
|
|
604
|
+
const state = {
|
|
605
|
+
committing: false,
|
|
606
|
+
unopened: true,
|
|
607
|
+
session,
|
|
608
|
+
attribution,
|
|
609
|
+
};
|
|
610
|
+
this.transactionPreparations.set(id, state);
|
|
611
|
+
state.pending = Promise.resolve().then(async () => {
|
|
612
|
+
const assertCurrent = () => {
|
|
613
|
+
if (this.discarded)
|
|
614
|
+
throw new Error("Client discarded before transaction admission");
|
|
615
|
+
if (this.shutdownPromise)
|
|
616
|
+
throw new Error("Client shut down before transaction admission");
|
|
617
|
+
if (this.transactionPreparations.get(id) !== state)
|
|
618
|
+
throw new Error("Transaction was rolled back before admission");
|
|
619
|
+
};
|
|
620
|
+
assertCurrent();
|
|
621
|
+
await prerequisite();
|
|
622
|
+
assertCurrent();
|
|
623
|
+
this.runtime.beginTransaction(kind, id, context);
|
|
624
|
+
state.unopened = false;
|
|
625
|
+
});
|
|
626
|
+
state.pending.catch(() => { });
|
|
627
|
+
return id;
|
|
214
628
|
}
|
|
215
|
-
|
|
629
|
+
const opened = this.runtime.beginTransaction(kind, id, this.writeContext(session, attribution));
|
|
630
|
+
this.transactionPreparations.set(opened, { committing: false, session, attribution });
|
|
631
|
+
return opened;
|
|
632
|
+
}
|
|
633
|
+
/** @internal Shared across schema clients attached to one runtime owner. */
|
|
634
|
+
preparationOwner() {
|
|
635
|
+
return this.runtime.preparationOwner ?? this.runtime;
|
|
636
|
+
}
|
|
637
|
+
onMutationError(listener) {
|
|
638
|
+
this.runtime.onMutationError(listener);
|
|
216
639
|
}
|
|
217
640
|
/**
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
* @param wasmModule Pre-loaded WASM module from loadWasmModule()
|
|
224
|
-
* @param context Application context with driver and schema
|
|
225
|
-
* @returns Connected JazzClient instance (created synchronously)
|
|
641
|
+
* @internal Observe every write this client commits, with the explicit
|
|
642
|
+
* session and attribution it was made with. A backend context shares one
|
|
643
|
+
* client between many `Db`s and uses this to route each rejection back to
|
|
644
|
+
* the `Db` that made the write.
|
|
226
645
|
*/
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
646
|
+
observeCommittedWrites(observer) {
|
|
647
|
+
this.committedWriteObserver = observer;
|
|
648
|
+
}
|
|
649
|
+
reportCommittedWrite(txId, writer) {
|
|
650
|
+
const observer = this.committedWriteObserver;
|
|
651
|
+
if (!observer)
|
|
652
|
+
return txId;
|
|
653
|
+
const session = writer?.session;
|
|
654
|
+
const attribution = writer?.attribution;
|
|
655
|
+
if (typeof txId === "string")
|
|
656
|
+
observer(txId, session, attribution);
|
|
657
|
+
else
|
|
658
|
+
txId.then((committed) => observer(committed, session, attribution), () => undefined);
|
|
659
|
+
return txId;
|
|
238
660
|
}
|
|
239
661
|
/**
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
* without WASM loading.
|
|
244
|
-
*
|
|
245
|
-
* @param runtime A runtime implementing the Runtime interface
|
|
246
|
-
* @param context Application context
|
|
247
|
-
* @returns Connected JazzClient instance
|
|
662
|
+
* @internal Register deferred physical preparation before returning a mutation.
|
|
663
|
+
* Callbacks must use the underlying runtime, not re-enter this client's
|
|
664
|
+
* transaction reads or commit (which wait for the registered preparation).
|
|
248
665
|
*/
|
|
249
|
-
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
client.setupSync(context.serverUrl, context.serverPathPrefix);
|
|
666
|
+
prepareTransaction(id, prepare) {
|
|
667
|
+
const state = this.transactionPreparations.get(id);
|
|
668
|
+
if (!state || state.committing) {
|
|
669
|
+
throw new Error("Cannot prepare a transaction that is closed or committing");
|
|
254
670
|
}
|
|
255
|
-
|
|
671
|
+
state.pending = (state.pending ?? Promise.resolve()).then(async () => {
|
|
672
|
+
if (this.transactionPreparations.get(id) !== state) {
|
|
673
|
+
throw new Error("Transaction was rolled back before preparation");
|
|
674
|
+
}
|
|
675
|
+
let active = true;
|
|
676
|
+
const assertActive = () => {
|
|
677
|
+
if (!active || this.transactionPreparations.get(id) !== state)
|
|
678
|
+
throw new Error("Transaction preparation is no longer active");
|
|
679
|
+
};
|
|
680
|
+
try {
|
|
681
|
+
await prepare({
|
|
682
|
+
queryInternal: (query, options, session) => {
|
|
683
|
+
assertActive();
|
|
684
|
+
return this.queryWithoutPreparation(query, { ...options, openTransactionId: id }, session);
|
|
685
|
+
},
|
|
686
|
+
insertInternal: (table, values, options, session, attribution) => {
|
|
687
|
+
assertActive();
|
|
688
|
+
const writeContext = this.writeContext(session, attribution, id, options);
|
|
689
|
+
const row = this.runtime.insert(table, values, writeContext, options?.id);
|
|
690
|
+
return { ...row, values: row.values };
|
|
691
|
+
},
|
|
692
|
+
updateInternal: (table, objectId, updates, updatedAt, session, attribution, _transaction, branch) => {
|
|
693
|
+
assertActive();
|
|
694
|
+
const writeContext = this.writeContext(session, attribution, id, { updatedAt, branch });
|
|
695
|
+
return this.runtime.update(table, objectId, updates, writeContext);
|
|
696
|
+
},
|
|
697
|
+
upsertInternal: (table, objectId, values, options, session, attribution) => {
|
|
698
|
+
assertActive();
|
|
699
|
+
const writeContext = this.writeContext(session, attribution, id, options);
|
|
700
|
+
return this.runtime.upsert(table, objectId, values, writeContext);
|
|
701
|
+
},
|
|
702
|
+
restoreInternal: (table, objectId, values, options, session, attribution) => {
|
|
703
|
+
assertActive();
|
|
704
|
+
const writeContext = this.writeContext(session, attribution, id, options);
|
|
705
|
+
const row = this.runtime.restore(table, objectId, values, writeContext);
|
|
706
|
+
return { ...row, values: row.values };
|
|
707
|
+
},
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
finally {
|
|
711
|
+
active = false;
|
|
712
|
+
}
|
|
713
|
+
});
|
|
714
|
+
// Registration owns failures even if the caller never commits or waits.
|
|
715
|
+
state.pending.catch(() => { });
|
|
716
|
+
return state.pending;
|
|
717
|
+
}
|
|
718
|
+
stageMutation(id, values, write) {
|
|
719
|
+
if (!id || !this.transactionPreparations.get(id)?.pending)
|
|
720
|
+
return write(values);
|
|
721
|
+
const snapshot = structuredClone(values);
|
|
722
|
+
this.prepareTransaction(id, async () => {
|
|
723
|
+
write(snapshot);
|
|
724
|
+
});
|
|
725
|
+
return { kind: "staged", openTransactionId: id };
|
|
726
|
+
}
|
|
727
|
+
stageRowMutation(id, table, values, objectId, write) {
|
|
728
|
+
if (!id || !this.transactionPreparations.get(id)?.pending)
|
|
729
|
+
return write(values, objectId);
|
|
730
|
+
const snapshot = structuredClone(values);
|
|
731
|
+
// The returned logical row must not share mutable bytes with the queued write.
|
|
732
|
+
const row = this.previewInsertInternal(table, snapshot, objectId);
|
|
733
|
+
this.prepareTransaction(id, async () => {
|
|
734
|
+
write(snapshot, row.id);
|
|
735
|
+
});
|
|
736
|
+
return { ...row, kind: "staged", openTransactionId: id };
|
|
737
|
+
}
|
|
738
|
+
/** @internal Prepare a return value without publishing or staging a physical row. */
|
|
739
|
+
previewInsertInternal(table, values, objectId) {
|
|
740
|
+
if (!this.runtime.previewInsert)
|
|
741
|
+
throw new Error("This runtime cannot prepare an inserted row");
|
|
742
|
+
return this.runtime.previewInsert(table, structuredClone(values), objectId);
|
|
743
|
+
}
|
|
744
|
+
commitTransaction(id) {
|
|
745
|
+
if (this.writesRefused)
|
|
746
|
+
throw this.writesRefused;
|
|
747
|
+
const state = this.transactionPreparations.get(id);
|
|
748
|
+
if (state?.committing)
|
|
749
|
+
throw new Error("Transaction is already committing");
|
|
750
|
+
const runtime = this.runtime;
|
|
751
|
+
const submitted = state?.pending
|
|
752
|
+
? state.pending.then(() => runtime.commitTransaction(id))
|
|
753
|
+
: runtime.commitTransaction(id);
|
|
754
|
+
if (typeof submitted === "string") {
|
|
755
|
+
this.transactionPreparations.delete(id);
|
|
756
|
+
return new WriteHandle(this.reportCommittedWrite(submitted, state), this);
|
|
757
|
+
}
|
|
758
|
+
if (state)
|
|
759
|
+
state.committing = true;
|
|
760
|
+
const txId = Promise.resolve(submitted).then((committed) => {
|
|
761
|
+
this.transactionPreparations.delete(id);
|
|
762
|
+
return committed;
|
|
763
|
+
}, (error) => {
|
|
764
|
+
if (state)
|
|
765
|
+
state.committing = false;
|
|
766
|
+
throw error;
|
|
767
|
+
});
|
|
768
|
+
return new WriteHandle(this.reportCommittedWrite(txId, state), this);
|
|
769
|
+
}
|
|
770
|
+
/** @internal See {@link Runtime.hasStagedTransactionWrites}. */
|
|
771
|
+
hasStagedTransactionWrites(id) {
|
|
772
|
+
if (this.transactionPreparations.get(id)?.unopened)
|
|
773
|
+
return false;
|
|
774
|
+
return this.runtime.hasStagedTransactionWrites?.(id);
|
|
775
|
+
}
|
|
776
|
+
rollbackTransaction(id) {
|
|
777
|
+
const unopened = this.transactionPreparations.get(id)?.unopened;
|
|
778
|
+
this.transactionPreparations.delete(id);
|
|
779
|
+
if (unopened)
|
|
780
|
+
return Promise.resolve(true);
|
|
781
|
+
return this.runtime.rollbackTransaction(id);
|
|
256
782
|
}
|
|
257
783
|
/**
|
|
258
|
-
*
|
|
784
|
+
* Enable backend-scoped sync auth for this client.
|
|
259
785
|
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
* @returns SessionClient for performing operations as the given user
|
|
265
|
-
* @throws Error if backendSecret is not configured
|
|
266
|
-
*
|
|
267
|
-
* @example
|
|
268
|
-
* ```typescript
|
|
269
|
-
* const userSession = { user_id: "user-123", claims: {} };
|
|
270
|
-
* const userClient = client.forSession(userSession);
|
|
271
|
-
* const id = await userClient.create("todos", [{ type: "Text", value: "Buy milk" }]);
|
|
272
|
-
* ```
|
|
273
|
-
*/
|
|
274
|
-
forSession(session) {
|
|
786
|
+
* In backend mode, sync/event transport uses `X-Jazz-Backend-Secret` instead
|
|
787
|
+
* of end-user auth headers and intentionally does not send admin headers.
|
|
788
|
+
*/
|
|
789
|
+
asBackend() {
|
|
275
790
|
if (!this.context.backendSecret) {
|
|
276
|
-
throw new Error("backendSecret required for
|
|
791
|
+
throw new Error("backendSecret required for backend mode");
|
|
277
792
|
}
|
|
278
793
|
if (!this.context.serverUrl) {
|
|
279
|
-
throw new Error("serverUrl required for
|
|
794
|
+
throw new Error("serverUrl required for backend mode");
|
|
280
795
|
}
|
|
281
|
-
return
|
|
796
|
+
return this;
|
|
282
797
|
}
|
|
283
798
|
/**
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
* - `claims` -> `session.claims` (defaults to `{}`)
|
|
289
|
-
*
|
|
290
|
-
* This helper only extracts payload fields and does not validate JWT signatures.
|
|
291
|
-
* JWT verification should happen in your auth middleware before request handling.
|
|
799
|
+
* @internal The server refused this client's credential. A refusal the app
|
|
800
|
+
* renews holds Global waits until the new credential reconnects, as an
|
|
801
|
+
* outage does; with nothing to renew it, the runtime ends them and its
|
|
802
|
+
* remote subscriptions as a terminal failure (#3923).
|
|
292
803
|
*/
|
|
293
|
-
|
|
294
|
-
|
|
804
|
+
handleCredentialRefusal(reason) {
|
|
805
|
+
if (isRenewableAuthFailure(reason) && credentialRenewal.get(this)?.(reason) === true)
|
|
806
|
+
return;
|
|
807
|
+
this.runtime.endCredentialWait?.();
|
|
808
|
+
}
|
|
809
|
+
updateAuthSnapshot(update, updateRuntime = true) {
|
|
810
|
+
const previousJwtToken = this.context.jwtToken;
|
|
811
|
+
const previousCookieSession = this.context.cookieSession;
|
|
812
|
+
const previousTrustedReservedSession = getTrustedReservedSession(this.context);
|
|
813
|
+
const previousResolvedSession = this.resolvedSession;
|
|
814
|
+
if (update.mode === "bearer") {
|
|
815
|
+
this.context.jwtToken = update.jwtToken;
|
|
816
|
+
this.context.cookieSession = undefined;
|
|
817
|
+
setTrustedReservedSession(this.context, update.trustedReservedSession);
|
|
818
|
+
}
|
|
819
|
+
else {
|
|
820
|
+
this.context.jwtToken = undefined;
|
|
821
|
+
this.context.cookieSession = update.cookieSession;
|
|
822
|
+
setTrustedReservedSession(this.context, undefined);
|
|
823
|
+
}
|
|
824
|
+
try {
|
|
825
|
+
this.resolvedSession = this.resolveSessionFromContext();
|
|
826
|
+
this.runtime.useSession?.(this.resolvedSession);
|
|
827
|
+
if (updateRuntime) {
|
|
828
|
+
this.runtime.updateAuth(JSON.stringify(this.buildTransportAuthPayload()));
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
catch (error) {
|
|
832
|
+
this.context.jwtToken = previousJwtToken;
|
|
833
|
+
this.context.cookieSession = previousCookieSession;
|
|
834
|
+
setTrustedReservedSession(this.context, previousTrustedReservedSession);
|
|
835
|
+
this.resolvedSession = previousResolvedSession;
|
|
836
|
+
this.runtime.useSession?.(previousResolvedSession);
|
|
837
|
+
throw error;
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
updateAuthToken(jwtToken) {
|
|
841
|
+
this.updateAuthSnapshot({ mode: "bearer", jwtToken });
|
|
842
|
+
}
|
|
843
|
+
/** @internal Accept an auth update already applied by the owning connection. */
|
|
844
|
+
acceptAuthUpdate(update) {
|
|
845
|
+
this.updateAuthSnapshot(update, false);
|
|
846
|
+
}
|
|
847
|
+
/** @internal Update a token minted by a dedicated first-party reserved auth flow. */
|
|
848
|
+
updateTrustedAuthToken(jwtToken, session) {
|
|
849
|
+
this.updateAuthSnapshot({
|
|
850
|
+
mode: "bearer",
|
|
851
|
+
jwtToken,
|
|
852
|
+
trustedReservedSession: session,
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
updateCookieSession(cookieSession) {
|
|
856
|
+
this.updateAuthSnapshot({ mode: "cookie", cookieSession });
|
|
857
|
+
}
|
|
858
|
+
normalizeQueryExecutionOptions(options) {
|
|
859
|
+
const resolved = resolveEffectiveQueryExecutionOptions(this.context, options);
|
|
860
|
+
if (!options?.openTransactionId) {
|
|
861
|
+
return resolved;
|
|
862
|
+
}
|
|
863
|
+
return {
|
|
864
|
+
...resolved,
|
|
865
|
+
openTransactionId: options.openTransactionId,
|
|
866
|
+
};
|
|
295
867
|
}
|
|
296
868
|
/**
|
|
297
|
-
*
|
|
298
|
-
*
|
|
299
|
-
* @param table Table name
|
|
300
|
-
* @param values Array of column values
|
|
301
|
-
* @returns The new row's ID (UUID string)
|
|
869
|
+
* @internal `db.waitForSync` for the writes `session` makes through this
|
|
870
|
+
* client (none: its own), on the runtime's native path.
|
|
302
871
|
*/
|
|
303
|
-
|
|
304
|
-
|
|
872
|
+
async waitForSyncAs(session, signal) {
|
|
873
|
+
if (!this.runtime.waitForPendingWrites)
|
|
874
|
+
throw new Error("Runtime does not support waiting for sync");
|
|
875
|
+
await this.runtime.waitForPendingWrites("global", {
|
|
876
|
+
throughOutage: true,
|
|
877
|
+
signal,
|
|
878
|
+
sync: { writeContext: this.writeContext(session) ?? null },
|
|
879
|
+
});
|
|
305
880
|
}
|
|
306
881
|
/**
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
* @param table Table name
|
|
310
|
-
* @param values Array of column values
|
|
311
|
-
* @param tier Acknowledgement tier to wait for
|
|
312
|
-
* @returns Promise resolving to the new row's ID when the tier acknowledges
|
|
882
|
+
* Resolve the writing session and encode the runtime write context. An
|
|
883
|
+
* insert/restore branch selector is lowered to a head-only branch view.
|
|
313
884
|
*/
|
|
314
|
-
|
|
315
|
-
|
|
885
|
+
writeContext(explicitSession, attribution, openTransactionId, { updatedAt, branch: selected, } = {}) {
|
|
886
|
+
// An explicit attribution without a session writes as no session, not the client's.
|
|
887
|
+
const session = explicitSession ||
|
|
888
|
+
(attribution === undefined ? (this.resolvedSession ?? undefined) : undefined);
|
|
889
|
+
const branch = selected && ("head" in selected ? selected : { head: selected });
|
|
890
|
+
if (!session &&
|
|
891
|
+
attribution === undefined &&
|
|
892
|
+
!openTransactionId &&
|
|
893
|
+
updatedAt === undefined &&
|
|
894
|
+
!branch) {
|
|
895
|
+
return undefined;
|
|
896
|
+
}
|
|
897
|
+
if (attribution === undefined &&
|
|
898
|
+
session &&
|
|
899
|
+
!openTransactionId &&
|
|
900
|
+
updatedAt === undefined &&
|
|
901
|
+
!branch) {
|
|
902
|
+
return JSON.stringify(serializeRuntimeSession(session));
|
|
903
|
+
}
|
|
904
|
+
const payload = {};
|
|
905
|
+
if (session) {
|
|
906
|
+
payload.session = serializeRuntimeSession(session);
|
|
907
|
+
}
|
|
908
|
+
if (attribution !== undefined) {
|
|
909
|
+
payload.attribution = attribution;
|
|
910
|
+
}
|
|
911
|
+
if (updatedAt !== undefined) {
|
|
912
|
+
payload.updated_at = normalizeUpdatedAt(updatedAt);
|
|
913
|
+
}
|
|
914
|
+
if (openTransactionId) {
|
|
915
|
+
payload.transaction_id = openTransactionId;
|
|
916
|
+
}
|
|
917
|
+
if (branch) {
|
|
918
|
+
payload.branch_view = {
|
|
919
|
+
head: encodeBranchSelector(branch.head),
|
|
920
|
+
base: encodeBranchViewBase(branch.base),
|
|
921
|
+
};
|
|
922
|
+
}
|
|
923
|
+
return JSON.stringify(payload);
|
|
316
924
|
}
|
|
317
925
|
/**
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
* @param query Query builder or JSON-encoded query specification
|
|
321
|
-
* @param settledTier Optional tier to hold delivery until confirmed
|
|
322
|
-
* @returns Array of matching rows
|
|
926
|
+
* Insert a new row into a table without waiting for durability.
|
|
323
927
|
*/
|
|
324
|
-
|
|
325
|
-
|
|
928
|
+
insert(table, values, options, session, attribution) {
|
|
929
|
+
const row = this.insertInternal(table, values, options, session, attribution);
|
|
930
|
+
return new WriteResult(row, this.reportCommittedWrite(committedTxId(row), { session, attribution }), this);
|
|
326
931
|
}
|
|
327
932
|
/**
|
|
328
|
-
*
|
|
329
|
-
*
|
|
933
|
+
* Consume one host byte/text stream and atomically insert the resulting
|
|
934
|
+
* scalar with the other row values. The streamed value is intentionally not
|
|
935
|
+
* copied back into the returned handle.
|
|
330
936
|
*/
|
|
331
|
-
async
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
937
|
+
async insertStreaming(table, values, column, source, options, session, attribution) {
|
|
938
|
+
return this.streamingMutation("insert", table, values, column, source, options, session, attribution);
|
|
939
|
+
}
|
|
940
|
+
async updateStreaming(table, objectId, values, column, source, options, session, attribution) {
|
|
941
|
+
return this.streamingMutation("update", table, values, column, source, options, session, attribution, objectId);
|
|
942
|
+
}
|
|
943
|
+
async upsertStreaming(table, objectId, values, column, source, options, session, attribution) {
|
|
944
|
+
return this.streamingMutation("upsert", table, values, column, source, options, session, attribution, objectId);
|
|
945
|
+
}
|
|
946
|
+
async streamingMutation(mutation, table, values, column, source, options, session, attribution, objectId) {
|
|
947
|
+
const result = await this.runStreamingMutation(mutation, table, values, column, source, options, session, attribution, objectId);
|
|
948
|
+
if (result.kind !== "committed") {
|
|
949
|
+
throw new Error("Streaming mutations cannot be staged inside an open transaction");
|
|
950
|
+
}
|
|
951
|
+
return new WriteHandle(this.reportCommittedWrite(result.txId, { session, attribution }), this, {
|
|
952
|
+
id: result.id,
|
|
953
|
+
});
|
|
337
954
|
}
|
|
338
955
|
/**
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
* @param objectId Row ID (UUID string)
|
|
342
|
-
* @param updates Object mapping column names to new values
|
|
956
|
+
* @internal Stage a streamed mutation in open transaction
|
|
957
|
+
* `openTransactionId`; it commits with the transaction.
|
|
343
958
|
*/
|
|
344
|
-
|
|
345
|
-
this.
|
|
959
|
+
async streamingMutationInTransaction(mutation, table, values, column, source, openTransactionId, options, session, attribution, objectId) {
|
|
960
|
+
const result = await this.runStreamingMutation(mutation, table, values, column, source, options, session, attribution, objectId, openTransactionId);
|
|
961
|
+
if (result.kind !== "staged") {
|
|
962
|
+
throw new Error("A streaming mutation in a transaction must be staged in it");
|
|
963
|
+
}
|
|
964
|
+
return { id: result.id };
|
|
965
|
+
}
|
|
966
|
+
async runStreamingMutation(mutation, table, values, column, source, options, session, attribution, objectId, openTransactionId) {
|
|
967
|
+
if (!this.runtime.streamingMutation) {
|
|
968
|
+
throw new Error("This runtime does not support streaming mutations");
|
|
969
|
+
}
|
|
970
|
+
const writeContext = this.writeContext(session, attribution, openTransactionId, options);
|
|
971
|
+
return this.runtime.streamingMutation(mutation, table, values, column, source, writeContext, objectId ?? ("id" in (options ?? {}) ? options.id : undefined));
|
|
346
972
|
}
|
|
347
973
|
/**
|
|
348
|
-
*
|
|
974
|
+
* @internal
|
|
349
975
|
*/
|
|
350
|
-
|
|
351
|
-
|
|
976
|
+
insertInternal(table, values, options, session, attribution, openTransactionId) {
|
|
977
|
+
const writeContext = this.writeContext(session, attribution, openTransactionId, options);
|
|
978
|
+
const row = this.stageRowMutation(openTransactionId, table, values, options?.id, (prepared, objectId) => this.runtime.insert(table, prepared, writeContext, objectId));
|
|
979
|
+
return {
|
|
980
|
+
...row,
|
|
981
|
+
values: row.values,
|
|
982
|
+
};
|
|
352
983
|
}
|
|
353
984
|
/**
|
|
354
|
-
*
|
|
355
|
-
*
|
|
356
|
-
* @param objectId Row ID (UUID string)
|
|
985
|
+
* Restore a soft-deleted row with a caller-supplied id without waiting for durability.
|
|
357
986
|
*/
|
|
358
|
-
|
|
359
|
-
this.
|
|
987
|
+
restore(table, objectId, values, options, session, attribution) {
|
|
988
|
+
const row = this.restoreInternal(table, objectId, values, options, session, attribution);
|
|
989
|
+
return new WriteResult(row, this.reportCommittedWrite(committedTxId(row), { session, attribution }), this);
|
|
360
990
|
}
|
|
361
991
|
/**
|
|
362
|
-
*
|
|
992
|
+
* @internal
|
|
363
993
|
*/
|
|
364
|
-
|
|
365
|
-
|
|
994
|
+
restoreInternal(table, objectId, values, options, session, attribution, openTransactionId) {
|
|
995
|
+
const writeContext = this.writeContext(session, attribution, openTransactionId, options);
|
|
996
|
+
const row = this.stageRowMutation(openTransactionId, table, values, objectId, (prepared) => this.runtime.restore(table, objectId, prepared, writeContext));
|
|
997
|
+
return {
|
|
998
|
+
...row,
|
|
999
|
+
values: row.values,
|
|
1000
|
+
};
|
|
366
1001
|
}
|
|
367
1002
|
/**
|
|
368
|
-
*
|
|
369
|
-
*
|
|
370
|
-
* @param query Query builder or JSON-encoded query specification
|
|
371
|
-
* @param callback Called with delta whenever results change
|
|
372
|
-
* @param settledTier Optional tier to hold initial delivery until confirmed
|
|
373
|
-
* @returns Subscription ID for unsubscribing
|
|
1003
|
+
* Create or update a row with a caller-supplied id without waiting for durability.
|
|
374
1004
|
*/
|
|
375
|
-
|
|
376
|
-
|
|
1005
|
+
upsert(table, objectId, values, options, session, attribution) {
|
|
1006
|
+
const result = this.upsertInternal(table, objectId, values, options, session, attribution);
|
|
1007
|
+
return new WriteHandle(this.reportCommittedWrite(committedTxId(result), { session, attribution }), this);
|
|
377
1008
|
}
|
|
378
1009
|
/**
|
|
379
|
-
* Internal subscribe with optional session and settled tier.
|
|
380
1010
|
* @internal
|
|
381
1011
|
*/
|
|
382
|
-
|
|
383
|
-
const
|
|
384
|
-
|
|
385
|
-
const queryJson = resolveQueryJson(query);
|
|
386
|
-
const optionsJson = encodeQueryExecutionOptions(normalizedOptions);
|
|
387
|
-
const subId = this.runtime.subscribe(queryJson, (deltaJsonOrObject) => {
|
|
388
|
-
// WASM runtime passes delta as JSON string, need to parse it
|
|
389
|
-
const delta = typeof deltaJsonOrObject === "string" ? JSON.parse(deltaJsonOrObject) : deltaJsonOrObject;
|
|
390
|
-
callback(delta);
|
|
391
|
-
}, sessionJson, normalizedOptions.settledTier, optionsJson);
|
|
392
|
-
this.subscriptions.set(subId, callback);
|
|
393
|
-
return subId;
|
|
1012
|
+
upsertInternal(table, objectId, values, options, session, attribution, openTransactionId) {
|
|
1013
|
+
const writeContext = this.writeContext(session, attribution, openTransactionId, options);
|
|
1014
|
+
return this.stageMutation(openTransactionId, values, (prepared) => this.runtime.upsert(table, objectId, prepared, writeContext));
|
|
394
1015
|
}
|
|
395
1016
|
/**
|
|
396
|
-
*
|
|
1017
|
+
* Execute a query and return all matching rows.
|
|
397
1018
|
*
|
|
398
|
-
* @param
|
|
1019
|
+
* @param query JSON-encoded runtime query specification
|
|
1020
|
+
* @param options Optional read durability options
|
|
1021
|
+
* @returns Array of matching rows
|
|
399
1022
|
*/
|
|
400
|
-
|
|
401
|
-
this.
|
|
402
|
-
this.subscriptions.delete(subscriptionId);
|
|
1023
|
+
async query(query, options, session) {
|
|
1024
|
+
return this.queryInternal(query, publicQueryExecutionOptions(options), session);
|
|
403
1025
|
}
|
|
404
|
-
/**
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
1026
|
+
/** @internal */
|
|
1027
|
+
async queryInternal(query, options, session) {
|
|
1028
|
+
const preparation = options?.openTransactionId
|
|
1029
|
+
? this.transactionPreparations.get(options.openTransactionId)?.pending
|
|
1030
|
+
: undefined;
|
|
1031
|
+
if (preparation)
|
|
1032
|
+
await preparation;
|
|
1033
|
+
return this.queryWithoutPreparation(query, options, session);
|
|
1034
|
+
}
|
|
1035
|
+
async queryWithoutPreparation(query, options, session) {
|
|
1036
|
+
const normalizedOptions = this.normalizeQueryExecutionOptions(options);
|
|
1037
|
+
const effectiveSession = session ?? this.resolvedSession;
|
|
1038
|
+
const sessionJson = effectiveSession
|
|
1039
|
+
? JSON.stringify(serializeRuntimeSession(effectiveSession))
|
|
1040
|
+
: undefined;
|
|
1041
|
+
const optionsJson = encodeQueryExecutionOptions(normalizedOptions);
|
|
1042
|
+
const results = await this.runtime.query(query, sessionJson, normalizedOptions.tier, optionsJson);
|
|
1043
|
+
return results;
|
|
409
1044
|
}
|
|
410
1045
|
/**
|
|
411
|
-
*
|
|
412
|
-
* @internal
|
|
1046
|
+
* Update a row by ID without waiting for durability.
|
|
413
1047
|
*/
|
|
414
|
-
|
|
415
|
-
|
|
1048
|
+
update(table, objectId, updates, options, session, attribution) {
|
|
1049
|
+
const result = this.updateInternal(table, objectId, updates, options?.updatedAt, session, attribution, undefined, options?.branch);
|
|
1050
|
+
return new WriteHandle(this.reportCommittedWrite(committedTxId(result), { session, attribution }), this);
|
|
1051
|
+
}
|
|
1052
|
+
/** @internal Typed `Db.update` diff lowering; not exposed as an imperative API. */
|
|
1053
|
+
updateLargeValues(table, objectId, updates, descriptors, options, session, attribution) {
|
|
1054
|
+
const result = this.updateLargeValuesInternal(table, objectId, updates, descriptors, options?.updatedAt, session, attribution, undefined, options?.branch);
|
|
1055
|
+
return new WriteHandle(this.reportCommittedWrite(committedTxId(result), { session, attribution }), this);
|
|
1056
|
+
}
|
|
1057
|
+
/** @internal */
|
|
1058
|
+
updateLargeValuesInternal(table, objectId, updates, descriptors, updatedAt, session, attribution, openTransactionId, branch) {
|
|
1059
|
+
if (branch) {
|
|
1060
|
+
throw new Error("Partial-value updates (applyDiffs, editedFrom) are not yet supported in branch views.");
|
|
1061
|
+
}
|
|
1062
|
+
const writeContext = this.writeContext(session, attribution, openTransactionId, { updatedAt });
|
|
1063
|
+
if (!this.runtime.updateLargeValues) {
|
|
1064
|
+
throw new Error("Native runtime does not support typed partial-value updates.");
|
|
1065
|
+
}
|
|
1066
|
+
return this.runtime.updateLargeValues(table, objectId, updates, descriptors, writeContext);
|
|
416
1067
|
}
|
|
417
1068
|
/**
|
|
418
|
-
* Get the server URL (for SessionClient).
|
|
419
1069
|
* @internal
|
|
420
1070
|
*/
|
|
421
|
-
|
|
422
|
-
|
|
1071
|
+
updateInternal(table, objectId, updates, updatedAt, session, attribution, openTransactionId, branch) {
|
|
1072
|
+
const writeContext = this.writeContext(session, attribution, openTransactionId, {
|
|
1073
|
+
updatedAt,
|
|
1074
|
+
branch,
|
|
1075
|
+
});
|
|
1076
|
+
return this.stageMutation(openTransactionId, updates, (prepared) => this.runtime.update(table, objectId, prepared, writeContext));
|
|
423
1077
|
}
|
|
424
1078
|
/**
|
|
425
|
-
*
|
|
426
|
-
* @internal
|
|
1079
|
+
* Delete a row by ID without waiting for durability.
|
|
427
1080
|
*/
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
1081
|
+
delete(table, objectId, options, session, attribution) {
|
|
1082
|
+
const result = this.deleteInternal(table, objectId, options?.updatedAt, session, attribution, undefined, options?.branch);
|
|
1083
|
+
return new WriteHandle(this.reportCommittedWrite(committedTxId(result), { session, attribution }), this);
|
|
1084
|
+
}
|
|
1085
|
+
canInsertLocally(table, values, session) {
|
|
1086
|
+
if (!this.runtime.canInsertLocally) {
|
|
1087
|
+
throw new Error("Runtime does not support write-policy dry-run insert checks.");
|
|
1088
|
+
}
|
|
1089
|
+
return this.runtime.canInsertLocally(table, values, session ?? this.resolvedSession ?? undefined);
|
|
1090
|
+
}
|
|
1091
|
+
canReadLocally(table, objectId, session) {
|
|
1092
|
+
if (!this.runtime.canReadLocally) {
|
|
1093
|
+
throw new Error("Runtime does not support read-policy dry-run checks.");
|
|
1094
|
+
}
|
|
1095
|
+
return this.runtime.canReadLocally(table, objectId, session ?? this.resolvedSession ?? undefined);
|
|
1096
|
+
}
|
|
1097
|
+
canUpdateLocally(table, objectId, values, session) {
|
|
1098
|
+
if (!this.runtime.canUpdateLocally) {
|
|
1099
|
+
throw new Error("Runtime does not support write-policy dry-run update checks.");
|
|
1100
|
+
}
|
|
1101
|
+
return this.runtime.canUpdateLocally(table, objectId, values, session ?? this.resolvedSession ?? undefined);
|
|
1102
|
+
}
|
|
1103
|
+
canDeleteLocally(table, objectId, session) {
|
|
1104
|
+
if (!this.runtime.canDeleteLocally) {
|
|
1105
|
+
throw new Error("Runtime does not support write-policy dry-run delete checks.");
|
|
1106
|
+
}
|
|
1107
|
+
return this.runtime.canDeleteLocally(table, objectId, session ?? this.resolvedSession ?? undefined);
|
|
1108
|
+
}
|
|
1109
|
+
requestInsertPermissionAdvice(table, values, session) {
|
|
1110
|
+
return (this.runtime.requestInsertPermissionAdvice?.(table, values, session ?? this.resolvedSession ?? undefined) ?? Promise.resolve("unknown"));
|
|
1111
|
+
}
|
|
1112
|
+
/** For the Inspector's `explain`; see {@link Runtime.explainReadClauses}. */
|
|
1113
|
+
explainReadClauses(table, rows, session) {
|
|
1114
|
+
if (!this.runtime.explainReadClauses) {
|
|
1115
|
+
throw new Error("explain is not supported yet by this runtime");
|
|
431
1116
|
}
|
|
432
|
-
return
|
|
1117
|
+
return this.runtime.explainReadClauses(table, rows, session);
|
|
1118
|
+
}
|
|
1119
|
+
requestReadPermissionAdvice(table, objectId, session) {
|
|
1120
|
+
return (this.runtime.requestReadPermissionAdvice?.(table, objectId, session ?? this.resolvedSession ?? undefined) ?? Promise.resolve("unknown"));
|
|
1121
|
+
}
|
|
1122
|
+
requestUpdatePermissionAdvice(table, objectId, values, session) {
|
|
1123
|
+
return (this.runtime.requestUpdatePermissionAdvice?.(table, objectId, values, session ?? this.resolvedSession ?? undefined) ?? Promise.resolve("unknown"));
|
|
1124
|
+
}
|
|
1125
|
+
requestDeletePermissionAdvice(table, objectId, session) {
|
|
1126
|
+
return (this.runtime.requestDeletePermissionAdvice?.(table, objectId, session ?? this.resolvedSession ?? undefined) ?? Promise.resolve("unknown"));
|
|
433
1127
|
}
|
|
434
1128
|
/**
|
|
435
|
-
* Get schema context for server requests.
|
|
436
1129
|
* @internal
|
|
437
1130
|
*/
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
};
|
|
1131
|
+
deleteInternal(table, objectId, updatedAt, session, attribution, openTransactionId, branch) {
|
|
1132
|
+
const writeContext = this.writeContext(session, attribution, openTransactionId, {
|
|
1133
|
+
updatedAt,
|
|
1134
|
+
branch,
|
|
1135
|
+
});
|
|
1136
|
+
return this.stageMutation(openTransactionId, {}, () => this.runtime.delete(table, objectId, writeContext));
|
|
444
1137
|
}
|
|
445
1138
|
/**
|
|
446
|
-
*
|
|
447
|
-
*
|
|
1139
|
+
* Subscribe to a query and receive updates when results change.
|
|
1140
|
+
*
|
|
1141
|
+
* @param callbacks Delta callback, or callbacks object with terminal error handling.
|
|
1142
|
+
* Legacy function-form subscriptions report terminal failures to `console.error`.
|
|
1143
|
+
* @param options Optional read durability options
|
|
1144
|
+
* @returns Subscription ID for unsubscribing
|
|
448
1145
|
*/
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
1146
|
+
subscribe(query, callbacks, options, session) {
|
|
1147
|
+
return this.subscribeInternal(query, callbacks, publicQueryExecutionOptions(options), session);
|
|
1148
|
+
}
|
|
1149
|
+
/** @internal */
|
|
1150
|
+
subscribeInternal(query, callbacks, options, session) {
|
|
1151
|
+
const { onUpdate, onError } = typeof callbacks === "function" ? { onUpdate: callbacks, onError: undefined } : callbacks;
|
|
1152
|
+
const normalizedOptions = this.normalizeQueryExecutionOptions(options);
|
|
1153
|
+
const effectiveSession = session ?? this.resolvedSession;
|
|
1154
|
+
const sessionJson = effectiveSession
|
|
1155
|
+
? JSON.stringify(serializeRuntimeSession(effectiveSession))
|
|
1156
|
+
: undefined;
|
|
1157
|
+
const optionsJson = encodeQueryExecutionOptions(normalizedOptions);
|
|
1158
|
+
const handle = this.runtime.createSubscription(query, sessionJson, normalizedOptions.tier, optionsJson);
|
|
1159
|
+
let terminal = false;
|
|
1160
|
+
let nativeHandleReleased = false;
|
|
1161
|
+
const releaseNativeHandle = () => {
|
|
1162
|
+
if (nativeHandleReleased)
|
|
1163
|
+
return;
|
|
1164
|
+
nativeHandleReleased = true;
|
|
1165
|
+
if (this.activeSubscriptionReleases.get(handle) === releaseSubscription) {
|
|
1166
|
+
this.activeSubscriptionReleases.delete(handle);
|
|
1167
|
+
}
|
|
1168
|
+
this.runtime.unsubscribe(handle);
|
|
452
1169
|
};
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
1170
|
+
const releaseSubscription = () => {
|
|
1171
|
+
// A public unsubscribe is terminal too: a queued native frame must not
|
|
1172
|
+
// re-enter application callbacks after its owner has been released.
|
|
1173
|
+
terminal = true;
|
|
1174
|
+
releaseNativeHandle();
|
|
1175
|
+
};
|
|
1176
|
+
this.registerSubscriptionRelease(handle, releaseSubscription);
|
|
1177
|
+
const terminate = (error, unsubscribe) => {
|
|
1178
|
+
if (terminal)
|
|
1179
|
+
return;
|
|
1180
|
+
terminal = true;
|
|
1181
|
+
if (unsubscribe)
|
|
1182
|
+
this.releaseSubscription(handle);
|
|
1183
|
+
if (!onError) {
|
|
1184
|
+
console.error("Unhandled Jazz subscription error", error);
|
|
1185
|
+
return;
|
|
1186
|
+
}
|
|
1187
|
+
try {
|
|
1188
|
+
onError(error);
|
|
1189
|
+
}
|
|
1190
|
+
catch (callbackError) {
|
|
1191
|
+
console.error("Jazz subscription error callback failed", callbackError);
|
|
1192
|
+
}
|
|
1193
|
+
};
|
|
1194
|
+
try {
|
|
1195
|
+
this.runtime.executeSubscription(handle, (result) => {
|
|
1196
|
+
if (terminal)
|
|
1197
|
+
return;
|
|
1198
|
+
if (result instanceof Error) {
|
|
1199
|
+
// A terminal callback means this facade owns the now-dead native
|
|
1200
|
+
// handle. Release it even if the core stream has stopped producing.
|
|
1201
|
+
terminate(result, true);
|
|
1202
|
+
return;
|
|
1203
|
+
}
|
|
1204
|
+
try {
|
|
1205
|
+
onUpdate(result);
|
|
1206
|
+
}
|
|
1207
|
+
catch (error) {
|
|
1208
|
+
// User callback failures must not escape through the native tick or
|
|
1209
|
+
// leave a live source publishing behind the terminal notification.
|
|
1210
|
+
terminate(toError(error), true);
|
|
1211
|
+
}
|
|
464
1212
|
});
|
|
465
1213
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
1214
|
+
catch (error) {
|
|
1215
|
+
// createSubscription already transferred ownership to this facade. If
|
|
1216
|
+
// callback installation fails synchronously, no caller can own the
|
|
1217
|
+
// handle because subscribe() has not returned it yet.
|
|
1218
|
+
this.releaseSubscription(handle);
|
|
1219
|
+
throw error;
|
|
1220
|
+
}
|
|
1221
|
+
return handle;
|
|
471
1222
|
}
|
|
472
1223
|
/**
|
|
473
|
-
*
|
|
1224
|
+
* Unsubscribe from a query.
|
|
474
1225
|
*
|
|
475
|
-
*
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
1226
|
+
* @param subscriptionId ID returned from subscribe()
|
|
1227
|
+
*/
|
|
1228
|
+
unsubscribe(subscriptionId) {
|
|
1229
|
+
this.releaseSubscription(subscriptionId);
|
|
1230
|
+
}
|
|
1231
|
+
/**
|
|
1232
|
+
* Connect to a Jazz server over WebSocket using the Rust transport layer.
|
|
1233
|
+
*
|
|
1234
|
+
* Accepts an HTTP/HTTPS server URL (e.g. "http://localhost:4000") and
|
|
1235
|
+
* converts it to the corresponding WebSocket `/ws` endpoint URL before
|
|
1236
|
+
* passing it to the underlying Rust runtime's `connect()`. Already-WS URLs
|
|
1237
|
+
* are passed through unchanged.
|
|
479
1238
|
*
|
|
480
|
-
*
|
|
1239
|
+
* @param url Server URL — http(s):// or ws(s)://. `/apps/<appId>/ws` is appended automatically.
|
|
1240
|
+
* @param auth Authentication credentials for the connection.
|
|
481
1241
|
*/
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
1242
|
+
connectTransport(url, auth) {
|
|
1243
|
+
this.runtime.connect(httpUrlToWs(url, this.context.appId), JSON.stringify(auth));
|
|
1244
|
+
}
|
|
1245
|
+
/**
|
|
1246
|
+
* Temporarily disconnect from the Jazz server without closing local runtime state.
|
|
1247
|
+
*/
|
|
1248
|
+
async disconnectTransport() {
|
|
1249
|
+
await this.runtime.disconnect({ rejectWaiters: false });
|
|
1250
|
+
}
|
|
1251
|
+
/**
|
|
1252
|
+
* Get the current schema.
|
|
1253
|
+
*/
|
|
1254
|
+
getSchema() {
|
|
1255
|
+
return normalizeRuntimeSchema(this.context.schema);
|
|
1256
|
+
}
|
|
1257
|
+
/** @internal Connection managers use this to attach native peer transports. */
|
|
1258
|
+
getRuntime() {
|
|
1259
|
+
return this.runtime;
|
|
1260
|
+
}
|
|
1261
|
+
async waitForTransaction(txId, tier, ready, timeoutMs) {
|
|
1262
|
+
validateWriteWaitTimeout(timeoutMs);
|
|
1263
|
+
// A timeout ends the wait here and in the runtime, so an abandoned wait
|
|
1264
|
+
// leaves no runtime work behind.
|
|
1265
|
+
const control = new AbortController();
|
|
1266
|
+
const ended = new Promise((_, reject) => {
|
|
1267
|
+
control.signal.addEventListener("abort", () => reject(control.signal.reason), {
|
|
1268
|
+
once: true,
|
|
1269
|
+
});
|
|
1270
|
+
});
|
|
1271
|
+
ended.catch(() => undefined);
|
|
1272
|
+
let timer;
|
|
1273
|
+
if (timeoutMs !== undefined) {
|
|
1274
|
+
timer = setTimeout(() => control.abort(new WriteWaitTimeoutError(tier, timeoutMs)), timeoutMs);
|
|
485
1275
|
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
1276
|
+
try {
|
|
1277
|
+
// Register before awaiting host readiness. Readiness still gates completion,
|
|
1278
|
+
// including runtimes that do not themselves need to defer transport progress.
|
|
1279
|
+
const completion = this.runtime.waitForTransaction(txId, tier, {
|
|
1280
|
+
...(ready ? { ready } : {}),
|
|
1281
|
+
signal: control.signal,
|
|
1282
|
+
});
|
|
1283
|
+
completion.catch(() => undefined);
|
|
1284
|
+
await Promise.race([Promise.all([ready, completion]), ended]);
|
|
491
1285
|
}
|
|
492
|
-
|
|
493
|
-
|
|
1286
|
+
catch (error) {
|
|
1287
|
+
if (control.signal.aborted && error === control.signal.reason)
|
|
1288
|
+
throw error;
|
|
1289
|
+
throw this.normalizeTransactionWaitError(error);
|
|
494
1290
|
}
|
|
495
|
-
|
|
496
|
-
|
|
1291
|
+
finally {
|
|
1292
|
+
clearTimeout(timer);
|
|
1293
|
+
if (!control.signal.aborted)
|
|
1294
|
+
control.abort(new Error("write wait ended"));
|
|
497
1295
|
}
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
1296
|
+
}
|
|
1297
|
+
/** @internal */
|
|
1298
|
+
async waitForSerializableTransaction(txId, timeoutMs) {
|
|
1299
|
+
const hasAuthority = Boolean(this.context.serverUrl) || this.runtime.nativeUpstreamConfigured?.() === true;
|
|
1300
|
+
// Hand the unresolved ID to the runtime wait so `timeoutMs` also covers a
|
|
1301
|
+
// commit that has not returned it yet. A commit that fails surfaces its own
|
|
1302
|
+
// error unchanged, not one normalized as a runtime wait failure.
|
|
1303
|
+
let commitFailure;
|
|
1304
|
+
const committed = Promise.resolve(txId).catch((error) => {
|
|
1305
|
+
commitFailure = { error };
|
|
1306
|
+
throw error;
|
|
1307
|
+
});
|
|
1308
|
+
committed.catch(() => undefined);
|
|
1309
|
+
try {
|
|
1310
|
+
await this.waitForTransaction(committed, hasAuthority ? "global" : "local", undefined, timeoutMs);
|
|
1311
|
+
}
|
|
1312
|
+
catch (error) {
|
|
1313
|
+
if (commitFailure)
|
|
1314
|
+
throw commitFailure.error;
|
|
1315
|
+
throw error;
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
normalizeTransactionWaitError(error) {
|
|
1319
|
+
return rejectionFromRuntimeWaitError(error) ?? toError(error);
|
|
504
1320
|
}
|
|
505
1321
|
/**
|
|
506
1322
|
* Shutdown the client and release resources.
|
|
507
1323
|
*/
|
|
508
1324
|
async shutdown() {
|
|
509
|
-
this.
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
retryServerPayloads: true,
|
|
523
|
-
onServerPayload: (payload) => this.sendSyncMessage(payload),
|
|
524
|
-
onServerPayloadError: (error) => {
|
|
525
|
-
const isExpectedAbort = isExpectedFetchAbortError(error);
|
|
526
|
-
if (!isExpectedAbort) {
|
|
527
|
-
console.error("Sync POST error:", error);
|
|
528
|
-
this.streamController.notifyTransportFailure();
|
|
529
|
-
}
|
|
530
|
-
},
|
|
531
|
-
}));
|
|
532
|
-
// Connect to binary stream for incoming messages
|
|
533
|
-
this.streamController.start(serverUrl, serverPathPrefix);
|
|
1325
|
+
if (this.shutdownPromise) {
|
|
1326
|
+
return await this.shutdownPromise;
|
|
1327
|
+
}
|
|
1328
|
+
this.shutdownPromise = (async () => {
|
|
1329
|
+
// Close runtime if it supports explicit shutdown.
|
|
1330
|
+
if (this.runtime.close) {
|
|
1331
|
+
await this.runtime.close();
|
|
1332
|
+
}
|
|
1333
|
+
else {
|
|
1334
|
+
this.runtime.disconnect({ rejectWaiters: false });
|
|
1335
|
+
}
|
|
1336
|
+
})();
|
|
1337
|
+
return await this.shutdownPromise;
|
|
534
1338
|
}
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
await sendSyncPayload(serverUrl, payload, {
|
|
540
|
-
jwtToken: this.context.jwtToken,
|
|
541
|
-
localAuthMode: this.context.localAuthMode,
|
|
542
|
-
localAuthToken: this.context.localAuthToken,
|
|
543
|
-
adminSecret: this.context.adminSecret,
|
|
544
|
-
clientId: this.serverClientId,
|
|
545
|
-
pathPrefix: this.streamController.getPathPrefix(),
|
|
546
|
-
});
|
|
1339
|
+
/** @internal Abandon runtime work after external storage invalidation/reset. */
|
|
1340
|
+
discard() {
|
|
1341
|
+
this.discarded = true;
|
|
1342
|
+
this.runtime.discard?.();
|
|
547
1343
|
}
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
// Cast to any — wasm-bindgen glue exports (default, initSync) aren't in .d.ts
|
|
556
|
-
const wasmModule = await import("jazz-wasm");
|
|
557
|
-
// In Node.js, we need to read the .wasm file and use initSync.
|
|
558
|
-
// In browsers/React Native, the default fetch-based init works (or default()).
|
|
559
|
-
// Use try/catch so we skip the Node path when node:* modules are unavailable (e.g. RN).
|
|
560
|
-
let nodeInitDone = false;
|
|
561
|
-
if (typeof process !== "undefined" && process.versions?.node) {
|
|
562
|
-
try {
|
|
563
|
-
const { existsSync, readFileSync } = await import("node:fs");
|
|
564
|
-
const { createRequire } = await import("node:module");
|
|
565
|
-
const { dirname, resolve } = await import("node:path");
|
|
566
|
-
const require = createRequire(import.meta.url);
|
|
567
|
-
const packageJsonPath = require.resolve("jazz-wasm/package.json");
|
|
568
|
-
const packageDir = dirname(packageJsonPath);
|
|
569
|
-
const wasmPath = resolve(packageDir, "pkg/jazz_wasm_bg.wasm");
|
|
570
|
-
if (existsSync(wasmPath)) {
|
|
571
|
-
wasmModule.initSync({ module: readFileSync(wasmPath) });
|
|
572
|
-
nodeInitDone = true;
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
catch {
|
|
576
|
-
// Node modules unavailable (e.g. React Native with process polyfill)
|
|
577
|
-
}
|
|
1344
|
+
/**
|
|
1345
|
+
* @internal Refuse every later commit with `error`: this tab yielded its
|
|
1346
|
+
* store to a newer build of the app and reloads, which would lose them.
|
|
1347
|
+
* A transaction opened before commits through here, not through the Db.
|
|
1348
|
+
*/
|
|
1349
|
+
refuseWrites(error) {
|
|
1350
|
+
this.writesRefused = error;
|
|
578
1351
|
}
|
|
579
|
-
|
|
580
|
-
|
|
1352
|
+
/** Whether this client's runtime can delete its local store. */
|
|
1353
|
+
supportsClientStorageReset() {
|
|
1354
|
+
return this.runtime.canClearClientStorage?.() === true;
|
|
1355
|
+
}
|
|
1356
|
+
async clearClientStorage() {
|
|
1357
|
+
if (!this.runtime.clearClientStorage) {
|
|
1358
|
+
throw new Error("Runtime does not support client storage reset.");
|
|
1359
|
+
}
|
|
1360
|
+
return await this.runtime.clearClientStorage();
|
|
581
1361
|
}
|
|
582
|
-
return wasmModule;
|
|
583
1362
|
}
|
|
584
1363
|
//# sourceMappingURL=client.js.map
|