@pyric/cli 0.1.0-alpha.10 → 0.1.0-alpha.11
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.orig +2 -2
- package/dist/assurance/.generated/conformance-verdicts.d.ts +16 -0
- package/dist/assurance/.generated/conformance-verdicts.d.ts.map +1 -1
- package/dist/assurance/.generated/conformance-verdicts.js +16 -0
- package/dist/assurance/.generated/conformance-verdicts.js.map +1 -1
- package/dist/bridge/server/peer.d.ts +1 -1
- package/dist/bridge/server.d.ts +1 -1
- package/dist/bridge/server.js +1 -1
- package/dist/cli/index.d.ts +11 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +13 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init.d.ts +3 -3
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +5 -5
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/serve.d.ts.map +1 -1
- package/dist/cli/serve.js +8 -2
- package/dist/cli/serve.js.map +1 -1
- package/dist/conformance/.generated/can-i-use-browser.d.ts.map +1 -1
- package/dist/conformance/.generated/can-i-use-browser.js +1 -1
- package/dist/conformance/.generated/can-i-use-browser.js.map +1 -1
- package/dist/conformance/.generated/can-i-use.d.ts.map +1 -1
- package/dist/conformance/.generated/can-i-use.js +1 -1
- package/dist/conformance/.generated/can-i-use.js.map +1 -1
- package/dist/conformance/.generated/conformance-docs.d.ts +12 -0
- package/dist/conformance/.generated/conformance-docs.d.ts.map +1 -0
- package/dist/conformance/.generated/conformance-docs.js +2 -0
- package/dist/conformance/.generated/conformance-docs.js.map +1 -0
- package/dist/conformance/docs.d.ts +6 -0
- package/dist/conformance/docs.d.ts.map +1 -0
- package/dist/conformance/docs.js +6 -0
- package/dist/conformance/docs.js.map +1 -0
- package/dist/remote/index.d.ts.map +1 -1
- package/dist/remote/index.js +1 -0
- package/dist/remote/index.js.map +1 -1
- package/dist/serve/activity-guard.d.ts +4 -0
- package/dist/serve/activity-guard.d.ts.map +1 -0
- package/dist/serve/activity-guard.js +22 -0
- package/dist/serve/activity-guard.js.map +1 -0
- package/dist/serve/activity-route.d.ts +4 -0
- package/dist/serve/activity-route.d.ts.map +1 -0
- package/dist/serve/activity-route.js +157 -0
- package/dist/serve/activity-route.js.map +1 -0
- package/dist/serve/activity-warning.d.ts +4 -0
- package/dist/serve/activity-warning.d.ts.map +1 -0
- package/dist/serve/activity-warning.js +21 -0
- package/dist/serve/activity-warning.js.map +1 -0
- package/dist/serve/bridge-mount.d.ts +5 -0
- package/dist/serve/bridge-mount.d.ts.map +1 -1
- package/dist/serve/bridge-mount.js +1 -0
- package/dist/serve/bridge-mount.js.map +1 -1
- package/dist/serve/docs-ui/404.html +3 -0
- package/dist/serve/docs-ui/_astro/{_slug_.DPUwShm2.css → _slug_.CXh9yTP1.css} +1 -1
- package/dist/serve/docs-ui/_astro/_slug_.DUci-duz.css +1 -0
- package/dist/serve/docs-ui/docs/_rhythm/index.html +2 -1
- package/dist/serve/docs-ui/docs/agent/set-up-your-agent/index.html +3 -2
- package/dist/serve/docs-ui/docs/agent/set-up-your-agent.md +1 -1
- package/dist/serve/docs-ui/docs/agent/watch-and-review/index.html +2 -1
- package/dist/serve/docs-ui/docs/agent/work-with-an-agent/index.html +2 -1
- package/dist/serve/docs-ui/docs/ai-compat/index.html +2 -1
- package/dist/serve/docs-ui/docs/api-reference/index.html +51 -49
- package/dist/serve/docs-ui/docs/api-reference.md +2 -2
- package/dist/serve/docs-ui/docs/app-compat/index.html +2 -1
- package/dist/serve/docs-ui/docs/auth-compat/index.html +2 -1
- package/dist/serve/docs-ui/docs/build/ai-logic/index.html +18 -3
- package/dist/serve/docs-ui/docs/build/ai-logic.md +30 -2
- package/dist/serve/docs-ui/docs/build/authentication/index.html +2 -1
- package/dist/serve/docs-ui/docs/build/authentication.md +1 -1
- package/dist/serve/docs-ui/docs/build/cloud-firestore/index.html +2 -1
- package/dist/serve/docs-ui/docs/build/cloud-messaging/index.html +46 -2
- package/dist/serve/docs-ui/docs/build/cloud-messaging.md +56 -1
- package/dist/serve/docs-ui/docs/build/cloud-storage/index.html +2 -1
- package/dist/serve/docs-ui/docs/build/cloud-storage.md +1 -1
- package/dist/serve/docs-ui/docs/build/realtime-database/index.html +21 -3
- package/dist/serve/docs-ui/docs/build/realtime-database.md +25 -1
- package/dist/serve/docs-ui/docs/conformance-scores/index.html +2 -1
- package/dist/serve/docs-ui/docs/create-pyric-reference-api/index.html +61 -28
- package/dist/serve/docs-ui/docs/create-pyric-reference-api.md +65 -20
- package/dist/serve/docs-ui/docs/database-compat/index.html +2 -1
- package/dist/serve/docs-ui/docs/firestore-compat/index.html +6 -5
- package/dist/serve/docs-ui/docs/firestore-compat.md +4 -4
- package/dist/serve/docs-ui/docs/functions-rtdb-compat/index.html +2 -1
- package/dist/serve/docs-ui/docs/get-started/how-the-swap-works/index.html +2 -1
- package/dist/serve/docs-ui/docs/get-started/start-building/index.html +4 -3
- package/dist/serve/docs-ui/docs/get-started/start-building.md +2 -2
- package/dist/serve/docs-ui/docs/index.json +800 -575
- package/dist/serve/docs-ui/docs/messaging-compat/index.html +2 -1
- package/dist/serve/docs-ui/docs/observe/see-whats-happening/index.html +2 -1
- package/dist/serve/docs-ui/docs/observe/shape-your-data/index.html +2 -1
- package/dist/serve/docs-ui/docs/overview/index.html +2 -1
- package/dist/serve/docs-ui/docs/pyric-admin-app-reference-api/index.html +5 -4
- package/dist/serve/docs-ui/docs/pyric-admin-app-reference-api.md +3 -4
- package/dist/serve/docs-ui/docs/pyric-admin-auth-reference-api/index.html +5 -4
- package/dist/serve/docs-ui/docs/pyric-admin-auth-reference-api.md +3 -4
- package/dist/serve/docs-ui/docs/pyric-admin-database-reference-api/index.html +5 -4
- package/dist/serve/docs-ui/docs/pyric-admin-database-reference-api.md +3 -4
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-api/index.html +2503 -12
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-api.md +2219 -8
- package/dist/serve/docs-ui/docs/pyric-admin-storage-reference-api/index.html +4 -3
- package/dist/serve/docs-ui/docs/pyric-admin-storage-reference-api.md +2 -3
- package/dist/serve/docs-ui/docs/pyric-ai-reference-api/index.html +16 -11
- package/dist/serve/docs-ui/docs/pyric-ai-reference-api.md +14 -13
- package/dist/serve/docs-ui/docs/pyric-ai-scripting-reference-api/index.html +4 -3
- package/dist/serve/docs-ui/docs/pyric-ai-scripting-reference-api.md +2 -3
- package/dist/serve/docs-ui/docs/pyric-app-reference-api/index.html +7 -2
- package/dist/serve/docs-ui/docs/pyric-app-reference-api.md +5 -2
- package/dist/serve/docs-ui/docs/pyric-auth-reference-api/index.html +23 -12
- package/dist/serve/docs-ui/docs/pyric-auth-reference-api.md +15 -12
- package/dist/serve/docs-ui/docs/pyric-cli-assurance-browser-reference-api/index.html +10 -48
- package/dist/serve/docs-ui/docs/pyric-cli-assurance-browser-reference-api.md +11 -24
- package/dist/serve/docs-ui/docs/pyric-cli-assurance-reference-api/index.html +87 -97
- package/dist/serve/docs-ui/docs/pyric-cli-assurance-reference-api.md +53 -65
- package/dist/serve/docs-ui/docs/pyric-cli-bridge-client-reference-api/index.html +14 -15
- package/dist/serve/docs-ui/docs/pyric-cli-bridge-client-reference-api.md +19 -28
- package/dist/serve/docs-ui/docs/pyric-cli-bridge-reference-api/index.html +4 -3
- package/dist/serve/docs-ui/docs/pyric-cli-bridge-reference-api.md +2 -3
- package/dist/serve/docs-ui/docs/pyric-cli-conformance-browser-reference-api/index.html +3 -2
- package/dist/serve/docs-ui/docs/pyric-cli-conformance-browser-reference-api.md +1 -2
- package/dist/serve/docs-ui/docs/pyric-cli-conformance-docs-reference-api/index.html +51 -0
- package/dist/serve/docs-ui/docs/pyric-cli-conformance-docs-reference-api.md +36 -0
- package/dist/serve/docs-ui/docs/pyric-cli-conformance-reference-api/index.html +3 -2
- package/dist/serve/docs-ui/docs/pyric-cli-conformance-reference-api.md +1 -2
- package/dist/serve/docs-ui/docs/pyric-cli-credentials-node-reference-api/index.html +3 -2
- package/dist/serve/docs-ui/docs/pyric-cli-credentials-node-reference-api.md +1 -2
- package/dist/serve/docs-ui/docs/pyric-cli-discover-reference-api/index.html +3 -2
- package/dist/serve/docs-ui/docs/pyric-cli-discover-reference-api.md +1 -2
- package/dist/serve/docs-ui/docs/pyric-cli-register-reference-api/index.html +3 -2
- package/dist/serve/docs-ui/docs/pyric-cli-register-reference-api.md +1 -2
- package/dist/serve/docs-ui/docs/pyric-cli-remote-reference-api/index.html +1067 -83
- package/dist/serve/docs-ui/docs/pyric-cli-remote-reference-api.md +1291 -160
- package/dist/serve/docs-ui/docs/pyric-cli-serve-worker-reference-api/index.html +123 -92
- package/dist/serve/docs-ui/docs/pyric-cli-serve-worker-reference-api.md +49 -20
- package/dist/serve/docs-ui/docs/pyric-cli-verify-reference-api/index.html +72 -7
- package/dist/serve/docs-ui/docs/pyric-cli-verify-reference-api.md +22 -7
- package/dist/serve/docs-ui/docs/pyric-cli-vite-reference-api/index.html +33 -12
- package/dist/serve/docs-ui/docs/pyric-cli-vite-reference-api.md +15 -12
- package/dist/serve/docs-ui/docs/pyric-database-reference-api/index.html +18 -17
- package/dist/serve/docs-ui/docs/pyric-database-reference-api.md +19 -22
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-api/index.html +1512 -545
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-api.md +1311 -316
- package/dist/serve/docs-ui/docs/pyric-firestore-values-reference-api/index.html +3 -2
- package/dist/serve/docs-ui/docs/pyric-firestore-values-reference-api.md +1 -2
- package/dist/serve/docs-ui/docs/pyric-messaging-reference-api/index.html +5 -4
- package/dist/serve/docs-ui/docs/pyric-messaging-reference-api.md +3 -4
- package/dist/serve/docs-ui/docs/pyric-messaging-sw-reference-api/index.html +69 -369
- package/dist/serve/docs-ui/docs/pyric-messaging-sw-reference-api.md +103 -216
- package/dist/serve/docs-ui/docs/pyric-rules-reference-api/index.html +10 -9
- package/dist/serve/docs-ui/docs/pyric-rules-reference-api.md +9 -10
- package/dist/serve/docs-ui/docs/pyric-sandbox-database-reference-api/index.html +8 -7
- package/dist/serve/docs-ui/docs/pyric-sandbox-database-reference-api.md +6 -7
- package/dist/serve/docs-ui/docs/pyric-sandbox-firestore-reference-api/index.html +10 -9
- package/dist/serve/docs-ui/docs/pyric-sandbox-firestore-reference-api.md +9 -10
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-api/index.html +374 -910
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-api.md +377 -911
- package/dist/serve/docs-ui/docs/pyric-storage-reference-api/index.html +25 -17
- package/dist/serve/docs-ui/docs/pyric-storage-reference-api.md +21 -19
- package/dist/serve/docs-ui/docs/pyric-ui-agents-reference-api/index.html +3 -2
- package/dist/serve/docs-ui/docs/pyric-ui-agents-reference-api.md +1 -2
- package/dist/serve/docs-ui/docs/pyric-ui-auth-hooks-reference-api/index.html +63 -776
- package/dist/serve/docs-ui/docs/pyric-ui-auth-hooks-reference-api.md +69 -510
- package/dist/serve/docs-ui/docs/pyric-ui-auth-reference-api/index.html +22 -21
- package/dist/serve/docs-ui/docs/pyric-ui-auth-reference-api.md +29 -30
- package/dist/serve/docs-ui/docs/pyric-ui-events-hooks-reference-api/index.html +15 -168
- package/dist/serve/docs-ui/docs/pyric-ui-events-hooks-reference-api.md +17 -87
- package/dist/serve/docs-ui/docs/pyric-ui-events-reference-api/index.html +6 -5
- package/dist/serve/docs-ui/docs/pyric-ui-events-reference-api.md +5 -6
- package/dist/serve/docs-ui/docs/pyric-ui-firestore-hooks-reference-api/index.html +82 -970
- package/dist/serve/docs-ui/docs/pyric-ui-firestore-hooks-reference-api.md +104 -479
- package/dist/serve/docs-ui/docs/pyric-ui-firestore-reference-api/index.html +30 -29
- package/dist/serve/docs-ui/docs/pyric-ui-firestore-reference-api.md +54 -55
- package/dist/serve/docs-ui/docs/pyric-ui-primitives-reference-api/index.html +3 -2
- package/dist/serve/docs-ui/docs/pyric-ui-primitives-reference-api.md +1 -2
- package/dist/serve/docs-ui/docs/pyric-ui-rtdb-reference-api/index.html +5 -4
- package/dist/serve/docs-ui/docs/pyric-ui-rtdb-reference-api.md +3 -4
- package/dist/serve/docs-ui/docs/pyric-ui-rules-hooks-reference-api/index.html +9 -124
- package/dist/serve/docs-ui/docs/pyric-ui-rules-hooks-reference-api.md +7 -58
- package/dist/serve/docs-ui/docs/pyric-ui-rules-reference-api/index.html +24 -23
- package/dist/serve/docs-ui/docs/pyric-ui-rules-reference-api.md +31 -34
- package/dist/serve/docs-ui/docs/pyric-ui-storage-hooks-reference-api/index.html +104 -1385
- package/dist/serve/docs-ui/docs/pyric-ui-storage-hooks-reference-api.md +133 -817
- package/dist/serve/docs-ui/docs/pyric-ui-storage-reference-api/index.html +34 -33
- package/dist/serve/docs-ui/docs/pyric-ui-storage-reference-api.md +37 -38
- package/dist/serve/docs-ui/docs/pyric-ui-traffic-hooks-reference-api/index.html +116 -1169
- package/dist/serve/docs-ui/docs/pyric-ui-traffic-hooks-reference-api.md +142 -590
- package/dist/serve/docs-ui/docs/pyric-ui-traffic-reference-api/index.html +4 -3
- package/dist/serve/docs-ui/docs/pyric-ui-traffic-reference-api.md +3 -4
- package/dist/serve/docs-ui/docs/rules-compat/index.html +34 -1
- package/dist/serve/docs-ui/docs/rules-compat.md +32 -0
- package/dist/serve/docs-ui/docs/secure/audit-your-rules/index.html +19 -2
- package/dist/serve/docs-ui/docs/secure/audit-your-rules.md +32 -0
- package/dist/serve/docs-ui/docs/secure/firestore-rules-limits/index.html +2 -1
- package/dist/serve/docs-ui/docs/secure/read-a-denial/index.html +2 -1
- package/dist/serve/docs-ui/docs/secure/rtdb-rules-in-typescript/index.html +2 -1
- package/dist/serve/docs-ui/docs/secure/rtdb-rules-in-typescript.md +1 -1
- package/dist/serve/docs-ui/docs/secure/rules-standard-library/index.html +2 -1
- package/dist/serve/docs-ui/docs/secure/secure-it-with-rules/index.html +2 -1
- package/dist/serve/docs-ui/docs/secure/simulate-and-lint/index.html +2 -1
- package/dist/serve/docs-ui/docs/secure/write-a-rules-test-suite/index.html +2 -1
- package/dist/serve/docs-ui/docs/ship/ship-to-production/index.html +2 -1
- package/dist/serve/docs-ui/docs/ship/test-in-node/index.html +2 -1
- package/dist/serve/docs-ui/docs/storage-compat/index.html +2 -1
- package/dist/serve/docs-ui/docs/trust/how-we-know-it-matches-firebase/index.html +2 -1
- package/dist/serve/docs-ui/docs/trust/versioning-and-compatibility/index.html +2 -1
- package/dist/serve/docs-ui/llms.txt +1 -0
- package/dist/serve/entries/ai.d.ts.map +1 -1
- package/dist/serve/entries/ai.js +39 -1
- package/dist/serve/entries/ai.js.map +1 -1
- package/dist/serve/entries/messaging-sw.d.ts.map +1 -1
- package/dist/serve/entries/messaging-sw.js +5 -1
- package/dist/serve/entries/messaging-sw.js.map +1 -1
- package/dist/serve/entries/messaging.d.ts.map +1 -1
- package/dist/serve/entries/messaging.js +7 -1
- package/dist/serve/entries/messaging.js.map +1 -1
- package/dist/serve/entries/runtime.d.ts.map +1 -1
- package/dist/serve/entries/runtime.js +20 -1
- package/dist/serve/entries/runtime.js.map +1 -1
- package/dist/serve/init-payload.d.ts +25 -0
- package/dist/serve/init-payload.d.ts.map +1 -1
- package/dist/serve/namespace.d.ts +39 -0
- package/dist/serve/namespace.d.ts.map +1 -1
- package/dist/serve/namespace.js +80 -1
- package/dist/serve/namespace.js.map +1 -1
- package/dist/serve/standalone-assets.d.ts +11 -9
- package/dist/serve/standalone-assets.d.ts.map +1 -1
- package/dist/serve/standalone-assets.js +6 -5
- package/dist/serve/standalone-assets.js.map +1 -1
- package/dist/serve/studio-ui/assets/{RulesCodeEditor-CXdSLKhO.js → RulesCodeEditor-CxVYcZXw.js} +1 -1
- package/dist/serve/studio-ui/assets/index-cpSfgQ7H.js +1218 -0
- package/dist/serve/studio-ui/assets/seed-DeuFKi4J.js +20 -0
- package/dist/serve/studio-ui/index.html +1 -1
- package/dist/serve/vite-plugin.d.ts +92 -15
- package/dist/serve/vite-plugin.d.ts.map +1 -1
- package/dist/serve/vite-plugin.js +281 -11
- package/dist/serve/vite-plugin.js.map +1 -1
- package/dist/serve/worker/activity-bootstrap.d.ts +8 -0
- package/dist/serve/worker/activity-bootstrap.d.ts.map +1 -0
- package/dist/serve/worker/activity-bootstrap.js +11 -0
- package/dist/serve/worker/activity-bootstrap.js.map +1 -0
- package/dist/serve/worker/client/connection.d.ts.map +1 -1
- package/dist/serve/worker/client/connection.js +17 -5
- package/dist/serve/worker/client/connection.js.map +1 -1
- package/dist/serve/worker/client/core.d.ts +2 -2
- package/dist/serve/worker/client/core.d.ts.map +1 -1
- package/dist/serve/worker/client/core.js +33 -5
- package/dist/serve/worker/client/core.js.map +1 -1
- package/dist/serve/worker/client/firestore-writes.d.ts.map +1 -1
- package/dist/serve/worker/client/firestore-writes.js +1 -0
- package/dist/serve/worker/client/firestore-writes.js.map +1 -1
- package/dist/serve/worker/client/messaging.d.ts +9 -1
- package/dist/serve/worker/client/messaging.d.ts.map +1 -1
- package/dist/serve/worker/client/messaging.js +15 -0
- package/dist/serve/worker/client/messaging.js.map +1 -1
- package/dist/serve/worker/client/studio.d.ts +10 -0
- package/dist/serve/worker/client/studio.d.ts.map +1 -1
- package/dist/serve/worker/client/studio.js +11 -0
- package/dist/serve/worker/client/studio.js.map +1 -1
- package/dist/serve/worker/durable-persistence.d.ts +12 -0
- package/dist/serve/worker/durable-persistence.d.ts.map +1 -0
- package/dist/serve/worker/durable-persistence.js +118 -0
- package/dist/serve/worker/durable-persistence.js.map +1 -0
- package/dist/serve/worker/entry.d.ts +7 -3
- package/dist/serve/worker/entry.d.ts.map +1 -1
- package/dist/serve/worker/entry.js +7 -3
- package/dist/serve/worker/entry.js.map +1 -1
- package/dist/serve/worker/host/core.d.ts +9 -5
- package/dist/serve/worker/host/core.d.ts.map +1 -1
- package/dist/serve/worker/host/core.js +33 -8
- package/dist/serve/worker/host/core.js.map +1 -1
- package/dist/serve/worker/host/dispatch.d.ts.map +1 -1
- package/dist/serve/worker/host/dispatch.js +9 -2
- package/dist/serve/worker/host/dispatch.js.map +1 -1
- package/dist/serve/worker/host/studio.d.ts +1 -1
- package/dist/serve/worker/host/studio.d.ts.map +1 -1
- package/dist/serve/worker/host/studio.js +36 -1
- package/dist/serve/worker/host/studio.js.map +1 -1
- package/dist/serve/worker/host/subscriptions.d.ts.map +1 -1
- package/dist/serve/worker/host/subscriptions.js +27 -7
- package/dist/serve/worker/host/subscriptions.js.map +1 -1
- package/dist/serve/worker/host-context.d.ts +15 -0
- package/dist/serve/worker/host-context.d.ts.map +1 -1
- package/dist/serve/worker/host-context.js +10 -0
- package/dist/serve/worker/host-context.js.map +1 -1
- package/dist/serve/worker/host-messaging.d.ts.map +1 -1
- package/dist/serve/worker/host-messaging.js +9 -2
- package/dist/serve/worker/host-messaging.js.map +1 -1
- package/dist/serve/worker/index.d.ts +1 -1
- package/dist/serve/worker/index.d.ts.map +1 -1
- package/dist/serve/worker/index.js +2 -0
- package/dist/serve/worker/index.js.map +1 -1
- package/dist/serve/worker/protocol.d.ts +25 -3
- package/dist/serve/worker/protocol.d.ts.map +1 -1
- package/dist/serve/worker/protocol.js.map +1 -1
- package/dist/serve/worker/serve-init.d.ts +23 -37
- package/dist/serve/worker/serve-init.d.ts.map +1 -1
- package/dist/serve/worker/serve-init.js +95 -172
- package/dist/serve/worker/serve-init.js.map +1 -1
- package/dist/vite.d.ts +4 -4
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +3 -3
- package/dist/vite.js.map +1 -1
- package/package.json +8 -4
- package/dist/serve/studio-ui/assets/index-BvtQIpGn.js +0 -1211
- package/dist/serve/studio-ui/assets/seed-3DMedLL3.js +0 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en"> <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>API reference: @pyric/cli/remote · Pyric Studio</title><meta name="description" content="Published declarations for @pyric/cli/remote."><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap" rel="stylesheet"><link rel="stylesheet" href="/__pyric/ui/_astro/_slug_.DPUwShm2.css"></head> <body> <header class="studio__bar"> <div class="studio__bar-inner"> <a class="studio__brand" href="/__pyric/ui/" aria-label="Pyric Studio">Pyric</a> <nav class="studio__nav" aria-label="Studio tabs"> <a class="studio__nav-tab" href="/__pyric/ui/"> Home </a><a class="studio__nav-tab" href="/__pyric/ui/firestore"> Firestore </a><a class="studio__nav-tab" href="/__pyric/ui/auth"> Auth </a><a class="studio__nav-tab" href="/__pyric/ui/rtdb"> RTDB </a><a class="studio__nav-tab" href="/__pyric/ui/storage"> Storage </a><a class="studio__nav-tab" href="/__pyric/ui/traffic"> Traffic </a><a class="studio__nav-tab" href="/__pyric/ui/settings"> Settings </a><a class="studio__nav-tab" href="/__pyric/ui/docs" aria-current="page"> Docs </a> </nav> </div> </header> <div class="docs-shell"> <details class="docs-nav-drawer"> <summary>Navigate</summary> <nav class="docs-nav" aria-label="Documentation"> <div class="docs-search" data-index-url="/__pyric/ui/docs/index.json"> <div class="docs-search-field"> <svg class="docs-search-icon" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"> <path d="M11.5 11.5 15 15M13 7A6 6 0 1 1 1 7a6 6 0 0 1 12 0Z" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path> </svg> <input type="text" class="docs-search-input" placeholder="Search docs" aria-label="Search docs" autocomplete="off" spellcheck="false"> <kbd class="docs-search-kbd">⌘K</kbd> </div> <ul class="docs-search-results" hidden></ul> </div> <script type="module">let i=null;function d(t){return i||(i=fetch(t).then(e=>e.json())),i}function l(t,e){return t.title.toLowerCase().includes(e)||t.excerpt.toLowerCase().includes(e)?!0:t.headings.some(r=>r.text.toLowerCase().includes(e))}function u(t,e,r){if(e.innerHTML="",t.length===0){e.hidden=!1;{const n=document.createElement("li");n.className="docs-search-empty",n.textContent="No matches",e.appendChild(n)}return}e.hidden=!1;for(const n of t.slice(0,8)){const s=document.createElement("li"),c=document.createElement("a");c.href=n.path;const o=document.createElement("span");o.className="docs-search-result-title",o.textContent=n.title;const a=document.createElement("span");a.className="docs-search-result-meta",a.textContent=[n.group,n.section].filter(Boolean).join(" / "),c.append(o,a),s.appendChild(c),e.appendChild(s)}}document.querySelectorAll(".docs-search").forEach(t=>{const e=t.dataset.indexUrl,r=t.querySelector(".docs-search-input"),n=t.querySelector(".docs-search-results");r.addEventListener("input",async()=>{const s=r.value.trim().toLowerCase();if(!s){n.hidden=!0,n.innerHTML="";return}const{pages:c}=await d(e);r.value.trim().toLowerCase()===s&&u(c.filter(o=>l(o,s)),n)}),r.addEventListener("focus",()=>{d(e),n.childElementCount>0&&(n.hidden=!1)}),r.addEventListener("keydown",s=>{s.key==="Escape"&&(r.value="",n.hidden=!0,n.innerHTML="",r.blur())}),r.addEventListener("blur",()=>{window.setTimeout(()=>{n.hidden=!0},150)})});document.addEventListener("keydown",t=>{if(!(t.metaKey||t.ctrlKey)||t.key.toLowerCase()!=="k")return;const e=[...document.querySelectorAll(".docs-search-input")].find(r=>r.offsetParent!==null);e&&(t.preventDefault(),e.focus(),e.select())});</script> <a class="docs-nav-toplink" href="/__pyric/ui/docs/overview/"> Overview </a><details class="docs-nav-group"> <summary>Get started</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/get-started/start-building/"> Quickstart </a> </li><li> <a href="/__pyric/ui/docs/get-started/how-the-swap-works/"> How the swap works </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Build</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/build/authentication/"> Authentication </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-firestore/"> Cloud Firestore </a> </li><li> <a href="/__pyric/ui/docs/build/realtime-database/"> Realtime Database </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-storage/"> Cloud Storage </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-messaging/"> Cloud Messaging </a> </li><li> <a href="/__pyric/ui/docs/build/ai-logic/"> AI Logic </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Secure & debug</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/secure/secure-it-with-rules/"> Security Rules </a> </li><li> <a href="/__pyric/ui/docs/secure/simulate-and-lint/"> Simulate and lint before you deploy </a> </li><li> <a href="/__pyric/ui/docs/secure/write-a-rules-test-suite/"> Write a rules test suite </a> </li><li> <a href="/__pyric/ui/docs/secure/read-a-denial/"> Read a denial and understand it </a> </li><li> <a href="/__pyric/ui/docs/secure/rules-standard-library/"> The rules standard library </a> </li><li> <a href="/__pyric/ui/docs/secure/rtdb-rules-in-typescript/"> RTDB rules in TypeScript </a> </li><li> <a href="/__pyric/ui/docs/secure/firestore-rules-limits/"> Rules limits </a> </li><li> <a href="/__pyric/ui/docs/secure/audit-your-rules/"> Audit rules and data </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Observe & shape</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/observe/see-whats-happening/"> Traffic & rule verdicts </a> </li><li> <a href="/__pyric/ui/docs/observe/shape-your-data/"> Seed, snapshot, replay </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Ship & test</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/ship/ship-to-production/"> Ship to production </a> </li><li> <a href="/__pyric/ui/docs/ship/test-in-node/"> Test in Node </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Work with an agent</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/agent/set-up-your-agent/"> Connect an agent </a> </li><li> <a href="/__pyric/ui/docs/agent/work-with-an-agent/"> Use the MCP tools </a> </li><li> <a href="/__pyric/ui/docs/agent/watch-and-review/"> Watch in Pyric Studio </a> </li> </ul> </div> </div> </details><a class="docs-nav-toplink" href="/__pyric/ui/docs/trust/versioning-and-compatibility/"> Trust </a><details class="docs-nav-group"> <summary>Conformance</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/conformance-scores/"> Public API coverage </a> </li><li> <a href="/__pyric/ui/docs/trust/how-we-know-it-matches-firebase/"> How we know it matches Firebase </a> </li><li> <a href="/__pyric/ui/docs/app-compat/"> App </a> </li><li> <a href="/__pyric/ui/docs/ai-compat/"> AI Logic </a> </li><li> <a href="/__pyric/ui/docs/auth-compat/"> Auth </a> </li><li> <a href="/__pyric/ui/docs/firestore-compat/"> Firestore </a> </li><li> <a href="/__pyric/ui/docs/database-compat/"> Realtime Database </a> </li><li> <a href="/__pyric/ui/docs/storage-compat/"> Storage </a> </li><li> <a href="/__pyric/ui/docs/messaging-compat/"> Messaging </a> </li><li> <a href="/__pyric/ui/docs/functions-rtdb-compat/"> Functions · RTDB </a> </li><li> <a href="/__pyric/ui/docs/rules-compat/"> Rules </a> </li> </ul> </div> </div> </details> <details class="docs-nav-group" open> <summary>Reference</summary> <div class="docs-nav-group-body docs-nav-group-body--reference"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/api-reference/"> API reference </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">pyric</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-app-reference-api/"> pyric/app </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore-reference-api/"> pyric/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-auth-reference-api/"> pyric/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-ai-reference-api/"> pyric/ai </a> </li><li> <a href="/__pyric/ui/docs/pyric-ai-scripting-reference-api/"> pyric/ai/scripting </a> </li><li> <a href="/__pyric/ui/docs/pyric-database-reference-api/"> pyric/database </a> </li><li> <a href="/__pyric/ui/docs/pyric-storage-reference-api/"> pyric/storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-messaging-reference-api/"> pyric/messaging </a> </li><li> <a href="/__pyric/ui/docs/pyric-messaging-sw-reference-api/"> pyric/messaging/sw </a> </li><li> <a href="/__pyric/ui/docs/pyric-rules-reference-api/"> pyric/rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore-values-reference-api/"> pyric/firestore-values </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-reference-api/"> pyric/sandbox </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-firestore-reference-api/"> pyric/sandbox/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-database-reference-api/"> pyric/sandbox/database </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">pyric-admin</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-admin-app-reference-api/"> pyric-admin/app </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-firestore-reference-api/"> pyric-admin/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-auth-reference-api/"> pyric-admin/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-database-reference-api/"> pyric-admin/database </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-storage-reference-api/"> pyric-admin/storage </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">create-pyric</h2> <ul> <li> <a href="/__pyric/ui/docs/create-pyric-reference-api/"> create-pyric </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">@pyric/cli</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-cli-credentials-node-reference-api/"> @pyric/cli/credentials/node </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-verify-reference-api/"> @pyric/cli/verify </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-conformance-reference-api/"> @pyric/cli/conformance </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-conformance-browser-reference-api/"> @pyric/cli/conformance/browser </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-assurance-reference-api/"> @pyric/cli/assurance </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-assurance-browser-reference-api/"> @pyric/cli/assurance/browser </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-bridge-reference-api/"> @pyric/cli/bridge </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-bridge-client-reference-api/"> @pyric/cli/bridge/client </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-discover-reference-api/"> @pyric/cli/discover </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-vite-reference-api/"> @pyric/cli/vite </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-serve-worker-reference-api/"> @pyric/cli/serve/worker </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-remote-reference-api/" aria-current="page"> @pyric/cli/remote </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-register-reference-api/"> @pyric/cli/register </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">@pyric/ui</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-ui-auth-reference-api/"> @pyric/ui/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-auth-hooks-reference-api/"> @pyric/ui/auth/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-primitives-reference-api/"> @pyric/ui/primitives </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-firestore-reference-api/"> @pyric/ui/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-firestore-hooks-reference-api/"> @pyric/ui/firestore/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rtdb-reference-api/"> @pyric/ui/rtdb </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-storage-reference-api/"> @pyric/ui/storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-storage-hooks-reference-api/"> @pyric/ui/storage/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-traffic-reference-api/"> @pyric/ui/traffic </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-traffic-hooks-reference-api/"> @pyric/ui/traffic/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-events-reference-api/"> @pyric/ui/events </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-events-hooks-reference-api/"> @pyric/ui/events/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-agents-reference-api/"> @pyric/ui/agents </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rules-reference-api/"> @pyric/ui/rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rules-hooks-reference-api/"> @pyric/ui/rules/hooks </a> </li> </ul> </div> </div> </details> </nav> </details> <nav class="docs-nav" aria-label="Documentation"> <div class="docs-search" data-index-url="/__pyric/ui/docs/index.json"> <div class="docs-search-field"> <svg class="docs-search-icon" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"> <path d="M11.5 11.5 15 15M13 7A6 6 0 1 1 1 7a6 6 0 0 1 12 0Z" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path> </svg> <input type="text" class="docs-search-input" placeholder="Search docs" aria-label="Search docs" autocomplete="off" spellcheck="false"> <kbd class="docs-search-kbd">⌘K</kbd> </div> <ul class="docs-search-results" hidden></ul> </div> <a class="docs-nav-toplink" href="/__pyric/ui/docs/overview/" id="nav-group-overview"> Overview </a><details class="docs-nav-group" id="nav-group-get-started"> <summary>Get started</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/get-started/start-building/"> Quickstart </a> </li><li> <a href="/__pyric/ui/docs/get-started/how-the-swap-works/"> How the swap works </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-build"> <summary>Build</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/build/authentication/"> Authentication </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-firestore/"> Cloud Firestore </a> </li><li> <a href="/__pyric/ui/docs/build/realtime-database/"> Realtime Database </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-storage/"> Cloud Storage </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-messaging/"> Cloud Messaging </a> </li><li> <a href="/__pyric/ui/docs/build/ai-logic/"> AI Logic </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-secure-debug"> <summary>Secure & debug</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/secure/secure-it-with-rules/"> Security Rules </a> </li><li> <a href="/__pyric/ui/docs/secure/simulate-and-lint/"> Simulate and lint before you deploy </a> </li><li> <a href="/__pyric/ui/docs/secure/write-a-rules-test-suite/"> Write a rules test suite </a> </li><li> <a href="/__pyric/ui/docs/secure/read-a-denial/"> Read a denial and understand it </a> </li><li> <a href="/__pyric/ui/docs/secure/rules-standard-library/"> The rules standard library </a> </li><li> <a href="/__pyric/ui/docs/secure/rtdb-rules-in-typescript/"> RTDB rules in TypeScript </a> </li><li> <a href="/__pyric/ui/docs/secure/firestore-rules-limits/"> Rules limits </a> </li><li> <a href="/__pyric/ui/docs/secure/audit-your-rules/"> Audit rules and data </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-observe-shape"> <summary>Observe & shape</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/observe/see-whats-happening/"> Traffic & rule verdicts </a> </li><li> <a href="/__pyric/ui/docs/observe/shape-your-data/"> Seed, snapshot, replay </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-ship-test"> <summary>Ship & test</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/ship/ship-to-production/"> Ship to production </a> </li><li> <a href="/__pyric/ui/docs/ship/test-in-node/"> Test in Node </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-work-with-an-agent"> <summary>Work with an agent</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/agent/set-up-your-agent/"> Connect an agent </a> </li><li> <a href="/__pyric/ui/docs/agent/work-with-an-agent/"> Use the MCP tools </a> </li><li> <a href="/__pyric/ui/docs/agent/watch-and-review/"> Watch in Pyric Studio </a> </li> </ul> </div> </div> </details><a class="docs-nav-toplink" href="/__pyric/ui/docs/trust/versioning-and-compatibility/" id="nav-group-trust"> Trust </a><details class="docs-nav-group" id="nav-group-conformance"> <summary>Conformance</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/conformance-scores/"> Public API coverage </a> </li><li> <a href="/__pyric/ui/docs/trust/how-we-know-it-matches-firebase/"> How we know it matches Firebase </a> </li><li> <a href="/__pyric/ui/docs/app-compat/"> App </a> </li><li> <a href="/__pyric/ui/docs/ai-compat/"> AI Logic </a> </li><li> <a href="/__pyric/ui/docs/auth-compat/"> Auth </a> </li><li> <a href="/__pyric/ui/docs/firestore-compat/"> Firestore </a> </li><li> <a href="/__pyric/ui/docs/database-compat/"> Realtime Database </a> </li><li> <a href="/__pyric/ui/docs/storage-compat/"> Storage </a> </li><li> <a href="/__pyric/ui/docs/messaging-compat/"> Messaging </a> </li><li> <a href="/__pyric/ui/docs/functions-rtdb-compat/"> Functions · RTDB </a> </li><li> <a href="/__pyric/ui/docs/rules-compat/"> Rules </a> </li> </ul> </div> </div> </details> <details class="docs-nav-group" id="nav-group-reference" open> <summary>Reference</summary> <div class="docs-nav-group-body docs-nav-group-body--reference"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/api-reference/"> API reference </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">pyric</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-app-reference-api/"> pyric/app </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore-reference-api/"> pyric/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-auth-reference-api/"> pyric/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-ai-reference-api/"> pyric/ai </a> </li><li> <a href="/__pyric/ui/docs/pyric-ai-scripting-reference-api/"> pyric/ai/scripting </a> </li><li> <a href="/__pyric/ui/docs/pyric-database-reference-api/"> pyric/database </a> </li><li> <a href="/__pyric/ui/docs/pyric-storage-reference-api/"> pyric/storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-messaging-reference-api/"> pyric/messaging </a> </li><li> <a href="/__pyric/ui/docs/pyric-messaging-sw-reference-api/"> pyric/messaging/sw </a> </li><li> <a href="/__pyric/ui/docs/pyric-rules-reference-api/"> pyric/rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore-values-reference-api/"> pyric/firestore-values </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-reference-api/"> pyric/sandbox </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-firestore-reference-api/"> pyric/sandbox/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-database-reference-api/"> pyric/sandbox/database </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">pyric-admin</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-admin-app-reference-api/"> pyric-admin/app </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-firestore-reference-api/"> pyric-admin/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-auth-reference-api/"> pyric-admin/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-database-reference-api/"> pyric-admin/database </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-storage-reference-api/"> pyric-admin/storage </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">create-pyric</h2> <ul> <li> <a href="/__pyric/ui/docs/create-pyric-reference-api/"> create-pyric </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">@pyric/cli</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-cli-credentials-node-reference-api/"> @pyric/cli/credentials/node </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-verify-reference-api/"> @pyric/cli/verify </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-conformance-reference-api/"> @pyric/cli/conformance </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-conformance-browser-reference-api/"> @pyric/cli/conformance/browser </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-assurance-reference-api/"> @pyric/cli/assurance </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-assurance-browser-reference-api/"> @pyric/cli/assurance/browser </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-bridge-reference-api/"> @pyric/cli/bridge </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-bridge-client-reference-api/"> @pyric/cli/bridge/client </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-discover-reference-api/"> @pyric/cli/discover </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-vite-reference-api/"> @pyric/cli/vite </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-serve-worker-reference-api/"> @pyric/cli/serve/worker </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-remote-reference-api/" aria-current="page"> @pyric/cli/remote </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-register-reference-api/"> @pyric/cli/register </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">@pyric/ui</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-ui-auth-reference-api/"> @pyric/ui/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-auth-hooks-reference-api/"> @pyric/ui/auth/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-primitives-reference-api/"> @pyric/ui/primitives </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-firestore-reference-api/"> @pyric/ui/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-firestore-hooks-reference-api/"> @pyric/ui/firestore/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rtdb-reference-api/"> @pyric/ui/rtdb </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-storage-reference-api/"> @pyric/ui/storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-storage-hooks-reference-api/"> @pyric/ui/storage/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-traffic-reference-api/"> @pyric/ui/traffic </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-traffic-hooks-reference-api/"> @pyric/ui/traffic/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-events-reference-api/"> @pyric/ui/events </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-events-hooks-reference-api/"> @pyric/ui/events/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-agents-reference-api/"> @pyric/ui/agents </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rules-reference-api/"> @pyric/ui/rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rules-hooks-reference-api/"> @pyric/ui/rules/hooks </a> </li> </ul> </div> </div> </details> </nav> <main class="doc-main"> <nav class="docs-breadcrumbs" aria-label="Breadcrumb"> <ol> <li> <a href="/__pyric/ui/docs/api-reference/">API reference</a> </li><li> <span class="docs-breadcrumbs-sep" aria-hidden="true">/</span> <span>@pyric/cli</span> </li><li> <span class="docs-breadcrumbs-sep" aria-hidden="true">/</span> <span aria-current="page">@pyric/cli/remote</span> </li> </ol> </nav> <header class="api-reference-header"> <p class="api-reference-kicker">API reference</p> <h1><code>@pyric/cli/remote</code></h1> <p class="api-reference-meta"> 18 published symbols from <code>@pyric/cli</code> </p> <p class="api-reference-source">
|
|
1
|
+
<!DOCTYPE html><html lang="en"> <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>API reference: @pyric/cli/remote · Pyric Studio</title><meta name="description" content="Published declarations for @pyric/cli/remote."><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap" rel="stylesheet"><link rel="stylesheet" href="/__pyric/ui/_astro/_slug_.CXh9yTP1.css">
|
|
2
|
+
<link rel="stylesheet" href="/__pyric/ui/_astro/_slug_.DUci-duz.css"></head> <body> <header class="studio__bar"> <div class="studio__bar-inner"> <a class="studio__brand" href="/__pyric/ui/" aria-label="Pyric Studio">Pyric</a> <nav class="studio__nav" aria-label="Studio tabs"> <a class="studio__nav-tab" href="/__pyric/ui/"> Home </a><a class="studio__nav-tab" href="/__pyric/ui/firestore"> Firestore </a><a class="studio__nav-tab" href="/__pyric/ui/auth"> Auth </a><a class="studio__nav-tab" href="/__pyric/ui/rtdb"> RTDB </a><a class="studio__nav-tab" href="/__pyric/ui/storage"> Storage </a><a class="studio__nav-tab" href="/__pyric/ui/traffic"> Traffic </a><a class="studio__nav-tab" href="/__pyric/ui/settings"> Settings </a><a class="studio__nav-tab" href="/__pyric/ui/docs" aria-current="page"> Docs </a> </nav> </div> </header> <div class="docs-shell"> <details class="docs-nav-drawer"> <summary>Navigate</summary> <nav class="docs-nav" aria-label="Documentation"> <div class="docs-search" data-index-url="/__pyric/ui/docs/index.json"> <div class="docs-search-field"> <svg class="docs-search-icon" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"> <path d="M11.5 11.5 15 15M13 7A6 6 0 1 1 1 7a6 6 0 0 1 12 0Z" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path> </svg> <input type="text" class="docs-search-input" placeholder="Search docs" aria-label="Search docs" autocomplete="off" spellcheck="false"> <kbd class="docs-search-kbd">⌘K</kbd> </div> <ul class="docs-search-results" hidden></ul> </div> <script type="module">let i=null;function d(t){return i||(i=fetch(t).then(e=>e.json())),i}function l(t,e){return t.title.toLowerCase().includes(e)||t.excerpt.toLowerCase().includes(e)?!0:t.headings.some(r=>r.text.toLowerCase().includes(e))}function u(t,e,r){if(e.innerHTML="",t.length===0){e.hidden=!1;{const n=document.createElement("li");n.className="docs-search-empty",n.textContent="No matches",e.appendChild(n)}return}e.hidden=!1;for(const n of t.slice(0,8)){const s=document.createElement("li"),c=document.createElement("a");c.href=n.path;const o=document.createElement("span");o.className="docs-search-result-title",o.textContent=n.title;const a=document.createElement("span");a.className="docs-search-result-meta",a.textContent=[n.group,n.section].filter(Boolean).join(" / "),c.append(o,a),s.appendChild(c),e.appendChild(s)}}document.querySelectorAll(".docs-search").forEach(t=>{const e=t.dataset.indexUrl,r=t.querySelector(".docs-search-input"),n=t.querySelector(".docs-search-results");r.addEventListener("input",async()=>{const s=r.value.trim().toLowerCase();if(!s){n.hidden=!0,n.innerHTML="";return}const{pages:c}=await d(e);r.value.trim().toLowerCase()===s&&u(c.filter(o=>l(o,s)),n)}),r.addEventListener("focus",()=>{d(e),n.childElementCount>0&&(n.hidden=!1)}),r.addEventListener("keydown",s=>{s.key==="Escape"&&(r.value="",n.hidden=!0,n.innerHTML="",r.blur())}),r.addEventListener("blur",()=>{window.setTimeout(()=>{n.hidden=!0},150)})});document.addEventListener("keydown",t=>{if(!(t.metaKey||t.ctrlKey)||t.key.toLowerCase()!=="k")return;const e=[...document.querySelectorAll(".docs-search-input")].find(r=>r.offsetParent!==null);e&&(t.preventDefault(),e.focus(),e.select())});</script> <a class="docs-nav-toplink" href="/__pyric/ui/docs/overview/"> Overview </a><details class="docs-nav-group"> <summary>Get started</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/get-started/start-building/"> Quickstart </a> </li><li> <a href="/__pyric/ui/docs/get-started/how-the-swap-works/"> How the swap works </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Build</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/build/authentication/"> Authentication </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-firestore/"> Cloud Firestore </a> </li><li> <a href="/__pyric/ui/docs/build/realtime-database/"> Realtime Database </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-storage/"> Cloud Storage </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-messaging/"> Cloud Messaging </a> </li><li> <a href="/__pyric/ui/docs/build/ai-logic/"> AI Logic </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Secure & debug</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/secure/secure-it-with-rules/"> Security Rules </a> </li><li> <a href="/__pyric/ui/docs/secure/simulate-and-lint/"> Simulate and lint before you deploy </a> </li><li> <a href="/__pyric/ui/docs/secure/write-a-rules-test-suite/"> Write a rules test suite </a> </li><li> <a href="/__pyric/ui/docs/secure/read-a-denial/"> Read a denial and understand it </a> </li><li> <a href="/__pyric/ui/docs/secure/rules-standard-library/"> The rules standard library </a> </li><li> <a href="/__pyric/ui/docs/secure/rtdb-rules-in-typescript/"> RTDB rules in TypeScript </a> </li><li> <a href="/__pyric/ui/docs/secure/firestore-rules-limits/"> Rules limits </a> </li><li> <a href="/__pyric/ui/docs/secure/audit-your-rules/"> Audit rules and data </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Observe & shape</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/observe/see-whats-happening/"> Traffic & rule verdicts </a> </li><li> <a href="/__pyric/ui/docs/observe/shape-your-data/"> Seed, snapshot, replay </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Ship & test</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/ship/ship-to-production/"> Ship to production </a> </li><li> <a href="/__pyric/ui/docs/ship/test-in-node/"> Test in Node </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Work with an agent</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/agent/set-up-your-agent/"> Connect an agent </a> </li><li> <a href="/__pyric/ui/docs/agent/work-with-an-agent/"> Use the MCP tools </a> </li><li> <a href="/__pyric/ui/docs/agent/watch-and-review/"> Watch in Pyric Studio </a> </li> </ul> </div> </div> </details><a class="docs-nav-toplink" href="/__pyric/ui/docs/trust/versioning-and-compatibility/"> Trust </a><details class="docs-nav-group"> <summary>Conformance</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/conformance-scores/"> Public API coverage </a> </li><li> <a href="/__pyric/ui/docs/trust/how-we-know-it-matches-firebase/"> How we know it matches Firebase </a> </li><li> <a href="/__pyric/ui/docs/app-compat/"> App </a> </li><li> <a href="/__pyric/ui/docs/ai-compat/"> AI Logic </a> </li><li> <a href="/__pyric/ui/docs/auth-compat/"> Auth </a> </li><li> <a href="/__pyric/ui/docs/firestore-compat/"> Firestore </a> </li><li> <a href="/__pyric/ui/docs/database-compat/"> Realtime Database </a> </li><li> <a href="/__pyric/ui/docs/storage-compat/"> Storage </a> </li><li> <a href="/__pyric/ui/docs/messaging-compat/"> Messaging </a> </li><li> <a href="/__pyric/ui/docs/functions-rtdb-compat/"> Functions · RTDB </a> </li><li> <a href="/__pyric/ui/docs/rules-compat/"> Rules </a> </li> </ul> </div> </div> </details> <details class="docs-nav-group" open> <summary>Reference</summary> <div class="docs-nav-group-body docs-nav-group-body--reference"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/api-reference/"> API reference </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">pyric</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-app-reference-api/"> pyric/app </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore-reference-api/"> pyric/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-auth-reference-api/"> pyric/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-ai-reference-api/"> pyric/ai </a> </li><li> <a href="/__pyric/ui/docs/pyric-ai-scripting-reference-api/"> pyric/ai/scripting </a> </li><li> <a href="/__pyric/ui/docs/pyric-database-reference-api/"> pyric/database </a> </li><li> <a href="/__pyric/ui/docs/pyric-storage-reference-api/"> pyric/storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-messaging-reference-api/"> pyric/messaging </a> </li><li> <a href="/__pyric/ui/docs/pyric-messaging-sw-reference-api/"> pyric/messaging/sw </a> </li><li> <a href="/__pyric/ui/docs/pyric-rules-reference-api/"> pyric/rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore-values-reference-api/"> pyric/firestore-values </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-reference-api/"> pyric/sandbox </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-firestore-reference-api/"> pyric/sandbox/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-database-reference-api/"> pyric/sandbox/database </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">pyric-admin</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-admin-app-reference-api/"> pyric-admin/app </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-firestore-reference-api/"> pyric-admin/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-auth-reference-api/"> pyric-admin/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-database-reference-api/"> pyric-admin/database </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-storage-reference-api/"> pyric-admin/storage </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">create-pyric</h2> <ul> <li> <a href="/__pyric/ui/docs/create-pyric-reference-api/"> create-pyric </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">@pyric/cli</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-cli-credentials-node-reference-api/"> @pyric/cli/credentials/node </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-verify-reference-api/"> @pyric/cli/verify </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-conformance-reference-api/"> @pyric/cli/conformance </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-conformance-browser-reference-api/"> @pyric/cli/conformance/browser </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-conformance-docs-reference-api/"> @pyric/cli/conformance/docs </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-assurance-reference-api/"> @pyric/cli/assurance </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-assurance-browser-reference-api/"> @pyric/cli/assurance/browser </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-bridge-reference-api/"> @pyric/cli/bridge </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-bridge-client-reference-api/"> @pyric/cli/bridge/client </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-discover-reference-api/"> @pyric/cli/discover </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-vite-reference-api/"> @pyric/cli/vite </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-serve-worker-reference-api/"> @pyric/cli/serve/worker </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-remote-reference-api/" aria-current="page"> @pyric/cli/remote </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-register-reference-api/"> @pyric/cli/register </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">@pyric/ui</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-ui-auth-reference-api/"> @pyric/ui/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-auth-hooks-reference-api/"> @pyric/ui/auth/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-primitives-reference-api/"> @pyric/ui/primitives </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-firestore-reference-api/"> @pyric/ui/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-firestore-hooks-reference-api/"> @pyric/ui/firestore/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rtdb-reference-api/"> @pyric/ui/rtdb </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-storage-reference-api/"> @pyric/ui/storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-storage-hooks-reference-api/"> @pyric/ui/storage/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-traffic-reference-api/"> @pyric/ui/traffic </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-traffic-hooks-reference-api/"> @pyric/ui/traffic/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-events-reference-api/"> @pyric/ui/events </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-events-hooks-reference-api/"> @pyric/ui/events/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-agents-reference-api/"> @pyric/ui/agents </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rules-reference-api/"> @pyric/ui/rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rules-hooks-reference-api/"> @pyric/ui/rules/hooks </a> </li> </ul> </div> </div> </details> </nav> </details> <nav class="docs-nav" aria-label="Documentation"> <div class="docs-search" data-index-url="/__pyric/ui/docs/index.json"> <div class="docs-search-field"> <svg class="docs-search-icon" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"> <path d="M11.5 11.5 15 15M13 7A6 6 0 1 1 1 7a6 6 0 0 1 12 0Z" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path> </svg> <input type="text" class="docs-search-input" placeholder="Search docs" aria-label="Search docs" autocomplete="off" spellcheck="false"> <kbd class="docs-search-kbd">⌘K</kbd> </div> <ul class="docs-search-results" hidden></ul> </div> <a class="docs-nav-toplink" href="/__pyric/ui/docs/overview/" id="nav-group-overview"> Overview </a><details class="docs-nav-group" id="nav-group-get-started"> <summary>Get started</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/get-started/start-building/"> Quickstart </a> </li><li> <a href="/__pyric/ui/docs/get-started/how-the-swap-works/"> How the swap works </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-build"> <summary>Build</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/build/authentication/"> Authentication </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-firestore/"> Cloud Firestore </a> </li><li> <a href="/__pyric/ui/docs/build/realtime-database/"> Realtime Database </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-storage/"> Cloud Storage </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-messaging/"> Cloud Messaging </a> </li><li> <a href="/__pyric/ui/docs/build/ai-logic/"> AI Logic </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-secure-debug"> <summary>Secure & debug</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/secure/secure-it-with-rules/"> Security Rules </a> </li><li> <a href="/__pyric/ui/docs/secure/simulate-and-lint/"> Simulate and lint before you deploy </a> </li><li> <a href="/__pyric/ui/docs/secure/write-a-rules-test-suite/"> Write a rules test suite </a> </li><li> <a href="/__pyric/ui/docs/secure/read-a-denial/"> Read a denial and understand it </a> </li><li> <a href="/__pyric/ui/docs/secure/rules-standard-library/"> The rules standard library </a> </li><li> <a href="/__pyric/ui/docs/secure/rtdb-rules-in-typescript/"> RTDB rules in TypeScript </a> </li><li> <a href="/__pyric/ui/docs/secure/firestore-rules-limits/"> Rules limits </a> </li><li> <a href="/__pyric/ui/docs/secure/audit-your-rules/"> Audit rules and data </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-observe-shape"> <summary>Observe & shape</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/observe/see-whats-happening/"> Traffic & rule verdicts </a> </li><li> <a href="/__pyric/ui/docs/observe/shape-your-data/"> Seed, snapshot, replay </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-ship-test"> <summary>Ship & test</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/ship/ship-to-production/"> Ship to production </a> </li><li> <a href="/__pyric/ui/docs/ship/test-in-node/"> Test in Node </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-work-with-an-agent"> <summary>Work with an agent</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/agent/set-up-your-agent/"> Connect an agent </a> </li><li> <a href="/__pyric/ui/docs/agent/work-with-an-agent/"> Use the MCP tools </a> </li><li> <a href="/__pyric/ui/docs/agent/watch-and-review/"> Watch in Pyric Studio </a> </li> </ul> </div> </div> </details><a class="docs-nav-toplink" href="/__pyric/ui/docs/trust/versioning-and-compatibility/" id="nav-group-trust"> Trust </a><details class="docs-nav-group" id="nav-group-conformance"> <summary>Conformance</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/conformance-scores/"> Public API coverage </a> </li><li> <a href="/__pyric/ui/docs/trust/how-we-know-it-matches-firebase/"> How we know it matches Firebase </a> </li><li> <a href="/__pyric/ui/docs/app-compat/"> App </a> </li><li> <a href="/__pyric/ui/docs/ai-compat/"> AI Logic </a> </li><li> <a href="/__pyric/ui/docs/auth-compat/"> Auth </a> </li><li> <a href="/__pyric/ui/docs/firestore-compat/"> Firestore </a> </li><li> <a href="/__pyric/ui/docs/database-compat/"> Realtime Database </a> </li><li> <a href="/__pyric/ui/docs/storage-compat/"> Storage </a> </li><li> <a href="/__pyric/ui/docs/messaging-compat/"> Messaging </a> </li><li> <a href="/__pyric/ui/docs/functions-rtdb-compat/"> Functions · RTDB </a> </li><li> <a href="/__pyric/ui/docs/rules-compat/"> Rules </a> </li> </ul> </div> </div> </details> <details class="docs-nav-group" id="nav-group-reference" open> <summary>Reference</summary> <div class="docs-nav-group-body docs-nav-group-body--reference"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/api-reference/"> API reference </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">pyric</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-app-reference-api/"> pyric/app </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore-reference-api/"> pyric/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-auth-reference-api/"> pyric/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-ai-reference-api/"> pyric/ai </a> </li><li> <a href="/__pyric/ui/docs/pyric-ai-scripting-reference-api/"> pyric/ai/scripting </a> </li><li> <a href="/__pyric/ui/docs/pyric-database-reference-api/"> pyric/database </a> </li><li> <a href="/__pyric/ui/docs/pyric-storage-reference-api/"> pyric/storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-messaging-reference-api/"> pyric/messaging </a> </li><li> <a href="/__pyric/ui/docs/pyric-messaging-sw-reference-api/"> pyric/messaging/sw </a> </li><li> <a href="/__pyric/ui/docs/pyric-rules-reference-api/"> pyric/rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore-values-reference-api/"> pyric/firestore-values </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-reference-api/"> pyric/sandbox </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-firestore-reference-api/"> pyric/sandbox/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-database-reference-api/"> pyric/sandbox/database </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">pyric-admin</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-admin-app-reference-api/"> pyric-admin/app </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-firestore-reference-api/"> pyric-admin/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-auth-reference-api/"> pyric-admin/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-database-reference-api/"> pyric-admin/database </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-storage-reference-api/"> pyric-admin/storage </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">create-pyric</h2> <ul> <li> <a href="/__pyric/ui/docs/create-pyric-reference-api/"> create-pyric </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">@pyric/cli</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-cli-credentials-node-reference-api/"> @pyric/cli/credentials/node </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-verify-reference-api/"> @pyric/cli/verify </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-conformance-reference-api/"> @pyric/cli/conformance </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-conformance-browser-reference-api/"> @pyric/cli/conformance/browser </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-conformance-docs-reference-api/"> @pyric/cli/conformance/docs </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-assurance-reference-api/"> @pyric/cli/assurance </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-assurance-browser-reference-api/"> @pyric/cli/assurance/browser </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-bridge-reference-api/"> @pyric/cli/bridge </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-bridge-client-reference-api/"> @pyric/cli/bridge/client </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-discover-reference-api/"> @pyric/cli/discover </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-vite-reference-api/"> @pyric/cli/vite </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-serve-worker-reference-api/"> @pyric/cli/serve/worker </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-remote-reference-api/" aria-current="page"> @pyric/cli/remote </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-register-reference-api/"> @pyric/cli/register </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">@pyric/ui</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-ui-auth-reference-api/"> @pyric/ui/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-auth-hooks-reference-api/"> @pyric/ui/auth/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-primitives-reference-api/"> @pyric/ui/primitives </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-firestore-reference-api/"> @pyric/ui/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-firestore-hooks-reference-api/"> @pyric/ui/firestore/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rtdb-reference-api/"> @pyric/ui/rtdb </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-storage-reference-api/"> @pyric/ui/storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-storage-hooks-reference-api/"> @pyric/ui/storage/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-traffic-reference-api/"> @pyric/ui/traffic </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-traffic-hooks-reference-api/"> @pyric/ui/traffic/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-events-reference-api/"> @pyric/ui/events </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-events-hooks-reference-api/"> @pyric/ui/events/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-agents-reference-api/"> @pyric/ui/agents </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rules-reference-api/"> @pyric/ui/rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rules-hooks-reference-api/"> @pyric/ui/rules/hooks </a> </li> </ul> </div> </div> </details> </nav> <main class="doc-main"> <nav class="docs-breadcrumbs" aria-label="Breadcrumb"> <ol> <li> <a href="/__pyric/ui/docs/api-reference/">API reference</a> </li><li> <span class="docs-breadcrumbs-sep" aria-hidden="true">/</span> <span>@pyric/cli</span> </li><li> <span class="docs-breadcrumbs-sep" aria-hidden="true">/</span> <span aria-current="page">@pyric/cli/remote</span> </li> </ol> </nav> <header class="api-reference-header"> <p class="api-reference-kicker">API reference</p> <h1><code>@pyric/cli/remote</code></h1> <p class="api-reference-meta"> 18 published symbols from <code>@pyric/cli</code> </p> <p class="api-reference-source">
|
|
2
3
|
Generated from the TypeScript declarations shipped at this import path.
|
|
3
|
-
</p> </header> <article class="prose api-reference-body"> <!-- Generated from published package declarations via TypeDoc.
|
|
4
|
+
</p> </header> <article class="prose api-reference-body"> <!-- Generated from published package declarations via TypeDoc. Rendered by the api-reference content loader. -->
|
|
4
5
|
<h2 id="interfaces">Interfaces</h2>
|
|
5
6
|
<p><a id="connectremotesandboxoptions"></a></p>
|
|
6
7
|
<h3 id="connectremotesandboxoptions">ConnectRemoteSandboxOptions</h3>
|
|
@@ -84,16 +85,502 @@ settles with the same fail-fast errors <a href="#connectremotesandbox">connectRe
|
|
|
84
85
|
|
|
85
86
|
|
|
86
87
|
|
|
87
|
-
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
<table><thead><tr><th align="left">Property</th><th align="left">Modifier</th><th align="left">Type</th><th align="left">Description</th></tr></thead><tbody><tr><td align="left"><a id="remote_sandbox"></a> <code>[REMOTE_SANDBOX]</code></td><td align="left"><code>readonly</code></td><td align="left"><code>true</code></td><td align="left">-</td></tr><tr><td align="left"><a id="admin"></a> <code>admin</code></td><td align="left"><code>readonly</code></td><td align="left"><code>SandboxAdmin</code></td><td align="left">Admin-plane access (rule-bypass reads). Identity-agnostic by design — admin reads aren’t gated on auth, so they live on the sandbox, not on a context. See SandboxAdmin.</td></tr><tr><td align="left"><a id="auth"></a> <code>auth</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#remoteauthadmin"><code>RemoteAuthAdmin</code></a></td><td align="left">Admin auth user CRUD.</td></tr><tr><td align="left"><a id="channel"></a> <code>channel</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#remotesandboxchannel-1"><code>RemoteSandboxChannel</code></a></td><td align="left">The raw worker op/sub relay channel (narrowed to the wire payload types).</td></tr><tr><td align="left"><a id="currentuser"></a> <code>currentUser</code></td><td align="left"><code>public</code></td><td align="left">{ <code>token?</code>: <code>Record</code><<code>string</code>, <code>unknown</code>>; <code>uid</code>: <code>string</code>; }</td><td align="left">Current authenticated user across the sandbox. Mutated by <code>pyric/auth</code>’s <code>signInAnonymously</code> / <code>signInWithEmailAndPassword</code> / <code>signOut</code> / <code>sandbox.setUser</code>. Read per-call by service factories (e.g. a future <code>getFirestore(sandbox)</code> overload) so they see auth state changes without re-binding handles. Defaults to <code>null</code> (anonymous / signed out). <strong>Independent of <code>withAuth({uid})</code></strong> — <code>withAuth</code> still produces a frozen <a href="/docs/pyric-firestore-reference-api/#sandboxcontext">SandboxContext</a> that carries its own identity for the runner’s test code (the existing pattern: explicit identity per service call). <code>currentUser</code> exists for the <code>pyric/auth</code> mirror, where consumer app code drives identity through a stateful <code>Auth</code> handle rather than naming it per call.</td></tr><tr><td align="left"><code>currentUser.token?</code></td><td align="left"><code>public</code></td><td align="left"><code>Record</code><<code>string</code>, <code>unknown</code>></td><td align="left">-</td></tr><tr><td align="left"><code>currentUser.uid</code></td><td align="left"><code>public</code></td><td align="left"><code>string</code></td><td align="left">-</td></tr><tr><td align="left"><a id="ready"></a> <code>ready</code></td><td align="left"><code>readonly</code></td><td align="left"><code>Promise</code><<code>void</code>></td><td align="left">-</td></tr><tr><td align="left"><a id="rtdb"></a> <code>rtdb</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#remotertdb"><code>RemoteRtdb</code></a></td><td align="left">RTDB conveniences (admin lens pinned).</td></tr><tr><td align="left"><a id="serveurl"></a> <code>serveUrl</code></td><td align="left"><code>readonly</code></td><td align="left"><code>string</code></td><td align="left">Base URL of the <code>pyric dev</code> this handle is attached to (used in error guidance: “open <serveurl> in a browser and retry”).</serveurl></td></tr><tr><td align="left"><a id="storage"></a> <code>storage</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#remotestorage"><code>RemoteStorage</code></a></td><td align="left">Storage conveniences (admin lens pinned; 8 MiB per-op byte cap).</td></tr></tbody></table></div>
|
|
88
125
|
<h4 id="methods">Methods</h4>
|
|
126
|
+
<p><a id="clearpersistence"></a></p>
|
|
127
|
+
<h5 id="clearpersistence">clearPersistence()</h5>
|
|
128
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">clearPersistence</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#C678DD">void</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
129
|
+
<p>Wipe the persisted blob for this sandbox’s <code>key</code>. In-memory state
|
|
130
|
+
is left intact — call <code>reset()</code> if you want both. Useful for
|
|
131
|
+
“sign out and forget” flows.</p>
|
|
132
|
+
<p>No-op when persistence is not enabled.</p>
|
|
133
|
+
<h6 id="returns">Returns</h6>
|
|
134
|
+
<p><code>Promise</code><<code>void</code>></p>
|
|
135
|
+
<h6 id="inherited-from">Inherited from</h6>
|
|
136
|
+
<p><a href="#remotesandbox"><code>RemoteSandbox</code></a>.<a href="#clearpersistence-2"><code>clearPersistence</code></a></p>
|
|
89
137
|
<p><a id="close"></a></p>
|
|
90
138
|
<h5 id="close">close()</h5>
|
|
91
139
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">close</span><span style="color:#ABB2BF">(): </span><span style="color:#C678DD">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
92
140
|
<p>Close the connection. In-flight ops reject; subscriptions stop.</p>
|
|
93
|
-
<h6 id="returns">Returns</h6>
|
|
141
|
+
<h6 id="returns-1">Returns</h6>
|
|
94
142
|
<p><code>void</code></p>
|
|
95
|
-
<h6 id="inherited-from">Inherited from</h6>
|
|
143
|
+
<h6 id="inherited-from-1">Inherited from</h6>
|
|
96
144
|
<p><a href="#remotesandbox"><code>RemoteSandbox</code></a>.<a href="#close-2"><code>close</code></a></p>
|
|
145
|
+
<p><a id="dispose"></a></p>
|
|
146
|
+
<h5 id="dispose">dispose()</h5>
|
|
147
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">dispose</span><span style="color:#ABB2BF">(): </span><span style="color:#C678DD">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
148
|
+
<p>Tear down listener registries on this sandbox’s environment without
|
|
149
|
+
replacing it. Use this when you’re about to discard the sandbox
|
|
150
|
+
itself (e.g. <code>runner.reseed()</code> builds a fresh sandbox rather than
|
|
151
|
+
calling <code>reset()</code>) and want to drop callback references on the
|
|
152
|
+
outgoing instance defensively. Idempotent. Does not touch data.</p>
|
|
153
|
+
<h6 id="returns-2">Returns</h6>
|
|
154
|
+
<p><code>void</code></p>
|
|
155
|
+
<h6 id="inherited-from-2">Inherited from</h6>
|
|
156
|
+
<p><a href="#remotesandbox"><code>RemoteSandbox</code></a>.<a href="#dispose-2"><code>dispose</code></a></p>
|
|
157
|
+
<p><a id="enablepersistence"></a></p>
|
|
158
|
+
<h5 id="enablepersistence">enablePersistence()</h5>
|
|
159
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">enablePersistence</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">options</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">SandboxPersistenceOptions</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#C678DD">void</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
160
|
+
<p>Persist the sandbox’s data to a backend and restore it on next
|
|
161
|
+
<code>enablePersistence</code> call. The default <code>'indexedDB'</code> backend turns
|
|
162
|
+
the sandbox into the host page’s local Firestore — writes flush
|
|
163
|
+
automatically and a fresh <code>initializeSandbox()</code> rehydrates from
|
|
164
|
+
the prior session.</p>
|
|
165
|
+
<p>Restoration happens before the promise resolves; awaiting this
|
|
166
|
+
call is sufficient to guarantee in-memory state matches the
|
|
167
|
+
persisted blob.</p>
|
|
168
|
+
<p>Idempotent across the same <code>key</code> — calling twice in one process
|
|
169
|
+
is a no-op on the second call. Different keys are rejected as an
|
|
170
|
+
error (a sandbox can persist to at most one backend at a time).</p>
|
|
171
|
+
<p>Listener semantics: every write event the sandbox emits triggers
|
|
172
|
+
a debounced flush (default 250ms). Browser hosts additionally
|
|
173
|
+
flush on <code>beforeunload</code> so a page navigation doesn’t lose the
|
|
174
|
+
tail of the debounce window.</p>
|
|
175
|
+
<p>See <a href="/docs/pyric-sandbox-reference-api/#sandboxpersistenceoptions">SandboxPersistenceOptions</a> for backend selection and
|
|
176
|
+
tuning.</p>
|
|
177
|
+
<h6 id="parameters">Parameters</h6>
|
|
178
|
+
<div class="table-scroll">
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>options</code></td><td align="left"><a href="/docs/pyric-sandbox-reference-api/#sandboxpersistenceoptions"><code>SandboxPersistenceOptions</code></a></td></tr></tbody></table></div>
|
|
192
|
+
<h6 id="returns-3">Returns</h6>
|
|
193
|
+
<p><code>Promise</code><<code>void</code>></p>
|
|
194
|
+
<h6 id="inherited-from-3">Inherited from</h6>
|
|
195
|
+
<p><a href="#remotesandbox"><code>RemoteSandbox</code></a>.<a href="#enablepersistence-2"><code>enablePersistence</code></a></p>
|
|
196
|
+
<p><a id="enabletabsync"></a></p>
|
|
197
|
+
<h5 id="enabletabsync">enableTabSync()</h5>
|
|
198
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">enableTabSync</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">options</span><span style="color:#C678DD">?:</span><span style="color:#E06C75"> TabSyncOptions</span><span style="color:#ABB2BF">): () </span><span style="color:#C678DD">=></span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
199
|
+
<p>Enable cross-tab realtime sync via <code>BroadcastChannel</code>. A write in
|
|
200
|
+
this tab will propagate to every OTHER tab of the same origin that
|
|
201
|
+
also called <code>enableTabSync</code>, causing their <code>onSnapshot</code> listeners to
|
|
202
|
+
re-evaluate — restoring production’s cross-client realtime behavior.</p>
|
|
203
|
+
<p><strong>Opt-in, OFF by default.</strong> Firestore only (RTDB is a follow-on).</p>
|
|
204
|
+
<p>Returns a disable function. Calling it removes the <code>onEvent</code>
|
|
205
|
+
subscription, the channel message listener, and closes the channel
|
|
206
|
+
(when it was created internally). After disable, no further propagation
|
|
207
|
+
occurs in either direction.</p>
|
|
208
|
+
<p><strong>Multi-writer note:</strong> concurrent writes from two tabs to the same doc
|
|
209
|
+
produce last-write-wins divergence — there is no conflict resolution.
|
|
210
|
+
The intended model is one active writer (one user, one tab) with
|
|
211
|
+
observers in other tabs; this covers the overwhelming majority of
|
|
212
|
+
local development scenarios.</p>
|
|
213
|
+
<h6 id="parameters-1">Parameters</h6>
|
|
214
|
+
<div class="table-scroll">
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>options?</code></td><td align="left"><a href="/docs/pyric-sandbox-reference-api/#tabsyncoptions"><code>TabSyncOptions</code></a></td></tr></tbody></table></div>
|
|
228
|
+
<h6 id="returns-4">Returns</h6>
|
|
229
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
230
|
+
<h6 id="returns-5">Returns</h6>
|
|
231
|
+
<p><code>void</code></p>
|
|
232
|
+
<h6 id="see">See</h6>
|
|
233
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#tabsyncoptions">TabSyncOptions</a> for channel injection (tests) and originId.</p>
|
|
234
|
+
<h6 id="example">Example</h6>
|
|
235
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#7F848E;font-style:italic">// In every tab that should participate in realtime:</span></span>
|
|
236
|
+
<span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> sandbox</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> initializeSandbox</span><span style="color:#ABB2BF">();</span></span>
|
|
237
|
+
<span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> disableSync</span><span style="color:#56B6C2"> =</span><span style="color:#E5C07B"> sandbox</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">enableTabSync</span><span style="color:#ABB2BF">();</span></span>
|
|
238
|
+
<span class="line"><span style="color:#7F848E;font-style:italic">// Later, to stop syncing:</span></span>
|
|
239
|
+
<span class="line"><span style="color:#61AFEF">disableSync</span><span style="color:#ABB2BF">();</span></span></code></pre>
|
|
240
|
+
<h6 id="inherited-from-4">Inherited from</h6>
|
|
241
|
+
<p><a href="#remotesandbox"><code>RemoteSandbox</code></a>.<a href="#enabletabsync-2"><code>enableTabSync</code></a></p>
|
|
242
|
+
<p><a id="flush"></a></p>
|
|
243
|
+
<h5 id="flush">flush()</h5>
|
|
244
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">flush</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#C678DD">void</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
245
|
+
<p>Force a snapshot to the configured persistence backend right now.
|
|
246
|
+
Useful before a manual navigation, or in tests that need
|
|
247
|
+
deterministic ordering against the debounce window. Resolves once
|
|
248
|
+
the write hits the backend.</p>
|
|
249
|
+
<p>Throws if persistence is not enabled.</p>
|
|
250
|
+
<h6 id="returns-6">Returns</h6>
|
|
251
|
+
<p><code>Promise</code><<code>void</code>></p>
|
|
252
|
+
<h6 id="inherited-from-5">Inherited from</h6>
|
|
253
|
+
<p><a href="#remotesandbox"><code>RemoteSandbox</code></a>.<a href="#flush-2"><code>flush</code></a></p>
|
|
254
|
+
<p><a id="history"></a></p>
|
|
255
|
+
<h5 id="history">history()</h5>
|
|
256
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">history</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">SandboxEvent</span><span style="color:#ABB2BF">[];</span></span></code></pre>
|
|
257
|
+
<p>Every <a href="/docs/pyric-sandbox-reference-api/#sandboxevent">SandboxEvent</a> this sandbox has emitted since init or
|
|
258
|
+
the last <code>reset()</code>. Returns a defensive copy.</p>
|
|
259
|
+
<p>Use this for replay: hand the array to <code>replay(events, rules)</code>
|
|
260
|
+
from <code>pyric/sandbox</code> and the engine re-issues every
|
|
261
|
+
captured write against a fresh sandbox.</p>
|
|
262
|
+
<p>Unlike <a href="/docs/pyric-firestore-reference-api/#onevent">onEvent</a> (live stream from the moment of subscribe),
|
|
263
|
+
<code>history()</code> returns <em>every</em> event the sandbox has seen — useful
|
|
264
|
+
for consumers that attach late (e.g., loading a saved session
|
|
265
|
+
before subscribing) or that need a snapshot at a particular moment.</p>
|
|
266
|
+
<p><code>reset()</code> and <code>dispose()</code> each append a closing <code>session_boundary</code>
|
|
267
|
+
event; <code>reset()</code> then clears the history. Consumers that took a
|
|
268
|
+
snapshot <em>before</em> reset retain the boundary in their copy.</p>
|
|
269
|
+
<h6 id="returns-7">Returns</h6>
|
|
270
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#sandboxevent"><code>SandboxEvent</code></a>[]</p>
|
|
271
|
+
<h6 id="inherited-from-6">Inherited from</h6>
|
|
272
|
+
<p><a href="#remotesandbox"><code>RemoteSandbox</code></a>.<a href="#history-2"><code>history</code></a></p>
|
|
273
|
+
<p><a id="loadsnapshot"></a></p>
|
|
274
|
+
<h5 id="loadsnapshot">loadSnapshot()</h5>
|
|
275
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">loadSnapshot</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">data</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">SandboxSnapshot</span><span style="color:#ABB2BF">): </span><span style="color:#C678DD">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
276
|
+
<p>CLOBBER-restore the sandbox’s entire state from a prior <a href="/docs/pyric-firestore-reference-api/#snapshot">snapshot</a>:
|
|
277
|
+
<code>reset()</code> (clears firestore + the signed-in session), then rebuild firestore
|
|
278
|
+
from <code>data</code> and restore each registered service. This is a TOTAL replace —
|
|
279
|
+
documents absent from <code>data</code> do NOT survive — and is the counterpart to
|
|
280
|
+
<a href="/docs/pyric-firestore-reference-api/#snapshot">snapshot</a>. It is what makes “transfer (clobber) one instance’s data
|
|
281
|
+
into another” and named-branch switching possible.</p>
|
|
282
|
+
<p>Fires a <code>session_boundary</code> (reset phase), re-evaluates live listeners against
|
|
283
|
+
the loaded state, and the next persistence flush writes the loaded state.
|
|
284
|
+
Services present in <code>data</code> but not currently registered are skipped (a
|
|
285
|
+
snapshot taken via <a href="/docs/pyric-firestore-reference-api/#snapshot">snapshot</a> always includes every registered
|
|
286
|
+
service, so this only affects cross-instance imports from a sandbox that had
|
|
287
|
+
a service this one lacks).</p>
|
|
288
|
+
<h6 id="parameters-2">Parameters</h6>
|
|
289
|
+
<div class="table-scroll">
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>data</code></td><td align="left"><a href="/docs/pyric-sandbox-reference-api/#sandboxsnapshot"><code>SandboxSnapshot</code></a></td></tr></tbody></table></div>
|
|
303
|
+
<h6 id="returns-8">Returns</h6>
|
|
304
|
+
<p><code>void</code></p>
|
|
305
|
+
<h6 id="inherited-from-7">Inherited from</h6>
|
|
306
|
+
<p><a href="#remotesandbox"><code>RemoteSandbox</code></a>.<a href="#loadsnapshot-2"><code>loadSnapshot</code></a></p>
|
|
307
|
+
<p><a id="oncurrentuserchanged"></a></p>
|
|
308
|
+
<h5 id="oncurrentuserchanged">onCurrentUserChanged()</h5>
|
|
309
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">onCurrentUserChanged</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">cb</span><span style="color:#ABB2BF">: (</span><span style="color:#E06C75;font-style:italic">user</span><span style="color:#ABB2BF">: {</span></span>
|
|
310
|
+
<span class="line"><span style="color:#E06C75"> token</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Record</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">, </span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">>;</span></span>
|
|
311
|
+
<span class="line"><span style="color:#E06C75"> uid</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">;</span></span>
|
|
312
|
+
<span class="line"><span style="color:#ABB2BF">}) </span><span style="color:#C678DD">=></span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">): () </span><span style="color:#C678DD">=></span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
313
|
+
<p>Subscribe to <code>currentUser</code> changes. Fires on every mutation —
|
|
314
|
+
sign-in, sign-out, user swap. Does NOT fire on subscribe.</p>
|
|
315
|
+
<p>Survives <code>reset()</code> and <code>dispose()</code> only as a no-op: a disposed
|
|
316
|
+
sandbox emits nothing further; a reset sandbox clears
|
|
317
|
+
<code>currentUser</code> to <code>null</code> (and fires the change) before swapping
|
|
318
|
+
the env.</p>
|
|
319
|
+
<p>Returns an unsubscribe function. Listener errors are swallowed —
|
|
320
|
+
subscribers are observational, the sandbox does not propagate
|
|
321
|
+
their errors.</p>
|
|
322
|
+
<h6 id="parameters-3">Parameters</h6>
|
|
323
|
+
<div class="table-scroll">
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>cb</code></td><td align="left">(<code>user</code>: { <code>token?</code>: <code>Record</code><<code>string</code>, <code>unknown</code>>; <code>uid</code>: <code>string</code>; }) => <code>void</code></td></tr></tbody></table></div>
|
|
337
|
+
<h6 id="returns-9">Returns</h6>
|
|
338
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
339
|
+
<h6 id="returns-10">Returns</h6>
|
|
340
|
+
<p><code>void</code></p>
|
|
341
|
+
<h6 id="inherited-from-8">Inherited from</h6>
|
|
342
|
+
<p><a href="#remotesandbox"><code>RemoteSandbox</code></a>.<a href="#oncurrentuserchanged-2"><code>onCurrentUserChanged</code></a></p>
|
|
343
|
+
<p><a id="onevent"></a></p>
|
|
344
|
+
<h5 id="onevent">onEvent()</h5>
|
|
345
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">onEvent</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">cb</span><span style="color:#ABB2BF">: (</span><span style="color:#E06C75;font-style:italic">event</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">SandboxEvent</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">): () </span><span style="color:#C678DD">=></span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
346
|
+
<p>Subscribe to every event the sandbox emits — see <a href="/docs/pyric-sandbox-reference-api/#sandboxevent">SandboxEvent</a>
|
|
347
|
+
for the discriminated-union shape. One subscription covers
|
|
348
|
+
request/denial/snapshot-error/listener-lifecycle/session-boundary;
|
|
349
|
+
filter on <code>event.kind</code> to recover individual streams.</p>
|
|
350
|
+
<p>Replaces the prior three-channel surface (<code>onRequest</code> / <code>onDenial</code>
|
|
351
|
+
/ <code>onSnapshotError</code>) — see issue #307. Filter cookbook:</p>
|
|
352
|
+
<ul>
|
|
353
|
+
<li>All denials: <code>event.kind === 'request' && event.result === 'deny'</code></li>
|
|
354
|
+
<li>Stream errors: <code>event.kind === 'listener_errored'</code></li>
|
|
355
|
+
<li>Per-op traffic: <code>event.kind === 'request'</code></li>
|
|
356
|
+
</ul>
|
|
357
|
+
<p>Survives <code>sandbox.reset()</code> — the subscription is held on the
|
|
358
|
+
sandbox, not on the underlying environment. A <code>session_boundary</code>
|
|
359
|
+
event with <code>phase: 'reset'</code> fires before the env swap so consumers
|
|
360
|
+
can segment their stream.</p>
|
|
361
|
+
<p>Returns an unsubscribe function. Listener errors are swallowed so a
|
|
362
|
+
faulty subscriber can’t change rule semantics or hide other events.
|
|
363
|
+
Both synchronous throws and rejected Promises from async callbacks
|
|
364
|
+
are silently discarded — subscribers are <strong>observational</strong>, the
|
|
365
|
+
sandbox doesn’t await them and doesn’t propagate their errors.</p>
|
|
366
|
+
<h6 id="parameters-4">Parameters</h6>
|
|
367
|
+
<div class="table-scroll">
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>cb</code></td><td align="left">(<code>event</code>: <a href="/docs/pyric-sandbox-reference-api/#sandboxevent"><code>SandboxEvent</code></a>) => <code>void</code></td></tr></tbody></table></div>
|
|
381
|
+
<h6 id="returns-11">Returns</h6>
|
|
382
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
383
|
+
<h6 id="returns-12">Returns</h6>
|
|
384
|
+
<p><code>void</code></p>
|
|
385
|
+
<h6 id="inherited-from-9">Inherited from</h6>
|
|
386
|
+
<p><a href="#remotesandbox"><code>RemoteSandbox</code></a>.<a href="#onevent-2"><code>onEvent</code></a></p>
|
|
387
|
+
<p><a id="registerpersistableservice"></a></p>
|
|
388
|
+
<h5 id="registerpersistableservice">registerPersistableService()</h5>
|
|
389
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">registerPersistableService</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">name</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">hooks</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">PersistableService</span><span style="color:#ABB2BF">): () </span><span style="color:#C678DD">=></span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
390
|
+
<p>Register a service (auth, storage, …) as a persistence participant.
|
|
391
|
+
The sandbox calls <code>hooks.snapshot()</code> on every flush and
|
|
392
|
+
<code>hooks.restore(data)</code> on restore. If <code>hooks.subscribe</code> is provided,
|
|
393
|
+
the persistence controller subscribes and schedules a debounced
|
|
394
|
+
flush on each change — so auth-user edits flush promptly, not only
|
|
395
|
+
on the next Firestore write.</p>
|
|
396
|
+
<p>Returns an unregister function — call it if the service is torn
|
|
397
|
+
down before the sandbox is disposed (uncommon in practice; the
|
|
398
|
+
sandbox’s <code>dispose()</code> clears the registry anyway).</p>
|
|
399
|
+
<p>Throws <code>failed-precondition</code> when a service with the same <code>name</code> is
|
|
400
|
+
already registered — the auth package registers <code>'auth'</code> once when
|
|
401
|
+
<code>getAuth(sandbox)</code> first creates a backend, so accidental double-
|
|
402
|
+
registration is a caller bug, not a no-op.</p>
|
|
403
|
+
<p><strong>Advanced / internal API.</strong> Service packages (auth, storage) call
|
|
404
|
+
this when they first attach to a sandbox. Consumer app code should
|
|
405
|
+
not need to call this directly.</p>
|
|
406
|
+
<h6 id="parameters-5">Parameters</h6>
|
|
407
|
+
<div class="table-scroll">
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>name</code></td><td align="left"><code>string</code></td></tr><tr><td align="left"><code>hooks</code></td><td align="left"><a href="/docs/pyric-sandbox-reference-api/#persistableservice"><code>PersistableService</code></a></td></tr></tbody></table></div>
|
|
425
|
+
<h6 id="returns-13">Returns</h6>
|
|
426
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
427
|
+
<h6 id="returns-14">Returns</h6>
|
|
428
|
+
<p><code>void</code></p>
|
|
429
|
+
<h6 id="inherited-from-10">Inherited from</h6>
|
|
430
|
+
<p><a href="#remotesandbox"><code>RemoteSandbox</code></a>.<a href="#registerpersistableservice-2"><code>registerPersistableService</code></a></p>
|
|
431
|
+
<p><a id="reset"></a></p>
|
|
432
|
+
<h5 id="reset">reset()</h5>
|
|
433
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">reset</span><span style="color:#ABB2BF">(): </span><span style="color:#C678DD">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
434
|
+
<p>Reset the underlying environment to a fresh state — wipes data,
|
|
435
|
+
rules, and any service-specific configuration.</p>
|
|
436
|
+
<p>Snapshot listeners attached to the OLD environment are dropped at
|
|
437
|
+
the swap — they can’t survive because their target docs have been
|
|
438
|
+
wiped. <code>onEvent</code> subscribers DO survive — the registry lives on
|
|
439
|
+
the sandbox, and a <code>session_boundary</code> event with <code>phase: 'reset'</code>
|
|
440
|
+
fires before the swap so subscribers know the rollover happened.
|
|
441
|
+
Existing <a href="/docs/pyric-firestore-reference-api/#sandboxcontext">SandboxContext</a>s continue to work — their sandbox
|
|
442
|
+
reference is stable; subsequent operations resolve to the new env.</p>
|
|
443
|
+
<h6 id="returns-15">Returns</h6>
|
|
444
|
+
<p><code>void</code></p>
|
|
445
|
+
<h6 id="inherited-from-11">Inherited from</h6>
|
|
446
|
+
<p><a href="#remotesandbox"><code>RemoteSandbox</code></a>.<a href="#reset-2"><code>reset</code></a></p>
|
|
447
|
+
<p><a id="resetall"></a></p>
|
|
448
|
+
<h5 id="resetall">resetAll()</h5>
|
|
449
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">resetAll</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">Promise</span><span style="color:#ABB2BF"><{</span></span>
|
|
450
|
+
<span class="line"><span style="color:#E06C75"> errors</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">[];</span></span>
|
|
451
|
+
<span class="line"><span style="color:#ABB2BF">}>;</span></span></code></pre>
|
|
452
|
+
<p>Reset the WHOLE sandbox: <a href="/docs/pyric-firestore-reference-api/#reset">reset</a> (Firestore env + signed-in
|
|
453
|
+
session), then clear every registered persistable service that
|
|
454
|
+
provides a <a href="/docs/pyric-sandbox-reference-api/#reset-2">PersistableService.reset</a> hook — auth users, the
|
|
455
|
+
RTDB tree, storage objects. This is the one sandbox-owned “wipe
|
|
456
|
+
everything” path: because it iterates the service registry, a new
|
|
457
|
+
service that registers with a <code>reset</code> hook is cleared automatically,
|
|
458
|
+
and a consumer (Pyric Studio’s reset) cannot forget one.</p>
|
|
459
|
+
<p>Service resets may be async (storage clears IndexedDB stores); the
|
|
460
|
+
returned promise resolves when every service has finished clearing.
|
|
461
|
+
A service whose <code>reset</code> throws is isolated (others still clear) and
|
|
462
|
+
REPORTED in the returned <code>errors</code> (as <code>name: message</code>) — a reset that
|
|
463
|
+
leaves data behind must never look successful to the caller.</p>
|
|
464
|
+
<h6 id="returns-16">Returns</h6>
|
|
465
|
+
<p><code>Promise</code><{
|
|
466
|
+
<code>errors</code>: <code>string</code>[];
|
|
467
|
+
}></p>
|
|
468
|
+
<h6 id="inherited-from-12">Inherited from</h6>
|
|
469
|
+
<p><a href="#remotesandbox"><code>RemoteSandbox</code></a>.<a href="#resetall-2"><code>resetAll</code></a></p>
|
|
470
|
+
<p><a id="runwithprovenance"></a></p>
|
|
471
|
+
<h5 id="runwithprovenance">runWithProvenance()?</h5>
|
|
472
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E06C75">optional</span><span style="color:#61AFEF"> runWithProvenance</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>(</span><span style="color:#E06C75">provenance</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">EventProvenance</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">fn</span><span style="color:#ABB2BF">: () </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> T</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
473
|
+
<p>Run <code>fn</code> with ambient <a href="/docs/pyric-sandbox-reference-api/#eventprovenance">EventProvenance</a> defaults: every event
|
|
474
|
+
emitted SYNCHRONOUSLY during <code>fn</code> that doesn’t already carry a
|
|
475
|
+
provenance field (on the event itself or via an explicit per-emit
|
|
476
|
+
override) is stamped with these values instead of the global
|
|
477
|
+
defaults. This is the mechanical “who issued this op” seam the
|
|
478
|
+
serve worker uses to tag Studio-issued ops (<code>actor: { kind: 'studio' }</code>) and to stamp the auth lens an op ran under
|
|
479
|
+
(<code>authLens</code>) — declared by the caller that issues the op, never
|
|
480
|
+
inferred from the op’s shape.</p>
|
|
481
|
+
<p>SYNCHRONOUS WINDOW: the ambient values apply only until <code>fn</code>
|
|
482
|
+
returns (for an async <code>fn</code>, its synchronous prefix — which covers
|
|
483
|
+
the local environment’s rules eval + event emission, since those
|
|
484
|
+
run before the op’s promise is handed back). Work an op DEFERS
|
|
485
|
+
(snapshot-listener deliveries and re-evals drain on a microtask,
|
|
486
|
+
off-stack) is intentionally OUTSIDE the window: a listener re-eval
|
|
487
|
+
belongs to the listener’s owner, not to whoever’s write triggered
|
|
488
|
+
it. Nested calls stack — the innermost window wins per field, and
|
|
489
|
+
each window restores the previous one on exit (including on throw).</p>
|
|
490
|
+
<p>OPTIONAL because remote sandbox proxies can’t provide an ambient
|
|
491
|
+
emit window (events are emitted in the worker they front). Callers
|
|
492
|
+
spell <code>sandbox.runWithProvenance?.(prov, fn) ?? fn()</code>.</p>
|
|
493
|
+
<h6 id="type-parameters">Type Parameters</h6>
|
|
494
|
+
<div class="table-scroll">
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
<table><thead><tr><th align="left">Type Parameter</th></tr></thead><tbody><tr><td align="left"><code>T</code></td></tr></tbody></table></div>
|
|
506
|
+
<h6 id="parameters-6">Parameters</h6>
|
|
507
|
+
<div class="table-scroll">
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>provenance</code></td><td align="left"><a href="/docs/pyric-sandbox-reference-api/#eventprovenance"><code>EventProvenance</code></a></td></tr><tr><td align="left"><code>fn</code></td><td align="left">() => <code>T</code></td></tr></tbody></table></div>
|
|
525
|
+
<h6 id="returns-17">Returns</h6>
|
|
526
|
+
<p><code>T</code></p>
|
|
527
|
+
<h6 id="inherited-from-13">Inherited from</h6>
|
|
528
|
+
<p><a href="#remotesandbox"><code>RemoteSandbox</code></a>.<a href="#runwithprovenance-2"><code>runWithProvenance</code></a></p>
|
|
529
|
+
<p><a id="snapshot"></a></p>
|
|
530
|
+
<h5 id="snapshot">snapshot()</h5>
|
|
531
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">snapshot</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">SandboxSnapshot</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
532
|
+
<p>Capture a snapshot of every service’s state. For v1 with only
|
|
533
|
+
Firestore, the return value carries a <code>firestore</code> key mapping doc
|
|
534
|
+
paths to data. Future services will add their own keys.</p>
|
|
535
|
+
<h6 id="returns-18">Returns</h6>
|
|
536
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#sandboxsnapshot"><code>SandboxSnapshot</code></a></p>
|
|
537
|
+
<h6 id="inherited-from-14">Inherited from</h6>
|
|
538
|
+
<p><a href="#remotesandbox"><code>RemoteSandbox</code></a>.<a href="#snapshot-2"><code>snapshot</code></a></p>
|
|
539
|
+
<p><a id="withauth"></a></p>
|
|
540
|
+
<h5 id="withauth">withAuth()</h5>
|
|
541
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">withAuth</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">auth</span><span style="color:#ABB2BF">: {</span></span>
|
|
542
|
+
<span class="line"><span style="color:#ABB2BF"> token?: </span><span style="color:#E06C75">Record</span><span style="color:#56B6C2"><</span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">, unknown>;</span></span>
|
|
543
|
+
<span class="line"><span style="color:#E06C75"> uid</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">;</span></span>
|
|
544
|
+
<span class="line"><span style="color:#ABB2BF">}): </span><span style="color:#E06C75">SandboxContext</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
545
|
+
<p>Derive a context bound to this sandbox under the given auth
|
|
546
|
+
identity. Operations through services attached to the returned
|
|
547
|
+
context evaluate rules under that identity. Many contexts can
|
|
548
|
+
coexist for one sandbox; data is shared.</p>
|
|
549
|
+
<p><code>null</code> is anonymous; an <code>AuthState</code> object names the user (and
|
|
550
|
+
optional custom claims). Passing <code>undefined</code> is a deliberate
|
|
551
|
+
error — say <code>withAuth(null)</code> for anonymous so the call site is
|
|
552
|
+
unambiguous.</p>
|
|
553
|
+
<h6 id="parameters-7">Parameters</h6>
|
|
554
|
+
<div class="table-scroll">
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>auth</code></td><td align="left">{ <code>token?</code>: <code>Record</code><<code>string</code>, <code>unknown</code>>; <code>uid</code>: <code>string</code>; }</td></tr><tr><td align="left"><code>auth.token?</code></td><td align="left"><code>Record</code><<code>string</code>, <code>unknown</code>></td></tr><tr><td align="left"><code>auth.uid</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
576
|
+
<h6 id="returns-19">Returns</h6>
|
|
577
|
+
<p><a href="/docs/pyric-firestore-reference-api/#sandboxcontext"><code>SandboxContext</code></a></p>
|
|
578
|
+
<h6 id="example-1">Example</h6>
|
|
579
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> sandbox</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> initializeSandbox</span><span style="color:#ABB2BF">();</span></span>
|
|
580
|
+
<span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> dbAlice</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> getFirestore</span><span style="color:#ABB2BF">(</span><span style="color:#E5C07B">sandbox</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">withAuth</span><span style="color:#ABB2BF">({ </span><span style="color:#E06C75">uid</span><span style="color:#ABB2BF">: </span><span style="color:#98C379">'alice'</span><span style="color:#ABB2BF"> }));</span></span>
|
|
581
|
+
<span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> dbAnon</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> getFirestore</span><span style="color:#ABB2BF">(</span><span style="color:#E5C07B">sandbox</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">withAuth</span><span style="color:#ABB2BF">(</span><span style="color:#D19A66">null</span><span style="color:#ABB2BF">));</span></span></code></pre>
|
|
582
|
+
<h6 id="inherited-from-15">Inherited from</h6>
|
|
583
|
+
<p><a href="#remotesandbox"><code>RemoteSandbox</code></a>.<a href="#withauth-2"><code>withAuth</code></a></p>
|
|
97
584
|
<hr>
|
|
98
585
|
<p><a id="remoteauthadmin"></a></p>
|
|
99
586
|
<h3 id="remoteauthadmin">RemoteAuthAdmin</h3>
|
|
@@ -103,12 +590,12 @@ worker’s user pool directly, mirroring <code>pyric/auth</code>’s sandbox ops
|
|
|
103
590
|
<p><a id="clearusers"></a></p>
|
|
104
591
|
<h5 id="clearusers">clearUsers()</h5>
|
|
105
592
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">clearUsers</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#C678DD">void</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
106
|
-
<h6 id="returns-
|
|
593
|
+
<h6 id="returns-20">Returns</h6>
|
|
107
594
|
<p><code>Promise</code><<code>void</code>></p>
|
|
108
595
|
<p><a id="createuser"></a></p>
|
|
109
596
|
<h5 id="createuser">createUser()</h5>
|
|
110
597
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">createUser</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">request</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">CreateUserRequest</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#E06C75">AuthUserRecord</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
111
|
-
<h6 id="parameters">Parameters</h6>
|
|
598
|
+
<h6 id="parameters-8">Parameters</h6>
|
|
112
599
|
<div class="table-scroll">
|
|
113
600
|
|
|
114
601
|
|
|
@@ -122,13 +609,13 @@ worker’s user pool directly, mirroring <code>pyric/auth</code>’s sandbox ops
|
|
|
122
609
|
|
|
123
610
|
|
|
124
611
|
|
|
125
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>request</code></td><td align="left"><code>CreateUserRequest</code></td></tr></tbody></table></div>
|
|
126
|
-
<h6 id="returns-
|
|
127
|
-
<p><code>Promise</code><<code>AuthUserRecord</code>></p>
|
|
612
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>request</code></td><td align="left"><a href="/docs/pyric-auth-reference-api/#createuserrequest"><code>CreateUserRequest</code></a></td></tr></tbody></table></div>
|
|
613
|
+
<h6 id="returns-21">Returns</h6>
|
|
614
|
+
<p><code>Promise</code><<a href="/docs/pyric-auth-reference-api/#authuserrecord"><code>AuthUserRecord</code></a>></p>
|
|
128
615
|
<p><a id="deleteuser"></a></p>
|
|
129
616
|
<h5 id="deleteuser">deleteUser()</h5>
|
|
130
617
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">deleteUser</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">uid</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#C678DD">void</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
131
|
-
<h6 id="parameters-
|
|
618
|
+
<h6 id="parameters-9">Parameters</h6>
|
|
132
619
|
<div class="table-scroll">
|
|
133
620
|
|
|
134
621
|
|
|
@@ -143,17 +630,17 @@ worker’s user pool directly, mirroring <code>pyric/auth</code>’s sandbox ops
|
|
|
143
630
|
|
|
144
631
|
|
|
145
632
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>uid</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
146
|
-
<h6 id="returns-
|
|
633
|
+
<h6 id="returns-22">Returns</h6>
|
|
147
634
|
<p><code>Promise</code><<code>void</code>></p>
|
|
148
635
|
<p><a id="listusers"></a></p>
|
|
149
636
|
<h5 id="listusers">listUsers()</h5>
|
|
150
637
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">listUsers</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#E06C75">AuthUserRecord</span><span style="color:#ABB2BF">[]</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
151
|
-
<h6 id="returns-
|
|
152
|
-
<p><code>Promise</code><<code>AuthUserRecord</code>[]></p>
|
|
638
|
+
<h6 id="returns-23">Returns</h6>
|
|
639
|
+
<p><code>Promise</code><<a href="/docs/pyric-auth-reference-api/#authuserrecord"><code>AuthUserRecord</code></a>[]></p>
|
|
153
640
|
<p><a id="updateuser"></a></p>
|
|
154
641
|
<h5 id="updateuser">updateUser()</h5>
|
|
155
642
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">updateUser</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">uid</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">request</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">UpdateUserRequest</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#E06C75">AuthUserRecord</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
156
|
-
<h6 id="parameters-
|
|
643
|
+
<h6 id="parameters-10">Parameters</h6>
|
|
157
644
|
<div class="table-scroll">
|
|
158
645
|
|
|
159
646
|
|
|
@@ -171,9 +658,9 @@ worker’s user pool directly, mirroring <code>pyric/auth</code>’s sandbox ops
|
|
|
171
658
|
|
|
172
659
|
|
|
173
660
|
|
|
174
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>uid</code></td><td align="left"><code>string</code></td></tr><tr><td align="left"><code>request</code></td><td align="left"><code>UpdateUserRequest</code></td></tr></tbody></table></div>
|
|
175
|
-
<h6 id="returns-
|
|
176
|
-
<p><code>Promise</code><<code>AuthUserRecord</code>></p>
|
|
661
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>uid</code></td><td align="left"><code>string</code></td></tr><tr><td align="left"><code>request</code></td><td align="left"><a href="/docs/pyric-auth-reference-api/#updateuserrequest"><code>UpdateUserRequest</code></a></td></tr></tbody></table></div>
|
|
662
|
+
<h6 id="returns-24">Returns</h6>
|
|
663
|
+
<p><code>Promise</code><<a href="/docs/pyric-auth-reference-api/#authuserrecord"><code>AuthUserRecord</code></a>></p>
|
|
177
664
|
<hr>
|
|
178
665
|
<p><a id="remotertdb"></a></p>
|
|
179
666
|
<h3 id="remotertdb">RemoteRtdb</h3>
|
|
@@ -186,7 +673,7 @@ matching what <code>pyric-admin</code>’s database backend needs. Use the raw
|
|
|
186
673
|
<h5 id="get">get()</h5>
|
|
187
674
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">get</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">path</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#E06C75">unknown</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
188
675
|
<p>Read the value at <code>path</code> (null when absent).</p>
|
|
189
|
-
<h6 id="parameters-
|
|
676
|
+
<h6 id="parameters-11">Parameters</h6>
|
|
190
677
|
<div class="table-scroll">
|
|
191
678
|
|
|
192
679
|
|
|
@@ -201,7 +688,7 @@ matching what <code>pyric-admin</code>’s database backend needs. Use the raw
|
|
|
201
688
|
|
|
202
689
|
|
|
203
690
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>path</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
204
|
-
<h6 id="returns-
|
|
691
|
+
<h6 id="returns-25">Returns</h6>
|
|
205
692
|
<p><code>Promise</code><<code>unknown</code>></p>
|
|
206
693
|
<p><a id="onvalue"></a></p>
|
|
207
694
|
<h5 id="onvalue">onValue()</h5>
|
|
@@ -212,7 +699,7 @@ matching what <code>pyric-admin</code>’s database backend needs. Use the raw
|
|
|
212
699
|
<span class="line"><span style="color:#E06C75"> code</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">;</span></span>
|
|
213
700
|
<span class="line"><span style="color:#ABB2BF">}) </span><span style="color:#C678DD">=></span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">): () </span><span style="color:#C678DD">=></span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
214
701
|
<p>Subscribe to the value at <code>path</code> (initial snapshot + every change).</p>
|
|
215
|
-
<h6 id="parameters-
|
|
702
|
+
<h6 id="parameters-12">Parameters</h6>
|
|
216
703
|
<div class="table-scroll">
|
|
217
704
|
|
|
218
705
|
|
|
@@ -235,9 +722,9 @@ matching what <code>pyric-admin</code>’s database backend needs. Use the raw
|
|
|
235
722
|
|
|
236
723
|
|
|
237
724
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>path</code></td><td align="left"><code>string</code></td></tr><tr><td align="left"><code>callback</code></td><td align="left">(<code>snapshot</code>: <a href="#remotertdbsnapshot"><code>RemoteRtdbSnapshot</code></a>) => <code>void</code></td></tr><tr><td align="left"><code>onError?</code></td><td align="left">(<code>err</code>: <code>Error</code> & { <code>code</code>: <code>string</code>; }) => <code>void</code></td></tr></tbody></table></div>
|
|
238
|
-
<h6 id="returns-
|
|
725
|
+
<h6 id="returns-26">Returns</h6>
|
|
239
726
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
240
|
-
<h6 id="returns-
|
|
727
|
+
<h6 id="returns-27">Returns</h6>
|
|
241
728
|
<p><code>void</code></p>
|
|
242
729
|
<p><a id="push"></a></p>
|
|
243
730
|
<h5 id="push">push()</h5>
|
|
@@ -248,7 +735,7 @@ matching what <code>pyric-admin</code>’s database backend needs. Use the raw
|
|
|
248
735
|
<p>Push <code>value</code> under a CLIENT-minted 20-char push id (the worker-protocol
|
|
249
736
|
contract: <code>rtdb.push</code> carries the key, so <code>.key</code> is known synchronously
|
|
250
737
|
on the pyric-admin side). Resolves with the minted key + full path.</p>
|
|
251
|
-
<h6 id="parameters-
|
|
738
|
+
<h6 id="parameters-13">Parameters</h6>
|
|
252
739
|
<div class="table-scroll">
|
|
253
740
|
|
|
254
741
|
|
|
@@ -267,7 +754,7 @@ on the pyric-admin side). Resolves with the minted key + full path.</p>
|
|
|
267
754
|
|
|
268
755
|
|
|
269
756
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>path</code></td><td align="left"><code>string</code></td></tr><tr><td align="left"><code>value?</code></td><td align="left"><code>unknown</code></td></tr></tbody></table></div>
|
|
270
|
-
<h6 id="returns-
|
|
757
|
+
<h6 id="returns-28">Returns</h6>
|
|
271
758
|
<p><code>Promise</code><{
|
|
272
759
|
<code>key</code>: <code>string</code>;
|
|
273
760
|
<code>path</code>: <code>string</code>;
|
|
@@ -275,7 +762,7 @@ on the pyric-admin side). Resolves with the minted key + full path.</p>
|
|
|
275
762
|
<p><a id="remove"></a></p>
|
|
276
763
|
<h5 id="remove">remove()</h5>
|
|
277
764
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">remove</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">path</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#C678DD">void</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
278
|
-
<h6 id="parameters-
|
|
765
|
+
<h6 id="parameters-14">Parameters</h6>
|
|
279
766
|
<div class="table-scroll">
|
|
280
767
|
|
|
281
768
|
|
|
@@ -290,12 +777,12 @@ on the pyric-admin side). Resolves with the minted key + full path.</p>
|
|
|
290
777
|
|
|
291
778
|
|
|
292
779
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>path</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
293
|
-
<h6 id="returns-
|
|
780
|
+
<h6 id="returns-29">Returns</h6>
|
|
294
781
|
<p><code>Promise</code><<code>void</code>></p>
|
|
295
782
|
<p><a id="set"></a></p>
|
|
296
783
|
<h5 id="set">set()</h5>
|
|
297
784
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">set</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">path</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">value</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">unknown</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#C678DD">void</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
298
|
-
<h6 id="parameters-
|
|
785
|
+
<h6 id="parameters-15">Parameters</h6>
|
|
299
786
|
<div class="table-scroll">
|
|
300
787
|
|
|
301
788
|
|
|
@@ -314,12 +801,12 @@ on the pyric-admin side). Resolves with the minted key + full path.</p>
|
|
|
314
801
|
|
|
315
802
|
|
|
316
803
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>path</code></td><td align="left"><code>string</code></td></tr><tr><td align="left"><code>value</code></td><td align="left"><code>unknown</code></td></tr></tbody></table></div>
|
|
317
|
-
<h6 id="returns-
|
|
804
|
+
<h6 id="returns-30">Returns</h6>
|
|
318
805
|
<p><code>Promise</code><<code>void</code>></p>
|
|
319
806
|
<p><a id="update"></a></p>
|
|
320
807
|
<h5 id="update">update()</h5>
|
|
321
808
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">update</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">path</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">values</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">Record</span><span style="color:#56B6C2"><</span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">unknown</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#C678DD">void</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
322
|
-
<h6 id="parameters-
|
|
809
|
+
<h6 id="parameters-16">Parameters</h6>
|
|
323
810
|
<div class="table-scroll">
|
|
324
811
|
|
|
325
812
|
|
|
@@ -338,7 +825,7 @@ on the pyric-admin side). Resolves with the minted key + full path.</p>
|
|
|
338
825
|
|
|
339
826
|
|
|
340
827
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>path</code></td><td align="left"><code>string</code></td></tr><tr><td align="left"><code>values</code></td><td align="left"><code>Record</code><<code>string</code>, <code>unknown</code>></td></tr></tbody></table></div>
|
|
341
|
-
<h6 id="returns-
|
|
828
|
+
<h6 id="returns-31">Returns</h6>
|
|
342
829
|
<p><code>Promise</code><<code>void</code>></p>
|
|
343
830
|
<hr>
|
|
344
831
|
<p><a id="remotertdbsnapshot"></a></p>
|
|
@@ -375,7 +862,7 @@ on the pyric-admin side). Resolves with the minted key + full path.</p>
|
|
|
375
862
|
<p><a id="remotesandbox"></a></p>
|
|
376
863
|
<h3 id="remotesandbox">RemoteSandbox</h3>
|
|
377
864
|
<p>The Node-side remote sandbox handle. Extends <code>pyric/sandbox</code>’s branded
|
|
378
|
-
RemoteSandboxBase — structurally a full <code>Sandbox</code>, so it can be
|
|
865
|
+
<a href="/docs/pyric-sandbox-reference-api/#remotesandbox">RemoteSandboxBase</a> — structurally a full <code>Sandbox</code>, so it can be
|
|
379
866
|
passed to <code>pyric-admin/app</code>’s <code>initializeApp({ sandbox })</code>, whose RTDB and
|
|
380
867
|
Auth backends dispatch on the brand and route through <a href="#channel-1">channel</a>.</p>
|
|
381
868
|
<p>Sandbox members that are genuinely sync-only (<code>admin</code>, <code>snapshot()</code>,
|
|
@@ -385,7 +872,7 @@ what to do instead. Implemented members: <code>withAuth</code> (pure local pair
|
|
|
385
872
|
construction) and <code>dispose</code> (aliases <a href="#close-2">close</a>).</p>
|
|
386
873
|
<h4 id="extends-1">Extends</h4>
|
|
387
874
|
<ul>
|
|
388
|
-
<li><code>
|
|
875
|
+
<li><a href="/docs/pyric-sandbox-reference-api/#remotesandbox"><code>RemoteSandbox</code></a></li>
|
|
389
876
|
</ul>
|
|
390
877
|
<h4 id="extended-by">Extended by</h4>
|
|
391
878
|
<ul>
|
|
@@ -427,14 +914,511 @@ construction) and <code>dispose</code> (aliases <a href="#close-2">close</a>).</
|
|
|
427
914
|
|
|
428
915
|
|
|
429
916
|
|
|
430
|
-
|
|
917
|
+
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
|
|
924
|
+
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
|
|
930
|
+
|
|
931
|
+
|
|
932
|
+
|
|
933
|
+
|
|
934
|
+
|
|
935
|
+
|
|
936
|
+
|
|
937
|
+
|
|
938
|
+
|
|
939
|
+
|
|
940
|
+
|
|
941
|
+
|
|
942
|
+
|
|
943
|
+
|
|
944
|
+
|
|
945
|
+
|
|
946
|
+
|
|
947
|
+
|
|
948
|
+
|
|
949
|
+
|
|
950
|
+
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
|
|
955
|
+
|
|
956
|
+
|
|
957
|
+
|
|
958
|
+
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
|
|
962
|
+
|
|
963
|
+
|
|
964
|
+
<table><thead><tr><th align="left">Property</th><th align="left">Modifier</th><th align="left">Type</th><th align="left">Description</th><th align="left">Overrides</th></tr></thead><tbody><tr><td align="left"><a id="remote_sandbox-1"></a> <code>[REMOTE_SANDBOX]</code></td><td align="left"><code>readonly</code></td><td align="left"><code>true</code></td><td align="left">-</td><td align="left">-</td></tr><tr><td align="left"><a id="admin-1"></a> <code>admin</code></td><td align="left"><code>readonly</code></td><td align="left"><code>SandboxAdmin</code></td><td align="left">Admin-plane access (rule-bypass reads). Identity-agnostic by design — admin reads aren’t gated on auth, so they live on the sandbox, not on a context. See SandboxAdmin.</td><td align="left">-</td></tr><tr><td align="left"><a id="auth-1"></a> <code>auth</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#remoteauthadmin"><code>RemoteAuthAdmin</code></a></td><td align="left">Admin auth user CRUD.</td><td align="left">-</td></tr><tr><td align="left"><a id="channel-1"></a> <code>channel</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#remotesandboxchannel-1"><code>RemoteSandboxChannel</code></a></td><td align="left">The raw worker op/sub relay channel (narrowed to the wire payload types).</td><td align="left"><a href="/docs/pyric-sandbox-reference-api/#remotesandbox"><code>RemoteSandbox</code></a>.<a href="/docs/pyric-sandbox-reference-api/#channel"><code>channel</code></a></td></tr><tr><td align="left"><a id="currentuser-1"></a> <code>currentUser</code></td><td align="left"><code>public</code></td><td align="left">{ <code>token?</code>: <code>Record</code><<code>string</code>, <code>unknown</code>>; <code>uid</code>: <code>string</code>; }</td><td align="left">Current authenticated user across the sandbox. Mutated by <code>pyric/auth</code>’s <code>signInAnonymously</code> / <code>signInWithEmailAndPassword</code> / <code>signOut</code> / <code>sandbox.setUser</code>. Read per-call by service factories (e.g. a future <code>getFirestore(sandbox)</code> overload) so they see auth state changes without re-binding handles. Defaults to <code>null</code> (anonymous / signed out). <strong>Independent of <code>withAuth({uid})</code></strong> — <code>withAuth</code> still produces a frozen <a href="/docs/pyric-firestore-reference-api/#sandboxcontext">SandboxContext</a> that carries its own identity for the runner’s test code (the existing pattern: explicit identity per service call). <code>currentUser</code> exists for the <code>pyric/auth</code> mirror, where consumer app code drives identity through a stateful <code>Auth</code> handle rather than naming it per call.</td><td align="left">-</td></tr><tr><td align="left"><code>currentUser.token?</code></td><td align="left"><code>public</code></td><td align="left"><code>Record</code><<code>string</code>, <code>unknown</code>></td><td align="left">-</td><td align="left">-</td></tr><tr><td align="left"><code>currentUser.uid</code></td><td align="left"><code>public</code></td><td align="left"><code>string</code></td><td align="left">-</td><td align="left">-</td></tr><tr><td align="left"><a id="rtdb-1"></a> <code>rtdb</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#remotertdb"><code>RemoteRtdb</code></a></td><td align="left">RTDB conveniences (admin lens pinned).</td><td align="left">-</td></tr><tr><td align="left"><a id="serveurl-1"></a> <code>serveUrl</code></td><td align="left"><code>readonly</code></td><td align="left"><code>string</code></td><td align="left">Base URL of the <code>pyric dev</code> this handle is attached to (used in error guidance: “open <serveurl> in a browser and retry”).</serveurl></td><td align="left">-</td></tr><tr><td align="left"><a id="storage-1"></a> <code>storage</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#remotestorage"><code>RemoteStorage</code></a></td><td align="left">Storage conveniences (admin lens pinned; 8 MiB per-op byte cap).</td><td align="left">-</td></tr></tbody></table></div>
|
|
431
965
|
<h4 id="methods-3">Methods</h4>
|
|
966
|
+
<p><a id="clearpersistence-2"></a></p>
|
|
967
|
+
<h5 id="clearpersistence-1">clearPersistence()</h5>
|
|
968
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">clearPersistence</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#C678DD">void</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
969
|
+
<p>Wipe the persisted blob for this sandbox’s <code>key</code>. In-memory state
|
|
970
|
+
is left intact — call <code>reset()</code> if you want both. Useful for
|
|
971
|
+
“sign out and forget” flows.</p>
|
|
972
|
+
<p>No-op when persistence is not enabled.</p>
|
|
973
|
+
<h6 id="returns-32">Returns</h6>
|
|
974
|
+
<p><code>Promise</code><<code>void</code>></p>
|
|
975
|
+
<h6 id="inherited-from-16">Inherited from</h6>
|
|
976
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#remotesandbox"><code>RemoteSandbox</code></a>.<a href="/docs/pyric-sandbox-reference-api/#clearpersistence-2"><code>clearPersistence</code></a></p>
|
|
432
977
|
<p><a id="close-2"></a></p>
|
|
433
978
|
<h5 id="close-1">close()</h5>
|
|
434
979
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">close</span><span style="color:#ABB2BF">(): </span><span style="color:#C678DD">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
435
980
|
<p>Close the connection. In-flight ops reject; subscriptions stop.</p>
|
|
436
|
-
<h6 id="returns-
|
|
981
|
+
<h6 id="returns-33">Returns</h6>
|
|
982
|
+
<p><code>void</code></p>
|
|
983
|
+
<p><a id="dispose-2"></a></p>
|
|
984
|
+
<h5 id="dispose-1">dispose()</h5>
|
|
985
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">dispose</span><span style="color:#ABB2BF">(): </span><span style="color:#C678DD">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
986
|
+
<p>Tear down listener registries on this sandbox’s environment without
|
|
987
|
+
replacing it. Use this when you’re about to discard the sandbox
|
|
988
|
+
itself (e.g. <code>runner.reseed()</code> builds a fresh sandbox rather than
|
|
989
|
+
calling <code>reset()</code>) and want to drop callback references on the
|
|
990
|
+
outgoing instance defensively. Idempotent. Does not touch data.</p>
|
|
991
|
+
<h6 id="returns-34">Returns</h6>
|
|
992
|
+
<p><code>void</code></p>
|
|
993
|
+
<h6 id="inherited-from-17">Inherited from</h6>
|
|
994
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#remotesandbox"><code>RemoteSandbox</code></a>.<a href="/docs/pyric-sandbox-reference-api/#dispose-4"><code>dispose</code></a></p>
|
|
995
|
+
<p><a id="enablepersistence-2"></a></p>
|
|
996
|
+
<h5 id="enablepersistence-1">enablePersistence()</h5>
|
|
997
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">enablePersistence</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">options</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">SandboxPersistenceOptions</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#C678DD">void</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
998
|
+
<p>Persist the sandbox’s data to a backend and restore it on next
|
|
999
|
+
<code>enablePersistence</code> call. The default <code>'indexedDB'</code> backend turns
|
|
1000
|
+
the sandbox into the host page’s local Firestore — writes flush
|
|
1001
|
+
automatically and a fresh <code>initializeSandbox()</code> rehydrates from
|
|
1002
|
+
the prior session.</p>
|
|
1003
|
+
<p>Restoration happens before the promise resolves; awaiting this
|
|
1004
|
+
call is sufficient to guarantee in-memory state matches the
|
|
1005
|
+
persisted blob.</p>
|
|
1006
|
+
<p>Idempotent across the same <code>key</code> — calling twice in one process
|
|
1007
|
+
is a no-op on the second call. Different keys are rejected as an
|
|
1008
|
+
error (a sandbox can persist to at most one backend at a time).</p>
|
|
1009
|
+
<p>Listener semantics: every write event the sandbox emits triggers
|
|
1010
|
+
a debounced flush (default 250ms). Browser hosts additionally
|
|
1011
|
+
flush on <code>beforeunload</code> so a page navigation doesn’t lose the
|
|
1012
|
+
tail of the debounce window.</p>
|
|
1013
|
+
<p>See <a href="/docs/pyric-sandbox-reference-api/#sandboxpersistenceoptions">SandboxPersistenceOptions</a> for backend selection and
|
|
1014
|
+
tuning.</p>
|
|
1015
|
+
<h6 id="parameters-17">Parameters</h6>
|
|
1016
|
+
<div class="table-scroll">
|
|
1017
|
+
|
|
1018
|
+
|
|
1019
|
+
|
|
1020
|
+
|
|
1021
|
+
|
|
1022
|
+
|
|
1023
|
+
|
|
1024
|
+
|
|
1025
|
+
|
|
1026
|
+
|
|
1027
|
+
|
|
1028
|
+
|
|
1029
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>options</code></td><td align="left"><a href="/docs/pyric-sandbox-reference-api/#sandboxpersistenceoptions"><code>SandboxPersistenceOptions</code></a></td></tr></tbody></table></div>
|
|
1030
|
+
<h6 id="returns-35">Returns</h6>
|
|
1031
|
+
<p><code>Promise</code><<code>void</code>></p>
|
|
1032
|
+
<h6 id="inherited-from-18">Inherited from</h6>
|
|
1033
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#remotesandbox"><code>RemoteSandbox</code></a>.<a href="/docs/pyric-sandbox-reference-api/#enablepersistence-2"><code>enablePersistence</code></a></p>
|
|
1034
|
+
<p><a id="enabletabsync-2"></a></p>
|
|
1035
|
+
<h5 id="enabletabsync-1">enableTabSync()</h5>
|
|
1036
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">enableTabSync</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">options</span><span style="color:#C678DD">?:</span><span style="color:#E06C75"> TabSyncOptions</span><span style="color:#ABB2BF">): () </span><span style="color:#C678DD">=></span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1037
|
+
<p>Enable cross-tab realtime sync via <code>BroadcastChannel</code>. A write in
|
|
1038
|
+
this tab will propagate to every OTHER tab of the same origin that
|
|
1039
|
+
also called <code>enableTabSync</code>, causing their <code>onSnapshot</code> listeners to
|
|
1040
|
+
re-evaluate — restoring production’s cross-client realtime behavior.</p>
|
|
1041
|
+
<p><strong>Opt-in, OFF by default.</strong> Firestore only (RTDB is a follow-on).</p>
|
|
1042
|
+
<p>Returns a disable function. Calling it removes the <code>onEvent</code>
|
|
1043
|
+
subscription, the channel message listener, and closes the channel
|
|
1044
|
+
(when it was created internally). After disable, no further propagation
|
|
1045
|
+
occurs in either direction.</p>
|
|
1046
|
+
<p><strong>Multi-writer note:</strong> concurrent writes from two tabs to the same doc
|
|
1047
|
+
produce last-write-wins divergence — there is no conflict resolution.
|
|
1048
|
+
The intended model is one active writer (one user, one tab) with
|
|
1049
|
+
observers in other tabs; this covers the overwhelming majority of
|
|
1050
|
+
local development scenarios.</p>
|
|
1051
|
+
<h6 id="parameters-18">Parameters</h6>
|
|
1052
|
+
<div class="table-scroll">
|
|
1053
|
+
|
|
1054
|
+
|
|
1055
|
+
|
|
1056
|
+
|
|
1057
|
+
|
|
1058
|
+
|
|
1059
|
+
|
|
1060
|
+
|
|
1061
|
+
|
|
1062
|
+
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>options?</code></td><td align="left"><a href="/docs/pyric-sandbox-reference-api/#tabsyncoptions"><code>TabSyncOptions</code></a></td></tr></tbody></table></div>
|
|
1066
|
+
<h6 id="returns-36">Returns</h6>
|
|
1067
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1068
|
+
<h6 id="returns-37">Returns</h6>
|
|
1069
|
+
<p><code>void</code></p>
|
|
1070
|
+
<h6 id="see-1">See</h6>
|
|
1071
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#tabsyncoptions">TabSyncOptions</a> for channel injection (tests) and originId.</p>
|
|
1072
|
+
<h6 id="example-2">Example</h6>
|
|
1073
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#7F848E;font-style:italic">// In every tab that should participate in realtime:</span></span>
|
|
1074
|
+
<span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> sandbox</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> initializeSandbox</span><span style="color:#ABB2BF">();</span></span>
|
|
1075
|
+
<span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> disableSync</span><span style="color:#56B6C2"> =</span><span style="color:#E5C07B"> sandbox</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">enableTabSync</span><span style="color:#ABB2BF">();</span></span>
|
|
1076
|
+
<span class="line"><span style="color:#7F848E;font-style:italic">// Later, to stop syncing:</span></span>
|
|
1077
|
+
<span class="line"><span style="color:#61AFEF">disableSync</span><span style="color:#ABB2BF">();</span></span></code></pre>
|
|
1078
|
+
<h6 id="inherited-from-19">Inherited from</h6>
|
|
1079
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#remotesandbox"><code>RemoteSandbox</code></a>.<a href="/docs/pyric-sandbox-reference-api/#enabletabsync-2"><code>enableTabSync</code></a></p>
|
|
1080
|
+
<p><a id="flush-2"></a></p>
|
|
1081
|
+
<h5 id="flush-1">flush()</h5>
|
|
1082
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">flush</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#C678DD">void</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1083
|
+
<p>Force a snapshot to the configured persistence backend right now.
|
|
1084
|
+
Useful before a manual navigation, or in tests that need
|
|
1085
|
+
deterministic ordering against the debounce window. Resolves once
|
|
1086
|
+
the write hits the backend.</p>
|
|
1087
|
+
<p>Throws if persistence is not enabled.</p>
|
|
1088
|
+
<h6 id="returns-38">Returns</h6>
|
|
1089
|
+
<p><code>Promise</code><<code>void</code>></p>
|
|
1090
|
+
<h6 id="inherited-from-20">Inherited from</h6>
|
|
1091
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#remotesandbox"><code>RemoteSandbox</code></a>.<a href="/docs/pyric-sandbox-reference-api/#flush-4"><code>flush</code></a></p>
|
|
1092
|
+
<p><a id="history-2"></a></p>
|
|
1093
|
+
<h5 id="history-1">history()</h5>
|
|
1094
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">history</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">SandboxEvent</span><span style="color:#ABB2BF">[];</span></span></code></pre>
|
|
1095
|
+
<p>Every <a href="/docs/pyric-sandbox-reference-api/#sandboxevent">SandboxEvent</a> this sandbox has emitted since init or
|
|
1096
|
+
the last <code>reset()</code>. Returns a defensive copy.</p>
|
|
1097
|
+
<p>Use this for replay: hand the array to <code>replay(events, rules)</code>
|
|
1098
|
+
from <code>pyric/sandbox</code> and the engine re-issues every
|
|
1099
|
+
captured write against a fresh sandbox.</p>
|
|
1100
|
+
<p>Unlike <a href="/docs/pyric-firestore-reference-api/#onevent">onEvent</a> (live stream from the moment of subscribe),
|
|
1101
|
+
<code>history()</code> returns <em>every</em> event the sandbox has seen — useful
|
|
1102
|
+
for consumers that attach late (e.g., loading a saved session
|
|
1103
|
+
before subscribing) or that need a snapshot at a particular moment.</p>
|
|
1104
|
+
<p><code>reset()</code> and <code>dispose()</code> each append a closing <code>session_boundary</code>
|
|
1105
|
+
event; <code>reset()</code> then clears the history. Consumers that took a
|
|
1106
|
+
snapshot <em>before</em> reset retain the boundary in their copy.</p>
|
|
1107
|
+
<h6 id="returns-39">Returns</h6>
|
|
1108
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#sandboxevent"><code>SandboxEvent</code></a>[]</p>
|
|
1109
|
+
<h6 id="inherited-from-21">Inherited from</h6>
|
|
1110
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#remotesandbox"><code>RemoteSandbox</code></a>.<a href="/docs/pyric-sandbox-reference-api/#history-2"><code>history</code></a></p>
|
|
1111
|
+
<p><a id="loadsnapshot-2"></a></p>
|
|
1112
|
+
<h5 id="loadsnapshot-1">loadSnapshot()</h5>
|
|
1113
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">loadSnapshot</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">data</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">SandboxSnapshot</span><span style="color:#ABB2BF">): </span><span style="color:#C678DD">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1114
|
+
<p>CLOBBER-restore the sandbox’s entire state from a prior <a href="/docs/pyric-firestore-reference-api/#snapshot">snapshot</a>:
|
|
1115
|
+
<code>reset()</code> (clears firestore + the signed-in session), then rebuild firestore
|
|
1116
|
+
from <code>data</code> and restore each registered service. This is a TOTAL replace —
|
|
1117
|
+
documents absent from <code>data</code> do NOT survive — and is the counterpart to
|
|
1118
|
+
<a href="/docs/pyric-firestore-reference-api/#snapshot">snapshot</a>. It is what makes “transfer (clobber) one instance’s data
|
|
1119
|
+
into another” and named-branch switching possible.</p>
|
|
1120
|
+
<p>Fires a <code>session_boundary</code> (reset phase), re-evaluates live listeners against
|
|
1121
|
+
the loaded state, and the next persistence flush writes the loaded state.
|
|
1122
|
+
Services present in <code>data</code> but not currently registered are skipped (a
|
|
1123
|
+
snapshot taken via <a href="/docs/pyric-firestore-reference-api/#snapshot">snapshot</a> always includes every registered
|
|
1124
|
+
service, so this only affects cross-instance imports from a sandbox that had
|
|
1125
|
+
a service this one lacks).</p>
|
|
1126
|
+
<h6 id="parameters-19">Parameters</h6>
|
|
1127
|
+
<div class="table-scroll">
|
|
1128
|
+
|
|
1129
|
+
|
|
1130
|
+
|
|
1131
|
+
|
|
1132
|
+
|
|
1133
|
+
|
|
1134
|
+
|
|
1135
|
+
|
|
1136
|
+
|
|
1137
|
+
|
|
1138
|
+
|
|
1139
|
+
|
|
1140
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>data</code></td><td align="left"><a href="/docs/pyric-sandbox-reference-api/#sandboxsnapshot"><code>SandboxSnapshot</code></a></td></tr></tbody></table></div>
|
|
1141
|
+
<h6 id="returns-40">Returns</h6>
|
|
1142
|
+
<p><code>void</code></p>
|
|
1143
|
+
<h6 id="inherited-from-22">Inherited from</h6>
|
|
1144
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#remotesandbox"><code>RemoteSandbox</code></a>.<a href="/docs/pyric-sandbox-reference-api/#loadsnapshot-2"><code>loadSnapshot</code></a></p>
|
|
1145
|
+
<p><a id="oncurrentuserchanged-2"></a></p>
|
|
1146
|
+
<h5 id="oncurrentuserchanged-1">onCurrentUserChanged()</h5>
|
|
1147
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">onCurrentUserChanged</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">cb</span><span style="color:#ABB2BF">: (</span><span style="color:#E06C75;font-style:italic">user</span><span style="color:#ABB2BF">: {</span></span>
|
|
1148
|
+
<span class="line"><span style="color:#E06C75"> token</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Record</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">, </span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">>;</span></span>
|
|
1149
|
+
<span class="line"><span style="color:#E06C75"> uid</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">;</span></span>
|
|
1150
|
+
<span class="line"><span style="color:#ABB2BF">}) </span><span style="color:#C678DD">=></span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">): () </span><span style="color:#C678DD">=></span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1151
|
+
<p>Subscribe to <code>currentUser</code> changes. Fires on every mutation —
|
|
1152
|
+
sign-in, sign-out, user swap. Does NOT fire on subscribe.</p>
|
|
1153
|
+
<p>Survives <code>reset()</code> and <code>dispose()</code> only as a no-op: a disposed
|
|
1154
|
+
sandbox emits nothing further; a reset sandbox clears
|
|
1155
|
+
<code>currentUser</code> to <code>null</code> (and fires the change) before swapping
|
|
1156
|
+
the env.</p>
|
|
1157
|
+
<p>Returns an unsubscribe function. Listener errors are swallowed —
|
|
1158
|
+
subscribers are observational, the sandbox does not propagate
|
|
1159
|
+
their errors.</p>
|
|
1160
|
+
<h6 id="parameters-20">Parameters</h6>
|
|
1161
|
+
<div class="table-scroll">
|
|
1162
|
+
|
|
1163
|
+
|
|
1164
|
+
|
|
1165
|
+
|
|
1166
|
+
|
|
1167
|
+
|
|
1168
|
+
|
|
1169
|
+
|
|
1170
|
+
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
|
|
1174
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>cb</code></td><td align="left">(<code>user</code>: { <code>token?</code>: <code>Record</code><<code>string</code>, <code>unknown</code>>; <code>uid</code>: <code>string</code>; }) => <code>void</code></td></tr></tbody></table></div>
|
|
1175
|
+
<h6 id="returns-41">Returns</h6>
|
|
1176
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1177
|
+
<h6 id="returns-42">Returns</h6>
|
|
437
1178
|
<p><code>void</code></p>
|
|
1179
|
+
<h6 id="inherited-from-23">Inherited from</h6>
|
|
1180
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#remotesandbox"><code>RemoteSandbox</code></a>.<a href="/docs/pyric-sandbox-reference-api/#oncurrentuserchanged-2"><code>onCurrentUserChanged</code></a></p>
|
|
1181
|
+
<p><a id="onevent-2"></a></p>
|
|
1182
|
+
<h5 id="onevent-1">onEvent()</h5>
|
|
1183
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">onEvent</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">cb</span><span style="color:#ABB2BF">: (</span><span style="color:#E06C75;font-style:italic">event</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">SandboxEvent</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">): () </span><span style="color:#C678DD">=></span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1184
|
+
<p>Subscribe to every event the sandbox emits — see <a href="/docs/pyric-sandbox-reference-api/#sandboxevent">SandboxEvent</a>
|
|
1185
|
+
for the discriminated-union shape. One subscription covers
|
|
1186
|
+
request/denial/snapshot-error/listener-lifecycle/session-boundary;
|
|
1187
|
+
filter on <code>event.kind</code> to recover individual streams.</p>
|
|
1188
|
+
<p>Replaces the prior three-channel surface (<code>onRequest</code> / <code>onDenial</code>
|
|
1189
|
+
/ <code>onSnapshotError</code>) — see issue #307. Filter cookbook:</p>
|
|
1190
|
+
<ul>
|
|
1191
|
+
<li>All denials: <code>event.kind === 'request' && event.result === 'deny'</code></li>
|
|
1192
|
+
<li>Stream errors: <code>event.kind === 'listener_errored'</code></li>
|
|
1193
|
+
<li>Per-op traffic: <code>event.kind === 'request'</code></li>
|
|
1194
|
+
</ul>
|
|
1195
|
+
<p>Survives <code>sandbox.reset()</code> — the subscription is held on the
|
|
1196
|
+
sandbox, not on the underlying environment. A <code>session_boundary</code>
|
|
1197
|
+
event with <code>phase: 'reset'</code> fires before the env swap so consumers
|
|
1198
|
+
can segment their stream.</p>
|
|
1199
|
+
<p>Returns an unsubscribe function. Listener errors are swallowed so a
|
|
1200
|
+
faulty subscriber can’t change rule semantics or hide other events.
|
|
1201
|
+
Both synchronous throws and rejected Promises from async callbacks
|
|
1202
|
+
are silently discarded — subscribers are <strong>observational</strong>, the
|
|
1203
|
+
sandbox doesn’t await them and doesn’t propagate their errors.</p>
|
|
1204
|
+
<h6 id="parameters-21">Parameters</h6>
|
|
1205
|
+
<div class="table-scroll">
|
|
1206
|
+
|
|
1207
|
+
|
|
1208
|
+
|
|
1209
|
+
|
|
1210
|
+
|
|
1211
|
+
|
|
1212
|
+
|
|
1213
|
+
|
|
1214
|
+
|
|
1215
|
+
|
|
1216
|
+
|
|
1217
|
+
|
|
1218
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>cb</code></td><td align="left">(<code>event</code>: <a href="/docs/pyric-sandbox-reference-api/#sandboxevent"><code>SandboxEvent</code></a>) => <code>void</code></td></tr></tbody></table></div>
|
|
1219
|
+
<h6 id="returns-43">Returns</h6>
|
|
1220
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1221
|
+
<h6 id="returns-44">Returns</h6>
|
|
1222
|
+
<p><code>void</code></p>
|
|
1223
|
+
<h6 id="inherited-from-24">Inherited from</h6>
|
|
1224
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#remotesandbox"><code>RemoteSandbox</code></a>.<a href="/docs/pyric-sandbox-reference-api/#onevent-2"><code>onEvent</code></a></p>
|
|
1225
|
+
<p><a id="registerpersistableservice-2"></a></p>
|
|
1226
|
+
<h5 id="registerpersistableservice-1">registerPersistableService()</h5>
|
|
1227
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">registerPersistableService</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">name</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">hooks</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">PersistableService</span><span style="color:#ABB2BF">): () </span><span style="color:#C678DD">=></span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1228
|
+
<p>Register a service (auth, storage, …) as a persistence participant.
|
|
1229
|
+
The sandbox calls <code>hooks.snapshot()</code> on every flush and
|
|
1230
|
+
<code>hooks.restore(data)</code> on restore. If <code>hooks.subscribe</code> is provided,
|
|
1231
|
+
the persistence controller subscribes and schedules a debounced
|
|
1232
|
+
flush on each change — so auth-user edits flush promptly, not only
|
|
1233
|
+
on the next Firestore write.</p>
|
|
1234
|
+
<p>Returns an unregister function — call it if the service is torn
|
|
1235
|
+
down before the sandbox is disposed (uncommon in practice; the
|
|
1236
|
+
sandbox’s <code>dispose()</code> clears the registry anyway).</p>
|
|
1237
|
+
<p>Throws <code>failed-precondition</code> when a service with the same <code>name</code> is
|
|
1238
|
+
already registered — the auth package registers <code>'auth'</code> once when
|
|
1239
|
+
<code>getAuth(sandbox)</code> first creates a backend, so accidental double-
|
|
1240
|
+
registration is a caller bug, not a no-op.</p>
|
|
1241
|
+
<p><strong>Advanced / internal API.</strong> Service packages (auth, storage) call
|
|
1242
|
+
this when they first attach to a sandbox. Consumer app code should
|
|
1243
|
+
not need to call this directly.</p>
|
|
1244
|
+
<h6 id="parameters-22">Parameters</h6>
|
|
1245
|
+
<div class="table-scroll">
|
|
1246
|
+
|
|
1247
|
+
|
|
1248
|
+
|
|
1249
|
+
|
|
1250
|
+
|
|
1251
|
+
|
|
1252
|
+
|
|
1253
|
+
|
|
1254
|
+
|
|
1255
|
+
|
|
1256
|
+
|
|
1257
|
+
|
|
1258
|
+
|
|
1259
|
+
|
|
1260
|
+
|
|
1261
|
+
|
|
1262
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>name</code></td><td align="left"><code>string</code></td></tr><tr><td align="left"><code>hooks</code></td><td align="left"><a href="/docs/pyric-sandbox-reference-api/#persistableservice"><code>PersistableService</code></a></td></tr></tbody></table></div>
|
|
1263
|
+
<h6 id="returns-45">Returns</h6>
|
|
1264
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1265
|
+
<h6 id="returns-46">Returns</h6>
|
|
1266
|
+
<p><code>void</code></p>
|
|
1267
|
+
<h6 id="inherited-from-25">Inherited from</h6>
|
|
1268
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#remotesandbox"><code>RemoteSandbox</code></a>.<a href="/docs/pyric-sandbox-reference-api/#registerpersistableservice-2"><code>registerPersistableService</code></a></p>
|
|
1269
|
+
<p><a id="reset-2"></a></p>
|
|
1270
|
+
<h5 id="reset-1">reset()</h5>
|
|
1271
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">reset</span><span style="color:#ABB2BF">(): </span><span style="color:#C678DD">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1272
|
+
<p>Reset the underlying environment to a fresh state — wipes data,
|
|
1273
|
+
rules, and any service-specific configuration.</p>
|
|
1274
|
+
<p>Snapshot listeners attached to the OLD environment are dropped at
|
|
1275
|
+
the swap — they can’t survive because their target docs have been
|
|
1276
|
+
wiped. <code>onEvent</code> subscribers DO survive — the registry lives on
|
|
1277
|
+
the sandbox, and a <code>session_boundary</code> event with <code>phase: 'reset'</code>
|
|
1278
|
+
fires before the swap so subscribers know the rollover happened.
|
|
1279
|
+
Existing <a href="/docs/pyric-firestore-reference-api/#sandboxcontext">SandboxContext</a>s continue to work — their sandbox
|
|
1280
|
+
reference is stable; subsequent operations resolve to the new env.</p>
|
|
1281
|
+
<h6 id="returns-47">Returns</h6>
|
|
1282
|
+
<p><code>void</code></p>
|
|
1283
|
+
<h6 id="inherited-from-26">Inherited from</h6>
|
|
1284
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#remotesandbox"><code>RemoteSandbox</code></a>.<a href="/docs/pyric-sandbox-reference-api/#reset-4"><code>reset</code></a></p>
|
|
1285
|
+
<p><a id="resetall-2"></a></p>
|
|
1286
|
+
<h5 id="resetall-1">resetAll()</h5>
|
|
1287
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">resetAll</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">Promise</span><span style="color:#ABB2BF"><{</span></span>
|
|
1288
|
+
<span class="line"><span style="color:#E06C75"> errors</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">[];</span></span>
|
|
1289
|
+
<span class="line"><span style="color:#ABB2BF">}>;</span></span></code></pre>
|
|
1290
|
+
<p>Reset the WHOLE sandbox: <a href="/docs/pyric-firestore-reference-api/#reset">reset</a> (Firestore env + signed-in
|
|
1291
|
+
session), then clear every registered persistable service that
|
|
1292
|
+
provides a <a href="/docs/pyric-sandbox-reference-api/#reset-2">PersistableService.reset</a> hook — auth users, the
|
|
1293
|
+
RTDB tree, storage objects. This is the one sandbox-owned “wipe
|
|
1294
|
+
everything” path: because it iterates the service registry, a new
|
|
1295
|
+
service that registers with a <code>reset</code> hook is cleared automatically,
|
|
1296
|
+
and a consumer (Pyric Studio’s reset) cannot forget one.</p>
|
|
1297
|
+
<p>Service resets may be async (storage clears IndexedDB stores); the
|
|
1298
|
+
returned promise resolves when every service has finished clearing.
|
|
1299
|
+
A service whose <code>reset</code> throws is isolated (others still clear) and
|
|
1300
|
+
REPORTED in the returned <code>errors</code> (as <code>name: message</code>) — a reset that
|
|
1301
|
+
leaves data behind must never look successful to the caller.</p>
|
|
1302
|
+
<h6 id="returns-48">Returns</h6>
|
|
1303
|
+
<p><code>Promise</code><{
|
|
1304
|
+
<code>errors</code>: <code>string</code>[];
|
|
1305
|
+
}></p>
|
|
1306
|
+
<h6 id="inherited-from-27">Inherited from</h6>
|
|
1307
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#remotesandbox"><code>RemoteSandbox</code></a>.<a href="/docs/pyric-sandbox-reference-api/#resetall-2"><code>resetAll</code></a></p>
|
|
1308
|
+
<p><a id="runwithprovenance-2"></a></p>
|
|
1309
|
+
<h5 id="runwithprovenance-1">runWithProvenance()?</h5>
|
|
1310
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E06C75">optional</span><span style="color:#61AFEF"> runWithProvenance</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>(</span><span style="color:#E06C75">provenance</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">EventProvenance</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">fn</span><span style="color:#ABB2BF">: () </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> T</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1311
|
+
<p>Run <code>fn</code> with ambient <a href="/docs/pyric-sandbox-reference-api/#eventprovenance">EventProvenance</a> defaults: every event
|
|
1312
|
+
emitted SYNCHRONOUSLY during <code>fn</code> that doesn’t already carry a
|
|
1313
|
+
provenance field (on the event itself or via an explicit per-emit
|
|
1314
|
+
override) is stamped with these values instead of the global
|
|
1315
|
+
defaults. This is the mechanical “who issued this op” seam the
|
|
1316
|
+
serve worker uses to tag Studio-issued ops (<code>actor: { kind: 'studio' }</code>) and to stamp the auth lens an op ran under
|
|
1317
|
+
(<code>authLens</code>) — declared by the caller that issues the op, never
|
|
1318
|
+
inferred from the op’s shape.</p>
|
|
1319
|
+
<p>SYNCHRONOUS WINDOW: the ambient values apply only until <code>fn</code>
|
|
1320
|
+
returns (for an async <code>fn</code>, its synchronous prefix — which covers
|
|
1321
|
+
the local environment’s rules eval + event emission, since those
|
|
1322
|
+
run before the op’s promise is handed back). Work an op DEFERS
|
|
1323
|
+
(snapshot-listener deliveries and re-evals drain on a microtask,
|
|
1324
|
+
off-stack) is intentionally OUTSIDE the window: a listener re-eval
|
|
1325
|
+
belongs to the listener’s owner, not to whoever’s write triggered
|
|
1326
|
+
it. Nested calls stack — the innermost window wins per field, and
|
|
1327
|
+
each window restores the previous one on exit (including on throw).</p>
|
|
1328
|
+
<p>OPTIONAL because remote sandbox proxies can’t provide an ambient
|
|
1329
|
+
emit window (events are emitted in the worker they front). Callers
|
|
1330
|
+
spell <code>sandbox.runWithProvenance?.(prov, fn) ?? fn()</code>.</p>
|
|
1331
|
+
<h6 id="type-parameters-1">Type Parameters</h6>
|
|
1332
|
+
<div class="table-scroll">
|
|
1333
|
+
|
|
1334
|
+
|
|
1335
|
+
|
|
1336
|
+
|
|
1337
|
+
|
|
1338
|
+
|
|
1339
|
+
|
|
1340
|
+
|
|
1341
|
+
|
|
1342
|
+
|
|
1343
|
+
<table><thead><tr><th align="left">Type Parameter</th></tr></thead><tbody><tr><td align="left"><code>T</code></td></tr></tbody></table></div>
|
|
1344
|
+
<h6 id="parameters-23">Parameters</h6>
|
|
1345
|
+
<div class="table-scroll">
|
|
1346
|
+
|
|
1347
|
+
|
|
1348
|
+
|
|
1349
|
+
|
|
1350
|
+
|
|
1351
|
+
|
|
1352
|
+
|
|
1353
|
+
|
|
1354
|
+
|
|
1355
|
+
|
|
1356
|
+
|
|
1357
|
+
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
|
|
1361
|
+
|
|
1362
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>provenance</code></td><td align="left"><a href="/docs/pyric-sandbox-reference-api/#eventprovenance"><code>EventProvenance</code></a></td></tr><tr><td align="left"><code>fn</code></td><td align="left">() => <code>T</code></td></tr></tbody></table></div>
|
|
1363
|
+
<h6 id="returns-49">Returns</h6>
|
|
1364
|
+
<p><code>T</code></p>
|
|
1365
|
+
<h6 id="inherited-from-28">Inherited from</h6>
|
|
1366
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#remotesandbox"><code>RemoteSandbox</code></a>.<a href="/docs/pyric-sandbox-reference-api/#runwithprovenance-2"><code>runWithProvenance</code></a></p>
|
|
1367
|
+
<p><a id="snapshot-2"></a></p>
|
|
1368
|
+
<h5 id="snapshot-1">snapshot()</h5>
|
|
1369
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">snapshot</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">SandboxSnapshot</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1370
|
+
<p>Capture a snapshot of every service’s state. For v1 with only
|
|
1371
|
+
Firestore, the return value carries a <code>firestore</code> key mapping doc
|
|
1372
|
+
paths to data. Future services will add their own keys.</p>
|
|
1373
|
+
<h6 id="returns-50">Returns</h6>
|
|
1374
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#sandboxsnapshot"><code>SandboxSnapshot</code></a></p>
|
|
1375
|
+
<h6 id="inherited-from-29">Inherited from</h6>
|
|
1376
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#remotesandbox"><code>RemoteSandbox</code></a>.<a href="/docs/pyric-sandbox-reference-api/#snapshot-4"><code>snapshot</code></a></p>
|
|
1377
|
+
<p><a id="withauth-2"></a></p>
|
|
1378
|
+
<h5 id="withauth-1">withAuth()</h5>
|
|
1379
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">withAuth</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">auth</span><span style="color:#ABB2BF">: {</span></span>
|
|
1380
|
+
<span class="line"><span style="color:#ABB2BF"> token?: </span><span style="color:#E06C75">Record</span><span style="color:#56B6C2"><</span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">, unknown>;</span></span>
|
|
1381
|
+
<span class="line"><span style="color:#E06C75"> uid</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">;</span></span>
|
|
1382
|
+
<span class="line"><span style="color:#ABB2BF">}): </span><span style="color:#E06C75">SandboxContext</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1383
|
+
<p>Derive a context bound to this sandbox under the given auth
|
|
1384
|
+
identity. Operations through services attached to the returned
|
|
1385
|
+
context evaluate rules under that identity. Many contexts can
|
|
1386
|
+
coexist for one sandbox; data is shared.</p>
|
|
1387
|
+
<p><code>null</code> is anonymous; an <code>AuthState</code> object names the user (and
|
|
1388
|
+
optional custom claims). Passing <code>undefined</code> is a deliberate
|
|
1389
|
+
error — say <code>withAuth(null)</code> for anonymous so the call site is
|
|
1390
|
+
unambiguous.</p>
|
|
1391
|
+
<h6 id="parameters-24">Parameters</h6>
|
|
1392
|
+
<div class="table-scroll">
|
|
1393
|
+
|
|
1394
|
+
|
|
1395
|
+
|
|
1396
|
+
|
|
1397
|
+
|
|
1398
|
+
|
|
1399
|
+
|
|
1400
|
+
|
|
1401
|
+
|
|
1402
|
+
|
|
1403
|
+
|
|
1404
|
+
|
|
1405
|
+
|
|
1406
|
+
|
|
1407
|
+
|
|
1408
|
+
|
|
1409
|
+
|
|
1410
|
+
|
|
1411
|
+
|
|
1412
|
+
|
|
1413
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>auth</code></td><td align="left">{ <code>token?</code>: <code>Record</code><<code>string</code>, <code>unknown</code>>; <code>uid</code>: <code>string</code>; }</td></tr><tr><td align="left"><code>auth.token?</code></td><td align="left"><code>Record</code><<code>string</code>, <code>unknown</code>></td></tr><tr><td align="left"><code>auth.uid</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
1414
|
+
<h6 id="returns-51">Returns</h6>
|
|
1415
|
+
<p><a href="/docs/pyric-firestore-reference-api/#sandboxcontext"><code>SandboxContext</code></a></p>
|
|
1416
|
+
<h6 id="example-3">Example</h6>
|
|
1417
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> sandbox</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> initializeSandbox</span><span style="color:#ABB2BF">();</span></span>
|
|
1418
|
+
<span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> dbAlice</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> getFirestore</span><span style="color:#ABB2BF">(</span><span style="color:#E5C07B">sandbox</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">withAuth</span><span style="color:#ABB2BF">({ </span><span style="color:#E06C75">uid</span><span style="color:#ABB2BF">: </span><span style="color:#98C379">'alice'</span><span style="color:#ABB2BF"> }));</span></span>
|
|
1419
|
+
<span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> dbAnon</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> getFirestore</span><span style="color:#ABB2BF">(</span><span style="color:#E5C07B">sandbox</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">withAuth</span><span style="color:#ABB2BF">(</span><span style="color:#D19A66">null</span><span style="color:#ABB2BF">));</span></span></code></pre>
|
|
1420
|
+
<h6 id="inherited-from-30">Inherited from</h6>
|
|
1421
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#remotesandbox"><code>RemoteSandbox</code></a>.<a href="/docs/pyric-sandbox-reference-api/#withauth-4"><code>withAuth</code></a></p>
|
|
438
1422
|
<hr>
|
|
439
1423
|
<p><a id="remotesandboxchannel-1"></a></p>
|
|
440
1424
|
<h3 id="remotesandboxchannel">RemoteSandboxChannel</h3>
|
|
@@ -448,7 +1432,7 @@ checkpoint 2’s <code>pyric-admin</code> remote-dispatch arm consumes it direct
|
|
|
448
1432
|
<p>Dispatch one worker op. Resolves with the worker’s <code>res.value</code>;
|
|
449
1433
|
rejects with an Error carrying <code>.code</code>. NOTE: callers choose their own
|
|
450
1434
|
<code>actAs</code> lens — nothing is pinned here.</p>
|
|
451
|
-
<h6 id="parameters-
|
|
1435
|
+
<h6 id="parameters-25">Parameters</h6>
|
|
452
1436
|
<div class="table-scroll">
|
|
453
1437
|
|
|
454
1438
|
|
|
@@ -463,7 +1447,7 @@ rejects with an Error carrying <code>.code</code>. NOTE: callers choose their ow
|
|
|
463
1447
|
|
|
464
1448
|
|
|
465
1449
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>op</code></td><td align="left"><code>WorkerOpPayload</code></td></tr></tbody></table></div>
|
|
466
|
-
<h6 id="returns-
|
|
1450
|
+
<h6 id="returns-52">Returns</h6>
|
|
467
1451
|
<p><code>Promise</code><<code>unknown</code>></p>
|
|
468
1452
|
<p><a id="subscribe"></a></p>
|
|
469
1453
|
<h5 id="subscribe">subscribe()</h5>
|
|
@@ -476,7 +1460,7 @@ rejects with an Error carrying <code>.code</code>. NOTE: callers choose their ow
|
|
|
476
1460
|
<p>Register a worker subscription. <code>onSnap</code> receives each snap value;
|
|
477
1461
|
an establishment failure (the worker host’s <code>{ __error }</code> snap) routes
|
|
478
1462
|
to <code>onError</code> instead. Returns the unsubscribe function.</p>
|
|
479
|
-
<h6 id="parameters-
|
|
1463
|
+
<h6 id="parameters-26">Parameters</h6>
|
|
480
1464
|
<div class="table-scroll">
|
|
481
1465
|
|
|
482
1466
|
|
|
@@ -499,9 +1483,9 @@ to <code>onError</code> instead. Returns the unsubscribe function.</p>
|
|
|
499
1483
|
|
|
500
1484
|
|
|
501
1485
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>sub</code></td><td align="left"><code>WorkerSubPayload</code></td></tr><tr><td align="left"><code>onSnap</code></td><td align="left">(<code>value</code>: <code>unknown</code>) => <code>void</code></td></tr><tr><td align="left"><code>onError?</code></td><td align="left">(<code>err</code>: <code>Error</code> & { <code>code</code>: <code>string</code>; }) => <code>void</code></td></tr></tbody></table></div>
|
|
502
|
-
<h6 id="returns-
|
|
1486
|
+
<h6 id="returns-53">Returns</h6>
|
|
503
1487
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
504
|
-
<h6 id="returns-
|
|
1488
|
+
<h6 id="returns-54">Returns</h6>
|
|
505
1489
|
<p><code>void</code></p>
|
|
506
1490
|
<hr>
|
|
507
1491
|
<p><a id="remotesandboxcore"></a></p>
|
|
@@ -529,11 +1513,11 @@ to <code>onError</code> instead. Returns the unsubscribe function.</p>
|
|
|
529
1513
|
|
|
530
1514
|
<table><thead><tr><th align="left">Property</th><th align="left">Type</th><th align="left">Description</th></tr></thead><tbody><tr><td align="left"><a id="channel-2"></a> <code>channel</code></td><td align="left"><a href="#remotesandboxchannel-1"><code>RemoteSandboxChannel</code></a></td><td align="left">-</td></tr><tr><td align="left"><a id="ready-1"></a> <code>ready</code></td><td align="left"><code>Promise</code><<code>void</code>></td><td align="left">Resolves on <code>attach-ack</code>; rejects when no browser tab is connected.</td></tr></tbody></table></div>
|
|
531
1515
|
<h4 id="methods-5">Methods</h4>
|
|
532
|
-
<p><a id="dispose"></a></p>
|
|
533
|
-
<h5 id="dispose">dispose()</h5>
|
|
1516
|
+
<p><a id="dispose-4"></a></p>
|
|
1517
|
+
<h5 id="dispose-2">dispose()</h5>
|
|
534
1518
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">dispose</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">reason</span><span style="color:#C678DD">?:</span><span style="color:#E06C75"> string</span><span style="color:#ABB2BF">): </span><span style="color:#C678DD">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
535
1519
|
<p>Fail everything in flight (transport closed). Idempotent.</p>
|
|
536
|
-
<h6 id="parameters-
|
|
1520
|
+
<h6 id="parameters-27">Parameters</h6>
|
|
537
1521
|
<div class="table-scroll">
|
|
538
1522
|
|
|
539
1523
|
|
|
@@ -548,13 +1532,13 @@ to <code>onError</code> instead. Returns the unsubscribe function.</p>
|
|
|
548
1532
|
|
|
549
1533
|
|
|
550
1534
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>reason?</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
551
|
-
<h6 id="returns-
|
|
1535
|
+
<h6 id="returns-55">Returns</h6>
|
|
552
1536
|
<p><code>void</code></p>
|
|
553
1537
|
<p><a id="handlemessage"></a></p>
|
|
554
1538
|
<h5 id="handlemessage">handleMessage()</h5>
|
|
555
1539
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">handleMessage</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">msg</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">BridgeMessage</span><span style="color:#ABB2BF">): </span><span style="color:#C678DD">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
556
1540
|
<p>Feed one parsed message from the transport into the core.</p>
|
|
557
|
-
<h6 id="parameters-
|
|
1541
|
+
<h6 id="parameters-28">Parameters</h6>
|
|
558
1542
|
<div class="table-scroll">
|
|
559
1543
|
|
|
560
1544
|
|
|
@@ -568,14 +1552,14 @@ to <code>onError</code> instead. Returns the unsubscribe function.</p>
|
|
|
568
1552
|
|
|
569
1553
|
|
|
570
1554
|
|
|
571
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>msg</code></td><td align="left"><code>BridgeMessage</code></td></tr></tbody></table></div>
|
|
572
|
-
<h6 id="returns-
|
|
1555
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>msg</code></td><td align="left"><a href="/docs/pyric-cli-bridge-client-reference-api/#bridgemessage"><code>BridgeMessage</code></a></td></tr></tbody></table></div>
|
|
1556
|
+
<h6 id="returns-56">Returns</h6>
|
|
573
1557
|
<p><code>void</code></p>
|
|
574
1558
|
<p><a id="start"></a></p>
|
|
575
1559
|
<h5 id="start">start()</h5>
|
|
576
1560
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">start</span><span style="color:#ABB2BF">(): </span><span style="color:#C678DD">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
577
1561
|
<p>Send the attach handshake. <code>ready</code> settles on the ack.</p>
|
|
578
|
-
<h6 id="returns-
|
|
1562
|
+
<h6 id="returns-57">Returns</h6>
|
|
579
1563
|
<p><code>void</code></p>
|
|
580
1564
|
<hr>
|
|
581
1565
|
<p><a id="remotestorage"></a></p>
|
|
@@ -591,7 +1575,7 @@ streaming transfers are not supported on the sandbox backend.</p>
|
|
|
591
1575
|
<h5 id="deleteobject">deleteObject()</h5>
|
|
592
1576
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">deleteObject</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">path</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#C678DD">void</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
593
1577
|
<p>Delete the object at <code>path</code>. Idempotent (missing = no-op).</p>
|
|
594
|
-
<h6 id="parameters-
|
|
1578
|
+
<h6 id="parameters-29">Parameters</h6>
|
|
595
1579
|
<div class="table-scroll">
|
|
596
1580
|
|
|
597
1581
|
|
|
@@ -606,13 +1590,13 @@ streaming transfers are not supported on the sandbox backend.</p>
|
|
|
606
1590
|
|
|
607
1591
|
|
|
608
1592
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>path</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
609
|
-
<h6 id="returns-
|
|
1593
|
+
<h6 id="returns-58">Returns</h6>
|
|
610
1594
|
<p><code>Promise</code><<code>void</code>></p>
|
|
611
1595
|
<p><a id="exists-1"></a></p>
|
|
612
1596
|
<h5 id="exists">exists()</h5>
|
|
613
1597
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">exists</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">path</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#E06C75">boolean</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
614
1598
|
<p>Does an object exist at <code>path</code>? (<code>getMetadata</code> with not-found → false.)</p>
|
|
615
|
-
<h6 id="parameters-
|
|
1599
|
+
<h6 id="parameters-30">Parameters</h6>
|
|
616
1600
|
<div class="table-scroll">
|
|
617
1601
|
|
|
618
1602
|
|
|
@@ -627,14 +1611,14 @@ streaming transfers are not supported on the sandbox backend.</p>
|
|
|
627
1611
|
|
|
628
1612
|
|
|
629
1613
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>path</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
630
|
-
<h6 id="returns-
|
|
1614
|
+
<h6 id="returns-59">Returns</h6>
|
|
631
1615
|
<p><code>Promise</code><<code>boolean</code>></p>
|
|
632
1616
|
<p><a id="getbytes"></a></p>
|
|
633
1617
|
<h5 id="getbytes">getBytes()</h5>
|
|
634
1618
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">getBytes</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">path</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#E06C75">Buffer</span><span style="color:#56B6C2"><</span><span style="color:#E06C75">ArrayBufferLike</span><span style="color:#56B6C2">>></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
635
1619
|
<p>Download the object’s bytes. Rejects <code>storage/object-not-found</code> when
|
|
636
1620
|
absent, <code>payload-too-large</code> when over the op cap.</p>
|
|
637
|
-
<h6 id="parameters-
|
|
1621
|
+
<h6 id="parameters-31">Parameters</h6>
|
|
638
1622
|
<div class="table-scroll">
|
|
639
1623
|
|
|
640
1624
|
|
|
@@ -649,13 +1633,13 @@ absent, <code>payload-too-large</code> when over the op cap.</p>
|
|
|
649
1633
|
|
|
650
1634
|
|
|
651
1635
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>path</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
652
|
-
<h6 id="returns-
|
|
1636
|
+
<h6 id="returns-60">Returns</h6>
|
|
653
1637
|
<p><code>Promise</code><<code>Buffer</code><<code>ArrayBufferLike</code>>></p>
|
|
654
1638
|
<p><a id="getmetadata"></a></p>
|
|
655
1639
|
<h5 id="getmetadata">getMetadata()</h5>
|
|
656
1640
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">getMetadata</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">path</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#E06C75">FullMetadata</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
657
1641
|
<p>Read the object’s <code>FullMetadata</code>.</p>
|
|
658
|
-
<h6 id="parameters-
|
|
1642
|
+
<h6 id="parameters-32">Parameters</h6>
|
|
659
1643
|
<div class="table-scroll">
|
|
660
1644
|
|
|
661
1645
|
|
|
@@ -670,8 +1654,8 @@ absent, <code>payload-too-large</code> when over the op cap.</p>
|
|
|
670
1654
|
|
|
671
1655
|
|
|
672
1656
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>path</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
673
|
-
<h6 id="returns-
|
|
674
|
-
<p><code>Promise</code><<code>FullMetadata</code>></p>
|
|
1657
|
+
<h6 id="returns-61">Returns</h6>
|
|
1658
|
+
<p><code>Promise</code><<a href="/docs/pyric-storage-reference-api/#fullmetadata"><code>FullMetadata</code></a>></p>
|
|
675
1659
|
<p><a id="listall"></a></p>
|
|
676
1660
|
<h5 id="listall">listAll()</h5>
|
|
677
1661
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">listAll</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">path</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#ABB2BF"><{</span></span>
|
|
@@ -685,7 +1669,7 @@ absent, <code>payload-too-large</code> when over the op cap.</p>
|
|
|
685
1669
|
<span class="line"><span style="color:#ABB2BF"> }[];</span></span>
|
|
686
1670
|
<span class="line"><span style="color:#ABB2BF">}>;</span></span></code></pre>
|
|
687
1671
|
<p>Enumerate immediate child items + prefixes under <code>path</code>.</p>
|
|
688
|
-
<h6 id="parameters-
|
|
1672
|
+
<h6 id="parameters-33">Parameters</h6>
|
|
689
1673
|
<div class="table-scroll">
|
|
690
1674
|
|
|
691
1675
|
|
|
@@ -700,7 +1684,7 @@ absent, <code>payload-too-large</code> when over the op cap.</p>
|
|
|
700
1684
|
|
|
701
1685
|
|
|
702
1686
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>path</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
703
|
-
<h6 id="returns-
|
|
1687
|
+
<h6 id="returns-62">Returns</h6>
|
|
704
1688
|
<p><code>Promise</code><{
|
|
705
1689
|
<code>items</code>: {
|
|
706
1690
|
<code>fullPath</code>: <code>string</code>;
|
|
@@ -722,7 +1706,7 @@ absent, <code>payload-too-large</code> when over the op cap.</p>
|
|
|
722
1706
|
<span class="line"><span style="color:#ABB2BF">}): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#E06C75">FullMetadata</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
723
1707
|
<p>Upload <code>data</code> at <code>path</code> (replaces any existing object). Resolves with
|
|
724
1708
|
the stored object’s <code>FullMetadata</code>.</p>
|
|
725
|
-
<h6 id="parameters-
|
|
1709
|
+
<h6 id="parameters-34">Parameters</h6>
|
|
726
1710
|
<div class="table-scroll">
|
|
727
1711
|
|
|
728
1712
|
|
|
@@ -753,8 +1737,8 @@ the stored object’s <code>FullMetadata</code>.</p>
|
|
|
753
1737
|
|
|
754
1738
|
|
|
755
1739
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>path</code></td><td align="left"><code>string</code></td></tr><tr><td align="left"><code>data</code></td><td align="left"><code>Uint8Array</code></td></tr><tr><td align="left"><code>options?</code></td><td align="left">{ <code>contentType?</code>: <code>string</code>; <code>metadata?</code>: <code>Record</code><<code>string</code>, <code>unknown</code>>; }</td></tr><tr><td align="left"><code>options.contentType?</code></td><td align="left"><code>string</code></td></tr><tr><td align="left"><code>options.metadata?</code></td><td align="left"><code>Record</code><<code>string</code>, <code>unknown</code>></td></tr></tbody></table></div>
|
|
756
|
-
<h6 id="returns-
|
|
757
|
-
<p><code>Promise</code><<code>FullMetadata</code>></p>
|
|
1740
|
+
<h6 id="returns-63">Returns</h6>
|
|
1741
|
+
<p><code>Promise</code><<a href="/docs/pyric-storage-reference-api/#fullmetadata"><code>FullMetadata</code></a>></p>
|
|
758
1742
|
<hr>
|
|
759
1743
|
<p><a id="remotetransport"></a></p>
|
|
760
1744
|
<h3 id="remotetransport">RemoteTransport</h3>
|
|
@@ -770,12 +1754,12 @@ event loop (a finished script exits); the core calls <code>ref()</code> when wor
|
|
|
770
1754
|
becomes outstanding (first pending op / live subscription) and
|
|
771
1755
|
<code>unref()</code> when the last one settles, so in-flight delivery keeps the
|
|
772
1756
|
process alive. Pure in-process transports (tests) may omit both.</p>
|
|
773
|
-
<h6 id="returns-
|
|
1757
|
+
<h6 id="returns-64">Returns</h6>
|
|
774
1758
|
<p><code>void</code></p>
|
|
775
1759
|
<p><a id="send"></a></p>
|
|
776
1760
|
<h5 id="send">send()</h5>
|
|
777
1761
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">send</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">msg</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">BridgeMessage</span><span style="color:#ABB2BF">): </span><span style="color:#C678DD">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
778
|
-
<h6 id="parameters-
|
|
1762
|
+
<h6 id="parameters-35">Parameters</h6>
|
|
779
1763
|
<div class="table-scroll">
|
|
780
1764
|
|
|
781
1765
|
|
|
@@ -789,19 +1773,19 @@ process alive. Pure in-process transports (tests) may omit both.</p>
|
|
|
789
1773
|
|
|
790
1774
|
|
|
791
1775
|
|
|
792
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>msg</code></td><td align="left"><code>BridgeMessage</code></td></tr></tbody></table></div>
|
|
793
|
-
<h6 id="returns-
|
|
1776
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>msg</code></td><td align="left"><a href="/docs/pyric-cli-bridge-client-reference-api/#bridgemessage"><code>BridgeMessage</code></a></td></tr></tbody></table></div>
|
|
1777
|
+
<h6 id="returns-65">Returns</h6>
|
|
794
1778
|
<p><code>void</code></p>
|
|
795
1779
|
<p><a id="unref"></a></p>
|
|
796
1780
|
<h5 id="unref">unref()?</h5>
|
|
797
1781
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E06C75">optional</span><span style="color:#61AFEF"> unref</span><span style="color:#ABB2BF">(): </span><span style="color:#C678DD">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
798
|
-
<h6 id="returns-
|
|
1782
|
+
<h6 id="returns-66">Returns</h6>
|
|
799
1783
|
<p><code>void</code></p>
|
|
800
1784
|
<h2 id="functions">Functions</h2>
|
|
801
1785
|
<p><a id="buildremoteauthadmin"></a></p>
|
|
802
1786
|
<h3 id="buildremoteauthadmin">buildRemoteAuthAdmin()</h3>
|
|
803
1787
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> buildRemoteAuthAdmin</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">channel</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">RemoteSandboxChannel</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">RemoteAuthAdmin</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
804
|
-
<h4 id="parameters-
|
|
1788
|
+
<h4 id="parameters-36">Parameters</h4>
|
|
805
1789
|
<div class="table-scroll">
|
|
806
1790
|
|
|
807
1791
|
|
|
@@ -816,13 +1800,13 @@ process alive. Pure in-process transports (tests) may omit both.</p>
|
|
|
816
1800
|
|
|
817
1801
|
|
|
818
1802
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>channel</code></td><td align="left"><a href="#remotesandboxchannel-1"><code>RemoteSandboxChannel</code></a></td></tr></tbody></table></div>
|
|
819
|
-
<h4 id="returns-
|
|
1803
|
+
<h4 id="returns-67">Returns</h4>
|
|
820
1804
|
<p><a href="#remoteauthadmin"><code>RemoteAuthAdmin</code></a></p>
|
|
821
1805
|
<hr>
|
|
822
1806
|
<p><a id="buildremotertdb"></a></p>
|
|
823
1807
|
<h3 id="buildremotertdb">buildRemoteRtdb()</h3>
|
|
824
1808
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> buildRemoteRtdb</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">channel</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">RemoteSandboxChannel</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">RemoteRtdb</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
825
|
-
<h4 id="parameters-
|
|
1809
|
+
<h4 id="parameters-37">Parameters</h4>
|
|
826
1810
|
<div class="table-scroll">
|
|
827
1811
|
|
|
828
1812
|
|
|
@@ -837,13 +1821,13 @@ process alive. Pure in-process transports (tests) may omit both.</p>
|
|
|
837
1821
|
|
|
838
1822
|
|
|
839
1823
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>channel</code></td><td align="left"><a href="#remotesandboxchannel-1"><code>RemoteSandboxChannel</code></a></td></tr></tbody></table></div>
|
|
840
|
-
<h4 id="returns-
|
|
1824
|
+
<h4 id="returns-68">Returns</h4>
|
|
841
1825
|
<p><a href="#remotertdb"><code>RemoteRtdb</code></a></p>
|
|
842
1826
|
<hr>
|
|
843
1827
|
<p><a id="buildremotestorage"></a></p>
|
|
844
1828
|
<h3 id="buildremotestorage">buildRemoteStorage()</h3>
|
|
845
1829
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> buildRemoteStorage</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">channel</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">RemoteSandboxChannel</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">RemoteStorage</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
846
|
-
<h4 id="parameters-
|
|
1830
|
+
<h4 id="parameters-38">Parameters</h4>
|
|
847
1831
|
<div class="table-scroll">
|
|
848
1832
|
|
|
849
1833
|
|
|
@@ -858,7 +1842,7 @@ process alive. Pure in-process transports (tests) may omit both.</p>
|
|
|
858
1842
|
|
|
859
1843
|
|
|
860
1844
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>channel</code></td><td align="left"><a href="#remotesandboxchannel-1"><code>RemoteSandboxChannel</code></a></td></tr></tbody></table></div>
|
|
861
|
-
<h4 id="returns-
|
|
1845
|
+
<h4 id="returns-69">Returns</h4>
|
|
862
1846
|
<p><a href="#remotestorage"><code>RemoteStorage</code></a></p>
|
|
863
1847
|
<hr>
|
|
864
1848
|
<p><a id="connectremotesandbox"></a></p>
|
|
@@ -869,7 +1853,7 @@ worker-relay CONSUMER (never a peer — attaching cannot kick the browser
|
|
|
869
1853
|
tab out of last-connection-wins), and return the typed remote handle.</p>
|
|
870
1854
|
<p>Fails fast when no serve is discoverable or no browser tab is connected —
|
|
871
1855
|
there is deliberately no headless fallback (see module doc).</p>
|
|
872
|
-
<h4 id="parameters-
|
|
1856
|
+
<h4 id="parameters-39">Parameters</h4>
|
|
873
1857
|
<div class="table-scroll">
|
|
874
1858
|
|
|
875
1859
|
|
|
@@ -884,7 +1868,7 @@ there is deliberately no headless fallback (see module doc).</p>
|
|
|
884
1868
|
|
|
885
1869
|
|
|
886
1870
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>options?</code></td><td align="left"><a href="#connectremotesandboxoptions"><code>ConnectRemoteSandboxOptions</code></a></td></tr></tbody></table></div>
|
|
887
|
-
<h4 id="returns-
|
|
1871
|
+
<h4 id="returns-70">Returns</h4>
|
|
888
1872
|
<p><code>Promise</code><<a href="#remotesandbox"><code>RemoteSandbox</code></a>></p>
|
|
889
1873
|
<hr>
|
|
890
1874
|
<p><a id="createlazyremotesandbox"></a></p>
|
|
@@ -894,7 +1878,7 @@ there is deliberately no headless fallback (see module doc).</p>
|
|
|
894
1878
|
<span class="line"><span style="color:#ABB2BF">}): </span><span style="color:#E5C07B">LazyRemoteSandbox</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
895
1879
|
<p>The lazy wrapper with the connect function injected — the test seam
|
|
896
1880
|
(tests inject a fake connect; production injects <code>connectRemoteSandbox</code>).</p>
|
|
897
|
-
<h4 id="parameters-
|
|
1881
|
+
<h4 id="parameters-40">Parameters</h4>
|
|
898
1882
|
<div class="table-scroll">
|
|
899
1883
|
|
|
900
1884
|
|
|
@@ -917,7 +1901,7 @@ there is deliberately no headless fallback (see module doc).</p>
|
|
|
917
1901
|
|
|
918
1902
|
|
|
919
1903
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>connect</code></td><td align="left">() => <code>Promise</code><<a href="#remotesandbox"><code>RemoteSandbox</code></a>></td></tr><tr><td align="left"><code>options?</code></td><td align="left">{ <code>url?</code>: <code>string</code>; }</td></tr><tr><td align="left"><code>options.url?</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
920
|
-
<h4 id="returns-
|
|
1904
|
+
<h4 id="returns-71">Returns</h4>
|
|
921
1905
|
<p><a href="#lazyremotesandbox"><code>LazyRemoteSandbox</code></a></p>
|
|
922
1906
|
<hr>
|
|
923
1907
|
<p><a id="createremotesandboxcore"></a></p>
|
|
@@ -930,7 +1914,7 @@ there is deliberately no headless fallback (see module doc).</p>
|
|
|
930
1914
|
(this leg’s id space; the bridge re-mints for the peer leg), pending ops
|
|
931
1915
|
carry a Node-side timeout above the bridge’s 30s, and <code>{ __error }</code> snap
|
|
932
1916
|
values are routed to the subscription’s error handler.</p>
|
|
933
|
-
<h4 id="parameters-
|
|
1917
|
+
<h4 id="parameters-41">Parameters</h4>
|
|
934
1918
|
<div class="table-scroll">
|
|
935
1919
|
|
|
936
1920
|
|
|
@@ -957,7 +1941,7 @@ values are routed to the subscription’s error handler.</p>
|
|
|
957
1941
|
|
|
958
1942
|
|
|
959
1943
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>transport</code></td><td align="left"><a href="#remotetransport"><code>RemoteTransport</code></a></td></tr><tr><td align="left"><code>opts</code></td><td align="left">{ <code>opTimeoutMs?</code>: <code>number</code>; <code>serveUrl</code>: <code>string</code>; }</td></tr><tr><td align="left"><code>opts.opTimeoutMs?</code></td><td align="left"><code>number</code></td></tr><tr><td align="left"><code>opts.serveUrl</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
960
|
-
<h4 id="returns-
|
|
1944
|
+
<h4 id="returns-72">Returns</h4>
|
|
961
1945
|
<p><a href="#remotesandboxcore"><code>RemoteSandboxCore</code></a></p>
|
|
962
1946
|
<hr>
|
|
963
1947
|
<p><a id="createremotesandboxhandle"></a></p>
|
|
@@ -983,7 +1967,7 @@ bounded backpressure lands, and no remote dispatch arm may depend on
|
|
|
983
1967
|
it — a throw (not a silent no-op) keeps a subscriber from believing
|
|
984
1968
|
it is observing events that will never arrive.</li>
|
|
985
1969
|
</ul>
|
|
986
|
-
<h4 id="parameters-
|
|
1970
|
+
<h4 id="parameters-42">Parameters</h4>
|
|
987
1971
|
<div class="table-scroll">
|
|
988
1972
|
|
|
989
1973
|
|
|
@@ -1010,7 +1994,7 @@ it is observing events that will never arrive.</li>
|
|
|
1010
1994
|
|
|
1011
1995
|
|
|
1012
1996
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>opts</code></td><td align="left">{ <code>channel</code>: <a href="#remotesandboxchannel-1"><code>RemoteSandboxChannel</code></a>; <code>close</code>: () => <code>void</code>; <code>serveUrl</code>: <code>string</code>; }</td></tr><tr><td align="left"><code>opts.channel</code></td><td align="left"><a href="#remotesandboxchannel-1"><code>RemoteSandboxChannel</code></a></td></tr><tr><td align="left"><code>opts.close</code></td><td align="left">() => <code>void</code></td></tr><tr><td align="left"><code>opts.serveUrl</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
1013
|
-
<h4 id="returns-
|
|
1997
|
+
<h4 id="returns-73">Returns</h4>
|
|
1014
1998
|
<p><a href="#remotesandbox"><code>RemoteSandbox</code></a></p>
|
|
1015
1999
|
<hr>
|
|
1016
2000
|
<p><a id="remotesandbox-1"></a></p>
|
|
@@ -1025,7 +2009,7 @@ The wire connection (discovery → WS attach) happens on the FIRST op (or
|
|
|
1025
2009
|
open <url>” — surfaces on first use instead of at construction. A failed
|
|
1026
2010
|
connect is NOT latched: the next op retries, matching the error’s own
|
|
1027
2011
|
“…and retry” guidance. <code>connectRemoteSandbox</code> (eager) is unchanged.</url></p>
|
|
1028
|
-
<h4 id="parameters-
|
|
2012
|
+
<h4 id="parameters-43">Parameters</h4>
|
|
1029
2013
|
<div class="table-scroll">
|
|
1030
2014
|
|
|
1031
2015
|
|
|
@@ -1040,5 +2024,5 @@ connect is NOT latched: the next op retries, matching the error’s own
|
|
|
1040
2024
|
|
|
1041
2025
|
|
|
1042
2026
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>options?</code></td><td align="left"><a href="#connectremotesandboxoptions"><code>ConnectRemoteSandboxOptions</code></a></td></tr></tbody></table></div>
|
|
1043
|
-
<h4 id="returns-
|
|
2027
|
+
<h4 id="returns-74">Returns</h4>
|
|
1044
2028
|
<p><a href="#lazyremotesandbox"><code>LazyRemoteSandbox</code></a></p> </article> </main> <aside class="doc-toc api-symbols" aria-label="API symbols"> <h2 class="doc-toc-heading">Symbols</h2> <input class="api-symbol-filter" type="search" placeholder="Filter symbols" aria-label="Filter API symbols" data-api-symbol-filter> <div class="api-symbol-groups" data-api-symbol-groups> <section class="api-symbol-group" data-api-symbol-group> <a class="api-symbol-kind" href="#interfaces"> Interfaces </a> <ul> <li data-api-symbol="connectremotesandboxoptions"> <a href="#connectremotesandboxoptions">ConnectRemoteSandboxOptions</a> </li><li data-api-symbol="lazyremotesandbox"> <a href="#lazyremotesandbox">LazyRemoteSandbox</a> </li><li data-api-symbol="remoteauthadmin"> <a href="#remoteauthadmin">RemoteAuthAdmin</a> </li><li data-api-symbol="remotertdb"> <a href="#remotertdb">RemoteRtdb</a> </li><li data-api-symbol="remotertdbsnapshot"> <a href="#remotertdbsnapshot">RemoteRtdbSnapshot</a> </li><li data-api-symbol="remotesandbox"> <a href="#remotesandbox">RemoteSandbox</a> </li><li data-api-symbol="remotesandboxchannel"> <a href="#remotesandboxchannel">RemoteSandboxChannel</a> </li><li data-api-symbol="remotesandboxcore"> <a href="#remotesandboxcore">RemoteSandboxCore</a> </li><li data-api-symbol="remotestorage"> <a href="#remotestorage">RemoteStorage</a> </li><li data-api-symbol="remotetransport"> <a href="#remotetransport">RemoteTransport</a> </li> </ul> </section><section class="api-symbol-group" data-api-symbol-group> <a class="api-symbol-kind" href="#functions"> Functions </a> <ul> <li data-api-symbol="buildremoteauthadmin()"> <a href="#buildremoteauthadmin">buildRemoteAuthAdmin()</a> </li><li data-api-symbol="buildremotertdb()"> <a href="#buildremotertdb">buildRemoteRtdb()</a> </li><li data-api-symbol="buildremotestorage()"> <a href="#buildremotestorage">buildRemoteStorage()</a> </li><li data-api-symbol="connectremotesandbox()"> <a href="#connectremotesandbox">connectRemoteSandbox()</a> </li><li data-api-symbol="createlazyremotesandbox()"> <a href="#createlazyremotesandbox">createLazyRemoteSandbox()</a> </li><li data-api-symbol="createremotesandboxcore()"> <a href="#createremotesandboxcore">createRemoteSandboxCore()</a> </li><li data-api-symbol="createremotesandboxhandle()"> <a href="#createremotesandboxhandle">createRemoteSandboxHandle()</a> </li><li data-api-symbol="remotesandbox()"> <a href="#remotesandbox-1">remoteSandbox()</a> </li> </ul> </section> <p class="api-symbol-empty" data-api-symbol-empty hidden>No matching symbols</p> </div> </aside> </div> <script type="module">const a=document.querySelector("[data-api-symbol-filter]"),d=[...document.querySelectorAll("[data-api-symbol-group]")],n=document.querySelector("[data-api-symbol-empty]");a?.addEventListener("input",()=>{const t=a.value.trim().toLowerCase();let o=0;for(const i of d){let e=0;i.querySelectorAll("[data-api-symbol]").forEach(l=>{const r=!t||(l.dataset.apiSymbol??"").includes(t);l.hidden=!r,r&&e++}),i.hidden=e===0,o+=e}n&&(n.hidden=o>0)});</script> <script type="module">const s=new Map;document.querySelectorAll('.doc-toc a[href^="#"]').forEach(t=>s.set(decodeURIComponent(t.hash.slice(1)),t));if(s.size>0){const t=new Set,n=()=>{let o=null;for(const e of s.keys())if(t.has(e)){o=e;break}s.forEach((e,c)=>e.classList.toggle("active",c===o))},r=new IntersectionObserver(o=>{for(const e of o)e.isIntersecting?t.add(e.target.id):t.delete(e.target.id);n()},{rootMargin:"-72px 0px -60% 0px"});s.forEach((o,e)=>{const c=document.getElementById(e);c&&r.observe(c)})}</script> <script type="module">document.querySelector('.studio__nav [aria-current="page"]')?.scrollIntoView({block:"nearest",inline:"center"});</script> </body> </html>
|