jazz-tools 2.0.0-alpha.60 → 2.0.0-alpha.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/jazz-tools.js +3 -0
- package/dist/_dev/native-account-session.d.ts +8 -1
- package/dist/_dev/native-account-session.d.ts.map +1 -1
- package/dist/_dev/native-account-session.js +10 -0
- package/dist/_dev/native-account-session.js.map +1 -1
- package/dist/accounts/account-manager-core.d.ts +6 -0
- package/dist/accounts/account-manager-core.d.ts.map +1 -1
- package/dist/accounts/account-manager-core.js +26 -2
- package/dist/accounts/account-manager-core.js.map +1 -1
- package/dist/accounts/enrollment.d.ts.map +1 -1
- package/dist/accounts/enrollment.js +11 -4
- package/dist/accounts/enrollment.js.map +1 -1
- package/dist/accounts/exports.d.ts +1 -2
- package/dist/accounts/exports.d.ts.map +1 -1
- package/dist/accounts/exports.js +4 -1
- package/dist/accounts/exports.js.map +1 -1
- package/dist/accounts/persistence.d.ts +8 -0
- package/dist/accounts/persistence.d.ts.map +1 -1
- package/dist/accounts/persistence.js +12 -0
- package/dist/accounts/persistence.js.map +1 -1
- package/dist/accounts/registry-client.d.ts +20 -0
- package/dist/accounts/registry-client.d.ts.map +1 -1
- package/dist/accounts/registry-client.js +34 -0
- package/dist/accounts/registry-client.js.map +1 -1
- package/dist/accounts/state.d.ts.map +1 -1
- package/dist/accounts/state.js +2 -1
- package/dist/accounts/state.js.map +1 -1
- package/dist/backend/create-jazz-session.d.ts +9 -7
- package/dist/backend/create-jazz-session.d.ts.map +1 -1
- package/dist/backend/create-jazz-session.js +55 -17
- package/dist/backend/create-jazz-session.js.map +1 -1
- package/dist/backend/create-jazz.d.ts +122 -34
- package/dist/backend/create-jazz.d.ts.map +1 -1
- package/dist/backend/create-jazz.js +396 -101
- package/dist/backend/create-jazz.js.map +1 -1
- package/dist/backend/early-db.d.ts.map +1 -1
- package/dist/backend/early-db.js +1 -0
- package/dist/backend/early-db.js.map +1 -1
- package/dist/backend/from-jwt.d.ts +2 -2
- package/dist/backend/from-jwt.d.ts.map +1 -1
- package/dist/backend/from-jwt.js +7 -1
- package/dist/backend/from-jwt.js.map +1 -1
- package/dist/backend/index.d.ts +2 -1
- package/dist/backend/index.d.ts.map +1 -1
- package/dist/backend/index.js +3 -1
- package/dist/backend/index.js.map +1 -1
- package/dist/backend/inspect-ui.d.ts +14 -0
- package/dist/backend/inspect-ui.d.ts.map +1 -0
- package/dist/backend/inspect-ui.js +156 -0
- package/dist/backend/inspect-ui.js.map +1 -0
- package/dist/backend/inspect.d.ts +129 -0
- package/dist/backend/inspect.d.ts.map +1 -0
- package/dist/backend/inspect.js +763 -0
- package/dist/backend/inspect.js.map +1 -0
- package/dist/backend/inspector-ui/0.js +2 -0
- package/dist/backend/inspector-ui/1.js +2 -0
- package/dist/backend/inspector-ui/10.js +2 -0
- package/dist/backend/inspector-ui/11.js +2 -0
- package/dist/backend/inspector-ui/12.js +2 -0
- package/dist/backend/inspector-ui/13.js +2 -0
- package/dist/backend/inspector-ui/14.js +2 -0
- package/dist/backend/inspector-ui/15.js +2 -0
- package/dist/backend/inspector-ui/16.js +2 -0
- package/dist/backend/inspector-ui/17.js +2 -0
- package/dist/backend/inspector-ui/18.js +2 -0
- package/dist/backend/inspector-ui/19.js +2 -0
- package/dist/backend/inspector-ui/2.js +2 -0
- package/dist/backend/inspector-ui/20.js +2 -0
- package/dist/backend/inspector-ui/3.js +2 -0
- package/dist/backend/inspector-ui/4.js +2 -0
- package/dist/backend/inspector-ui/5.js +2 -0
- package/dist/backend/inspector-ui/6.js +2 -0
- package/dist/backend/inspector-ui/7.js +2 -0
- package/dist/backend/inspector-ui/8.js +2 -0
- package/dist/backend/inspector-ui/9.js +2 -0
- package/dist/backend/inspector-ui-files.d.ts +4 -0
- package/dist/backend/inspector-ui-files.d.ts.map +1 -0
- package/dist/backend/inspector-ui-files.js +25 -0
- package/dist/backend/session-expiry.d.ts +61 -0
- package/dist/backend/session-expiry.d.ts.map +1 -0
- package/dist/backend/session-expiry.js +102 -0
- package/dist/backend/session-expiry.js.map +1 -0
- package/dist/backend/upgrade-status.d.ts +19 -0
- package/dist/backend/upgrade-status.d.ts.map +1 -0
- package/dist/backend/upgrade-status.js +55 -0
- package/dist/backend/upgrade-status.js.map +1 -0
- package/dist/backend/vercel-sockets.d.ts +16 -0
- package/dist/backend/vercel-sockets.d.ts.map +1 -0
- package/dist/backend/vercel-sockets.js +24 -0
- package/dist/backend/vercel-sockets.js.map +1 -0
- package/dist/backend/vercel-store.d.ts.map +1 -1
- package/dist/backend/vercel-store.js +77 -10
- package/dist/backend/vercel-store.js.map +1 -1
- package/dist/classic-api.d.ts.map +1 -1
- package/dist/classic-api.js +36 -0
- package/dist/classic-api.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +30 -2
- package/dist/cli.js.map +1 -1
- package/dist/client/index.d.ts +2 -6
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +2 -3
- package/dist/client/index.js.map +1 -1
- package/dist/cloud/credentials.d.ts +1 -1
- package/dist/cloud/credentials.d.ts.map +1 -1
- package/dist/cloud/credentials.js.map +1 -1
- package/dist/dev/catalogue.d.ts +12 -0
- package/dist/dev/catalogue.d.ts.map +1 -1
- package/dist/dev/catalogue.js +31 -0
- package/dist/dev/catalogue.js.map +1 -1
- package/dist/dev/inspector-overlay/embedded/assets/backend-DHeT1LCS.css +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/backend-Dt5FYVfX.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/{create-legacy-browser-delegate-X_T_QKCN.js → create-legacy-browser-delegate-Bf58kV5i.js} +1 -1
- package/dist/dev/inspector-overlay/embedded/assets/esm-BQhYkCKN.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/{esm-aRzpnC3u.js → esm-CI6IodCN.js} +1 -1
- package/dist/dev/inspector-overlay/embedded/assets/{esm-ezD5H765.js → esm-D5aLlEYl.js} +1 -1
- package/dist/dev/inspector-overlay/embedded/assets/{esm-7mP3GQX4.js → esm-D_R-EGgt.js} +1 -1
- package/dist/dev/inspector-overlay/embedded/assets/{esm-BX6IY2Mv.js → esm-WihpI9g6.js} +1 -1
- package/dist/dev/inspector-overlay/embedded/assets/index-CjhxdwQ7.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/jazz-broker-worker-CaVlHITU.js +3 -0
- package/dist/dev/inspector-overlay/embedded/assets/{jazz-broker-worker-XRRxJUcx.js → jazz-broker-worker-D-HQuhdu.js} +160 -557
- package/dist/dev/inspector-overlay/embedded/assets/jazz_wasm-t1Mm3faf.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/{jazz_wasm_bg-KR7h3v27.wasm → jazz_wasm_bg-BazWJnU4.wasm} +0 -0
- package/dist/dev/inspector-overlay/embedded/assets/{index-C78Pprka.css → src-Cq8gSOLx.css} +1 -1
- package/dist/dev/inspector-overlay/embedded/assets/src-Dg6641Mj.js +22 -0
- package/dist/dev/inspector-overlay/embedded/assets/{trace-api-B5CaetI0.js → trace-api-BctnwbUf.js} +1 -1
- package/dist/dev/inspector-overlay/embedded/backend.html +16 -0
- package/dist/dev/inspector-overlay/embedded/embedded.html +3 -2
- package/dist/dev/inspector-overlay/host-bridge.d.ts.map +1 -1
- package/dist/dev/inspector-overlay/host-bridge.js +4 -1
- package/dist/dev/inspector-overlay/host-bridge.js.map +1 -1
- package/dist/dev/inspector-overlay/loader.d.ts +12 -1
- package/dist/dev/inspector-overlay/loader.d.ts.map +1 -1
- package/dist/dev/inspector-overlay/loader.js +31 -4
- package/dist/dev/inspector-overlay/loader.js.map +1 -1
- package/dist/drivers/schema-wire.d.ts +6 -2
- package/dist/drivers/schema-wire.d.ts.map +1 -1
- package/dist/drivers/schema-wire.js +6 -2
- package/dist/drivers/schema-wire.js.map +1 -1
- package/dist/effect/jazz.d.ts +12 -5
- package/dist/effect/jazz.d.ts.map +1 -1
- package/dist/effect/jazz.js +28 -5
- package/dist/effect/jazz.js.map +1 -1
- package/dist/expo/create-account-manager.d.ts +1 -1
- package/dist/expo/create-account-manager.d.ts.map +1 -1
- package/dist/expo/create-jazz-session.d.ts +37 -17
- package/dist/expo/create-jazz-session.d.ts.map +1 -1
- package/dist/expo/create-jazz-session.js +49 -10
- package/dist/expo/create-jazz-session.js.map +1 -1
- package/dist/expo/index.d.ts +5 -8
- package/dist/expo/index.d.ts.map +1 -1
- package/dist/expo/index.js +5 -7
- package/dist/expo/index.js.map +1 -1
- package/dist/expo/provider.d.ts +6 -3
- package/dist/expo/provider.d.ts.map +1 -1
- package/dist/expo/provider.js +7 -6
- package/dist/expo/provider.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/inspect/cli.d.ts +12 -0
- package/dist/inspect/cli.d.ts.map +1 -0
- package/dist/inspect/cli.js +292 -0
- package/dist/inspect/cli.js.map +1 -0
- package/dist/inspect/client.d.ts +60 -0
- package/dist/inspect/client.d.ts.map +1 -0
- package/dist/inspect/client.js +241 -0
- package/dist/inspect/client.js.map +1 -0
- package/dist/inspect/mcp.d.ts +17 -0
- package/dist/inspect/mcp.d.ts.map +1 -0
- package/dist/inspect/mcp.js +308 -0
- package/dist/inspect/mcp.js.map +1 -0
- package/dist/inspect/protocol.d.ts +218 -0
- package/dist/inspect/protocol.d.ts.map +1 -0
- package/dist/inspect/protocol.js +357 -0
- package/dist/inspect/protocol.js.map +1 -0
- package/dist/inspector/index.d.ts +10 -0
- package/dist/inspector/index.d.ts.map +1 -0
- package/dist/inspector/index.js +27 -0
- package/dist/inspector/index.js.map +1 -0
- package/dist/migrations.d.ts +1 -1
- package/dist/migrations.js +1 -1
- package/dist/migrations.js.map +1 -1
- package/dist/react/index.d.ts +4 -9
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +4 -6
- package/dist/react/index.js.map +1 -1
- package/dist/react/provider-props.d.ts +7 -0
- package/dist/react/provider-props.d.ts.map +1 -0
- package/dist/react/provider-props.js +15 -0
- package/dist/react/provider-props.js.map +1 -0
- package/dist/react/provider.d.ts +9 -15
- package/dist/react/provider.d.ts.map +1 -1
- package/dist/react/provider.js +19 -38
- package/dist/react/provider.js.map +1 -1
- package/dist/react-core/index.d.ts +3 -4
- package/dist/react-core/index.d.ts.map +1 -1
- package/dist/react-core/index.js +8 -4
- package/dist/react-core/index.js.map +1 -1
- package/dist/react-core/provider.d.ts +6 -6
- package/dist/react-core/provider.d.ts.map +1 -1
- package/dist/react-core/provider.js +5 -6
- package/dist/react-core/provider.js.map +1 -1
- package/dist/react-core/session.d.ts +41 -33
- package/dist/react-core/session.d.ts.map +1 -1
- package/dist/react-core/session.js +41 -89
- package/dist/react-core/session.js.map +1 -1
- package/dist/react-native/account-session.js +1 -1
- package/dist/react-native/account-session.js.map +1 -1
- package/dist/react-native/create-account-manager.d.ts +1 -1
- package/dist/react-native/create-account-manager.d.ts.map +1 -1
- package/dist/react-native/create-jazz-session.d.ts +37 -17
- package/dist/react-native/create-jazz-session.d.ts.map +1 -1
- package/dist/react-native/create-jazz-session.js +49 -10
- package/dist/react-native/create-jazz-session.js.map +1 -1
- package/dist/react-native/index.d.ts +5 -10
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js +5 -7
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/native-foreground-db.d.ts +7 -0
- package/dist/react-native/native-foreground-db.d.ts.map +1 -1
- package/dist/react-native/native-foreground-db.js +29 -0
- package/dist/react-native/native-foreground-db.js.map +1 -1
- package/dist/react-native/provider.d.ts +14 -19
- package/dist/react-native/provider.d.ts.map +1 -1
- package/dist/react-native/provider.js +19 -18
- package/dist/react-native/provider.js.map +1 -1
- package/dist/react-native/runtime-source.js +1 -1
- package/dist/react-native/runtime-source.js.map +1 -1
- package/dist/removed-api.d.ts +87 -0
- package/dist/removed-api.d.ts.map +1 -0
- package/dist/removed-api.js +95 -0
- package/dist/removed-api.js.map +1 -0
- package/dist/runtime/auth-secret-store.d.ts +0 -44
- package/dist/runtime/auth-secret-store.d.ts.map +1 -1
- package/dist/runtime/auth-secret-store.js +1 -103
- package/dist/runtime/auth-secret-store.js.map +1 -1
- package/dist/runtime/client.d.ts +10 -4
- package/dist/runtime/client.d.ts.map +1 -1
- package/dist/runtime/client.js.map +1 -1
- package/dist/runtime/connection-manager/browser-connection-manager.d.ts +4 -1
- package/dist/runtime/connection-manager/browser-connection-manager.d.ts.map +1 -1
- package/dist/runtime/connection-manager/browser-connection-manager.js +33 -2
- package/dist/runtime/connection-manager/browser-connection-manager.js.map +1 -1
- package/dist/runtime/connection-manager/types.d.ts +17 -2
- package/dist/runtime/connection-manager/types.d.ts.map +1 -1
- package/dist/runtime/connection-manager/types.js +19 -5
- package/dist/runtime/connection-manager/types.js.map +1 -1
- package/dist/runtime/credentialed-transport.d.ts +5 -2
- package/dist/runtime/credentialed-transport.d.ts.map +1 -1
- package/dist/runtime/credentialed-transport.js +12 -3
- package/dist/runtime/credentialed-transport.js.map +1 -1
- package/dist/runtime/db-replaced-error.d.ts +3 -1
- package/dist/runtime/db-replaced-error.d.ts.map +1 -1
- package/dist/runtime/db-replaced-error.js +4 -2
- package/dist/runtime/db-replaced-error.js.map +1 -1
- package/dist/runtime/db.d.ts +35 -7
- package/dist/runtime/db.d.ts.map +1 -1
- package/dist/runtime/db.js +65 -9
- package/dist/runtime/db.js.map +1 -1
- package/dist/runtime/index.d.ts +3 -4
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +1 -2
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/native-artifact-fingerprint-napi.d.ts +1 -1
- package/dist/runtime/native-artifact-fingerprint-napi.js +1 -1
- package/dist/runtime/native-artifact-fingerprint-napi.js.map +1 -1
- package/dist/runtime/native-artifact-fingerprint-wasm.d.ts +1 -1
- package/dist/runtime/native-artifact-fingerprint-wasm.js +1 -1
- package/dist/runtime/native-artifact-fingerprint-wasm.js.map +1 -1
- package/dist/runtime/native-artifact-fingerprints.d.ts +2 -2
- package/dist/runtime/native-runtime/attached-browser-worker-connection.d.ts +3 -1
- package/dist/runtime/native-runtime/attached-browser-worker-connection.d.ts.map +1 -1
- package/dist/runtime/native-runtime/attached-browser-worker-connection.js.map +1 -1
- package/dist/runtime/native-runtime/broker-worker-load-failure.d.ts +31 -0
- package/dist/runtime/native-runtime/broker-worker-load-failure.d.ts.map +1 -0
- package/dist/runtime/native-runtime/broker-worker-load-failure.js +66 -0
- package/dist/runtime/native-runtime/broker-worker-load-failure.js.map +1 -0
- package/dist/runtime/native-runtime/browser-follower-connection.d.ts +5 -1
- package/dist/runtime/native-runtime/browser-follower-connection.d.ts.map +1 -1
- package/dist/runtime/native-runtime/browser-follower-connection.js +4 -3
- package/dist/runtime/native-runtime/browser-follower-connection.js.map +1 -1
- package/dist/runtime/native-runtime/browser-shared-worker-connection.d.ts +3 -1
- package/dist/runtime/native-runtime/browser-shared-worker-connection.d.ts.map +1 -1
- package/dist/runtime/native-runtime/browser-shared-worker-connection.js +55 -4
- package/dist/runtime/native-runtime/browser-shared-worker-connection.js.map +1 -1
- package/dist/runtime/native-runtime/browser-worker-protocol.d.ts +5 -0
- package/dist/runtime/native-runtime/browser-worker-protocol.d.ts.map +1 -1
- package/dist/runtime/native-runtime/browser-worker-protocol.js.map +1 -1
- package/dist/runtime/native-runtime/http-stream-socket.d.ts +25 -7
- package/dist/runtime/native-runtime/http-stream-socket.d.ts.map +1 -1
- package/dist/runtime/native-runtime/http-stream-socket.js +56 -29
- package/dist/runtime/native-runtime/http-stream-socket.js.map +1 -1
- package/dist/runtime/native-runtime/native-runtime-adapter.d.ts +13 -5
- package/dist/runtime/native-runtime/native-runtime-adapter.d.ts.map +1 -1
- package/dist/runtime/native-runtime/native-runtime-adapter.js +38 -10
- package/dist/runtime/native-runtime/native-runtime-adapter.js.map +1 -1
- package/dist/runtime/native-runtime/websocket.d.ts +13 -0
- package/dist/runtime/native-runtime/websocket.d.ts.map +1 -1
- package/dist/runtime/native-runtime/websocket.js +23 -4
- package/dist/runtime/native-runtime/websocket.js.map +1 -1
- package/dist/runtime/page-handle.d.ts +87 -0
- package/dist/runtime/page-handle.d.ts.map +1 -0
- package/dist/runtime/page-handle.js +144 -0
- package/dist/runtime/page-handle.js.map +1 -0
- package/dist/runtime/removed-provider-props.d.ts +17 -0
- package/dist/runtime/removed-provider-props.d.ts.map +1 -0
- package/dist/runtime/removed-provider-props.js +16 -0
- package/dist/runtime/removed-provider-props.js.map +1 -0
- package/dist/runtime/runtime-source.d.ts +4 -1
- package/dist/runtime/runtime-source.d.ts.map +1 -1
- package/dist/runtime/runtime-source.js.map +1 -1
- package/dist/runtime/store-held-by-another-tab-error.d.ts +11 -0
- package/dist/runtime/store-held-by-another-tab-error.d.ts.map +1 -1
- package/dist/runtime/store-held-by-another-tab-error.js +11 -0
- package/dist/runtime/store-held-by-another-tab-error.js.map +1 -1
- package/dist/runtime/sync-status.d.ts +60 -1
- package/dist/runtime/sync-status.d.ts.map +1 -1
- package/dist/runtime/sync-status.js +64 -4
- package/dist/runtime/sync-status.js.map +1 -1
- package/dist/session/backend-watch.d.ts +53 -14
- package/dist/session/backend-watch.d.ts.map +1 -1
- package/dist/session/backend-watch.js +99 -22
- package/dist/session/backend-watch.js.map +1 -1
- package/dist/session/config-options.d.ts +15 -0
- package/dist/session/config-options.d.ts.map +1 -0
- package/dist/session/config-options.js +55 -0
- package/dist/session/config-options.js.map +1 -0
- package/dist/session/consumer.d.ts +1 -1
- package/dist/session/consumer.js +1 -1
- package/dist/session/consumer.js.map +1 -1
- package/dist/session/create-jazz-session.d.ts +57 -21
- package/dist/session/create-jazz-session.d.ts.map +1 -1
- package/dist/session/create-jazz-session.js +257 -58
- package/dist/session/create-jazz-session.js.map +1 -1
- package/dist/session/follow-user.d.ts +17 -7
- package/dist/session/follow-user.d.ts.map +1 -1
- package/dist/session/follow-user.js +23 -2
- package/dist/session/follow-user.js.map +1 -1
- package/dist/session/jazz-session.d.ts +164 -0
- package/dist/session/jazz-session.d.ts.map +1 -0
- package/dist/session/jazz-session.js +432 -0
- package/dist/session/jazz-session.js.map +1 -0
- package/dist/session/left-behind-replicas.d.ts +8 -1
- package/dist/session/left-behind-replicas.d.ts.map +1 -1
- package/dist/session/left-behind-replicas.js +21 -4
- package/dist/session/left-behind-replicas.js.map +1 -1
- package/dist/session/state.d.ts +20 -13
- package/dist/session/state.d.ts.map +1 -1
- package/dist/session/state.js +68 -23
- package/dist/session/state.js.map +1 -1
- package/dist/solid/index.d.ts +3 -9
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/index.js +8 -11
- package/dist/solid/index.ssr.js +3 -6
- package/dist/solid/provider.d.ts +3 -3
- package/dist/solid/provider.d.ts.map +1 -1
- package/dist/solid/provider.js +23 -39
- package/dist/solid/provider.js.map +1 -1
- package/dist/solid/provider.ssr.js +6 -23
- package/dist/solid/provider.ssr.js.map +1 -1
- package/dist/solid/session.d.ts +42 -12
- package/dist/solid/session.d.ts.map +1 -1
- package/dist/solid/session.js +82 -35
- package/dist/solid/session.js.map +1 -1
- package/dist/solid/session.ssr.js +85 -22
- package/dist/solid/session.ssr.js.map +1 -1
- package/dist/svelte/JazzProvider.svelte +54 -20
- package/dist/svelte/JazzProvider.svelte.d.ts +14 -4
- package/dist/svelte/JazzProvider.svelte.d.ts.map +1 -1
- package/dist/svelte/JazzSvelteClientProvider.svelte +1 -7
- package/dist/svelte/JazzSvelteClientProvider.svelte.d.ts +0 -1
- package/dist/svelte/JazzSvelteClientProvider.svelte.d.ts.map +1 -1
- package/dist/svelte/JazzSvelteProvider.svelte +5 -4
- package/dist/svelte/JazzSvelteProvider.svelte.d.ts +2 -2
- package/dist/svelte/JazzSvelteProvider.svelte.d.ts.map +1 -1
- package/dist/svelte/index.d.ts +4 -12
- package/dist/svelte/index.d.ts.map +1 -1
- package/dist/svelte/index.js +4 -8
- package/dist/svelte/session-state.d.ts +14 -4
- package/dist/svelte/session-state.d.ts.map +1 -1
- package/dist/svelte/session-state.js +10 -4
- package/dist/testing/policy-test-app.d.ts.map +1 -1
- package/dist/testing/policy-test-app.js +5 -4
- package/dist/testing/policy-test-app.js.map +1 -1
- package/dist/testing/test-jazz.d.ts +2 -2
- package/dist/testing/test-jazz.d.ts.map +1 -1
- package/dist/testing/test-jazz.js +5 -2
- package/dist/testing/test-jazz.js.map +1 -1
- package/dist/thin/index.d.ts +7 -10
- package/dist/thin/index.d.ts.map +1 -1
- package/dist/thin/index.js +28 -11
- package/dist/thin/index.js.map +1 -1
- package/dist/thin/thin-runtime.d.ts +22 -2
- package/dist/thin/thin-runtime.d.ts.map +1 -1
- package/dist/thin/thin-runtime.js +157 -24
- package/dist/thin/thin-runtime.js.map +1 -1
- package/dist/vue/index.d.ts +3 -8
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +3 -5
- package/dist/vue/index.js.map +1 -1
- package/dist/vue/provider.d.ts +6 -27
- package/dist/vue/provider.d.ts.map +1 -1
- package/dist/vue/provider.js +10 -19
- package/dist/vue/provider.js.map +1 -1
- package/dist/vue/session.d.ts +29 -28
- package/dist/vue/session.d.ts.map +1 -1
- package/dist/vue/session.js +79 -22
- package/dist/vue/session.js.map +1 -1
- package/dist/window-client-storage.d.ts +4 -30
- package/dist/window-client-storage.d.ts.map +1 -1
- package/dist/window-client-storage.js +2 -63
- package/dist/window-client-storage.js.map +1 -1
- package/dist/worker/jazz-broker-worker-core.d.ts.map +1 -1
- package/dist/worker/jazz-broker-worker-core.js +16 -19
- package/dist/worker/jazz-broker-worker-core.js.map +1 -1
- package/dist/worker/jazz-broker-worker.js +160 -557
- package/dist/worker/jazz_wasm_bg.wasm +0 -0
- package/dist/worker/runtime-admission.d.ts +19 -0
- package/dist/worker/runtime-admission.d.ts.map +1 -0
- package/dist/worker/runtime-admission.js +34 -0
- package/dist/worker/runtime-admission.js.map +1 -0
- package/package.json +18 -5
- package/dist/backend/session-recheck.d.ts +0 -18
- package/dist/backend/session-recheck.d.ts.map +0 -1
- package/dist/backend/session-recheck.js +0 -57
- package/dist/backend/session-recheck.js.map +0 -1
- package/dist/dev/inspector-overlay/embedded/assets/esm-k3rsq4Gn.js +0 -1
- package/dist/dev/inspector-overlay/embedded/assets/index-C-btvLcw.js +0 -20
- package/dist/dev/inspector-overlay/embedded/assets/jazz-broker-worker-CAMcDeUa.js +0 -3
- package/dist/dev/inspector-overlay/embedded/assets/jazz_wasm-Cc71x_6y.js +0 -1
- package/dist/dev/inspector-overlay/serve.d.ts +0 -46
- package/dist/dev/inspector-overlay/serve.d.ts.map +0 -1
- package/dist/dev/inspector-overlay/serve.js +0 -131
- package/dist/dev/inspector-overlay/serve.js.map +0 -1
- package/dist/dev-tools/auto-attach.d.ts +0 -11
- package/dist/dev-tools/auto-attach.d.ts.map +0 -1
- package/dist/dev-tools/auto-attach.js +0 -26
- package/dist/dev-tools/auto-attach.js.map +0 -1
- package/dist/expo/auth-secret-store.d.ts +0 -37
- package/dist/expo/auth-secret-store.d.ts.map +0 -1
- package/dist/expo/auth-secret-store.js +0 -139
- package/dist/expo/auth-secret-store.js.map +0 -1
- package/dist/expo/session.d.ts +0 -10
- package/dist/expo/session.d.ts.map +0 -1
- package/dist/expo/session.js +0 -5
- package/dist/expo/session.js.map +0 -1
- package/dist/expo/use-local-first-auth.d.ts +0 -12
- package/dist/expo/use-local-first-auth.d.ts.map +0 -1
- package/dist/expo/use-local-first-auth.js +0 -13
- package/dist/expo/use-local-first-auth.js.map +0 -1
- package/dist/react/devtools-auto-attach.d.ts +0 -2
- package/dist/react/devtools-auto-attach.d.ts.map +0 -1
- package/dist/react/devtools-auto-attach.js +0 -11
- package/dist/react/devtools-auto-attach.js.map +0 -1
- package/dist/react/session.d.ts +0 -18
- package/dist/react/session.d.ts.map +0 -1
- package/dist/react/session.js +0 -28
- package/dist/react/session.js.map +0 -1
- package/dist/react/use-local-first-auth.d.ts +0 -11
- package/dist/react/use-local-first-auth.d.ts.map +0 -1
- package/dist/react/use-local-first-auth.js +0 -13
- package/dist/react/use-local-first-auth.js.map +0 -1
- package/dist/react-core/app.d.ts +0 -31
- package/dist/react-core/app.d.ts.map +0 -1
- package/dist/react-core/app.js +0 -65
- package/dist/react-core/app.js.map +0 -1
- package/dist/react-core/use-account-state.d.ts +0 -4
- package/dist/react-core/use-account-state.d.ts.map +0 -1
- package/dist/react-core/use-account-state.js +0 -6
- package/dist/react-core/use-account-state.js.map +0 -1
- package/dist/react-core/use-local-first-auth.d.ts +0 -12
- package/dist/react-core/use-local-first-auth.d.ts.map +0 -1
- package/dist/react-core/use-local-first-auth.js +0 -14
- package/dist/react-core/use-local-first-auth.js.map +0 -1
- package/dist/react-native/session.d.ts +0 -10
- package/dist/react-native/session.d.ts.map +0 -1
- package/dist/react-native/session.js +0 -5
- package/dist/react-native/session.js.map +0 -1
- package/dist/react-native/use-local-first-auth.d.ts +0 -15
- package/dist/react-native/use-local-first-auth.d.ts.map +0 -1
- package/dist/react-native/use-local-first-auth.js +0 -14
- package/dist/react-native/use-local-first-auth.js.map +0 -1
- package/dist/runtime/local-first-auth-controller.d.ts +0 -29
- package/dist/runtime/local-first-auth-controller.d.ts.map +0 -1
- package/dist/runtime/local-first-auth-controller.js +0 -101
- package/dist/runtime/local-first-auth-controller.js.map +0 -1
- package/dist/session/app.d.ts +0 -58
- package/dist/session/app.d.ts.map +0 -1
- package/dist/session/app.js +0 -325
- package/dist/session/app.js.map +0 -1
- package/dist/session/create-jazz-app.d.ts +0 -11
- package/dist/session/create-jazz-app.d.ts.map +0 -1
- package/dist/session/create-jazz-app.js +0 -11
- package/dist/session/create-jazz-app.js.map +0 -1
- package/dist/solid/app.d.ts +0 -30
- package/dist/solid/app.d.ts.map +0 -1
- package/dist/solid/app.js +0 -95
- package/dist/solid/app.js.map +0 -1
- package/dist/solid/app.ssr.js +0 -109
- package/dist/solid/app.ssr.js.map +0 -1
- package/dist/solid/create-account-state.d.ts +0 -4
- package/dist/solid/create-account-state.d.ts.map +0 -1
- package/dist/solid/create-account-state.js +0 -10
- package/dist/solid/create-account-state.js.map +0 -1
- package/dist/solid/create-account-state.ssr.js +0 -12
- package/dist/solid/create-account-state.ssr.js.map +0 -1
- package/dist/solid/use-local-first-auth.d.ts +0 -11
- package/dist/solid/use-local-first-auth.d.ts.map +0 -1
- package/dist/solid/use-local-first-auth.js +0 -30
- package/dist/solid/use-local-first-auth.js.map +0 -1
- package/dist/solid/use-local-first-auth.ssr.js +0 -31
- package/dist/solid/use-local-first-auth.ssr.js.map +0 -1
- package/dist/svelte/JazzSessionClientProvider.svelte +0 -42
- package/dist/svelte/JazzSessionClientProvider.svelte.d.ts +0 -13
- package/dist/svelte/JazzSessionClientProvider.svelte.d.ts.map +0 -1
- package/dist/svelte/JazzSessionProvider.svelte +0 -68
- package/dist/svelte/JazzSessionProvider.svelte.d.ts +0 -19
- package/dist/svelte/JazzSessionProvider.svelte.d.ts.map +0 -1
- package/dist/svelte/account-state.d.ts +0 -5
- package/dist/svelte/account-state.d.ts.map +0 -1
- package/dist/svelte/account-state.js +0 -9
- package/dist/svelte/auth-state.d.ts +0 -23
- package/dist/svelte/auth-state.d.ts.map +0 -1
- package/dist/svelte/auth-state.js +0 -16
- package/dist/svelte/local-first-auth.svelte.d.ts +0 -50
- package/dist/svelte/local-first-auth.svelte.d.ts.map +0 -1
- package/dist/svelte/local-first-auth.svelte.js +0 -58
- package/dist/vue/app.d.ts +0 -76
- package/dist/vue/app.d.ts.map +0 -1
- package/dist/vue/app.js +0 -100
- package/dist/vue/app.js.map +0 -1
- package/dist/vue/use-account-state.d.ts +0 -5
- package/dist/vue/use-account-state.d.ts.map +0 -1
- package/dist/vue/use-account-state.js +0 -10
- package/dist/vue/use-account-state.js.map +0 -1
- package/dist/vue/use-local-first-auth.d.ts +0 -53
- package/dist/vue/use-local-first-auth.d.ts.map +0 -1
- package/dist/vue/use-local-first-auth.js +0 -67
- package/dist/vue/use-local-first-auth.js.map +0 -1
- /package/dist/dev/inspector-overlay/embedded/assets/{esm-CH5eVyQQ.js → esm-xNe3wI_B.js} +0 -0
- /package/dist/dev/inspector-overlay/embedded/assets/{node-foreground-node-lease.browser-Bm3gYjlT.js → node-foreground-node-lease.browser-CH8w-D6S.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-source.js","sourceRoot":"","sources":["../../src/react-native/runtime-source.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EACL,0BAA0B,EAC1B,eAAe,EACf,6BAA6B,EAC7B,6CAA6C,GAC9C,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAC3F,OAAO,EACL,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EACL,6CAA6C,EAC7C,2CAA2C,EAC3C,wCAAwC,GACzC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,kBAAkB,GAGnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAoBtD,SAAS,yBAAyB,CAAC,MAA2B;IAC5D,OAAO,CAAC,MAAM,CAAC,MAAM,E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AAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,SAAS,iBAAiB,CAAC,KAAsD;IAC/E,IAAI,CAAC,CAAC,KAAK,CAAC,UAAU,YAAY,UAAU,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,UAAU,KAAK,EAAE;QACjF,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["import \"./abort-signal.js\";\nimport { clientScope } from \"../runtime/client-scope.js\";\nimport { installNativeRuntimeEntropy } from \"../runtime/runtime-entropy.js\";\nimport type { RuntimeClientContext } from \"../runtime/runtime-source.js\";\nimport { RuntimeSource } from \"../runtime/runtime-source.js\";\nimport type { TextAnchors } from \"../runtime/text-anchors.js\";\nimport type { JazzClient } from \"../runtime/client.js\";\nimport { JazzClient as JazzRuntimeClient } from \"../runtime/client.js\";\nimport type { Session } from \"../runtime/context.js\";\nimport {\n markTrustedReservedSession,\n parseJwtPayload,\n internalSessionFromJwtPayload,\n internalSessionFromVerifiedReservedJwtPayload,\n} from \"../runtime/client-session.js\";\nimport type { AppContext } from \"../runtime/context.js\";\nimport type { DbConfig } from \"../runtime/db.js\";\nimport { NativeRuntimeAdapter } from \"../runtime/native-runtime/native-runtime-adapter.js\";\nimport {\n getTrustedReservedSession,\n setTrustedReservedSession,\n} from \"../runtime/db-internal-session.js\";\nimport { authorBytesForSession } from \"../runtime/author-id.js\";\nimport { accountConfigBearer, assertAccountConfig } from \"../accounts/config-capability.js\";\nimport {\n beginNativeAccountSession,\n attachNativeAccountSchema,\n resolveNativeSession,\n} from \"./account-session.js\";\nimport { serializeSchemaSource } from \"../drivers/schema-wire.js\";\nimport {\n REACT_NATIVE_MEMORY_RUNTIME_UNSUPPORTED_ERROR,\n REACT_NATIVE_NATIVE_RELAY_MEMORY_ONLY_ERROR,\n REACT_NATIVE_NATIVE_RELAY_REQUIRED_ERROR,\n} from \"./errors.js\";\nimport {\n NativeForegroundDb,\n type NativeForegroundFactory,\n type NativeForegroundModule,\n} from \"./native-foreground-db.js\";\nimport { importNativeRelay } from \"./native-relay.js\";\n\n/**\n * Opaque authority supplied by trusted native platform admission. It is\n * deliberately only a field of the React-Native client configuration: app\n * code must neither construct a scope nor use low-level foreground helpers.\n */\nexport type ReactNativeRelayConfig = Readonly<{\n capability: Uint8Array;\n}>;\n\nexport type ReactNativeDbConfig = DbConfig & {\n /**\n * Opaque authority issued by trusted native platform admission. The normal\n * persistent RN runtime consumes it through its installed JSI foreground\n * engine; application JavaScript cannot construct scope configuration.\n */\n nativeRelay?: ReactNativeRelayConfig;\n};\n\nfunction shouldRequireSqliteDriver(config: ReactNativeDbConfig): boolean {\n return (config.driver?.type ?? \"persistent\") === \"persistent\";\n}\n\nexport class ReactNativeRuntimeSource extends RuntimeSource<ReactNativeDbConfig> {\n private admittedSession: Session | null = null;\n private admittedCapability: Uint8Array | null = null;\n private foregroundModule: NativeForegroundModule | null = null;\n private foregroundFactory: NativeForegroundFactory | null = null;\n private lifecycleForeground: NativeForegroundDb | null = null;\n private pendingCapability: Uint8Array | null = null;\n private ownsAdmission = false;\n private explicitlyOffline = false;\n\n override textAnchors(): TextAnchors {\n const call = this.foregroundFactory?.textAnchors;\n if (!call) throw new Error(\"This React Native runtime does not support text anchors\");\n const run = (request: Record<string, unknown>) => JSON.parse(call(JSON.stringify(request)));\n return {\n captureAnchor: (text, position, side, version) =>\n run({ op: \"captureAnchor\", text, position, side, version }),\n resolveAnchor: (anchor, text, version) => run({ op: \"resolveAnchor\", anchor, text, version }),\n captureRange: (text, start, end, version) =>\n run({ op: \"captureRange\", text, start, end, version }),\n resolveRange: (range, text, version) => run({ op: \"resolveRange\", range, text, version }),\n };\n }\n\n override async load(config: ReactNativeDbConfig): Promise<void> {\n if (shouldRequireSqliteDriver(config)) {\n if (!config.nativeRelay && config.accountId && config.accountRegistryAuthority) {\n if (this.pendingCapability || this.admittedCapability) return;\n assertAccountConfig(config);\n const session = resolveNativeSession(config);\n const module = await importNativeRelay();\n const factory = module.installNativeForegroundRuntime();\n if (factory.accountSecret) installNativeRuntimeEntropy(factory.accountSecret);\n const bearer = config.cookieSession\n ? ((await accountConfigBearer(config)?.()) ?? undefined)\n : undefined;\n this.pendingCapability = beginNativeAccountSession(factory, config, session, bearer);\n this.foregroundFactory = factory;\n this.foregroundModule = module;\n this.ownsAdmission = true;\n this.admittedSession = markTrustedReservedSession({\n ...session,\n account_id: config.accountId,\n });\n this.nativeConnection = {\n configured: () => config.serverUrl !== undefined,\n disconnect: () => {\n this.explicitlyOffline = true;\n this.lifecycleForeground?.disconnectNativeUpstream();\n },\n reconnect: () => {\n this.explicitlyOffline = false;\n this.lifecycleForeground?.reconnectNativeUpstream();\n },\n };\n return;\n }\n if (config.nativeRelay) {\n if (this.admittedCapability) return;\n assertNativeRelay(config.nativeRelay);\n // Capture before the first await: caller-owned bytes must never select\n // a different scope after native identity preflight.\n const capability = new Uint8Array(config.nativeRelay.capability);\n const foreground = await importNativeRelay();\n this.foregroundFactory = foreground.installNativeForegroundRuntime();\n if (this.foregroundFactory.accountSecret)\n installNativeRuntimeEntropy(this.foregroundFactory.accountSecret);\n this.foregroundModule = foreground;\n const withForeground = <T>(run: (db: NativeForegroundDb) => T): T => {\n if (this.lifecycleForeground) return run(this.lifecycleForeground);\n // Connectivity is available before the lazy schema client exists.\n const temporary = new NativeForegroundDb(\n this.foregroundFactory!.openAttached(capability),\n foreground,\n );\n try {\n return run(temporary);\n } finally {\n temporary.close();\n }\n };\n const opened = new NativeForegroundDb(\n this.foregroundFactory.openAttached(capability),\n foreground,\n );\n try {\n const metadata = opened.nativeSessionMetadata();\n const selected = resolveNativeSession(config);\n if (\n metadata.accountId !== (config.accountId ?? null) ||\n (config.accountRegistryAuthority !== undefined &&\n metadata.registryAuthority !== config.accountRegistryAuthority) ||\n metadata.issuer !== selected.issuer ||\n metadata.userId !== selected.user_id\n ) {\n throw new Error(\n \"React Native admitted session does not match the selected account identity\",\n );\n }\n const configured = opened.nativeConnectionStatus().configured;\n // The admitted scope's transport configuration is immutable. Lifecycle\n // actions use the application owner, rather than opening a recovery\n // foreground merely to inspect or change connectivity.\n this.nativeConnection = {\n configured: () => configured,\n disconnect: () => withForeground((db) => db.disconnectNativeUpstream()),\n reconnect: () => withForeground((db) => db.reconnectNativeUpstream()),\n };\n this.admittedSession = markTrustedReservedSession({\n account_id: metadata.accountId ?? undefined,\n issuer: metadata.issuer,\n user_id: metadata.userId,\n claims: selected.claims,\n authMode:\n metadata.issuer === \"urn:jazz:local-first\"\n ? \"local-first\"\n : metadata.issuer === \"urn:jazz:anonymous\"\n ? \"anonymous\"\n : \"external\",\n });\n } finally {\n opened.close();\n }\n this.admittedCapability = capability;\n return;\n }\n throw new Error(REACT_NATIVE_NATIVE_RELAY_REQUIRED_ERROR);\n }\n\n if (config.nativeRelay) throw new Error(REACT_NATIVE_NATIVE_RELAY_MEMORY_ONLY_ERROR);\n // Do not delegate to DefaultRuntimeSource here. It is the browser/Node\n // implementation and imports the WASM runtime; Metro resolves that import\n // even for code paths that would never execute on a native device.\n throw new Error(REACT_NATIVE_MEMORY_RUNTIME_UNSUPPORTED_ERROR);\n }\n\n override assertAuthUpdateAllowed(): never {\n throw new Error(\n \"React Native authentication is native-admission bound; revoke the old native scope, admit the new scope, and create a new Db\",\n );\n }\n\n override admitConfig(config: ReactNativeDbConfig): void {\n if (!this.admittedSession) throw new Error(\"React Native native session is not admitted\");\n if (this.ownsAdmission) return;\n // The handle's JWT was checked against the native account/identity during\n // load. Keep its bearer representation: reserved local-first identities\n // deliberately cannot enter through the generic cookie-session path.\n // Native authority still comes exclusively from the admitted capability.\n setTrustedReservedSession(config, this.admittedSession);\n }\n\n override createClient(context: RuntimeClientContext<ReactNativeDbConfig>): JazzClient {\n if (this.pendingCapability) {\n const pending = this.pendingCapability;\n try {\n this.admittedCapability = attachNativeAccountSchema(\n this.foregroundFactory!,\n pending,\n serializeSchemaSource(context.schema),\n );\n } finally {\n this.pendingCapability = null;\n }\n }\n if (this.admittedCapability) {\n const factory = this.foregroundFactory;\n const module = this.foregroundModule;\n const capability = this.admittedCapability;\n if (!factory || !module)\n throw new Error(\"React Native native foreground runtime is not loaded\");\n const session = resolveNativeSession(context.config);\n const foreground = new NativeForegroundDb(factory.openAttached(capability), module);\n try {\n const metadata = foreground.nativeSessionMetadata();\n if (\n metadata.accountId !== (context.config.accountId ?? null) ||\n metadata.issuer !== session.issuer ||\n metadata.userId !== session.user_id ||\n (context.config.accountRegistryAuthority !== undefined &&\n metadata.registryAuthority !== context.config.accountRegistryAuthority)\n ) {\n throw new Error(\n \"React Native admitted session does not match the selected account identity\",\n );\n }\n if (this.explicitlyOffline) foreground.disconnectNativeUpstream();\n this.lifecycleForeground = foreground;\n const runtime = NativeRuntimeAdapter.fromDb(\n foreground,\n context.schema,\n metadata.node,\n authorBytesForSession(session),\n 1,\n false,\n {\n slowQueryLog: {\n appId: clientScope(context.config),\n thresholdMs: context.config.slowQueryThresholdMs,\n },\n },\n );\n const appContext: AppContext = {\n appId: clientScope(context.config),\n accountId: context.config.accountId,\n schema: context.schema,\n driver: context.config.driver,\n serverUrl: context.config.serverUrl,\n env: context.config.env,\n jwtToken: context.config.jwtToken,\n cookieSession: context.config.cookieSession,\n };\n setTrustedReservedSession(appContext, getTrustedReservedSession(context.config));\n return JazzRuntimeClient.connectWithRuntime(runtime, appContext, {\n onAuthFailure: context.onAuthFailure,\n });\n } catch (error) {\n this.lifecycleForeground = null;\n foreground.close();\n throw error;\n }\n }\n throw new Error(REACT_NATIVE_MEMORY_RUNTIME_UNSUPPORTED_ERROR);\n }\n\n override async shutdown(): Promise<void> {\n if (!this.ownsAdmission) return;\n const capability = this.admittedCapability ?? this.pendingCapability;\n if (capability) this.foregroundFactory!.releaseAccountSession!(capability);\n this.admittedCapability = null;\n this.pendingCapability = null;\n this.lifecycleForeground = null;\n this.ownsAdmission = false;\n }\n\n override refreshAccountToken(token: string): boolean {\n if (!this.ownsAdmission) this.assertAuthUpdateAllowed();\n const capability = this.admittedCapability ?? this.pendingCapability;\n if (!capability) throw new Error(\"React Native account context is closed\");\n const payload = parseJwtPayload(token);\n const session =\n payload?.iss === \"urn:jazz:local-first\"\n ? internalSessionFromVerifiedReservedJwtPayload(payload, \"local-first\")\n : payload && internalSessionFromJwtPayload(payload);\n if (!session) throw new Error(\"Invalid account refresh token\");\n this.foregroundFactory!.refreshAccountSession!(\n capability,\n JSON.stringify({ jwt: token, claims: session.claims }),\n );\n return true;\n }\n}\n\nfunction assertNativeRelay(relay: NonNullable<ReactNativeDbConfig[\"nativeRelay\"]>): void {\n if (!(relay.capability instanceof Uint8Array) || relay.capability.byteLength !== 32)\n throw new Error(REACT_NATIVE_NATIVE_RELAY_REQUIRED_ERROR);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"runtime-source.js","sourceRoot":"","sources":["../../src/react-native/runtime-source.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EACL,0BAA0B,EAC1B,eAAe,EACf,6BAA6B,EAC7B,6CAA6C,GAC9C,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAC3F,OAAO,EACL,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EA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ACvE,CAAC,CAAC,OAAO,IAAI,6BAA6B,CAAC,OAAO,CAAC,CAAC;QACxD,IAAI,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAC/D,IAAI,CAAC,iBAAkB,CAAC,qBAAsB,CAC5C,UAAU,EACV,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CACvD,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,SAAS,iBAAiB,CAAC,KAAsD;IAC/E,IAAI,CAAC,CAAC,KAAK,CAAC,UAAU,YAAY,UAAU,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,UAAU,KAAK,EAAE;QACjF,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["import \"./abort-signal.js\";\nimport { clientScope } from \"../runtime/client-scope.js\";\nimport { installNativeRuntimeEntropy } from \"../runtime/runtime-entropy.js\";\nimport type { RuntimeClientContext } from \"../runtime/runtime-source.js\";\nimport { RuntimeSource } from \"../runtime/runtime-source.js\";\nimport type { TextAnchors } from \"../runtime/text-anchors.js\";\nimport type { JazzClient } from \"../runtime/client.js\";\nimport { JazzClient as JazzRuntimeClient } from \"../runtime/client.js\";\nimport type { Session } from \"../runtime/context.js\";\nimport {\n markTrustedReservedSession,\n parseJwtPayload,\n internalSessionFromJwtPayload,\n internalSessionFromVerifiedReservedJwtPayload,\n} from \"../runtime/client-session.js\";\nimport type { AppContext } from \"../runtime/context.js\";\nimport type { DbConfig } from \"../runtime/db.js\";\nimport { NativeRuntimeAdapter } from \"../runtime/native-runtime/native-runtime-adapter.js\";\nimport {\n getTrustedReservedSession,\n setTrustedReservedSession,\n} from \"../runtime/db-internal-session.js\";\nimport { authorBytesForSession } from \"../runtime/author-id.js\";\nimport { accountConfigBearer, assertAccountConfig } from \"../accounts/config-capability.js\";\nimport {\n beginNativeAccountSession,\n attachNativeAccountSchema,\n resolveNativeSession,\n} from \"./account-session.js\";\nimport { serializeSchemaSource } from \"../drivers/schema-wire.js\";\nimport {\n REACT_NATIVE_MEMORY_RUNTIME_UNSUPPORTED_ERROR,\n REACT_NATIVE_NATIVE_RELAY_MEMORY_ONLY_ERROR,\n REACT_NATIVE_NATIVE_RELAY_REQUIRED_ERROR,\n} from \"./errors.js\";\nimport {\n NativeForegroundDb,\n type NativeForegroundFactory,\n type NativeForegroundModule,\n} from \"./native-foreground-db.js\";\nimport { importNativeRelay } from \"./native-relay.js\";\n\n/**\n * Opaque authority supplied by trusted native platform admission. It is\n * deliberately only a field of the React-Native client configuration: app\n * code must neither construct a scope nor use low-level foreground helpers.\n */\nexport type ReactNativeRelayConfig = Readonly<{\n capability: Uint8Array;\n}>;\n\nexport type ReactNativeDbConfig = DbConfig & {\n /**\n * Opaque authority issued by trusted native platform admission. The normal\n * persistent RN runtime consumes it through its installed JSI foreground\n * engine; application JavaScript cannot construct scope configuration.\n */\n nativeRelay?: ReactNativeRelayConfig;\n};\n\nfunction shouldRequireSqliteDriver(config: ReactNativeDbConfig): boolean {\n return (config.driver?.type ?? \"persistent\") === \"persistent\";\n}\n\nexport class ReactNativeRuntimeSource extends RuntimeSource<ReactNativeDbConfig> {\n private admittedSession: Session | null = null;\n private admittedCapability: Uint8Array | null = null;\n private foregroundModule: NativeForegroundModule | null = null;\n private foregroundFactory: NativeForegroundFactory | null = null;\n private lifecycleForeground: NativeForegroundDb | null = null;\n private pendingCapability: Uint8Array | null = null;\n private ownsAdmission = false;\n private explicitlyOffline = false;\n\n override textAnchors(): TextAnchors {\n const call = this.foregroundFactory?.textAnchors;\n if (!call) throw new Error(\"This React Native runtime does not support text anchors\");\n const run = (request: Record<string, unknown>) => JSON.parse(call(JSON.stringify(request)));\n return {\n captureAnchor: (text, position, side, version) =>\n run({ op: \"captureAnchor\", text, position, side, version }),\n resolveAnchor: (anchor, text, version) => run({ op: \"resolveAnchor\", anchor, text, version }),\n captureRange: (text, start, end, version) =>\n run({ op: \"captureRange\", text, start, end, version }),\n resolveRange: (range, text, version) => run({ op: \"resolveRange\", range, text, version }),\n };\n }\n\n override async load(config: ReactNativeDbConfig): Promise<void> {\n if (shouldRequireSqliteDriver(config)) {\n if (!config.nativeRelay && config.accountId && config.accountRegistryAuthority) {\n if (this.pendingCapability || this.admittedCapability) return;\n assertAccountConfig(config);\n const session = resolveNativeSession(config);\n const module = await importNativeRelay();\n const factory = module.installNativeForegroundRuntime();\n if (factory.accountSecret) installNativeRuntimeEntropy(factory.accountSecret);\n const bearer = config.cookieSession\n ? ((await accountConfigBearer(config)?.()) ?? undefined)\n : undefined;\n this.pendingCapability = beginNativeAccountSession(factory, config, session, bearer);\n this.foregroundFactory = factory;\n this.foregroundModule = module;\n this.ownsAdmission = true;\n this.admittedSession = markTrustedReservedSession({\n ...session,\n account_id: config.accountId,\n });\n this.nativeConnection = {\n configured: () => config.serverUrl !== undefined,\n disconnect: () => {\n this.explicitlyOffline = true;\n this.lifecycleForeground?.disconnectNativeUpstream();\n },\n reconnect: () => {\n this.explicitlyOffline = false;\n this.lifecycleForeground?.reconnectNativeUpstream();\n },\n };\n return;\n }\n if (config.nativeRelay) {\n if (this.admittedCapability) return;\n assertNativeRelay(config.nativeRelay);\n // Capture before the first await: caller-owned bytes must never select\n // a different scope after native identity preflight.\n const capability = new Uint8Array(config.nativeRelay.capability);\n const foreground = await importNativeRelay();\n this.foregroundFactory = foreground.installNativeForegroundRuntime();\n if (this.foregroundFactory.accountSecret)\n installNativeRuntimeEntropy(this.foregroundFactory.accountSecret);\n this.foregroundModule = foreground;\n const withForeground = <T>(run: (db: NativeForegroundDb) => T): T => {\n if (this.lifecycleForeground) return run(this.lifecycleForeground);\n // Connectivity is available before the lazy schema client exists.\n const temporary = new NativeForegroundDb(\n this.foregroundFactory!.openAttached(capability),\n foreground,\n );\n try {\n return run(temporary);\n } finally {\n temporary.close();\n }\n };\n const opened = new NativeForegroundDb(\n this.foregroundFactory.openAttached(capability),\n foreground,\n );\n try {\n const metadata = opened.nativeSessionMetadata();\n const selected = resolveNativeSession(config);\n if (\n metadata.accountId !== (config.accountId ?? null) ||\n (config.accountRegistryAuthority !== undefined &&\n metadata.registryAuthority !== config.accountRegistryAuthority) ||\n metadata.issuer !== selected.issuer ||\n metadata.userId !== selected.user_id\n ) {\n throw new Error(\n \"React Native admitted session does not match the selected account identity\",\n );\n }\n const configured = opened.nativeConnectionStatus().configured;\n // The admitted scope's transport configuration is immutable. Lifecycle\n // actions use the application owner, rather than opening a recovery\n // foreground merely to inspect or change connectivity.\n this.nativeConnection = {\n configured: () => configured,\n disconnect: () => withForeground((db) => db.disconnectNativeUpstream()),\n reconnect: () => withForeground((db) => db.reconnectNativeUpstream()),\n };\n this.admittedSession = markTrustedReservedSession({\n account_id: metadata.accountId ?? undefined,\n issuer: metadata.issuer,\n user_id: metadata.userId,\n claims: selected.claims,\n authMode:\n metadata.issuer === \"urn:jazz:local-first\"\n ? \"local-first\"\n : metadata.issuer === \"urn:jazz:anonymous\"\n ? \"anonymous\"\n : \"external\",\n });\n } finally {\n opened.close();\n }\n this.admittedCapability = capability;\n return;\n }\n throw new Error(REACT_NATIVE_NATIVE_RELAY_REQUIRED_ERROR);\n }\n\n if (config.nativeRelay) throw new Error(REACT_NATIVE_NATIVE_RELAY_MEMORY_ONLY_ERROR);\n // Do not delegate to DefaultRuntimeSource here. It is the browser/Node\n // implementation and imports the WASM runtime; Metro resolves that import\n // even for code paths that would never execute on a native device.\n throw new Error(REACT_NATIVE_MEMORY_RUNTIME_UNSUPPORTED_ERROR);\n }\n\n override assertAuthUpdateAllowed(): never {\n throw new Error(\n \"React Native authentication is native-admission bound; revoke the old native scope, admit the new scope, and create a new Db\",\n );\n }\n\n override admitConfig(config: ReactNativeDbConfig): void {\n if (!this.admittedSession) throw new Error(\"React Native native session is not admitted\");\n if (this.ownsAdmission) return;\n // The handle's JWT was checked against the native account/identity during\n // load. Keep its bearer representation: reserved local-first identities\n // deliberately cannot enter through the generic cookie-session path.\n // Native authority still comes exclusively from the admitted capability.\n setTrustedReservedSession(config, this.admittedSession);\n }\n\n override createClient(context: RuntimeClientContext<ReactNativeDbConfig>): JazzClient {\n if (this.pendingCapability) {\n const pending = this.pendingCapability;\n try {\n this.admittedCapability = attachNativeAccountSchema(\n this.foregroundFactory!,\n pending,\n serializeSchemaSource(context.schema, context.migrations),\n );\n } finally {\n this.pendingCapability = null;\n }\n }\n if (this.admittedCapability) {\n const factory = this.foregroundFactory;\n const module = this.foregroundModule;\n const capability = this.admittedCapability;\n if (!factory || !module)\n throw new Error(\"React Native native foreground runtime is not loaded\");\n const session = resolveNativeSession(context.config);\n const foreground = new NativeForegroundDb(factory.openAttached(capability), module);\n try {\n const metadata = foreground.nativeSessionMetadata();\n if (\n metadata.accountId !== (context.config.accountId ?? null) ||\n metadata.issuer !== session.issuer ||\n metadata.userId !== session.user_id ||\n (context.config.accountRegistryAuthority !== undefined &&\n metadata.registryAuthority !== context.config.accountRegistryAuthority)\n ) {\n throw new Error(\n \"React Native admitted session does not match the selected account identity\",\n );\n }\n if (this.explicitlyOffline) foreground.disconnectNativeUpstream();\n this.lifecycleForeground = foreground;\n const runtime = NativeRuntimeAdapter.fromDb(\n foreground,\n context.schema,\n metadata.node,\n authorBytesForSession(session),\n 1,\n false,\n {\n slowQueryLog: {\n appId: clientScope(context.config),\n thresholdMs: context.config.slowQueryThresholdMs,\n },\n },\n );\n const appContext: AppContext = {\n appId: clientScope(context.config),\n accountId: context.config.accountId,\n schema: context.schema,\n driver: context.config.driver,\n serverUrl: context.config.serverUrl,\n env: context.config.env,\n jwtToken: context.config.jwtToken,\n cookieSession: context.config.cookieSession,\n };\n setTrustedReservedSession(appContext, getTrustedReservedSession(context.config));\n return JazzRuntimeClient.connectWithRuntime(runtime, appContext, {\n onAuthFailure: context.onAuthFailure,\n });\n } catch (error) {\n this.lifecycleForeground = null;\n foreground.close();\n throw error;\n }\n }\n throw new Error(REACT_NATIVE_MEMORY_RUNTIME_UNSUPPORTED_ERROR);\n }\n\n override async shutdown(): Promise<void> {\n if (!this.ownsAdmission) return;\n const capability = this.admittedCapability ?? this.pendingCapability;\n if (capability) this.foregroundFactory!.releaseAccountSession!(capability);\n this.admittedCapability = null;\n this.pendingCapability = null;\n this.lifecycleForeground = null;\n this.ownsAdmission = false;\n }\n\n override refreshAccountToken(token: string): boolean {\n if (!this.ownsAdmission) this.assertAuthUpdateAllowed();\n const capability = this.admittedCapability ?? this.pendingCapability;\n if (!capability) throw new Error(\"React Native account context is closed\");\n const payload = parseJwtPayload(token);\n const session =\n payload?.iss === \"urn:jazz:local-first\"\n ? internalSessionFromVerifiedReservedJwtPayload(payload, \"local-first\")\n : payload && internalSessionFromJwtPayload(payload);\n if (!session) throw new Error(\"Invalid account refresh token\");\n this.foregroundFactory!.refreshAccountSession!(\n capability,\n JSON.stringify({ jwt: token, claims: session.claims }),\n );\n return true;\n }\n}\n\nfunction assertNativeRelay(relay: NonNullable<ReactNativeDbConfig[\"nativeRelay\"]>): void {\n if (!(relay.capability instanceof Uint8Array) || relay.capability.byteLength !== 32)\n throw new Error(REACT_NATIVE_NATIVE_RELAY_REQUIRED_ERROR);\n}\n"]}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Names alpha.60 exported and alpha.61 removed (the session replaced them),
|
|
3
|
+
* kept for one release as stubs that throw when used, naming what replaced
|
|
4
|
+
* them. Without them a bundler's "not exported" error guesses a similarly
|
|
5
|
+
* named export (Turbopack suggests `useJazzClient` for `useJazzAuth`), which
|
|
6
|
+
* is the wrong one. They are not working aliases.
|
|
7
|
+
*
|
|
8
|
+
* Each is typed so TypeScript shows it too: `@deprecated` with the
|
|
9
|
+
* replacement where it is declared, and parameters of type `never`, so a call
|
|
10
|
+
* with arguments doesn't type-check.
|
|
11
|
+
*/
|
|
12
|
+
/** Where the alpha.60 → alpha.61 changes are written up. */
|
|
13
|
+
export declare const UPGRADE_FROM_ALPHA_60_URL = "https://jazz.tools/docs/operating/backups-and-upgrades#upgrading-from-alpha60";
|
|
14
|
+
declare const removedApi: unique symbol;
|
|
15
|
+
/** A removed export: calling or constructing it throws, naming its replacement. */
|
|
16
|
+
export type RemovedApi = ((...args: never[]) => never) & (new (...args: never[]) => never) & {
|
|
17
|
+
readonly [removedApi]: never;
|
|
18
|
+
};
|
|
19
|
+
/** The error a removed export throws. `code` is `JAZZ_API_REMOVED`. */
|
|
20
|
+
export declare function removedApiError(name: string, replacement: string): Error;
|
|
21
|
+
/** @internal A stub for a removed export: throws when called or constructed. */
|
|
22
|
+
export declare function removed(name: string, replacement: string): RemovedApi;
|
|
23
|
+
/** What replaced each removed name. */
|
|
24
|
+
export declare const REPLACED: {
|
|
25
|
+
readonly useJazzAuth: "useJazzSession() (Svelte: getJazzSession()): the session, who is signed in, and its operations";
|
|
26
|
+
readonly useJazzSessionOwner: "useJazzSession() (Svelte: getJazzSession()): the session, who is signed in, and its operations";
|
|
27
|
+
readonly useAccountState: "useJazzSession() (Svelte: getJazzSession()): the session, who is signed in, and its operations";
|
|
28
|
+
readonly createAccountState: "useJazzSession() (the session's snapshot is reactive)";
|
|
29
|
+
readonly createJazzSessionState: "useJazzSession()";
|
|
30
|
+
readonly accountState: "getJazzSession()";
|
|
31
|
+
readonly createAccountManager: "createJazzClient(config) (the session signs in itself: initial: \"device\", createDeviceAccount(), or your backend's user)";
|
|
32
|
+
readonly AccountManager: "createJazzClient(config) (the session signs in itself: initial: \"device\", createDeviceAccount(), or your backend's user)";
|
|
33
|
+
readonly createDb: "createJazzClient(config), then session.db";
|
|
34
|
+
readonly createJazzApp: "createJazzClient(config), or <JazzProvider config={…}>";
|
|
35
|
+
readonly exportLocalFirstSecret: "session.exportDeviceKey()";
|
|
36
|
+
readonly useLocalFirstAuth: "device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key)";
|
|
37
|
+
readonly createUseLocalFirstAuth: "device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key)";
|
|
38
|
+
readonly LocalFirstAuth: "device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key)";
|
|
39
|
+
readonly BrowserAuthSecretStore: "device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key)";
|
|
40
|
+
readonly ExpoAuthSecretStore: "device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key)";
|
|
41
|
+
readonly expoAuthSecretStore: "device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key)";
|
|
42
|
+
readonly JazzSessionProvider: "<JazzProvider session={session}>";
|
|
43
|
+
readonly JazzSvelteProvider: "<JazzProvider config={…}>, or <JazzSvelteClientProvider client> for a client you opened yourself";
|
|
44
|
+
readonly acceptLocalFirstAuth: "acceptDeviceAccounts";
|
|
45
|
+
};
|
|
46
|
+
/** @deprecated Removed in alpha.61, and throws when used: use useJazzSession() (Svelte: getJazzSession()): the session, who is signed in, and its operations. */
|
|
47
|
+
export declare const useJazzAuth: RemovedApi;
|
|
48
|
+
/** @deprecated Removed in alpha.61, and throws when used: use useJazzSession() (Svelte: getJazzSession()): the session, who is signed in, and its operations. */
|
|
49
|
+
export declare const useJazzSessionOwner: RemovedApi;
|
|
50
|
+
/** @deprecated Removed in alpha.61, and throws when used: use useJazzSession() (Svelte: getJazzSession()): the session, who is signed in, and its operations. */
|
|
51
|
+
export declare const useAccountState: RemovedApi;
|
|
52
|
+
/** @deprecated Removed in alpha.61, and throws when used: use useJazzSession() (the session's snapshot is reactive). */
|
|
53
|
+
export declare const createAccountState: RemovedApi;
|
|
54
|
+
/** @deprecated Removed in alpha.61, and throws when used: use useJazzSession(). */
|
|
55
|
+
export declare const createJazzSessionState: RemovedApi;
|
|
56
|
+
/** @deprecated Removed in alpha.61, and throws when used: use getJazzSession(). */
|
|
57
|
+
export declare const accountState: RemovedApi;
|
|
58
|
+
/** @deprecated Removed in alpha.61, and throws when used: use createJazzClient(config) (the session signs in itself: initial: "device", createDeviceAccount(), or your backend's user). */
|
|
59
|
+
export declare const createAccountManager: RemovedApi;
|
|
60
|
+
/** @deprecated Removed in alpha.61, and throws when used: use createJazzClient(config) (the session signs in itself: initial: "device", createDeviceAccount(), or your backend's user). */
|
|
61
|
+
export declare const AccountManager: RemovedApi;
|
|
62
|
+
/** @deprecated Removed in alpha.61, and throws when used: use createJazzClient(config), then session.db. */
|
|
63
|
+
export declare const createDb: RemovedApi;
|
|
64
|
+
/** @deprecated Removed in alpha.61, and throws when used: use createJazzClient(config), or <JazzProvider config={…}>. */
|
|
65
|
+
export declare const createJazzApp: RemovedApi;
|
|
66
|
+
/** @deprecated Removed in alpha.61, and throws when used: use session.exportDeviceKey(). */
|
|
67
|
+
export declare const exportLocalFirstSecret: RemovedApi;
|
|
68
|
+
/** @deprecated Removed in alpha.61, and throws when used: use device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key). */
|
|
69
|
+
export declare const useLocalFirstAuth: RemovedApi;
|
|
70
|
+
/** @deprecated Removed in alpha.61, and throws when used: use device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key). */
|
|
71
|
+
export declare const createUseLocalFirstAuth: RemovedApi;
|
|
72
|
+
/** @deprecated Removed in alpha.61, and throws when used: use device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key). */
|
|
73
|
+
export declare const LocalFirstAuth: RemovedApi;
|
|
74
|
+
/** @deprecated Removed in alpha.61, and throws when used: use device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key). */
|
|
75
|
+
export declare const BrowserAuthSecretStore: RemovedApi;
|
|
76
|
+
/** @deprecated Removed in alpha.61, and throws when used: use device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key). */
|
|
77
|
+
export declare const ExpoAuthSecretStore: RemovedApi;
|
|
78
|
+
/** @deprecated Removed in alpha.61, and throws when used: use device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key). */
|
|
79
|
+
export declare const expoAuthSecretStore: RemovedApi;
|
|
80
|
+
/** @deprecated Removed in alpha.61, and throws when used: use <JazzProvider session={session}>. */
|
|
81
|
+
export declare const JazzSessionProvider: RemovedApi;
|
|
82
|
+
/** @deprecated Removed in alpha.61, and throws when used: use <JazzProvider config={…}>, or <JazzSvelteClientProvider client> for a client you opened yourself. */
|
|
83
|
+
export declare const JazzSvelteProvider: RemovedApi;
|
|
84
|
+
/** @deprecated Removed in alpha.61, and throws when used: use acceptDeviceAccounts. */
|
|
85
|
+
export declare const acceptLocalFirstAuth: RemovedApi;
|
|
86
|
+
export {};
|
|
87
|
+
//# sourceMappingURL=removed-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removed-api.d.ts","sourceRoot":"","sources":["../src/removed-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,4DAA4D;AAC5D,eAAO,MAAM,yBAAyB,kFAC2C,CAAC;AAElF,OAAO,CAAC,MAAM,UAAU,EAAE,OAAO,MAAM,CAAC;AAExC,mFAAmF;AACnF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,GACpD,CAAC,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,GAAG;IAAE,QAAQ,CAAC,CAAC,UAAU,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAEvE,uEAAuE;AACvE,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,KAAK,CAOxE;AAED,gFAAgF;AAChF,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,UAAU,CAQrE;AASD,uCAAuC;AACvC,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;CAsBX,CAAC;AAGX,iK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ported and alpha.61 removed (the session replaced them),
|
|
3
|
+
* kept for one release as stubs that throw when used, naming what replaced
|
|
4
|
+
* them. Without them a bundler's "not exported" error guesses a similarly
|
|
5
|
+
* named export (Turbopack suggests `useJazzClient` for `useJazzAuth`), which
|
|
6
|
+
* is the wrong one. They are not working aliases.
|
|
7
|
+
*
|
|
8
|
+
* Each is typed so TypeScript shows it too: `@deprecated` with the
|
|
9
|
+
* replacement where it is declared, and parameters of type `never`, so a call
|
|
10
|
+
* with arguments doesn't type-check.
|
|
11
|
+
*/
|
|
12
|
+
/** Where the alpha.60 → alpha.61 changes are written up. */
|
|
13
|
+
export const UPGRADE_FROM_ALPHA_60_URL = "https://jazz.tools/docs/operating/backups-and-upgrades#upgrading-from-alpha60";
|
|
14
|
+
/** The error a removed export throws. `code` is `JAZZ_API_REMOVED`. */
|
|
15
|
+
export function removedApiError(name, replacement) {
|
|
16
|
+
return Object.assign(new Error(`[JAZZ_API_REMOVED] ${name} was removed in jazz-tools alpha.61: use ${replacement}. See ${UPGRADE_FROM_ALPHA_60_URL}`), { code: "JAZZ_API_REMOVED" });
|
|
17
|
+
}
|
|
18
|
+
/** @internal A stub for a removed export: throws when called or constructed. */
|
|
19
|
+
export function removed(name, replacement) {
|
|
20
|
+
// A plain function (not a Proxy): React and Fast Refresh inspect exports,
|
|
21
|
+
// which must stay inert. Calling or constructing it throws.
|
|
22
|
+
const stub = function removedJazzApi() {
|
|
23
|
+
throw removedApiError(name, replacement);
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(stub, "name", { value: name });
|
|
26
|
+
return stub;
|
|
27
|
+
}
|
|
28
|
+
const SESSION_HOOK = "useJazzSession() (Svelte: getJazzSession()): the session, who is signed in, and its operations";
|
|
29
|
+
const SESSION = 'createJazzClient(config) (the session signs in itself: initial: "device", createDeviceAccount(), or your backend\'s user)';
|
|
30
|
+
const DEVICE_ACCOUNTS = "device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key)";
|
|
31
|
+
/** What replaced each removed name. */
|
|
32
|
+
export const REPLACED = {
|
|
33
|
+
useJazzAuth: SESSION_HOOK,
|
|
34
|
+
useJazzSessionOwner: SESSION_HOOK,
|
|
35
|
+
useAccountState: SESSION_HOOK,
|
|
36
|
+
createAccountState: "useJazzSession() (the session's snapshot is reactive)",
|
|
37
|
+
createJazzSessionState: "useJazzSession()",
|
|
38
|
+
accountState: "getJazzSession()",
|
|
39
|
+
createAccountManager: SESSION,
|
|
40
|
+
AccountManager: SESSION,
|
|
41
|
+
createDb: "createJazzClient(config), then session.db",
|
|
42
|
+
createJazzApp: "createJazzClient(config), or <JazzProvider config={…}>",
|
|
43
|
+
exportLocalFirstSecret: "session.exportDeviceKey()",
|
|
44
|
+
useLocalFirstAuth: DEVICE_ACCOUNTS,
|
|
45
|
+
createUseLocalFirstAuth: DEVICE_ACCOUNTS,
|
|
46
|
+
LocalFirstAuth: DEVICE_ACCOUNTS,
|
|
47
|
+
BrowserAuthSecretStore: DEVICE_ACCOUNTS,
|
|
48
|
+
ExpoAuthSecretStore: DEVICE_ACCOUNTS,
|
|
49
|
+
expoAuthSecretStore: DEVICE_ACCOUNTS,
|
|
50
|
+
JazzSessionProvider: "<JazzProvider session={session}>",
|
|
51
|
+
JazzSvelteProvider: "<JazzProvider config={…}>, or <JazzSvelteClientProvider client> for a client you opened yourself",
|
|
52
|
+
acceptLocalFirstAuth: "acceptDeviceAccounts",
|
|
53
|
+
};
|
|
54
|
+
// The stubs. Each entry point re-exports the ones it exported in alpha.60.
|
|
55
|
+
/** @deprecated Removed in alpha.61, and throws when used: use useJazzSession() (Svelte: getJazzSession()): the session, who is signed in, and its operations. */
|
|
56
|
+
export const useJazzAuth = /*#__PURE__*/ removed("useJazzAuth", REPLACED.useJazzAuth);
|
|
57
|
+
/** @deprecated Removed in alpha.61, and throws when used: use useJazzSession() (Svelte: getJazzSession()): the session, who is signed in, and its operations. */
|
|
58
|
+
export const useJazzSessionOwner = /*#__PURE__*/ removed("useJazzSessionOwner", REPLACED.useJazzSessionOwner);
|
|
59
|
+
/** @deprecated Removed in alpha.61, and throws when used: use useJazzSession() (Svelte: getJazzSession()): the session, who is signed in, and its operations. */
|
|
60
|
+
export const useAccountState = /*#__PURE__*/ removed("useAccountState", REPLACED.useAccountState);
|
|
61
|
+
/** @deprecated Removed in alpha.61, and throws when used: use useJazzSession() (the session's snapshot is reactive). */
|
|
62
|
+
export const createAccountState = /*#__PURE__*/ removed("createAccountState", REPLACED.createAccountState);
|
|
63
|
+
/** @deprecated Removed in alpha.61, and throws when used: use useJazzSession(). */
|
|
64
|
+
export const createJazzSessionState = /*#__PURE__*/ removed("createJazzSessionState", REPLACED.createJazzSessionState);
|
|
65
|
+
/** @deprecated Removed in alpha.61, and throws when used: use getJazzSession(). */
|
|
66
|
+
export const accountState = /*#__PURE__*/ removed("accountState", REPLACED.accountState);
|
|
67
|
+
/** @deprecated Removed in alpha.61, and throws when used: use createJazzClient(config) (the session signs in itself: initial: "device", createDeviceAccount(), or your backend's user). */
|
|
68
|
+
export const createAccountManager = /*#__PURE__*/ removed("createAccountManager", REPLACED.createAccountManager);
|
|
69
|
+
/** @deprecated Removed in alpha.61, and throws when used: use createJazzClient(config) (the session signs in itself: initial: "device", createDeviceAccount(), or your backend's user). */
|
|
70
|
+
export const AccountManager = /*#__PURE__*/ removed("AccountManager", REPLACED.AccountManager);
|
|
71
|
+
/** @deprecated Removed in alpha.61, and throws when used: use createJazzClient(config), then session.db. */
|
|
72
|
+
export const createDb = /*#__PURE__*/ removed("createDb", REPLACED.createDb);
|
|
73
|
+
/** @deprecated Removed in alpha.61, and throws when used: use createJazzClient(config), or <JazzProvider config={…}>. */
|
|
74
|
+
export const createJazzApp = /*#__PURE__*/ removed("createJazzApp", REPLACED.createJazzApp);
|
|
75
|
+
/** @deprecated Removed in alpha.61, and throws when used: use session.exportDeviceKey(). */
|
|
76
|
+
export const exportLocalFirstSecret = /*#__PURE__*/ removed("exportLocalFirstSecret", REPLACED.exportLocalFirstSecret);
|
|
77
|
+
/** @deprecated Removed in alpha.61, and throws when used: use device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key). */
|
|
78
|
+
export const useLocalFirstAuth = /*#__PURE__*/ removed("useLocalFirstAuth", REPLACED.useLocalFirstAuth);
|
|
79
|
+
/** @deprecated Removed in alpha.61, and throws when used: use device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key). */
|
|
80
|
+
export const createUseLocalFirstAuth = /*#__PURE__*/ removed("createUseLocalFirstAuth", REPLACED.createUseLocalFirstAuth);
|
|
81
|
+
/** @deprecated Removed in alpha.61, and throws when used: use device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key). */
|
|
82
|
+
export const LocalFirstAuth = /*#__PURE__*/ removed("LocalFirstAuth", REPLACED.LocalFirstAuth);
|
|
83
|
+
/** @deprecated Removed in alpha.61, and throws when used: use device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key). */
|
|
84
|
+
export const BrowserAuthSecretStore = /*#__PURE__*/ removed("BrowserAuthSecretStore", REPLACED.BrowserAuthSecretStore);
|
|
85
|
+
/** @deprecated Removed in alpha.61, and throws when used: use device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key). */
|
|
86
|
+
export const ExpoAuthSecretStore = /*#__PURE__*/ removed("ExpoAuthSecretStore", REPLACED.ExpoAuthSecretStore);
|
|
87
|
+
/** @deprecated Removed in alpha.61, and throws when used: use device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key). */
|
|
88
|
+
export const expoAuthSecretStore = /*#__PURE__*/ removed("expoAuthSecretStore", REPLACED.expoAuthSecretStore);
|
|
89
|
+
/** @deprecated Removed in alpha.61, and throws when used: use <JazzProvider session={session}>. */
|
|
90
|
+
export const JazzSessionProvider = /*#__PURE__*/ removed("JazzSessionProvider", REPLACED.JazzSessionProvider);
|
|
91
|
+
/** @deprecated Removed in alpha.61, and throws when used: use <JazzProvider config={…}>, or <JazzSvelteClientProvider client> for a client you opened yourself. */
|
|
92
|
+
export const JazzSvelteProvider = /*#__PURE__*/ removed("JazzSvelteProvider", REPLACED.JazzSvelteProvider);
|
|
93
|
+
/** @deprecated Removed in alpha.61, and throws when used: use acceptDeviceAccounts. */
|
|
94
|
+
export const acceptLocalFirstAuth = /*#__PURE__*/ removed("acceptLocalFirstAuth", REPLACED.acceptLocalFirstAuth);
|
|
95
|
+
//# sourceMappingURL=removed-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removed-api.js","sourceRoot":"","sources":["../src/removed-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,yBAAyB,GACpC,+EAA+E,CAAC;AAQlF,uEAAuE;AACvE,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,WAAmB;IAC/D,OAAO,MAAM,CAAC,MAAM,CAClB,IAAI,KAAK,CACP,sBAAsB,IAAI,4CAA4C,WAAW,SAAS,yBAAyB,EAAE,CACtH,EACD,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAC7B,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,OAAO,CAAC,IAAY,EAAE,WAAmB;IACvD,0EAA0E;IAC1E,4DAA4D;IAC5D,MAAM,IAAI,GAAG,SAAS,cAAc;QAClC,MAAM,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAC3C,CAAC,CAAC;IACF,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACrD,OAAO,IAA6B,CAAC;AACvC,CAAC;AAED,MAAM,YAAY,GAChB,gGAAgG,CAAC;AACnG,MAAM,OAAO,GACX,2HAA2H,CAAC;AAC9H,MAAM,eAAe,GACnB,wGAAwG,CAAC;AAE3G,uCAAuC;AACvC,MAAM,CAAC,MAAM,QAAQ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AAa,CAAC,OAAO,CAClE,qBAAqB,EACrB,QAAQ,CAAC,mBAAmB,CAC7B,CAAC;AACF,yKAAyK;AACzK,MAAM,CAAC,MAAM,mBAAmB,GAAe,aAAa,CAAC,OAAO,CAClE,qBAAqB,EACrB,QAAQ,CAAC,mBAAmB,CAC7B,CAAC;AACF,mGAAmG;AACnG,MAAM,CAAC,MAAM,mBAAmB,GAAe,aAAa,CAAC,OAAO,CAClE,qBAAqB,EACrB,QAAQ,CAAC,mBAAmB,CAC7B,CAAC;AACF,mKAAmK;AACnK,MAAM,CAAC,MAAM,kBAAkB,GAAe,aAAa,CAAC,OAAO,CACjE,oBAAoB,EACpB,QAAQ,CAAC,kBAAkB,CAC5B,CAAC;AACF,uFAAuF;AACvF,MAAM,CAAC,MAAM,oBAAoB,GAAe,aAAa,CAAC,OAAO,CACnE,sBAAsB,EACtB,QAAQ,CAAC,oBAAoB,CAC9B,CAAC","sourcesContent":["/**\n * Names alpha.60 exported and alpha.61 removed (the session replaced them),\n * kept for one release as stubs that throw when used, naming what replaced\n * them. Without them a bundler's \"not exported\" error guesses a similarly\n * named export (Turbopack suggests `useJazzClient` for `useJazzAuth`), which\n * is the wrong one. They are not working aliases.\n *\n * Each is typed so TypeScript shows it too: `@deprecated` with the\n * replacement where it is declared, and parameters of type `never`, so a call\n * with arguments doesn't type-check.\n */\n\n/** Where the alpha.60 → alpha.61 changes are written up. */\nexport const UPGRADE_FROM_ALPHA_60_URL =\n \"https://jazz.tools/docs/operating/backups-and-upgrades#upgrading-from-alpha60\";\n\ndeclare const removedApi: unique symbol;\n\n/** A removed export: calling or constructing it throws, naming its replacement. */\nexport type RemovedApi = ((...args: never[]) => never) &\n (new (...args: never[]) => never) & { readonly [removedApi]: never };\n\n/** The error a removed export throws. `code` is `JAZZ_API_REMOVED`. */\nexport function removedApiError(name: string, replacement: string): Error {\n return Object.assign(\n new Error(\n `[JAZZ_API_REMOVED] ${name} was removed in jazz-tools alpha.61: use ${replacement}. See ${UPGRADE_FROM_ALPHA_60_URL}`,\n ),\n { code: \"JAZZ_API_REMOVED\" },\n );\n}\n\n/** @internal A stub for a removed export: throws when called or constructed. */\nexport function removed(name: string, replacement: string): RemovedApi {\n // A plain function (not a Proxy): React and Fast Refresh inspect exports,\n // which must stay inert. Calling or constructing it throws.\n const stub = function removedJazzApi(): never {\n throw removedApiError(name, replacement);\n };\n Object.defineProperty(stub, \"name\", { value: name });\n return stub as unknown as RemovedApi;\n}\n\nconst SESSION_HOOK =\n \"useJazzSession() (Svelte: getJazzSession()): the session, who is signed in, and its operations\";\nconst SESSION =\n 'createJazzClient(config) (the session signs in itself: initial: \"device\", createDeviceAccount(), or your backend\\'s user)';\nconst DEVICE_ACCOUNTS =\n \"device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key)\";\n\n/** What replaced each removed name. */\nexport const REPLACED = {\n useJazzAuth: SESSION_HOOK,\n useJazzSessionOwner: SESSION_HOOK,\n useAccountState: SESSION_HOOK,\n createAccountState: \"useJazzSession() (the session's snapshot is reactive)\",\n createJazzSessionState: \"useJazzSession()\",\n accountState: \"getJazzSession()\",\n createAccountManager: SESSION,\n AccountManager: SESSION,\n createDb: \"createJazzClient(config), then session.db\",\n createJazzApp: \"createJazzClient(config), or <JazzProvider config={…}>\",\n exportLocalFirstSecret: \"session.exportDeviceKey()\",\n useLocalFirstAuth: DEVICE_ACCOUNTS,\n createUseLocalFirstAuth: DEVICE_ACCOUNTS,\n LocalFirstAuth: DEVICE_ACCOUNTS,\n BrowserAuthSecretStore: DEVICE_ACCOUNTS,\n ExpoAuthSecretStore: DEVICE_ACCOUNTS,\n expoAuthSecretStore: DEVICE_ACCOUNTS,\n JazzSessionProvider: \"<JazzProvider session={session}>\",\n JazzSvelteProvider:\n \"<JazzProvider config={…}>, or <JazzSvelteClientProvider client> for a client you opened yourself\",\n acceptLocalFirstAuth: \"acceptDeviceAccounts\",\n} as const;\n\n// The stubs. Each entry point re-exports the ones it exported in alpha.60.\n/** @deprecated Removed in alpha.61, and throws when used: use useJazzSession() (Svelte: getJazzSession()): the session, who is signed in, and its operations. */\nexport const useJazzAuth: RemovedApi = /*#__PURE__*/ removed(\"useJazzAuth\", REPLACED.useJazzAuth);\n/** @deprecated Removed in alpha.61, and throws when used: use useJazzSession() (Svelte: getJazzSession()): the session, who is signed in, and its operations. */\nexport const useJazzSessionOwner: RemovedApi = /*#__PURE__*/ removed(\n \"useJazzSessionOwner\",\n REPLACED.useJazzSessionOwner,\n);\n/** @deprecated Removed in alpha.61, and throws when used: use useJazzSession() (Svelte: getJazzSession()): the session, who is signed in, and its operations. */\nexport const useAccountState: RemovedApi = /*#__PURE__*/ removed(\n \"useAccountState\",\n REPLACED.useAccountState,\n);\n/** @deprecated Removed in alpha.61, and throws when used: use useJazzSession() (the session's snapshot is reactive). */\nexport const createAccountState: RemovedApi = /*#__PURE__*/ removed(\n \"createAccountState\",\n REPLACED.createAccountState,\n);\n/** @deprecated Removed in alpha.61, and throws when used: use useJazzSession(). */\nexport const createJazzSessionState: RemovedApi = /*#__PURE__*/ removed(\n \"createJazzSessionState\",\n REPLACED.createJazzSessionState,\n);\n/** @deprecated Removed in alpha.61, and throws when used: use getJazzSession(). */\nexport const accountState: RemovedApi = /*#__PURE__*/ removed(\n \"accountState\",\n REPLACED.accountState,\n);\n/** @deprecated Removed in alpha.61, and throws when used: use createJazzClient(config) (the session signs in itself: initial: \"device\", createDeviceAccount(), or your backend's user). */\nexport const createAccountManager: RemovedApi = /*#__PURE__*/ removed(\n \"createAccountManager\",\n REPLACED.createAccountManager,\n);\n/** @deprecated Removed in alpha.61, and throws when used: use createJazzClient(config) (the session signs in itself: initial: \"device\", createDeviceAccount(), or your backend's user). */\nexport const AccountManager: RemovedApi = /*#__PURE__*/ removed(\n \"AccountManager\",\n REPLACED.AccountManager,\n);\n/** @deprecated Removed in alpha.61, and throws when used: use createJazzClient(config), then session.db. */\nexport const createDb: RemovedApi = /*#__PURE__*/ removed(\"createDb\", REPLACED.createDb);\n/** @deprecated Removed in alpha.61, and throws when used: use createJazzClient(config), or <JazzProvider config={…}>. */\nexport const createJazzApp: RemovedApi = /*#__PURE__*/ removed(\n \"createJazzApp\",\n REPLACED.createJazzApp,\n);\n/** @deprecated Removed in alpha.61, and throws when used: use session.exportDeviceKey(). */\nexport const exportLocalFirstSecret: RemovedApi = /*#__PURE__*/ removed(\n \"exportLocalFirstSecret\",\n REPLACED.exportLocalFirstSecret,\n);\n/** @deprecated Removed in alpha.61, and throws when used: use device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key). */\nexport const useLocalFirstAuth: RemovedApi = /*#__PURE__*/ removed(\n \"useLocalFirstAuth\",\n REPLACED.useLocalFirstAuth,\n);\n/** @deprecated Removed in alpha.61, and throws when used: use device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key). */\nexport const createUseLocalFirstAuth: RemovedApi = /*#__PURE__*/ removed(\n \"createUseLocalFirstAuth\",\n REPLACED.createUseLocalFirstAuth,\n);\n/** @deprecated Removed in alpha.61, and throws when used: use device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key). */\nexport const LocalFirstAuth: RemovedApi = /*#__PURE__*/ removed(\n \"LocalFirstAuth\",\n REPLACED.LocalFirstAuth,\n);\n/** @deprecated Removed in alpha.61, and throws when used: use device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key). */\nexport const BrowserAuthSecretStore: RemovedApi = /*#__PURE__*/ removed(\n \"BrowserAuthSecretStore\",\n REPLACED.BrowserAuthSecretStore,\n);\n/** @deprecated Removed in alpha.61, and throws when used: use device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key). */\nexport const ExpoAuthSecretStore: RemovedApi = /*#__PURE__*/ removed(\n \"ExpoAuthSecretStore\",\n REPLACED.ExpoAuthSecretStore,\n);\n/** @deprecated Removed in alpha.61, and throws when used: use device accounts on the session: createDeviceAccount(), exportDeviceKey() and restoreDeviceAccount(key). */\nexport const expoAuthSecretStore: RemovedApi = /*#__PURE__*/ removed(\n \"expoAuthSecretStore\",\n REPLACED.expoAuthSecretStore,\n);\n/** @deprecated Removed in alpha.61, and throws when used: use <JazzProvider session={session}>. */\nexport const JazzSessionProvider: RemovedApi = /*#__PURE__*/ removed(\n \"JazzSessionProvider\",\n REPLACED.JazzSessionProvider,\n);\n/** @deprecated Removed in alpha.61, and throws when used: use <JazzProvider config={…}>, or <JazzSvelteClientProvider client> for a client you opened yourself. */\nexport const JazzSvelteProvider: RemovedApi = /*#__PURE__*/ removed(\n \"JazzSvelteProvider\",\n REPLACED.JazzSvelteProvider,\n);\n/** @deprecated Removed in alpha.61, and throws when used: use acceptDeviceAccounts. */\nexport const acceptLocalFirstAuth: RemovedApi = /*#__PURE__*/ removed(\n \"acceptLocalFirstAuth\",\n REPLACED.acceptLocalFirstAuth,\n);\n"]}
|
|
@@ -1,51 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Interface for platform-appropriate auth secret persistence.
|
|
3
|
-
*/
|
|
4
|
-
export interface AuthSecretStore {
|
|
5
|
-
loadSecret(): Promise<string | null>;
|
|
6
|
-
saveSecret(secret: string): Promise<void>;
|
|
7
|
-
clearSecret(): Promise<void>;
|
|
8
|
-
getOrCreateSecret(): Promise<string>;
|
|
9
|
-
}
|
|
10
|
-
import { type AuthSecretScope } from "./auth-secret-codec.js";
|
|
11
1
|
export { authSecretStorageKey, AuthSecretFormatError, formatAuthSecret, parseAuthSecret, } from "./auth-secret-codec.js";
|
|
12
2
|
/**
|
|
13
3
|
* Generate a new 32-byte auth secret in canonical versioned form.
|
|
14
4
|
* Uses the platform's native CSPRNG.
|
|
15
5
|
*/
|
|
16
6
|
export declare function generateAuthSecret(): string;
|
|
17
|
-
export interface BrowserAuthSecretStoreOptions extends AuthSecretScope {
|
|
18
|
-
/** Explicit physical storage key. Prefer appId/profile for portable scoping. */
|
|
19
|
-
key?: string;
|
|
20
|
-
/** Override storage backend (for testing) */
|
|
21
|
-
storage?: Pick<Storage, "getItem" | "setItem" | "removeItem">;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* AuthSecretStore backed by localStorage.
|
|
25
|
-
*
|
|
26
|
-
* Singleton — call static methods directly: `BrowserAuthSecretStore.getOrCreateSecret()`.
|
|
27
|
-
*
|
|
28
|
-
* Uses a check-then-write pattern; not atomic across concurrent tabs on
|
|
29
|
-
* first visit. Apps that need strict cross-tab guarantees can use a custom
|
|
30
|
-
* AuthSecretStore with IndexedDB transactions or BroadcastChannel coordination.
|
|
31
|
-
*/
|
|
32
|
-
export declare class BrowserAuthSecretStore implements AuthSecretStore {
|
|
33
|
-
private static globalInstances;
|
|
34
|
-
private static storageScopedInstances;
|
|
35
|
-
private readonly key;
|
|
36
|
-
private readonly explicitStorage;
|
|
37
|
-
private cachedPromise;
|
|
38
|
-
constructor(options?: BrowserAuthSecretStoreOptions);
|
|
39
|
-
private requireStorage;
|
|
40
|
-
static getDefault(options?: BrowserAuthSecretStoreOptions): BrowserAuthSecretStore;
|
|
41
|
-
loadSecret(): Promise<string | null>;
|
|
42
|
-
saveSecret(secret: string): Promise<void>;
|
|
43
|
-
clearSecret(): Promise<void>;
|
|
44
|
-
getOrCreateSecret(): Promise<string>;
|
|
45
|
-
static loadSecret(options?: BrowserAuthSecretStoreOptions): Promise<string | null>;
|
|
46
|
-
static saveSecret(secret: string, options?: BrowserAuthSecretStoreOptions): Promise<void>;
|
|
47
|
-
static clearSecret(options?: BrowserAuthSecretStoreOptions): Promise<void>;
|
|
48
|
-
static getOrCreateSecret(options?: BrowserAuthSecretStoreOptions): Promise<string>;
|
|
49
|
-
}
|
|
50
|
-
export declare const browserAuthSecretStore: AuthSecretStore;
|
|
51
7
|
//# sourceMappingURL=auth-secret-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-secret-store.d.ts","sourceRoot":"","sources":["../../src/runtime/auth-secret-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth-secret-store.d.ts","sourceRoot":"","sources":["../../src/runtime/auth-secret-store.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAEhC;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAI3C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { formatAuthSecret } from "./auth-secret-codec.js";
|
|
2
2
|
export { authSecretStorageKey, AuthSecretFormatError, formatAuthSecret, parseAuthSecret, } from "./auth-secret-codec.js";
|
|
3
3
|
/**
|
|
4
4
|
* Generate a new 32-byte auth secret in canonical versioned form.
|
|
@@ -9,106 +9,4 @@ export function generateAuthSecret() {
|
|
|
9
9
|
crypto.getRandomValues(bytes);
|
|
10
10
|
return formatAuthSecret(bytes);
|
|
11
11
|
}
|
|
12
|
-
function resolveBrowserAuthSecretKey(options = {}) {
|
|
13
|
-
if (options.key) {
|
|
14
|
-
return options.key;
|
|
15
|
-
}
|
|
16
|
-
return authSecretStorageKey(options);
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* AuthSecretStore backed by localStorage.
|
|
20
|
-
*
|
|
21
|
-
* Singleton — call static methods directly: `BrowserAuthSecretStore.getOrCreateSecret()`.
|
|
22
|
-
*
|
|
23
|
-
* Uses a check-then-write pattern; not atomic across concurrent tabs on
|
|
24
|
-
* first visit. Apps that need strict cross-tab guarantees can use a custom
|
|
25
|
-
* AuthSecretStore with IndexedDB transactions or BroadcastChannel coordination.
|
|
26
|
-
*/
|
|
27
|
-
export class BrowserAuthSecretStore {
|
|
28
|
-
static globalInstances = new Map();
|
|
29
|
-
static storageScopedInstances = new WeakMap();
|
|
30
|
-
key;
|
|
31
|
-
explicitStorage;
|
|
32
|
-
cachedPromise = null;
|
|
33
|
-
constructor(options = {}) {
|
|
34
|
-
this.key = resolveBrowserAuthSecretKey(options);
|
|
35
|
-
this.explicitStorage = options.storage;
|
|
36
|
-
}
|
|
37
|
-
requireStorage() {
|
|
38
|
-
const storage = this.explicitStorage ?? globalThis.localStorage;
|
|
39
|
-
if (!storage) {
|
|
40
|
-
throw new Error("BrowserAuthSecretStore requires a browser environment. " +
|
|
41
|
-
"Defer reads to a client-only context, or pass `options.storage`.");
|
|
42
|
-
}
|
|
43
|
-
return storage;
|
|
44
|
-
}
|
|
45
|
-
static getDefault(options = {}) {
|
|
46
|
-
const storage = options.storage;
|
|
47
|
-
const key = resolveBrowserAuthSecretKey(options);
|
|
48
|
-
if (storage) {
|
|
49
|
-
let instances = BrowserAuthSecretStore.storageScopedInstances.get(storage);
|
|
50
|
-
if (!instances) {
|
|
51
|
-
instances = new Map();
|
|
52
|
-
BrowserAuthSecretStore.storageScopedInstances.set(storage, instances);
|
|
53
|
-
}
|
|
54
|
-
let instance = instances.get(key);
|
|
55
|
-
if (!instance) {
|
|
56
|
-
instance = new BrowserAuthSecretStore(options);
|
|
57
|
-
instances.set(key, instance);
|
|
58
|
-
}
|
|
59
|
-
return instance;
|
|
60
|
-
}
|
|
61
|
-
let instance = BrowserAuthSecretStore.globalInstances.get(key);
|
|
62
|
-
if (!instance) {
|
|
63
|
-
instance = new BrowserAuthSecretStore(options);
|
|
64
|
-
BrowserAuthSecretStore.globalInstances.set(key, instance);
|
|
65
|
-
}
|
|
66
|
-
return instance;
|
|
67
|
-
}
|
|
68
|
-
async loadSecret() {
|
|
69
|
-
const secret = this.requireStorage().getItem(this.key);
|
|
70
|
-
if (secret === null)
|
|
71
|
-
return null;
|
|
72
|
-
parseAuthSecret(secret);
|
|
73
|
-
return secret;
|
|
74
|
-
}
|
|
75
|
-
async saveSecret(secret) {
|
|
76
|
-
parseAuthSecret(secret);
|
|
77
|
-
this.requireStorage().setItem(this.key, secret);
|
|
78
|
-
this.cachedPromise = Promise.resolve(secret);
|
|
79
|
-
}
|
|
80
|
-
async clearSecret() {
|
|
81
|
-
this.requireStorage().removeItem(this.key);
|
|
82
|
-
this.cachedPromise = null;
|
|
83
|
-
}
|
|
84
|
-
getOrCreateSecret() {
|
|
85
|
-
if (!this.cachedPromise) {
|
|
86
|
-
const storage = this.requireStorage();
|
|
87
|
-
const existing = storage.getItem(this.key);
|
|
88
|
-
if (existing !== null) {
|
|
89
|
-
parseAuthSecret(existing);
|
|
90
|
-
this.cachedPromise = Promise.resolve(existing);
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
const secret = generateAuthSecret();
|
|
94
|
-
storage.setItem(this.key, secret);
|
|
95
|
-
this.cachedPromise = Promise.resolve(secret);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return this.cachedPromise;
|
|
99
|
-
}
|
|
100
|
-
static loadSecret(options = {}) {
|
|
101
|
-
return BrowserAuthSecretStore.getDefault(options).loadSecret();
|
|
102
|
-
}
|
|
103
|
-
static saveSecret(secret, options = {}) {
|
|
104
|
-
return BrowserAuthSecretStore.getDefault(options).saveSecret(secret);
|
|
105
|
-
}
|
|
106
|
-
static clearSecret(options = {}) {
|
|
107
|
-
return BrowserAuthSecretStore.getDefault(options).clearSecret();
|
|
108
|
-
}
|
|
109
|
-
static getOrCreateSecret(options = {}) {
|
|
110
|
-
return BrowserAuthSecretStore.getDefault(options).getOrCreateSecret();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
export const browserAuthSecretStore = BrowserAuthSecretStore.getDefault();
|
|
114
12
|
//# sourceMappingURL=auth-secret-store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-secret-store.js","sourceRoot":"","sources":["../../src/runtime/auth-secret-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth-secret-store.js","sourceRoot":"","sources":["../../src/runtime/auth-secret-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAEhC;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IACjC,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC9B,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC","sourcesContent":["import { formatAuthSecret } from \"./auth-secret-codec.js\";\n\nexport {\n authSecretStorageKey,\n AuthSecretFormatError,\n formatAuthSecret,\n parseAuthSecret,\n} from \"./auth-secret-codec.js\";\n\n/**\n * Generate a new 32-byte auth secret in canonical versioned form.\n * Uses the platform's native CSPRNG.\n */\nexport function generateAuthSecret(): string {\n const bytes = new Uint8Array(32);\n crypto.getRandomValues(bytes);\n return formatAuthSecret(bytes);\n}\n"]}
|
package/dist/runtime/client.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { AppContext, Session } from "./context.js";
|
|
|
9
9
|
import type { InsertValues, RuntimeSubscriptionDelta, Value, WasmSchema } from "../drivers/types.js";
|
|
10
10
|
import type { AuthFailureReason } from "./auth-state.js";
|
|
11
11
|
import type { RemoteLinkState } from "./remote-link-state.js";
|
|
12
|
-
import type { LinkStatus } from "./sync-status.js";
|
|
12
|
+
import type { LinkFailure, LinkStatus, UploadStatus } from "./sync-status.js";
|
|
13
13
|
/** @internal Runtime operations bound to the currently executing preparation. */
|
|
14
14
|
export type TransactionPreparationIO = Pick<JazzClient, "queryInternal" | "insertInternal" | "updateInternal" | "upsertInternal" | "restoreInternal">;
|
|
15
15
|
/**
|
|
@@ -44,9 +44,13 @@ export interface Runtime {
|
|
|
44
44
|
/**
|
|
45
45
|
* Wait until every write committed so far reaches `tier`. `throughOutage`
|
|
46
46
|
* keeps the wait pending through outages until a terminal failure.
|
|
47
|
+
* `inFlightStreams` (the drain after the local-first upgrade) first lets
|
|
48
|
+
* streaming writes still sending their value finish, and waits for their
|
|
49
|
+
* writes too, until that signal aborts.
|
|
47
50
|
*/
|
|
48
51
|
waitForPendingWrites?(tier?: string, options?: {
|
|
49
52
|
throughOutage?: boolean;
|
|
53
|
+
inFlightStreams?: AbortSignal;
|
|
50
54
|
signal?: AbortSignal;
|
|
51
55
|
}): Promise<void>;
|
|
52
56
|
/** @internal Close mutation admission and report the foreground TxTime high-water. */
|
|
@@ -67,9 +71,11 @@ export interface Runtime {
|
|
|
67
71
|
setRemoteLinkHint?(state: RemoteLinkState): void;
|
|
68
72
|
/** @internal The upstream link as the app sees it. */
|
|
69
73
|
upstreamLinkStatus?(): LinkStatus;
|
|
70
|
-
/** @internal
|
|
71
|
-
|
|
72
|
-
/** @internal
|
|
74
|
+
/** @internal This client's uploads: pending, since when, and refusals. */
|
|
75
|
+
uploadStatus?(): UploadStatus;
|
|
76
|
+
/** @internal The latest link failure this client saw, if any. */
|
|
77
|
+
lastLinkFailure?(): LinkFailure | null;
|
|
78
|
+
/** @internal Observe changes of the link status or the upload status. */
|
|
73
79
|
onSyncStatusChange?(listener: () => void, signal: AbortSignal): void;
|
|
74
80
|
/** @internal Construct a provisional row without staging or accepting a write. */
|
|
75
81
|
previewInsert?(table: string, values: InsertValues, objectId?: string): Row;
|