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":"native-foreground-db.js","sourceRoot":"","sources":["../../src/react-native/native-foreground-db.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AA8B7D;;;;;;;GAOG;AACH;;;;;;;;GAQG;AACH,MAAM,OAAO,kBAAkB;IAeV;IACA;IAfX,MAAM,GAAG,KAAK,CAAC;IACf,qBAAqB,CAAoD;IACzE,oBAAoB,CAAyC;IACrE,2EAA2E;IACnE,qBAAqB,GAAG,CAAC,CAAC;IAC1B,uBAAuB,CAAgE;IAC/F,2EAA2E;IACnE,uBAAuB,GAAmD,IAAI,CAAC;IACtE,YAAY,GAAG,IAAI,GAAG,EAAuC,CAAC;IAC/E,oEAAoE;IAC5D,uBAAuB,GAAG,KAAK,CAAC;IAChC,6BAA6B,GAAG,KAAK,CAAC;IAE9C,YACmB,OAAgC,EAChC,QAAgC;QADhC,YAAO,GAAP,OAAO,CAAyB;QAChC,aAAQ,GAAR,QAAQ,CAAwB;IAChD,CAAC;IAEJ,gBAAgB,CAAC,QAAiE;QAChF,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;YACnC,MAAM,IAAI,KAAK,CACb,8EAA8E,CAC/E,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,OAAO,EAAE,EAAE;YACxC,+DAA+D;YAC/D,qEAAqE;YACrE,sEAAsE;YACtE,yCAAyC;YACzC,IAAI,CAAC,IAAI,CAAC,MAAM;gBAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC,CAAC,C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EAAE,CAAC,CAAC;IAC/E,IAAI,QAAQ,CAAC,UAAU,KAAK,SAAS;QAAE,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IAC7F,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,WAAW,CAAC,SAAiB;IACpC,MAAM,IAAI,KAAK,CAAC,GAAG,8BAA8B,KAAK,SAAS,iBAAiB,CAAC,CAAC;AACpF,CAAC;AAED,SAAS,UAAU,CAAC,SAAiB,EAAE,QAAgB;IACrD,MAAM,IAAI,KAAK,CACb,kCAAkC,SAAS,wBAAwB,QAAQ,WAAW,CACvF,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAkC;IAC7D,IAAI,KAAK,CAAC,UAAU,KAAK,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;IACtF,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrF,OAAO,GAAG,CAAC;AACb,CAAC;AAED,kEAAkE;AAClE,SAAS,cAAc,CAAC,KAAc;IACpC,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,OAAO,OAAO,CAAC,QAAQ,CAAC,+BAA+B,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import type * as Relay from \"jazz-rn/relay\";\nimport type { MutationErrorEvent } from \"../runtime/client.js\";\nimport { UnsupportedSnapshotError } from \"../runtime/snapshot-ref.js\";\nimport { REACT_NATIVE_UNSUPPORTED_ERROR } from \"./errors.js\";\n\n// The foreground command vocabulary is owned by jazz-rn. This module is\n// internal: no public declaration of jazz-tools reaches it, so applications\n// never need the optional jazz-rn peer to type-check.\ntype ForegroundCommand = Relay.NativeForegroundCommand;\ntype ForegroundResponse = Relay.NativeForegroundResponse;\ntype ForegroundMutationKind = Extract<ForegroundCommand, { type: \"directMutation\" }>[\"mutation\"];\ntype NativeConnectionStatus = Extract<ForegroundResponse, { type: \"nativeConnectionStatus\" }>;\n/** An upstream connection failure other than a refused credential (#4337). */\nexport type NativeUpstreamFailure = { reason: string; retrying: boolean };\ntype ForegroundMutationOptions = {\n rowId?: Uint8Array;\n branch?: unknown;\n head?: unknown;\n base?: unknown;\n updatedAtMs?: number;\n author?: Uint8Array;\n attribution?: Uint8Array;\n};\n\nexport type NativeForegroundRuntime = Relay.NativeForegroundRuntime;\nexport type NativeForegroundFactory = Relay.NativeForegroundRuntimeFactory;\nexport type NativeForegroundModule = Pick<\n typeof Relay,\n | \"installNativeForegroundRuntime\"\n | \"encodeNativeForegroundCommand\"\n | \"decodeNativeForegroundResponse\"\n>;\n\n/**\n * Narrow NativeDb consumer for the first JSI foreground slice.\n *\n * Rows and subscription deltas stay in the ordinary binding byte format, so\n * NativeRuntimeAdapter remains the sole schema-aware decoder. This is not a\n * second object-shaped database facade and intentionally grows only as the\n * shared Rust command ABI grows.\n */\n/**\n * Thin `NativeDb` adapter over the native foreground command ABI.\n *\n * This deliberately contains no row, query, or mutation interpretation: the\n * normal `NativeRuntimeAdapter` owns the public API and existing codecs. A\n * direct mutation is represented by one ordinary native mergeable transaction;\n * explicit public transactions retain their native transaction handle until\n * commit/rollback.\n */\nexport class NativeForegroundDb {\n private closed = false;\n private mutationErrorCallback: ((event: MutationErrorEvent) => void) | undefined;\n private authRejectedCallback: ((reason: string) => void) | undefined;\n /** The sequence of the refusal last reported, so each is reported once. */\n private reportedAuthRejection = 0;\n private upstreamFailureCallback: ((failure: NativeUpstreamFailure | null) => void) | undefined;\n /** The upstream failure last reported, so each change is reported once. */\n private reportedUpstreamFailure: { sequence: number; retrying: boolean } | null = null;\n private readonly transactions = new Map<string, NativeForegroundTransaction>();\n /** A native build without the (append-only) slow-query commands. */\n private slowQueryLogUnsupported = false;\n private pendingUploadCountUnsupported = false;\n\n constructor(\n private readonly runtime: NativeForegroundRuntime,\n private readonly commands: NativeForegroundModule,\n ) {}\n\n setTickScheduler(callback: (first: Error | string | null, second?: string) => void): void {\n if (!this.runtime.setTickScheduler) {\n throw new Error(\n \"React Native native foreground runtime does not expose owner wake scheduling\",\n );\n }\n this.runtime.setTickScheduler((urgency) => {\n // Native invalidation clears the JSI registration first, but a\n // CallInvoker task may already have crossed into JS when close races\n // teardown. Do not let that stale task re-enter the adapter after its\n // foreground facade has become unusable.\n if (!this.closed) callback(urgency);\n });\n }\n\n onMutationError(callback: (event: MutationErrorEvent) => void): void {\n this.assertOpen();\n this.mutationErrorCallback = callback;\n }\n\n /**\n * Observe the upstream refusing the scope's credential. The refusal is auth\n * state, not a failed tick: local ticks keep running, and the tick that\n * first sees a refusal reports it once, so the app can renew the\n * credential (#4248, #4296).\n */\n onAuthRejected(callback: (reason: string) => void): void {\n this.assertOpen();\n this.authRejectedCallback = callback;\n }\n\n /**\n * Observe the scope's upstream connection failing for a reason other than\n * its credential, and recovering (`null`). A failure is connection state,\n * not a failed tick: local ticks keep running (#4337).\n */\n onUpstreamFailure(callback: (failure: NativeUpstreamFailure | null) => void): void {\n this.assertOpen();\n this.upstreamFailureCallback = callback;\n }\n\n all(\n query: Uint8Array,\n opts: unknown,\n openTransactionId?: string,\n ): Uint8Array | { poll(): Uint8Array | null; cancel(): void } {\n const transaction =\n openTransactionId === undefined\n ? undefined\n : this.openTransaction(openTransactionId, \"read\").handle;\n // No tick here: the native relay owner applies admitted writes and pumps\n // on its own thread. The read is fenced natively behind every write\n // admitted before it, so it resolves (possibly as pending) with them.\n const response = this.execute({\n type: \"all\",\n query,\n optionsJson: JSON.stringify(opts ?? {}),\n transaction,\n });\n if (response.type === \"rows\") return response.rows;\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type === \"pending\") return this.pendingRows(response.operation);\n return unexpected(\"all\", response.type);\n }\n\n captureSnapshot(): Uint8Array | { poll(): Uint8Array | null; cancel(): void } {\n this.assertOpen();\n if (this.runtime.supportsSnapshotCapture !== true) {\n throw new UnsupportedSnapshotError(\n \"Capturing snapshots requires a newer Jazz native build; rebuild the native app to use captureSnapshot()\",\n );\n }\n const response = this.execute({ type: \"captureSnapshot\" });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type === \"rows\") return response.rows;\n if (response.type === \"pending\") return this.pendingRows(response.operation);\n return unexpected(\"captureSnapshot\", response.type);\n }\n\n // The shared mutation adapter needs one exact local row, without coverage\n // registration or hydration, to merge staged patches synchronously.\n localCurrentRow(table: string, rowId: Uint8Array): Uint8Array {\n const response = this.execute({ type: \"localCurrentRow\", table, rowId });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"rows\") return unexpected(\"localCurrentRow\", response.type);\n return response.rows;\n }\n\n subscribe(query: Uint8Array, opts: unknown): NativeForegroundSubscription {\n // Fenced natively like `all()`: the first frame reflects earlier writes.\n const response = this.execute({\n type: \"subscribe\",\n query,\n optionsJson: JSON.stringify(opts ?? {}),\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"subscribed\") return unexpected(\"subscribe\", response.type);\n return new NativeForegroundSubscription(response.subscription, this);\n }\n\n tick(): void {\n this.assertOpen();\n this.runtime.tick();\n if (!this.mutationErrorCallback && !this.authRejectedCallback && !this.upstreamFailureCallback)\n return;\n // One call drains everything a tick reports.\n const response = this.execute({ type: \"drainTickEvents\" });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"tickEvents\") return unexpected(\"drainTickEvents\", response.type);\n const rejection = response.authRejection;\n if (rejection && rejection.sequence !== this.reportedAuthRejection) {\n this.reportedAuthRejection = rejection.sequence;\n queueMicrotask(() => {\n if (!this.closed) this.authRejectedCallback?.(rejection.reason);\n });\n }\n const failure = response.upstreamFailure;\n const reported = this.reportedUpstreamFailure;\n if (\n failure\n ? failure.sequence !== reported?.sequence || failure.retrying !== reported.retrying\n : reported\n ) {\n this.reportedUpstreamFailure = failure && {\n sequence: failure.sequence,\n retrying: failure.retrying,\n };\n const change = failure && { reason: failure.reason, retrying: failure.retrying };\n queueMicrotask(() => {\n if (!this.closed) this.upstreamFailureCallback?.(change);\n });\n }\n // The drain claims mutation errors; with no observer they are dropped.\n if (!this.mutationErrorCallback) return;\n const events = JSON.parse(response.eventsJson) as MutationErrorEvent[];\n for (const event of events)\n queueMicrotask(() => {\n if (!this.closed) this.mutationErrorCallback?.(event);\n });\n }\n\n close(): boolean {\n if (this.closed) return false;\n this.closed = true;\n this.transactions.clear();\n try {\n const response = this.executeAllowClosed(\"close\");\n if (response.type !== \"closed\") return unexpected(\"close\", response.type);\n return response.closed;\n } finally {\n // The command owns logical Db closure. The HostObject close releases the\n // JSI handle and is deliberately safe to call after that transition.\n // It must also run when command execution fails (for example, because a\n // platform logout revoked the capability just before this call).\n this.runtime.close();\n }\n }\n\n /**\n * The slow-query report due now: one line per slow query shape, naming\n * `app`. An older native build without the command reports nothing.\n */\n takeSlowQueryReport(app?: string): string[] {\n if (this.slowQueryLogUnsupported || this.closed) return [];\n let response: ForegroundResponse;\n try {\n response = this.execute({ type: \"takeSlowQueryReport\", app });\n } catch {\n this.slowQueryLogUnsupported = true;\n return [];\n }\n if (response.type !== \"slowQueryReport\") {\n this.slowQueryLogUnsupported = true;\n return [];\n }\n return response.lines;\n }\n\n /**\n * How many of this foreground's commits still wait for the server's\n * verdict. An older native build without the command reports none.\n */\n pendingUploadCount(): number {\n if (this.pendingUploadCountUnsupported || this.closed) return 0;\n let response: ForegroundResponse;\n try {\n response = this.execute({ type: \"pendingUploadCount\" });\n } catch (error) {\n // An older host rejects the unknown command (InvalidCommand). A busy\n // host or a revoked handle is transient and must not disable the count.\n if (rejectsCommand(error)) this.pendingUploadCountUnsupported = true;\n return 0;\n }\n if (response.type !== \"pendingUploadCount\") {\n this.pendingUploadCountUnsupported = true;\n return 0;\n }\n return response.count;\n }\n\n /** Report query runs of at least `ms` milliseconds; 0 turns the log off. */\n setSlowQueryThresholdMs(ms: number): void {\n if (this.slowQueryLogUnsupported || this.closed) return;\n let response: ForegroundResponse;\n try {\n response = this.execute({ type: \"setSlowQueryThresholdMs\", ms: Math.round(ms) });\n } catch {\n this.slowQueryLogUnsupported = true;\n return;\n }\n if (response.type !== \"slowQueryThresholdSet\") this.slowQueryLogUnsupported = true;\n }\n\n isNativeForegroundClosed(): boolean {\n // Only a typed native closed/revoked receipt suppresses a stale wake.\n // Missing support or any unexpected native/probe failure is not closure.\n return this.closed || this.runtime.isClosed?.() === true;\n }\n\n nativeSessionMetadata(): {\n node: Uint8Array;\n registryAuthority: string;\n accountId: string | null;\n issuer: string;\n userId: string;\n } {\n const response = this.execute({ type: \"nativeSessionMetadata\" });\n if (response.type !== \"nativeSessionMetadata\")\n return unexpected(\"nativeSessionMetadata\", response.type);\n return response;\n }\n\n disconnectNativeUpstream(): void {\n const response = this.execute({ type: \"disconnectNativeUpstream\" });\n if (response.type !== \"nativeConnectionStatus\")\n return unexpected(\"disconnectNativeUpstream\", response.type);\n }\n\n reconnectNativeUpstream(): void {\n const response = this.execute({ type: \"reconnectNativeUpstream\" });\n if (response.type !== \"nativeConnectionStatus\")\n return unexpected(\"reconnectNativeUpstream\", response.type);\n }\n\n nativeConnectionStatus(): NativeConnectionStatus {\n const response = this.execute({ type: \"nativeConnectionStatus\" });\n if (response.type !== \"nativeConnectionStatus\")\n return unexpected(\"nativeConnectionStatus\", response.type);\n return response;\n }\n\n rejectAuthUpdate(): never {\n throw new Error(\n \"React Native native foreground cannot rotate authentication in place; keep the existing admitted session or revoke the old native capability and create a new Db for the newly admitted session\",\n );\n }\n\n drain(subscription: number, operation?: number): unknown[] | { pendingOperation: number } {\n const response =\n operation === undefined\n ? this.execute({ type: \"drainSubscription\", subscription })\n : this.execute({ type: \"poll\", operation });\n if (response.type === \"pending\") return { pendingOperation: response.operation };\n if (response.type === \"operationError\") {\n throw foregroundOperationError({\n ...response,\n reason: `React Native native foreground subscription failed: ${response.reason}`,\n });\n }\n if (response.type !== \"subscriptionEvents\")\n return unexpected(\"drainSubscription\", response.type);\n return response.events.map((event) => {\n if (event.type === \"delta\") return event;\n if (event.type === \"closed\") return event;\n return {\n type: \"rejected\",\n reason: { type: \"ServerFailure\", code: event.reason },\n };\n });\n }\n\n unsubscribe(subscription: number): boolean {\n if (this.closed) return false;\n const response = this.execute({ type: \"unsubscribe\", subscription });\n if (response.type !== \"unsubscribed\") return unexpected(\"unsubscribe\", response.type);\n // Native unsubscribe retires the stream handle synchronously but queues\n // its core cleanup for the following ordinary turn. Drive that turn here:\n // after the JS reader stops polling there may be no unrelated operation\n // to do it for us.\n if (response.closed) this.tick();\n return response.closed;\n }\n\n requestInsertPermissionAdvice(table: string, cells: Uint8Array) {\n return this.requestPermissionAdvice({ type: \"insert\", table, cells });\n }\n\n requestReadPermissionAdvice(table: string, rowId: Uint8Array) {\n return this.requestPermissionAdvice({ type: \"read\", table, rowId });\n }\n\n requestUpdatePermissionAdvice(table: string, rowId: Uint8Array, patch: Uint8Array) {\n return this.requestPermissionAdvice({ type: \"update\", table, rowId, patch });\n }\n\n requestDeletePermissionAdvice(table: string, rowId: Uint8Array) {\n return this.requestPermissionAdvice({ type: \"delete\", table, rowId });\n }\n\n private requestPermissionAdvice(action: Relay.NativeForegroundPermissionAdviceAction) {\n let response = this.execute({ type: \"permissionAdvice\", action });\n if (response.type === \"permissionAdvice\") return response.advice;\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"pending\") return unexpected(\"permissionAdvice\", response.type);\n const operation = response.operation;\n let completed = false;\n return {\n poll: (): string | null => {\n if (completed || this.closed) return \"unknown\";\n this.tick();\n response = this.execute({ type: \"poll\", operation });\n if (response.type === \"pending\") return null;\n completed = true;\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"permissionAdvice\")\n return unexpected(\"permissionAdvice\", response.type);\n return response.advice;\n },\n cancel: (): boolean => {\n if (completed || this.closed) return false;\n completed = true;\n const cancelled = this.execute({ type: \"cancel\", operation });\n if (cancelled.type !== \"cancelled\")\n return unexpected(\"permissionAdvice cancellation\", cancelled.type);\n return cancelled.cancelled;\n },\n };\n }\n\n /**\n * Resolve once every local write so far reached `tier`. A wait that does\n * not settle at once is a pollable read, so a caller that stops waiting\n * cancels it.\n */\n waitForPendingWrites(\n tier: string,\n ): Uint8Array | { poll(): Uint8Array | null; cancel(): boolean } {\n let response = this.execute({ type: \"waitForPendingWrites\", tier });\n const settle = (): Uint8Array => {\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"rows\" || response.rows.length !== 0)\n return unexpected(\"waitForPendingWrites\", response.type);\n return response.rows;\n };\n if (response.type !== \"pending\") return settle();\n const operation = response.operation;\n let completed = false;\n return {\n poll: (): Uint8Array | null => {\n if (completed || this.closed) throw new Error(\"waitForPendingWrites was cancelled\");\n this.tick();\n response = this.execute({ type: \"poll\", operation });\n if (response.type === \"pending\") return null;\n completed = true;\n return settle();\n },\n cancel: (): boolean => {\n if (completed || this.closed) return false;\n completed = true;\n const cancelled = this.execute({ type: \"cancel\", operation });\n if (cancelled.type !== \"cancelled\")\n return unexpected(\"waitForPendingWrites cancellation\", cancelled.type);\n return cancelled.cancelled;\n },\n };\n }\n\n async waitForTransaction(txId: Uint8Array, tier: string, observeOnly = false): Promise<void> {\n if (![\"local\", \"global\"].includes(tier)) {\n throw new Error(`Unsupported write durability tier: ${tier}`);\n }\n let response = this.execute({ type: \"waitForTransaction\", txId, tier, observeOnly });\n while (response.type === \"pending\") {\n const operation = response.operation;\n await new Promise<void>((resolve) => setTimeout(resolve, 0));\n this.tick();\n response = this.execute({ type: \"poll\", operation });\n }\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"transactionSettled\")\n return unexpected(\"waitForTransaction\", response.type);\n }\n\n private execute(command: ForegroundCommand): ForegroundResponse {\n this.assertOpen();\n return this.executeAllowClosed(command);\n }\n\n private pendingRows(operation: number): { poll(): Uint8Array | null; cancel(): void } {\n let completed = false;\n return {\n poll: () => {\n if (completed) throw new Error(\"Native foreground read is already complete\");\n this.tick();\n const response = this.execute({ type: \"poll\", operation });\n if (response.type === \"pending\") return null;\n completed = true;\n if (response.type === \"operationError\") {\n throw foregroundOperationError({\n ...response,\n reason: `React Native native foreground read failed: ${response.reason}`,\n });\n }\n if (response.type !== \"rows\") return unexpected(\"poll\", response.type);\n return response.rows;\n },\n cancel: () => {\n if (completed || this.closed) return;\n completed = true;\n const response = this.execute({ type: \"cancel\", operation });\n if (response.type !== \"cancelled\") return unexpected(\"read cancellation\", response.type);\n },\n };\n }\n\n private executeAllowClosed(command: ForegroundCommand): ForegroundResponse {\n return this.commands.decodeNativeForegroundResponse(\n this.runtime.execute(this.commands.encodeNativeForegroundCommand(command)),\n );\n }\n\n private assertOpen(): void {\n if (this.closed) throw new Error(\"React Native native foreground runtime is closed\");\n }\n\n // The admitted native host already owns and validates the schema. A schema\n // view therefore shares this foreground rather than opening a second store.\n registerSchema(): NativeForegroundDb {\n return this;\n }\n\n beginTransaction(openTransactionId: string, kind: \"mergeable\" | \"serializable\"): void {\n this.assertOpen();\n if (this.transactions.has(openTransactionId)) {\n throw new Error(\n `React Native native foreground transaction ${openTransactionId} is already open`,\n );\n }\n const response = this.execute({ type: \"beginTransaction\", kind });\n if (response.type !== \"transactionOpened\") return unexpected(\"beginTransaction\", response.type);\n this.transactions.set(openTransactionId, {\n handle: response.transaction,\n kind,\n closed: false,\n });\n }\n\n commitTransaction(openTransactionId: string): NativeForegroundWrite {\n const transaction = this.openTransaction(openTransactionId, \"commit\");\n const response = this.execute({\n type: \"commitTransaction\",\n transaction: transaction.handle,\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"transactionCommitted\")\n return unexpected(\"commitTransaction\", response.type);\n this.transactions.delete(openTransactionId);\n transaction.closed = true;\n return nativeWrite(this, response.txId);\n }\n\n rollbackTransaction(openTransactionId: string): void {\n const transaction = this.openTransaction(openTransactionId, \"rollback\");\n const response = this.execute({\n type: \"rollbackTransaction\",\n transaction: transaction.handle,\n });\n if (response.type !== \"transactionRolledBack\")\n return unexpected(\"rollbackTransaction\", response.type);\n this.transactions.delete(openTransactionId);\n transaction.closed = true;\n }\n\n insert(\n table: string,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n return this.directMutation(\"insert\", table, options?.rowId, cells, options);\n }\n\n insertInTransaction(\n openTransactionId: string,\n table: string,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): Uint8Array {\n return this.stageMutation(\n this.openTransaction(openTransactionId, \"insert into\"),\n \"insert\",\n table,\n options?.rowId,\n cells,\n options,\n );\n }\n\n update(\n table: string,\n rowId: Uint8Array,\n patch: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n return this.directMutation(\"update\", table, rowId, patch, options);\n }\n\n updateInTransaction(\n openTransactionId: string,\n table: string,\n rowId: Uint8Array,\n patch: Uint8Array,\n options?: ForegroundMutationOptions,\n ): void {\n this.stageMutation(\n this.openTransaction(openTransactionId, \"update in\"),\n \"update\",\n table,\n rowId,\n patch,\n options,\n );\n }\n\n upsert(\n table: string,\n rowId: Uint8Array,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n return this.directMutation(\"upsert\", table, rowId, cells, options);\n }\n\n upsertInTransaction(\n openTransactionId: string,\n table: string,\n rowId: Uint8Array,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): void {\n this.stageMutation(\n this.openTransaction(openTransactionId, \"upsert into\"),\n \"upsert\",\n table,\n rowId,\n cells,\n options,\n );\n }\n\n delete(\n table: string,\n rowId: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n return this.directMutation(\"delete\", table, rowId, new Uint8Array(), options);\n }\n\n deleteInTransaction(\n openTransactionId: string,\n table: string,\n rowId: Uint8Array,\n options?: ForegroundMutationOptions,\n ): void {\n this.stageMutation(\n this.openTransaction(openTransactionId, \"delete from\"),\n \"delete\",\n table,\n rowId,\n new Uint8Array(),\n options,\n );\n }\n\n restore(\n table: string,\n rowId: Uint8Array,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n return this.directMutation(\"restore\", table, rowId, cells, options);\n }\n\n restoreInTransaction(\n openTransactionId: string,\n table: string,\n rowId: Uint8Array,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): void {\n this.stageMutation(\n this.openTransaction(openTransactionId, \"restore in\"),\n \"restore\",\n table,\n rowId,\n cells,\n options,\n );\n }\n\n connectUpstream(): never {\n return unsupported(\"JavaScript upstream transport\");\n }\n\n writeState(txId: Uint8Array): unknown {\n const response = this.execute({ type: \"writeState\", txId });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"writeState\") return unexpected(\"writeState\", response.type);\n return JSON.parse(response.stateJson);\n }\n\n updateLargeValues(\n table: string,\n rowId: Uint8Array,\n patch: Uint8Array,\n descriptors: readonly unknown[],\n updatedAtMs?: number,\n ): NativeForegroundWrite {\n const response = this.execute({\n type: \"updateLargeValues\",\n table,\n rowId,\n patch,\n descriptorsJson: JSON.stringify(descriptors),\n updatedAtMs,\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"transactionCommitted\")\n return unexpected(\"updateLargeValues\", response.type);\n return nativeWrite(this, response.txId, rowId);\n }\n\n beginStreamingMutation(\n table: string,\n rowId: Uint8Array,\n cells: Uint8Array,\n column: string,\n mutation: \"insert\" | \"update\" | \"upsert\" = \"insert\",\n _author?: Uint8Array,\n _attribution?: Uint8Array,\n updatedAtMs?: number,\n head?: unknown,\n base?: unknown,\n transaction?: string,\n ) {\n if (updatedAtMs !== undefined && (!Number.isSafeInteger(updatedAtMs) || updatedAtMs < 0)) {\n throw new Error(\"updatedAtMs must be a non-negative safe integer\");\n }\n const response = this.execute({\n type: \"beginStreamingMutation\",\n mutation,\n table,\n rowId,\n cells,\n column,\n optionsJson: JSON.stringify({ updatedAtMs, head, base, transaction }),\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"streamingMutationOpened\")\n return unexpected(\"beginStreamingMutation\", response.type);\n const upload = response.upload;\n let closed = false;\n const assertOpen = () => {\n if (closed) throw new Error(\"streaming mutation is closed\");\n this.assertOpen();\n };\n return {\n push: async (chunk: Uint8Array): Promise<void> => {\n assertOpen();\n const pushed = await this.completeMutationOperation(\n this.execute({ type: \"pushStreamingMutation\", upload, chunk }),\n );\n if (pushed.type === \"operationError\") throw foregroundOperationError(pushed);\n if (pushed.type !== \"streamingMutationPushed\")\n return unexpected(\"pushStreamingMutation\", pushed.type);\n },\n finishInTransaction: async (): Promise<void> => {\n assertOpen();\n const finished = await this.completeMutationOperation(\n this.execute({ type: \"finishStreamingMutation\", upload }),\n );\n closed = true;\n if (finished.type === \"operationError\") throw foregroundOperationError(finished);\n if (finished.type !== \"mutationStaged\")\n return unexpected(\"finishStreamingMutation\", finished.type);\n },\n finish: async (): Promise<NativeForegroundWrite> => {\n assertOpen();\n let finished = this.execute({ type: \"finishStreamingMutation\", upload });\n if (finished.type === \"operationError\") throw foregroundOperationError(finished);\n closed = true;\n while (finished.type === \"pending\") {\n const operation = finished.operation;\n await new Promise<void>((resolve) => setTimeout(resolve, 0));\n this.tick();\n finished = this.execute({ type: \"poll\", operation });\n }\n if (finished.type === \"operationError\") throw foregroundOperationError(finished);\n if (finished.type !== \"transactionCommitted\")\n return unexpected(\"finishStreamingMutation\", finished.type);\n return nativeWrite(this, finished.txId, rowId);\n },\n abort: async (): Promise<boolean> => {\n if (closed || this.closed) return false;\n const admitted = this.execute({ type: \"abortStreamingMutation\", upload });\n if (admitted.type === \"operationError\") throw foregroundOperationError(admitted);\n closed = true;\n const aborted = await this.completeMutationOperation(admitted);\n if (aborted.type === \"operationError\") throw foregroundOperationError(aborted);\n if (aborted.type !== \"streamingMutationAborted\")\n return unexpected(\"abortStreamingMutation\", aborted.type);\n return aborted.aborted;\n },\n };\n }\n\n private async completeMutationOperation(\n response: ForegroundResponse,\n ): Promise<ForegroundResponse> {\n while (response.type === \"pending\") {\n const operation = response.operation;\n await new Promise<void>((resolve) => setTimeout(resolve, 0));\n this.tick();\n response = this.execute({ type: \"poll\", operation });\n }\n return response;\n }\n\n private directMutation(\n mutation: ForegroundMutationKind,\n table: string,\n rowId: Uint8Array | undefined,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n if (mutation === \"upsert\" && options && \"branch\" in options)\n throw new Error(\"upsert option `branch` is not supported; use `head`\");\n if (\n options?.updatedAtMs !== undefined &&\n (!Number.isSafeInteger(options.updatedAtMs) || options.updatedAtMs < 0)\n )\n throw new Error(\"updatedAtMs must be a non-negative safe integer\");\n const {\n rowId: _rowId,\n author: _author,\n attribution: _attribution,\n ...wireOptions\n } = options ?? {};\n const response = this.execute({\n type: \"directMutation\",\n mutation,\n table,\n rowId,\n cells,\n optionsJson: JSON.stringify(wireOptions),\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"mutationCommitted\") return unexpected(mutation, response.type);\n return nativeWrite(this, response.txId, response.rowId);\n }\n\n private stageMutation(\n transaction: NativeForegroundTransaction,\n mutation: ForegroundMutationKind,\n table: string,\n rowId: Uint8Array | undefined,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): Uint8Array {\n if (transaction.closed) throw new Error(\"React Native native foreground transaction is closed\");\n if (mutation === \"upsert\" && options && \"branch\" in options) {\n throw new Error(\n \"upsert option `branch` is not supported; use `head` (and optional `base`) for a branch view\",\n );\n }\n if (\n options?.updatedAtMs !== undefined &&\n (!Number.isSafeInteger(options.updatedAtMs) || options.updatedAtMs < 0)\n ) {\n throw new Error(\"updatedAtMs must be a non-negative safe integer\");\n }\n // Identity belongs to the admitted native capability, never the command.\n const {\n rowId: _rowId,\n author: _author,\n attribution: _attribution,\n ...wireOptions\n } = options ?? {};\n const response = this.execute({\n type: \"stageMutation\",\n transaction: transaction.handle,\n mutation,\n table,\n rowId,\n cells,\n optionsJson: JSON.stringify(wireOptions),\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (mutation === \"insert\" && response.type === \"inserted\") return response.rowId;\n if (mutation !== \"insert\" && response.type === \"mutationStaged\") return rowId!;\n return unexpected(mutation, response.type);\n }\n\n private openTransaction(id: string, operation: string): NativeForegroundTransaction {\n const transaction = this.transactions.get(id);\n if (!transaction || transaction.closed) {\n throw new Error(\n `React Native native foreground cannot ${operation} unknown transaction ${id}`,\n );\n }\n return transaction;\n }\n}\n\ntype NativeForegroundTransaction = {\n handle: number;\n kind: \"mergeable\" | \"serializable\";\n closed: boolean;\n};\n\ntype NativeForegroundWrite = {\n /** Public write identity. Native binding spellings are normalized here. */\n readonly txId: string;\n readonly payload: Uint8Array;\n readonly rowId: Uint8Array;\n wait(tier: string, observeOnly?: boolean): Promise<void>;\n writeState(): unknown;\n close(): boolean;\n};\n\nfunction nativeWrite(\n db: NativeForegroundDb,\n txId: Uint8Array<ArrayBufferLike>,\n rowId: Uint8Array<ArrayBufferLike> = new Uint8Array(16),\n): NativeForegroundWrite {\n const id = formatTransactionId(txId);\n let closed = false;\n return {\n txId: id,\n payload: new Uint8Array(),\n rowId: rowId.slice(),\n async wait(tier: string, observeOnly = false): Promise<void> {\n if (closed) throw new Error(\"write state is unavailable\");\n await db.waitForTransaction(txId, tier, observeOnly);\n },\n writeState: () => {\n if (closed) throw new Error(\"write state is unavailable\");\n return db.writeState(txId);\n },\n close: () => {\n if (closed) return false;\n closed = true;\n return true;\n },\n };\n}\n\nclass NativeForegroundSubscription {\n private closed = false;\n private pendingOperation: number | undefined;\n\n constructor(\n private readonly handle: number,\n private readonly db: NativeForegroundDb,\n ) {}\n\n readAll(): unknown[] | { retryAfterMs(): number } {\n if (this.closed) return [];\n // Native core publication already materializes the canonical event before\n // waking this owner. Keep this pull delivery-only: a foreground read must\n // never run a full relay tick while the JS mutation call is returning.\n const events = this.db.drain(this.handle, this.pendingOperation);\n if (!Array.isArray(events)) {\n this.pendingOperation = events.pendingOperation;\n return { retryAfterMs: () => 0 };\n }\n this.pendingOperation = undefined;\n // An empty batch is a ready native pull with no current event. Returning\n // it lets NativeRuntimeAdapter finish the reader so the next native wake\n // can restart it; a timer here recreates the old relay-polling latency.\n return events;\n }\n\n close(): boolean {\n if (this.closed) return false;\n this.closed = true;\n return this.db.unsubscribe(this.handle);\n }\n}\n\n/**\n * The error a failed foreground operation throws: the unchanged reason text as\n * the message, plus the stable core `code` when a core error caused it.\n */\nfunction foregroundOperationError(response: {\n reason: string;\n code?: string;\n reasonName?: string;\n}): Error {\n const error = new Error(response.reason);\n if (response.code !== undefined) Object.assign(error, { code: response.code });\n if (response.reasonName !== undefined) Object.assign(error, { reason: response.reasonName });\n return error;\n}\n\nfunction unsupported(operation: string): never {\n throw new Error(`${REACT_NATIVE_UNSUPPORTED_ERROR}; ${operation} is unavailable`);\n}\n\nfunction unexpected(operation: string, response: string): never {\n throw new Error(\n `React Native native foreground ${operation} returned unexpected ${response} response`,\n );\n}\n\nfunction formatTransactionId(bytes: Uint8Array<ArrayBufferLike>): string {\n if (bytes.byteLength !== 16)\n throw new Error(\"React Native native foreground returned malformed transaction id\");\n const hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, \"0\")).join(\"\");\n return hex;\n}\n\n/** Whether the native host refused a command it does not know. */\nfunction rejectsCommand(error: unknown): boolean {\n const message = error instanceof Error ? error.message : String(error);\n return message.includes(\"runtime failed during execute\");\n}\n"]}
|
|
1
|
+
{"version":3,"file":"native-foreground-db.js","sourceRoot":"","sources":["../../src/react-native/native-foreground-db.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,U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,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrF,OAAO,GAAG,CAAC;AACb,CAAC;AAED,kEAAkE;AAClE,SAAS,cAAc,CAAC,KAAc;IACpC,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,OAAO,OAAO,CAAC,QAAQ,CAAC,+BAA+B,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import type * as Relay from \"jazz-rn/relay\";\nimport type { MutationErrorEvent } from \"../runtime/client.js\";\nimport { UnsupportedSnapshotError } from \"../runtime/snapshot-ref.js\";\nimport { NO_UPLOADS, uploadStatusFromCount, type UploadStatus } from \"../runtime/sync-status.js\";\nimport { REACT_NATIVE_UNSUPPORTED_ERROR } from \"./errors.js\";\n\n// The foreground command vocabulary is owned by jazz-rn. This module is\n// internal: no public declaration of jazz-tools reaches it, so applications\n// never need the optional jazz-rn peer to type-check.\ntype ForegroundCommand = Relay.NativeForegroundCommand;\ntype ForegroundResponse = Relay.NativeForegroundResponse;\ntype ForegroundMutationKind = Extract<ForegroundCommand, { type: \"directMutation\" }>[\"mutation\"];\ntype NativeConnectionStatus = Extract<ForegroundResponse, { type: \"nativeConnectionStatus\" }>;\n/** An upstream connection failure other than a refused credential (#4337). */\nexport type NativeUpstreamFailure = { reason: string; retrying: boolean };\ntype ForegroundMutationOptions = {\n rowId?: Uint8Array;\n branch?: unknown;\n head?: unknown;\n base?: unknown;\n updatedAtMs?: number;\n author?: Uint8Array;\n attribution?: Uint8Array;\n};\n\nexport type NativeForegroundRuntime = Relay.NativeForegroundRuntime;\nexport type NativeForegroundFactory = Relay.NativeForegroundRuntimeFactory;\nexport type NativeForegroundModule = Pick<\n typeof Relay,\n | \"installNativeForegroundRuntime\"\n | \"encodeNativeForegroundCommand\"\n | \"decodeNativeForegroundResponse\"\n>;\n\n/**\n * Narrow NativeDb consumer for the first JSI foreground slice.\n *\n * Rows and subscription deltas stay in the ordinary binding byte format, so\n * NativeRuntimeAdapter remains the sole schema-aware decoder. This is not a\n * second object-shaped database facade and intentionally grows only as the\n * shared Rust command ABI grows.\n */\n/**\n * Thin `NativeDb` adapter over the native foreground command ABI.\n *\n * This deliberately contains no row, query, or mutation interpretation: the\n * normal `NativeRuntimeAdapter` owns the public API and existing codecs. A\n * direct mutation is represented by one ordinary native mergeable transaction;\n * explicit public transactions retain their native transaction handle until\n * commit/rollback.\n */\nexport class NativeForegroundDb {\n private closed = false;\n private mutationErrorCallback: ((event: MutationErrorEvent) => void) | undefined;\n private authRejectedCallback: ((reason: string) => void) | undefined;\n /** The sequence of the refusal last reported, so each is reported once. */\n private reportedAuthRejection = 0;\n private upstreamFailureCallback: ((failure: NativeUpstreamFailure | null) => void) | undefined;\n /** The upstream failure last reported, so each change is reported once. */\n private reportedUpstreamFailure: { sequence: number; retrying: boolean } | null = null;\n private readonly transactions = new Map<string, NativeForegroundTransaction>();\n /** A native build without the (append-only) slow-query commands. */\n private slowQueryLogUnsupported = false;\n private pendingUploadCountUnsupported = false;\n private uploadStatusUnsupported = false;\n\n constructor(\n private readonly runtime: NativeForegroundRuntime,\n private readonly commands: NativeForegroundModule,\n ) {}\n\n setTickScheduler(callback: (first: Error | string | null, second?: string) => void): void {\n if (!this.runtime.setTickScheduler) {\n throw new Error(\n \"React Native native foreground runtime does not expose owner wake scheduling\",\n );\n }\n this.runtime.setTickScheduler((urgency) => {\n // Native invalidation clears the JSI registration first, but a\n // CallInvoker task may already have crossed into JS when close races\n // teardown. Do not let that stale task re-enter the adapter after its\n // foreground facade has become unusable.\n if (!this.closed) callback(urgency);\n });\n }\n\n onMutationError(callback: (event: MutationErrorEvent) => void): void {\n this.assertOpen();\n this.mutationErrorCallback = callback;\n }\n\n /**\n * Observe the upstream refusing the scope's credential. The refusal is auth\n * state, not a failed tick: local ticks keep running, and the tick that\n * first sees a refusal reports it once, so the app can renew the\n * credential (#4248, #4296).\n */\n onAuthRejected(callback: (reason: string) => void): void {\n this.assertOpen();\n this.authRejectedCallback = callback;\n }\n\n /**\n * Observe the scope's upstream connection failing for a reason other than\n * its credential, and recovering (`null`). A failure is connection state,\n * not a failed tick: local ticks keep running (#4337).\n */\n onUpstreamFailure(callback: (failure: NativeUpstreamFailure | null) => void): void {\n this.assertOpen();\n this.upstreamFailureCallback = callback;\n }\n\n all(\n query: Uint8Array,\n opts: unknown,\n openTransactionId?: string,\n ): Uint8Array | { poll(): Uint8Array | null; cancel(): void } {\n const transaction =\n openTransactionId === undefined\n ? undefined\n : this.openTransaction(openTransactionId, \"read\").handle;\n // No tick here: the native relay owner applies admitted writes and pumps\n // on its own thread. The read is fenced natively behind every write\n // admitted before it, so it resolves (possibly as pending) with them.\n const response = this.execute({\n type: \"all\",\n query,\n optionsJson: JSON.stringify(opts ?? {}),\n transaction,\n });\n if (response.type === \"rows\") return response.rows;\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type === \"pending\") return this.pendingRows(response.operation);\n return unexpected(\"all\", response.type);\n }\n\n captureSnapshot(): Uint8Array | { poll(): Uint8Array | null; cancel(): void } {\n this.assertOpen();\n if (this.runtime.supportsSnapshotCapture !== true) {\n throw new UnsupportedSnapshotError(\n \"Capturing snapshots requires a newer Jazz native build; rebuild the native app to use captureSnapshot()\",\n );\n }\n const response = this.execute({ type: \"captureSnapshot\" });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type === \"rows\") return response.rows;\n if (response.type === \"pending\") return this.pendingRows(response.operation);\n return unexpected(\"captureSnapshot\", response.type);\n }\n\n // The shared mutation adapter needs one exact local row, without coverage\n // registration or hydration, to merge staged patches synchronously.\n localCurrentRow(table: string, rowId: Uint8Array): Uint8Array {\n const response = this.execute({ type: \"localCurrentRow\", table, rowId });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"rows\") return unexpected(\"localCurrentRow\", response.type);\n return response.rows;\n }\n\n subscribe(query: Uint8Array, opts: unknown): NativeForegroundSubscription {\n // Fenced natively like `all()`: the first frame reflects earlier writes.\n const response = this.execute({\n type: \"subscribe\",\n query,\n optionsJson: JSON.stringify(opts ?? {}),\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"subscribed\") return unexpected(\"subscribe\", response.type);\n return new NativeForegroundSubscription(response.subscription, this);\n }\n\n tick(): void {\n this.assertOpen();\n this.runtime.tick();\n if (!this.mutationErrorCallback && !this.authRejectedCallback && !this.upstreamFailureCallback)\n return;\n // One call drains everything a tick reports.\n const response = this.execute({ type: \"drainTickEvents\" });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"tickEvents\") return unexpected(\"drainTickEvents\", response.type);\n const rejection = response.authRejection;\n if (rejection && rejection.sequence !== this.reportedAuthRejection) {\n this.reportedAuthRejection = rejection.sequence;\n queueMicrotask(() => {\n if (!this.closed) this.authRejectedCallback?.(rejection.reason);\n });\n }\n const failure = response.upstreamFailure;\n const reported = this.reportedUpstreamFailure;\n if (\n failure\n ? failure.sequence !== reported?.sequence || failure.retrying !== reported.retrying\n : reported\n ) {\n this.reportedUpstreamFailure = failure && {\n sequence: failure.sequence,\n retrying: failure.retrying,\n };\n const change = failure && { reason: failure.reason, retrying: failure.retrying };\n queueMicrotask(() => {\n if (!this.closed) this.upstreamFailureCallback?.(change);\n });\n }\n // The drain claims mutation errors; with no observer they are dropped.\n if (!this.mutationErrorCallback) return;\n const events = JSON.parse(response.eventsJson) as MutationErrorEvent[];\n for (const event of events)\n queueMicrotask(() => {\n if (!this.closed) this.mutationErrorCallback?.(event);\n });\n }\n\n close(): boolean {\n if (this.closed) return false;\n this.closed = true;\n this.transactions.clear();\n try {\n const response = this.executeAllowClosed(\"close\");\n if (response.type !== \"closed\") return unexpected(\"close\", response.type);\n return response.closed;\n } finally {\n // The command owns logical Db closure. The HostObject close releases the\n // JSI handle and is deliberately safe to call after that transition.\n // It must also run when command execution fails (for example, because a\n // platform logout revoked the capability just before this call).\n this.runtime.close();\n }\n }\n\n /**\n * The slow-query report due now: one line per slow query shape, naming\n * `app`. An older native build without the command reports nothing.\n */\n takeSlowQueryReport(app?: string): string[] {\n if (this.slowQueryLogUnsupported || this.closed) return [];\n let response: ForegroundResponse;\n try {\n response = this.execute({ type: \"takeSlowQueryReport\", app });\n } catch {\n this.slowQueryLogUnsupported = true;\n return [];\n }\n if (response.type !== \"slowQueryReport\") {\n this.slowQueryLogUnsupported = true;\n return [];\n }\n return response.lines;\n }\n\n /**\n * This foreground's uploads. An older native build without the command\n * reports the pending count alone, and one older still reports none.\n */\n uploadStatus(): UploadStatus {\n if (this.closed) return NO_UPLOADS;\n if (this.uploadStatusUnsupported) return uploadStatusFromCount(this.pendingUploadCount());\n let response: ForegroundResponse;\n try {\n response = this.execute({ type: \"uploadStatus\" });\n } catch (error) {\n // As for the count: only a host that rejects the command lacks it.\n if (rejectsCommand(error)) this.uploadStatusUnsupported = true;\n return this.uploadStatusUnsupported\n ? uploadStatusFromCount(this.pendingUploadCount())\n : NO_UPLOADS;\n }\n if (response.type !== \"uploadStatus\") {\n this.uploadStatusUnsupported = true;\n return uploadStatusFromCount(this.pendingUploadCount());\n }\n return JSON.parse(response.statusJson) as UploadStatus;\n }\n\n /**\n * How many of this foreground's commits still wait for the server's\n * verdict. An older native build without the command reports none.\n */\n pendingUploadCount(): number {\n if (this.pendingUploadCountUnsupported || this.closed) return 0;\n let response: ForegroundResponse;\n try {\n response = this.execute({ type: \"pendingUploadCount\" });\n } catch (error) {\n // An older host rejects the unknown command (InvalidCommand). A busy\n // host or a revoked handle is transient and must not disable the count.\n if (rejectsCommand(error)) this.pendingUploadCountUnsupported = true;\n return 0;\n }\n if (response.type !== \"pendingUploadCount\") {\n this.pendingUploadCountUnsupported = true;\n return 0;\n }\n return response.count;\n }\n\n /** Report query runs of at least `ms` milliseconds; 0 turns the log off. */\n setSlowQueryThresholdMs(ms: number): void {\n if (this.slowQueryLogUnsupported || this.closed) return;\n let response: ForegroundResponse;\n try {\n response = this.execute({ type: \"setSlowQueryThresholdMs\", ms: Math.round(ms) });\n } catch {\n this.slowQueryLogUnsupported = true;\n return;\n }\n if (response.type !== \"slowQueryThresholdSet\") this.slowQueryLogUnsupported = true;\n }\n\n isNativeForegroundClosed(): boolean {\n // Only a typed native closed/revoked receipt suppresses a stale wake.\n // Missing support or any unexpected native/probe failure is not closure.\n return this.closed || this.runtime.isClosed?.() === true;\n }\n\n nativeSessionMetadata(): {\n node: Uint8Array;\n registryAuthority: string;\n accountId: string | null;\n issuer: string;\n userId: string;\n } {\n const response = this.execute({ type: \"nativeSessionMetadata\" });\n if (response.type !== \"nativeSessionMetadata\")\n return unexpected(\"nativeSessionMetadata\", response.type);\n return response;\n }\n\n disconnectNativeUpstream(): void {\n const response = this.execute({ type: \"disconnectNativeUpstream\" });\n if (response.type !== \"nativeConnectionStatus\")\n return unexpected(\"disconnectNativeUpstream\", response.type);\n }\n\n reconnectNativeUpstream(): void {\n const response = this.execute({ type: \"reconnectNativeUpstream\" });\n if (response.type !== \"nativeConnectionStatus\")\n return unexpected(\"reconnectNativeUpstream\", response.type);\n }\n\n nativeConnectionStatus(): NativeConnectionStatus {\n const response = this.execute({ type: \"nativeConnectionStatus\" });\n if (response.type !== \"nativeConnectionStatus\")\n return unexpected(\"nativeConnectionStatus\", response.type);\n return response;\n }\n\n rejectAuthUpdate(): never {\n throw new Error(\n \"React Native native foreground cannot rotate authentication in place; keep the existing admitted session or revoke the old native capability and create a new Db for the newly admitted session\",\n );\n }\n\n drain(subscription: number, operation?: number): unknown[] | { pendingOperation: number } {\n const response =\n operation === undefined\n ? this.execute({ type: \"drainSubscription\", subscription })\n : this.execute({ type: \"poll\", operation });\n if (response.type === \"pending\") return { pendingOperation: response.operation };\n if (response.type === \"operationError\") {\n throw foregroundOperationError({\n ...response,\n reason: `React Native native foreground subscription failed: ${response.reason}`,\n });\n }\n if (response.type !== \"subscriptionEvents\")\n return unexpected(\"drainSubscription\", response.type);\n return response.events.map((event) => {\n if (event.type === \"delta\") return event;\n if (event.type === \"closed\") return event;\n return {\n type: \"rejected\",\n reason: { type: \"ServerFailure\", code: event.reason },\n };\n });\n }\n\n unsubscribe(subscription: number): boolean {\n if (this.closed) return false;\n const response = this.execute({ type: \"unsubscribe\", subscription });\n if (response.type !== \"unsubscribed\") return unexpected(\"unsubscribe\", response.type);\n // Native unsubscribe retires the stream handle synchronously but queues\n // its core cleanup for the following ordinary turn. Drive that turn here:\n // after the JS reader stops polling there may be no unrelated operation\n // to do it for us.\n if (response.closed) this.tick();\n return response.closed;\n }\n\n requestInsertPermissionAdvice(table: string, cells: Uint8Array) {\n return this.requestPermissionAdvice({ type: \"insert\", table, cells });\n }\n\n requestReadPermissionAdvice(table: string, rowId: Uint8Array) {\n return this.requestPermissionAdvice({ type: \"read\", table, rowId });\n }\n\n requestUpdatePermissionAdvice(table: string, rowId: Uint8Array, patch: Uint8Array) {\n return this.requestPermissionAdvice({ type: \"update\", table, rowId, patch });\n }\n\n requestDeletePermissionAdvice(table: string, rowId: Uint8Array) {\n return this.requestPermissionAdvice({ type: \"delete\", table, rowId });\n }\n\n private requestPermissionAdvice(action: Relay.NativeForegroundPermissionAdviceAction) {\n let response = this.execute({ type: \"permissionAdvice\", action });\n if (response.type === \"permissionAdvice\") return response.advice;\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"pending\") return unexpected(\"permissionAdvice\", response.type);\n const operation = response.operation;\n let completed = false;\n return {\n poll: (): string | null => {\n if (completed || this.closed) return \"unknown\";\n this.tick();\n response = this.execute({ type: \"poll\", operation });\n if (response.type === \"pending\") return null;\n completed = true;\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"permissionAdvice\")\n return unexpected(\"permissionAdvice\", response.type);\n return response.advice;\n },\n cancel: (): boolean => {\n if (completed || this.closed) return false;\n completed = true;\n const cancelled = this.execute({ type: \"cancel\", operation });\n if (cancelled.type !== \"cancelled\")\n return unexpected(\"permissionAdvice cancellation\", cancelled.type);\n return cancelled.cancelled;\n },\n };\n }\n\n /**\n * Resolve once every local write so far reached `tier`. A wait that does\n * not settle at once is a pollable read, so a caller that stops waiting\n * cancels it.\n */\n waitForPendingWrites(\n tier: string,\n ): Uint8Array | { poll(): Uint8Array | null; cancel(): boolean } {\n let response = this.execute({ type: \"waitForPendingWrites\", tier });\n const settle = (): Uint8Array => {\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"rows\" || response.rows.length !== 0)\n return unexpected(\"waitForPendingWrites\", response.type);\n return response.rows;\n };\n if (response.type !== \"pending\") return settle();\n const operation = response.operation;\n let completed = false;\n return {\n poll: (): Uint8Array | null => {\n if (completed || this.closed) throw new Error(\"waitForPendingWrites was cancelled\");\n this.tick();\n response = this.execute({ type: \"poll\", operation });\n if (response.type === \"pending\") return null;\n completed = true;\n return settle();\n },\n cancel: (): boolean => {\n if (completed || this.closed) return false;\n completed = true;\n const cancelled = this.execute({ type: \"cancel\", operation });\n if (cancelled.type !== \"cancelled\")\n return unexpected(\"waitForPendingWrites cancellation\", cancelled.type);\n return cancelled.cancelled;\n },\n };\n }\n\n async waitForTransaction(txId: Uint8Array, tier: string, observeOnly = false): Promise<void> {\n if (![\"local\", \"global\"].includes(tier)) {\n throw new Error(`Unsupported write durability tier: ${tier}`);\n }\n let response = this.execute({ type: \"waitForTransaction\", txId, tier, observeOnly });\n while (response.type === \"pending\") {\n const operation = response.operation;\n await new Promise<void>((resolve) => setTimeout(resolve, 0));\n this.tick();\n response = this.execute({ type: \"poll\", operation });\n }\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"transactionSettled\")\n return unexpected(\"waitForTransaction\", response.type);\n }\n\n private execute(command: ForegroundCommand): ForegroundResponse {\n this.assertOpen();\n return this.executeAllowClosed(command);\n }\n\n private pendingRows(operation: number): { poll(): Uint8Array | null; cancel(): void } {\n let completed = false;\n return {\n poll: () => {\n if (completed) throw new Error(\"Native foreground read is already complete\");\n this.tick();\n const response = this.execute({ type: \"poll\", operation });\n if (response.type === \"pending\") return null;\n completed = true;\n if (response.type === \"operationError\") {\n throw foregroundOperationError({\n ...response,\n reason: `React Native native foreground read failed: ${response.reason}`,\n });\n }\n if (response.type !== \"rows\") return unexpected(\"poll\", response.type);\n return response.rows;\n },\n cancel: () => {\n if (completed || this.closed) return;\n completed = true;\n const response = this.execute({ type: \"cancel\", operation });\n if (response.type !== \"cancelled\") return unexpected(\"read cancellation\", response.type);\n },\n };\n }\n\n private executeAllowClosed(command: ForegroundCommand): ForegroundResponse {\n return this.commands.decodeNativeForegroundResponse(\n this.runtime.execute(this.commands.encodeNativeForegroundCommand(command)),\n );\n }\n\n private assertOpen(): void {\n if (this.closed) throw new Error(\"React Native native foreground runtime is closed\");\n }\n\n // The admitted native host already owns and validates the schema. A schema\n // view therefore shares this foreground rather than opening a second store.\n registerSchema(): NativeForegroundDb {\n return this;\n }\n\n beginTransaction(openTransactionId: string, kind: \"mergeable\" | \"serializable\"): void {\n this.assertOpen();\n if (this.transactions.has(openTransactionId)) {\n throw new Error(\n `React Native native foreground transaction ${openTransactionId} is already open`,\n );\n }\n const response = this.execute({ type: \"beginTransaction\", kind });\n if (response.type !== \"transactionOpened\") return unexpected(\"beginTransaction\", response.type);\n this.transactions.set(openTransactionId, {\n handle: response.transaction,\n kind,\n closed: false,\n });\n }\n\n commitTransaction(openTransactionId: string): NativeForegroundWrite {\n const transaction = this.openTransaction(openTransactionId, \"commit\");\n const response = this.execute({\n type: \"commitTransaction\",\n transaction: transaction.handle,\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"transactionCommitted\")\n return unexpected(\"commitTransaction\", response.type);\n this.transactions.delete(openTransactionId);\n transaction.closed = true;\n return nativeWrite(this, response.txId);\n }\n\n rollbackTransaction(openTransactionId: string): void {\n const transaction = this.openTransaction(openTransactionId, \"rollback\");\n const response = this.execute({\n type: \"rollbackTransaction\",\n transaction: transaction.handle,\n });\n if (response.type !== \"transactionRolledBack\")\n return unexpected(\"rollbackTransaction\", response.type);\n this.transactions.delete(openTransactionId);\n transaction.closed = true;\n }\n\n insert(\n table: string,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n return this.directMutation(\"insert\", table, options?.rowId, cells, options);\n }\n\n insertInTransaction(\n openTransactionId: string,\n table: string,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): Uint8Array {\n return this.stageMutation(\n this.openTransaction(openTransactionId, \"insert into\"),\n \"insert\",\n table,\n options?.rowId,\n cells,\n options,\n );\n }\n\n update(\n table: string,\n rowId: Uint8Array,\n patch: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n return this.directMutation(\"update\", table, rowId, patch, options);\n }\n\n updateInTransaction(\n openTransactionId: string,\n table: string,\n rowId: Uint8Array,\n patch: Uint8Array,\n options?: ForegroundMutationOptions,\n ): void {\n this.stageMutation(\n this.openTransaction(openTransactionId, \"update in\"),\n \"update\",\n table,\n rowId,\n patch,\n options,\n );\n }\n\n upsert(\n table: string,\n rowId: Uint8Array,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n return this.directMutation(\"upsert\", table, rowId, cells, options);\n }\n\n upsertInTransaction(\n openTransactionId: string,\n table: string,\n rowId: Uint8Array,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): void {\n this.stageMutation(\n this.openTransaction(openTransactionId, \"upsert into\"),\n \"upsert\",\n table,\n rowId,\n cells,\n options,\n );\n }\n\n delete(\n table: string,\n rowId: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n return this.directMutation(\"delete\", table, rowId, new Uint8Array(), options);\n }\n\n deleteInTransaction(\n openTransactionId: string,\n table: string,\n rowId: Uint8Array,\n options?: ForegroundMutationOptions,\n ): void {\n this.stageMutation(\n this.openTransaction(openTransactionId, \"delete from\"),\n \"delete\",\n table,\n rowId,\n new Uint8Array(),\n options,\n );\n }\n\n restore(\n table: string,\n rowId: Uint8Array,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n return this.directMutation(\"restore\", table, rowId, cells, options);\n }\n\n restoreInTransaction(\n openTransactionId: string,\n table: string,\n rowId: Uint8Array,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): void {\n this.stageMutation(\n this.openTransaction(openTransactionId, \"restore in\"),\n \"restore\",\n table,\n rowId,\n cells,\n options,\n );\n }\n\n connectUpstream(): never {\n return unsupported(\"JavaScript upstream transport\");\n }\n\n writeState(txId: Uint8Array): unknown {\n const response = this.execute({ type: \"writeState\", txId });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"writeState\") return unexpected(\"writeState\", response.type);\n return JSON.parse(response.stateJson);\n }\n\n updateLargeValues(\n table: string,\n rowId: Uint8Array,\n patch: Uint8Array,\n descriptors: readonly unknown[],\n updatedAtMs?: number,\n ): NativeForegroundWrite {\n const response = this.execute({\n type: \"updateLargeValues\",\n table,\n rowId,\n patch,\n descriptorsJson: JSON.stringify(descriptors),\n updatedAtMs,\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"transactionCommitted\")\n return unexpected(\"updateLargeValues\", response.type);\n return nativeWrite(this, response.txId, rowId);\n }\n\n beginStreamingMutation(\n table: string,\n rowId: Uint8Array,\n cells: Uint8Array,\n column: string,\n mutation: \"insert\" | \"update\" | \"upsert\" = \"insert\",\n _author?: Uint8Array,\n _attribution?: Uint8Array,\n updatedAtMs?: number,\n head?: unknown,\n base?: unknown,\n transaction?: string,\n ) {\n if (updatedAtMs !== undefined && (!Number.isSafeInteger(updatedAtMs) || updatedAtMs < 0)) {\n throw new Error(\"updatedAtMs must be a non-negative safe integer\");\n }\n const response = this.execute({\n type: \"beginStreamingMutation\",\n mutation,\n table,\n rowId,\n cells,\n column,\n optionsJson: JSON.stringify({ updatedAtMs, head, base, transaction }),\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"streamingMutationOpened\")\n return unexpected(\"beginStreamingMutation\", response.type);\n const upload = response.upload;\n let closed = false;\n const assertOpen = () => {\n if (closed) throw new Error(\"streaming mutation is closed\");\n this.assertOpen();\n };\n return {\n push: async (chunk: Uint8Array): Promise<void> => {\n assertOpen();\n const pushed = await this.completeMutationOperation(\n this.execute({ type: \"pushStreamingMutation\", upload, chunk }),\n );\n if (pushed.type === \"operationError\") throw foregroundOperationError(pushed);\n if (pushed.type !== \"streamingMutationPushed\")\n return unexpected(\"pushStreamingMutation\", pushed.type);\n },\n finishInTransaction: async (): Promise<void> => {\n assertOpen();\n const finished = await this.completeMutationOperation(\n this.execute({ type: \"finishStreamingMutation\", upload }),\n );\n closed = true;\n if (finished.type === \"operationError\") throw foregroundOperationError(finished);\n if (finished.type !== \"mutationStaged\")\n return unexpected(\"finishStreamingMutation\", finished.type);\n },\n finish: async (): Promise<NativeForegroundWrite> => {\n assertOpen();\n let finished = this.execute({ type: \"finishStreamingMutation\", upload });\n if (finished.type === \"operationError\") throw foregroundOperationError(finished);\n closed = true;\n while (finished.type === \"pending\") {\n const operation = finished.operation;\n await new Promise<void>((resolve) => setTimeout(resolve, 0));\n this.tick();\n finished = this.execute({ type: \"poll\", operation });\n }\n if (finished.type === \"operationError\") throw foregroundOperationError(finished);\n if (finished.type !== \"transactionCommitted\")\n return unexpected(\"finishStreamingMutation\", finished.type);\n return nativeWrite(this, finished.txId, rowId);\n },\n abort: async (): Promise<boolean> => {\n if (closed || this.closed) return false;\n const admitted = this.execute({ type: \"abortStreamingMutation\", upload });\n if (admitted.type === \"operationError\") throw foregroundOperationError(admitted);\n closed = true;\n const aborted = await this.completeMutationOperation(admitted);\n if (aborted.type === \"operationError\") throw foregroundOperationError(aborted);\n if (aborted.type !== \"streamingMutationAborted\")\n return unexpected(\"abortStreamingMutation\", aborted.type);\n return aborted.aborted;\n },\n };\n }\n\n private async completeMutationOperation(\n response: ForegroundResponse,\n ): Promise<ForegroundResponse> {\n while (response.type === \"pending\") {\n const operation = response.operation;\n await new Promise<void>((resolve) => setTimeout(resolve, 0));\n this.tick();\n response = this.execute({ type: \"poll\", operation });\n }\n return response;\n }\n\n private directMutation(\n mutation: ForegroundMutationKind,\n table: string,\n rowId: Uint8Array | undefined,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n if (mutation === \"upsert\" && options && \"branch\" in options)\n throw new Error(\"upsert option `branch` is not supported; use `head`\");\n if (\n options?.updatedAtMs !== undefined &&\n (!Number.isSafeInteger(options.updatedAtMs) || options.updatedAtMs < 0)\n )\n throw new Error(\"updatedAtMs must be a non-negative safe integer\");\n const {\n rowId: _rowId,\n author: _author,\n attribution: _attribution,\n ...wireOptions\n } = options ?? {};\n const response = this.execute({\n type: \"directMutation\",\n mutation,\n table,\n rowId,\n cells,\n optionsJson: JSON.stringify(wireOptions),\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"mutationCommitted\") return unexpected(mutation, response.type);\n return nativeWrite(this, response.txId, response.rowId);\n }\n\n private stageMutation(\n transaction: NativeForegroundTransaction,\n mutation: ForegroundMutationKind,\n table: string,\n rowId: Uint8Array | undefined,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): Uint8Array {\n if (transaction.closed) throw new Error(\"React Native native foreground transaction is closed\");\n if (mutation === \"upsert\" && options && \"branch\" in options) {\n throw new Error(\n \"upsert option `branch` is not supported; use `head` (and optional `base`) for a branch view\",\n );\n }\n if (\n options?.updatedAtMs !== undefined &&\n (!Number.isSafeInteger(options.updatedAtMs) || options.updatedAtMs < 0)\n ) {\n throw new Error(\"updatedAtMs must be a non-negative safe integer\");\n }\n // Identity belongs to the admitted native capability, never the command.\n const {\n rowId: _rowId,\n author: _author,\n attribution: _attribution,\n ...wireOptions\n } = options ?? {};\n const response = this.execute({\n type: \"stageMutation\",\n transaction: transaction.handle,\n mutation,\n table,\n rowId,\n cells,\n optionsJson: JSON.stringify(wireOptions),\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (mutation === \"insert\" && response.type === \"inserted\") return response.rowId;\n if (mutation !== \"insert\" && response.type === \"mutationStaged\") return rowId!;\n return unexpected(mutation, response.type);\n }\n\n private openTransaction(id: string, operation: string): NativeForegroundTransaction {\n const transaction = this.transactions.get(id);\n if (!transaction || transaction.closed) {\n throw new Error(\n `React Native native foreground cannot ${operation} unknown transaction ${id}`,\n );\n }\n return transaction;\n }\n}\n\ntype NativeForegroundTransaction = {\n handle: number;\n kind: \"mergeable\" | \"serializable\";\n closed: boolean;\n};\n\ntype NativeForegroundWrite = {\n /** Public write identity. Native binding spellings are normalized here. */\n readonly txId: string;\n readonly payload: Uint8Array;\n readonly rowId: Uint8Array;\n wait(tier: string, observeOnly?: boolean): Promise<void>;\n writeState(): unknown;\n close(): boolean;\n};\n\nfunction nativeWrite(\n db: NativeForegroundDb,\n txId: Uint8Array<ArrayBufferLike>,\n rowId: Uint8Array<ArrayBufferLike> = new Uint8Array(16),\n): NativeForegroundWrite {\n const id = formatTransactionId(txId);\n let closed = false;\n return {\n txId: id,\n payload: new Uint8Array(),\n rowId: rowId.slice(),\n async wait(tier: string, observeOnly = false): Promise<void> {\n if (closed) throw new Error(\"write state is unavailable\");\n await db.waitForTransaction(txId, tier, observeOnly);\n },\n writeState: () => {\n if (closed) throw new Error(\"write state is unavailable\");\n return db.writeState(txId);\n },\n close: () => {\n if (closed) return false;\n closed = true;\n return true;\n },\n };\n}\n\nclass NativeForegroundSubscription {\n private closed = false;\n private pendingOperation: number | undefined;\n\n constructor(\n private readonly handle: number,\n private readonly db: NativeForegroundDb,\n ) {}\n\n readAll(): unknown[] | { retryAfterMs(): number } {\n if (this.closed) return [];\n // Native core publication already materializes the canonical event before\n // waking this owner. Keep this pull delivery-only: a foreground read must\n // never run a full relay tick while the JS mutation call is returning.\n const events = this.db.drain(this.handle, this.pendingOperation);\n if (!Array.isArray(events)) {\n this.pendingOperation = events.pendingOperation;\n return { retryAfterMs: () => 0 };\n }\n this.pendingOperation = undefined;\n // An empty batch is a ready native pull with no current event. Returning\n // it lets NativeRuntimeAdapter finish the reader so the next native wake\n // can restart it; a timer here recreates the old relay-polling latency.\n return events;\n }\n\n close(): boolean {\n if (this.closed) return false;\n this.closed = true;\n return this.db.unsubscribe(this.handle);\n }\n}\n\n/**\n * The error a failed foreground operation throws: the unchanged reason text as\n * the message, plus the stable core `code` when a core error caused it.\n */\nfunction foregroundOperationError(response: {\n reason: string;\n code?: string;\n reasonName?: string;\n}): Error {\n const error = new Error(response.reason);\n if (response.code !== undefined) Object.assign(error, { code: response.code });\n if (response.reasonName !== undefined) Object.assign(error, { reason: response.reasonName });\n return error;\n}\n\nfunction unsupported(operation: string): never {\n throw new Error(`${REACT_NATIVE_UNSUPPORTED_ERROR}; ${operation} is unavailable`);\n}\n\nfunction unexpected(operation: string, response: string): never {\n throw new Error(\n `React Native native foreground ${operation} returned unexpected ${response} response`,\n );\n}\n\nfunction formatTransactionId(bytes: Uint8Array<ArrayBufferLike>): string {\n if (bytes.byteLength !== 16)\n throw new Error(\"React Native native foreground returned malformed transaction id\");\n const hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, \"0\")).join(\"\");\n return hex;\n}\n\n/** Whether the native host refused a command it does not know. */\nfunction rejectsCommand(error: unknown): boolean {\n const message = error instanceof Error ? error.message : String(error);\n return message.includes(\"runtime failed during execute\");\n}\n"]}
|
|
@@ -1,35 +1,30 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
import { type JazzAppViewProps } from "../react-core/app.js";
|
|
3
|
-
import type { JazzSession } from "../session/state.js";
|
|
4
|
-
import { type JazzClientConfig } from "./create-jazz-session.js";
|
|
5
1
|
import type { PublicSession } from "../runtime/context.js";
|
|
6
2
|
import type { Db } from "../runtime/db.js";
|
|
7
3
|
import { useSession } from "../react-core/provider.js";
|
|
8
|
-
import { type
|
|
9
|
-
import type {
|
|
4
|
+
import { type JazzSessionSourceProps, type JazzSessionViewProps } from "../react-core/session.js";
|
|
5
|
+
import type { SessionCore } from "../session/state.js";
|
|
6
|
+
import { type JazzClientConfig } from "./create-jazz-session.js";
|
|
7
|
+
import type { JazzClient as CreatedJazzClient } from "./create-jazz-client.js";
|
|
10
8
|
export { JazzClientProvider, type JazzClientProviderProps } from "../react-core/provider.js";
|
|
11
9
|
interface JazzClientContextValue {
|
|
12
10
|
db: Db;
|
|
13
11
|
session: PublicSession | null;
|
|
14
12
|
shutdown: CreatedJazzClient["shutdown"];
|
|
15
13
|
}
|
|
16
|
-
export type
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
export type JazzProviderProps = JazzSessionSourceProps<JazzClientConfig, CreatedJazzClient> & JazzSessionViewProps<CreatedJazzClient>;
|
|
15
|
+
/**
|
|
16
|
+
* Jazz for a React Native app: owns a session (`config`) or shows yours
|
|
17
|
+
* (`session`), renders `children` with its client once someone is signed in,
|
|
18
|
+
* and `signedOut`, `loading` or `error` otherwise. Read the session anywhere
|
|
19
|
+
* below with `useJazzSession()`.
|
|
20
|
+
*/
|
|
23
21
|
export declare function JazzProvider(props: JazzProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
24
22
|
export declare function useJazzClient(): JazzClientContextValue;
|
|
25
23
|
export declare function useDb(): Db;
|
|
26
24
|
export { useSession };
|
|
27
25
|
export type { JazzClientContextValue };
|
|
28
|
-
/** The
|
|
29
|
-
export declare function
|
|
30
|
-
|
|
31
|
-
}>({ config, createJazzClient, loading, error, ...view }: JazzAppViewProps<CreatedJazzClient> & {
|
|
32
|
-
config: Config;
|
|
33
|
-
createJazzClient: (config: Config) => Promise<JazzSession<CreatedJazzClient>>;
|
|
26
|
+
/** @internal The provider shared by React Native and Expo, with native default views. */
|
|
27
|
+
export declare function NativeJazzProvider<Config>(props: JazzSessionSourceProps<Config, CreatedJazzClient> & JazzSessionViewProps<CreatedJazzClient> & {
|
|
28
|
+
openCore: (config: Config) => Promise<SessionCore<CreatedJazzClient>>;
|
|
34
29
|
}): import("react/jsx-runtime").JSX.Element;
|
|
35
30
|
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/react-native/provider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/react-native/provider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAGL,UAAU,EACX,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,EAAyB,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,KAAK,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE/E,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAE7F,UAAU,sBAAsB;IAC9B,EAAE,EAAE,EAAE,CAAC;IACP,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IAC9B,QAAQ,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;CACzC;AAED,MAAM,MAAM,iBAAiB,GAAG,sBAAsB,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,GACzF,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAE1C;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAEpD;AAED,wBAAgB,aAAa,IAAI,sBAAsB,CAEtD;AAED,wBAAgB,KAAK,IAAI,EAAE,CAE1B;AAED,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,sBAAsB,EAAE,CAAC;AAEvC,yFAAyF;AACzF,wBAAgB,kBAAkB,CAAC,MAAM,EACvC,KAAK,EAAE,sBAAsB,CAAC,MAAM,EAAE,iBAAiB,CAAC,GACtD,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IACxC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC,CAAC;CACvE,2CAkCJ"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { View, Text, Pressable } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
3
|
+
import { useDb as useCoreDb, useJazzClient as useCoreJazzClient, useSession, } from "../react-core/provider.js";
|
|
4
|
+
import { JazzSessionProvider, } from "../react-core/session.js";
|
|
5
|
+
import { refuseRemovedProviderProps } from "../react/provider-props.js";
|
|
6
|
+
import { assertNoClassicProviderProps } from "../classic-api.js";
|
|
7
|
+
import { openNativeSessionCore } from "./create-jazz-session.js";
|
|
8
8
|
export { JazzClientProvider } from "../react-core/provider.js";
|
|
9
|
+
/**
|
|
10
|
+
* Jazz for a React Native app: owns a session (`config`) or shows yours
|
|
11
|
+
* (`session`), renders `children` with its client once someone is signed in,
|
|
12
|
+
* and `signedOut`, `loading` or `error` otherwise. Read the session anywhere
|
|
13
|
+
* below with `useJazzSession()`.
|
|
14
|
+
*/
|
|
9
15
|
export function JazzProvider(props) {
|
|
10
|
-
|
|
11
|
-
return _jsx(ApplicationJazzProvider, { ...props });
|
|
12
|
-
const { config, fallback, children } = props;
|
|
13
|
-
return (_jsx(CoreJazzProvider, { config: config, fallback: fallback, openJazzClient: createClient, children: children }));
|
|
16
|
+
return _jsx(NativeJazzProvider, { ...props, openCore: openNativeSessionCore });
|
|
14
17
|
}
|
|
15
18
|
export function useJazzClient() {
|
|
16
19
|
return useCoreJazzClient();
|
|
@@ -19,15 +22,13 @@ export function useDb() {
|
|
|
19
22
|
return useCoreDb();
|
|
20
23
|
}
|
|
21
24
|
export { useSession };
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return (_jsx(ConfiguredJazzAppProvider, { ...view, config: config, createJazzClient: createJazzClient, loading: loading === undefined ? (_jsx(View, { children: _jsx(Text, { children: "Loading\u2026" }) })) : (loading), error: error === undefined
|
|
30
|
-
? (state) => (_jsxs(View, { accessibilityRole: "alert", children: [_jsx(Text, { children: "We couldn\u2019t connect to your account. Please try again." }), _jsx(Pressable, { accessibilityRole: "button", onPress: () => void state.retry(), children: _jsx(Text, { children: "Try again" }) })] }))
|
|
25
|
+
/** @internal The provider shared by React Native and Expo, with native default views. */
|
|
26
|
+
export function NativeJazzProvider(props) {
|
|
27
|
+
assertNoClassicProviderProps("JazzProvider", props);
|
|
28
|
+
refuseRemovedProviderProps(props);
|
|
29
|
+
const { loading, error, ...rest } = props;
|
|
30
|
+
return (_jsx(JazzSessionProvider, { ...rest, loading: loading === undefined ? (_jsx(View, { children: _jsx(Text, { children: "Loading\u2026" }) })) : (loading), error: error === undefined
|
|
31
|
+
? (state) => (_jsxs(View, { accessibilityRole: "alert", children: [_jsx(Text, { children: "Jazz couldn\u2019t start. Please try again." }), _jsx(Pressable, { accessibilityRole: "button", onPress: () => void state.retry().catch(() => { }), children: _jsx(Text, { children: "Try again" }) })] }))
|
|
31
32
|
: error }));
|
|
32
33
|
}
|
|
33
34
|
//# sourceMappingURL=provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/react-native/provider.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/react-native/provider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGrD,OAAO,EACL,KAAK,IAAI,SAAS,EAClB,aAAa,IAAI,iBAAiB,EAClC,UAAU,GACX,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,mBAAmB,GAGpB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAyB,MAAM,0BAA0B,CAAC;AAGxF,OAAO,EAAE,kBAAkB,EAAgC,MAAM,2BAA2B,CAAC;AAW7F;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,KAAwB;IACnD,OAAO,KAAC,kBAAkB,OAAK,KAAK,EAAE,QAAQ,EAAE,qBAAqB,GAAI,CAAC;AAC5E,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,iBAAiB,EAA4B,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,KAAK;IACnB,OAAO,SAAS,EAAM,CAAC;AACzB,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC;AAGtB,yFAAyF;AACzF,MAAM,UAAU,kBAAkB,CAChC,KAGG;IAEH,4BAA4B,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACpD,0BAA0B,CAAC,KAAK,CAAC,CAAC;IAClC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAC1C,OAAO,CACL,KAAC,mBAAmB,OACd,IAAI,EACR,OAAO,EACL,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,CACtB,KAAC,IAAI,cACH,KAAC,IAAI,gCAAgB,GAChB,CACR,CAAC,CAAC,CAAC,CACF,OAAO,CACR,EAEH,KAAK,EACH,KAAK,KAAK,SAAS;YACjB,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACT,MAAC,IAAI,IAAC,iBAAiB,EAAC,OAAO,aAC7B,KAAC,IAAI,8DAA8C,EACnD,KAAC,SAAS,IACR,iBAAiB,EAAC,QAAQ,EAC1B,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,KAAK,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,YAEjD,KAAC,IAAI,4BAAiB,GACZ,IACP,CACR;YACH,CAAC,CAAC,KAAK,GAEX,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { View, Text, Pressable } from \"react-native\";\nimport type { PublicSession } from \"../runtime/context.js\";\nimport type { Db } from \"../runtime/db.js\";\nimport {\n useDb as useCoreDb,\n useJazzClient as useCoreJazzClient,\n useSession,\n} from \"../react-core/provider.js\";\nimport {\n JazzSessionProvider,\n type JazzSessionSourceProps,\n type JazzSessionViewProps,\n} from \"../react-core/session.js\";\nimport type { SessionCore } from \"../session/state.js\";\nimport { refuseRemovedProviderProps } from \"../react/provider-props.js\";\nimport { assertNoClassicProviderProps } from \"../classic-api.js\";\nimport { openNativeSessionCore, type JazzClientConfig } from \"./create-jazz-session.js\";\nimport type { JazzClient as CreatedJazzClient } from \"./create-jazz-client.js\";\n\nexport { JazzClientProvider, type JazzClientProviderProps } from \"../react-core/provider.js\";\n\ninterface JazzClientContextValue {\n db: Db;\n session: PublicSession | null;\n shutdown: CreatedJazzClient[\"shutdown\"];\n}\n\nexport type JazzProviderProps = JazzSessionSourceProps<JazzClientConfig, CreatedJazzClient> &\n JazzSessionViewProps<CreatedJazzClient>;\n\n/**\n * Jazz for a React Native app: owns a session (`config`) or shows yours\n * (`session`), renders `children` with its client once someone is signed in,\n * and `signedOut`, `loading` or `error` otherwise. Read the session anywhere\n * below with `useJazzSession()`.\n */\nexport function JazzProvider(props: JazzProviderProps) {\n return <NativeJazzProvider {...props} openCore={openNativeSessionCore} />;\n}\n\nexport function useJazzClient(): JazzClientContextValue {\n return useCoreJazzClient() as JazzClientContextValue;\n}\n\nexport function useDb(): Db {\n return useCoreDb<Db>();\n}\n\nexport { useSession };\nexport type { JazzClientContextValue };\n\n/** @internal The provider shared by React Native and Expo, with native default views. */\nexport function NativeJazzProvider<Config>(\n props: JazzSessionSourceProps<Config, CreatedJazzClient> &\n JazzSessionViewProps<CreatedJazzClient> & {\n openCore: (config: Config) => Promise<SessionCore<CreatedJazzClient>>;\n },\n) {\n assertNoClassicProviderProps(\"JazzProvider\", props);\n refuseRemovedProviderProps(props);\n const { loading, error, ...rest } = props;\n return (\n <JazzSessionProvider\n {...rest}\n loading={\n loading === undefined ? (\n <View>\n <Text>Loading…</Text>\n </View>\n ) : (\n loading\n )\n }\n error={\n error === undefined\n ? (state) => (\n <View accessibilityRole=\"alert\">\n <Text>Jazz couldn’t start. Please try again.</Text>\n <Pressable\n accessibilityRole=\"button\"\n onPress={() => void state.retry().catch(() => {})}\n >\n <Text>Try again</Text>\n </Pressable>\n </View>\n )\n : error\n }\n />\n );\n}\n"]}
|
|
@@ -161,7 +161,7 @@ export class ReactNativeRuntimeSource extends RuntimeSource {
|
|
|
161
161
|
if (this.pendingCapability) {
|
|
162
162
|
const pending = this.pendingCapability;
|
|
163
163
|
try {
|
|
164
|
-
this.admittedCapability = attachNativeAccountSchema(this.foregroundFactory, pending, serializeSchemaSource(context.schema));
|
|
164
|
+
this.admittedCapability = attachNativeAccountSchema(this.foregroundFactory, pending, serializeSchemaSource(context.schema, context.migrations));
|
|
165
165
|
}
|
|
166
166
|
finally {
|
|
167
167
|
this.pendingCapability = null;
|