@pyric/cli 0.1.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +216 -0
- package/README.md +180 -0
- package/README.md.orig +141 -0
- package/dist/assurance/.generated/conformance-verdicts.d.ts +1071 -0
- package/dist/assurance/.generated/conformance-verdicts.d.ts.map +1 -0
- package/dist/assurance/.generated/conformance-verdicts.js +1070 -0
- package/dist/assurance/.generated/conformance-verdicts.js.map +1 -0
- package/dist/assurance/attachment.d.ts +24 -0
- package/dist/assurance/attachment.d.ts.map +1 -0
- package/dist/assurance/attachment.js +138 -0
- package/dist/assurance/attachment.js.map +1 -0
- package/dist/assurance/browser.d.ts +7 -0
- package/dist/assurance/browser.d.ts.map +1 -0
- package/dist/assurance/browser.js +68 -0
- package/dist/assurance/browser.js.map +1 -0
- package/dist/assurance/campaign.d.ts +41 -0
- package/dist/assurance/campaign.d.ts.map +1 -0
- package/dist/assurance/campaign.js +364 -0
- package/dist/assurance/campaign.js.map +1 -0
- package/dist/assurance/capabilities.d.ts +11 -0
- package/dist/assurance/capabilities.d.ts.map +1 -0
- package/dist/assurance/capabilities.js +282 -0
- package/dist/assurance/capabilities.js.map +1 -0
- package/dist/assurance/cases.d.ts +14 -0
- package/dist/assurance/cases.d.ts.map +1 -0
- package/dist/assurance/cases.js +27 -0
- package/dist/assurance/cases.js.map +1 -0
- package/dist/assurance/index.d.ts +10 -0
- package/dist/assurance/index.d.ts.map +1 -0
- package/dist/assurance/index.js +9 -0
- package/dist/assurance/index.js.map +1 -0
- package/dist/assurance/runner.d.ts +3 -0
- package/dist/assurance/runner.d.ts.map +1 -0
- package/dist/assurance/runner.js +633 -0
- package/dist/assurance/runner.js.map +1 -0
- package/dist/assurance/tool-names.d.ts +4 -0
- package/dist/assurance/tool-names.d.ts.map +1 -0
- package/dist/assurance/tool-names.js +14 -0
- package/dist/assurance/tool-names.js.map +1 -0
- package/dist/assurance/tools.d.ts +19 -0
- package/dist/assurance/tools.d.ts.map +1 -0
- package/dist/assurance/tools.js +737 -0
- package/dist/assurance/tools.js.map +1 -0
- package/dist/assurance/types.d.ts +347 -0
- package/dist/assurance/types.d.ts.map +1 -0
- package/dist/assurance/types.js +7 -0
- package/dist/assurance/types.js.map +1 -0
- package/dist/assurance/validation.d.ts +8 -0
- package/dist/assurance/validation.d.ts.map +1 -0
- package/dist/assurance/validation.js +269 -0
- package/dist/assurance/validation.js.map +1 -0
- package/dist/bridge/client/bridge.d.ts +133 -0
- package/dist/bridge/client/bridge.d.ts.map +1 -0
- package/dist/bridge/client/bridge.js +429 -0
- package/dist/bridge/client/bridge.js.map +1 -0
- package/dist/bridge/client/dispatch.d.ts +41 -0
- package/dist/bridge/client/dispatch.d.ts.map +1 -0
- package/dist/bridge/client/dispatch.js +111 -0
- package/dist/bridge/client/dispatch.js.map +1 -0
- package/dist/bridge/client.d.ts +24 -0
- package/dist/bridge/client.d.ts.map +1 -0
- package/dist/bridge/client.js +26 -0
- package/dist/bridge/client.js.map +1 -0
- package/dist/bridge/protocol.d.ts +227 -0
- package/dist/bridge/protocol.d.ts.map +1 -0
- package/dist/bridge/protocol.js +131 -0
- package/dist/bridge/protocol.js.map +1 -0
- package/dist/bridge/server/audit.d.ts +19 -0
- package/dist/bridge/server/audit.d.ts.map +1 -0
- package/dist/bridge/server/audit.js +46 -0
- package/dist/bridge/server/audit.js.map +1 -0
- package/dist/bridge/server/bridge.d.ts +126 -0
- package/dist/bridge/server/bridge.d.ts.map +1 -0
- package/dist/bridge/server/bridge.js +383 -0
- package/dist/bridge/server/bridge.js.map +1 -0
- package/dist/bridge/server/headless.d.ts +36 -0
- package/dist/bridge/server/headless.d.ts.map +1 -0
- package/dist/bridge/server/headless.js +142 -0
- package/dist/bridge/server/headless.js.map +1 -0
- package/dist/bridge/server/json-schema-to-zod.d.ts +37 -0
- package/dist/bridge/server/json-schema-to-zod.d.ts.map +1 -0
- package/dist/bridge/server/json-schema-to-zod.js +93 -0
- package/dist/bridge/server/json-schema-to-zod.js.map +1 -0
- package/dist/bridge/server/local-bridge.d.ts +33 -0
- package/dist/bridge/server/local-bridge.d.ts.map +1 -0
- package/dist/bridge/server/local-bridge.js +41 -0
- package/dist/bridge/server/local-bridge.js.map +1 -0
- package/dist/bridge/server/logger.d.ts +28 -0
- package/dist/bridge/server/logger.d.ts.map +1 -0
- package/dist/bridge/server/logger.js +42 -0
- package/dist/bridge/server/logger.js.map +1 -0
- package/dist/bridge/server/mcp-contract.d.ts +21 -0
- package/dist/bridge/server/mcp-contract.d.ts.map +1 -0
- package/dist/bridge/server/mcp-contract.js +63 -0
- package/dist/bridge/server/mcp-contract.js.map +1 -0
- package/dist/bridge/server/mcp.d.ts +26 -0
- package/dist/bridge/server/mcp.d.ts.map +1 -0
- package/dist/bridge/server/mcp.js +102 -0
- package/dist/bridge/server/mcp.js.map +1 -0
- package/dist/bridge/server/peer.d.ts +39 -0
- package/dist/bridge/server/peer.d.ts.map +1 -0
- package/dist/bridge/server/peer.js +189 -0
- package/dist/bridge/server/peer.js.map +1 -0
- package/dist/bridge/server/standalone.d.ts +49 -0
- package/dist/bridge/server/standalone.d.ts.map +1 -0
- package/dist/bridge/server/standalone.js +267 -0
- package/dist/bridge/server/standalone.js.map +1 -0
- package/dist/bridge/server/tool-metadata.d.ts +38 -0
- package/dist/bridge/server/tool-metadata.d.ts.map +1 -0
- package/dist/bridge/server/tool-metadata.js +84 -0
- package/dist/bridge/server/tool-metadata.js.map +1 -0
- package/dist/bridge/server.d.ts +21 -0
- package/dist/bridge/server.d.ts.map +1 -0
- package/dist/bridge/server.js +18 -0
- package/dist/bridge/server.js.map +1 -0
- package/dist/cli/can-i-use.d.ts +5 -0
- package/dist/cli/can-i-use.d.ts.map +1 -0
- package/dist/cli/can-i-use.js +49 -0
- package/dist/cli/can-i-use.js.map +1 -0
- package/dist/cli/database-rules.d.ts +43 -0
- package/dist/cli/database-rules.d.ts.map +1 -0
- package/dist/cli/database-rules.js +261 -0
- package/dist/cli/database-rules.js.map +1 -0
- package/dist/cli/dev-runner.d.ts +112 -0
- package/dist/cli/dev-runner.d.ts.map +1 -0
- package/dist/cli/dev-runner.js +239 -0
- package/dist/cli/dev-runner.js.map +1 -0
- package/dist/cli/firebase-json.d.ts +66 -0
- package/dist/cli/firebase-json.d.ts.map +1 -0
- package/dist/cli/firebase-json.js +60 -0
- package/dist/cli/firebase-json.js.map +1 -0
- package/dist/cli/firestore-indexes.d.ts +21 -0
- package/dist/cli/firestore-indexes.d.ts.map +1 -0
- package/dist/cli/firestore-indexes.js +39 -0
- package/dist/cli/firestore-indexes.js.map +1 -0
- package/dist/cli/index.d.ts +56 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +387 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init.d.ts +50 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +182 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/mcp-proxy.d.ts +10 -0
- package/dist/cli/mcp-proxy.d.ts.map +1 -0
- package/dist/cli/mcp-proxy.js +129 -0
- package/dist/cli/mcp-proxy.js.map +1 -0
- package/dist/cli/parse-args.d.ts +20 -0
- package/dist/cli/parse-args.d.ts.map +1 -0
- package/dist/cli/parse-args.js +74 -0
- package/dist/cli/parse-args.js.map +1 -0
- package/dist/cli/rules.d.ts +55 -0
- package/dist/cli/rules.d.ts.map +1 -0
- package/dist/cli/rules.js +199 -0
- package/dist/cli/rules.js.map +1 -0
- package/dist/cli/scope.d.ts +12 -0
- package/dist/cli/scope.d.ts.map +1 -0
- package/dist/cli/scope.js +44 -0
- package/dist/cli/scope.js.map +1 -0
- package/dist/cli/serve.d.ts +122 -0
- package/dist/cli/serve.d.ts.map +1 -0
- package/dist/cli/serve.js +844 -0
- package/dist/cli/serve.js.map +1 -0
- package/dist/cli/service-commands.d.ts +8 -0
- package/dist/cli/service-commands.d.ts.map +1 -0
- package/dist/cli/service-commands.js +58 -0
- package/dist/cli/service-commands.js.map +1 -0
- package/dist/cli/snapshot.d.ts +22 -0
- package/dist/cli/snapshot.d.ts.map +1 -0
- package/dist/cli/snapshot.js +139 -0
- package/dist/cli/snapshot.js.map +1 -0
- package/dist/cli/storage-rules.d.ts +21 -0
- package/dist/cli/storage-rules.d.ts.map +1 -0
- package/dist/cli/storage-rules.js +121 -0
- package/dist/cli/storage-rules.js.map +1 -0
- package/dist/cli/verify.d.ts +23 -0
- package/dist/cli/verify.d.ts.map +1 -0
- package/dist/cli/verify.js +349 -0
- package/dist/cli/verify.js.map +1 -0
- package/dist/conformance/.generated/can-i-use-browser.d.ts +44 -0
- package/dist/conformance/.generated/can-i-use-browser.d.ts.map +1 -0
- package/dist/conformance/.generated/can-i-use-browser.js +67 -0
- package/dist/conformance/.generated/can-i-use-browser.js.map +1 -0
- package/dist/conformance/.generated/can-i-use.d.ts +61 -0
- package/dist/conformance/.generated/can-i-use.d.ts.map +1 -0
- package/dist/conformance/.generated/can-i-use.js +68 -0
- package/dist/conformance/.generated/can-i-use.js.map +1 -0
- package/dist/conformance/browser.d.ts +7 -0
- package/dist/conformance/browser.d.ts.map +1 -0
- package/dist/conformance/browser.js +8 -0
- package/dist/conformance/browser.js.map +1 -0
- package/dist/conformance/can-i-use-tool.d.ts +21 -0
- package/dist/conformance/can-i-use-tool.d.ts.map +1 -0
- package/dist/conformance/can-i-use-tool.js +40 -0
- package/dist/conformance/can-i-use-tool.js.map +1 -0
- package/dist/conformance/can-i-use.d.ts +6 -0
- package/dist/conformance/can-i-use.d.ts.map +1 -0
- package/dist/conformance/can-i-use.js +10 -0
- package/dist/conformance/can-i-use.js.map +1 -0
- package/dist/conformance/index.d.ts +8 -0
- package/dist/conformance/index.d.ts.map +1 -0
- package/dist/conformance/index.js +2 -0
- package/dist/conformance/index.js.map +1 -0
- package/dist/conformance/tools.d.ts +4 -0
- package/dist/conformance/tools.d.ts.map +1 -0
- package/dist/conformance/tools.js +14 -0
- package/dist/conformance/tools.js.map +1 -0
- package/dist/credentials/core/memoize-ttl.d.ts +58 -0
- package/dist/credentials/core/memoize-ttl.d.ts.map +1 -0
- package/dist/credentials/core/memoize-ttl.js +88 -0
- package/dist/credentials/core/memoize-ttl.js.map +1 -0
- package/dist/credentials/core/types.d.ts +11 -0
- package/dist/credentials/core/types.d.ts.map +1 -0
- package/dist/credentials/core/types.js +2 -0
- package/dist/credentials/core/types.js.map +1 -0
- package/dist/credentials/node/from-adc.d.ts +10 -0
- package/dist/credentials/node/from-adc.d.ts.map +1 -0
- package/dist/credentials/node/from-adc.js +76 -0
- package/dist/credentials/node/from-adc.js.map +1 -0
- package/dist/credentials/node/from-service-account.d.ts +24 -0
- package/dist/credentials/node/from-service-account.d.ts.map +1 -0
- package/dist/credentials/node/from-service-account.js +108 -0
- package/dist/credentials/node/from-service-account.js.map +1 -0
- package/dist/credentials/node/index.d.ts +7 -0
- package/dist/credentials/node/index.d.ts.map +1 -0
- package/dist/credentials/node/index.js +7 -0
- package/dist/credentials/node/index.js.map +1 -0
- package/dist/discover/concurrency.d.ts +42 -0
- package/dist/discover/concurrency.d.ts.map +1 -0
- package/dist/discover/concurrency.js +113 -0
- package/dist/discover/concurrency.js.map +1 -0
- package/dist/discover/crawler-adapter.d.ts +48 -0
- package/dist/discover/crawler-adapter.d.ts.map +1 -0
- package/dist/discover/crawler-adapter.js +92 -0
- package/dist/discover/crawler-adapter.js.map +1 -0
- package/dist/discover/crawler.d.ts +294 -0
- package/dist/discover/crawler.d.ts.map +1 -0
- package/dist/discover/crawler.js +764 -0
- package/dist/discover/crawler.js.map +1 -0
- package/dist/discover/credential-free.d.ts +19 -0
- package/dist/discover/credential-free.d.ts.map +1 -0
- package/dist/discover/credential-free.js +18 -0
- package/dist/discover/credential-free.js.map +1 -0
- package/dist/discover/findCollectionGroup.d.ts +44 -0
- package/dist/discover/findCollectionGroup.d.ts.map +1 -0
- package/dist/discover/findCollectionGroup.js +81 -0
- package/dist/discover/findCollectionGroup.js.map +1 -0
- package/dist/discover/firestore-source.d.ts +60 -0
- package/dist/discover/firestore-source.d.ts.map +1 -0
- package/dist/discover/firestore-source.js +11 -0
- package/dist/discover/firestore-source.js.map +1 -0
- package/dist/discover/index.d.ts +3 -0
- package/dist/discover/index.d.ts.map +1 -0
- package/dist/discover/index.js +5 -0
- package/dist/discover/index.js.map +1 -0
- package/dist/discover/merge.d.ts +108 -0
- package/dist/discover/merge.d.ts.map +1 -0
- package/dist/discover/merge.js +394 -0
- package/dist/discover/merge.js.map +1 -0
- package/dist/discover/session.d.ts +116 -0
- package/dist/discover/session.d.ts.map +1 -0
- package/dist/discover/session.js +331 -0
- package/dist/discover/session.js.map +1 -0
- package/dist/discover/tools.d.ts +58 -0
- package/dist/discover/tools.d.ts.map +1 -0
- package/dist/discover/tools.js +115 -0
- package/dist/discover/tools.js.map +1 -0
- package/dist/discover/types.d.ts +190 -0
- package/dist/discover/types.d.ts.map +1 -0
- package/dist/discover/types.js +12 -0
- package/dist/discover/types.js.map +1 -0
- package/dist/discover/wire.d.ts +70 -0
- package/dist/discover/wire.d.ts.map +1 -0
- package/dist/discover/wire.js +309 -0
- package/dist/discover/wire.js.map +1 -0
- package/dist/functions-rtdb/child.d.ts +52 -0
- package/dist/functions-rtdb/child.d.ts.map +1 -0
- package/dist/functions-rtdb/child.js +283 -0
- package/dist/functions-rtdb/child.js.map +1 -0
- package/dist/functions-rtdb/delivery.d.ts +4 -0
- package/dist/functions-rtdb/delivery.d.ts.map +1 -0
- package/dist/functions-rtdb/delivery.js +2 -0
- package/dist/functions-rtdb/delivery.js.map +1 -0
- package/dist/functions-rtdb/discovery.d.ts +41 -0
- package/dist/functions-rtdb/discovery.d.ts.map +1 -0
- package/dist/functions-rtdb/discovery.js +86 -0
- package/dist/functions-rtdb/discovery.js.map +1 -0
- package/dist/functions-rtdb/event.d.ts +20 -0
- package/dist/functions-rtdb/event.d.ts.map +1 -0
- package/dist/functions-rtdb/event.js +45 -0
- package/dist/functions-rtdb/event.js.map +1 -0
- package/dist/functions-rtdb/execution.d.ts +20 -0
- package/dist/functions-rtdb/execution.d.ts.map +1 -0
- package/dist/functions-rtdb/execution.js +70 -0
- package/dist/functions-rtdb/execution.js.map +1 -0
- package/dist/functions-rtdb/in-memory-delivery.d.ts +9 -0
- package/dist/functions-rtdb/in-memory-delivery.d.ts.map +1 -0
- package/dist/functions-rtdb/in-memory-delivery.js +36 -0
- package/dist/functions-rtdb/in-memory-delivery.js.map +1 -0
- package/dist/functions-rtdb/project.d.ts +7 -0
- package/dist/functions-rtdb/project.d.ts.map +1 -0
- package/dist/functions-rtdb/project.js +54 -0
- package/dist/functions-rtdb/project.js.map +1 -0
- package/dist/functions-rtdb/projection.d.ts +14 -0
- package/dist/functions-rtdb/projection.d.ts.map +1 -0
- package/dist/functions-rtdb/projection.js +65 -0
- package/dist/functions-rtdb/projection.js.map +1 -0
- package/dist/functions-rtdb/reference-pattern.d.ts +5 -0
- package/dist/functions-rtdb/reference-pattern.d.ts.map +1 -0
- package/dist/functions-rtdb/reference-pattern.js +14 -0
- package/dist/functions-rtdb/reference-pattern.js.map +1 -0
- package/dist/functions-rtdb/remote-delivery.d.ts +9 -0
- package/dist/functions-rtdb/remote-delivery.d.ts.map +1 -0
- package/dist/functions-rtdb/remote-delivery.js +11 -0
- package/dist/functions-rtdb/remote-delivery.js.map +1 -0
- package/dist/pkg-version.d.ts +2 -0
- package/dist/pkg-version.d.ts.map +1 -0
- package/dist/pkg-version.js +47 -0
- package/dist/pkg-version.js.map +1 -0
- package/dist/register/esm-exports.d.ts +26 -0
- package/dist/register/esm-exports.d.ts.map +1 -0
- package/dist/register/esm-exports.js +61 -0
- package/dist/register/esm-exports.js.map +1 -0
- package/dist/register/hooks.d.ts +13 -0
- package/dist/register/hooks.d.ts.map +1 -0
- package/dist/register/hooks.js +15 -0
- package/dist/register/hooks.js.map +1 -0
- package/dist/register/index.d.ts +5 -0
- package/dist/register/index.d.ts.map +1 -0
- package/dist/register/index.js +124 -0
- package/dist/register/index.js.map +1 -0
- package/dist/register/mapping.d.ts +19 -0
- package/dist/register/mapping.d.ts.map +1 -0
- package/dist/register/mapping.js +35 -0
- package/dist/register/mapping.js.map +1 -0
- package/dist/remote/index.d.ts +232 -0
- package/dist/remote/index.d.ts.map +1 -0
- package/dist/remote/index.js +720 -0
- package/dist/remote/index.js.map +1 -0
- package/dist/rtdb/crawl-snapshot.d.ts +17 -0
- package/dist/rtdb/crawl-snapshot.d.ts.map +1 -0
- package/dist/rtdb/crawl-snapshot.js +72 -0
- package/dist/rtdb/crawl-snapshot.js.map +1 -0
- package/dist/rtdb/inspection.d.ts +8 -0
- package/dist/rtdb/inspection.d.ts.map +1 -0
- package/dist/rtdb/inspection.js +111 -0
- package/dist/rtdb/inspection.js.map +1 -0
- package/dist/rtdb/load-rules-document.d.ts +25 -0
- package/dist/rtdb/load-rules-document.d.ts.map +1 -0
- package/dist/rtdb/load-rules-document.js +38 -0
- package/dist/rtdb/load-rules-document.js.map +1 -0
- package/dist/rtdb/rules-generation-tool.d.ts +4 -0
- package/dist/rtdb/rules-generation-tool.d.ts.map +1 -0
- package/dist/rtdb/rules-generation-tool.js +35 -0
- package/dist/rtdb/rules-generation-tool.js.map +1 -0
- package/dist/rtdb/rules-json.d.ts +8 -0
- package/dist/rtdb/rules-json.d.ts.map +1 -0
- package/dist/rtdb/rules-json.js +17 -0
- package/dist/rtdb/rules-json.js.map +1 -0
- package/dist/serve/bridge-mount.d.ts +36 -0
- package/dist/serve/bridge-mount.d.ts.map +1 -0
- package/dist/serve/bridge-mount.js +162 -0
- package/dist/serve/bridge-mount.js.map +1 -0
- package/dist/serve/bundler.d.ts +110 -0
- package/dist/serve/bundler.d.ts.map +1 -0
- package/dist/serve/bundler.js +432 -0
- package/dist/serve/bundler.js.map +1 -0
- package/dist/serve/capture-store.d.ts +27 -0
- package/dist/serve/capture-store.d.ts.map +1 -0
- package/dist/serve/capture-store.js +47 -0
- package/dist/serve/capture-store.js.map +1 -0
- package/dist/serve/discovery.d.ts +71 -0
- package/dist/serve/discovery.d.ts.map +1 -0
- package/dist/serve/discovery.js +158 -0
- package/dist/serve/discovery.js.map +1 -0
- package/dist/serve/docs-ui/_astro/_slug_.DPUwShm2.css +1 -0
- package/dist/serve/docs-ui/docs/_rhythm/index.html +99 -0
- package/dist/serve/docs-ui/docs/_rhythm.md +97 -0
- package/dist/serve/docs-ui/docs/agent/set-up-your-agent/index.html +42 -0
- package/dist/serve/docs-ui/docs/agent/set-up-your-agent.md +72 -0
- package/dist/serve/docs-ui/docs/agent/watch-and-review/index.html +25 -0
- package/dist/serve/docs-ui/docs/agent/watch-and-review.md +38 -0
- package/dist/serve/docs-ui/docs/agent/work-with-an-agent/index.html +69 -0
- package/dist/serve/docs-ui/docs/agent/work-with-an-agent.md +74 -0
- package/dist/serve/docs-ui/docs/ai-compat/index.html +423 -0
- package/dist/serve/docs-ui/docs/ai-compat.md +456 -0
- package/dist/serve/docs-ui/docs/api-reference/index.html +66 -0
- package/dist/serve/docs-ui/docs/api-reference.md +69 -0
- package/dist/serve/docs-ui/docs/app-compat/index.html +159 -0
- package/dist/serve/docs-ui/docs/app-compat.md +178 -0
- package/dist/serve/docs-ui/docs/auth-compat/index.html +644 -0
- package/dist/serve/docs-ui/docs/auth-compat.md +701 -0
- package/dist/serve/docs-ui/docs/build/ai-logic/index.html +27 -0
- package/dist/serve/docs-ui/docs/build/ai-logic.md +39 -0
- package/dist/serve/docs-ui/docs/build/authentication/index.html +65 -0
- package/dist/serve/docs-ui/docs/build/authentication.md +95 -0
- package/dist/serve/docs-ui/docs/build/cloud-firestore/index.html +69 -0
- package/dist/serve/docs-ui/docs/build/cloud-firestore.md +93 -0
- package/dist/serve/docs-ui/docs/build/cloud-messaging/index.html +27 -0
- package/dist/serve/docs-ui/docs/build/cloud-messaging.md +37 -0
- package/dist/serve/docs-ui/docs/build/cloud-storage/index.html +65 -0
- package/dist/serve/docs-ui/docs/build/cloud-storage.md +86 -0
- package/dist/serve/docs-ui/docs/build/realtime-database/index.html +49 -0
- package/dist/serve/docs-ui/docs/build/realtime-database.md +67 -0
- package/dist/serve/docs-ui/docs/conformance-scores/index.html +49 -0
- package/dist/serve/docs-ui/docs/conformance-scores.md +53 -0
- package/dist/serve/docs-ui/docs/create-pyric-reference-api/index.html +498 -0
- package/dist/serve/docs-ui/docs/create-pyric-reference-api.md +345 -0
- package/dist/serve/docs-ui/docs/database-compat/index.html +1037 -0
- package/dist/serve/docs-ui/docs/database-compat.md +1099 -0
- package/dist/serve/docs-ui/docs/firestore-compat/index.html +823 -0
- package/dist/serve/docs-ui/docs/firestore-compat.md +881 -0
- package/dist/serve/docs-ui/docs/functions-rtdb-compat/index.html +72 -0
- package/dist/serve/docs-ui/docs/functions-rtdb-compat.md +83 -0
- package/dist/serve/docs-ui/docs/get-started/how-the-swap-works/index.html +27 -0
- package/dist/serve/docs-ui/docs/get-started/how-the-swap-works.md +50 -0
- package/dist/serve/docs-ui/docs/get-started/start-building/index.html +31 -0
- package/dist/serve/docs-ui/docs/get-started/start-building.md +53 -0
- package/dist/serve/docs-ui/docs/index.html +2 -0
- package/dist/serve/docs-ui/docs/index.json +11719 -0
- package/dist/serve/docs-ui/docs/messaging-compat/index.html +264 -0
- package/dist/serve/docs-ui/docs/messaging-compat.md +285 -0
- package/dist/serve/docs-ui/docs/observe/see-whats-happening/index.html +73 -0
- package/dist/serve/docs-ui/docs/observe/see-whats-happening.md +69 -0
- package/dist/serve/docs-ui/docs/observe/shape-your-data/index.html +44 -0
- package/dist/serve/docs-ui/docs/observe/shape-your-data.md +74 -0
- package/dist/serve/docs-ui/docs/overview/index.html +16 -0
- package/dist/serve/docs-ui/docs/overview.md +31 -0
- package/dist/serve/docs-ui/docs/pyric-admin-app-reference-api/index.html +185 -0
- package/dist/serve/docs-ui/docs/pyric-admin-app-reference-api.md +206 -0
- package/dist/serve/docs-ui/docs/pyric-admin-auth-reference-api/index.html +617 -0
- package/dist/serve/docs-ui/docs/pyric-admin-auth-reference-api.md +441 -0
- package/dist/serve/docs-ui/docs/pyric-admin-database-reference-api/index.html +583 -0
- package/dist/serve/docs-ui/docs/pyric-admin-database-reference-api.md +597 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-api/index.html +32 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-api.md +30 -0
- package/dist/serve/docs-ui/docs/pyric-admin-storage-reference-api/index.html +317 -0
- package/dist/serve/docs-ui/docs/pyric-admin-storage-reference-api.md +285 -0
- package/dist/serve/docs-ui/docs/pyric-ai-reference-api/index.html +5830 -0
- package/dist/serve/docs-ui/docs/pyric-ai-reference-api.md +5439 -0
- package/dist/serve/docs-ui/docs/pyric-ai-scripting-reference-api/index.html +159 -0
- package/dist/serve/docs-ui/docs/pyric-ai-scripting-reference-api.md +122 -0
- package/dist/serve/docs-ui/docs/pyric-app-reference-api/index.html +420 -0
- package/dist/serve/docs-ui/docs/pyric-app-reference-api.md +326 -0
- package/dist/serve/docs-ui/docs/pyric-auth-reference-api/index.html +5452 -0
- package/dist/serve/docs-ui/docs/pyric-auth-reference-api.md +5271 -0
- package/dist/serve/docs-ui/docs/pyric-cli-assurance-browser-reference-api/index.html +98 -0
- package/dist/serve/docs-ui/docs/pyric-cli-assurance-browser-reference-api.md +88 -0
- package/dist/serve/docs-ui/docs/pyric-cli-assurance-reference-api/index.html +2263 -0
- package/dist/serve/docs-ui/docs/pyric-cli-assurance-reference-api.md +1477 -0
- package/dist/serve/docs-ui/docs/pyric-cli-bridge-client-reference-api/index.html +546 -0
- package/dist/serve/docs-ui/docs/pyric-cli-bridge-client-reference-api.md +485 -0
- package/dist/serve/docs-ui/docs/pyric-cli-bridge-reference-api/index.html +506 -0
- package/dist/serve/docs-ui/docs/pyric-cli-bridge-reference-api.md +419 -0
- package/dist/serve/docs-ui/docs/pyric-cli-conformance-browser-reference-api/index.html +257 -0
- package/dist/serve/docs-ui/docs/pyric-cli-conformance-browser-reference-api.md +197 -0
- package/dist/serve/docs-ui/docs/pyric-cli-conformance-reference-api/index.html +307 -0
- package/dist/serve/docs-ui/docs/pyric-cli-conformance-reference-api.md +254 -0
- package/dist/serve/docs-ui/docs/pyric-cli-credentials-node-reference-api/index.html +67 -0
- package/dist/serve/docs-ui/docs/pyric-cli-credentials-node-reference-api.md +59 -0
- package/dist/serve/docs-ui/docs/pyric-cli-discover-reference-api/index.html +2355 -0
- package/dist/serve/docs-ui/docs/pyric-cli-discover-reference-api.md +2036 -0
- package/dist/serve/docs-ui/docs/pyric-cli-register-reference-api/index.html +10 -0
- package/dist/serve/docs-ui/docs/pyric-cli-register-reference-api.md +16 -0
- package/dist/serve/docs-ui/docs/pyric-cli-remote-reference-api/index.html +1044 -0
- package/dist/serve/docs-ui/docs/pyric-cli-remote-reference-api.md +952 -0
- package/dist/serve/docs-ui/docs/pyric-cli-serve-worker-reference-api/index.html +5041 -0
- package/dist/serve/docs-ui/docs/pyric-cli-serve-worker-reference-api.md +4739 -0
- package/dist/serve/docs-ui/docs/pyric-cli-verify-reference-api/index.html +926 -0
- package/dist/serve/docs-ui/docs/pyric-cli-verify-reference-api.md +586 -0
- package/dist/serve/docs-ui/docs/pyric-cli-vite-reference-api/index.html +102 -0
- package/dist/serve/docs-ui/docs/pyric-cli-vite-reference-api.md +76 -0
- package/dist/serve/docs-ui/docs/pyric-database-reference-api/index.html +1851 -0
- package/dist/serve/docs-ui/docs/pyric-database-reference-api.md +1842 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-api/index.html +3623 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-api.md +3399 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-values-reference-api/index.html +30 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-values-reference-api.md +30 -0
- package/dist/serve/docs-ui/docs/pyric-messaging-reference-api/index.html +508 -0
- package/dist/serve/docs-ui/docs/pyric-messaging-reference-api.md +374 -0
- package/dist/serve/docs-ui/docs/pyric-messaging-sw-reference-api/index.html +482 -0
- package/dist/serve/docs-ui/docs/pyric-messaging-sw-reference-api.md +348 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-api/index.html +2629 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-api.md +2213 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-database-reference-api/index.html +120 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-database-reference-api.md +110 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-firestore-reference-api/index.html +202 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-firestore-reference-api.md +134 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-api/index.html +5019 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-api.md +4060 -0
- package/dist/serve/docs-ui/docs/pyric-storage-reference-api/index.html +2120 -0
- package/dist/serve/docs-ui/docs/pyric-storage-reference-api.md +1687 -0
- package/dist/serve/docs-ui/docs/pyric-ui-agents-reference-api/index.html +638 -0
- package/dist/serve/docs-ui/docs/pyric-ui-agents-reference-api.md +430 -0
- package/dist/serve/docs-ui/docs/pyric-ui-auth-hooks-reference-api/index.html +813 -0
- package/dist/serve/docs-ui/docs/pyric-ui-auth-hooks-reference-api.md +634 -0
- package/dist/serve/docs-ui/docs/pyric-ui-auth-reference-api/index.html +1708 -0
- package/dist/serve/docs-ui/docs/pyric-ui-auth-reference-api.md +1300 -0
- package/dist/serve/docs-ui/docs/pyric-ui-events-hooks-reference-api/index.html +177 -0
- package/dist/serve/docs-ui/docs/pyric-ui-events-hooks-reference-api.md +111 -0
- package/dist/serve/docs-ui/docs/pyric-ui-events-reference-api/index.html +1542 -0
- package/dist/serve/docs-ui/docs/pyric-ui-events-reference-api.md +903 -0
- package/dist/serve/docs-ui/docs/pyric-ui-firestore-hooks-reference-api/index.html +1024 -0
- package/dist/serve/docs-ui/docs/pyric-ui-firestore-hooks-reference-api.md +640 -0
- package/dist/serve/docs-ui/docs/pyric-ui-firestore-reference-api/index.html +2753 -0
- package/dist/serve/docs-ui/docs/pyric-ui-firestore-reference-api.md +2171 -0
- package/dist/serve/docs-ui/docs/pyric-ui-primitives-reference-api/index.html +1005 -0
- package/dist/serve/docs-ui/docs/pyric-ui-primitives-reference-api.md +693 -0
- package/dist/serve/docs-ui/docs/pyric-ui-rtdb-reference-api/index.html +1388 -0
- package/dist/serve/docs-ui/docs/pyric-ui-rtdb-reference-api.md +1340 -0
- package/dist/serve/docs-ui/docs/pyric-ui-rules-hooks-reference-api/index.html +131 -0
- package/dist/serve/docs-ui/docs/pyric-ui-rules-hooks-reference-api.md +76 -0
- package/dist/serve/docs-ui/docs/pyric-ui-rules-reference-api/index.html +648 -0
- package/dist/serve/docs-ui/docs/pyric-ui-rules-reference-api.md +508 -0
- package/dist/serve/docs-ui/docs/pyric-ui-storage-hooks-reference-api/index.html +1457 -0
- package/dist/serve/docs-ui/docs/pyric-ui-storage-hooks-reference-api.md +1029 -0
- package/dist/serve/docs-ui/docs/pyric-ui-storage-reference-api/index.html +2476 -0
- package/dist/serve/docs-ui/docs/pyric-ui-storage-reference-api.md +1919 -0
- package/dist/serve/docs-ui/docs/pyric-ui-traffic-hooks-reference-api/index.html +1241 -0
- package/dist/serve/docs-ui/docs/pyric-ui-traffic-hooks-reference-api.md +817 -0
- package/dist/serve/docs-ui/docs/pyric-ui-traffic-reference-api/index.html +2289 -0
- package/dist/serve/docs-ui/docs/pyric-ui-traffic-reference-api.md +1489 -0
- package/dist/serve/docs-ui/docs/rules-compat/index.html +272 -0
- package/dist/serve/docs-ui/docs/rules-compat.md +287 -0
- package/dist/serve/docs-ui/docs/secure/audit-your-rules/index.html +34 -0
- package/dist/serve/docs-ui/docs/secure/audit-your-rules.md +67 -0
- package/dist/serve/docs-ui/docs/secure/firestore-rules-limits/index.html +105 -0
- package/dist/serve/docs-ui/docs/secure/firestore-rules-limits.md +152 -0
- package/dist/serve/docs-ui/docs/secure/read-a-denial/index.html +40 -0
- package/dist/serve/docs-ui/docs/secure/read-a-denial.md +58 -0
- package/dist/serve/docs-ui/docs/secure/rtdb-rules-in-typescript/index.html +66 -0
- package/dist/serve/docs-ui/docs/secure/rtdb-rules-in-typescript.md +89 -0
- package/dist/serve/docs-ui/docs/secure/rules-standard-library/index.html +158 -0
- package/dist/serve/docs-ui/docs/secure/rules-standard-library.md +116 -0
- package/dist/serve/docs-ui/docs/secure/secure-it-with-rules/index.html +46 -0
- package/dist/serve/docs-ui/docs/secure/secure-it-with-rules.md +51 -0
- package/dist/serve/docs-ui/docs/secure/simulate-and-lint/index.html +94 -0
- package/dist/serve/docs-ui/docs/secure/simulate-and-lint.md +86 -0
- package/dist/serve/docs-ui/docs/secure/write-a-rules-test-suite/index.html +81 -0
- package/dist/serve/docs-ui/docs/secure/write-a-rules-test-suite.md +105 -0
- package/dist/serve/docs-ui/docs/ship/ship-to-production/index.html +36 -0
- package/dist/serve/docs-ui/docs/ship/ship-to-production.md +64 -0
- package/dist/serve/docs-ui/docs/ship/test-in-node/index.html +74 -0
- package/dist/serve/docs-ui/docs/ship/test-in-node.md +94 -0
- package/dist/serve/docs-ui/docs/storage-compat/index.html +532 -0
- package/dist/serve/docs-ui/docs/storage-compat.md +577 -0
- package/dist/serve/docs-ui/docs/trust/how-we-know-it-matches-firebase/index.html +131 -0
- package/dist/serve/docs-ui/docs/trust/how-we-know-it-matches-firebase.md +155 -0
- package/dist/serve/docs-ui/docs/trust/versioning-and-compatibility/index.html +13 -0
- package/dist/serve/docs-ui/docs/trust/versioning-and-compatibility.md +21 -0
- package/dist/serve/docs-ui/index.html +1 -0
- package/dist/serve/docs-ui/llms.txt +123 -0
- package/dist/serve/entries/ai.d.ts +4 -0
- package/dist/serve/entries/ai.d.ts.map +1 -0
- package/dist/serve/entries/ai.js +184 -0
- package/dist/serve/entries/ai.js.map +1 -0
- package/dist/serve/entries/app-backend.d.ts +2 -0
- package/dist/serve/entries/app-backend.d.ts.map +1 -0
- package/dist/serve/entries/app-backend.js +4 -0
- package/dist/serve/entries/app-backend.js.map +1 -0
- package/dist/serve/entries/app-client.d.ts +5 -0
- package/dist/serve/entries/app-client.d.ts.map +1 -0
- package/dist/serve/entries/app-client.js +23 -0
- package/dist/serve/entries/app-client.js.map +1 -0
- package/dist/serve/entries/app-session-store.d.ts +14 -0
- package/dist/serve/entries/app-session-store.d.ts.map +1 -0
- package/dist/serve/entries/app-session-store.js +37 -0
- package/dist/serve/entries/app-session-store.js.map +1 -0
- package/dist/serve/entries/app.d.ts +2 -0
- package/dist/serve/entries/app.d.ts.map +1 -0
- package/dist/serve/entries/app.js +10 -0
- package/dist/serve/entries/app.js.map +1 -0
- package/dist/serve/entries/auth-helper-core.d.ts +52 -0
- package/dist/serve/entries/auth-helper-core.d.ts.map +1 -0
- package/dist/serve/entries/auth-helper-core.js +118 -0
- package/dist/serve/entries/auth-helper-core.js.map +1 -0
- package/dist/serve/entries/auth-helper-dom.d.ts +14 -0
- package/dist/serve/entries/auth-helper-dom.d.ts.map +1 -0
- package/dist/serve/entries/auth-helper-dom.js +116 -0
- package/dist/serve/entries/auth-helper-dom.js.map +1 -0
- package/dist/serve/entries/auth-helper-runtime.d.ts +5 -0
- package/dist/serve/entries/auth-helper-runtime.d.ts.map +1 -0
- package/dist/serve/entries/auth-helper-runtime.js +11 -0
- package/dist/serve/entries/auth-helper-runtime.js.map +1 -0
- package/dist/serve/entries/auth.d.ts +77 -0
- package/dist/serve/entries/auth.d.ts.map +1 -0
- package/dist/serve/entries/auth.js +201 -0
- package/dist/serve/entries/auth.js.map +1 -0
- package/dist/serve/entries/bridge-url.d.ts +25 -0
- package/dist/serve/entries/bridge-url.d.ts.map +1 -0
- package/dist/serve/entries/bridge-url.js +30 -0
- package/dist/serve/entries/bridge-url.js.map +1 -0
- package/dist/serve/entries/database.d.ts +46 -0
- package/dist/serve/entries/database.d.ts.map +1 -0
- package/dist/serve/entries/database.js +80 -0
- package/dist/serve/entries/database.js.map +1 -0
- package/dist/serve/entries/firestore.d.ts +104 -0
- package/dist/serve/entries/firestore.d.ts.map +1 -0
- package/dist/serve/entries/firestore.js +202 -0
- package/dist/serve/entries/firestore.js.map +1 -0
- package/dist/serve/entries/init.d.ts +2 -0
- package/dist/serve/entries/init.d.ts.map +1 -0
- package/dist/serve/entries/init.js +40 -0
- package/dist/serve/entries/init.js.map +1 -0
- package/dist/serve/entries/keepalive.d.ts +20 -0
- package/dist/serve/entries/keepalive.d.ts.map +1 -0
- package/dist/serve/entries/keepalive.js +38 -0
- package/dist/serve/entries/keepalive.js.map +1 -0
- package/dist/serve/entries/messaging-sw.d.ts +10 -0
- package/dist/serve/entries/messaging-sw.d.ts.map +1 -0
- package/dist/serve/entries/messaging-sw.js +36 -0
- package/dist/serve/entries/messaging-sw.js.map +1 -0
- package/dist/serve/entries/messaging.d.ts +11 -0
- package/dist/serve/entries/messaging.d.ts.map +1 -0
- package/dist/serve/entries/messaging.js +53 -0
- package/dist/serve/entries/messaging.js.map +1 -0
- package/dist/serve/entries/runtime.d.ts +46 -0
- package/dist/serve/entries/runtime.d.ts.map +1 -0
- package/dist/serve/entries/runtime.js +435 -0
- package/dist/serve/entries/runtime.js.map +1 -0
- package/dist/serve/entries/session-store.d.ts +48 -0
- package/dist/serve/entries/session-store.d.ts.map +1 -0
- package/dist/serve/entries/session-store.js +82 -0
- package/dist/serve/entries/session-store.js.map +1 -0
- package/dist/serve/entries/storage.d.ts +25 -0
- package/dist/serve/entries/storage.d.ts.map +1 -0
- package/dist/serve/entries/storage.js +61 -0
- package/dist/serve/entries/storage.js.map +1 -0
- package/dist/serve/entries/tab-sync-wiring.d.ts +88 -0
- package/dist/serve/entries/tab-sync-wiring.d.ts.map +1 -0
- package/dist/serve/entries/tab-sync-wiring.js +217 -0
- package/dist/serve/entries/tab-sync-wiring.js.map +1 -0
- package/dist/serve/entries/worker-runtime.d.ts +10 -0
- package/dist/serve/entries/worker-runtime.d.ts.map +1 -0
- package/dist/serve/entries/worker-runtime.js +59 -0
- package/dist/serve/entries/worker-runtime.js.map +1 -0
- package/dist/serve/init-payload.d.ts +21 -0
- package/dist/serve/init-payload.d.ts.map +1 -0
- package/dist/serve/init-payload.js +2 -0
- package/dist/serve/init-payload.js.map +1 -0
- package/dist/serve/namespace.d.ts +73 -0
- package/dist/serve/namespace.d.ts.map +1 -0
- package/dist/serve/namespace.js +470 -0
- package/dist/serve/namespace.js.map +1 -0
- package/dist/serve/open-browser.d.ts +23 -0
- package/dist/serve/open-browser.d.ts.map +1 -0
- package/dist/serve/open-browser.js +58 -0
- package/dist/serve/open-browser.js.map +1 -0
- package/dist/serve/rules.d.ts +77 -0
- package/dist/serve/rules.d.ts.map +1 -0
- package/dist/serve/rules.js +202 -0
- package/dist/serve/rules.js.map +1 -0
- package/dist/serve/sandbox-marker.d.ts +9 -0
- package/dist/serve/sandbox-marker.d.ts.map +1 -0
- package/dist/serve/sandbox-marker.js +31 -0
- package/dist/serve/sandbox-marker.js.map +1 -0
- package/dist/serve/server.d.ts +135 -0
- package/dist/serve/server.d.ts.map +1 -0
- package/dist/serve/server.js +328 -0
- package/dist/serve/server.js.map +1 -0
- package/dist/serve/standalone-assets.d.ts +67 -0
- package/dist/serve/standalone-assets.d.ts.map +1 -0
- package/dist/serve/standalone-assets.js +134 -0
- package/dist/serve/standalone-assets.js.map +1 -0
- package/dist/serve/state-store.d.ts +45 -0
- package/dist/serve/state-store.d.ts.map +1 -0
- package/dist/serve/state-store.js +120 -0
- package/dist/serve/state-store.js.map +1 -0
- package/dist/serve/studio/disk-project-store.d.ts +9 -0
- package/dist/serve/studio/disk-project-store.d.ts.map +1 -0
- package/dist/serve/studio/disk-project-store.js +173 -0
- package/dist/serve/studio/disk-project-store.js.map +1 -0
- package/dist/serve/studio/disk-workspace.d.ts +14 -0
- package/dist/serve/studio/disk-workspace.d.ts.map +1 -0
- package/dist/serve/studio/disk-workspace.js +152 -0
- package/dist/serve/studio/disk-workspace.js.map +1 -0
- package/dist/serve/studio/index.d.ts +10 -0
- package/dist/serve/studio/index.d.ts.map +1 -0
- package/dist/serve/studio/index.js +9 -0
- package/dist/serve/studio/index.js.map +1 -0
- package/dist/serve/studio/routes.d.ts +40 -0
- package/dist/serve/studio/routes.d.ts.map +1 -0
- package/dist/serve/studio/routes.js +182 -0
- package/dist/serve/studio/routes.js.map +1 -0
- package/dist/serve/studio/store-types.d.ts +45 -0
- package/dist/serve/studio/store-types.d.ts.map +1 -0
- package/dist/serve/studio/store-types.js +11 -0
- package/dist/serve/studio/store-types.js.map +1 -0
- package/dist/serve/studio-ui/assets/RulesCodeEditor-CXdSLKhO.js +23 -0
- package/dist/serve/studio-ui/assets/index-BlSGru_r.css +1 -0
- package/dist/serve/studio-ui/assets/index-BvtQIpGn.js +1211 -0
- package/dist/serve/studio-ui/assets/seed-3DMedLL3.js +2 -0
- package/dist/serve/studio-ui/index.html +32 -0
- package/dist/serve/studio-ui/pyric-logo.svg +76 -0
- package/dist/serve/vite-plugin.d.ts +57 -0
- package/dist/serve/vite-plugin.d.ts.map +1 -0
- package/dist/serve/vite-plugin.js +664 -0
- package/dist/serve/vite-plugin.js.map +1 -0
- package/dist/serve/worker/client/admin-firestore.d.ts +18 -0
- package/dist/serve/worker/client/admin-firestore.d.ts.map +1 -0
- package/dist/serve/worker/client/admin-firestore.js +26 -0
- package/dist/serve/worker/client/admin-firestore.js.map +1 -0
- package/dist/serve/worker/client/ai.d.ts +31 -0
- package/dist/serve/worker/client/ai.d.ts.map +1 -0
- package/dist/serve/worker/client/ai.js +89 -0
- package/dist/serve/worker/client/ai.js.map +1 -0
- package/dist/serve/worker/client/auth.d.ts +168 -0
- package/dist/serve/worker/client/auth.d.ts.map +1 -0
- package/dist/serve/worker/client/auth.js +322 -0
- package/dist/serve/worker/client/auth.js.map +1 -0
- package/dist/serve/worker/client/connection.d.ts +80 -0
- package/dist/serve/worker/client/connection.d.ts.map +1 -0
- package/dist/serve/worker/client/connection.js +148 -0
- package/dist/serve/worker/client/connection.js.map +1 -0
- package/dist/serve/worker/client/core.d.ts +109 -0
- package/dist/serve/worker/client/core.d.ts.map +1 -0
- package/dist/serve/worker/client/core.js +248 -0
- package/dist/serve/worker/client/core.js.map +1 -0
- package/dist/serve/worker/client/disconnect.d.ts +7 -0
- package/dist/serve/worker/client/disconnect.d.ts.map +1 -0
- package/dist/serve/worker/client/disconnect.js +26 -0
- package/dist/serve/worker/client/disconnect.js.map +1 -0
- package/dist/serve/worker/client/firestore-reads.d.ts +49 -0
- package/dist/serve/worker/client/firestore-reads.d.ts.map +1 -0
- package/dist/serve/worker/client/firestore-reads.js +139 -0
- package/dist/serve/worker/client/firestore-reads.js.map +1 -0
- package/dist/serve/worker/client/firestore-refs.d.ts +54 -0
- package/dist/serve/worker/client/firestore-refs.d.ts.map +1 -0
- package/dist/serve/worker/client/firestore-refs.js +167 -0
- package/dist/serve/worker/client/firestore-refs.js.map +1 -0
- package/dist/serve/worker/client/firestore-writes.d.ts +70 -0
- package/dist/serve/worker/client/firestore-writes.d.ts.map +1 -0
- package/dist/serve/worker/client/firestore-writes.js +169 -0
- package/dist/serve/worker/client/firestore-writes.js.map +1 -0
- package/dist/serve/worker/client/handles.d.ts +73 -0
- package/dist/serve/worker/client/handles.d.ts.map +1 -0
- package/dist/serve/worker/client/handles.js +4 -0
- package/dist/serve/worker/client/handles.js.map +1 -0
- package/dist/serve/worker/client/messaging.d.ts +16 -0
- package/dist/serve/worker/client/messaging.d.ts.map +1 -0
- package/dist/serve/worker/client/messaging.js +60 -0
- package/dist/serve/worker/client/messaging.js.map +1 -0
- package/dist/serve/worker/client/presence.d.ts +43 -0
- package/dist/serve/worker/client/presence.d.ts.map +1 -0
- package/dist/serve/worker/client/presence.js +132 -0
- package/dist/serve/worker/client/presence.js.map +1 -0
- package/dist/serve/worker/client/rtdb.d.ts +36 -0
- package/dist/serve/worker/client/rtdb.d.ts.map +1 -0
- package/dist/serve/worker/client/rtdb.js +241 -0
- package/dist/serve/worker/client/rtdb.js.map +1 -0
- package/dist/serve/worker/client/rules.d.ts +24 -0
- package/dist/serve/worker/client/rules.d.ts.map +1 -0
- package/dist/serve/worker/client/rules.js +44 -0
- package/dist/serve/worker/client/rules.js.map +1 -0
- package/dist/serve/worker/client/service-worker-connection.d.ts +3 -0
- package/dist/serve/worker/client/service-worker-connection.d.ts.map +1 -0
- package/dist/serve/worker/client/service-worker-connection.js +53 -0
- package/dist/serve/worker/client/service-worker-connection.js.map +1 -0
- package/dist/serve/worker/client/snapshots.d.ts +32 -0
- package/dist/serve/worker/client/snapshots.d.ts.map +1 -0
- package/dist/serve/worker/client/snapshots.js +46 -0
- package/dist/serve/worker/client/snapshots.js.map +1 -0
- package/dist/serve/worker/client/storage.d.ts +64 -0
- package/dist/serve/worker/client/storage.d.ts.map +1 -0
- package/dist/serve/worker/client/storage.js +125 -0
- package/dist/serve/worker/client/storage.js.map +1 -0
- package/dist/serve/worker/client/studio.d.ts +32 -0
- package/dist/serve/worker/client/studio.d.ts.map +1 -0
- package/dist/serve/worker/client/studio.js +61 -0
- package/dist/serve/worker/client/studio.js.map +1 -0
- package/dist/serve/worker/client.d.ts +43 -0
- package/dist/serve/worker/client.d.ts.map +1 -0
- package/dist/serve/worker/client.js +44 -0
- package/dist/serve/worker/client.js.map +1 -0
- package/dist/serve/worker/entry.d.ts +40 -0
- package/dist/serve/worker/entry.d.ts.map +1 -0
- package/dist/serve/worker/entry.js +144 -0
- package/dist/serve/worker/entry.js.map +1 -0
- package/dist/serve/worker/host/admin-firestore.d.ts +17 -0
- package/dist/serve/worker/host/admin-firestore.d.ts.map +1 -0
- package/dist/serve/worker/host/admin-firestore.js +92 -0
- package/dist/serve/worker/host/admin-firestore.js.map +1 -0
- package/dist/serve/worker/host/connection.d.ts +40 -0
- package/dist/serve/worker/host/connection.d.ts.map +1 -0
- package/dist/serve/worker/host/connection.js +153 -0
- package/dist/serve/worker/host/connection.js.map +1 -0
- package/dist/serve/worker/host/core.d.ts +159 -0
- package/dist/serve/worker/host/core.d.ts.map +1 -0
- package/dist/serve/worker/host/core.js +296 -0
- package/dist/serve/worker/host/core.js.map +1 -0
- package/dist/serve/worker/host/dispatch.d.ts +34 -0
- package/dist/serve/worker/host/dispatch.d.ts.map +1 -0
- package/dist/serve/worker/host/dispatch.js +267 -0
- package/dist/serve/worker/host/dispatch.js.map +1 -0
- package/dist/serve/worker/host/firestore-reads.d.ts +17 -0
- package/dist/serve/worker/host/firestore-reads.d.ts.map +1 -0
- package/dist/serve/worker/host/firestore-reads.js +108 -0
- package/dist/serve/worker/host/firestore-reads.js.map +1 -0
- package/dist/serve/worker/host/firestore-writes.d.ts +37 -0
- package/dist/serve/worker/host/firestore-writes.d.ts.map +1 -0
- package/dist/serve/worker/host/firestore-writes.js +409 -0
- package/dist/serve/worker/host/firestore-writes.js.map +1 -0
- package/dist/serve/worker/host/presence.d.ts +38 -0
- package/dist/serve/worker/host/presence.d.ts.map +1 -0
- package/dist/serve/worker/host/presence.js +280 -0
- package/dist/serve/worker/host/presence.js.map +1 -0
- package/dist/serve/worker/host/rtdb.d.ts +18 -0
- package/dist/serve/worker/host/rtdb.d.ts.map +1 -0
- package/dist/serve/worker/host/rtdb.js +128 -0
- package/dist/serve/worker/host/rtdb.js.map +1 -0
- package/dist/serve/worker/host/rules.d.ts +17 -0
- package/dist/serve/worker/host/rules.d.ts.map +1 -0
- package/dist/serve/worker/host/rules.js +118 -0
- package/dist/serve/worker/host/rules.js.map +1 -0
- package/dist/serve/worker/host/storage.d.ts +19 -0
- package/dist/serve/worker/host/storage.d.ts.map +1 -0
- package/dist/serve/worker/host/storage.js +260 -0
- package/dist/serve/worker/host/storage.js.map +1 -0
- package/dist/serve/worker/host/studio.d.ts +13 -0
- package/dist/serve/worker/host/studio.d.ts.map +1 -0
- package/dist/serve/worker/host/studio.js +30 -0
- package/dist/serve/worker/host/studio.js.map +1 -0
- package/dist/serve/worker/host/subscriptions.d.ts +21 -0
- package/dist/serve/worker/host/subscriptions.d.ts.map +1 -0
- package/dist/serve/worker/host/subscriptions.js +162 -0
- package/dist/serve/worker/host/subscriptions.js.map +1 -0
- package/dist/serve/worker/host-ai.d.ts +59 -0
- package/dist/serve/worker/host-ai.d.ts.map +1 -0
- package/dist/serve/worker/host-ai.js +158 -0
- package/dist/serve/worker/host-ai.js.map +1 -0
- package/dist/serve/worker/host-auth.d.ts +47 -0
- package/dist/serve/worker/host-auth.d.ts.map +1 -0
- package/dist/serve/worker/host-auth.js +464 -0
- package/dist/serve/worker/host-auth.js.map +1 -0
- package/dist/serve/worker/host-context.d.ts +220 -0
- package/dist/serve/worker/host-context.d.ts.map +1 -0
- package/dist/serve/worker/host-context.js +45 -0
- package/dist/serve/worker/host-context.js.map +1 -0
- package/dist/serve/worker/host-events.d.ts +21 -0
- package/dist/serve/worker/host-events.d.ts.map +1 -0
- package/dist/serve/worker/host-events.js +87 -0
- package/dist/serve/worker/host-events.js.map +1 -0
- package/dist/serve/worker/host-messaging.d.ts +60 -0
- package/dist/serve/worker/host-messaging.d.ts.map +1 -0
- package/dist/serve/worker/host-messaging.js +226 -0
- package/dist/serve/worker/host-messaging.js.map +1 -0
- package/dist/serve/worker/host.d.ts +36 -0
- package/dist/serve/worker/host.d.ts.map +1 -0
- package/dist/serve/worker/host.js +39 -0
- package/dist/serve/worker/host.js.map +1 -0
- package/dist/serve/worker/index.d.ts +22 -0
- package/dist/serve/worker/index.d.ts.map +1 -0
- package/dist/serve/worker/index.js +61 -0
- package/dist/serve/worker/index.js.map +1 -0
- package/dist/serve/worker/presence-timing.d.ts +14 -0
- package/dist/serve/worker/presence-timing.d.ts.map +1 -0
- package/dist/serve/worker/presence-timing.js +14 -0
- package/dist/serve/worker/presence-timing.js.map +1 -0
- package/dist/serve/worker/protocol.d.ts +1150 -0
- package/dist/serve/worker/protocol.d.ts.map +1 -0
- package/dist/serve/worker/protocol.js +228 -0
- package/dist/serve/worker/protocol.js.map +1 -0
- package/dist/serve/worker/serve-init.d.ts +201 -0
- package/dist/serve/worker/serve-init.d.ts.map +1 -0
- package/dist/serve/worker/serve-init.js +579 -0
- package/dist/serve/worker/serve-init.js.map +1 -0
- package/dist/serve/worker/service-worker-channel.d.ts +23 -0
- package/dist/serve/worker/service-worker-channel.d.ts.map +1 -0
- package/dist/serve/worker/service-worker-channel.js +9 -0
- package/dist/serve/worker/service-worker-channel.js.map +1 -0
- package/dist/serve/worker/service-worker-relay.d.ts +22 -0
- package/dist/serve/worker/service-worker-relay.d.ts.map +1 -0
- package/dist/serve/worker/service-worker-relay.js +63 -0
- package/dist/serve/worker/service-worker-relay.js.map +1 -0
- package/dist/serve/writer-lock.d.ts +32 -0
- package/dist/serve/writer-lock.d.ts.map +1 -0
- package/dist/serve/writer-lock.js +43 -0
- package/dist/serve/writer-lock.js.map +1 -0
- package/dist/verify/cases.d.ts +37 -0
- package/dist/verify/cases.d.ts.map +1 -0
- package/dist/verify/cases.js +173 -0
- package/dist/verify/cases.js.map +1 -0
- package/dist/verify/fixture.d.ts +100 -0
- package/dist/verify/fixture.d.ts.map +1 -0
- package/dist/verify/fixture.js +156 -0
- package/dist/verify/fixture.js.map +1 -0
- package/dist/verify/index.d.ts +102 -0
- package/dist/verify/index.d.ts.map +1 -0
- package/dist/verify/index.js +318 -0
- package/dist/verify/index.js.map +1 -0
- package/dist/verify/tools.d.ts +7 -0
- package/dist/verify/tools.d.ts.map +1 -0
- package/dist/verify/tools.js +83 -0
- package/dist/verify/tools.js.map +1 -0
- package/dist/version/compat-target.d.ts +18 -0
- package/dist/version/compat-target.d.ts.map +1 -0
- package/dist/version/compat-target.js +18 -0
- package/dist/version/compat-target.js.map +1 -0
- package/dist/vite.d.ts +12 -0
- package/dist/vite.d.ts.map +1 -0
- package/dist/vite.js +16 -0
- package/dist/vite.js.map +1 -0
- package/package.json +144 -0
|
@@ -0,0 +1,2213 @@
|
|
|
1
|
+
|
|
2
|
+
<!-- Generated from published package declarations via TypeDoc. Do not edit by hand; run bun run docs:api:generate. -->
|
|
3
|
+
|
|
4
|
+
## Classes
|
|
5
|
+
|
|
6
|
+
<a id="rulesassertionerror"></a>
|
|
7
|
+
|
|
8
|
+
### RulesAssertionError
|
|
9
|
+
|
|
10
|
+
Thrown by `assertCase` / a runner case's `run()` when the simulated
|
|
11
|
+
decision did not match the case's expectation. The message is the
|
|
12
|
+
rendered trace from `explainCase`, so a test runner surfaces the "why"
|
|
13
|
+
without extra wiring.
|
|
14
|
+
|
|
15
|
+
#### Extends
|
|
16
|
+
|
|
17
|
+
- `Error`
|
|
18
|
+
|
|
19
|
+
#### Constructors
|
|
20
|
+
|
|
21
|
+
<a id="constructor"></a>
|
|
22
|
+
|
|
23
|
+
##### Constructor
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
new RulesAssertionError(message: string): RulesAssertionError;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
###### Parameters
|
|
30
|
+
|
|
31
|
+
| Parameter | Type |
|
|
32
|
+
| :------ | :------ |
|
|
33
|
+
| `message` | `string` |
|
|
34
|
+
|
|
35
|
+
###### Returns
|
|
36
|
+
|
|
37
|
+
[`RulesAssertionError`](#rulesassertionerror)
|
|
38
|
+
|
|
39
|
+
###### Overrides
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
Error.constructor
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
***
|
|
46
|
+
|
|
47
|
+
<a id="rulescompileerror"></a>
|
|
48
|
+
|
|
49
|
+
### RulesCompileError
|
|
50
|
+
|
|
51
|
+
Thrown by `firestoreRules(source)` / `rtdbRules(...)` when the source
|
|
52
|
+
cannot compile. Carries the compile-blocking issues on `.issues` so a
|
|
53
|
+
caller can surface them without re-parsing.
|
|
54
|
+
|
|
55
|
+
#### Extends
|
|
56
|
+
|
|
57
|
+
- `Error`
|
|
58
|
+
|
|
59
|
+
#### Constructors
|
|
60
|
+
|
|
61
|
+
<a id="constructor-1"></a>
|
|
62
|
+
|
|
63
|
+
##### Constructor
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
new RulesCompileError(message: string, issues: RuleIssue[]): RulesCompileError;
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
###### Parameters
|
|
70
|
+
|
|
71
|
+
| Parameter | Type |
|
|
72
|
+
| :------ | :------ |
|
|
73
|
+
| `message` | `string` |
|
|
74
|
+
| `issues` | [`RuleIssue`](#ruleissue)[] |
|
|
75
|
+
|
|
76
|
+
###### Returns
|
|
77
|
+
|
|
78
|
+
[`RulesCompileError`](#rulescompileerror)
|
|
79
|
+
|
|
80
|
+
###### Overrides
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
Error.constructor
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
#### Properties
|
|
87
|
+
|
|
88
|
+
| Property | Modifier | Type |
|
|
89
|
+
| :------ | :------ | :------ |
|
|
90
|
+
| <a id="issues"></a> `issues` | `readonly` | [`RuleIssue`](#ruleissue)[] |
|
|
91
|
+
|
|
92
|
+
***
|
|
93
|
+
|
|
94
|
+
<a id="rulesunsupportederror"></a>
|
|
95
|
+
|
|
96
|
+
### RulesUnsupportedError
|
|
97
|
+
|
|
98
|
+
Thrown by `assertCase` / a runner case's `run()` when the simulator
|
|
99
|
+
abstained — it hit a feature it does not implement, so neither a pass nor
|
|
100
|
+
a genuine failure can be asserted. Distinct from
|
|
101
|
+
[RulesAssertionError](#rulesassertionerror) so a runner can choose to skip rather than
|
|
102
|
+
fail on a known simulator gap.
|
|
103
|
+
|
|
104
|
+
#### Extends
|
|
105
|
+
|
|
106
|
+
- `Error`
|
|
107
|
+
|
|
108
|
+
#### Constructors
|
|
109
|
+
|
|
110
|
+
<a id="constructor-2"></a>
|
|
111
|
+
|
|
112
|
+
##### Constructor
|
|
113
|
+
|
|
114
|
+
```ts
|
|
115
|
+
new RulesUnsupportedError(message: string): RulesUnsupportedError;
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
###### Parameters
|
|
119
|
+
|
|
120
|
+
| Parameter | Type |
|
|
121
|
+
| :------ | :------ |
|
|
122
|
+
| `message` | `string` |
|
|
123
|
+
|
|
124
|
+
###### Returns
|
|
125
|
+
|
|
126
|
+
[`RulesUnsupportedError`](#rulesunsupportederror)
|
|
127
|
+
|
|
128
|
+
###### Overrides
|
|
129
|
+
|
|
130
|
+
```ts
|
|
131
|
+
Error.constructor
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Interfaces
|
|
135
|
+
|
|
136
|
+
<a id="caseresult"></a>
|
|
137
|
+
|
|
138
|
+
### CaseResult
|
|
139
|
+
|
|
140
|
+
The outcome of running one Firestore case through `simulate`. Never a
|
|
141
|
+
thrown error — a denied or abstained case is data, not an exception.
|
|
142
|
+
|
|
143
|
+
#### Properties
|
|
144
|
+
|
|
145
|
+
| Property | Type | Description |
|
|
146
|
+
| :------ | :------ | :------ |
|
|
147
|
+
| <a id="case"></a> `case` | [`FirestoreCase`](#firestorecase) | The case that produced this result. |
|
|
148
|
+
| <a id="decision"></a> `decision` | `"ALLOW"` \| `"DENY"` \| `"UNSUPPORTED"` | The engine's absolute verdict, independent of expectation. |
|
|
149
|
+
| <a id="description"></a> `description` | `string` | - |
|
|
150
|
+
| <a id="expectation"></a> `expectation` | `"ALLOW"` \| `"DENY"` | - |
|
|
151
|
+
| <a id="notes"></a> `notes` | `string`[] | Top-level diagnostic strings. |
|
|
152
|
+
| <a id="passed"></a> `passed` | `boolean` | `true` when `decision` matched `expectation`. |
|
|
153
|
+
| <a id="pathresolution"></a> `pathResolution?` | [`PathResolutionTrace`](#pathresolutiontrace) | Which match blocks the resolver considered and where each fell apart. |
|
|
154
|
+
| <a id="trace"></a> `trace` | [`RuleEvaluation`](#ruleevaluation)[] | Per-rule evaluation entries in source order. |
|
|
155
|
+
| <a id="unsupported"></a> `unsupported` | `boolean` | `true` when the simulator abstained on a feature it does not implement — neither a pass nor a genuine failure. |
|
|
156
|
+
|
|
157
|
+
***
|
|
158
|
+
|
|
159
|
+
<a id="evaluatedruleinfo"></a>
|
|
160
|
+
|
|
161
|
+
### EvaluatedRuleInfo
|
|
162
|
+
|
|
163
|
+
The DECIDING rule's source position + sub-expression trace, projected from a
|
|
164
|
+
TestResult — for BOTH verdicts: the `allow` rule that granted an
|
|
165
|
+
ALLOW, or the rule responsible for a DENY. Additive companion to
|
|
166
|
+
renderLegacyDebugMessages: that flattens the per-rule trace to
|
|
167
|
+
strings (dropping `line` and `expressionTrace`); this preserves the
|
|
168
|
+
structured detail a UI needs to point at the exact source line and step
|
|
169
|
+
through the evaluation ("show the work"). Position/trace fields are optional
|
|
170
|
+
so a partial trace projects honestly.
|
|
171
|
+
|
|
172
|
+
#### Properties
|
|
173
|
+
|
|
174
|
+
| Property | Type | Description |
|
|
175
|
+
| :------ | :------ | :------ |
|
|
176
|
+
| <a id="expression"></a> `expression?` | `string` | Pretty-printed condition text of the deciding rule. |
|
|
177
|
+
| <a id="expressiontrace"></a> `expressionTrace?` | [`ExprTraceEntry`](#exprtraceentry)[] | Per-sub-expression evaluation trace of the deciding rule. |
|
|
178
|
+
| <a id="line"></a> `line?` | `number` | 1-indexed source line of the deciding `allow` rule. |
|
|
179
|
+
| <a id="verdict"></a> `verdict` | `"allow"` \| `"deny"` | The verdict the deciding rule produced for the op. |
|
|
180
|
+
|
|
181
|
+
***
|
|
182
|
+
|
|
183
|
+
<a id="explanation"></a>
|
|
184
|
+
|
|
185
|
+
### Explanation
|
|
186
|
+
|
|
187
|
+
The structured account of why one Firestore case resolved as it did.
|
|
188
|
+
|
|
189
|
+
#### Properties
|
|
190
|
+
|
|
191
|
+
| Property | Type | Description |
|
|
192
|
+
| :------ | :------ | :------ |
|
|
193
|
+
| <a id="deciding"></a> `deciding?` | [`EvaluatedRuleInfo`](#evaluatedruleinfo) | The deciding `allow` rule (line, condition text, sub-expression trace), when one was evaluated. Absent on default-deny / abstain. |
|
|
194
|
+
| <a id="decision-1"></a> `decision` | `"ALLOW"` \| `"DENY"` \| `"UNSUPPORTED"` | - |
|
|
195
|
+
| <a id="expectation-1"></a> `expectation` | `"ALLOW"` \| `"DENY"` | - |
|
|
196
|
+
| <a id="notes-1"></a> `notes` | `string`[] | - |
|
|
197
|
+
| <a id="passed-1"></a> `passed` | `boolean` | - |
|
|
198
|
+
| <a id="pathresolution-1"></a> `pathResolution?` | [`PathResolutionTrace`](#pathresolutiontrace) | - |
|
|
199
|
+
| <a id="trace-1"></a> `trace` | [`RuleEvaluation`](#ruleevaluation)[] | - |
|
|
200
|
+
| <a id="unsupported-1"></a> `unsupported` | `boolean` | - |
|
|
201
|
+
|
|
202
|
+
***
|
|
203
|
+
|
|
204
|
+
<a id="exprtraceentry"></a>
|
|
205
|
+
|
|
206
|
+
### ExprTraceEntry
|
|
207
|
+
|
|
208
|
+
One entry in the per-rule expression trace recorded by `TraceRecorder`.
|
|
209
|
+
|
|
210
|
+
Trace entries are emitted in evaluation order. The tree shape is
|
|
211
|
+
reconstructable via `parent`: root entries have `parent: null`, and
|
|
212
|
+
each child entry's `parent` is the array index of its evaluating
|
|
213
|
+
ancestor. This is denser than nested objects for transport (a tool
|
|
214
|
+
call returns a single flat array) and easier for the agent to scan
|
|
215
|
+
top-to-bottom.
|
|
216
|
+
|
|
217
|
+
`value` carries the evaluation result. For nodes that threw, see
|
|
218
|
+
`error`; for short-circuit skips, `skipped: true` is set instead.
|
|
219
|
+
|
|
220
|
+
#### Properties
|
|
221
|
+
|
|
222
|
+
| Property | Type | Description |
|
|
223
|
+
| :------ | :------ | :------ |
|
|
224
|
+
| <a id="error"></a> `error?` | `string` | Error message when the expression threw. The wrapper still re-throws; this captures the diagnostic for the caller. |
|
|
225
|
+
| <a id="inlinedfrom"></a> `inlinedFrom?` | \{ `name`: `string`; \} | Set on entries recorded *inside* a user-defined function's body (after parameter binding). Carries the enclosing function's name so the agent can filter the trace by frame — `entries.filter(e => e.inlinedFrom?.name === 'isOwner')` — without walking the parent chain to find the surrounding `functionCall`. Parameter expressions are *not* tagged: they evaluate in the caller's scope, before the frame is entered. The `functionCall` entry itself is recorded in the caller's frame too, so a top-level `isOwner()` shows `inlinedFrom: undefined` on the `functionCall`, but `'isOwner'` on its body children. |
|
|
226
|
+
| `inlinedFrom.name` | `string` | - |
|
|
227
|
+
| <a id="kind"></a> `kind` | \| `"literal"` \| `"identifier"` \| `"memberAccess"` \| `"methodCall"` \| `"bracketAccess"` \| `"sliceAccess"` \| `"binaryOp"` \| `"unaryOp"` \| `"ternary"` \| `"inExpr"` \| `"isExpr"` \| `"listLiteral"` \| `"mapLiteral"` \| `"pathLiteral"` \| `"functionCall"` | AST node type — useful for filtering by structural kind. |
|
|
228
|
+
| <a id="letbinding"></a> `letBinding?` | \{ `name`: `string`; \} | Set on entries that record a `let` binding evaluation inside a user-defined function. `value` holds the bound value. |
|
|
229
|
+
| `letBinding.name` | `string` | - |
|
|
230
|
+
| <a id="parent"></a> `parent` | `number` | Index of the parent entry in the trace array; null at the root. |
|
|
231
|
+
| <a id="skipped"></a> `skipped?` | `boolean` | True for an `&&` / `||` operand that was *not* evaluated due to short-circuit. The recorder emits a placeholder entry so the trace shape mirrors the surface AST. |
|
|
232
|
+
| <a id="source"></a> `source` | `string` | Pretty-printed source of the expression (via `assembleExpression`). |
|
|
233
|
+
| <a id="value"></a> `value?` | `unknown` | Evaluation result. Undefined when `skipped` or `error` is set. |
|
|
234
|
+
|
|
235
|
+
***
|
|
236
|
+
|
|
237
|
+
<a id="firestorecase"></a>
|
|
238
|
+
|
|
239
|
+
### FirestoreCase
|
|
240
|
+
|
|
241
|
+
One Firestore rules case: a single request plus the outcome it should
|
|
242
|
+
produce. Structurally identical to the engine's `TestCase` — re-exported
|
|
243
|
+
here under the public name so callers never reach into the engine seam.
|
|
244
|
+
|
|
245
|
+
#### Properties
|
|
246
|
+
|
|
247
|
+
| Property | Type | Description |
|
|
248
|
+
| :------ | :------ | :------ |
|
|
249
|
+
| <a id="auth"></a> `auth?` | \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | Auth context; `null`/omitted for unauthenticated. |
|
|
250
|
+
| `auth.token?` | `Record`\<`string`, `unknown`\> | - |
|
|
251
|
+
| `auth.uid` | `string` | - |
|
|
252
|
+
| <a id="data"></a> `data?` | `Record`\<`string`, `unknown`\> | `request.resource.data` for write operations. |
|
|
253
|
+
| <a id="description-1"></a> `description` | `string` | Human-readable description of what this case verifies. |
|
|
254
|
+
| <a id="expectation-2"></a> `expectation` | `"ALLOW"` \| `"DENY"` | Expected outcome. |
|
|
255
|
+
| <a id="functionmocks"></a> `functionMocks?` | \{ `function`: `"get"` \| `"exists"`; `path`: `string`; `result`: `boolean` \| `Record`\<`string`, `unknown`\>; \}[] | Mock `get()` / `exists()` calls the rules make. |
|
|
256
|
+
| <a id="method"></a> `method` | `"get"` \| `"list"` \| `"create"` \| `"update"` \| `"delete"` | Firestore method under test. |
|
|
257
|
+
| <a id="path"></a> `path` | `string` | Document path, e.g. `"users/alice"`. |
|
|
258
|
+
| <a id="query"></a> `query?` | \{ `limit?`: `number`; `offset?`: `number`; `orderBy?`: `string`; \} | `request.query` payload (list ops only): limit/offset/orderBy. |
|
|
259
|
+
| `query.limit?` | `number` | - |
|
|
260
|
+
| `query.offset?` | `number` | - |
|
|
261
|
+
| `query.orderBy?` | `string` | - |
|
|
262
|
+
| <a id="requesttime"></a> `requestTime?` | `string` | Override for `request.time` (ISO-8601). Defaults to wallclock. |
|
|
263
|
+
| <a id="resource"></a> `resource?` | `Record`\<`string`, `unknown`\> | Existing document data (`resource.data`). |
|
|
264
|
+
| <a id="writemode"></a> `writeMode?` | \| \{ `kind`: `"create"`; \} \| \{ `kind`: `"set"`; `merge`: `boolean`; \} \| \{ `kind`: `"update"`; \} \| \{ `kind`: `"delete"`; \} | Explicit write semantics — controls update-merge and getAfter() projection. Omit to treat `data` as the full after-state. |
|
|
265
|
+
|
|
266
|
+
***
|
|
267
|
+
|
|
268
|
+
<a id="firestoreruleset"></a>
|
|
269
|
+
|
|
270
|
+
### FirestoreRuleset
|
|
271
|
+
|
|
272
|
+
#### Methods
|
|
273
|
+
|
|
274
|
+
<a id="explain"></a>
|
|
275
|
+
|
|
276
|
+
##### explain()
|
|
277
|
+
|
|
278
|
+
```ts
|
|
279
|
+
explain(oneCase: FirestoreCase): Explanation;
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
The structured account of why one case resolved as it did.
|
|
283
|
+
|
|
284
|
+
###### Parameters
|
|
285
|
+
|
|
286
|
+
| Parameter | Type |
|
|
287
|
+
| :------ | :------ |
|
|
288
|
+
| `oneCase` | [`FirestoreCase`](#firestorecase) |
|
|
289
|
+
|
|
290
|
+
###### Returns
|
|
291
|
+
|
|
292
|
+
[`Explanation`](#explanation)
|
|
293
|
+
|
|
294
|
+
<a id="lint"></a>
|
|
295
|
+
|
|
296
|
+
##### lint()
|
|
297
|
+
|
|
298
|
+
```ts
|
|
299
|
+
lint(): RuleIssue[];
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
Structural, security, and budget findings on the compiled ruleset.
|
|
303
|
+
No parse errors — the source already compiled.
|
|
304
|
+
|
|
305
|
+
###### Returns
|
|
306
|
+
|
|
307
|
+
[`RuleIssue`](#ruleissue)[]
|
|
308
|
+
|
|
309
|
+
<a id="simulate"></a>
|
|
310
|
+
|
|
311
|
+
##### simulate()
|
|
312
|
+
|
|
313
|
+
```ts
|
|
314
|
+
simulate(cases: FirestoreCase[]): SimulationSummary;
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
Run every case. Never throws on a rule outcome: a denied or abstained
|
|
318
|
+
case is reported in the returned summary.
|
|
319
|
+
|
|
320
|
+
###### Parameters
|
|
321
|
+
|
|
322
|
+
| Parameter | Type |
|
|
323
|
+
| :------ | :------ |
|
|
324
|
+
| `cases` | [`FirestoreCase`](#firestorecase)[] |
|
|
325
|
+
|
|
326
|
+
###### Returns
|
|
327
|
+
|
|
328
|
+
[`SimulationSummary`](#simulationsummary)
|
|
329
|
+
|
|
330
|
+
<a id="tojson"></a>
|
|
331
|
+
|
|
332
|
+
##### toJSON()
|
|
333
|
+
|
|
334
|
+
```ts
|
|
335
|
+
toJSON(): FirestoreRules;
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
The parsed ruleset as plain data (the AST).
|
|
339
|
+
|
|
340
|
+
###### Returns
|
|
341
|
+
|
|
342
|
+
`FirestoreRules`
|
|
343
|
+
|
|
344
|
+
***
|
|
345
|
+
|
|
346
|
+
<a id="pathdef"></a>
|
|
347
|
+
|
|
348
|
+
### PathDef
|
|
349
|
+
|
|
350
|
+
Definition of rules for a single database path.
|
|
351
|
+
|
|
352
|
+
#### Properties
|
|
353
|
+
|
|
354
|
+
| Property | Type |
|
|
355
|
+
| :------ | :------ |
|
|
356
|
+
| <a id="children"></a> `children?` | `Record`\<`string`, [`PathDef`](#pathdef)\> |
|
|
357
|
+
| <a id="fieldconstraints"></a> `fieldConstraints?` | `Record`\<`string`, [`Expr`](#expr)[]\> |
|
|
358
|
+
| <a id="indexon"></a> `indexOn?` | `string`[] |
|
|
359
|
+
| <a id="read"></a> `read?` | `string` |
|
|
360
|
+
| <a id="schema"></a> `schema?` | `ZodObject`\<`any`\> |
|
|
361
|
+
| <a id="validate"></a> `validate?` | `string` |
|
|
362
|
+
| <a id="write"></a> `write?` | `string` |
|
|
363
|
+
|
|
364
|
+
***
|
|
365
|
+
|
|
366
|
+
<a id="pathresolutionentry"></a>
|
|
367
|
+
|
|
368
|
+
### PathResolutionEntry
|
|
369
|
+
|
|
370
|
+
One `match` block the simulator considered while resolving the
|
|
371
|
+
request path. Together, `PathResolutionTrace.attempts` forms a
|
|
372
|
+
complete picture of "what did the resolver try, and where did
|
|
373
|
+
each attempt fall apart?" — useful for the agent when a request
|
|
374
|
+
lands in the default-deny path because no block matched.
|
|
375
|
+
|
|
376
|
+
Recorded only by the local simulator; the production Test API
|
|
377
|
+
client doesn't expose path-resolution internals.
|
|
378
|
+
|
|
379
|
+
#### Properties
|
|
380
|
+
|
|
381
|
+
| Property | Type | Description |
|
|
382
|
+
| :------ | :------ | :------ |
|
|
383
|
+
| <a id="bindings"></a> `bindings` | `Record`\<`string`, `string`\> | Wildcard / recursive bindings the block produced (even when the overall match failed — the partial bindings are still diagnostic). |
|
|
384
|
+
| <a id="blockpath"></a> `blockPath` | `string` | Raw match path as written in the source, e.g. `'/users/{uid}/messages/{mId}'`. |
|
|
385
|
+
| <a id="line-1"></a> `line?` | `number` | Source line of the `match` keyword. Absent when the parser didn't populate `loc` (programmatically-constructed blocks). |
|
|
386
|
+
| <a id="matched"></a> `matched` | `boolean` | True for a block that fully resolved (no remaining request segments AND every nested match either completed or wasn't needed). MULTIPLE entries may be `matched: true` in one trace: a request path can match several overlapping `match` blocks (e.g. `/docs/{doc}` and a sibling `/{document=**}`), and every matching block's allows OR-combine. Container blocks whose children completed the resolution are also flagged matched. |
|
|
387
|
+
| <a id="matchedsegments"></a> `matchedSegments` | `number` | How many of the block's path segments matched against the request path before the resolver gave up or completed. |
|
|
388
|
+
| <a id="reason"></a> `reason?` | `"literal-mismatch"` \| `"request-shorter"` \| `"no-matching-child"` | Why the resolver moved on. Absent when `matched: true`. - `'literal-mismatch'` — a literal segment in the block didn't match the corresponding request segment. - `'request-shorter'` — block path had more segments than the request supplied (e.g. block is `/a/{b}/c`, request is `/a/x`). - `'no-matching-child'` — block matched its own segments but remaining request segments weren't covered by any child block. |
|
|
389
|
+
| <a id="totalsegments"></a> `totalSegments` | `number` | Total segments in the block's path pattern. |
|
|
390
|
+
|
|
391
|
+
***
|
|
392
|
+
|
|
393
|
+
<a id="pathresolutiontrace"></a>
|
|
394
|
+
|
|
395
|
+
### PathResolutionTrace
|
|
396
|
+
|
|
397
|
+
#### Properties
|
|
398
|
+
|
|
399
|
+
| Property | Type | Description |
|
|
400
|
+
| :------ | :------ | :------ |
|
|
401
|
+
| <a id="attempts"></a> `attempts` | [`PathResolutionEntry`](#pathresolutionentry)[] | One entry per match block the resolver considered, in the order it tried them. `attempts[i].matched: true` marks a block that fully resolved; one or more per trace, since overlapping blocks all match and OR-combine. |
|
|
402
|
+
| <a id="requestpath"></a> `requestPath` | `string` | The request path that was resolved, verbatim from `TestCase.path`. |
|
|
403
|
+
|
|
404
|
+
***
|
|
405
|
+
|
|
406
|
+
<a id="rtdbcase"></a>
|
|
407
|
+
|
|
408
|
+
### RtdbCase
|
|
409
|
+
|
|
410
|
+
One Realtime Database rules case. `expectation` is required so a `simulate`
|
|
411
|
+
run can partition cases into passed/failed the same way Firestore does —
|
|
412
|
+
the RTDB simulator otherwise returns only a raw allow/deny with no notion
|
|
413
|
+
of an expectation.
|
|
414
|
+
|
|
415
|
+
#### Properties
|
|
416
|
+
|
|
417
|
+
| Property | Type | Description |
|
|
418
|
+
| :------ | :------ | :------ |
|
|
419
|
+
| <a id="auth-1"></a> `auth?` | \| `string` \| \{ `token?`: `Record`\<`string`, `unknown`\>; `uid`: `string`; \} | Auth context; a bare uid string, a full identity, or `null`. |
|
|
420
|
+
| <a id="data-1"></a> `data?` | `Record`\<`string`, `unknown`\> | Existing tree data the rule reads (`data`). |
|
|
421
|
+
| <a id="description-2"></a> `description?` | `string` | Human-readable description of what this case verifies. |
|
|
422
|
+
| <a id="expectation-3"></a> `expectation` | `"ALLOW"` \| `"DENY"` | Expected outcome. |
|
|
423
|
+
| <a id="newdata"></a> `newData?` | `unknown` | Proposed write value (`newData`), for write/validate cases. |
|
|
424
|
+
| <a id="operation"></a> `operation` | `"validate"` \| `"read"` \| `"write"` | RTDB rule kind under test. |
|
|
425
|
+
| <a id="path-1"></a> `path` | `string` | Absolute, root-relative tree path, e.g. `"/users/alice"`. |
|
|
426
|
+
|
|
427
|
+
***
|
|
428
|
+
|
|
429
|
+
<a id="rtdbcaseresult"></a>
|
|
430
|
+
|
|
431
|
+
### RtdbCaseResult
|
|
432
|
+
|
|
433
|
+
The outcome of running one RTDB case through `simulate`.
|
|
434
|
+
|
|
435
|
+
#### Properties
|
|
436
|
+
|
|
437
|
+
| Property | Type | Description |
|
|
438
|
+
| :------ | :------ | :------ |
|
|
439
|
+
| <a id="case-1"></a> `case` | [`RtdbCase`](#rtdbcase) | - |
|
|
440
|
+
| <a id="decision-2"></a> `decision` | `"ALLOW"` \| `"DENY"` \| `"UNSUPPORTED"` | - |
|
|
441
|
+
| <a id="description-3"></a> `description?` | `string` | - |
|
|
442
|
+
| <a id="expectation-4"></a> `expectation` | `"ALLOW"` \| `"DENY"` | - |
|
|
443
|
+
| <a id="matchedpath"></a> `matchedPath` | `string` | The tree path whose rule decided the request. |
|
|
444
|
+
| <a id="matchedrule"></a> `matchedRule` | `string` | Which rule kind (`.read` / `.write` / `.validate`) decided. |
|
|
445
|
+
| <a id="passed-2"></a> `passed` | `boolean` | - |
|
|
446
|
+
| <a id="reason-1"></a> `reason` | `string` | Engine-provided reason string. |
|
|
447
|
+
| <a id="unsupported-2"></a> `unsupported` | `boolean` | - |
|
|
448
|
+
|
|
449
|
+
***
|
|
450
|
+
|
|
451
|
+
<a id="rtdbexplanation"></a>
|
|
452
|
+
|
|
453
|
+
### RtdbExplanation
|
|
454
|
+
|
|
455
|
+
#### Properties
|
|
456
|
+
|
|
457
|
+
| Property | Type |
|
|
458
|
+
| :------ | :------ |
|
|
459
|
+
| <a id="decision-3"></a> `decision` | `"ALLOW"` \| `"DENY"` \| `"UNSUPPORTED"` |
|
|
460
|
+
| <a id="expectation-5"></a> `expectation` | `"ALLOW"` \| `"DENY"` |
|
|
461
|
+
| <a id="matchedpath-1"></a> `matchedPath` | `string` |
|
|
462
|
+
| <a id="matchedrule-1"></a> `matchedRule` | `string` |
|
|
463
|
+
| <a id="passed-3"></a> `passed` | `boolean` |
|
|
464
|
+
| <a id="reason-2"></a> `reason` | `string` |
|
|
465
|
+
| <a id="unsupported-3"></a> `unsupported` | `boolean` |
|
|
466
|
+
|
|
467
|
+
***
|
|
468
|
+
|
|
469
|
+
<a id="rtdbrulescheckresult"></a>
|
|
470
|
+
|
|
471
|
+
### RtdbRulesCheckResult
|
|
472
|
+
|
|
473
|
+
#### Properties
|
|
474
|
+
|
|
475
|
+
| Property | Type |
|
|
476
|
+
| :------ | :------ |
|
|
477
|
+
| <a id="errors"></a> `errors` | [`RtdbRulesFinding`](#rtdbrulesfinding)[] |
|
|
478
|
+
| <a id="ok"></a> `ok` | `boolean` |
|
|
479
|
+
| <a id="warnings"></a> `warnings` | [`RtdbRulesFinding`](#rtdbrulesfinding)[] |
|
|
480
|
+
|
|
481
|
+
***
|
|
482
|
+
|
|
483
|
+
<a id="rtdbrulesdefinition"></a>
|
|
484
|
+
|
|
485
|
+
### RtdbRulesDefinition
|
|
486
|
+
|
|
487
|
+
#### Properties
|
|
488
|
+
|
|
489
|
+
| Property | Type |
|
|
490
|
+
| :------ | :------ |
|
|
491
|
+
| <a id="paths"></a> `paths` | \| `Record`\<`string`, [`PathDef`](#pathdef)\> \| (`ctx`: [`RulesetContext`](#rulesetcontext)) => `void` |
|
|
492
|
+
|
|
493
|
+
***
|
|
494
|
+
|
|
495
|
+
<a id="rtdbrulesdocument"></a>
|
|
496
|
+
|
|
497
|
+
### RtdbRulesDocument
|
|
498
|
+
|
|
499
|
+
The authored RTDB rules artifact `defineRtdbRules` returns.
|
|
500
|
+
|
|
501
|
+
Deliberately INERT on the public surface: it exposes no methods. It is a
|
|
502
|
+
value you author and hand to `rtdbRules()`, which is the one analysis
|
|
503
|
+
surface (`lint` / `simulate` / `explain` / `toJSON`). The brand is
|
|
504
|
+
type-level only; nothing exists at runtime.
|
|
505
|
+
|
|
506
|
+
#### Properties
|
|
507
|
+
|
|
508
|
+
| Property | Modifier | Type |
|
|
509
|
+
| :------ | :------ | :------ |
|
|
510
|
+
| <a id="rtdb_rules_document_brand"></a> `[RTDB_RULES_DOCUMENT_BRAND]?` | `readonly` | `never` |
|
|
511
|
+
|
|
512
|
+
***
|
|
513
|
+
|
|
514
|
+
<a id="rtdbruleset"></a>
|
|
515
|
+
|
|
516
|
+
### RtdbRuleset
|
|
517
|
+
|
|
518
|
+
#### Methods
|
|
519
|
+
|
|
520
|
+
<a id="explain-2"></a>
|
|
521
|
+
|
|
522
|
+
##### explain()
|
|
523
|
+
|
|
524
|
+
```ts
|
|
525
|
+
explain(oneCase: RtdbCase): RtdbExplanation;
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
The structured account of why one case resolved as it did.
|
|
529
|
+
|
|
530
|
+
###### Parameters
|
|
531
|
+
|
|
532
|
+
| Parameter | Type |
|
|
533
|
+
| :------ | :------ |
|
|
534
|
+
| `oneCase` | [`RtdbCase`](#rtdbcase) |
|
|
535
|
+
|
|
536
|
+
###### Returns
|
|
537
|
+
|
|
538
|
+
[`RtdbExplanation`](#rtdbexplanation)
|
|
539
|
+
|
|
540
|
+
<a id="lint-2"></a>
|
|
541
|
+
|
|
542
|
+
##### lint()
|
|
543
|
+
|
|
544
|
+
```ts
|
|
545
|
+
lint(): RuleIssue[];
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
Structural findings on the compiled ruleset (from `check()`).
|
|
549
|
+
|
|
550
|
+
###### Returns
|
|
551
|
+
|
|
552
|
+
[`RuleIssue`](#ruleissue)[]
|
|
553
|
+
|
|
554
|
+
<a id="simulate-2"></a>
|
|
555
|
+
|
|
556
|
+
##### simulate()
|
|
557
|
+
|
|
558
|
+
```ts
|
|
559
|
+
simulate(cases: RtdbCase[]): RtdbSimulationSummary;
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
Run every case. Never throws on a rule outcome.
|
|
563
|
+
|
|
564
|
+
###### Parameters
|
|
565
|
+
|
|
566
|
+
| Parameter | Type |
|
|
567
|
+
| :------ | :------ |
|
|
568
|
+
| `cases` | [`RtdbCase`](#rtdbcase)[] |
|
|
569
|
+
|
|
570
|
+
###### Returns
|
|
571
|
+
|
|
572
|
+
[`RtdbSimulationSummary`](#rtdbsimulationsummary)
|
|
573
|
+
|
|
574
|
+
<a id="tojson-2"></a>
|
|
575
|
+
|
|
576
|
+
##### toJSON()
|
|
577
|
+
|
|
578
|
+
```ts
|
|
579
|
+
toJSON(): RtdbRulesJson;
|
|
580
|
+
```
|
|
581
|
+
|
|
582
|
+
The compiled `rules.json`.
|
|
583
|
+
|
|
584
|
+
###### Returns
|
|
585
|
+
|
|
586
|
+
[`RtdbRulesJson`](#rtdbrulesjson)
|
|
587
|
+
|
|
588
|
+
***
|
|
589
|
+
|
|
590
|
+
<a id="rtdbrulesfinding"></a>
|
|
591
|
+
|
|
592
|
+
### RtdbRulesFinding
|
|
593
|
+
|
|
594
|
+
#### Properties
|
|
595
|
+
|
|
596
|
+
| Property | Type |
|
|
597
|
+
| :------ | :------ |
|
|
598
|
+
| <a id="code"></a> `code` | `string` |
|
|
599
|
+
| <a id="message"></a> `message` | `string` |
|
|
600
|
+
| <a id="path-2"></a> `path` | `string` |
|
|
601
|
+
| <a id="rule"></a> `rule` | [`RtdbRulesFindingRule`](#rtdbrulesfindingrule-1) |
|
|
602
|
+
|
|
603
|
+
***
|
|
604
|
+
|
|
605
|
+
<a id="rtdbsimulationsummary"></a>
|
|
606
|
+
|
|
607
|
+
### RtdbSimulationSummary
|
|
608
|
+
|
|
609
|
+
#### Properties
|
|
610
|
+
|
|
611
|
+
| Property | Type |
|
|
612
|
+
| :------ | :------ |
|
|
613
|
+
| <a id="cases"></a> `cases` | [`RtdbCaseResult`](#rtdbcaseresult)[] |
|
|
614
|
+
| <a id="failed"></a> `failed` | `number` |
|
|
615
|
+
| <a id="passed-4"></a> `passed` | `number` |
|
|
616
|
+
| <a id="unsupported-4"></a> `unsupported` | `number` |
|
|
617
|
+
|
|
618
|
+
***
|
|
619
|
+
|
|
620
|
+
<a id="ruleevaluation"></a>
|
|
621
|
+
|
|
622
|
+
### RuleEvaluation
|
|
623
|
+
|
|
624
|
+
Per-rule evaluation entry produced by the local simulator. Each entry
|
|
625
|
+
corresponds to one `allow` declaration the simulator evaluated, in
|
|
626
|
+
source order.
|
|
627
|
+
|
|
628
|
+
Populated only by the internal simulator (which has the parsed
|
|
629
|
+
AST in hand); the production Test API client (`TestFirestoreRulesHandler`)
|
|
630
|
+
returns an empty `trace` and surfaces the wire text on `TestResult.notes`.
|
|
631
|
+
|
|
632
|
+
#### Properties
|
|
633
|
+
|
|
634
|
+
| Property | Type | Description |
|
|
635
|
+
| :------ | :------ | :------ |
|
|
636
|
+
| <a id="conditiontext"></a> `conditionText?` | `string` | Pretty-printed condition expression. Use this verbatim in agent-facing summaries — derived from the AST via `printExpression`, so it survives comment removal and whitespace re-flow in the source. |
|
|
637
|
+
| <a id="expressiontrace-1"></a> `expressionTrace?` | [`ExprTraceEntry`](#exprtraceentry)[] | Per-sub-expression evaluation trace for this rule's condition. Flat, in evaluation order; reconstruct the tree via the `parent` index on each entry. Populated by the local simulator when the caller enables tracing — currently always on for the simulator so agents can see *why* a rule's condition resolved as it did (which disjunct was true, which `let` binding the value flowed through, which method call threw). Absent on entries that came from the production Test API client (no AST visibility). |
|
|
638
|
+
| <a id="line-2"></a> `line?` | `number` | 1-indexed source line of the `allow` keyword. Populated when the rule's `loc` was set by the parser. |
|
|
639
|
+
| <a id="matchpath"></a> `matchPath?` | `string` | Source-rendered path of the `match` block this rule belongs to, e.g. `'/docs/{docId}'` or `'/{document=**}'`. Populated when the request path matches MORE THAN ONE overlapping `match` block: allows OR-combine across every matching block (production semantics — there is no first-match-wins), so a DENY trace can carry entries from several blocks. This field keeps them unambiguous — which block did this rule live in. Absent for the common single-block case. |
|
|
640
|
+
| <a id="message-1"></a> `message?` | `string` | Human-readable diagnostic — populated for `UNSUPPORTED` (which sim surface is missing) and `ERROR` (which runtime error caused the rule to abort). |
|
|
641
|
+
| <a id="operations"></a> `operations` | (`"get"` \| `"list"` \| `"create"` \| `"update"` \| `"delete"` \| `"read"` \| `"write"`)[] | Operations declared on the allow rule (`read`, `write`, `get`, ...). |
|
|
642
|
+
| <a id="ruleindex"></a> `ruleIndex` | `number` | Position of the `allow` declaration within its match block, 0-indexed in source order. |
|
|
643
|
+
| <a id="verdict-1"></a> `verdict` | `"ALLOW"` \| `"DENY"` \| `"UNSUPPORTED"` \| `"ERROR"` | Outcome for this single rule. The TestResult's overall `decision` is derived from the trace under OR semantics (any `'ALLOW'` ⇒ ALLOW, else any `'UNSUPPORTED'` ⇒ UNSUPPORTED, else DENY). |
|
|
644
|
+
|
|
645
|
+
***
|
|
646
|
+
|
|
647
|
+
<a id="ruleissue"></a>
|
|
648
|
+
|
|
649
|
+
### RuleIssue
|
|
650
|
+
|
|
651
|
+
#### Properties
|
|
652
|
+
|
|
653
|
+
| Property | Type | Description |
|
|
654
|
+
| :------ | :------ | :------ |
|
|
655
|
+
| <a id="code-1"></a> `code` | `string` | Stable machine code, e.g. `'PARSE_ERROR'`, `'SEC-4'`, `'GET_BUDGET'`. |
|
|
656
|
+
| <a id="fix"></a> `fix?` | `string` | Suggested remediation, verbatim, when the producing stage offers one. |
|
|
657
|
+
| <a id="line-3"></a> `line?` | `number` | 1-indexed source line, when known. |
|
|
658
|
+
| <a id="message-2"></a> `message` | `string` | Human-readable description. |
|
|
659
|
+
| <a id="origin"></a> `origin` | [`RuleIssueOrigin`](#ruleissueorigin-1) | - |
|
|
660
|
+
| <a id="path-3"></a> `path?` | `string` | Rules path the issue applies to, when known (e.g. `'/users/{uid}'`). |
|
|
661
|
+
| <a id="severity"></a> `severity` | [`RuleIssueSeverity`](#ruleissueseverity-1) | - |
|
|
662
|
+
|
|
663
|
+
***
|
|
664
|
+
|
|
665
|
+
<a id="rulesetcontext"></a>
|
|
666
|
+
|
|
667
|
+
### RulesetContext
|
|
668
|
+
|
|
669
|
+
Context passed to the callback overload of ruleset().
|
|
670
|
+
|
|
671
|
+
#### Properties
|
|
672
|
+
|
|
673
|
+
| Property | Type |
|
|
674
|
+
| :------ | :------ |
|
|
675
|
+
| <a id="path-4"></a> `path` | (`path`: `string`, `def`: [`PathDef`](#pathdef)) => `void` |
|
|
676
|
+
|
|
677
|
+
***
|
|
678
|
+
|
|
679
|
+
<a id="schemarulesresult"></a>
|
|
680
|
+
|
|
681
|
+
### SchemaRulesResult
|
|
682
|
+
|
|
683
|
+
#### Properties
|
|
684
|
+
|
|
685
|
+
| Property | Type |
|
|
686
|
+
| :------ | :------ |
|
|
687
|
+
| <a id="children-1"></a> `children` | `Record`\<`string`, \{ `children?`: `Record`\<`string`, \{ `validate`: [`Expr`](#expr); \}\>; `validate`: [`Expr`](#expr); \}\> |
|
|
688
|
+
| <a id="validate-1"></a> `validate` | `string` |
|
|
689
|
+
|
|
690
|
+
***
|
|
691
|
+
|
|
692
|
+
<a id="simulationsummary"></a>
|
|
693
|
+
|
|
694
|
+
### SimulationSummary
|
|
695
|
+
|
|
696
|
+
Aggregate of a `simulate(cases)` run. Counts partition the cases:
|
|
697
|
+
`passed + failed + unsupported === cases.length`.
|
|
698
|
+
|
|
699
|
+
#### Properties
|
|
700
|
+
|
|
701
|
+
| Property | Type |
|
|
702
|
+
| :------ | :------ |
|
|
703
|
+
| <a id="cases-1"></a> `cases` | [`CaseResult`](#caseresult)[] |
|
|
704
|
+
| <a id="failed-1"></a> `failed` | `number` |
|
|
705
|
+
| <a id="passed-5"></a> `passed` | `number` |
|
|
706
|
+
| <a id="unsupported-5"></a> `unsupported` | `number` |
|
|
707
|
+
|
|
708
|
+
## Type Aliases
|
|
709
|
+
|
|
710
|
+
<a id="expr"></a>
|
|
711
|
+
|
|
712
|
+
### Expr
|
|
713
|
+
|
|
714
|
+
```ts
|
|
715
|
+
type Expr = string;
|
|
716
|
+
```
|
|
717
|
+
|
|
718
|
+
Type alias for RTDB rule expression strings.
|
|
719
|
+
|
|
720
|
+
***
|
|
721
|
+
|
|
722
|
+
<a id="firestoremethod"></a>
|
|
723
|
+
|
|
724
|
+
### FirestoreMethod
|
|
725
|
+
|
|
726
|
+
```ts
|
|
727
|
+
type FirestoreMethod = typeof FIRESTORE_METHODS[number];
|
|
728
|
+
```
|
|
729
|
+
|
|
730
|
+
***
|
|
731
|
+
|
|
732
|
+
<a id="rtdbrulesfindingrule-1"></a>
|
|
733
|
+
|
|
734
|
+
### RtdbRulesFindingRule
|
|
735
|
+
|
|
736
|
+
```ts
|
|
737
|
+
type RtdbRulesFindingRule = ".read" | ".write" | ".validate" | "ruleset";
|
|
738
|
+
```
|
|
739
|
+
|
|
740
|
+
***
|
|
741
|
+
|
|
742
|
+
<a id="rtdbrulesjson"></a>
|
|
743
|
+
|
|
744
|
+
### RtdbRulesJson
|
|
745
|
+
|
|
746
|
+
```ts
|
|
747
|
+
type RtdbRulesJson = {
|
|
748
|
+
rules: Record<string, unknown>;
|
|
749
|
+
};
|
|
750
|
+
```
|
|
751
|
+
|
|
752
|
+
#### Properties
|
|
753
|
+
|
|
754
|
+
| Property | Type |
|
|
755
|
+
| :------ | :------ |
|
|
756
|
+
| <a id="rules"></a> `rules` | `Record`\<`string`, `unknown`\> |
|
|
757
|
+
|
|
758
|
+
***
|
|
759
|
+
|
|
760
|
+
<a id="rtdbrulessimulationauth"></a>
|
|
761
|
+
|
|
762
|
+
### RtdbRulesSimulationAuth
|
|
763
|
+
|
|
764
|
+
```ts
|
|
765
|
+
type RtdbRulesSimulationAuth =
|
|
766
|
+
| string
|
|
767
|
+
| {
|
|
768
|
+
token?: Record<string, unknown>;
|
|
769
|
+
uid: string;
|
|
770
|
+
}
|
|
771
|
+
| null;
|
|
772
|
+
```
|
|
773
|
+
|
|
774
|
+
***
|
|
775
|
+
|
|
776
|
+
<a id="rtdbrulessimulationinput"></a>
|
|
777
|
+
|
|
778
|
+
### RtdbRulesSimulationInput
|
|
779
|
+
|
|
780
|
+
```ts
|
|
781
|
+
type RtdbRulesSimulationInput = Omit<SimulationInput, "auth" | "mockData"> & {
|
|
782
|
+
auth?: RtdbRulesSimulationAuth;
|
|
783
|
+
data?: Record<string, unknown>;
|
|
784
|
+
mockData?: Record<string, unknown>;
|
|
785
|
+
};
|
|
786
|
+
```
|
|
787
|
+
|
|
788
|
+
#### Type Declaration
|
|
789
|
+
|
|
790
|
+
##### auth?
|
|
791
|
+
|
|
792
|
+
```ts
|
|
793
|
+
optional auth: RtdbRulesSimulationAuth;
|
|
794
|
+
```
|
|
795
|
+
|
|
796
|
+
##### data?
|
|
797
|
+
|
|
798
|
+
```ts
|
|
799
|
+
optional data: Record<string, unknown>;
|
|
800
|
+
```
|
|
801
|
+
|
|
802
|
+
##### mockData?
|
|
803
|
+
|
|
804
|
+
```ts
|
|
805
|
+
optional mockData: Record<string, unknown>;
|
|
806
|
+
```
|
|
807
|
+
|
|
808
|
+
***
|
|
809
|
+
|
|
810
|
+
<a id="ruleissueorigin-1"></a>
|
|
811
|
+
|
|
812
|
+
### RuleIssueOrigin
|
|
813
|
+
|
|
814
|
+
```ts
|
|
815
|
+
type RuleIssueOrigin = "parse" | "validate" | "lint";
|
|
816
|
+
```
|
|
817
|
+
|
|
818
|
+
The stage that produced the issue.
|
|
819
|
+
- `parse` — the source did not parse; nothing downstream ran.
|
|
820
|
+
- `validate` — a structural/security finding on a parsed ruleset.
|
|
821
|
+
- `lint` — a budget/quality/hallucination warning.
|
|
822
|
+
|
|
823
|
+
***
|
|
824
|
+
|
|
825
|
+
<a id="ruleissueseverity-1"></a>
|
|
826
|
+
|
|
827
|
+
### RuleIssueSeverity
|
|
828
|
+
|
|
829
|
+
```ts
|
|
830
|
+
type RuleIssueSeverity = "error" | "warning" | "info";
|
|
831
|
+
```
|
|
832
|
+
|
|
833
|
+
Ordered by decreasing urgency. `info` is advisory.
|
|
834
|
+
|
|
835
|
+
***
|
|
836
|
+
|
|
837
|
+
<a id="segment"></a>
|
|
838
|
+
|
|
839
|
+
### Segment
|
|
840
|
+
|
|
841
|
+
```ts
|
|
842
|
+
type Segment =
|
|
843
|
+
| string
|
|
844
|
+
| {
|
|
845
|
+
$: string;
|
|
846
|
+
};
|
|
847
|
+
```
|
|
848
|
+
|
|
849
|
+
A path segment: string for literal, { $: name } for path variable.
|
|
850
|
+
|
|
851
|
+
## Variables
|
|
852
|
+
|
|
853
|
+
<a id="all"></a>
|
|
854
|
+
|
|
855
|
+
### all()
|
|
856
|
+
|
|
857
|
+
```ts
|
|
858
|
+
const all: (...exprs: Expr[]) => Expr;
|
|
859
|
+
```
|
|
860
|
+
|
|
861
|
+
All conditions must be true (AND).
|
|
862
|
+
|
|
863
|
+
#### Parameters
|
|
864
|
+
|
|
865
|
+
| Parameter | Type |
|
|
866
|
+
| :------ | :------ |
|
|
867
|
+
| ...`exprs` | [`Expr`](#expr)[] |
|
|
868
|
+
|
|
869
|
+
#### Returns
|
|
870
|
+
|
|
871
|
+
[`Expr`](#expr)
|
|
872
|
+
|
|
873
|
+
***
|
|
874
|
+
|
|
875
|
+
<a id="allow"></a>
|
|
876
|
+
|
|
877
|
+
### allow()
|
|
878
|
+
|
|
879
|
+
```ts
|
|
880
|
+
const allow: () => Expr;
|
|
881
|
+
```
|
|
882
|
+
|
|
883
|
+
Always allow (true). Readable alias for always().
|
|
884
|
+
|
|
885
|
+
#### Returns
|
|
886
|
+
|
|
887
|
+
[`Expr`](#expr)
|
|
888
|
+
|
|
889
|
+
***
|
|
890
|
+
|
|
891
|
+
<a id="always"></a>
|
|
892
|
+
|
|
893
|
+
### always()
|
|
894
|
+
|
|
895
|
+
```ts
|
|
896
|
+
const always: () => Expr;
|
|
897
|
+
```
|
|
898
|
+
|
|
899
|
+
Always allow (true).
|
|
900
|
+
|
|
901
|
+
#### Returns
|
|
902
|
+
|
|
903
|
+
[`Expr`](#expr)
|
|
904
|
+
|
|
905
|
+
***
|
|
906
|
+
|
|
907
|
+
<a id="any"></a>
|
|
908
|
+
|
|
909
|
+
### any()
|
|
910
|
+
|
|
911
|
+
```ts
|
|
912
|
+
const any: (...exprs: Expr[]) => Expr;
|
|
913
|
+
```
|
|
914
|
+
|
|
915
|
+
At least one condition must be true (OR).
|
|
916
|
+
|
|
917
|
+
#### Parameters
|
|
918
|
+
|
|
919
|
+
| Parameter | Type |
|
|
920
|
+
| :------ | :------ |
|
|
921
|
+
| ...`exprs` | [`Expr`](#expr)[] |
|
|
922
|
+
|
|
923
|
+
#### Returns
|
|
924
|
+
|
|
925
|
+
[`Expr`](#expr)
|
|
926
|
+
|
|
927
|
+
***
|
|
928
|
+
|
|
929
|
+
<a id="auth_uid"></a>
|
|
930
|
+
|
|
931
|
+
### AUTH\_UID
|
|
932
|
+
|
|
933
|
+
```ts
|
|
934
|
+
const AUTH_UID: Segment;
|
|
935
|
+
```
|
|
936
|
+
|
|
937
|
+
auth.uid as a comparison value (unquoted in expressions)
|
|
938
|
+
|
|
939
|
+
***
|
|
940
|
+
|
|
941
|
+
<a id="authenticated"></a>
|
|
942
|
+
|
|
943
|
+
### authenticated()
|
|
944
|
+
|
|
945
|
+
```ts
|
|
946
|
+
const authenticated: () => Expr;
|
|
947
|
+
```
|
|
948
|
+
|
|
949
|
+
#### Returns
|
|
950
|
+
|
|
951
|
+
[`Expr`](#expr)
|
|
952
|
+
|
|
953
|
+
***
|
|
954
|
+
|
|
955
|
+
<a id="dataexists"></a>
|
|
956
|
+
|
|
957
|
+
### dataExists()
|
|
958
|
+
|
|
959
|
+
```ts
|
|
960
|
+
const dataExists: (path?: string) => Expr;
|
|
961
|
+
```
|
|
962
|
+
|
|
963
|
+
Check if data exists at current node or a child path
|
|
964
|
+
|
|
965
|
+
#### Parameters
|
|
966
|
+
|
|
967
|
+
| Parameter | Type |
|
|
968
|
+
| :------ | :------ |
|
|
969
|
+
| `path?` | `string` |
|
|
970
|
+
|
|
971
|
+
#### Returns
|
|
972
|
+
|
|
973
|
+
[`Expr`](#expr)
|
|
974
|
+
|
|
975
|
+
***
|
|
976
|
+
|
|
977
|
+
<a id="dataparentval"></a>
|
|
978
|
+
|
|
979
|
+
### dataParentVal()
|
|
980
|
+
|
|
981
|
+
```ts
|
|
982
|
+
const dataParentVal: (depth: number, field: string) => Expr;
|
|
983
|
+
```
|
|
984
|
+
|
|
985
|
+
Navigate up from data snapshot, then read a child field's value
|
|
986
|
+
|
|
987
|
+
#### Parameters
|
|
988
|
+
|
|
989
|
+
| Parameter | Type |
|
|
990
|
+
| :------ | :------ |
|
|
991
|
+
| `depth` | `number` |
|
|
992
|
+
| `field` | `string` |
|
|
993
|
+
|
|
994
|
+
#### Returns
|
|
995
|
+
|
|
996
|
+
[`Expr`](#expr)
|
|
997
|
+
|
|
998
|
+
***
|
|
999
|
+
|
|
1000
|
+
<a id="dataval"></a>
|
|
1001
|
+
|
|
1002
|
+
### dataVal()
|
|
1003
|
+
|
|
1004
|
+
```ts
|
|
1005
|
+
const dataVal: (path?: string) => Expr;
|
|
1006
|
+
```
|
|
1007
|
+
|
|
1008
|
+
Read data value at current node or a child path (pre-write state)
|
|
1009
|
+
|
|
1010
|
+
#### Parameters
|
|
1011
|
+
|
|
1012
|
+
| Parameter | Type |
|
|
1013
|
+
| :------ | :------ |
|
|
1014
|
+
| `path?` | `string` |
|
|
1015
|
+
|
|
1016
|
+
#### Returns
|
|
1017
|
+
|
|
1018
|
+
[`Expr`](#expr)
|
|
1019
|
+
|
|
1020
|
+
***
|
|
1021
|
+
|
|
1022
|
+
<a id="deny"></a>
|
|
1023
|
+
|
|
1024
|
+
### deny()
|
|
1025
|
+
|
|
1026
|
+
```ts
|
|
1027
|
+
const deny: () => Expr;
|
|
1028
|
+
```
|
|
1029
|
+
|
|
1030
|
+
Always deny (false).
|
|
1031
|
+
|
|
1032
|
+
#### Returns
|
|
1033
|
+
|
|
1034
|
+
[`Expr`](#expr)
|
|
1035
|
+
|
|
1036
|
+
***
|
|
1037
|
+
|
|
1038
|
+
<a id="eq"></a>
|
|
1039
|
+
|
|
1040
|
+
### eq()
|
|
1041
|
+
|
|
1042
|
+
```ts
|
|
1043
|
+
const eq: (left: Expr, right: CompareValue) => Expr;
|
|
1044
|
+
```
|
|
1045
|
+
|
|
1046
|
+
Strict equality: left === right (right is a literal value or runtime ref)
|
|
1047
|
+
|
|
1048
|
+
#### Parameters
|
|
1049
|
+
|
|
1050
|
+
| Parameter | Type |
|
|
1051
|
+
| :------ | :------ |
|
|
1052
|
+
| `left` | [`Expr`](#expr) |
|
|
1053
|
+
| `right` | `CompareValue` |
|
|
1054
|
+
|
|
1055
|
+
#### Returns
|
|
1056
|
+
|
|
1057
|
+
[`Expr`](#expr)
|
|
1058
|
+
|
|
1059
|
+
***
|
|
1060
|
+
|
|
1061
|
+
<a id="expr-1"></a>
|
|
1062
|
+
|
|
1063
|
+
### expr()
|
|
1064
|
+
|
|
1065
|
+
```ts
|
|
1066
|
+
const expr: (raw: string) => Expr;
|
|
1067
|
+
```
|
|
1068
|
+
|
|
1069
|
+
Create an Expr from a raw expression string.
|
|
1070
|
+
|
|
1071
|
+
#### Parameters
|
|
1072
|
+
|
|
1073
|
+
| Parameter | Type |
|
|
1074
|
+
| :------ | :------ |
|
|
1075
|
+
| `raw` | `string` |
|
|
1076
|
+
|
|
1077
|
+
#### Returns
|
|
1078
|
+
|
|
1079
|
+
[`Expr`](#expr)
|
|
1080
|
+
|
|
1081
|
+
***
|
|
1082
|
+
|
|
1083
|
+
<a id="fieldenum"></a>
|
|
1084
|
+
|
|
1085
|
+
### fieldEnum()
|
|
1086
|
+
|
|
1087
|
+
```ts
|
|
1088
|
+
const fieldEnum: (field: string, values: string[]) => Expr;
|
|
1089
|
+
```
|
|
1090
|
+
|
|
1091
|
+
Field must be one of the allowed string values
|
|
1092
|
+
|
|
1093
|
+
#### Parameters
|
|
1094
|
+
|
|
1095
|
+
| Parameter | Type |
|
|
1096
|
+
| :------ | :------ |
|
|
1097
|
+
| `field` | `string` |
|
|
1098
|
+
| `values` | `string`[] |
|
|
1099
|
+
|
|
1100
|
+
#### Returns
|
|
1101
|
+
|
|
1102
|
+
[`Expr`](#expr)
|
|
1103
|
+
|
|
1104
|
+
***
|
|
1105
|
+
|
|
1106
|
+
<a id="fieldisboolean"></a>
|
|
1107
|
+
|
|
1108
|
+
### fieldIsBoolean()
|
|
1109
|
+
|
|
1110
|
+
```ts
|
|
1111
|
+
const fieldIsBoolean: (field: string) => Expr;
|
|
1112
|
+
```
|
|
1113
|
+
|
|
1114
|
+
Field must be a boolean
|
|
1115
|
+
|
|
1116
|
+
#### Parameters
|
|
1117
|
+
|
|
1118
|
+
| Parameter | Type |
|
|
1119
|
+
| :------ | :------ |
|
|
1120
|
+
| `field` | `string` |
|
|
1121
|
+
|
|
1122
|
+
#### Returns
|
|
1123
|
+
|
|
1124
|
+
[`Expr`](#expr)
|
|
1125
|
+
|
|
1126
|
+
***
|
|
1127
|
+
|
|
1128
|
+
<a id="fieldisnumber"></a>
|
|
1129
|
+
|
|
1130
|
+
### fieldIsNumber()
|
|
1131
|
+
|
|
1132
|
+
```ts
|
|
1133
|
+
const fieldIsNumber: (field: string) => Expr;
|
|
1134
|
+
```
|
|
1135
|
+
|
|
1136
|
+
Field must be a number
|
|
1137
|
+
|
|
1138
|
+
#### Parameters
|
|
1139
|
+
|
|
1140
|
+
| Parameter | Type |
|
|
1141
|
+
| :------ | :------ |
|
|
1142
|
+
| `field` | `string` |
|
|
1143
|
+
|
|
1144
|
+
#### Returns
|
|
1145
|
+
|
|
1146
|
+
[`Expr`](#expr)
|
|
1147
|
+
|
|
1148
|
+
***
|
|
1149
|
+
|
|
1150
|
+
<a id="fieldisstring"></a>
|
|
1151
|
+
|
|
1152
|
+
### fieldIsString()
|
|
1153
|
+
|
|
1154
|
+
```ts
|
|
1155
|
+
const fieldIsString: (field: string) => Expr;
|
|
1156
|
+
```
|
|
1157
|
+
|
|
1158
|
+
Field must be a string
|
|
1159
|
+
|
|
1160
|
+
#### Parameters
|
|
1161
|
+
|
|
1162
|
+
| Parameter | Type |
|
|
1163
|
+
| :------ | :------ |
|
|
1164
|
+
| `field` | `string` |
|
|
1165
|
+
|
|
1166
|
+
#### Returns
|
|
1167
|
+
|
|
1168
|
+
[`Expr`](#expr)
|
|
1169
|
+
|
|
1170
|
+
***
|
|
1171
|
+
|
|
1172
|
+
<a id="fieldowneronly"></a>
|
|
1173
|
+
|
|
1174
|
+
### fieldOwnerOnly()
|
|
1175
|
+
|
|
1176
|
+
```ts
|
|
1177
|
+
const fieldOwnerOnly: (field: string) => Expr;
|
|
1178
|
+
```
|
|
1179
|
+
|
|
1180
|
+
Only the field owner (auth.uid === data.child(field).val()) can access
|
|
1181
|
+
|
|
1182
|
+
#### Parameters
|
|
1183
|
+
|
|
1184
|
+
| Parameter | Type |
|
|
1185
|
+
| :------ | :------ |
|
|
1186
|
+
| `field` | `string` |
|
|
1187
|
+
|
|
1188
|
+
#### Returns
|
|
1189
|
+
|
|
1190
|
+
[`Expr`](#expr)
|
|
1191
|
+
|
|
1192
|
+
***
|
|
1193
|
+
|
|
1194
|
+
<a id="gt"></a>
|
|
1195
|
+
|
|
1196
|
+
### gt()
|
|
1197
|
+
|
|
1198
|
+
```ts
|
|
1199
|
+
const gt: (left: Expr, right: number) => Expr;
|
|
1200
|
+
```
|
|
1201
|
+
|
|
1202
|
+
Greater than: left > right
|
|
1203
|
+
|
|
1204
|
+
#### Parameters
|
|
1205
|
+
|
|
1206
|
+
| Parameter | Type |
|
|
1207
|
+
| :------ | :------ |
|
|
1208
|
+
| `left` | [`Expr`](#expr) |
|
|
1209
|
+
| `right` | `number` |
|
|
1210
|
+
|
|
1211
|
+
#### Returns
|
|
1212
|
+
|
|
1213
|
+
[`Expr`](#expr)
|
|
1214
|
+
|
|
1215
|
+
***
|
|
1216
|
+
|
|
1217
|
+
<a id="haschild"></a>
|
|
1218
|
+
|
|
1219
|
+
### hasChild()
|
|
1220
|
+
|
|
1221
|
+
```ts
|
|
1222
|
+
const hasChild: (field: string) => Expr;
|
|
1223
|
+
```
|
|
1224
|
+
|
|
1225
|
+
Incoming data must have a specific child field
|
|
1226
|
+
|
|
1227
|
+
#### Parameters
|
|
1228
|
+
|
|
1229
|
+
| Parameter | Type |
|
|
1230
|
+
| :------ | :------ |
|
|
1231
|
+
| `field` | `string` |
|
|
1232
|
+
|
|
1233
|
+
#### Returns
|
|
1234
|
+
|
|
1235
|
+
[`Expr`](#expr)
|
|
1236
|
+
|
|
1237
|
+
***
|
|
1238
|
+
|
|
1239
|
+
<a id="haschildren"></a>
|
|
1240
|
+
|
|
1241
|
+
### hasChildren()
|
|
1242
|
+
|
|
1243
|
+
```ts
|
|
1244
|
+
const hasChildren: () => Expr;
|
|
1245
|
+
```
|
|
1246
|
+
|
|
1247
|
+
Incoming data must be an object with at least one child
|
|
1248
|
+
|
|
1249
|
+
#### Returns
|
|
1250
|
+
|
|
1251
|
+
[`Expr`](#expr)
|
|
1252
|
+
|
|
1253
|
+
***
|
|
1254
|
+
|
|
1255
|
+
<a id="hasrole"></a>
|
|
1256
|
+
|
|
1257
|
+
### hasRole()
|
|
1258
|
+
|
|
1259
|
+
```ts
|
|
1260
|
+
const hasRole: (segments: Segment[], role: string) => Expr;
|
|
1261
|
+
```
|
|
1262
|
+
|
|
1263
|
+
Cross-path role check via root lookup
|
|
1264
|
+
|
|
1265
|
+
#### Parameters
|
|
1266
|
+
|
|
1267
|
+
| Parameter | Type |
|
|
1268
|
+
| :------ | :------ |
|
|
1269
|
+
| `segments` | [`Segment`](#segment)[] |
|
|
1270
|
+
| `role` | `string` |
|
|
1271
|
+
|
|
1272
|
+
#### Returns
|
|
1273
|
+
|
|
1274
|
+
[`Expr`](#expr)
|
|
1275
|
+
|
|
1276
|
+
***
|
|
1277
|
+
|
|
1278
|
+
<a id="immutable"></a>
|
|
1279
|
+
|
|
1280
|
+
### immutable()
|
|
1281
|
+
|
|
1282
|
+
```ts
|
|
1283
|
+
const immutable: (field: string) => Expr;
|
|
1284
|
+
```
|
|
1285
|
+
|
|
1286
|
+
Field can be set on creation but never changed after
|
|
1287
|
+
|
|
1288
|
+
#### Parameters
|
|
1289
|
+
|
|
1290
|
+
| Parameter | Type |
|
|
1291
|
+
| :------ | :------ |
|
|
1292
|
+
| `field` | `string` |
|
|
1293
|
+
|
|
1294
|
+
#### Returns
|
|
1295
|
+
|
|
1296
|
+
[`Expr`](#expr)
|
|
1297
|
+
|
|
1298
|
+
***
|
|
1299
|
+
|
|
1300
|
+
<a id="immutableself"></a>
|
|
1301
|
+
|
|
1302
|
+
### immutableSelf()
|
|
1303
|
+
|
|
1304
|
+
```ts
|
|
1305
|
+
const immutableSelf: () => Expr;
|
|
1306
|
+
```
|
|
1307
|
+
|
|
1308
|
+
This node's own value can be set on creation but never changed
|
|
1309
|
+
|
|
1310
|
+
#### Returns
|
|
1311
|
+
|
|
1312
|
+
[`Expr`](#expr)
|
|
1313
|
+
|
|
1314
|
+
***
|
|
1315
|
+
|
|
1316
|
+
<a id="ismember"></a>
|
|
1317
|
+
|
|
1318
|
+
### isMember()
|
|
1319
|
+
|
|
1320
|
+
```ts
|
|
1321
|
+
const isMember: (listName: string, pathVarName: string) => Expr;
|
|
1322
|
+
```
|
|
1323
|
+
|
|
1324
|
+
Cross-path membership check: root.child(list).child($var).child(auth.uid).exists()
|
|
1325
|
+
|
|
1326
|
+
#### Parameters
|
|
1327
|
+
|
|
1328
|
+
| Parameter | Type |
|
|
1329
|
+
| :------ | :------ |
|
|
1330
|
+
| `listName` | `string` |
|
|
1331
|
+
| `pathVarName` | `string` |
|
|
1332
|
+
|
|
1333
|
+
#### Returns
|
|
1334
|
+
|
|
1335
|
+
[`Expr`](#expr)
|
|
1336
|
+
|
|
1337
|
+
***
|
|
1338
|
+
|
|
1339
|
+
<a id="isnew"></a>
|
|
1340
|
+
|
|
1341
|
+
### isNew()
|
|
1342
|
+
|
|
1343
|
+
```ts
|
|
1344
|
+
const isNew: () => Expr;
|
|
1345
|
+
```
|
|
1346
|
+
|
|
1347
|
+
Data at this path doesn't exist yet (creation check)
|
|
1348
|
+
|
|
1349
|
+
#### Returns
|
|
1350
|
+
|
|
1351
|
+
[`Expr`](#expr)
|
|
1352
|
+
|
|
1353
|
+
***
|
|
1354
|
+
|
|
1355
|
+
<a id="lte"></a>
|
|
1356
|
+
|
|
1357
|
+
### lte()
|
|
1358
|
+
|
|
1359
|
+
```ts
|
|
1360
|
+
const lte: (left: Expr, right: number) => Expr;
|
|
1361
|
+
```
|
|
1362
|
+
|
|
1363
|
+
Less than or equal: left <= right
|
|
1364
|
+
|
|
1365
|
+
#### Parameters
|
|
1366
|
+
|
|
1367
|
+
| Parameter | Type |
|
|
1368
|
+
| :------ | :------ |
|
|
1369
|
+
| `left` | [`Expr`](#expr) |
|
|
1370
|
+
| `right` | `number` |
|
|
1371
|
+
|
|
1372
|
+
#### Returns
|
|
1373
|
+
|
|
1374
|
+
[`Expr`](#expr)
|
|
1375
|
+
|
|
1376
|
+
***
|
|
1377
|
+
|
|
1378
|
+
<a id="neq"></a>
|
|
1379
|
+
|
|
1380
|
+
### neq()
|
|
1381
|
+
|
|
1382
|
+
```ts
|
|
1383
|
+
const neq: (left: Expr, right: CompareValue) => Expr;
|
|
1384
|
+
```
|
|
1385
|
+
|
|
1386
|
+
Strict inequality: left !== right
|
|
1387
|
+
|
|
1388
|
+
#### Parameters
|
|
1389
|
+
|
|
1390
|
+
| Parameter | Type |
|
|
1391
|
+
| :------ | :------ |
|
|
1392
|
+
| `left` | [`Expr`](#expr) |
|
|
1393
|
+
| `right` | `CompareValue` |
|
|
1394
|
+
|
|
1395
|
+
#### Returns
|
|
1396
|
+
|
|
1397
|
+
[`Expr`](#expr)
|
|
1398
|
+
|
|
1399
|
+
***
|
|
1400
|
+
|
|
1401
|
+
<a id="newdataexists"></a>
|
|
1402
|
+
|
|
1403
|
+
### newDataExists()
|
|
1404
|
+
|
|
1405
|
+
```ts
|
|
1406
|
+
const newDataExists: (path?: string) => Expr;
|
|
1407
|
+
```
|
|
1408
|
+
|
|
1409
|
+
Check if incoming data exists at current node or a child path
|
|
1410
|
+
|
|
1411
|
+
#### Parameters
|
|
1412
|
+
|
|
1413
|
+
| Parameter | Type |
|
|
1414
|
+
| :------ | :------ |
|
|
1415
|
+
| `path?` | `string` |
|
|
1416
|
+
|
|
1417
|
+
#### Returns
|
|
1418
|
+
|
|
1419
|
+
[`Expr`](#expr)
|
|
1420
|
+
|
|
1421
|
+
***
|
|
1422
|
+
|
|
1423
|
+
<a id="newdatais"></a>
|
|
1424
|
+
|
|
1425
|
+
### newDataIs()
|
|
1426
|
+
|
|
1427
|
+
```ts
|
|
1428
|
+
const newDataIs: (type: "String" | "Number" | "Boolean") => Expr;
|
|
1429
|
+
```
|
|
1430
|
+
|
|
1431
|
+
Check incoming data type at current node
|
|
1432
|
+
|
|
1433
|
+
#### Parameters
|
|
1434
|
+
|
|
1435
|
+
| Parameter | Type |
|
|
1436
|
+
| :------ | :------ |
|
|
1437
|
+
| `type` | `"String"` \| `"Number"` \| `"Boolean"` |
|
|
1438
|
+
|
|
1439
|
+
#### Returns
|
|
1440
|
+
|
|
1441
|
+
[`Expr`](#expr)
|
|
1442
|
+
|
|
1443
|
+
***
|
|
1444
|
+
|
|
1445
|
+
<a id="newdataparentexists"></a>
|
|
1446
|
+
|
|
1447
|
+
### newDataParentExists()
|
|
1448
|
+
|
|
1449
|
+
```ts
|
|
1450
|
+
const newDataParentExists: (depth: number, field: string) => Expr;
|
|
1451
|
+
```
|
|
1452
|
+
|
|
1453
|
+
Navigate up from newData snapshot, then check if a child field exists
|
|
1454
|
+
|
|
1455
|
+
#### Parameters
|
|
1456
|
+
|
|
1457
|
+
| Parameter | Type |
|
|
1458
|
+
| :------ | :------ |
|
|
1459
|
+
| `depth` | `number` |
|
|
1460
|
+
| `field` | `string` |
|
|
1461
|
+
|
|
1462
|
+
#### Returns
|
|
1463
|
+
|
|
1464
|
+
[`Expr`](#expr)
|
|
1465
|
+
|
|
1466
|
+
***
|
|
1467
|
+
|
|
1468
|
+
<a id="newdataparentval"></a>
|
|
1469
|
+
|
|
1470
|
+
### newDataParentVal()
|
|
1471
|
+
|
|
1472
|
+
```ts
|
|
1473
|
+
const newDataParentVal: (depth: number, field: string) => Expr;
|
|
1474
|
+
```
|
|
1475
|
+
|
|
1476
|
+
Navigate up from newData snapshot, then read a child field's value
|
|
1477
|
+
|
|
1478
|
+
#### Parameters
|
|
1479
|
+
|
|
1480
|
+
| Parameter | Type |
|
|
1481
|
+
| :------ | :------ |
|
|
1482
|
+
| `depth` | `number` |
|
|
1483
|
+
| `field` | `string` |
|
|
1484
|
+
|
|
1485
|
+
#### Returns
|
|
1486
|
+
|
|
1487
|
+
[`Expr`](#expr)
|
|
1488
|
+
|
|
1489
|
+
***
|
|
1490
|
+
|
|
1491
|
+
<a id="newdataval"></a>
|
|
1492
|
+
|
|
1493
|
+
### newDataVal()
|
|
1494
|
+
|
|
1495
|
+
```ts
|
|
1496
|
+
const newDataVal: (path?: string) => Expr;
|
|
1497
|
+
```
|
|
1498
|
+
|
|
1499
|
+
Read incoming data value at current node or a child path (post-write state)
|
|
1500
|
+
|
|
1501
|
+
#### Parameters
|
|
1502
|
+
|
|
1503
|
+
| Parameter | Type |
|
|
1504
|
+
| :------ | :------ |
|
|
1505
|
+
| `path?` | `string` |
|
|
1506
|
+
|
|
1507
|
+
#### Returns
|
|
1508
|
+
|
|
1509
|
+
[`Expr`](#expr)
|
|
1510
|
+
|
|
1511
|
+
***
|
|
1512
|
+
|
|
1513
|
+
<a id="not"></a>
|
|
1514
|
+
|
|
1515
|
+
### not()
|
|
1516
|
+
|
|
1517
|
+
```ts
|
|
1518
|
+
const not: (e: Expr) => Expr;
|
|
1519
|
+
```
|
|
1520
|
+
|
|
1521
|
+
Negate a condition.
|
|
1522
|
+
|
|
1523
|
+
#### Parameters
|
|
1524
|
+
|
|
1525
|
+
| Parameter | Type |
|
|
1526
|
+
| :------ | :------ |
|
|
1527
|
+
| `e` | [`Expr`](#expr) |
|
|
1528
|
+
|
|
1529
|
+
#### Returns
|
|
1530
|
+
|
|
1531
|
+
[`Expr`](#expr)
|
|
1532
|
+
|
|
1533
|
+
***
|
|
1534
|
+
|
|
1535
|
+
<a id="ownerornew"></a>
|
|
1536
|
+
|
|
1537
|
+
### ownerOrNew()
|
|
1538
|
+
|
|
1539
|
+
```ts
|
|
1540
|
+
const ownerOrNew: (field: string) => Expr;
|
|
1541
|
+
```
|
|
1542
|
+
|
|
1543
|
+
Anyone authenticated can create; only the field owner can edit
|
|
1544
|
+
|
|
1545
|
+
#### Parameters
|
|
1546
|
+
|
|
1547
|
+
| Parameter | Type |
|
|
1548
|
+
| :------ | :------ |
|
|
1549
|
+
| `field` | `string` |
|
|
1550
|
+
|
|
1551
|
+
#### Returns
|
|
1552
|
+
|
|
1553
|
+
[`Expr`](#expr)
|
|
1554
|
+
|
|
1555
|
+
***
|
|
1556
|
+
|
|
1557
|
+
<a id="ownfield"></a>
|
|
1558
|
+
|
|
1559
|
+
### ownField()
|
|
1560
|
+
|
|
1561
|
+
```ts
|
|
1562
|
+
const ownField: (field: string) => Expr;
|
|
1563
|
+
```
|
|
1564
|
+
|
|
1565
|
+
Field-based ownership: auth.uid matches a value stored in a data field
|
|
1566
|
+
|
|
1567
|
+
#### Parameters
|
|
1568
|
+
|
|
1569
|
+
| Parameter | Type |
|
|
1570
|
+
| :------ | :------ |
|
|
1571
|
+
| `field` | `string` |
|
|
1572
|
+
|
|
1573
|
+
#### Returns
|
|
1574
|
+
|
|
1575
|
+
[`Expr`](#expr)
|
|
1576
|
+
|
|
1577
|
+
***
|
|
1578
|
+
|
|
1579
|
+
<a id="ownpath"></a>
|
|
1580
|
+
|
|
1581
|
+
### ownPath()
|
|
1582
|
+
|
|
1583
|
+
```ts
|
|
1584
|
+
const ownPath: (pathVar: string) => Expr;
|
|
1585
|
+
```
|
|
1586
|
+
|
|
1587
|
+
Path-based ownership: auth.uid matches a URL path variable
|
|
1588
|
+
|
|
1589
|
+
#### Parameters
|
|
1590
|
+
|
|
1591
|
+
| Parameter | Type |
|
|
1592
|
+
| :------ | :------ |
|
|
1593
|
+
| `pathVar` | `string` |
|
|
1594
|
+
|
|
1595
|
+
#### Returns
|
|
1596
|
+
|
|
1597
|
+
[`Expr`](#expr)
|
|
1598
|
+
|
|
1599
|
+
***
|
|
1600
|
+
|
|
1601
|
+
<a id="pathowneronly"></a>
|
|
1602
|
+
|
|
1603
|
+
### pathOwnerOnly()
|
|
1604
|
+
|
|
1605
|
+
```ts
|
|
1606
|
+
const pathOwnerOnly: (pathVar: string) => Expr;
|
|
1607
|
+
```
|
|
1608
|
+
|
|
1609
|
+
Only the path owner (auth.uid === $pathVar) can access
|
|
1610
|
+
|
|
1611
|
+
#### Parameters
|
|
1612
|
+
|
|
1613
|
+
| Parameter | Type |
|
|
1614
|
+
| :------ | :------ |
|
|
1615
|
+
| `pathVar` | `string` |
|
|
1616
|
+
|
|
1617
|
+
#### Returns
|
|
1618
|
+
|
|
1619
|
+
[`Expr`](#expr)
|
|
1620
|
+
|
|
1621
|
+
***
|
|
1622
|
+
|
|
1623
|
+
<a id="required"></a>
|
|
1624
|
+
|
|
1625
|
+
### required()
|
|
1626
|
+
|
|
1627
|
+
```ts
|
|
1628
|
+
const required: (...fields: string[]) => Expr;
|
|
1629
|
+
```
|
|
1630
|
+
|
|
1631
|
+
All specified fields must be present in the incoming data
|
|
1632
|
+
|
|
1633
|
+
#### Parameters
|
|
1634
|
+
|
|
1635
|
+
| Parameter | Type |
|
|
1636
|
+
| :------ | :------ |
|
|
1637
|
+
| ...`fields` | `string`[] |
|
|
1638
|
+
|
|
1639
|
+
#### Returns
|
|
1640
|
+
|
|
1641
|
+
[`Expr`](#expr)
|
|
1642
|
+
|
|
1643
|
+
***
|
|
1644
|
+
|
|
1645
|
+
<a id="rootequals"></a>
|
|
1646
|
+
|
|
1647
|
+
### rootEquals()
|
|
1648
|
+
|
|
1649
|
+
```ts
|
|
1650
|
+
const rootEquals: (segments: Segment[], value: string) => Expr;
|
|
1651
|
+
```
|
|
1652
|
+
|
|
1653
|
+
Check if a path's value equals a specific string (via root)
|
|
1654
|
+
|
|
1655
|
+
#### Parameters
|
|
1656
|
+
|
|
1657
|
+
| Parameter | Type |
|
|
1658
|
+
| :------ | :------ |
|
|
1659
|
+
| `segments` | [`Segment`](#segment)[] |
|
|
1660
|
+
| `value` | `string` |
|
|
1661
|
+
|
|
1662
|
+
#### Returns
|
|
1663
|
+
|
|
1664
|
+
[`Expr`](#expr)
|
|
1665
|
+
|
|
1666
|
+
***
|
|
1667
|
+
|
|
1668
|
+
<a id="rootexists"></a>
|
|
1669
|
+
|
|
1670
|
+
### rootExists()
|
|
1671
|
+
|
|
1672
|
+
```ts
|
|
1673
|
+
const rootExists: (segments: Segment[]) => Expr;
|
|
1674
|
+
```
|
|
1675
|
+
|
|
1676
|
+
Check if a path exists in the database (via root)
|
|
1677
|
+
|
|
1678
|
+
#### Parameters
|
|
1679
|
+
|
|
1680
|
+
| Parameter | Type |
|
|
1681
|
+
| :------ | :------ |
|
|
1682
|
+
| `segments` | [`Segment`](#segment)[] |
|
|
1683
|
+
|
|
1684
|
+
#### Returns
|
|
1685
|
+
|
|
1686
|
+
[`Expr`](#expr)
|
|
1687
|
+
|
|
1688
|
+
***
|
|
1689
|
+
|
|
1690
|
+
<a id="transition"></a>
|
|
1691
|
+
|
|
1692
|
+
### transition()
|
|
1693
|
+
|
|
1694
|
+
```ts
|
|
1695
|
+
const transition: (field: string, allowed: [string, string][]) => Expr;
|
|
1696
|
+
```
|
|
1697
|
+
|
|
1698
|
+
State machine: only allowed transitions on a field
|
|
1699
|
+
|
|
1700
|
+
#### Parameters
|
|
1701
|
+
|
|
1702
|
+
| Parameter | Type |
|
|
1703
|
+
| :------ | :------ |
|
|
1704
|
+
| `field` | `string` |
|
|
1705
|
+
| `allowed` | \[`string`, `string`\][] |
|
|
1706
|
+
|
|
1707
|
+
#### Returns
|
|
1708
|
+
|
|
1709
|
+
[`Expr`](#expr)
|
|
1710
|
+
|
|
1711
|
+
## Functions
|
|
1712
|
+
|
|
1713
|
+
<a id="assertcase"></a>
|
|
1714
|
+
|
|
1715
|
+
### assertCase()
|
|
1716
|
+
|
|
1717
|
+
#### Call Signature
|
|
1718
|
+
|
|
1719
|
+
```ts
|
|
1720
|
+
function assertCase(result: CaseResult | RtdbCaseResult): void;
|
|
1721
|
+
```
|
|
1722
|
+
|
|
1723
|
+
Throw when a case result did not pass. A simulator abstention throws
|
|
1724
|
+
[RulesUnsupportedError](#rulesunsupportederror); a genuine expectation mismatch throws
|
|
1725
|
+
[RulesAssertionError](#rulesassertionerror). Both carry the [explainCase](#explaincase) trace as
|
|
1726
|
+
their message. Returns `void` on a passing result.
|
|
1727
|
+
|
|
1728
|
+
##### Parameters
|
|
1729
|
+
|
|
1730
|
+
| Parameter | Type |
|
|
1731
|
+
| :------ | :------ |
|
|
1732
|
+
| `result` | [`CaseResult`](#caseresult) \| [`RtdbCaseResult`](#rtdbcaseresult) |
|
|
1733
|
+
|
|
1734
|
+
##### Returns
|
|
1735
|
+
|
|
1736
|
+
`void`
|
|
1737
|
+
|
|
1738
|
+
#### Call Signature
|
|
1739
|
+
|
|
1740
|
+
```ts
|
|
1741
|
+
function assertCase(ruleset: FirestoreRuleset, oneCase: FirestoreCase): void;
|
|
1742
|
+
```
|
|
1743
|
+
|
|
1744
|
+
Simulate one case against a ruleset and throw on a miss — the runner
|
|
1745
|
+
form: `for (const c of cases) test(c.description, () => assertCase(ruleset, c))`.
|
|
1746
|
+
|
|
1747
|
+
##### Parameters
|
|
1748
|
+
|
|
1749
|
+
| Parameter | Type |
|
|
1750
|
+
| :------ | :------ |
|
|
1751
|
+
| `ruleset` | [`FirestoreRuleset`](#firestoreruleset) |
|
|
1752
|
+
| `oneCase` | [`FirestoreCase`](#firestorecase) |
|
|
1753
|
+
|
|
1754
|
+
##### Returns
|
|
1755
|
+
|
|
1756
|
+
`void`
|
|
1757
|
+
|
|
1758
|
+
#### Call Signature
|
|
1759
|
+
|
|
1760
|
+
```ts
|
|
1761
|
+
function assertCase(ruleset: RtdbRuleset, oneCase: RtdbCase): void;
|
|
1762
|
+
```
|
|
1763
|
+
|
|
1764
|
+
Throw when a case result did not pass. A simulator abstention throws
|
|
1765
|
+
[RulesUnsupportedError](#rulesunsupportederror); a genuine expectation mismatch throws
|
|
1766
|
+
[RulesAssertionError](#rulesassertionerror). Both carry the [explainCase](#explaincase) trace as
|
|
1767
|
+
their message. Returns `void` on a passing result.
|
|
1768
|
+
|
|
1769
|
+
##### Parameters
|
|
1770
|
+
|
|
1771
|
+
| Parameter | Type |
|
|
1772
|
+
| :------ | :------ |
|
|
1773
|
+
| `ruleset` | [`RtdbRuleset`](#rtdbruleset) |
|
|
1774
|
+
| `oneCase` | [`RtdbCase`](#rtdbcase) |
|
|
1775
|
+
|
|
1776
|
+
##### Returns
|
|
1777
|
+
|
|
1778
|
+
`void`
|
|
1779
|
+
|
|
1780
|
+
#### Call Signature
|
|
1781
|
+
|
|
1782
|
+
```ts
|
|
1783
|
+
function assertCase(source: string, oneCase: FirestoreCase): void;
|
|
1784
|
+
```
|
|
1785
|
+
|
|
1786
|
+
Convenience: compile Firestore source and assert one case against it.
|
|
1787
|
+
|
|
1788
|
+
##### Parameters
|
|
1789
|
+
|
|
1790
|
+
| Parameter | Type |
|
|
1791
|
+
| :------ | :------ |
|
|
1792
|
+
| `source` | `string` |
|
|
1793
|
+
| `oneCase` | [`FirestoreCase`](#firestorecase) |
|
|
1794
|
+
|
|
1795
|
+
##### Returns
|
|
1796
|
+
|
|
1797
|
+
`void`
|
|
1798
|
+
|
|
1799
|
+
***
|
|
1800
|
+
|
|
1801
|
+
<a id="bytes"></a>
|
|
1802
|
+
|
|
1803
|
+
### bytes()
|
|
1804
|
+
|
|
1805
|
+
```ts
|
|
1806
|
+
function bytes(input: string | Uint8Array<ArrayBufferLike>): Bytes;
|
|
1807
|
+
```
|
|
1808
|
+
|
|
1809
|
+
A `bytes` value.
|
|
1810
|
+
- string → UTF-8 encoded
|
|
1811
|
+
- Uint8Array → used verbatim
|
|
1812
|
+
|
|
1813
|
+
#### Parameters
|
|
1814
|
+
|
|
1815
|
+
| Parameter | Type |
|
|
1816
|
+
| :------ | :------ |
|
|
1817
|
+
| `input` | `string` \| `Uint8Array`\<`ArrayBufferLike`\> |
|
|
1818
|
+
|
|
1819
|
+
#### Returns
|
|
1820
|
+
|
|
1821
|
+
`Bytes`
|
|
1822
|
+
|
|
1823
|
+
***
|
|
1824
|
+
|
|
1825
|
+
<a id="definertdbrules"></a>
|
|
1826
|
+
|
|
1827
|
+
### defineRtdbRules()
|
|
1828
|
+
|
|
1829
|
+
```ts
|
|
1830
|
+
function defineRtdbRules(definition: RtdbRulesDefinition): RtdbRulesDocument;
|
|
1831
|
+
```
|
|
1832
|
+
|
|
1833
|
+
#### Parameters
|
|
1834
|
+
|
|
1835
|
+
| Parameter | Type |
|
|
1836
|
+
| :------ | :------ |
|
|
1837
|
+
| `definition` | [`RtdbRulesDefinition`](#rtdbrulesdefinition) |
|
|
1838
|
+
|
|
1839
|
+
#### Returns
|
|
1840
|
+
|
|
1841
|
+
[`RtdbRulesDocument`](#rtdbrulesdocument)
|
|
1842
|
+
|
|
1843
|
+
***
|
|
1844
|
+
|
|
1845
|
+
<a id="duration"></a>
|
|
1846
|
+
|
|
1847
|
+
### duration()
|
|
1848
|
+
|
|
1849
|
+
```ts
|
|
1850
|
+
function duration(value: number, unit?: string): Duration;
|
|
1851
|
+
```
|
|
1852
|
+
|
|
1853
|
+
A `duration` value. `unit` is one of the Firestore duration units
|
|
1854
|
+
(`'w' | 'd' | 'h' | 'm' | 's' | 'ms' | 'ns'`); defaults to seconds.
|
|
1855
|
+
|
|
1856
|
+
#### Parameters
|
|
1857
|
+
|
|
1858
|
+
| Parameter | Type |
|
|
1859
|
+
| :------ | :------ |
|
|
1860
|
+
| `value` | `number` |
|
|
1861
|
+
| `unit?` | `string` |
|
|
1862
|
+
|
|
1863
|
+
#### Returns
|
|
1864
|
+
|
|
1865
|
+
`Duration`
|
|
1866
|
+
|
|
1867
|
+
***
|
|
1868
|
+
|
|
1869
|
+
<a id="explaincase"></a>
|
|
1870
|
+
|
|
1871
|
+
### explainCase()
|
|
1872
|
+
|
|
1873
|
+
```ts
|
|
1874
|
+
function explainCase(result: CaseResult | RtdbCaseResult): string;
|
|
1875
|
+
```
|
|
1876
|
+
|
|
1877
|
+
Render a case result as a human-readable trace. The single sanctioned
|
|
1878
|
+
trace renderer — used as the message of the error `assertCase` throws, and
|
|
1879
|
+
available directly for logging a result without asserting.
|
|
1880
|
+
|
|
1881
|
+
#### Parameters
|
|
1882
|
+
|
|
1883
|
+
| Parameter | Type |
|
|
1884
|
+
| :------ | :------ |
|
|
1885
|
+
| `result` | [`CaseResult`](#caseresult) \| [`RtdbCaseResult`](#rtdbcaseresult) |
|
|
1886
|
+
|
|
1887
|
+
#### Returns
|
|
1888
|
+
|
|
1889
|
+
`string`
|
|
1890
|
+
|
|
1891
|
+
***
|
|
1892
|
+
|
|
1893
|
+
<a id="firestorerules"></a>
|
|
1894
|
+
|
|
1895
|
+
### firestoreRules()
|
|
1896
|
+
|
|
1897
|
+
```ts
|
|
1898
|
+
function firestoreRules(source: string): FirestoreRuleset;
|
|
1899
|
+
```
|
|
1900
|
+
|
|
1901
|
+
Compile Firestore rules source into a deep, safe-by-default handle.
|
|
1902
|
+
|
|
1903
|
+
#### Parameters
|
|
1904
|
+
|
|
1905
|
+
| Parameter | Type |
|
|
1906
|
+
| :------ | :------ |
|
|
1907
|
+
| `source` | `string` |
|
|
1908
|
+
|
|
1909
|
+
#### Returns
|
|
1910
|
+
|
|
1911
|
+
[`FirestoreRuleset`](#firestoreruleset)
|
|
1912
|
+
|
|
1913
|
+
#### Throws
|
|
1914
|
+
|
|
1915
|
+
when the source does not parse. The thrown
|
|
1916
|
+
error carries the compile-blocking issues on `.issues`.
|
|
1917
|
+
|
|
1918
|
+
***
|
|
1919
|
+
|
|
1920
|
+
<a id="flip"></a>
|
|
1921
|
+
|
|
1922
|
+
### flip()
|
|
1923
|
+
|
|
1924
|
+
```ts
|
|
1925
|
+
function flip(marks: string[]): string;
|
|
1926
|
+
```
|
|
1927
|
+
|
|
1928
|
+
Turn flip: validates a turn field alternates between marks.
|
|
1929
|
+
First mark is the initial value on creation.
|
|
1930
|
+
Supports 2+ players with circular rotation.
|
|
1931
|
+
|
|
1932
|
+
#### Parameters
|
|
1933
|
+
|
|
1934
|
+
| Parameter | Type | Description |
|
|
1935
|
+
| :------ | :------ | :------ |
|
|
1936
|
+
| `marks` | `string`[] | ordered list of marks (e.g., ["X", "O"]) |
|
|
1937
|
+
|
|
1938
|
+
#### Returns
|
|
1939
|
+
|
|
1940
|
+
`string`
|
|
1941
|
+
|
|
1942
|
+
***
|
|
1943
|
+
|
|
1944
|
+
<a id="latlng"></a>
|
|
1945
|
+
|
|
1946
|
+
### latlng()
|
|
1947
|
+
|
|
1948
|
+
```ts
|
|
1949
|
+
function latlng(lat: number, lng: number): LatLng;
|
|
1950
|
+
```
|
|
1951
|
+
|
|
1952
|
+
A `latlng` geographic point.
|
|
1953
|
+
|
|
1954
|
+
#### Parameters
|
|
1955
|
+
|
|
1956
|
+
| Parameter | Type |
|
|
1957
|
+
| :------ | :------ |
|
|
1958
|
+
| `lat` | `number` |
|
|
1959
|
+
| `lng` | `number` |
|
|
1960
|
+
|
|
1961
|
+
#### Returns
|
|
1962
|
+
|
|
1963
|
+
`LatLng`
|
|
1964
|
+
|
|
1965
|
+
***
|
|
1966
|
+
|
|
1967
|
+
<a id="lint-4"></a>
|
|
1968
|
+
|
|
1969
|
+
### lint()
|
|
1970
|
+
|
|
1971
|
+
```ts
|
|
1972
|
+
function lint(source: string): RuleIssue[];
|
|
1973
|
+
```
|
|
1974
|
+
|
|
1975
|
+
Lint Firestore rules source. Accepts anything — including empty or
|
|
1976
|
+
syntactically broken source — and always returns an issue list.
|
|
1977
|
+
|
|
1978
|
+
#### Parameters
|
|
1979
|
+
|
|
1980
|
+
| Parameter | Type |
|
|
1981
|
+
| :------ | :------ |
|
|
1982
|
+
| `source` | `string` |
|
|
1983
|
+
|
|
1984
|
+
#### Returns
|
|
1985
|
+
|
|
1986
|
+
[`RuleIssue`](#ruleissue)[]
|
|
1987
|
+
|
|
1988
|
+
***
|
|
1989
|
+
|
|
1990
|
+
<a id="reference"></a>
|
|
1991
|
+
|
|
1992
|
+
### reference()
|
|
1993
|
+
|
|
1994
|
+
```ts
|
|
1995
|
+
function reference(path: string): Reference;
|
|
1996
|
+
```
|
|
1997
|
+
|
|
1998
|
+
A `reference` to a document, by its path (e.g. `"users/alice"`).
|
|
1999
|
+
|
|
2000
|
+
#### Parameters
|
|
2001
|
+
|
|
2002
|
+
| Parameter | Type |
|
|
2003
|
+
| :------ | :------ |
|
|
2004
|
+
| `path` | `string` |
|
|
2005
|
+
|
|
2006
|
+
#### Returns
|
|
2007
|
+
|
|
2008
|
+
`Reference`
|
|
2009
|
+
|
|
2010
|
+
***
|
|
2011
|
+
|
|
2012
|
+
<a id="rtdbrules"></a>
|
|
2013
|
+
|
|
2014
|
+
### rtdbRules()
|
|
2015
|
+
|
|
2016
|
+
```ts
|
|
2017
|
+
function rtdbRules(input: RtdbRulesInput): RtdbRuleset;
|
|
2018
|
+
```
|
|
2019
|
+
|
|
2020
|
+
Build a deep handle on a Realtime Database ruleset from a definition, a
|
|
2021
|
+
compiled document, or compiled `{ rules }` JSON.
|
|
2022
|
+
|
|
2023
|
+
#### Parameters
|
|
2024
|
+
|
|
2025
|
+
| Parameter | Type |
|
|
2026
|
+
| :------ | :------ |
|
|
2027
|
+
| `input` | `RtdbRulesInput` |
|
|
2028
|
+
|
|
2029
|
+
#### Returns
|
|
2030
|
+
|
|
2031
|
+
[`RtdbRuleset`](#rtdbruleset)
|
|
2032
|
+
|
|
2033
|
+
***
|
|
2034
|
+
|
|
2035
|
+
<a id="ruleset"></a>
|
|
2036
|
+
|
|
2037
|
+
### ruleset()
|
|
2038
|
+
|
|
2039
|
+
```ts
|
|
2040
|
+
function ruleset(input:
|
|
2041
|
+
| Record<string, PathDef>
|
|
2042
|
+
| (ctx: RulesetContext) => void): RtdbNode;
|
|
2043
|
+
```
|
|
2044
|
+
|
|
2045
|
+
Compile a declarative rules definition into an environment-independent tree.
|
|
2046
|
+
|
|
2047
|
+
#### Parameters
|
|
2048
|
+
|
|
2049
|
+
| Parameter | Type |
|
|
2050
|
+
| :------ | :------ |
|
|
2051
|
+
| `input` | \| `Record`\<`string`, [`PathDef`](#pathdef)\> \| (`ctx`: [`RulesetContext`](#rulesetcontext)) => `void` |
|
|
2052
|
+
|
|
2053
|
+
#### Returns
|
|
2054
|
+
|
|
2055
|
+
`RtdbNode`
|
|
2056
|
+
|
|
2057
|
+
***
|
|
2058
|
+
|
|
2059
|
+
<a id="schemarules"></a>
|
|
2060
|
+
|
|
2061
|
+
### schemaRules()
|
|
2062
|
+
|
|
2063
|
+
```ts
|
|
2064
|
+
function schemaRules(schema: ZodObject<any>, fieldConstraints?: Record<string, Expr[]>): SchemaRulesResult;
|
|
2065
|
+
```
|
|
2066
|
+
|
|
2067
|
+
Generate RTDB validate rules from a Zod object schema.
|
|
2068
|
+
Optional fieldConstraints are AND-composed with the schema type check.
|
|
2069
|
+
|
|
2070
|
+
#### Parameters
|
|
2071
|
+
|
|
2072
|
+
| Parameter | Type |
|
|
2073
|
+
| :------ | :------ |
|
|
2074
|
+
| `schema` | `ZodObject`\<`any`\> |
|
|
2075
|
+
| `fieldConstraints?` | `Record`\<`string`, [`Expr`](#expr)[]\> |
|
|
2076
|
+
|
|
2077
|
+
#### Returns
|
|
2078
|
+
|
|
2079
|
+
[`SchemaRulesResult`](#schemarulesresult)
|
|
2080
|
+
|
|
2081
|
+
***
|
|
2082
|
+
|
|
2083
|
+
<a id="servertimestamp"></a>
|
|
2084
|
+
|
|
2085
|
+
### serverTimestamp()
|
|
2086
|
+
|
|
2087
|
+
```ts
|
|
2088
|
+
function serverTimestamp(): {
|
|
2089
|
+
};
|
|
2090
|
+
```
|
|
2091
|
+
|
|
2092
|
+
The server-timestamp sentinel — the case-data equivalent of
|
|
2093
|
+
`FieldValue.serverTimestamp()`. The simulator resolves it to the request
|
|
2094
|
+
time, so a rule comparing `data.createdAt == request.time` sees a match.
|
|
2095
|
+
|
|
2096
|
+
#### Returns
|
|
2097
|
+
|
|
2098
|
+
```ts
|
|
2099
|
+
{
|
|
2100
|
+
}
|
|
2101
|
+
```
|
|
2102
|
+
|
|
2103
|
+
***
|
|
2104
|
+
|
|
2105
|
+
<a id="timestamp"></a>
|
|
2106
|
+
|
|
2107
|
+
### timestamp()
|
|
2108
|
+
|
|
2109
|
+
```ts
|
|
2110
|
+
function timestamp(input:
|
|
2111
|
+
| string
|
|
2112
|
+
| number
|
|
2113
|
+
| {
|
|
2114
|
+
nanos?: number;
|
|
2115
|
+
seconds: number;
|
|
2116
|
+
}): Timestamp;
|
|
2117
|
+
```
|
|
2118
|
+
|
|
2119
|
+
A Firestore `timestamp` value.
|
|
2120
|
+
- number → milliseconds since the epoch
|
|
2121
|
+
- string → ISO-8601
|
|
2122
|
+
- object → explicit `{ seconds, nanos }`
|
|
2123
|
+
|
|
2124
|
+
#### Parameters
|
|
2125
|
+
|
|
2126
|
+
| Parameter | Type |
|
|
2127
|
+
| :------ | :------ |
|
|
2128
|
+
| `input` | \| `string` \| `number` \| \{ `nanos?`: `number`; `seconds`: `number`; \} |
|
|
2129
|
+
|
|
2130
|
+
#### Returns
|
|
2131
|
+
|
|
2132
|
+
`Timestamp`
|
|
2133
|
+
|
|
2134
|
+
***
|
|
2135
|
+
|
|
2136
|
+
<a id="turnguard"></a>
|
|
2137
|
+
|
|
2138
|
+
### turnGuard()
|
|
2139
|
+
|
|
2140
|
+
```ts
|
|
2141
|
+
function turnGuard(
|
|
2142
|
+
turnField: string,
|
|
2143
|
+
players: Record<string, string>,
|
|
2144
|
+
statusField?: string,
|
|
2145
|
+
playingValue?: string): string;
|
|
2146
|
+
```
|
|
2147
|
+
|
|
2148
|
+
Turn enforcement: only the current turn's player can write.
|
|
2149
|
+
Uses data (pre-write) for the turn check — NOT newData.
|
|
2150
|
+
|
|
2151
|
+
#### Parameters
|
|
2152
|
+
|
|
2153
|
+
| Parameter | Type | Description |
|
|
2154
|
+
| :------ | :------ | :------ |
|
|
2155
|
+
| `turnField` | `string` | the field that stores whose turn it is (e.g., "currentTurn") |
|
|
2156
|
+
| `players` | `Record`\<`string`, `string`\> | map of mark → player field (e.g., { X: "playerX", O: "playerO" }) |
|
|
2157
|
+
| `statusField?` | `string` | optional field that must equal playingValue for moves to be allowed |
|
|
2158
|
+
| `playingValue?` | `string` | the value of statusField during active play (e.g., "playing") |
|
|
2159
|
+
|
|
2160
|
+
#### Returns
|
|
2161
|
+
|
|
2162
|
+
`string`
|
|
2163
|
+
|
|
2164
|
+
***
|
|
2165
|
+
|
|
2166
|
+
<a id="vector"></a>
|
|
2167
|
+
|
|
2168
|
+
### vector()
|
|
2169
|
+
|
|
2170
|
+
```ts
|
|
2171
|
+
function vector(values: readonly number[]): Vector;
|
|
2172
|
+
```
|
|
2173
|
+
|
|
2174
|
+
A `vector` value from its numeric components.
|
|
2175
|
+
|
|
2176
|
+
#### Parameters
|
|
2177
|
+
|
|
2178
|
+
| Parameter | Type |
|
|
2179
|
+
| :------ | :------ |
|
|
2180
|
+
| `values` | readonly `number`[] |
|
|
2181
|
+
|
|
2182
|
+
#### Returns
|
|
2183
|
+
|
|
2184
|
+
`Vector`
|
|
2185
|
+
|
|
2186
|
+
***
|
|
2187
|
+
|
|
2188
|
+
<a id="wincheckhelper"></a>
|
|
2189
|
+
|
|
2190
|
+
### winCheckHelper()
|
|
2191
|
+
|
|
2192
|
+
```ts
|
|
2193
|
+
function winCheckHelper(
|
|
2194
|
+
mark: string,
|
|
2195
|
+
lines: number[][],
|
|
2196
|
+
boardPath?: string): string;
|
|
2197
|
+
```
|
|
2198
|
+
|
|
2199
|
+
Win check helper: validates a boolean field against winning lines on a board.
|
|
2200
|
+
If true, at least one winning line must exist. If false, no winning line can exist.
|
|
2201
|
+
Uses the "client claims, rules verify" pattern.
|
|
2202
|
+
|
|
2203
|
+
#### Parameters
|
|
2204
|
+
|
|
2205
|
+
| Parameter | Type | Description |
|
|
2206
|
+
| :------ | :------ | :------ |
|
|
2207
|
+
| `mark` | `string` | the player mark to check (e.g., "X") |
|
|
2208
|
+
| `lines` | `number`[][] | array of winning line coordinates (e.g., [[0,1,2], [3,4,5], ...]) |
|
|
2209
|
+
| `boardPath?` | `string` | the path to the board relative to the parent (default "board") |
|
|
2210
|
+
|
|
2211
|
+
#### Returns
|
|
2212
|
+
|
|
2213
|
+
`string`
|