@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,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
<!-- Generated from published package declarations via TypeDoc. Do not edit by hand; run bun run docs:api:generate. -->
|
|
1
|
+
<!-- Generated from published package declarations via TypeDoc. Rendered by the api-reference content loader. -->
|
|
3
2
|
|
|
4
3
|
## Classes
|
|
5
4
|
|
|
@@ -177,13 +176,113 @@ isEqual(other: FieldPath): boolean;
|
|
|
177
176
|
|
|
178
177
|
***
|
|
179
178
|
|
|
179
|
+
<a id="fieldvalue"></a>
|
|
180
|
+
|
|
181
|
+
### FieldValue
|
|
182
|
+
|
|
183
|
+
#### Constructors
|
|
184
|
+
|
|
185
|
+
<a id="constructor-1"></a>
|
|
186
|
+
|
|
187
|
+
##### Constructor
|
|
188
|
+
|
|
189
|
+
```ts
|
|
190
|
+
new FieldValue(): FieldValue;
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
###### Returns
|
|
194
|
+
|
|
195
|
+
[`FieldValue`](#fieldvalue)
|
|
196
|
+
|
|
197
|
+
#### Methods
|
|
198
|
+
|
|
199
|
+
<a id="arrayremove"></a>
|
|
200
|
+
|
|
201
|
+
##### arrayRemove()
|
|
202
|
+
|
|
203
|
+
```ts
|
|
204
|
+
static arrayRemove(...values: unknown[]): FieldValueSentinel;
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
###### Parameters
|
|
208
|
+
|
|
209
|
+
| Parameter | Type |
|
|
210
|
+
| :------ | :------ |
|
|
211
|
+
| ...`values` | `unknown`[] |
|
|
212
|
+
|
|
213
|
+
###### Returns
|
|
214
|
+
|
|
215
|
+
[`FieldValueSentinel`](#fieldvaluesentinel)
|
|
216
|
+
|
|
217
|
+
<a id="arrayunion"></a>
|
|
218
|
+
|
|
219
|
+
##### arrayUnion()
|
|
220
|
+
|
|
221
|
+
```ts
|
|
222
|
+
static arrayUnion(...values: unknown[]): FieldValueSentinel;
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
###### Parameters
|
|
226
|
+
|
|
227
|
+
| Parameter | Type |
|
|
228
|
+
| :------ | :------ |
|
|
229
|
+
| ...`values` | `unknown`[] |
|
|
230
|
+
|
|
231
|
+
###### Returns
|
|
232
|
+
|
|
233
|
+
[`FieldValueSentinel`](#fieldvaluesentinel)
|
|
234
|
+
|
|
235
|
+
<a id="delete"></a>
|
|
236
|
+
|
|
237
|
+
##### delete()
|
|
238
|
+
|
|
239
|
+
```ts
|
|
240
|
+
static delete(): FieldValueSentinel;
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
###### Returns
|
|
244
|
+
|
|
245
|
+
[`FieldValueSentinel`](#fieldvaluesentinel)
|
|
246
|
+
|
|
247
|
+
<a id="increment"></a>
|
|
248
|
+
|
|
249
|
+
##### increment()
|
|
250
|
+
|
|
251
|
+
```ts
|
|
252
|
+
static increment(n: number): FieldValueSentinel;
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
###### Parameters
|
|
256
|
+
|
|
257
|
+
| Parameter | Type |
|
|
258
|
+
| :------ | :------ |
|
|
259
|
+
| `n` | `number` |
|
|
260
|
+
|
|
261
|
+
###### Returns
|
|
262
|
+
|
|
263
|
+
[`FieldValueSentinel`](#fieldvaluesentinel)
|
|
264
|
+
|
|
265
|
+
<a id="servertimestamp"></a>
|
|
266
|
+
|
|
267
|
+
##### serverTimestamp()
|
|
268
|
+
|
|
269
|
+
```ts
|
|
270
|
+
static serverTimestamp(): FieldValueSentinel;
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
###### Returns
|
|
274
|
+
|
|
275
|
+
[`FieldValueSentinel`](#fieldvaluesentinel)
|
|
276
|
+
|
|
277
|
+
***
|
|
278
|
+
|
|
180
279
|
<a id="geopoint"></a>
|
|
181
280
|
|
|
182
281
|
### GeoPoint
|
|
183
282
|
|
|
184
283
|
#### Constructors
|
|
185
284
|
|
|
186
|
-
<a id="constructor-
|
|
285
|
+
<a id="constructor-2"></a>
|
|
187
286
|
|
|
188
287
|
##### Constructor
|
|
189
288
|
|
|
@@ -312,193 +411,476 @@ static fromJSON(json: object): GeoPoint;
|
|
|
312
411
|
|
|
313
412
|
***
|
|
314
413
|
|
|
315
|
-
<a id="
|
|
414
|
+
<a id="sandboxerror"></a>
|
|
316
415
|
|
|
317
|
-
###
|
|
416
|
+
### SandboxError
|
|
318
417
|
|
|
319
|
-
|
|
418
|
+
Sandbox-layer error. Catch with `instanceof SandboxError` and switch
|
|
419
|
+
on `code`. `denialContext` is populated for `permission-denied` only
|
|
420
|
+
(and only after Slice 4 wires it through).
|
|
320
421
|
|
|
321
|
-
|
|
422
|
+
Two construction forms are supported:
|
|
423
|
+
- Positional: `new SandboxError(code, message, denialContext?)` —
|
|
424
|
+
the original signature, kept for backward compatibility with
|
|
425
|
+
existing internal call sites.
|
|
426
|
+
- Options bag: `new SandboxError({ code, message, remediation? })` —
|
|
427
|
+
used when attaching remediation guidance.
|
|
322
428
|
|
|
323
|
-
|
|
429
|
+
#### Extends
|
|
430
|
+
|
|
431
|
+
- `Error`
|
|
432
|
+
|
|
433
|
+
#### Constructors
|
|
434
|
+
|
|
435
|
+
<a id="constructor-3"></a>
|
|
436
|
+
|
|
437
|
+
##### Constructor
|
|
324
438
|
|
|
325
439
|
```ts
|
|
326
|
-
|
|
440
|
+
new SandboxError(
|
|
441
|
+
code: SandboxErrorCode,
|
|
442
|
+
message: string,
|
|
443
|
+
denialContext?: DenialContext): SandboxError;
|
|
327
444
|
```
|
|
328
445
|
|
|
329
446
|
###### Parameters
|
|
330
447
|
|
|
331
448
|
| Parameter | Type |
|
|
332
449
|
| :------ | :------ |
|
|
333
|
-
| `
|
|
450
|
+
| `code` | [`SandboxErrorCode`](pyric-sandbox-reference-api.md#sandboxerrorcode) |
|
|
451
|
+
| `message` | `string` |
|
|
452
|
+
| `denialContext?` | [`DenialContext`](pyric-sandbox-reference-api.md#denialcontext) |
|
|
334
453
|
|
|
335
454
|
###### Returns
|
|
336
455
|
|
|
337
|
-
`
|
|
456
|
+
[`SandboxError`](#sandboxerror)
|
|
338
457
|
|
|
339
|
-
|
|
458
|
+
###### Overrides
|
|
340
459
|
|
|
341
|
-
|
|
460
|
+
```ts
|
|
461
|
+
Error.constructor
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
##### Constructor
|
|
342
465
|
|
|
343
466
|
```ts
|
|
344
|
-
|
|
467
|
+
new SandboxError(options: SandboxErrorOptions): SandboxError;
|
|
345
468
|
```
|
|
346
469
|
|
|
347
|
-
######
|
|
470
|
+
###### Parameters
|
|
348
471
|
|
|
349
|
-
|
|
472
|
+
| Parameter | Type |
|
|
473
|
+
| :------ | :------ |
|
|
474
|
+
| `options` | `SandboxErrorOptions` |
|
|
350
475
|
|
|
351
|
-
|
|
476
|
+
###### Returns
|
|
352
477
|
|
|
353
|
-
|
|
478
|
+
[`SandboxError`](#sandboxerror)
|
|
479
|
+
|
|
480
|
+
###### Overrides
|
|
354
481
|
|
|
355
482
|
```ts
|
|
356
|
-
|
|
483
|
+
Error.constructor
|
|
357
484
|
```
|
|
358
485
|
|
|
359
|
-
|
|
486
|
+
#### Properties
|
|
360
487
|
|
|
361
|
-
|
|
488
|
+
| Property | Modifier | Type |
|
|
489
|
+
| :------ | :------ | :------ |
|
|
490
|
+
| <a id="code"></a> `code` | `readonly` | [`SandboxErrorCode`](pyric-sandbox-reference-api.md#sandboxerrorcode) |
|
|
491
|
+
| <a id="denialcontext"></a> `denialContext?` | `readonly` | [`DenialContext`](pyric-sandbox-reference-api.md#denialcontext) |
|
|
492
|
+
| <a id="remediation"></a> `remediation?` | `readonly` | `string` |
|
|
362
493
|
|
|
363
|
-
|
|
494
|
+
***
|
|
364
495
|
|
|
365
|
-
|
|
496
|
+
<a id="timestamp"></a>
|
|
497
|
+
|
|
498
|
+
### Timestamp
|
|
499
|
+
|
|
500
|
+
#### Constructors
|
|
501
|
+
|
|
502
|
+
<a id="constructor-4"></a>
|
|
503
|
+
|
|
504
|
+
##### Constructor
|
|
366
505
|
|
|
367
506
|
```ts
|
|
368
|
-
|
|
507
|
+
new Timestamp(seconds: number, nanoseconds: number): Timestamp;
|
|
369
508
|
```
|
|
370
509
|
|
|
371
510
|
###### Parameters
|
|
372
511
|
|
|
373
512
|
| Parameter | Type |
|
|
374
513
|
| :------ | :------ |
|
|
375
|
-
| `
|
|
514
|
+
| `seconds` | `number` |
|
|
515
|
+
| `nanoseconds` | `number` |
|
|
376
516
|
|
|
377
517
|
###### Returns
|
|
378
518
|
|
|
379
|
-
[`
|
|
519
|
+
[`Timestamp`](#timestamp)
|
|
380
520
|
|
|
381
|
-
|
|
521
|
+
#### Properties
|
|
382
522
|
|
|
383
|
-
|
|
523
|
+
| Property | Modifier | Type |
|
|
524
|
+
| :------ | :------ | :------ |
|
|
525
|
+
| <a id="nanoseconds"></a> `nanoseconds` | `readonly` | `number` |
|
|
526
|
+
| <a id="seconds"></a> `seconds` | `readonly` | `number` |
|
|
527
|
+
|
|
528
|
+
#### Methods
|
|
529
|
+
|
|
530
|
+
<a id="isequal-6"></a>
|
|
531
|
+
|
|
532
|
+
##### isEqual()
|
|
384
533
|
|
|
385
534
|
```ts
|
|
386
|
-
|
|
535
|
+
isEqual(other: Timestamp): boolean;
|
|
387
536
|
```
|
|
388
537
|
|
|
538
|
+
FS-B12 — value equality, mirroring `fb.Timestamp.isEqual`.
|
|
539
|
+
|
|
389
540
|
###### Parameters
|
|
390
541
|
|
|
391
542
|
| Parameter | Type |
|
|
392
543
|
| :------ | :------ |
|
|
393
|
-
| `
|
|
544
|
+
| `other` | [`Timestamp`](#timestamp) |
|
|
394
545
|
|
|
395
546
|
###### Returns
|
|
396
547
|
|
|
397
|
-
|
|
548
|
+
`boolean`
|
|
398
549
|
|
|
399
|
-
|
|
550
|
+
<a id="todate"></a>
|
|
400
551
|
|
|
401
|
-
|
|
552
|
+
##### toDate()
|
|
402
553
|
|
|
403
|
-
|
|
554
|
+
```ts
|
|
555
|
+
toDate(): Date;
|
|
556
|
+
```
|
|
404
557
|
|
|
405
|
-
|
|
406
|
-
`getAggregateFromServer`. `.data()` returns the computed numbers
|
|
407
|
-
keyed by the spec's aliases (or `{ count: number }` for the
|
|
408
|
-
count-only entry point).
|
|
558
|
+
###### Returns
|
|
409
559
|
|
|
410
|
-
|
|
560
|
+
`Date`
|
|
411
561
|
|
|
412
|
-
|
|
413
|
-
| :------ | :------ |
|
|
414
|
-
| `T` *extends* `Record`\<`string`, `number` \| `null`\> | `Record`\<`string`, `number` \| `null`\> |
|
|
562
|
+
<a id="tojson-4"></a>
|
|
415
563
|
|
|
416
|
-
|
|
564
|
+
##### toJSON()
|
|
417
565
|
|
|
418
|
-
|
|
566
|
+
```ts
|
|
567
|
+
toJSON(): {
|
|
568
|
+
nanoseconds: number;
|
|
569
|
+
seconds: number;
|
|
570
|
+
type: string;
|
|
571
|
+
};
|
|
572
|
+
```
|
|
419
573
|
|
|
420
|
-
|
|
574
|
+
FS-B12 — JSON form, mirroring `fb.Timestamp.toJSON`.
|
|
575
|
+
|
|
576
|
+
###### Returns
|
|
421
577
|
|
|
422
578
|
```ts
|
|
423
|
-
|
|
579
|
+
{
|
|
580
|
+
nanoseconds: number;
|
|
581
|
+
seconds: number;
|
|
582
|
+
type: string;
|
|
583
|
+
}
|
|
424
584
|
```
|
|
425
585
|
|
|
426
|
-
######
|
|
586
|
+
###### nanoseconds
|
|
427
587
|
|
|
428
|
-
|
|
588
|
+
```ts
|
|
589
|
+
nanoseconds: number;
|
|
590
|
+
```
|
|
429
591
|
|
|
430
|
-
|
|
592
|
+
###### seconds
|
|
431
593
|
|
|
432
|
-
|
|
594
|
+
```ts
|
|
595
|
+
seconds: number;
|
|
596
|
+
```
|
|
433
597
|
|
|
434
|
-
|
|
598
|
+
###### type
|
|
435
599
|
|
|
436
|
-
|
|
600
|
+
```ts
|
|
601
|
+
type: string;
|
|
602
|
+
```
|
|
437
603
|
|
|
438
|
-
|
|
604
|
+
<a id="tomillis"></a>
|
|
439
605
|
|
|
440
|
-
|
|
441
|
-
| :------ | :------ |
|
|
442
|
-
| `_T` | [`AuthState`](#authstate) |
|
|
606
|
+
##### toMillis()
|
|
443
607
|
|
|
444
|
-
|
|
608
|
+
```ts
|
|
609
|
+
toMillis(): number;
|
|
610
|
+
```
|
|
445
611
|
|
|
446
|
-
|
|
447
|
-
| :------ | :------ | :------ |
|
|
448
|
-
| <a id="id"></a> `id` | `readonly` | `string` |
|
|
449
|
-
| <a id="path"></a> `path` | `readonly` | `string` |
|
|
612
|
+
###### Returns
|
|
450
613
|
|
|
451
|
-
|
|
614
|
+
`number`
|
|
452
615
|
|
|
453
|
-
<a id="
|
|
616
|
+
<a id="tostring-2"></a>
|
|
454
617
|
|
|
455
|
-
|
|
618
|
+
##### toString()
|
|
456
619
|
|
|
457
|
-
|
|
620
|
+
```ts
|
|
621
|
+
toString(): string;
|
|
622
|
+
```
|
|
458
623
|
|
|
459
|
-
|
|
624
|
+
FS-B12 — textual form, mirroring `fb.Timestamp.toString`.
|
|
460
625
|
|
|
461
|
-
|
|
462
|
-
| :------ | :------ |
|
|
463
|
-
| `_T` | [`AuthState`](#authstate) |
|
|
626
|
+
###### Returns
|
|
464
627
|
|
|
465
|
-
|
|
628
|
+
`string`
|
|
466
629
|
|
|
467
|
-
|
|
468
|
-
| :------ | :------ | :------ |
|
|
469
|
-
| <a id="id-1"></a> `id` | `readonly` | `string` |
|
|
470
|
-
| <a id="path-1"></a> `path` | `readonly` | `string` |
|
|
630
|
+
<a id="valueof"></a>
|
|
471
631
|
|
|
472
|
-
|
|
632
|
+
##### valueOf()
|
|
473
633
|
|
|
474
|
-
|
|
634
|
+
```ts
|
|
635
|
+
valueOf(): string;
|
|
636
|
+
```
|
|
475
637
|
|
|
476
|
-
|
|
638
|
+
FS-B12 — primitive coercion for `<`/`<=`/`>=`/`>` comparisons, mirroring
|
|
639
|
+
`fb.Timestamp.valueOf`: a zero-padded `<seconds>.<nanoseconds>` string
|
|
640
|
+
(seconds offset by MIN_SECONDS so it stays non-negative and lexically
|
|
641
|
+
ordered).
|
|
477
642
|
|
|
478
|
-
|
|
643
|
+
###### Returns
|
|
479
644
|
|
|
480
|
-
|
|
645
|
+
`string`
|
|
481
646
|
|
|
482
|
-
|
|
647
|
+
<a id="fromdate"></a>
|
|
483
648
|
|
|
484
|
-
|
|
649
|
+
##### fromDate()
|
|
485
650
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
651
|
+
```ts
|
|
652
|
+
static fromDate(d: Date): Timestamp;
|
|
653
|
+
```
|
|
489
654
|
|
|
490
|
-
|
|
655
|
+
###### Parameters
|
|
491
656
|
|
|
492
|
-
|
|
|
493
|
-
| :------ | :------ |
|
|
494
|
-
|
|
|
495
|
-
| <a id="id-2"></a> `id` | `readonly` | `string` |
|
|
657
|
+
| Parameter | Type |
|
|
658
|
+
| :------ | :------ |
|
|
659
|
+
| `d` | `Date` |
|
|
496
660
|
|
|
497
|
-
|
|
661
|
+
###### Returns
|
|
498
662
|
|
|
499
|
-
|
|
663
|
+
[`Timestamp`](#timestamp)
|
|
500
664
|
|
|
501
|
-
|
|
665
|
+
<a id="frommillis"></a>
|
|
666
|
+
|
|
667
|
+
##### fromMillis()
|
|
668
|
+
|
|
669
|
+
```ts
|
|
670
|
+
static fromMillis(ms: number): Timestamp;
|
|
671
|
+
```
|
|
672
|
+
|
|
673
|
+
###### Parameters
|
|
674
|
+
|
|
675
|
+
| Parameter | Type |
|
|
676
|
+
| :------ | :------ |
|
|
677
|
+
| `ms` | `number` |
|
|
678
|
+
|
|
679
|
+
###### Returns
|
|
680
|
+
|
|
681
|
+
[`Timestamp`](#timestamp)
|
|
682
|
+
|
|
683
|
+
<a id="now"></a>
|
|
684
|
+
|
|
685
|
+
##### now()
|
|
686
|
+
|
|
687
|
+
```ts
|
|
688
|
+
static now(): Timestamp;
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
###### Returns
|
|
692
|
+
|
|
693
|
+
[`Timestamp`](#timestamp)
|
|
694
|
+
|
|
695
|
+
***
|
|
696
|
+
|
|
697
|
+
<a id="vectorvalue"></a>
|
|
698
|
+
|
|
699
|
+
### VectorValue
|
|
700
|
+
|
|
701
|
+
#### Methods
|
|
702
|
+
|
|
703
|
+
<a id="isequal-8"></a>
|
|
704
|
+
|
|
705
|
+
##### isEqual()
|
|
706
|
+
|
|
707
|
+
```ts
|
|
708
|
+
isEqual(other: VectorValue): boolean;
|
|
709
|
+
```
|
|
710
|
+
|
|
711
|
+
###### Parameters
|
|
712
|
+
|
|
713
|
+
| Parameter | Type |
|
|
714
|
+
| :------ | :------ |
|
|
715
|
+
| `other` | [`VectorValue`](#vectorvalue) |
|
|
716
|
+
|
|
717
|
+
###### Returns
|
|
718
|
+
|
|
719
|
+
`boolean`
|
|
720
|
+
|
|
721
|
+
<a id="toarray"></a>
|
|
722
|
+
|
|
723
|
+
##### toArray()
|
|
724
|
+
|
|
725
|
+
```ts
|
|
726
|
+
toArray(): number[];
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
###### Returns
|
|
730
|
+
|
|
731
|
+
`number`[]
|
|
732
|
+
|
|
733
|
+
<a id="tojson-6"></a>
|
|
734
|
+
|
|
735
|
+
##### toJSON()
|
|
736
|
+
|
|
737
|
+
```ts
|
|
738
|
+
toJSON(): object;
|
|
739
|
+
```
|
|
740
|
+
|
|
741
|
+
###### Returns
|
|
742
|
+
|
|
743
|
+
`object`
|
|
744
|
+
|
|
745
|
+
<a id="create"></a>
|
|
746
|
+
|
|
747
|
+
##### create()
|
|
748
|
+
|
|
749
|
+
```ts
|
|
750
|
+
static create(values: number[]): VectorValue;
|
|
751
|
+
```
|
|
752
|
+
|
|
753
|
+
###### Parameters
|
|
754
|
+
|
|
755
|
+
| Parameter | Type |
|
|
756
|
+
| :------ | :------ |
|
|
757
|
+
| `values` | `number`[] |
|
|
758
|
+
|
|
759
|
+
###### Returns
|
|
760
|
+
|
|
761
|
+
[`VectorValue`](#vectorvalue)
|
|
762
|
+
|
|
763
|
+
<a id="fromjson-4"></a>
|
|
764
|
+
|
|
765
|
+
##### fromJSON()
|
|
766
|
+
|
|
767
|
+
```ts
|
|
768
|
+
static fromJSON(json: object): VectorValue;
|
|
769
|
+
```
|
|
770
|
+
|
|
771
|
+
###### Parameters
|
|
772
|
+
|
|
773
|
+
| Parameter | Type |
|
|
774
|
+
| :------ | :------ |
|
|
775
|
+
| `json` | `object` |
|
|
776
|
+
|
|
777
|
+
###### Returns
|
|
778
|
+
|
|
779
|
+
[`VectorValue`](#vectorvalue)
|
|
780
|
+
|
|
781
|
+
## Interfaces
|
|
782
|
+
|
|
783
|
+
<a id="aggregatequerysnapshot"></a>
|
|
784
|
+
|
|
785
|
+
### AggregateQuerySnapshot
|
|
786
|
+
|
|
787
|
+
Snapshot returned by `getCountFromServer` /
|
|
788
|
+
`getAggregateFromServer`. `.data()` returns the computed numbers
|
|
789
|
+
keyed by the spec's aliases (or `{ count: number }` for the
|
|
790
|
+
count-only entry point).
|
|
791
|
+
|
|
792
|
+
#### Type Parameters
|
|
793
|
+
|
|
794
|
+
| Type Parameter | Default type |
|
|
795
|
+
| :------ | :------ |
|
|
796
|
+
| `T` *extends* `Record`\<`string`, `number` \| `null`\> | `Record`\<`string`, `number` \| `null`\> |
|
|
797
|
+
|
|
798
|
+
#### Methods
|
|
799
|
+
|
|
800
|
+
<a id="data"></a>
|
|
801
|
+
|
|
802
|
+
##### data()
|
|
803
|
+
|
|
804
|
+
```ts
|
|
805
|
+
data(): T;
|
|
806
|
+
```
|
|
807
|
+
|
|
808
|
+
###### Returns
|
|
809
|
+
|
|
810
|
+
`T`
|
|
811
|
+
|
|
812
|
+
***
|
|
813
|
+
|
|
814
|
+
<a id="collectionreference"></a>
|
|
815
|
+
|
|
816
|
+
### CollectionReference
|
|
817
|
+
|
|
818
|
+
A reference to a Firestore collection. Backend-opaque.
|
|
819
|
+
|
|
820
|
+
#### Type Parameters
|
|
821
|
+
|
|
822
|
+
| Type Parameter | Default type |
|
|
823
|
+
| :------ | :------ |
|
|
824
|
+
| `_T` | [`DocumentData`](#documentdata) |
|
|
825
|
+
|
|
826
|
+
#### Properties
|
|
827
|
+
|
|
828
|
+
| Property | Modifier | Type |
|
|
829
|
+
| :------ | :------ | :------ |
|
|
830
|
+
| <a id="id"></a> `id` | `readonly` | `string` |
|
|
831
|
+
| <a id="path"></a> `path` | `readonly` | `string` |
|
|
832
|
+
|
|
833
|
+
***
|
|
834
|
+
|
|
835
|
+
<a id="documentreference"></a>
|
|
836
|
+
|
|
837
|
+
### DocumentReference
|
|
838
|
+
|
|
839
|
+
A reference to a Firestore document. Backend-opaque.
|
|
840
|
+
|
|
841
|
+
#### Type Parameters
|
|
842
|
+
|
|
843
|
+
| Type Parameter | Default type |
|
|
844
|
+
| :------ | :------ |
|
|
845
|
+
| `_T` | [`DocumentData`](#documentdata) |
|
|
846
|
+
|
|
847
|
+
#### Properties
|
|
848
|
+
|
|
849
|
+
| Property | Modifier | Type |
|
|
850
|
+
| :------ | :------ | :------ |
|
|
851
|
+
| <a id="id-1"></a> `id` | `readonly` | `string` |
|
|
852
|
+
| <a id="path-1"></a> `path` | `readonly` | `string` |
|
|
853
|
+
|
|
854
|
+
***
|
|
855
|
+
|
|
856
|
+
<a id="documentsnapshot"></a>
|
|
857
|
+
|
|
858
|
+
### DocumentSnapshot
|
|
859
|
+
|
|
860
|
+
A point-in-time view of one document.
|
|
861
|
+
|
|
862
|
+
#### Extended by
|
|
863
|
+
|
|
864
|
+
- [`QueryDocumentSnapshot`](#querydocumentsnapshot)
|
|
865
|
+
|
|
866
|
+
#### Type Parameters
|
|
867
|
+
|
|
868
|
+
| Type Parameter | Default type |
|
|
869
|
+
| :------ | :------ |
|
|
870
|
+
| `T` | [`DocumentData`](#documentdata) |
|
|
871
|
+
|
|
872
|
+
#### Properties
|
|
873
|
+
|
|
874
|
+
| Property | Modifier | Type |
|
|
875
|
+
| :------ | :------ | :------ |
|
|
876
|
+
| <a id="exists"></a> `exists` | `readonly` | `boolean` \| () => `boolean` |
|
|
877
|
+
| <a id="id-2"></a> `id` | `readonly` | `string` |
|
|
878
|
+
|
|
879
|
+
#### Methods
|
|
880
|
+
|
|
881
|
+
<a id="data-2"></a>
|
|
882
|
+
|
|
883
|
+
##### data()
|
|
502
884
|
|
|
503
885
|
```ts
|
|
504
886
|
data(): T;
|
|
@@ -521,7 +903,7 @@ Opaque sandbox handle carrying its owner via [TARGET\_SYMBOL](#target_symbol-1).
|
|
|
521
903
|
| Property | Modifier | Type |
|
|
522
904
|
| :------ | :------ | :------ |
|
|
523
905
|
| <a id="target_symbol"></a> `[TARGET_SYMBOL]` | `readonly` | `Target` |
|
|
524
|
-
| <a id="app"></a> `app?` | `readonly` | `FirebaseApp` |
|
|
906
|
+
| <a id="app"></a> `app?` | `readonly` | [`FirebaseApp`](pyric-app-reference-api.md#firebaseapp) |
|
|
525
907
|
|
|
526
908
|
***
|
|
527
909
|
|
|
@@ -544,7 +926,7 @@ underlying Firestore representation. Mirrors `firebase/firestore`'s
|
|
|
544
926
|
| Type Parameter | Default type |
|
|
545
927
|
| :------ | :------ |
|
|
546
928
|
| `AppModelType` | - |
|
|
547
|
-
| `DbModelType` *extends* [`
|
|
929
|
+
| `DbModelType` *extends* [`DocumentData`](#documentdata) | [`DocumentData`](#documentdata) |
|
|
548
930
|
|
|
549
931
|
#### Methods
|
|
550
932
|
|
|
@@ -632,14 +1014,17 @@ confirm-gate admin writes (see the bridge's prod confirm-policy).
|
|
|
632
1014
|
##### resolveSandbox()
|
|
633
1015
|
|
|
634
1016
|
```ts
|
|
635
|
-
resolveSandbox():
|
|
1017
|
+
resolveSandbox():
|
|
1018
|
+
| LocalSandbox
|
|
1019
|
+
| Promise<LocalSandbox>;
|
|
636
1020
|
```
|
|
637
1021
|
|
|
638
1022
|
Resolve the sandbox whose Firestore state should be inspected.
|
|
639
1023
|
|
|
640
1024
|
###### Returns
|
|
641
1025
|
|
|
642
|
-
`
|
|
1026
|
+
\| [`LocalSandbox`](pyric-sandbox-reference-api.md#localsandbox)
|
|
1027
|
+
\| `Promise`\<[`LocalSandbox`](pyric-sandbox-reference-api.md#localsandbox)\>
|
|
643
1028
|
|
|
644
1029
|
***
|
|
645
1030
|
|
|
@@ -664,6 +1049,20 @@ Client-cache/network settings `initializeFirestore` accepts but no-ops
|
|
|
664
1049
|
|
|
665
1050
|
***
|
|
666
1051
|
|
|
1052
|
+
<a id="lintresult"></a>
|
|
1053
|
+
|
|
1054
|
+
### LintResult
|
|
1055
|
+
|
|
1056
|
+
#### Properties
|
|
1057
|
+
|
|
1058
|
+
| Property | Type | Description |
|
|
1059
|
+
| :------ | :------ | :------ |
|
|
1060
|
+
| <a id="metrics"></a> `metrics` | [`RulesMetrics`](pyric-admin-firestore-reference-api.md#rulesmetrics) | - |
|
|
1061
|
+
| <a id="parseerror"></a> `parseError?` | `ParseError` | Structured parse failure when the source did not parse. When defined, `metrics` (except `sourceSize`) and `warnings` carry no signal — budget checks were skipped. Callers should branch on `parseError` before interpreting warnings or metrics. Why this isn't a new `severity` value: a parse failure means "this isn't a rule yet" rather than "this rule will fail at runtime", which is a categorically different question from anything `warnings` answers. Adding a new severity would force every consumer to handle a third branch they don't care about; a separate field lets old code keep working and gives new code a clean signal to check. |
|
|
1062
|
+
| <a id="warnings"></a> `warnings` | [`LintWarning`](pyric-admin-firestore-reference-api.md#lintwarning)[] | - |
|
|
1063
|
+
|
|
1064
|
+
***
|
|
1065
|
+
|
|
667
1066
|
<a id="localcache-1"></a>
|
|
668
1067
|
|
|
669
1068
|
### LocalCache
|
|
@@ -679,157 +1078,743 @@ Opaque local-cache config token accepted by [initializeFirestore](#initializefir
|
|
|
679
1078
|
| <a id="garbagecollector"></a> `garbageCollector?` | `readonly` | [`MemoryGarbageCollector`](#memorygarbagecollector) |
|
|
680
1079
|
| <a id="tabmanager"></a> `tabManager?` | `readonly` | [`PersistentTabManager`](#persistenttabmanager) |
|
|
681
1080
|
|
|
682
|
-
***
|
|
1081
|
+
***
|
|
1082
|
+
|
|
1083
|
+
<a id="memorygarbagecollector"></a>
|
|
1084
|
+
|
|
1085
|
+
### MemoryGarbageCollector
|
|
1086
|
+
|
|
1087
|
+
Opaque garbage-collector config token. Inert for the same reason —
|
|
1088
|
+
there is no memory cache tier with GC pressure to tune.
|
|
1089
|
+
|
|
1090
|
+
#### Properties
|
|
1091
|
+
|
|
1092
|
+
| Property | Modifier | Type |
|
|
1093
|
+
| :------ | :------ | :------ |
|
|
1094
|
+
| <a id="gc_symbol"></a> `[GC_SYMBOL]` | `readonly` | `"eager"` \| `"lru"` |
|
|
1095
|
+
|
|
1096
|
+
***
|
|
1097
|
+
|
|
1098
|
+
<a id="persistencesettings"></a>
|
|
1099
|
+
|
|
1100
|
+
### PersistenceSettings
|
|
1101
|
+
|
|
1102
|
+
#### Properties
|
|
1103
|
+
|
|
1104
|
+
| Property | Type |
|
|
1105
|
+
| :------ | :------ |
|
|
1106
|
+
| <a id="forceownership"></a> `forceOwnership?` | `boolean` |
|
|
1107
|
+
|
|
1108
|
+
***
|
|
1109
|
+
|
|
1110
|
+
<a id="persistenttabmanager"></a>
|
|
1111
|
+
|
|
1112
|
+
### PersistentTabManager
|
|
1113
|
+
|
|
1114
|
+
Opaque tab-manager config token. Inert — persistence is always on,
|
|
1115
|
+
and the SharedWorker/`pyric dev` path already is the one shared
|
|
1116
|
+
store every tab talks to, so there is no separate multi-tab mode
|
|
1117
|
+
to opt into. Carries the requested kind only for debugging.
|
|
1118
|
+
|
|
1119
|
+
#### Properties
|
|
1120
|
+
|
|
1121
|
+
| Property | Modifier | Type |
|
|
1122
|
+
| :------ | :------ | :------ |
|
|
1123
|
+
| <a id="tab_manager_symbol"></a> `[TAB_MANAGER_SYMBOL]` | `readonly` | `"single"` \| `"multiple"` |
|
|
1124
|
+
|
|
1125
|
+
***
|
|
1126
|
+
|
|
1127
|
+
<a id="query"></a>
|
|
1128
|
+
|
|
1129
|
+
### Query
|
|
1130
|
+
|
|
1131
|
+
A Firestore query (a collection ref or one with where/orderBy/limit applied).
|
|
1132
|
+
|
|
1133
|
+
#### Type Parameters
|
|
1134
|
+
|
|
1135
|
+
| Type Parameter | Default type |
|
|
1136
|
+
| :------ | :------ |
|
|
1137
|
+
| `_T` | [`DocumentData`](#documentdata) |
|
|
1138
|
+
|
|
1139
|
+
***
|
|
1140
|
+
|
|
1141
|
+
<a id="queryconstraint"></a>
|
|
1142
|
+
|
|
1143
|
+
### QueryConstraint
|
|
1144
|
+
|
|
1145
|
+
#### Methods
|
|
1146
|
+
|
|
1147
|
+
<a id="applysandbox"></a>
|
|
1148
|
+
|
|
1149
|
+
##### applySandbox()
|
|
1150
|
+
|
|
1151
|
+
```ts
|
|
1152
|
+
applySandbox(q: Query): Query;
|
|
1153
|
+
```
|
|
1154
|
+
|
|
1155
|
+
###### Parameters
|
|
1156
|
+
|
|
1157
|
+
| Parameter | Type |
|
|
1158
|
+
| :------ | :------ |
|
|
1159
|
+
| `q` | [`Query`](pyric-admin-firestore-reference-api.md#query) |
|
|
1160
|
+
|
|
1161
|
+
###### Returns
|
|
1162
|
+
|
|
1163
|
+
[`Query`](pyric-admin-firestore-reference-api.md#query)
|
|
1164
|
+
|
|
1165
|
+
***
|
|
1166
|
+
|
|
1167
|
+
<a id="querydocumentsnapshot"></a>
|
|
1168
|
+
|
|
1169
|
+
### QueryDocumentSnapshot
|
|
1170
|
+
|
|
1171
|
+
`QueryDocumentSnapshot` is a `DocumentSnapshot` known to exist —
|
|
1172
|
+
`.data()` always returns the typed model, never `undefined`. Yielded
|
|
1173
|
+
by `QuerySnapshot.docs` and passed to converter `fromFirestore`
|
|
1174
|
+
callbacks. Mirrors the JS SDK's narrowing.
|
|
1175
|
+
|
|
1176
|
+
#### Extends
|
|
1177
|
+
|
|
1178
|
+
- [`DocumentSnapshot`](#documentsnapshot)\<`T`\>
|
|
1179
|
+
|
|
1180
|
+
#### Type Parameters
|
|
1181
|
+
|
|
1182
|
+
| Type Parameter | Default type |
|
|
1183
|
+
| :------ | :------ |
|
|
1184
|
+
| `T` | [`DocumentData`](#documentdata) |
|
|
1185
|
+
|
|
1186
|
+
#### Properties
|
|
1187
|
+
|
|
1188
|
+
| Property | Modifier | Type |
|
|
1189
|
+
| :------ | :------ | :------ |
|
|
1190
|
+
| <a id="exists-1"></a> `exists` | `readonly` | `boolean` \| () => `boolean` |
|
|
1191
|
+
| <a id="id-3"></a> `id` | `readonly` | `string` |
|
|
1192
|
+
|
|
1193
|
+
#### Methods
|
|
1194
|
+
|
|
1195
|
+
<a id="data-4"></a>
|
|
1196
|
+
|
|
1197
|
+
##### data()
|
|
1198
|
+
|
|
1199
|
+
```ts
|
|
1200
|
+
data(): T;
|
|
1201
|
+
```
|
|
1202
|
+
|
|
1203
|
+
###### Returns
|
|
1204
|
+
|
|
1205
|
+
`T`
|
|
1206
|
+
|
|
1207
|
+
###### Overrides
|
|
1208
|
+
|
|
1209
|
+
[`DocumentSnapshot`](#documentsnapshot).[`data`](#data-2)
|
|
1210
|
+
|
|
1211
|
+
***
|
|
1212
|
+
|
|
1213
|
+
<a id="querysnapshot"></a>
|
|
1214
|
+
|
|
1215
|
+
### QuerySnapshot
|
|
1216
|
+
|
|
1217
|
+
A point-in-time view of a query result.
|
|
1218
|
+
|
|
1219
|
+
#### Type Parameters
|
|
1220
|
+
|
|
1221
|
+
| Type Parameter | Default type |
|
|
1222
|
+
| :------ | :------ |
|
|
1223
|
+
| `T` | [`DocumentData`](#documentdata) |
|
|
1224
|
+
|
|
1225
|
+
#### Properties
|
|
1226
|
+
|
|
1227
|
+
| Property | Modifier | Type |
|
|
1228
|
+
| :------ | :------ | :------ |
|
|
1229
|
+
| <a id="docs"></a> `docs` | `readonly` | readonly [`QueryDocumentSnapshot`](#querydocumentsnapshot)\<`T`\>[] |
|
|
1230
|
+
| <a id="empty"></a> `empty` | `readonly` | `boolean` |
|
|
1231
|
+
| <a id="size"></a> `size` | `readonly` | `number` |
|
|
1232
|
+
|
|
1233
|
+
***
|
|
1234
|
+
|
|
1235
|
+
<a id="sandbox"></a>
|
|
1236
|
+
|
|
1237
|
+
### Sandbox
|
|
1238
|
+
|
|
1239
|
+
A Firebase sandbox — an isolated environment with one auth identity.
|
|
1240
|
+
|
|
1241
|
+
Created via `initializeSandbox(config)`. Use `fork({ auth })` to
|
|
1242
|
+
derive a new sandbox with a different identity that shares the
|
|
1243
|
+
underlying environment (rules, data, state). Fork is the only
|
|
1244
|
+
identity-switching mechanism — there are no per-op auth overrides
|
|
1245
|
+
and no in-place mutation.
|
|
1246
|
+
|
|
1247
|
+
#### Extended by
|
|
1248
|
+
|
|
1249
|
+
- [`LocalSandbox`](pyric-sandbox-reference-api.md#localsandbox)
|
|
1250
|
+
- [`RemoteSandbox`](pyric-sandbox-reference-api.md#remotesandbox)
|
|
1251
|
+
|
|
1252
|
+
#### Properties
|
|
1253
|
+
|
|
1254
|
+
| Property | Modifier | Type | Description |
|
|
1255
|
+
| :------ | :------ | :------ | :------ |
|
|
1256
|
+
| <a id="admin"></a> `admin` | `readonly` | `SandboxAdmin` | 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. |
|
|
1257
|
+
| <a id="currentuser"></a> `currentUser` | `public` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | Current authenticated user across the sandbox. Mutated by `pyric/auth`'s `signInAnonymously` / `signInWithEmailAndPassword` / `signOut` / `sandbox.setUser`. Read per-call by service factories (e.g. a future `getFirestore(sandbox)` overload) so they see auth state changes without re-binding handles. Defaults to `null` (anonymous / signed out). **Independent of `withAuth({uid})`** — `withAuth` still produces a frozen [SandboxContext](#sandboxcontext) that carries its own identity for the runner's test code (the existing pattern: explicit identity per service call). `currentUser` exists for the `pyric/auth` mirror, where consumer app code drives identity through a stateful `Auth` handle rather than naming it per call. |
|
|
1258
|
+
| `currentUser.token?` | `public` | `Record`\<`string`, `unknown`\> | - |
|
|
1259
|
+
| `currentUser.uid` | `public` | `string` | - |
|
|
1260
|
+
|
|
1261
|
+
#### Methods
|
|
1262
|
+
|
|
1263
|
+
<a id="clearpersistence"></a>
|
|
1264
|
+
|
|
1265
|
+
##### clearPersistence()
|
|
1266
|
+
|
|
1267
|
+
```ts
|
|
1268
|
+
clearPersistence(): Promise<void>;
|
|
1269
|
+
```
|
|
1270
|
+
|
|
1271
|
+
Wipe the persisted blob for this sandbox's `key`. In-memory state
|
|
1272
|
+
is left intact — call `reset()` if you want both. Useful for
|
|
1273
|
+
"sign out and forget" flows.
|
|
1274
|
+
|
|
1275
|
+
No-op when persistence is not enabled.
|
|
1276
|
+
|
|
1277
|
+
###### Returns
|
|
1278
|
+
|
|
1279
|
+
`Promise`\<`void`\>
|
|
1280
|
+
|
|
1281
|
+
<a id="dispose"></a>
|
|
1282
|
+
|
|
1283
|
+
##### dispose()
|
|
1284
|
+
|
|
1285
|
+
```ts
|
|
1286
|
+
dispose(): void;
|
|
1287
|
+
```
|
|
1288
|
+
|
|
1289
|
+
Tear down listener registries on this sandbox's environment without
|
|
1290
|
+
replacing it. Use this when you're about to discard the sandbox
|
|
1291
|
+
itself (e.g. `runner.reseed()` builds a fresh sandbox rather than
|
|
1292
|
+
calling `reset()`) and want to drop callback references on the
|
|
1293
|
+
outgoing instance defensively. Idempotent. Does not touch data.
|
|
1294
|
+
|
|
1295
|
+
###### Returns
|
|
1296
|
+
|
|
1297
|
+
`void`
|
|
1298
|
+
|
|
1299
|
+
<a id="enablepersistence"></a>
|
|
1300
|
+
|
|
1301
|
+
##### enablePersistence()
|
|
1302
|
+
|
|
1303
|
+
```ts
|
|
1304
|
+
enablePersistence(options: SandboxPersistenceOptions): Promise<void>;
|
|
1305
|
+
```
|
|
1306
|
+
|
|
1307
|
+
Persist the sandbox's data to a backend and restore it on next
|
|
1308
|
+
`enablePersistence` call. The default `'indexedDB'` backend turns
|
|
1309
|
+
the sandbox into the host page's local Firestore — writes flush
|
|
1310
|
+
automatically and a fresh `initializeSandbox()` rehydrates from
|
|
1311
|
+
the prior session.
|
|
1312
|
+
|
|
1313
|
+
Restoration happens before the promise resolves; awaiting this
|
|
1314
|
+
call is sufficient to guarantee in-memory state matches the
|
|
1315
|
+
persisted blob.
|
|
1316
|
+
|
|
1317
|
+
Idempotent across the same `key` — calling twice in one process
|
|
1318
|
+
is a no-op on the second call. Different keys are rejected as an
|
|
1319
|
+
error (a sandbox can persist to at most one backend at a time).
|
|
1320
|
+
|
|
1321
|
+
Listener semantics: every write event the sandbox emits triggers
|
|
1322
|
+
a debounced flush (default 250ms). Browser hosts additionally
|
|
1323
|
+
flush on `beforeunload` so a page navigation doesn't lose the
|
|
1324
|
+
tail of the debounce window.
|
|
1325
|
+
|
|
1326
|
+
See [SandboxPersistenceOptions](pyric-sandbox-reference-api.md#sandboxpersistenceoptions) for backend selection and
|
|
1327
|
+
tuning.
|
|
1328
|
+
|
|
1329
|
+
###### Parameters
|
|
1330
|
+
|
|
1331
|
+
| Parameter | Type |
|
|
1332
|
+
| :------ | :------ |
|
|
1333
|
+
| `options` | [`SandboxPersistenceOptions`](pyric-sandbox-reference-api.md#sandboxpersistenceoptions) |
|
|
1334
|
+
|
|
1335
|
+
###### Returns
|
|
1336
|
+
|
|
1337
|
+
`Promise`\<`void`\>
|
|
1338
|
+
|
|
1339
|
+
<a id="enabletabsync"></a>
|
|
1340
|
+
|
|
1341
|
+
##### enableTabSync()
|
|
1342
|
+
|
|
1343
|
+
```ts
|
|
1344
|
+
enableTabSync(options?: TabSyncOptions): () => void;
|
|
1345
|
+
```
|
|
1346
|
+
|
|
1347
|
+
Enable cross-tab realtime sync via `BroadcastChannel`. A write in
|
|
1348
|
+
this tab will propagate to every OTHER tab of the same origin that
|
|
1349
|
+
also called `enableTabSync`, causing their `onSnapshot` listeners to
|
|
1350
|
+
re-evaluate — restoring production's cross-client realtime behavior.
|
|
1351
|
+
|
|
1352
|
+
**Opt-in, OFF by default.** Firestore only (RTDB is a follow-on).
|
|
1353
|
+
|
|
1354
|
+
Returns a disable function. Calling it removes the `onEvent`
|
|
1355
|
+
subscription, the channel message listener, and closes the channel
|
|
1356
|
+
(when it was created internally). After disable, no further propagation
|
|
1357
|
+
occurs in either direction.
|
|
1358
|
+
|
|
1359
|
+
**Multi-writer note:** concurrent writes from two tabs to the same doc
|
|
1360
|
+
produce last-write-wins divergence — there is no conflict resolution.
|
|
1361
|
+
The intended model is one active writer (one user, one tab) with
|
|
1362
|
+
observers in other tabs; this covers the overwhelming majority of
|
|
1363
|
+
local development scenarios.
|
|
1364
|
+
|
|
1365
|
+
###### Parameters
|
|
1366
|
+
|
|
1367
|
+
| Parameter | Type |
|
|
1368
|
+
| :------ | :------ |
|
|
1369
|
+
| `options?` | [`TabSyncOptions`](pyric-sandbox-reference-api.md#tabsyncoptions) |
|
|
1370
|
+
|
|
1371
|
+
###### Returns
|
|
1372
|
+
|
|
1373
|
+
```ts
|
|
1374
|
+
(): void;
|
|
1375
|
+
```
|
|
1376
|
+
|
|
1377
|
+
###### Returns
|
|
1378
|
+
|
|
1379
|
+
`void`
|
|
1380
|
+
|
|
1381
|
+
###### See
|
|
1382
|
+
|
|
1383
|
+
[TabSyncOptions](pyric-sandbox-reference-api.md#tabsyncoptions) for channel injection (tests) and originId.
|
|
1384
|
+
|
|
1385
|
+
###### Example
|
|
1386
|
+
|
|
1387
|
+
```ts
|
|
1388
|
+
// In every tab that should participate in realtime:
|
|
1389
|
+
const sandbox = initializeSandbox();
|
|
1390
|
+
const disableSync = sandbox.enableTabSync();
|
|
1391
|
+
// Later, to stop syncing:
|
|
1392
|
+
disableSync();
|
|
1393
|
+
```
|
|
1394
|
+
|
|
1395
|
+
<a id="flush"></a>
|
|
1396
|
+
|
|
1397
|
+
##### flush()
|
|
1398
|
+
|
|
1399
|
+
```ts
|
|
1400
|
+
flush(): Promise<void>;
|
|
1401
|
+
```
|
|
1402
|
+
|
|
1403
|
+
Force a snapshot to the configured persistence backend right now.
|
|
1404
|
+
Useful before a manual navigation, or in tests that need
|
|
1405
|
+
deterministic ordering against the debounce window. Resolves once
|
|
1406
|
+
the write hits the backend.
|
|
1407
|
+
|
|
1408
|
+
Throws if persistence is not enabled.
|
|
1409
|
+
|
|
1410
|
+
###### Returns
|
|
1411
|
+
|
|
1412
|
+
`Promise`\<`void`\>
|
|
1413
|
+
|
|
1414
|
+
<a id="history"></a>
|
|
1415
|
+
|
|
1416
|
+
##### history()
|
|
1417
|
+
|
|
1418
|
+
```ts
|
|
1419
|
+
history(): SandboxEvent[];
|
|
1420
|
+
```
|
|
1421
|
+
|
|
1422
|
+
Every [SandboxEvent](pyric-sandbox-reference-api.md#sandboxevent) this sandbox has emitted since init or
|
|
1423
|
+
the last `reset()`. Returns a defensive copy.
|
|
1424
|
+
|
|
1425
|
+
Use this for replay: hand the array to `replay(events, rules)`
|
|
1426
|
+
from `pyric/sandbox` and the engine re-issues every
|
|
1427
|
+
captured write against a fresh sandbox.
|
|
1428
|
+
|
|
1429
|
+
Unlike [onEvent](#onevent) (live stream from the moment of subscribe),
|
|
1430
|
+
`history()` returns *every* event the sandbox has seen — useful
|
|
1431
|
+
for consumers that attach late (e.g., loading a saved session
|
|
1432
|
+
before subscribing) or that need a snapshot at a particular moment.
|
|
1433
|
+
|
|
1434
|
+
`reset()` and `dispose()` each append a closing `session_boundary`
|
|
1435
|
+
event; `reset()` then clears the history. Consumers that took a
|
|
1436
|
+
snapshot *before* reset retain the boundary in their copy.
|
|
1437
|
+
|
|
1438
|
+
###### Returns
|
|
1439
|
+
|
|
1440
|
+
[`SandboxEvent`](pyric-sandbox-reference-api.md#sandboxevent)[]
|
|
1441
|
+
|
|
1442
|
+
<a id="loadsnapshot"></a>
|
|
1443
|
+
|
|
1444
|
+
##### loadSnapshot()
|
|
1445
|
+
|
|
1446
|
+
```ts
|
|
1447
|
+
loadSnapshot(data: SandboxSnapshot): void;
|
|
1448
|
+
```
|
|
1449
|
+
|
|
1450
|
+
CLOBBER-restore the sandbox's entire state from a prior [snapshot](#snapshot):
|
|
1451
|
+
`reset()` (clears firestore + the signed-in session), then rebuild firestore
|
|
1452
|
+
from `data` and restore each registered service. This is a TOTAL replace —
|
|
1453
|
+
documents absent from `data` do NOT survive — and is the counterpart to
|
|
1454
|
+
[snapshot](#snapshot). It is what makes "transfer (clobber) one instance's data
|
|
1455
|
+
into another" and named-branch switching possible.
|
|
1456
|
+
|
|
1457
|
+
Fires a `session_boundary` (reset phase), re-evaluates live listeners against
|
|
1458
|
+
the loaded state, and the next persistence flush writes the loaded state.
|
|
1459
|
+
Services present in `data` but not currently registered are skipped (a
|
|
1460
|
+
snapshot taken via [snapshot](#snapshot) always includes every registered
|
|
1461
|
+
service, so this only affects cross-instance imports from a sandbox that had
|
|
1462
|
+
a service this one lacks).
|
|
1463
|
+
|
|
1464
|
+
###### Parameters
|
|
1465
|
+
|
|
1466
|
+
| Parameter | Type |
|
|
1467
|
+
| :------ | :------ |
|
|
1468
|
+
| `data` | [`SandboxSnapshot`](pyric-sandbox-reference-api.md#sandboxsnapshot) |
|
|
1469
|
+
|
|
1470
|
+
###### Returns
|
|
1471
|
+
|
|
1472
|
+
`void`
|
|
1473
|
+
|
|
1474
|
+
<a id="oncurrentuserchanged"></a>
|
|
1475
|
+
|
|
1476
|
+
##### onCurrentUserChanged()
|
|
1477
|
+
|
|
1478
|
+
```ts
|
|
1479
|
+
onCurrentUserChanged(cb: (user: {
|
|
1480
|
+
token?: Record<string, unknown>;
|
|
1481
|
+
uid: string;
|
|
1482
|
+
}) => void): () => void;
|
|
1483
|
+
```
|
|
1484
|
+
|
|
1485
|
+
Subscribe to `currentUser` changes. Fires on every mutation —
|
|
1486
|
+
sign-in, sign-out, user swap. Does NOT fire on subscribe.
|
|
1487
|
+
|
|
1488
|
+
Survives `reset()` and `dispose()` only as a no-op: a disposed
|
|
1489
|
+
sandbox emits nothing further; a reset sandbox clears
|
|
1490
|
+
`currentUser` to `null` (and fires the change) before swapping
|
|
1491
|
+
the env.
|
|
1492
|
+
|
|
1493
|
+
Returns an unsubscribe function. Listener errors are swallowed —
|
|
1494
|
+
subscribers are observational, the sandbox does not propagate
|
|
1495
|
+
their errors.
|
|
1496
|
+
|
|
1497
|
+
###### Parameters
|
|
1498
|
+
|
|
1499
|
+
| Parameter | Type |
|
|
1500
|
+
| :------ | :------ |
|
|
1501
|
+
| `cb` | (`user`: \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \}) => `void` |
|
|
1502
|
+
|
|
1503
|
+
###### Returns
|
|
1504
|
+
|
|
1505
|
+
```ts
|
|
1506
|
+
(): void;
|
|
1507
|
+
```
|
|
1508
|
+
|
|
1509
|
+
###### Returns
|
|
1510
|
+
|
|
1511
|
+
`void`
|
|
1512
|
+
|
|
1513
|
+
<a id="onevent"></a>
|
|
1514
|
+
|
|
1515
|
+
##### onEvent()
|
|
1516
|
+
|
|
1517
|
+
```ts
|
|
1518
|
+
onEvent(cb: (event: SandboxEvent) => void): () => void;
|
|
1519
|
+
```
|
|
1520
|
+
|
|
1521
|
+
Subscribe to every event the sandbox emits — see [SandboxEvent](pyric-sandbox-reference-api.md#sandboxevent)
|
|
1522
|
+
for the discriminated-union shape. One subscription covers
|
|
1523
|
+
request/denial/snapshot-error/listener-lifecycle/session-boundary;
|
|
1524
|
+
filter on `event.kind` to recover individual streams.
|
|
1525
|
+
|
|
1526
|
+
Replaces the prior three-channel surface (`onRequest` / `onDenial`
|
|
1527
|
+
/ `onSnapshotError`) — see issue #307. Filter cookbook:
|
|
1528
|
+
- All denials: `event.kind === 'request' && event.result === 'deny'`
|
|
1529
|
+
- Stream errors: `event.kind === 'listener_errored'`
|
|
1530
|
+
- Per-op traffic: `event.kind === 'request'`
|
|
1531
|
+
|
|
1532
|
+
Survives `sandbox.reset()` — the subscription is held on the
|
|
1533
|
+
sandbox, not on the underlying environment. A `session_boundary`
|
|
1534
|
+
event with `phase: 'reset'` fires before the env swap so consumers
|
|
1535
|
+
can segment their stream.
|
|
1536
|
+
|
|
1537
|
+
Returns an unsubscribe function. Listener errors are swallowed so a
|
|
1538
|
+
faulty subscriber can't change rule semantics or hide other events.
|
|
1539
|
+
Both synchronous throws and rejected Promises from async callbacks
|
|
1540
|
+
are silently discarded — subscribers are **observational**, the
|
|
1541
|
+
sandbox doesn't await them and doesn't propagate their errors.
|
|
1542
|
+
|
|
1543
|
+
###### Parameters
|
|
1544
|
+
|
|
1545
|
+
| Parameter | Type |
|
|
1546
|
+
| :------ | :------ |
|
|
1547
|
+
| `cb` | (`event`: [`SandboxEvent`](pyric-sandbox-reference-api.md#sandboxevent)) => `void` |
|
|
1548
|
+
|
|
1549
|
+
###### Returns
|
|
1550
|
+
|
|
1551
|
+
```ts
|
|
1552
|
+
(): void;
|
|
1553
|
+
```
|
|
1554
|
+
|
|
1555
|
+
###### Returns
|
|
683
1556
|
|
|
684
|
-
|
|
1557
|
+
`void`
|
|
685
1558
|
|
|
686
|
-
|
|
1559
|
+
<a id="registerpersistableservice"></a>
|
|
687
1560
|
|
|
688
|
-
|
|
689
|
-
there is no memory cache tier with GC pressure to tune.
|
|
1561
|
+
##### registerPersistableService()
|
|
690
1562
|
|
|
691
|
-
|
|
1563
|
+
```ts
|
|
1564
|
+
registerPersistableService(name: string, hooks: PersistableService): () => void;
|
|
1565
|
+
```
|
|
692
1566
|
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
1567
|
+
Register a service (auth, storage, …) as a persistence participant.
|
|
1568
|
+
The sandbox calls `hooks.snapshot()` on every flush and
|
|
1569
|
+
`hooks.restore(data)` on restore. If `hooks.subscribe` is provided,
|
|
1570
|
+
the persistence controller subscribes and schedules a debounced
|
|
1571
|
+
flush on each change — so auth-user edits flush promptly, not only
|
|
1572
|
+
on the next Firestore write.
|
|
696
1573
|
|
|
697
|
-
|
|
1574
|
+
Returns an unregister function — call it if the service is torn
|
|
1575
|
+
down before the sandbox is disposed (uncommon in practice; the
|
|
1576
|
+
sandbox's `dispose()` clears the registry anyway).
|
|
698
1577
|
|
|
699
|
-
|
|
1578
|
+
Throws `failed-precondition` when a service with the same `name` is
|
|
1579
|
+
already registered — the auth package registers `'auth'` once when
|
|
1580
|
+
`getAuth(sandbox)` first creates a backend, so accidental double-
|
|
1581
|
+
registration is a caller bug, not a no-op.
|
|
700
1582
|
|
|
701
|
-
|
|
1583
|
+
**Advanced / internal API.** Service packages (auth, storage) call
|
|
1584
|
+
this when they first attach to a sandbox. Consumer app code should
|
|
1585
|
+
not need to call this directly.
|
|
702
1586
|
|
|
703
|
-
|
|
1587
|
+
###### Parameters
|
|
704
1588
|
|
|
705
|
-
|
|
|
1589
|
+
| Parameter | Type |
|
|
706
1590
|
| :------ | :------ |
|
|
707
|
-
|
|
|
1591
|
+
| `name` | `string` |
|
|
1592
|
+
| `hooks` | [`PersistableService`](pyric-sandbox-reference-api.md#persistableservice) |
|
|
708
1593
|
|
|
709
|
-
|
|
1594
|
+
###### Returns
|
|
710
1595
|
|
|
711
|
-
|
|
1596
|
+
```ts
|
|
1597
|
+
(): void;
|
|
1598
|
+
```
|
|
712
1599
|
|
|
713
|
-
|
|
1600
|
+
###### Returns
|
|
714
1601
|
|
|
715
|
-
|
|
716
|
-
and the SharedWorker/`pyric dev` path already is the one shared
|
|
717
|
-
store every tab talks to, so there is no separate multi-tab mode
|
|
718
|
-
to opt into. Carries the requested kind only for debugging.
|
|
1602
|
+
`void`
|
|
719
1603
|
|
|
720
|
-
|
|
1604
|
+
<a id="reset"></a>
|
|
721
1605
|
|
|
722
|
-
|
|
723
|
-
| :------ | :------ | :------ |
|
|
724
|
-
| <a id="tab_manager_symbol"></a> `[TAB_MANAGER_SYMBOL]` | `readonly` | `"single"` \| `"multiple"` |
|
|
1606
|
+
##### reset()
|
|
725
1607
|
|
|
726
|
-
|
|
1608
|
+
```ts
|
|
1609
|
+
reset(): void;
|
|
1610
|
+
```
|
|
727
1611
|
|
|
728
|
-
|
|
1612
|
+
Reset the underlying environment to a fresh state — wipes data,
|
|
1613
|
+
rules, and any service-specific configuration.
|
|
729
1614
|
|
|
730
|
-
|
|
1615
|
+
Snapshot listeners attached to the OLD environment are dropped at
|
|
1616
|
+
the swap — they can't survive because their target docs have been
|
|
1617
|
+
wiped. `onEvent` subscribers DO survive — the registry lives on
|
|
1618
|
+
the sandbox, and a `session_boundary` event with `phase: 'reset'`
|
|
1619
|
+
fires before the swap so subscribers know the rollover happened.
|
|
1620
|
+
Existing [SandboxContext](#sandboxcontext)s continue to work — their sandbox
|
|
1621
|
+
reference is stable; subsequent operations resolve to the new env.
|
|
731
1622
|
|
|
732
|
-
|
|
1623
|
+
###### Returns
|
|
733
1624
|
|
|
734
|
-
|
|
1625
|
+
`void`
|
|
735
1626
|
|
|
736
|
-
|
|
737
|
-
| :------ | :------ |
|
|
738
|
-
| `_T` | [`AuthState`](#authstate) |
|
|
1627
|
+
<a id="resetall"></a>
|
|
739
1628
|
|
|
740
|
-
|
|
1629
|
+
##### resetAll()
|
|
741
1630
|
|
|
742
|
-
|
|
1631
|
+
```ts
|
|
1632
|
+
resetAll(): Promise<{
|
|
1633
|
+
errors: string[];
|
|
1634
|
+
}>;
|
|
1635
|
+
```
|
|
743
1636
|
|
|
744
|
-
|
|
1637
|
+
Reset the WHOLE sandbox: [reset](#reset) (Firestore env + signed-in
|
|
1638
|
+
session), then clear every registered persistable service that
|
|
1639
|
+
provides a [PersistableService.reset](pyric-sandbox-reference-api.md#reset-2) hook — auth users, the
|
|
1640
|
+
RTDB tree, storage objects. This is the one sandbox-owned "wipe
|
|
1641
|
+
everything" path: because it iterates the service registry, a new
|
|
1642
|
+
service that registers with a `reset` hook is cleared automatically,
|
|
1643
|
+
and a consumer (Pyric Studio's reset) cannot forget one.
|
|
745
1644
|
|
|
746
|
-
|
|
1645
|
+
Service resets may be async (storage clears IndexedDB stores); the
|
|
1646
|
+
returned promise resolves when every service has finished clearing.
|
|
1647
|
+
A service whose `reset` throws is isolated (others still clear) and
|
|
1648
|
+
REPORTED in the returned `errors` (as `name: message`) — a reset that
|
|
1649
|
+
leaves data behind must never look successful to the caller.
|
|
747
1650
|
|
|
748
|
-
|
|
1651
|
+
###### Returns
|
|
749
1652
|
|
|
750
|
-
|
|
1653
|
+
`Promise`\<\{
|
|
1654
|
+
`errors`: `string`[];
|
|
1655
|
+
\}\>
|
|
1656
|
+
|
|
1657
|
+
<a id="runwithprovenance"></a>
|
|
1658
|
+
|
|
1659
|
+
##### runWithProvenance()?
|
|
751
1660
|
|
|
752
1661
|
```ts
|
|
753
|
-
|
|
1662
|
+
optional runWithProvenance<T>(provenance: EventProvenance, fn: () => T): T;
|
|
754
1663
|
```
|
|
755
1664
|
|
|
1665
|
+
Run `fn` with ambient [EventProvenance](pyric-sandbox-reference-api.md#eventprovenance) defaults: every event
|
|
1666
|
+
emitted SYNCHRONOUSLY during `fn` that doesn't already carry a
|
|
1667
|
+
provenance field (on the event itself or via an explicit per-emit
|
|
1668
|
+
override) is stamped with these values instead of the global
|
|
1669
|
+
defaults. This is the mechanical "who issued this op" seam the
|
|
1670
|
+
serve worker uses to tag Studio-issued ops (`actor: { kind:
|
|
1671
|
+
'studio' }`) and to stamp the auth lens an op ran under
|
|
1672
|
+
(`authLens`) — declared by the caller that issues the op, never
|
|
1673
|
+
inferred from the op's shape.
|
|
1674
|
+
|
|
1675
|
+
SYNCHRONOUS WINDOW: the ambient values apply only until `fn`
|
|
1676
|
+
returns (for an async `fn`, its synchronous prefix — which covers
|
|
1677
|
+
the local environment's rules eval + event emission, since those
|
|
1678
|
+
run before the op's promise is handed back). Work an op DEFERS
|
|
1679
|
+
(snapshot-listener deliveries and re-evals drain on a microtask,
|
|
1680
|
+
off-stack) is intentionally OUTSIDE the window: a listener re-eval
|
|
1681
|
+
belongs to the listener's owner, not to whoever's write triggered
|
|
1682
|
+
it. Nested calls stack — the innermost window wins per field, and
|
|
1683
|
+
each window restores the previous one on exit (including on throw).
|
|
1684
|
+
|
|
1685
|
+
OPTIONAL because remote sandbox proxies can't provide an ambient
|
|
1686
|
+
emit window (events are emitted in the worker they front). Callers
|
|
1687
|
+
spell `sandbox.runWithProvenance?.(prov, fn) ?? fn()`.
|
|
1688
|
+
|
|
1689
|
+
###### Type Parameters
|
|
1690
|
+
|
|
1691
|
+
| Type Parameter |
|
|
1692
|
+
| :------ |
|
|
1693
|
+
| `T` |
|
|
1694
|
+
|
|
756
1695
|
###### Parameters
|
|
757
1696
|
|
|
758
1697
|
| Parameter | Type |
|
|
759
1698
|
| :------ | :------ |
|
|
760
|
-
| `
|
|
1699
|
+
| `provenance` | [`EventProvenance`](pyric-sandbox-reference-api.md#eventprovenance) |
|
|
1700
|
+
| `fn` | () => `T` |
|
|
761
1701
|
|
|
762
1702
|
###### Returns
|
|
763
1703
|
|
|
764
|
-
`
|
|
1704
|
+
`T`
|
|
765
1705
|
|
|
766
|
-
|
|
1706
|
+
<a id="snapshot"></a>
|
|
767
1707
|
|
|
768
|
-
|
|
1708
|
+
##### snapshot()
|
|
769
1709
|
|
|
770
|
-
|
|
1710
|
+
```ts
|
|
1711
|
+
snapshot(): SandboxSnapshot;
|
|
1712
|
+
```
|
|
771
1713
|
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
callbacks. Mirrors the JS SDK's narrowing.
|
|
1714
|
+
Capture a snapshot of every service's state. For v1 with only
|
|
1715
|
+
Firestore, the return value carries a `firestore` key mapping doc
|
|
1716
|
+
paths to data. Future services will add their own keys.
|
|
776
1717
|
|
|
777
|
-
|
|
1718
|
+
###### Returns
|
|
778
1719
|
|
|
779
|
-
|
|
1720
|
+
[`SandboxSnapshot`](pyric-sandbox-reference-api.md#sandboxsnapshot)
|
|
780
1721
|
|
|
781
|
-
|
|
1722
|
+
<a id="withauth"></a>
|
|
782
1723
|
|
|
783
|
-
|
|
784
|
-
| :------ | :------ |
|
|
785
|
-
| `T` | [`AuthState`](#authstate) |
|
|
1724
|
+
##### withAuth()
|
|
786
1725
|
|
|
787
|
-
|
|
1726
|
+
```ts
|
|
1727
|
+
withAuth(auth: {
|
|
1728
|
+
token?: Record<string, unknown>;
|
|
1729
|
+
uid: string;
|
|
1730
|
+
}): SandboxContext;
|
|
1731
|
+
```
|
|
788
1732
|
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
1733
|
+
Derive a context bound to this sandbox under the given auth
|
|
1734
|
+
identity. Operations through services attached to the returned
|
|
1735
|
+
context evaluate rules under that identity. Many contexts can
|
|
1736
|
+
coexist for one sandbox; data is shared.
|
|
793
1737
|
|
|
794
|
-
|
|
1738
|
+
`null` is anonymous; an `AuthState` object names the user (and
|
|
1739
|
+
optional custom claims). Passing `undefined` is a deliberate
|
|
1740
|
+
error — say `withAuth(null)` for anonymous so the call site is
|
|
1741
|
+
unambiguous.
|
|
795
1742
|
|
|
796
|
-
|
|
1743
|
+
###### Parameters
|
|
797
1744
|
|
|
798
|
-
|
|
1745
|
+
| Parameter | Type |
|
|
1746
|
+
| :------ | :------ |
|
|
1747
|
+
| `auth` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
|
|
1748
|
+
| `auth.token?` | `Record`\<`string`, `unknown`\> |
|
|
1749
|
+
| `auth.uid` | `string` |
|
|
1750
|
+
|
|
1751
|
+
###### Returns
|
|
1752
|
+
|
|
1753
|
+
[`SandboxContext`](#sandboxcontext)
|
|
1754
|
+
|
|
1755
|
+
###### Example
|
|
799
1756
|
|
|
800
1757
|
```ts
|
|
801
|
-
|
|
1758
|
+
const sandbox = initializeSandbox();
|
|
1759
|
+
const dbAlice = getFirestore(sandbox.withAuth({ uid: 'alice' }));
|
|
1760
|
+
const dbAnon = getFirestore(sandbox.withAuth(null));
|
|
802
1761
|
```
|
|
803
1762
|
|
|
804
|
-
|
|
1763
|
+
***
|
|
805
1764
|
|
|
806
|
-
|
|
1765
|
+
<a id="sandboxcontext"></a>
|
|
807
1766
|
|
|
808
|
-
|
|
1767
|
+
### SandboxContext
|
|
809
1768
|
|
|
810
|
-
[
|
|
1769
|
+
Identity-bearing handle on a [Sandbox](#sandbox). A
|
|
1770
|
+
`(sandbox, auth, operationContext)`
|
|
1771
|
+
tuple — cheap to create, immutable, freely shareable. Service
|
|
1772
|
+
factories require a `SandboxContext`; bare `Sandbox` is a type
|
|
1773
|
+
error so every call site states identity explicitly.
|
|
811
1774
|
|
|
812
|
-
|
|
1775
|
+
Constructed via `Sandbox.withAuth(auth)` or chained via
|
|
1776
|
+
`SandboxContext.withAuth(auth)`. The concrete class is exported
|
|
1777
|
+
from `pyric/sandbox` for `instanceof` routing in service
|
|
1778
|
+
factories; consumers don't construct it directly.
|
|
813
1779
|
|
|
814
|
-
|
|
1780
|
+
#### Properties
|
|
815
1781
|
|
|
816
|
-
|
|
1782
|
+
| Property | Modifier | Type | Description |
|
|
1783
|
+
| :------ | :------ | :------ | :------ |
|
|
1784
|
+
| <a id="auth"></a> `auth` | `readonly` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | The identity rules evaluate under for operations through this context. |
|
|
1785
|
+
| `auth.token?` | `public` | `Record`\<`string`, `unknown`\> | - |
|
|
1786
|
+
| `auth.uid` | `public` | `string` | - |
|
|
1787
|
+
| <a id="operationcontext"></a> `operationContext` | `readonly` | [`OperationContext`](pyric-sandbox-reference-api.md#operationcontext-2) | Immutable provenance bound to every operation issued through this handle. |
|
|
1788
|
+
| <a id="sandbox-1"></a> `sandbox` | `readonly` | [`Sandbox`](#sandbox) | The data foundation this context operates against. |
|
|
817
1789
|
|
|
818
|
-
|
|
1790
|
+
#### Methods
|
|
819
1791
|
|
|
820
|
-
|
|
1792
|
+
<a id="withauth-2"></a>
|
|
821
1793
|
|
|
822
|
-
|
|
1794
|
+
##### withAuth()
|
|
1795
|
+
|
|
1796
|
+
```ts
|
|
1797
|
+
withAuth(auth: {
|
|
1798
|
+
token?: Record<string, unknown>;
|
|
1799
|
+
uid: string;
|
|
1800
|
+
}): SandboxContext;
|
|
1801
|
+
```
|
|
1802
|
+
|
|
1803
|
+
Derive a sibling context on the same sandbox with different auth.
|
|
1804
|
+
Replaces auth and its lens while preserving the operation source and
|
|
1805
|
+
optional plan identity.
|
|
1806
|
+
|
|
1807
|
+
###### Parameters
|
|
1808
|
+
|
|
1809
|
+
| Parameter | Type |
|
|
823
1810
|
| :------ | :------ |
|
|
824
|
-
| `
|
|
1811
|
+
| `auth` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
|
|
1812
|
+
| `auth.token?` | `Record`\<`string`, `unknown`\> |
|
|
1813
|
+
| `auth.uid` | `string` |
|
|
825
1814
|
|
|
826
|
-
|
|
1815
|
+
###### Returns
|
|
827
1816
|
|
|
828
|
-
|
|
829
|
-
| :------ | :------ | :------ |
|
|
830
|
-
| <a id="docs"></a> `docs` | `readonly` | readonly [`QueryDocumentSnapshot`](#querydocumentsnapshot)\<`T`\>[] |
|
|
831
|
-
| <a id="empty"></a> `empty` | `readonly` | `boolean` |
|
|
832
|
-
| <a id="size"></a> `size` | `readonly` | `number` |
|
|
1817
|
+
[`SandboxContext`](#sandboxcontext)
|
|
833
1818
|
|
|
834
1819
|
***
|
|
835
1820
|
|
|
@@ -986,7 +1971,56 @@ of omitting an auth field, and acting-as-a-user is named too.
|
|
|
986
1971
|
### AuthState
|
|
987
1972
|
|
|
988
1973
|
```ts
|
|
989
|
-
type AuthState =
|
|
1974
|
+
type AuthState =
|
|
1975
|
+
| {
|
|
1976
|
+
token?: Record<string, unknown>;
|
|
1977
|
+
uid: string;
|
|
1978
|
+
}
|
|
1979
|
+
| null;
|
|
1980
|
+
```
|
|
1981
|
+
|
|
1982
|
+
A signed-in identity for sandbox operations. `null` is anonymous.
|
|
1983
|
+
|
|
1984
|
+
`token` is the Firebase Auth token claims map (custom claims plus
|
|
1985
|
+
standard ones). It surfaces the same way it does in production rules
|
|
1986
|
+
via `request.auth.token.*`. Omit it for plain UID-only auth.
|
|
1987
|
+
|
|
1988
|
+
Renamed from `AuthContext` (pre-multi-context) so the data type
|
|
1989
|
+
doesn't visually collide with `SandboxContext` (the identity-bearing
|
|
1990
|
+
handle). They sit at different layers — payload vs. handle — and the
|
|
1991
|
+
names should reflect that.
|
|
1992
|
+
|
|
1993
|
+
***
|
|
1994
|
+
|
|
1995
|
+
<a id="documentdata"></a>
|
|
1996
|
+
|
|
1997
|
+
### DocumentData
|
|
1998
|
+
|
|
1999
|
+
```ts
|
|
2000
|
+
type DocumentData = Record<string, unknown>;
|
|
2001
|
+
```
|
|
2002
|
+
|
|
2003
|
+
***
|
|
2004
|
+
|
|
2005
|
+
<a id="fieldvaluesentinel"></a>
|
|
2006
|
+
|
|
2007
|
+
### FieldValueSentinel
|
|
2008
|
+
|
|
2009
|
+
```ts
|
|
2010
|
+
type FieldValueSentinel =
|
|
2011
|
+
| {
|
|
2012
|
+
}
|
|
2013
|
+
| {
|
|
2014
|
+
value: number;
|
|
2015
|
+
}
|
|
2016
|
+
| {
|
|
2017
|
+
values: unknown[];
|
|
2018
|
+
}
|
|
2019
|
+
| {
|
|
2020
|
+
values: unknown[];
|
|
2021
|
+
}
|
|
2022
|
+
| {
|
|
2023
|
+
};
|
|
990
2024
|
```
|
|
991
2025
|
|
|
992
2026
|
***
|
|
@@ -1003,12 +2037,22 @@ Mirrors `firebase/firestore`'s `LogLevel` union.
|
|
|
1003
2037
|
|
|
1004
2038
|
***
|
|
1005
2039
|
|
|
2040
|
+
<a id="orderdirection"></a>
|
|
2041
|
+
|
|
2042
|
+
### OrderDirection
|
|
2043
|
+
|
|
2044
|
+
```ts
|
|
2045
|
+
type OrderDirection = "asc" | "desc";
|
|
2046
|
+
```
|
|
2047
|
+
|
|
2048
|
+
***
|
|
2049
|
+
|
|
1006
2050
|
<a id="transaction"></a>
|
|
1007
2051
|
|
|
1008
2052
|
### Transaction
|
|
1009
2053
|
|
|
1010
2054
|
```ts
|
|
1011
|
-
type Transaction =
|
|
2055
|
+
type Transaction = Transaction;
|
|
1012
2056
|
```
|
|
1013
2057
|
|
|
1014
2058
|
***
|
|
@@ -1027,12 +2071,32 @@ type Unsubscribe = () => void;
|
|
|
1027
2071
|
|
|
1028
2072
|
***
|
|
1029
2073
|
|
|
2074
|
+
<a id="wherefilterop"></a>
|
|
2075
|
+
|
|
2076
|
+
### WhereFilterOp
|
|
2077
|
+
|
|
2078
|
+
```ts
|
|
2079
|
+
type WhereFilterOp =
|
|
2080
|
+
| "<"
|
|
2081
|
+
| "<="
|
|
2082
|
+
| "=="
|
|
2083
|
+
| "!="
|
|
2084
|
+
| ">="
|
|
2085
|
+
| ">"
|
|
2086
|
+
| "in"
|
|
2087
|
+
| "not-in"
|
|
2088
|
+
| "array-contains"
|
|
2089
|
+
| "array-contains-any";
|
|
2090
|
+
```
|
|
2091
|
+
|
|
2092
|
+
***
|
|
2093
|
+
|
|
1030
2094
|
<a id="writebatch"></a>
|
|
1031
2095
|
|
|
1032
2096
|
### WriteBatch
|
|
1033
2097
|
|
|
1034
2098
|
```ts
|
|
1035
|
-
type WriteBatch =
|
|
2099
|
+
type WriteBatch = WriteBatch;
|
|
1036
2100
|
```
|
|
1037
2101
|
|
|
1038
2102
|
## Variables
|
|
@@ -1055,7 +2119,10 @@ the sandbox backend so free functions can recover their owner.
|
|
|
1055
2119
|
### actingAs()
|
|
1056
2120
|
|
|
1057
2121
|
```ts
|
|
1058
|
-
function actingAs(sandbox: Sandbox, identity:
|
|
2122
|
+
function actingAs(sandbox: Sandbox, identity: {
|
|
2123
|
+
token?: Record<string, unknown>;
|
|
2124
|
+
uid: string;
|
|
2125
|
+
}): Firestore;
|
|
1059
2126
|
```
|
|
1060
2127
|
|
|
1061
2128
|
A Firestore handle scoped to a specific identity, for multi-user testing.
|
|
@@ -1070,8 +2137,10 @@ delivered to another's `onSnapshot`: the basis for multi-user sync testing.
|
|
|
1070
2137
|
|
|
1071
2138
|
| Parameter | Type |
|
|
1072
2139
|
| :------ | :------ |
|
|
1073
|
-
| `sandbox` | `Sandbox` |
|
|
1074
|
-
| `identity` | `
|
|
2140
|
+
| `sandbox` | [`Sandbox`](#sandbox) |
|
|
2141
|
+
| `identity` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} |
|
|
2142
|
+
| `identity.token?` | `Record`\<`string`, `unknown`\> |
|
|
2143
|
+
| `identity.uid` | `string` |
|
|
1075
2144
|
|
|
1076
2145
|
#### Returns
|
|
1077
2146
|
|
|
@@ -1109,7 +2178,7 @@ function addDoc<T>(coll: CollectionReference<T>, data: T): Promise<DocumentRefer
|
|
|
1109
2178
|
|
|
1110
2179
|
| Type Parameter | Default type |
|
|
1111
2180
|
| :------ | :------ |
|
|
1112
|
-
| `T` | `DocumentData` |
|
|
2181
|
+
| `T` | [`DocumentData`](#documentdata) |
|
|
1113
2182
|
|
|
1114
2183
|
#### Parameters
|
|
1115
2184
|
|
|
@@ -1148,7 +2217,7 @@ would otherwise be at the top level.
|
|
|
1148
2217
|
|
|
1149
2218
|
***
|
|
1150
2219
|
|
|
1151
|
-
<a id="arrayremove"></a>
|
|
2220
|
+
<a id="arrayremove-2"></a>
|
|
1152
2221
|
|
|
1153
2222
|
### arrayRemove()
|
|
1154
2223
|
|
|
@@ -1164,11 +2233,11 @@ function arrayRemove(...values: unknown[]): FieldValueSentinel;
|
|
|
1164
2233
|
|
|
1165
2234
|
#### Returns
|
|
1166
2235
|
|
|
1167
|
-
`FieldValueSentinel`
|
|
2236
|
+
[`FieldValueSentinel`](#fieldvaluesentinel)
|
|
1168
2237
|
|
|
1169
2238
|
***
|
|
1170
2239
|
|
|
1171
|
-
<a id="arrayunion"></a>
|
|
2240
|
+
<a id="arrayunion-2"></a>
|
|
1172
2241
|
|
|
1173
2242
|
### arrayUnion()
|
|
1174
2243
|
|
|
@@ -1184,7 +2253,7 @@ function arrayUnion(...values: unknown[]): FieldValueSentinel;
|
|
|
1184
2253
|
|
|
1185
2254
|
#### Returns
|
|
1186
2255
|
|
|
1187
|
-
`FieldValueSentinel`
|
|
2256
|
+
[`FieldValueSentinel`](#fieldvaluesentinel)
|
|
1188
2257
|
|
|
1189
2258
|
***
|
|
1190
2259
|
|
|
@@ -1260,7 +2329,7 @@ function collection(parent:
|
|
|
1260
2329
|
|
|
1261
2330
|
| Parameter | Type |
|
|
1262
2331
|
| :------ | :------ |
|
|
1263
|
-
| `parent` | \| [`Firestore`](#firestore) \| [`DocumentReference`](#documentreference)
|
|
2332
|
+
| `parent` | \| [`Firestore`](#firestore) \| [`DocumentReference`](#documentreference)\<[`DocumentData`](#documentdata)\> |
|
|
1264
2333
|
| ...`pathSegments` | `string`[] |
|
|
1265
2334
|
|
|
1266
2335
|
#### Returns
|
|
@@ -1448,7 +2517,7 @@ function deleteField(): FieldValueSentinel;
|
|
|
1448
2517
|
|
|
1449
2518
|
#### Returns
|
|
1450
2519
|
|
|
1451
|
-
`FieldValueSentinel`
|
|
2520
|
+
[`FieldValueSentinel`](#fieldvaluesentinel)
|
|
1452
2521
|
|
|
1453
2522
|
***
|
|
1454
2523
|
|
|
@@ -1495,7 +2564,7 @@ function doc<T>(parent:
|
|
|
1495
2564
|
|
|
1496
2565
|
| Type Parameter | Default type |
|
|
1497
2566
|
| :------ | :------ |
|
|
1498
|
-
| `T` | `DocumentData` |
|
|
2567
|
+
| `T` | [`DocumentData`](#documentdata) |
|
|
1499
2568
|
|
|
1500
2569
|
#### Parameters
|
|
1501
2570
|
|
|
@@ -1729,7 +2798,7 @@ uid }))` instead.
|
|
|
1729
2798
|
|
|
1730
2799
|
| Parameter | Type |
|
|
1731
2800
|
| :------ | :------ |
|
|
1732
|
-
| `sandbox` | `Sandbox` |
|
|
2801
|
+
| `sandbox` | [`Sandbox`](#sandbox) |
|
|
1733
2802
|
|
|
1734
2803
|
##### Returns
|
|
1735
2804
|
|
|
@@ -1777,7 +2846,7 @@ uid }))` instead.
|
|
|
1777
2846
|
|
|
1778
2847
|
| Parameter | Type |
|
|
1779
2848
|
| :------ | :------ |
|
|
1780
|
-
| `ctx` | `SandboxContext` |
|
|
2849
|
+
| `ctx` | [`SandboxContext`](#sandboxcontext) |
|
|
1781
2850
|
|
|
1782
2851
|
##### Returns
|
|
1783
2852
|
|
|
@@ -1825,7 +2894,7 @@ uid }))` instead.
|
|
|
1825
2894
|
|
|
1826
2895
|
| Parameter | Type |
|
|
1827
2896
|
| :------ | :------ |
|
|
1828
|
-
| `app` | `FirebaseApp` |
|
|
2897
|
+
| `app` | [`FirebaseApp`](pyric-app-reference-api.md#firebaseapp) |
|
|
1829
2898
|
|
|
1830
2899
|
##### Returns
|
|
1831
2900
|
|
|
@@ -1869,7 +2938,7 @@ The sandbox target dispatches straight into the chainable adapter.
|
|
|
1869
2938
|
|
|
1870
2939
|
| Parameter | Type |
|
|
1871
2940
|
| :------ | :------ |
|
|
1872
|
-
| `source` | \| [`Query`](#query)
|
|
2941
|
+
| `source` | \| [`Query`](#query)\<[`DocumentData`](#documentdata)\> \| [`CollectionReference`](#collectionreference)\<[`DocumentData`](#documentdata)\> |
|
|
1873
2942
|
| `spec` | `S` |
|
|
1874
2943
|
|
|
1875
2944
|
#### Returns
|
|
@@ -1898,7 +2967,7 @@ Count documents matching the query. Returns a snapshot whose
|
|
|
1898
2967
|
|
|
1899
2968
|
| Parameter | Type |
|
|
1900
2969
|
| :------ | :------ |
|
|
1901
|
-
| `source` | \| [`Query`](#query)
|
|
2970
|
+
| `source` | \| [`Query`](#query)\<[`DocumentData`](#documentdata)\> \| [`CollectionReference`](#collectionreference)\<[`DocumentData`](#documentdata)\> |
|
|
1902
2971
|
|
|
1903
2972
|
#### Returns
|
|
1904
2973
|
|
|
@@ -1920,7 +2989,7 @@ function getDoc<T>(ref: DocumentReference<T>): Promise<DocumentSnapshot<T>>;
|
|
|
1920
2989
|
|
|
1921
2990
|
| Type Parameter | Default type |
|
|
1922
2991
|
| :------ | :------ |
|
|
1923
|
-
| `T` | `DocumentData` |
|
|
2992
|
+
| `T` | [`DocumentData`](#documentdata) |
|
|
1924
2993
|
|
|
1925
2994
|
#### Parameters
|
|
1926
2995
|
|
|
@@ -1952,7 +3021,7 @@ not a claim of parity.
|
|
|
1952
3021
|
|
|
1953
3022
|
| Type Parameter | Default type |
|
|
1954
3023
|
| :------ | :------ |
|
|
1955
|
-
| `T` | `DocumentData` |
|
|
3024
|
+
| `T` | [`DocumentData`](#documentdata) |
|
|
1956
3025
|
|
|
1957
3026
|
#### Parameters
|
|
1958
3027
|
|
|
@@ -1983,7 +3052,7 @@ same honest thing.
|
|
|
1983
3052
|
|
|
1984
3053
|
| Type Parameter | Default type |
|
|
1985
3054
|
| :------ | :------ |
|
|
1986
|
-
| `T` | `DocumentData` |
|
|
3055
|
+
| `T` | [`DocumentData`](#documentdata) |
|
|
1987
3056
|
|
|
1988
3057
|
#### Parameters
|
|
1989
3058
|
|
|
@@ -2009,7 +3078,7 @@ function getDocs<T>(query: Query<T>): Promise<QuerySnapshot<T>>;
|
|
|
2009
3078
|
|
|
2010
3079
|
| Type Parameter | Default type |
|
|
2011
3080
|
| :------ | :------ |
|
|
2012
|
-
| `T` | `DocumentData` |
|
|
3081
|
+
| `T` | [`DocumentData`](#documentdata) |
|
|
2013
3082
|
|
|
2014
3083
|
#### Parameters
|
|
2015
3084
|
|
|
@@ -2037,7 +3106,7 @@ Query-plural form of [getDocFromCache](#getdocfromcache) — same cache-miss div
|
|
|
2037
3106
|
|
|
2038
3107
|
| Type Parameter | Default type |
|
|
2039
3108
|
| :------ | :------ |
|
|
2040
|
-
| `T` | `DocumentData` |
|
|
3109
|
+
| `T` | [`DocumentData`](#documentdata) |
|
|
2041
3110
|
|
|
2042
3111
|
#### Parameters
|
|
2043
3112
|
|
|
@@ -2065,7 +3134,7 @@ Query-plural form of [getDocFromServer](#getdocfromserver).
|
|
|
2065
3134
|
|
|
2066
3135
|
| Type Parameter | Default type |
|
|
2067
3136
|
| :------ | :------ |
|
|
2068
|
-
| `T` | `DocumentData` |
|
|
3137
|
+
| `T` | [`DocumentData`](#documentdata) |
|
|
2069
3138
|
|
|
2070
3139
|
#### Parameters
|
|
2071
3140
|
|
|
@@ -2105,7 +3174,7 @@ input's shape:
|
|
|
2105
3174
|
|
|
2106
3175
|
| Parameter | Type |
|
|
2107
3176
|
| :------ | :------ |
|
|
2108
|
-
| `ctx` | `SandboxContext` |
|
|
3177
|
+
| `ctx` | [`SandboxContext`](#sandboxcontext) |
|
|
2109
3178
|
|
|
2110
3179
|
##### Returns
|
|
2111
3180
|
|
|
@@ -2157,7 +3226,7 @@ input's shape:
|
|
|
2157
3226
|
|
|
2158
3227
|
| Parameter | Type |
|
|
2159
3228
|
| :------ | :------ |
|
|
2160
|
-
| `sandbox` | `Sandbox` |
|
|
3229
|
+
| `sandbox` | [`Sandbox`](#sandbox) |
|
|
2161
3230
|
|
|
2162
3231
|
##### Returns
|
|
2163
3232
|
|
|
@@ -2209,7 +3278,7 @@ input's shape:
|
|
|
2209
3278
|
|
|
2210
3279
|
| Parameter | Type |
|
|
2211
3280
|
| :------ | :------ |
|
|
2212
|
-
| `app` | `FirebaseApp` |
|
|
3281
|
+
| `app` | [`FirebaseApp`](pyric-app-reference-api.md#firebaseapp) |
|
|
2213
3282
|
|
|
2214
3283
|
##### Returns
|
|
2215
3284
|
|
|
@@ -2288,7 +3357,10 @@ const db = getFirestore(app);
|
|
|
2288
3357
|
#### Call Signature
|
|
2289
3358
|
|
|
2290
3359
|
```ts
|
|
2291
|
-
function getFirestore(target?:
|
|
3360
|
+
function getFirestore(target?:
|
|
3361
|
+
| FirebaseApp
|
|
3362
|
+
| Sandbox
|
|
3363
|
+
| SandboxContext): Firestore;
|
|
2292
3364
|
```
|
|
2293
3365
|
|
|
2294
3366
|
Construct a Firestore handle. Three overloads dispatch by the
|
|
@@ -2307,7 +3379,7 @@ input's shape:
|
|
|
2307
3379
|
|
|
2308
3380
|
| Parameter | Type |
|
|
2309
3381
|
| :------ | :------ |
|
|
2310
|
-
| `target?` | `
|
|
3382
|
+
| `target?` | \| [`FirebaseApp`](pyric-app-reference-api.md#firebaseapp) \| [`Sandbox`](#sandbox) \| [`SandboxContext`](#sandboxcontext) |
|
|
2311
3383
|
|
|
2312
3384
|
##### Returns
|
|
2313
3385
|
|
|
@@ -2339,7 +3411,7 @@ const db = getFirestore(app);
|
|
|
2339
3411
|
|
|
2340
3412
|
***
|
|
2341
3413
|
|
|
2342
|
-
<a id="increment"></a>
|
|
3414
|
+
<a id="increment-2"></a>
|
|
2343
3415
|
|
|
2344
3416
|
### increment()
|
|
2345
3417
|
|
|
@@ -2355,7 +3427,7 @@ function increment(n: number): FieldValueSentinel;
|
|
|
2355
3427
|
|
|
2356
3428
|
#### Returns
|
|
2357
3429
|
|
|
2358
|
-
`FieldValueSentinel`
|
|
3430
|
+
[`FieldValueSentinel`](#fieldvaluesentinel)
|
|
2359
3431
|
|
|
2360
3432
|
***
|
|
2361
3433
|
|
|
@@ -2365,7 +3437,10 @@ function increment(n: number): FieldValueSentinel;
|
|
|
2365
3437
|
|
|
2366
3438
|
```ts
|
|
2367
3439
|
function initializeFirestore(
|
|
2368
|
-
app:
|
|
3440
|
+
app:
|
|
3441
|
+
| FirebaseApp
|
|
3442
|
+
| Sandbox
|
|
3443
|
+
| SandboxContext,
|
|
2369
3444
|
_settings?: FirestoreSettings,
|
|
2370
3445
|
_databaseId?: string): Firestore;
|
|
2371
3446
|
```
|
|
@@ -2381,7 +3456,7 @@ configure into existence.
|
|
|
2381
3456
|
|
|
2382
3457
|
| Parameter | Type |
|
|
2383
3458
|
| :------ | :------ |
|
|
2384
|
-
| `app` | `
|
|
3459
|
+
| `app` | \| [`FirebaseApp`](pyric-app-reference-api.md#firebaseapp) \| [`Sandbox`](#sandbox) \| [`SandboxContext`](#sandboxcontext) |
|
|
2385
3460
|
| `_settings?` | [`FirestoreSettings`](#firestoresettings) |
|
|
2386
3461
|
| `_databaseId?` | `string` |
|
|
2387
3462
|
|
|
@@ -2520,7 +3595,7 @@ function onSnapshot<T>(
|
|
|
2520
3595
|
|
|
2521
3596
|
| Type Parameter |
|
|
2522
3597
|
| :------ |
|
|
2523
|
-
| `T` *extends* \| [`DocumentReference`](#documentreference)
|
|
3598
|
+
| `T` *extends* \| [`DocumentReference`](#documentreference)\<[`DocumentData`](#documentdata)\> \| [`Query`](#query)\<[`DocumentData`](#documentdata)\> |
|
|
2524
3599
|
|
|
2525
3600
|
##### Parameters
|
|
2526
3601
|
|
|
@@ -2550,7 +3625,7 @@ function onSnapshot<T>(
|
|
|
2550
3625
|
|
|
2551
3626
|
| Type Parameter |
|
|
2552
3627
|
| :------ |
|
|
2553
|
-
| `T` *extends* \| [`DocumentReference`](#documentreference)
|
|
3628
|
+
| `T` *extends* \| [`DocumentReference`](#documentreference)\<[`DocumentData`](#documentdata)\> \| [`Query`](#query)\<[`DocumentData`](#documentdata)\> |
|
|
2554
3629
|
|
|
2555
3630
|
##### Parameters
|
|
2556
3631
|
|
|
@@ -2641,7 +3716,7 @@ function orderBy(field: string | FieldPath, direction?: OrderDirection): QueryCo
|
|
|
2641
3716
|
| Parameter | Type |
|
|
2642
3717
|
| :------ | :------ |
|
|
2643
3718
|
| `field` | `string` \| [`FieldPath`](#fieldpath) |
|
|
2644
|
-
| `direction?` | `OrderDirection` |
|
|
3719
|
+
| `direction?` | [`OrderDirection`](#orderdirection) |
|
|
2645
3720
|
|
|
2646
3721
|
#### Returns
|
|
2647
3722
|
|
|
@@ -2734,7 +3809,7 @@ function query<T>(source:
|
|
|
2734
3809
|
|
|
2735
3810
|
| Type Parameter | Default type |
|
|
2736
3811
|
| :------ | :------ |
|
|
2737
|
-
| `T` | `DocumentData` |
|
|
3812
|
+
| `T` | [`DocumentData`](#documentdata) |
|
|
2738
3813
|
|
|
2739
3814
|
#### Parameters
|
|
2740
3815
|
|
|
@@ -2796,7 +3871,7 @@ function refEqual(a: DocumentReference, b: DocumentReference): boolean;
|
|
|
2796
3871
|
### runTransaction()
|
|
2797
3872
|
|
|
2798
3873
|
```ts
|
|
2799
|
-
function runTransaction<R>(db: Firestore, fn: (tx:
|
|
3874
|
+
function runTransaction<R>(db: Firestore, fn: (tx: Transaction) => R | Promise<R>): Promise<R>;
|
|
2800
3875
|
```
|
|
2801
3876
|
|
|
2802
3877
|
#### Type Parameters
|
|
@@ -2810,7 +3885,7 @@ function runTransaction<R>(db: Firestore, fn: (tx: ChainTransaction) => R | Prom
|
|
|
2810
3885
|
| Parameter | Type |
|
|
2811
3886
|
| :------ | :------ |
|
|
2812
3887
|
| `db` | [`Firestore`](#firestore) |
|
|
2813
|
-
| `fn` | (`tx`: `
|
|
3888
|
+
| `fn` | (`tx`: [`Transaction`](pyric-admin-firestore-reference-api.md#transaction)) => `R` \| `Promise`\<`R`\> |
|
|
2814
3889
|
|
|
2815
3890
|
#### Returns
|
|
2816
3891
|
|
|
@@ -2818,7 +3893,7 @@ function runTransaction<R>(db: Firestore, fn: (tx: ChainTransaction) => R | Prom
|
|
|
2818
3893
|
|
|
2819
3894
|
***
|
|
2820
3895
|
|
|
2821
|
-
<a id="servertimestamp"></a>
|
|
3896
|
+
<a id="servertimestamp-2"></a>
|
|
2822
3897
|
|
|
2823
3898
|
### serverTimestamp()
|
|
2824
3899
|
|
|
@@ -2828,7 +3903,7 @@ function serverTimestamp(): FieldValueSentinel;
|
|
|
2828
3903
|
|
|
2829
3904
|
#### Returns
|
|
2830
3905
|
|
|
2831
|
-
`FieldValueSentinel`
|
|
3906
|
+
[`FieldValueSentinel`](#fieldvaluesentinel)
|
|
2832
3907
|
|
|
2833
3908
|
***
|
|
2834
3909
|
|
|
@@ -2847,7 +3922,7 @@ options?: SetOptions): Promise<void>;
|
|
|
2847
3922
|
|
|
2848
3923
|
| Type Parameter | Default type |
|
|
2849
3924
|
| :------ | :------ |
|
|
2850
|
-
| `T` | `DocumentData` |
|
|
3925
|
+
| `T` | [`DocumentData`](#documentdata) |
|
|
2851
3926
|
|
|
2852
3927
|
#### Parameters
|
|
2853
3928
|
|
|
@@ -2905,8 +3980,8 @@ function snapshotEqual(a:
|
|
|
2905
3980
|
|
|
2906
3981
|
| Parameter | Type |
|
|
2907
3982
|
| :------ | :------ |
|
|
2908
|
-
| `a` | \| [`DocumentSnapshot`](#documentsnapshot)
|
|
2909
|
-
| `b` | \| [`DocumentSnapshot`](#documentsnapshot)
|
|
3983
|
+
| `a` | \| [`DocumentSnapshot`](#documentsnapshot)\<[`DocumentData`](#documentdata)\> \| [`QuerySnapshot`](#querysnapshot)\<[`DocumentData`](#documentdata)\> |
|
|
3984
|
+
| `b` | \| [`DocumentSnapshot`](#documentsnapshot)\<[`DocumentData`](#documentdata)\> \| [`QuerySnapshot`](#querysnapshot)\<[`DocumentData`](#documentdata)\> |
|
|
2910
3985
|
|
|
2911
3986
|
#### Returns
|
|
2912
3987
|
|
|
@@ -3091,7 +4166,7 @@ against the same path.
|
|
|
3091
4166
|
| Parameter | Type |
|
|
3092
4167
|
| :------ | :------ |
|
|
3093
4168
|
| `ref` | [`DocumentReference`](#documentreference) |
|
|
3094
|
-
| `data` | `DocumentData` |
|
|
4169
|
+
| `data` | [`DocumentData`](#documentdata) |
|
|
3095
4170
|
|
|
3096
4171
|
#### Returns
|
|
3097
4172
|
|
|
@@ -3162,7 +4237,7 @@ function where(
|
|
|
3162
4237
|
| Parameter | Type |
|
|
3163
4238
|
| :------ | :------ |
|
|
3164
4239
|
| `field` | `string` \| [`FieldPath`](#fieldpath) |
|
|
3165
|
-
| `op` | `WhereFilterOp` |
|
|
4240
|
+
| `op` | [`WhereFilterOp`](#wherefilterop) |
|
|
3166
4241
|
| `value` | `unknown` |
|
|
3167
4242
|
|
|
3168
4243
|
#### Returns
|
|
@@ -3186,13 +4261,13 @@ function withConverter<AppModel, DbModel>(ref: DocumentReference<DocumentData>,
|
|
|
3186
4261
|
| Type Parameter | Default type |
|
|
3187
4262
|
| :------ | :------ |
|
|
3188
4263
|
| `AppModel` | - |
|
|
3189
|
-
| `DbModel` *extends* `DocumentData` | `DocumentData` |
|
|
4264
|
+
| `DbModel` *extends* [`DocumentData`](#documentdata) | [`DocumentData`](#documentdata) |
|
|
3190
4265
|
|
|
3191
4266
|
##### Parameters
|
|
3192
4267
|
|
|
3193
4268
|
| Parameter | Type |
|
|
3194
4269
|
| :------ | :------ |
|
|
3195
|
-
| `ref` | [`DocumentReference`](#documentreference)
|
|
4270
|
+
| `ref` | [`DocumentReference`](#documentreference)\<[`DocumentData`](#documentdata)\> |
|
|
3196
4271
|
| `converter` | [`FirestoreDataConverter`](#firestoredataconverter)\<`AppModel`, `DbModel`\> |
|
|
3197
4272
|
|
|
3198
4273
|
##### Returns
|
|
@@ -3214,7 +4289,7 @@ function withConverter(ref: DocumentReference<unknown>, converter: null): Docume
|
|
|
3214
4289
|
|
|
3215
4290
|
##### Returns
|
|
3216
4291
|
|
|
3217
|
-
[`DocumentReference`](#documentreference)
|
|
4292
|
+
[`DocumentReference`](#documentreference)\<[`DocumentData`](#documentdata)\>
|
|
3218
4293
|
|
|
3219
4294
|
#### Call Signature
|
|
3220
4295
|
|
|
@@ -3227,13 +4302,13 @@ function withConverter<AppModel, DbModel>(ref: CollectionReference<DocumentData>
|
|
|
3227
4302
|
| Type Parameter | Default type |
|
|
3228
4303
|
| :------ | :------ |
|
|
3229
4304
|
| `AppModel` | - |
|
|
3230
|
-
| `DbModel` *extends* `DocumentData` | `DocumentData` |
|
|
4305
|
+
| `DbModel` *extends* [`DocumentData`](#documentdata) | [`DocumentData`](#documentdata) |
|
|
3231
4306
|
|
|
3232
4307
|
##### Parameters
|
|
3233
4308
|
|
|
3234
4309
|
| Parameter | Type |
|
|
3235
4310
|
| :------ | :------ |
|
|
3236
|
-
| `ref` | [`CollectionReference`](#collectionreference)
|
|
4311
|
+
| `ref` | [`CollectionReference`](#collectionreference)\<[`DocumentData`](#documentdata)\> |
|
|
3237
4312
|
| `converter` | [`FirestoreDataConverter`](#firestoredataconverter)\<`AppModel`, `DbModel`\> |
|
|
3238
4313
|
|
|
3239
4314
|
##### Returns
|
|
@@ -3255,7 +4330,7 @@ function withConverter(ref: CollectionReference<unknown>, converter: null): Coll
|
|
|
3255
4330
|
|
|
3256
4331
|
##### Returns
|
|
3257
4332
|
|
|
3258
|
-
[`CollectionReference`](#collectionreference)
|
|
4333
|
+
[`CollectionReference`](#collectionreference)\<[`DocumentData`](#documentdata)\>
|
|
3259
4334
|
|
|
3260
4335
|
#### Call Signature
|
|
3261
4336
|
|
|
@@ -3268,13 +4343,13 @@ function withConverter<AppModel, DbModel>(q: Query<DocumentData>, converter: Fir
|
|
|
3268
4343
|
| Type Parameter | Default type |
|
|
3269
4344
|
| :------ | :------ |
|
|
3270
4345
|
| `AppModel` | - |
|
|
3271
|
-
| `DbModel` *extends* `DocumentData` | `DocumentData` |
|
|
4346
|
+
| `DbModel` *extends* [`DocumentData`](#documentdata) | [`DocumentData`](#documentdata) |
|
|
3272
4347
|
|
|
3273
4348
|
##### Parameters
|
|
3274
4349
|
|
|
3275
4350
|
| Parameter | Type |
|
|
3276
4351
|
| :------ | :------ |
|
|
3277
|
-
| `q` | [`Query`](#query)
|
|
4352
|
+
| `q` | [`Query`](#query)\<[`DocumentData`](#documentdata)\> |
|
|
3278
4353
|
| `converter` | [`FirestoreDataConverter`](#firestoredataconverter)\<`AppModel`, `DbModel`\> |
|
|
3279
4354
|
|
|
3280
4355
|
##### Returns
|
|
@@ -3296,7 +4371,7 @@ function withConverter(q: Query<unknown>, converter: null): Query<DocumentData>;
|
|
|
3296
4371
|
|
|
3297
4372
|
##### Returns
|
|
3298
4373
|
|
|
3299
|
-
[`Query`](#query)
|
|
4374
|
+
[`Query`](#query)\<[`DocumentData`](#documentdata)\>
|
|
3300
4375
|
|
|
3301
4376
|
***
|
|
3302
4377
|
|
|
@@ -3305,7 +4380,7 @@ function withConverter(q: Query<unknown>, converter: null): Query<DocumentData>;
|
|
|
3305
4380
|
### writeBatch()
|
|
3306
4381
|
|
|
3307
4382
|
```ts
|
|
3308
|
-
function writeBatch(db: Firestore):
|
|
4383
|
+
function writeBatch(db: Firestore): WriteBatch;
|
|
3309
4384
|
```
|
|
3310
4385
|
|
|
3311
4386
|
#### Parameters
|
|
@@ -3316,84 +4391,4 @@ function writeBatch(db: Firestore): ChainWriteBatch;
|
|
|
3316
4391
|
|
|
3317
4392
|
#### Returns
|
|
3318
4393
|
|
|
3319
|
-
`
|
|
3320
|
-
|
|
3321
|
-
## References
|
|
3322
|
-
|
|
3323
|
-
<a id="documentdata"></a>
|
|
3324
|
-
|
|
3325
|
-
### DocumentData
|
|
3326
|
-
|
|
3327
|
-
Renames and re-exports [AuthState](#authstate)
|
|
3328
|
-
|
|
3329
|
-
***
|
|
3330
|
-
|
|
3331
|
-
<a id="fieldvalue"></a>
|
|
3332
|
-
|
|
3333
|
-
### FieldValue
|
|
3334
|
-
|
|
3335
|
-
Renames and re-exports [AuthState](#authstate)
|
|
3336
|
-
|
|
3337
|
-
***
|
|
3338
|
-
|
|
3339
|
-
<a id="fieldvaluesentinel"></a>
|
|
3340
|
-
|
|
3341
|
-
### FieldValueSentinel
|
|
3342
|
-
|
|
3343
|
-
Renames and re-exports [AuthState](#authstate)
|
|
3344
|
-
|
|
3345
|
-
***
|
|
3346
|
-
|
|
3347
|
-
<a id="lintresult"></a>
|
|
3348
|
-
|
|
3349
|
-
### LintResult
|
|
3350
|
-
|
|
3351
|
-
Renames and re-exports [AuthState](#authstate)
|
|
3352
|
-
|
|
3353
|
-
***
|
|
3354
|
-
|
|
3355
|
-
<a id="orderdirection"></a>
|
|
3356
|
-
|
|
3357
|
-
### OrderDirection
|
|
3358
|
-
|
|
3359
|
-
Renames and re-exports [AuthState](#authstate)
|
|
3360
|
-
|
|
3361
|
-
***
|
|
3362
|
-
|
|
3363
|
-
<a id="sandbox"></a>
|
|
3364
|
-
|
|
3365
|
-
### Sandbox
|
|
3366
|
-
|
|
3367
|
-
Renames and re-exports [AuthState](#authstate)
|
|
3368
|
-
|
|
3369
|
-
***
|
|
3370
|
-
|
|
3371
|
-
<a id="sandboxcontext"></a>
|
|
3372
|
-
|
|
3373
|
-
### SandboxContext
|
|
3374
|
-
|
|
3375
|
-
Renames and re-exports [AuthState](#authstate)
|
|
3376
|
-
|
|
3377
|
-
***
|
|
3378
|
-
|
|
3379
|
-
<a id="sandboxerror"></a>
|
|
3380
|
-
|
|
3381
|
-
### SandboxError
|
|
3382
|
-
|
|
3383
|
-
Renames and re-exports [AuthState](#authstate)
|
|
3384
|
-
|
|
3385
|
-
***
|
|
3386
|
-
|
|
3387
|
-
<a id="timestamp"></a>
|
|
3388
|
-
|
|
3389
|
-
### Timestamp
|
|
3390
|
-
|
|
3391
|
-
Renames and re-exports [AuthState](#authstate)
|
|
3392
|
-
|
|
3393
|
-
***
|
|
3394
|
-
|
|
3395
|
-
<a id="wherefilterop"></a>
|
|
3396
|
-
|
|
3397
|
-
### WhereFilterOp
|
|
3398
|
-
|
|
3399
|
-
Renames and re-exports [AuthState](#authstate)
|
|
4394
|
+
[`WriteBatch`](pyric-admin-firestore-reference-api.md#writebatch)
|