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