@pyric/cli 0.1.0-alpha.9
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 +156 -0
- package/README.md.orig +138 -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 +7 -0
- package/dist/assurance/capabilities.d.ts.map +1 -0
- package/dist/assurance/capabilities.js +295 -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/generated-capabilities.d.ts +52 -0
- package/dist/assurance/generated-capabilities.d.ts.map +1 -0
- package/dist/assurance/generated-capabilities.js +329 -0
- package/dist/assurance/generated-capabilities.js.map +1 -0
- package/dist/assurance/index.d.ts +11 -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 +740 -0
- package/dist/assurance/tools.js.map +1 -0
- package/dist/assurance/types.d.ts +348 -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 +62 -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 +81 -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/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 +379 -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 +69 -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/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_.CQYSemvw.css +1 -0
- package/dist/serve/docs-ui/docs/_rhythm/index.html +99 -0
- package/dist/serve/docs-ui/docs/_rhythm.md +101 -0
- package/dist/serve/docs-ui/docs/api-reference/index.html +64 -0
- package/dist/serve/docs-ui/docs/api-reference.md +67 -0
- package/dist/serve/docs-ui/docs/audit-your-rules/index.html +34 -0
- package/dist/serve/docs-ui/docs/audit-your-rules.md +50 -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/firestore-rules-limits/index.html +59 -0
- package/dist/serve/docs-ui/docs/firestore-rules-limits.md +54 -0
- package/dist/serve/docs-ui/docs/how-the-swap-works/index.html +47 -0
- package/dist/serve/docs-ui/docs/how-the-swap-works.md +43 -0
- package/dist/serve/docs-ui/docs/how-we-know-it-matches-firebase/index.html +131 -0
- package/dist/serve/docs-ui/docs/how-we-know-it-matches-firebase.md +169 -0
- package/dist/serve/docs-ui/docs/index.html +2 -0
- package/dist/serve/docs-ui/docs/index.json +18637 -0
- package/dist/serve/docs-ui/docs/overview/index.html +23 -0
- package/dist/serve/docs-ui/docs/overview.md +40 -0
- package/dist/serve/docs-ui/docs/pyric-admin-app/index.html +19 -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-app.md +27 -0
- package/dist/serve/docs-ui/docs/pyric-admin-auth/index.html +24 -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-auth.md +29 -0
- package/dist/serve/docs-ui/docs/pyric-admin-database/index.html +26 -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-database.md +31 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore/index.html +38 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-explanation-error-translation/index.html +57 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-explanation-error-translation.md +95 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-explanation-per-call-delegate/index.html +58 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-explanation-per-call-delegate.md +94 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-explanation-why-mirror-admin-shape/index.html +59 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-explanation-why-mirror-admin-shape.md +88 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-run-a-transaction/index.html +53 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-run-a-transaction.md +76 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-seed-and-set-rules/index.html +62 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-seed-and-set-rules.md +96 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-translate-denials/index.html +80 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-translate-denials.md +98 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-use-onsnapshot/index.html +57 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-use-onsnapshot.md +88 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-write-a-batch/index.html +50 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-write-a-batch.md +73 -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-firestore-reference-onsnapshot/index.html +68 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-onsnapshot.md +81 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-re-exported-types/index.html +76 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-re-exported-types.md +103 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-sandbox-firestore/index.html +40 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-sandbox-firestore.md +77 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-tutorials-01-first-admin-session/index.html +118 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-tutorials-01-first-admin-session.md +166 -0
- package/dist/serve/docs-ui/docs/pyric-admin-firestore.md +53 -0
- package/dist/serve/docs-ui/docs/pyric-admin-storage/index.html +25 -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-admin-storage.md +30 -0
- package/dist/serve/docs-ui/docs/pyric-ai-compat/index.html +436 -0
- package/dist/serve/docs-ui/docs/pyric-ai-compat.md +471 -0
- package/dist/serve/docs-ui/docs/pyric-ai-reference-api/index.html +5831 -0
- package/dist/serve/docs-ui/docs/pyric-ai-reference-api.md +5440 -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-compat/index.html +180 -0
- package/dist/serve/docs-ui/docs/pyric-app-compat.md +199 -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/index.html +59 -0
- package/dist/serve/docs-ui/docs/pyric-auth-compat/index.html +804 -0
- package/dist/serve/docs-ui/docs/pyric-auth-compat.md +847 -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-auth-reference-feature-matrix/index.html +781 -0
- package/dist/serve/docs-ui/docs/pyric-auth-reference-feature-matrix.md +198 -0
- package/dist/serve/docs-ui/docs/pyric-auth-reference-sandbox-test-driver/index.html +71 -0
- package/dist/serve/docs-ui/docs/pyric-auth-reference-sandbox-test-driver.md +108 -0
- package/dist/serve/docs-ui/docs/pyric-auth.md +86 -0
- package/dist/serve/docs-ui/docs/pyric-cli/index.html +40 -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 +2355 -0
- package/dist/serve/docs-ui/docs/pyric-cli-assurance-reference-api.md +1554 -0
- package/dist/serve/docs-ui/docs/pyric-cli-bridge/index.html +69 -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-bridge.md +99 -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-functions-rtdb-compat/index.html +112 -0
- package/dist/serve/docs-ui/docs/pyric-cli-functions-rtdb-compat.md +124 -0
- package/dist/serve/docs-ui/docs/pyric-cli-how-to-build-a-standalone-binary/index.html +91 -0
- package/dist/serve/docs-ui/docs/pyric-cli-how-to-build-a-standalone-binary.md +105 -0
- package/dist/serve/docs-ui/docs/pyric-cli-how-to-promote-sandbox-state-to-a-fixture/index.html +52 -0
- package/dist/serve/docs-ui/docs/pyric-cli-how-to-promote-sandbox-state-to-a-fixture.md +98 -0
- package/dist/serve/docs-ui/docs/pyric-cli-how-to-run-rtdb-onvaluecreated/index.html +66 -0
- package/dist/serve/docs-ui/docs/pyric-cli-how-to-run-rtdb-onvaluecreated.md +100 -0
- package/dist/serve/docs-ui/docs/pyric-cli-how-to-serve-persistence-and-multi-tab/index.html +228 -0
- package/dist/serve/docs-ui/docs/pyric-cli-how-to-serve-persistence-and-multi-tab.md +179 -0
- package/dist/serve/docs-ui/docs/pyric-cli-how-to-use-the-vite-plugin/index.html +341 -0
- package/dist/serve/docs-ui/docs/pyric-cli-how-to-use-the-vite-plugin.md +309 -0
- package/dist/serve/docs-ui/docs/pyric-cli-how-to-verify-against-a-captured-session/index.html +128 -0
- package/dist/serve/docs-ui/docs/pyric-cli-how-to-verify-against-a-captured-session.md +207 -0
- package/dist/serve/docs-ui/docs/pyric-cli-reference-cli/index.html +404 -0
- package/dist/serve/docs-ui/docs/pyric-cli-reference-cli.md +249 -0
- package/dist/serve/docs-ui/docs/pyric-cli-reference-package-and-resolution/index.html +93 -0
- package/dist/serve/docs-ui/docs/pyric-cli-reference-package-and-resolution.md +65 -0
- package/dist/serve/docs-ui/docs/pyric-cli-reference-verify/index.html +81 -0
- package/dist/serve/docs-ui/docs/pyric-cli-reference-verify.md +110 -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-tutorials-server-adoption/index.html +219 -0
- package/dist/serve/docs-ui/docs/pyric-cli-tutorials-server-adoption.md +251 -0
- package/dist/serve/docs-ui/docs/pyric-cli-tutorials-wire-claude-code/index.html +136 -0
- package/dist/serve/docs-ui/docs/pyric-cli-tutorials-wire-claude-code.md +217 -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-cli.md +42 -0
- package/dist/serve/docs-ui/docs/pyric-conformance-scores/index.html +180 -0
- package/dist/serve/docs-ui/docs/pyric-conformance-scores.md +184 -0
- package/dist/serve/docs-ui/docs/pyric-database/index.html +43 -0
- package/dist/serve/docs-ui/docs/pyric-database-compat/index.html +1224 -0
- package/dist/serve/docs-ui/docs/pyric-database-compat.md +1289 -0
- package/dist/serve/docs-ui/docs/pyric-database-explanation-rules-authoring-and-deploy-are-separate/index.html +16 -0
- package/dist/serve/docs-ui/docs/pyric-database-explanation-rules-authoring-and-deploy-are-separate.md +23 -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-database-reference-constraints/index.html +381 -0
- package/dist/serve/docs-ui/docs/pyric-database-reference-constraints.md +168 -0
- package/dist/serve/docs-ui/docs/pyric-database-reference-rules-tooling/index.html +218 -0
- package/dist/serve/docs-ui/docs/pyric-database-reference-rules-tooling.md +303 -0
- package/dist/serve/docs-ui/docs/pyric-database-tutorials-01-author-rtdb-rules-with-constraints/index.html +125 -0
- package/dist/serve/docs-ui/docs/pyric-database-tutorials-01-author-rtdb-rules-with-constraints.md +171 -0
- package/dist/serve/docs-ui/docs/pyric-database.md +26 -0
- package/dist/serve/docs-ui/docs/pyric-explanation-versioning-and-compatibility/index.html +40 -0
- package/dist/serve/docs-ui/docs/pyric-explanation-versioning-and-compatibility.md +68 -0
- package/dist/serve/docs-ui/docs/pyric-firestore/index.html +48 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-compat/index.html +868 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-compat.md +939 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-explanation-rules-tooling-is-separate/index.html +92 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-explanation-rules-tooling-is-separate.md +70 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-explanation-target-symbol-opacity/index.html +59 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-explanation-target-symbol-opacity.md +91 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-explanation-two-backends-one-surface/index.html +43 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-explanation-two-backends-one-surface.md +58 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-migrate-from-firebase-firestore/index.html +58 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-migrate-from-firebase-firestore.md +86 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-pick-a-backend/index.html +52 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-pick-a-backend.md +83 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-run-a-transaction/index.html +42 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-run-a-transaction.md +59 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-use-onsnapshot/index.html +66 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-use-onsnapshot.md +96 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-use-sandbox-ops/index.html +61 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-how-to-use-sandbox-ops.md +92 -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-reference-feature-matrix/index.html +80 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-feature-matrix.md +66 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-getfirestore/index.html +46 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-getfirestore.md +73 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-query-constraints/index.html +80 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-query-constraints.md +129 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-sandbox-ops/index.html +58 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-sandbox-ops.md +88 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-tool-factories/index.html +51 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-tool-factories.md +71 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-tutorials-01-write-a-sandbox-demo/index.html +130 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-tutorials-01-write-a-sandbox-demo.md +180 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-tutorials-02-swap-to-prod-backend/index.html +59 -0
- package/dist/serve/docs-ui/docs/pyric-firestore-tutorials-02-swap-to-prod-backend.md +92 -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-firestore.md +72 -0
- package/dist/serve/docs-ui/docs/pyric-messaging-compat/index.html +300 -0
- package/dist/serve/docs-ui/docs/pyric-messaging-compat.md +321 -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/index.html +87 -0
- package/dist/serve/docs-ui/docs/pyric-rules-compat/index.html +328 -0
- package/dist/serve/docs-ui/docs/pyric-rules-compat.md +347 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-agent-failure-modes/index.html +50 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-agent-failure-modes.md +78 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-lint-vs-validate-vs-simulate-vs-test/index.html +79 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-lint-vs-validate-vs-simulate-vs-test.md +69 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-runtime-budget-and-shared-gates/index.html +67 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-runtime-budget-and-shared-gates.md +75 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-sentinel-expression-engine/index.html +49 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-sentinel-expression-engine.md +74 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-simulator-vs-rules-test-api/index.html +95 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-simulator-vs-rules-test-api.md +80 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-the-2-plus-modules-extension/index.html +58 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-the-2-plus-modules-extension.md +79 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-value-wrappers-design/index.html +63 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-value-wrappers-design.md +84 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-why-this-package-exists/index.html +34 -0
- package/dist/serve/docs-ui/docs/pyric-rules-explanation-why-this-package-exists.md +43 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-compare-rulesets-for-weakening/index.html +55 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-compare-rulesets-for-weakening.md +77 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-inspect-rules-via-the-ast/index.html +90 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-inspect-rules-via-the-ast.md +129 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-lint-rules-source/index.html +55 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-lint-rules-source.md +84 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-pin-request-time/index.html +49 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-pin-request-time.md +64 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-register-tools-with-an-agent/index.html +61 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-register-tools-with-an-agent.md +87 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-resolve-module-imports/index.html +93 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-resolve-module-imports.md +105 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-simulate-rules-locally/index.html +89 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-simulate-rules-locally.md +134 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-test-rules-against-firebase/index.html +66 -0
- package/dist/serve/docs-ui/docs/pyric-rules-how-to-test-rules-against-firebase.md +102 -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-rules-reference-ast/index.html +85 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-ast.md +121 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-conformance-gaps/index.html +277 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-conformance-gaps.md +360 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-errors/index.html +76 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-errors.md +123 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-lint-rules/index.html +148 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-lint-rules.md +159 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-simulator-context/index.html +66 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-simulator-context.md +104 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-stdlib-modules/index.html +241 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-stdlib-modules.md +143 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-test-case-schema/index.html +94 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-test-case-schema.md +121 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-validator-findings/index.html +87 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-validator-findings.md +117 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-value-wrappers/index.html +102 -0
- package/dist/serve/docs-ui/docs/pyric-rules-reference-value-wrappers.md +152 -0
- package/dist/serve/docs-ui/docs/pyric-rules.md +93 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox/index.html +67 -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-explanation-every-op-is-a-request/index.html +141 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-every-op-is-a-request.md +161 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-identity-is-a-context/index.html +66 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-identity-is-a-context.md +110 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-internal-adapter-protocol/index.html +71 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-internal-adapter-protocol.md +111 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-listener-re-evaluation/index.html +56 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-listener-re-evaluation.md +82 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-local-backend-vs-firestore-offline/index.html +64 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-local-backend-vs-firestore-offline.md +56 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-why-adapters-are-siblings/index.html +92 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-why-adapters-are-siblings.md +90 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-why-this-package-exists/index.html +69 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-why-this-package-exists.md +57 -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-how-to-multiple-isolated-sandboxes/index.html +63 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-multiple-isolated-sandboxes.md +89 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-observe-events/index.html +159 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-observe-events.md +168 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-pick-an-adapter/index.html +79 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-pick-an-adapter.md +75 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-replay-events/index.html +88 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-replay-events.md +92 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-reset-between-tests/index.html +68 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-reset-between-tests.md +92 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-seed-data-and-rules/index.html +91 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-seed-data-and-rules.md +122 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-switch-users/index.html +50 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-switch-users.md +78 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-use-admin-reads/index.html +54 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-use-admin-reads.md +85 -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-sandbox-reference-divergences/index.html +125 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-divergences.md +151 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-error-codes/index.html +110 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-error-codes.md +118 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-internal-protocol/index.html +72 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-internal-protocol.md +109 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-sandbox-and-context/index.html +90 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-sandbox-and-context.md +140 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-sandbox-event/index.html +146 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-sandbox-event.md +204 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-snapshot-and-admin/index.html +53 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-snapshot-and-admin.md +89 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-tutorials-01-your-first-sandbox-session/index.html +115 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox-tutorials-01-your-first-sandbox-session.md +176 -0
- package/dist/serve/docs-ui/docs/pyric-sandbox.md +69 -0
- package/dist/serve/docs-ui/docs/pyric-storage/index.html +65 -0
- package/dist/serve/docs-ui/docs/pyric-storage-compat/index.html +676 -0
- package/dist/serve/docs-ui/docs/pyric-storage-compat.md +699 -0
- package/dist/serve/docs-ui/docs/pyric-storage-explanation-implementation-scope/index.html +52 -0
- package/dist/serve/docs-ui/docs/pyric-storage-explanation-implementation-scope.md +85 -0
- package/dist/serve/docs-ui/docs/pyric-storage-explanation-session-archive-use-case/index.html +58 -0
- package/dist/serve/docs-ui/docs/pyric-storage-explanation-session-archive-use-case.md +82 -0
- package/dist/serve/docs-ui/docs/pyric-storage-explanation-why-indexeddb/index.html +50 -0
- package/dist/serve/docs-ui/docs/pyric-storage-explanation-why-indexeddb.md +82 -0
- package/dist/serve/docs-ui/docs/pyric-storage-how-to-enforce-rules/index.html +120 -0
- package/dist/serve/docs-ui/docs/pyric-storage-how-to-enforce-rules.md +127 -0
- package/dist/serve/docs-ui/docs/pyric-storage-how-to-list-and-delete/index.html +53 -0
- package/dist/serve/docs-ui/docs/pyric-storage-how-to-list-and-delete.md +86 -0
- package/dist/serve/docs-ui/docs/pyric-storage-how-to-switch-backends/index.html +43 -0
- package/dist/serve/docs-ui/docs/pyric-storage-how-to-switch-backends.md +65 -0
- package/dist/serve/docs-ui/docs/pyric-storage-how-to-test-rule-expressions/index.html +70 -0
- package/dist/serve/docs-ui/docs/pyric-storage-how-to-test-rule-expressions.md +88 -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-storage-reference-conformance-gaps/index.html +137 -0
- package/dist/serve/docs-ui/docs/pyric-storage-reference-conformance-gaps.md +171 -0
- package/dist/serve/docs-ui/docs/pyric-storage-reference-error-codes/index.html +37 -0
- package/dist/serve/docs-ui/docs/pyric-storage-reference-error-codes.md +57 -0
- package/dist/serve/docs-ui/docs/pyric-storage-reference-rules-subset/index.html +96 -0
- package/dist/serve/docs-ui/docs/pyric-storage-reference-rules-subset.md +134 -0
- package/dist/serve/docs-ui/docs/pyric-storage-reference-storage-options/index.html +39 -0
- package/dist/serve/docs-ui/docs/pyric-storage-reference-storage-options.md +61 -0
- package/dist/serve/docs-ui/docs/pyric-storage.md +67 -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/read-a-denial/index.html +40 -0
- package/dist/serve/docs-ui/docs/read-a-denial.md +62 -0
- package/dist/serve/docs-ui/docs/receive-messages/index.html +28 -0
- package/dist/serve/docs-ui/docs/receive-messages.md +43 -0
- package/dist/serve/docs-ui/docs/rtdb-rules-in-typescript/index.html +67 -0
- package/dist/serve/docs-ui/docs/rtdb-rules-in-typescript.md +101 -0
- package/dist/serve/docs-ui/docs/rules-patterns/index.html +68 -0
- package/dist/serve/docs-ui/docs/rules-patterns.md +104 -0
- package/dist/serve/docs-ui/docs/rules-standard-library/index.html +87 -0
- package/dist/serve/docs-ui/docs/rules-standard-library.md +93 -0
- package/dist/serve/docs-ui/docs/run-ai-logic-locally/index.html +27 -0
- package/dist/serve/docs-ui/docs/run-ai-logic-locally.md +43 -0
- package/dist/serve/docs-ui/docs/secure-it-with-rules/index.html +69 -0
- package/dist/serve/docs-ui/docs/secure-it-with-rules.md +101 -0
- package/dist/serve/docs-ui/docs/see-whats-happening/index.html +73 -0
- package/dist/serve/docs-ui/docs/see-whats-happening.md +77 -0
- package/dist/serve/docs-ui/docs/set-up-the-project/index.html +14 -0
- package/dist/serve/docs-ui/docs/set-up-the-project.md +19 -0
- package/dist/serve/docs-ui/docs/set-up-your-agent/index.html +42 -0
- package/dist/serve/docs-ui/docs/set-up-your-agent.md +86 -0
- package/dist/serve/docs-ui/docs/shape-your-data/index.html +44 -0
- package/dist/serve/docs-ui/docs/shape-your-data.md +88 -0
- package/dist/serve/docs-ui/docs/ship-to-production/index.html +36 -0
- package/dist/serve/docs-ui/docs/ship-to-production.md +80 -0
- package/dist/serve/docs-ui/docs/sign-in-and-manage-users/index.html +31 -0
- package/dist/serve/docs-ui/docs/sign-in-and-manage-users.md +50 -0
- package/dist/serve/docs-ui/docs/simulate-and-lint/index.html +95 -0
- package/dist/serve/docs-ui/docs/simulate-and-lint.md +99 -0
- package/dist/serve/docs-ui/docs/skills/index.html +20 -0
- package/dist/serve/docs-ui/docs/skills.md +34 -0
- package/dist/serve/docs-ui/docs/start-building/index.html +32 -0
- package/dist/serve/docs-ui/docs/start-building.md +64 -0
- package/dist/serve/docs-ui/docs/store-and-query-data/index.html +16 -0
- package/dist/serve/docs-ui/docs/store-and-query-data.md +33 -0
- package/dist/serve/docs-ui/docs/store-files/index.html +13 -0
- package/dist/serve/docs-ui/docs/store-files.md +25 -0
- package/dist/serve/docs-ui/docs/sync-realtime-data/index.html +15 -0
- package/dist/serve/docs-ui/docs/sync-realtime-data.md +27 -0
- package/dist/serve/docs-ui/docs/test-in-node/index.html +74 -0
- package/dist/serve/docs-ui/docs/test-in-node.md +100 -0
- package/dist/serve/docs-ui/docs/ui/index.html +76 -0
- package/dist/serve/docs-ui/docs/ui-auth-authsigninhelper/index.html +194 -0
- package/dist/serve/docs-ui/docs/ui-auth-authsigninhelper.md +114 -0
- package/dist/serve/docs-ui/docs/ui-auth-authusers/index.html +263 -0
- package/dist/serve/docs-ui/docs/ui-auth-authusers.md +183 -0
- package/dist/serve/docs-ui/docs/ui-firestore-collectionlist/index.html +92 -0
- package/dist/serve/docs-ui/docs/ui-firestore-collectionlist.md +79 -0
- package/dist/serve/docs-ui/docs/ui-firestore-deletewithconfirm/index.html +128 -0
- package/dist/serve/docs-ui/docs/ui-firestore-deletewithconfirm.md +104 -0
- package/dist/serve/docs-ui/docs/ui-firestore-documenteditor/index.html +154 -0
- package/dist/serve/docs-ui/docs/ui-firestore-documenteditor.md +117 -0
- package/dist/serve/docs-ui/docs/ui-firestore-documentlist/index.html +132 -0
- package/dist/serve/docs-ui/docs/ui-firestore-documentlist.md +92 -0
- package/dist/serve/docs-ui/docs/ui-firestore-documentpreview/index.html +159 -0
- package/dist/serve/docs-ui/docs/ui-firestore-documentpreview.md +84 -0
- package/dist/serve/docs-ui/docs/ui-firestore-querybuilder/index.html +104 -0
- package/dist/serve/docs-ui/docs/ui-firestore-querybuilder.md +103 -0
- package/dist/serve/docs-ui/docs/ui-firestore-referencepicker/index.html +113 -0
- package/dist/serve/docs-ui/docs/ui-firestore-referencepicker.md +93 -0
- package/dist/serve/docs-ui/docs/ui-primitives-badge/index.html +56 -0
- package/dist/serve/docs-ui/docs/ui-primitives-badge.md +40 -0
- package/dist/serve/docs-ui/docs/ui-primitives-confirmdialog/index.html +140 -0
- package/dist/serve/docs-ui/docs/ui-primitives-confirmdialog.md +108 -0
- package/dist/serve/docs-ui/docs/ui-primitives-copybutton/index.html +58 -0
- package/dist/serve/docs-ui/docs/ui-primitives-copybutton.md +37 -0
- package/dist/serve/docs-ui/docs/ui-primitives-jsonview/index.html +58 -0
- package/dist/serve/docs-ui/docs/ui-primitives-jsonview.md +47 -0
- package/dist/serve/docs-ui/docs/ui-primitives-segmentedcontrol/index.html +70 -0
- package/dist/serve/docs-ui/docs/ui-primitives-segmentedcontrol.md +50 -0
- package/dist/serve/docs-ui/docs/ui-primitives-toast/index.html +87 -0
- package/dist/serve/docs-ui/docs/ui-primitives-toast.md +82 -0
- package/dist/serve/docs-ui/docs/ui-primitives-virtuallist/index.html +85 -0
- package/dist/serve/docs-ui/docs/ui-primitives-virtuallist.md +54 -0
- package/dist/serve/docs-ui/docs/ui-storage/index.html +150 -0
- package/dist/serve/docs-ui/docs/ui-storage-deleteselectionwithconfirm/index.html +126 -0
- package/dist/serve/docs-ui/docs/ui-storage-deleteselectionwithconfirm.md +88 -0
- package/dist/serve/docs-ui/docs/ui-storage-objectbrowser/index.html +137 -0
- package/dist/serve/docs-ui/docs/ui-storage-objectbrowser.md +90 -0
- package/dist/serve/docs-ui/docs/ui-storage-objectinspector/index.html +139 -0
- package/dist/serve/docs-ui/docs/ui-storage-objectinspector.md +93 -0
- package/dist/serve/docs-ui/docs/ui-storage-pathbreadcrumb/index.html +72 -0
- package/dist/serve/docs-ui/docs/ui-storage-pathbreadcrumb.md +57 -0
- package/dist/serve/docs-ui/docs/ui-storage-rules-aware-affordances/index.html +60 -0
- package/dist/serve/docs-ui/docs/ui-storage-rules-aware-affordances.md +52 -0
- package/dist/serve/docs-ui/docs/ui-storage-uploaddropzone/index.html +93 -0
- package/dist/serve/docs-ui/docs/ui-storage-uploaddropzone.md +78 -0
- package/dist/serve/docs-ui/docs/ui-storage-usestoragerulesgate/index.html +144 -0
- package/dist/serve/docs-ui/docs/ui-storage-usestoragerulesgate.md +101 -0
- package/dist/serve/docs-ui/docs/ui-storage.md +165 -0
- package/dist/serve/docs-ui/docs/ui-traffic/index.html +88 -0
- package/dist/serve/docs-ui/docs/ui-traffic-ruleheatmap/index.html +79 -0
- package/dist/serve/docs-ui/docs/ui-traffic-ruleheatmap.md +60 -0
- package/dist/serve/docs-ui/docs/ui-traffic-trafficdetail/index.html +78 -0
- package/dist/serve/docs-ui/docs/ui-traffic-trafficdetail.md +59 -0
- package/dist/serve/docs-ui/docs/ui-traffic-trafficlog/index.html +118 -0
- package/dist/serve/docs-ui/docs/ui-traffic-trafficlog.md +69 -0
- package/dist/serve/docs-ui/docs/ui-traffic-trafficstats/index.html +51 -0
- package/dist/serve/docs-ui/docs/ui-traffic-trafficstats.md +46 -0
- package/dist/serve/docs-ui/docs/ui-traffic.md +102 -0
- package/dist/serve/docs-ui/docs/ui.md +90 -0
- package/dist/serve/docs-ui/docs/watch-and-review/index.html +25 -0
- package/dist/serve/docs-ui/docs/watch-and-review.md +40 -0
- package/dist/serve/docs-ui/docs/what-your-agent-can-do/index.html +81 -0
- package/dist/serve/docs-ui/docs/what-your-agent-can-do.md +78 -0
- package/dist/serve/docs-ui/docs/whats-experimental/index.html +22 -0
- package/dist/serve/docs-ui/docs/whats-experimental.md +33 -0
- package/dist/serve/docs-ui/docs/whats-possible/index.html +63 -0
- package/dist/serve/docs-ui/docs/whats-possible.md +53 -0
- package/dist/serve/docs-ui/docs/which-data-service/index.html +8 -0
- package/dist/serve/docs-ui/docs/which-data-service.md +11 -0
- package/dist/serve/docs-ui/docs/write-a-rules-test-suite/index.html +85 -0
- package/dist/serve/docs-ui/docs/write-a-rules-test-suite.md +119 -0
- package/dist/serve/docs-ui/index.html +1 -0
- package/dist/serve/docs-ui/llms.txt +308 -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-BZpD57II.js +23 -0
- package/dist/serve/studio-ui/assets/index-Bsa-TQNK.css +1 -0
- package/dist/serve/studio-ui/assets/index-DGaVuOhE.js +1211 -0
- package/dist/serve/studio-ui/assets/seed-CTmn6YuO.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 +658 -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 +133 -0
|
@@ -0,0 +1,4739 @@
|
|
|
1
|
+
|
|
2
|
+
<!-- Generated from published package declarations via TypeDoc. Do not edit by hand; run bun run docs:api:generate. -->
|
|
3
|
+
|
|
4
|
+
## Interfaces
|
|
5
|
+
|
|
6
|
+
<a id="clientauth"></a>
|
|
7
|
+
|
|
8
|
+
### ClientAuth
|
|
9
|
+
|
|
10
|
+
Client-side Auth handle. Holds the port + a local `currentUser` mirror.
|
|
11
|
+
Returned by `getAuth(db | workerUrl)`. Mirrors `firebase/auth`'s `Auth`.
|
|
12
|
+
|
|
13
|
+
#### Properties
|
|
14
|
+
|
|
15
|
+
| Property | Modifier | Type | Description |
|
|
16
|
+
| :------ | :------ | :------ | :------ |
|
|
17
|
+
| <a id="currentuser"></a> `currentUser` | `public` | [`ClientUser`](#clientuser) | Local mirror of the worker's currentUser, updated from the stream. |
|
|
18
|
+
| <a id="port"></a> `port` | `readonly` | `ClientPort` | - |
|
|
19
|
+
|
|
20
|
+
***
|
|
21
|
+
|
|
22
|
+
<a id="clientdb"></a>
|
|
23
|
+
|
|
24
|
+
### ClientDb
|
|
25
|
+
|
|
26
|
+
Opaque client-side Firestore handle. Holds the MessagePort to the worker.
|
|
27
|
+
|
|
28
|
+
#### Properties
|
|
29
|
+
|
|
30
|
+
| Property | Modifier | Type |
|
|
31
|
+
| :------ | :------ | :------ |
|
|
32
|
+
| <a id="port-1"></a> `port` | `readonly` | `ClientPort` |
|
|
33
|
+
|
|
34
|
+
***
|
|
35
|
+
|
|
36
|
+
<a id="clientdocsnapshot"></a>
|
|
37
|
+
|
|
38
|
+
### ClientDocSnapshot
|
|
39
|
+
|
|
40
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
41
|
+
|
|
42
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
43
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
44
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
45
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
46
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
47
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
48
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
49
|
+
|
|
50
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
51
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
52
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
53
|
+
|
|
54
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
55
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
56
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
57
|
+
|
|
58
|
+
#### Properties
|
|
59
|
+
|
|
60
|
+
| Property | Modifier | Type | Description |
|
|
61
|
+
| :------ | :------ | :------ | :------ |
|
|
62
|
+
| <a id="id"></a> `id` | `readonly` | `string` | - |
|
|
63
|
+
| <a id="path"></a> `path` | `readonly` | `string` | - |
|
|
64
|
+
| <a id="ref"></a> `ref` | `readonly` | [`DocRefHandle`](#docrefhandle) | Full port-carrying reference, usable by write APIs. |
|
|
65
|
+
|
|
66
|
+
#### Methods
|
|
67
|
+
|
|
68
|
+
<a id="data"></a>
|
|
69
|
+
|
|
70
|
+
##### data()
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
data(): Record<string, unknown>;
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
###### Returns
|
|
77
|
+
|
|
78
|
+
`Record`\<`string`, `unknown`\>
|
|
79
|
+
|
|
80
|
+
<a id="exists"></a>
|
|
81
|
+
|
|
82
|
+
##### exists()
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
exists(): boolean;
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
###### Returns
|
|
89
|
+
|
|
90
|
+
`boolean`
|
|
91
|
+
|
|
92
|
+
***
|
|
93
|
+
|
|
94
|
+
<a id="clientfirebasestorage"></a>
|
|
95
|
+
|
|
96
|
+
### ClientFirebaseStorage
|
|
97
|
+
|
|
98
|
+
Worker-backed Storage handle (carries the shared `MessagePort`).
|
|
99
|
+
|
|
100
|
+
#### Properties
|
|
101
|
+
|
|
102
|
+
| Property | Modifier | Type |
|
|
103
|
+
| :------ | :------ | :------ |
|
|
104
|
+
| <a id="port-2"></a> `port` | `readonly` | `ClientPort` |
|
|
105
|
+
|
|
106
|
+
***
|
|
107
|
+
|
|
108
|
+
<a id="clientquerysnapshot"></a>
|
|
109
|
+
|
|
110
|
+
### ClientQuerySnapshot
|
|
111
|
+
|
|
112
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
113
|
+
|
|
114
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
115
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
116
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
117
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
118
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
119
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
120
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
121
|
+
|
|
122
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
123
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
124
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
125
|
+
|
|
126
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
127
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
128
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
129
|
+
|
|
130
|
+
#### Properties
|
|
131
|
+
|
|
132
|
+
| Property | Modifier | Type |
|
|
133
|
+
| :------ | :------ | :------ |
|
|
134
|
+
| <a id="docs"></a> `docs` | `readonly` | [`ClientDocSnapshot`](#clientdocsnapshot)[] |
|
|
135
|
+
| <a id="empty"></a> `empty` | `readonly` | `boolean` |
|
|
136
|
+
| <a id="size"></a> `size` | `readonly` | `number` |
|
|
137
|
+
|
|
138
|
+
***
|
|
139
|
+
|
|
140
|
+
<a id="clientrtdb"></a>
|
|
141
|
+
|
|
142
|
+
### ClientRtdb
|
|
143
|
+
|
|
144
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
145
|
+
|
|
146
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
147
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
148
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
149
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
150
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
151
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
152
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
153
|
+
|
|
154
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
155
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
156
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
157
|
+
|
|
158
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
159
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
160
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
161
|
+
|
|
162
|
+
#### Properties
|
|
163
|
+
|
|
164
|
+
| Property | Modifier | Type |
|
|
165
|
+
| :------ | :------ | :------ |
|
|
166
|
+
| <a id="port-3"></a> `port` | `readonly` | `ClientPort` |
|
|
167
|
+
|
|
168
|
+
***
|
|
169
|
+
|
|
170
|
+
<a id="clientsettablemetadata"></a>
|
|
171
|
+
|
|
172
|
+
### ClientSettableMetadata
|
|
173
|
+
|
|
174
|
+
Mirror of `pyric/storage`'s `SettableMetadata` (plain JSON on the wire).
|
|
175
|
+
|
|
176
|
+
#### Properties
|
|
177
|
+
|
|
178
|
+
| Property | Type |
|
|
179
|
+
| :------ | :------ |
|
|
180
|
+
| <a id="cachecontrol"></a> `cacheControl?` | `string` |
|
|
181
|
+
| <a id="contentdisposition"></a> `contentDisposition?` | `string` |
|
|
182
|
+
| <a id="contentencoding"></a> `contentEncoding?` | `string` |
|
|
183
|
+
| <a id="contentlanguage"></a> `contentLanguage?` | `string` |
|
|
184
|
+
| <a id="contenttype"></a> `contentType?` | `string` |
|
|
185
|
+
| <a id="custommetadata"></a> `customMetadata?` | \{ \[`key`: `string`\]: `string`; \} |
|
|
186
|
+
|
|
187
|
+
***
|
|
188
|
+
|
|
189
|
+
<a id="clientstoragereference"></a>
|
|
190
|
+
|
|
191
|
+
### ClientStorageReference
|
|
192
|
+
|
|
193
|
+
Worker-backed Storage reference (path + name; carries the port for ops).
|
|
194
|
+
|
|
195
|
+
#### Properties
|
|
196
|
+
|
|
197
|
+
| Property | Modifier | Type |
|
|
198
|
+
| :------ | :------ | :------ |
|
|
199
|
+
| <a id="fullpath"></a> `fullPath` | `readonly` | `string` |
|
|
200
|
+
| <a id="name"></a> `name` | `readonly` | `string` |
|
|
201
|
+
| <a id="port-4"></a> `port` | `readonly` | `ClientPort` |
|
|
202
|
+
|
|
203
|
+
***
|
|
204
|
+
|
|
205
|
+
<a id="clienttransaction"></a>
|
|
206
|
+
|
|
207
|
+
### ClientTransaction
|
|
208
|
+
|
|
209
|
+
Client-side transaction handle.
|
|
210
|
+
|
|
211
|
+
#### Methods
|
|
212
|
+
|
|
213
|
+
<a id="delete"></a>
|
|
214
|
+
|
|
215
|
+
##### delete()
|
|
216
|
+
|
|
217
|
+
```ts
|
|
218
|
+
delete(ref: DocRefHandle): void;
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
###### Parameters
|
|
222
|
+
|
|
223
|
+
| Parameter | Type |
|
|
224
|
+
| :------ | :------ |
|
|
225
|
+
| `ref` | [`DocRefHandle`](#docrefhandle) |
|
|
226
|
+
|
|
227
|
+
###### Returns
|
|
228
|
+
|
|
229
|
+
`void`
|
|
230
|
+
|
|
231
|
+
<a id="get"></a>
|
|
232
|
+
|
|
233
|
+
##### get()
|
|
234
|
+
|
|
235
|
+
```ts
|
|
236
|
+
get(ref: DocRefHandle): Promise<ClientDocSnapshot>;
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
###### Parameters
|
|
240
|
+
|
|
241
|
+
| Parameter | Type |
|
|
242
|
+
| :------ | :------ |
|
|
243
|
+
| `ref` | [`DocRefHandle`](#docrefhandle) |
|
|
244
|
+
|
|
245
|
+
###### Returns
|
|
246
|
+
|
|
247
|
+
`Promise`\<[`ClientDocSnapshot`](#clientdocsnapshot)\>
|
|
248
|
+
|
|
249
|
+
<a id="set"></a>
|
|
250
|
+
|
|
251
|
+
##### set()
|
|
252
|
+
|
|
253
|
+
```ts
|
|
254
|
+
set(
|
|
255
|
+
ref: DocRefHandle,
|
|
256
|
+
data: Record<string, unknown>,
|
|
257
|
+
options?: {
|
|
258
|
+
merge?: boolean;
|
|
259
|
+
mergeFields?: string[];
|
|
260
|
+
}): void;
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
###### Parameters
|
|
264
|
+
|
|
265
|
+
| Parameter | Type |
|
|
266
|
+
| :------ | :------ |
|
|
267
|
+
| `ref` | [`DocRefHandle`](#docrefhandle) |
|
|
268
|
+
| `data` | `Record`\<`string`, `unknown`\> |
|
|
269
|
+
| `options?` | \{ `merge?`: `boolean`; `mergeFields?`: `string`[]; \} |
|
|
270
|
+
| `options.merge?` | `boolean` |
|
|
271
|
+
| `options.mergeFields?` | `string`[] |
|
|
272
|
+
|
|
273
|
+
###### Returns
|
|
274
|
+
|
|
275
|
+
`void`
|
|
276
|
+
|
|
277
|
+
<a id="update"></a>
|
|
278
|
+
|
|
279
|
+
##### update()
|
|
280
|
+
|
|
281
|
+
```ts
|
|
282
|
+
update(ref: DocRefHandle, data: Record<string, unknown>): void;
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
###### Parameters
|
|
286
|
+
|
|
287
|
+
| Parameter | Type |
|
|
288
|
+
| :------ | :------ |
|
|
289
|
+
| `ref` | [`DocRefHandle`](#docrefhandle) |
|
|
290
|
+
| `data` | `Record`\<`string`, `unknown`\> |
|
|
291
|
+
|
|
292
|
+
###### Returns
|
|
293
|
+
|
|
294
|
+
`void`
|
|
295
|
+
|
|
296
|
+
***
|
|
297
|
+
|
|
298
|
+
<a id="clientuser"></a>
|
|
299
|
+
|
|
300
|
+
### ClientUser
|
|
301
|
+
|
|
302
|
+
Client-side User — a snapshot of the worker's `User` with token accessors
|
|
303
|
+
that RPC back to the worker. Mirrors `firebase/auth`'s `User` shape.
|
|
304
|
+
|
|
305
|
+
#### Properties
|
|
306
|
+
|
|
307
|
+
| Property | Modifier | Type |
|
|
308
|
+
| :------ | :------ | :------ |
|
|
309
|
+
| <a id="displayname"></a> `displayName` | `readonly` | `string` |
|
|
310
|
+
| <a id="email"></a> `email` | `readonly` | `string` |
|
|
311
|
+
| <a id="emailverified"></a> `emailVerified` | `readonly` | `boolean` |
|
|
312
|
+
| <a id="isanonymous"></a> `isAnonymous` | `readonly` | `boolean` |
|
|
313
|
+
| <a id="phonenumber"></a> `phoneNumber` | `readonly` | `string` |
|
|
314
|
+
| <a id="photourl"></a> `photoURL` | `readonly` | `string` |
|
|
315
|
+
| <a id="providerdata"></a> `providerData` | `readonly` | readonly \{ `displayName`: `string`; `email`: `string`; `phoneNumber`: `string`; `photoURL`: `string`; `providerId`: `string`; `uid`: `string`; \}[] |
|
|
316
|
+
| <a id="providerid"></a> `providerId` | `readonly` | `string` |
|
|
317
|
+
| <a id="uid"></a> `uid` | `readonly` | `string` |
|
|
318
|
+
|
|
319
|
+
#### Methods
|
|
320
|
+
|
|
321
|
+
<a id="getidtoken"></a>
|
|
322
|
+
|
|
323
|
+
##### getIdToken()
|
|
324
|
+
|
|
325
|
+
```ts
|
|
326
|
+
getIdToken(forceRefresh?: boolean): Promise<string>;
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
###### Parameters
|
|
330
|
+
|
|
331
|
+
| Parameter | Type |
|
|
332
|
+
| :------ | :------ |
|
|
333
|
+
| `forceRefresh?` | `boolean` |
|
|
334
|
+
|
|
335
|
+
###### Returns
|
|
336
|
+
|
|
337
|
+
`Promise`\<`string`\>
|
|
338
|
+
|
|
339
|
+
<a id="getidtokenresult"></a>
|
|
340
|
+
|
|
341
|
+
##### getIdTokenResult()
|
|
342
|
+
|
|
343
|
+
```ts
|
|
344
|
+
getIdTokenResult(forceRefresh?: boolean): Promise<SerializedIdTokenResult>;
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
###### Parameters
|
|
348
|
+
|
|
349
|
+
| Parameter | Type |
|
|
350
|
+
| :------ | :------ |
|
|
351
|
+
| `forceRefresh?` | `boolean` |
|
|
352
|
+
|
|
353
|
+
###### Returns
|
|
354
|
+
|
|
355
|
+
`Promise`\<[`SerializedIdTokenResult`](#serializedidtokenresult)\>
|
|
356
|
+
|
|
357
|
+
***
|
|
358
|
+
|
|
359
|
+
<a id="clientusercredential"></a>
|
|
360
|
+
|
|
361
|
+
### ClientUserCredential
|
|
362
|
+
|
|
363
|
+
Client-side UserCredential — mirrors `firebase/auth`.
|
|
364
|
+
|
|
365
|
+
#### Properties
|
|
366
|
+
|
|
367
|
+
| Property | Type |
|
|
368
|
+
| :------ | :------ |
|
|
369
|
+
| <a id="operationtype"></a> `operationType` | `"signIn"` \| `"reauthenticate"` \| `"link"` |
|
|
370
|
+
| <a id="providerid-1"></a> `providerId` | `string` |
|
|
371
|
+
| <a id="user"></a> `user` | [`ClientUser`](#clientuser) |
|
|
372
|
+
|
|
373
|
+
***
|
|
374
|
+
|
|
375
|
+
<a id="clientwritebatch"></a>
|
|
376
|
+
|
|
377
|
+
### ClientWriteBatch
|
|
378
|
+
|
|
379
|
+
Client-side write batch. Buffers `set`/`update`/`delete` calls and
|
|
380
|
+
sends them all to the worker on `.commit()`.
|
|
381
|
+
|
|
382
|
+
Mirrors `pyric/firestore`'s `writeBatch(db)` shape:
|
|
383
|
+
const batch = writeBatch(db);
|
|
384
|
+
batch.set(ref, { ... });
|
|
385
|
+
batch.delete(ref2);
|
|
386
|
+
await batch.commit();
|
|
387
|
+
|
|
388
|
+
#### Methods
|
|
389
|
+
|
|
390
|
+
<a id="commit"></a>
|
|
391
|
+
|
|
392
|
+
##### commit()
|
|
393
|
+
|
|
394
|
+
```ts
|
|
395
|
+
commit(): Promise<void>;
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
###### Returns
|
|
399
|
+
|
|
400
|
+
`Promise`\<`void`\>
|
|
401
|
+
|
|
402
|
+
<a id="delete-2"></a>
|
|
403
|
+
|
|
404
|
+
##### delete()
|
|
405
|
+
|
|
406
|
+
```ts
|
|
407
|
+
delete(ref: DocRefHandle): ClientWriteBatch;
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
###### Parameters
|
|
411
|
+
|
|
412
|
+
| Parameter | Type |
|
|
413
|
+
| :------ | :------ |
|
|
414
|
+
| `ref` | [`DocRefHandle`](#docrefhandle) |
|
|
415
|
+
|
|
416
|
+
###### Returns
|
|
417
|
+
|
|
418
|
+
[`ClientWriteBatch`](#clientwritebatch)
|
|
419
|
+
|
|
420
|
+
<a id="set-2"></a>
|
|
421
|
+
|
|
422
|
+
##### set()
|
|
423
|
+
|
|
424
|
+
```ts
|
|
425
|
+
set(
|
|
426
|
+
ref: DocRefHandle,
|
|
427
|
+
data: Record<string, unknown>,
|
|
428
|
+
options?: {
|
|
429
|
+
merge?: boolean;
|
|
430
|
+
mergeFields?: string[];
|
|
431
|
+
}): ClientWriteBatch;
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
###### Parameters
|
|
435
|
+
|
|
436
|
+
| Parameter | Type |
|
|
437
|
+
| :------ | :------ |
|
|
438
|
+
| `ref` | [`DocRefHandle`](#docrefhandle) |
|
|
439
|
+
| `data` | `Record`\<`string`, `unknown`\> |
|
|
440
|
+
| `options?` | \{ `merge?`: `boolean`; `mergeFields?`: `string`[]; \} |
|
|
441
|
+
| `options.merge?` | `boolean` |
|
|
442
|
+
| `options.mergeFields?` | `string`[] |
|
|
443
|
+
|
|
444
|
+
###### Returns
|
|
445
|
+
|
|
446
|
+
[`ClientWriteBatch`](#clientwritebatch)
|
|
447
|
+
|
|
448
|
+
<a id="update-2"></a>
|
|
449
|
+
|
|
450
|
+
##### update()
|
|
451
|
+
|
|
452
|
+
```ts
|
|
453
|
+
update(ref: DocRefHandle, data: Record<string, unknown>): ClientWriteBatch;
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
###### Parameters
|
|
457
|
+
|
|
458
|
+
| Parameter | Type |
|
|
459
|
+
| :------ | :------ |
|
|
460
|
+
| `ref` | [`DocRefHandle`](#docrefhandle) |
|
|
461
|
+
| `data` | `Record`\<`string`, `unknown`\> |
|
|
462
|
+
|
|
463
|
+
###### Returns
|
|
464
|
+
|
|
465
|
+
[`ClientWriteBatch`](#clientwritebatch)
|
|
466
|
+
|
|
467
|
+
***
|
|
468
|
+
|
|
469
|
+
<a id="collrefhandle"></a>
|
|
470
|
+
|
|
471
|
+
### CollRefHandle
|
|
472
|
+
|
|
473
|
+
Client-side collection reference.
|
|
474
|
+
|
|
475
|
+
#### Properties
|
|
476
|
+
|
|
477
|
+
| Property | Modifier | Type |
|
|
478
|
+
| :------ | :------ | :------ |
|
|
479
|
+
| <a id="descriptor"></a> `descriptor` | `readonly` | `CollRef` |
|
|
480
|
+
| <a id="id-1"></a> `id` | `readonly` | `string` |
|
|
481
|
+
| <a id="path-1"></a> `path` | `readonly` | `string` |
|
|
482
|
+
| <a id="port-5"></a> `port` | `readonly` | `ClientPort` |
|
|
483
|
+
|
|
484
|
+
***
|
|
485
|
+
|
|
486
|
+
<a id="docrefhandle"></a>
|
|
487
|
+
|
|
488
|
+
### DocRefHandle
|
|
489
|
+
|
|
490
|
+
Client-side document reference — carries a DocRef descriptor + port.
|
|
491
|
+
|
|
492
|
+
#### Properties
|
|
493
|
+
|
|
494
|
+
| Property | Modifier | Type |
|
|
495
|
+
| :------ | :------ | :------ |
|
|
496
|
+
| <a id="descriptor-1"></a> `descriptor` | `readonly` | `DocRef` |
|
|
497
|
+
| <a id="id-2"></a> `id` | `readonly` | `string` |
|
|
498
|
+
| <a id="path-2"></a> `path` | `readonly` | `string` |
|
|
499
|
+
| <a id="port-6"></a> `port` | `readonly` | `ClientPort` |
|
|
500
|
+
|
|
501
|
+
***
|
|
502
|
+
|
|
503
|
+
<a id="presencesession"></a>
|
|
504
|
+
|
|
505
|
+
### PresenceSession
|
|
506
|
+
|
|
507
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
508
|
+
|
|
509
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
510
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
511
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
512
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
513
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
514
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
515
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
516
|
+
|
|
517
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
518
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
519
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
520
|
+
|
|
521
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
522
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
523
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
524
|
+
|
|
525
|
+
#### Properties
|
|
526
|
+
|
|
527
|
+
| Property | Modifier | Type | Description |
|
|
528
|
+
| :------ | :------ | :------ | :------ |
|
|
529
|
+
| <a id="clientid"></a> `clientId` | `readonly` | `string` | Logical page id — Studio uses this to label "This page". |
|
|
530
|
+
| <a id="kind"></a> `kind` | `readonly` | [`PresenceClientKind`](#presenceclientkind) | - |
|
|
531
|
+
|
|
532
|
+
#### Methods
|
|
533
|
+
|
|
534
|
+
<a id="stop"></a>
|
|
535
|
+
|
|
536
|
+
##### stop()
|
|
537
|
+
|
|
538
|
+
```ts
|
|
539
|
+
stop(): void;
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
Stop heartbeats, listeners, and send a best-effort disconnect.
|
|
543
|
+
|
|
544
|
+
###### Returns
|
|
545
|
+
|
|
546
|
+
`void`
|
|
547
|
+
|
|
548
|
+
***
|
|
549
|
+
|
|
550
|
+
<a id="presencesnapshot"></a>
|
|
551
|
+
|
|
552
|
+
### PresenceSnapshot
|
|
553
|
+
|
|
554
|
+
Authoritative presence snapshot owned by the SharedWorker host.
|
|
555
|
+
|
|
556
|
+
#### Properties
|
|
557
|
+
|
|
558
|
+
| Property | Type |
|
|
559
|
+
| :------ | :------ |
|
|
560
|
+
| <a id="clients"></a> `clients` | `PresenceClientRecord`[] |
|
|
561
|
+
|
|
562
|
+
***
|
|
563
|
+
|
|
564
|
+
<a id="queryhandle"></a>
|
|
565
|
+
|
|
566
|
+
### QueryHandle
|
|
567
|
+
|
|
568
|
+
Client-side query.
|
|
569
|
+
|
|
570
|
+
#### Properties
|
|
571
|
+
|
|
572
|
+
| Property | Modifier | Type |
|
|
573
|
+
| :------ | :------ | :------ |
|
|
574
|
+
| <a id="descriptor-2"></a> `descriptor` | `readonly` | `QueryDescriptor` |
|
|
575
|
+
| <a id="port-7"></a> `port` | `readonly` | `ClientPort` |
|
|
576
|
+
|
|
577
|
+
***
|
|
578
|
+
|
|
579
|
+
<a id="resolvedidentity"></a>
|
|
580
|
+
|
|
581
|
+
### ResolvedIdentity
|
|
582
|
+
|
|
583
|
+
A provider identity resolved IN-PAGE (by the `ServeAuthHelper`'s
|
|
584
|
+
popup/redirect picker) and handed to the worker for sign-in. Provider flows
|
|
585
|
+
(`signInWithPopup`/`signInWithRedirect`) can't cross the worker port — the
|
|
586
|
+
`AuthFlowResolver` lives in-page — so the page resolves the picked identity
|
|
587
|
+
and bridges it here; the worker seeds it + `restoreSession`s it (no password
|
|
588
|
+
— provider users never sign in with one). See `auth.acceptIdentity`.
|
|
589
|
+
|
|
590
|
+
#### Properties
|
|
591
|
+
|
|
592
|
+
| Property | Modifier | Type |
|
|
593
|
+
| :------ | :------ | :------ |
|
|
594
|
+
| <a id="customclaims"></a> `customClaims` | `readonly` | `Record`\<`string`, `unknown`\> |
|
|
595
|
+
| <a id="displayname-1"></a> `displayName` | `readonly` | `string` |
|
|
596
|
+
| <a id="email-1"></a> `email` | `readonly` | `string` |
|
|
597
|
+
| <a id="providerid-2"></a> `providerId` | `readonly` | `string` |
|
|
598
|
+
| <a id="uid-1"></a> `uid` | `readonly` | `string` |
|
|
599
|
+
|
|
600
|
+
***
|
|
601
|
+
|
|
602
|
+
<a id="rtdbdatasnapshot"></a>
|
|
603
|
+
|
|
604
|
+
### RtdbDataSnapshot
|
|
605
|
+
|
|
606
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
607
|
+
|
|
608
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
609
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
610
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
611
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
612
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
613
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
614
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
615
|
+
|
|
616
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
617
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
618
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
619
|
+
|
|
620
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
621
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
622
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
623
|
+
|
|
624
|
+
#### Properties
|
|
625
|
+
|
|
626
|
+
| Property | Modifier | Type |
|
|
627
|
+
| :------ | :------ | :------ |
|
|
628
|
+
| <a id="key"></a> `key` | `readonly` | `string` |
|
|
629
|
+
| <a id="ref-1"></a> `ref` | `readonly` | [`RtdbRefHandle`](#rtdbrefhandle) |
|
|
630
|
+
| <a id="size-1"></a> `size` | `readonly` | `number` |
|
|
631
|
+
|
|
632
|
+
#### Methods
|
|
633
|
+
|
|
634
|
+
<a id="child"></a>
|
|
635
|
+
|
|
636
|
+
##### child()
|
|
637
|
+
|
|
638
|
+
```ts
|
|
639
|
+
child(path: string): RtdbDataSnapshot;
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
###### Parameters
|
|
643
|
+
|
|
644
|
+
| Parameter | Type |
|
|
645
|
+
| :------ | :------ |
|
|
646
|
+
| `path` | `string` |
|
|
647
|
+
|
|
648
|
+
###### Returns
|
|
649
|
+
|
|
650
|
+
[`RtdbDataSnapshot`](#rtdbdatasnapshot)
|
|
651
|
+
|
|
652
|
+
<a id="exists-2"></a>
|
|
653
|
+
|
|
654
|
+
##### exists()
|
|
655
|
+
|
|
656
|
+
```ts
|
|
657
|
+
exists(): boolean;
|
|
658
|
+
```
|
|
659
|
+
|
|
660
|
+
###### Returns
|
|
661
|
+
|
|
662
|
+
`boolean`
|
|
663
|
+
|
|
664
|
+
<a id="exportval"></a>
|
|
665
|
+
|
|
666
|
+
##### exportVal()
|
|
667
|
+
|
|
668
|
+
```ts
|
|
669
|
+
exportVal(): unknown;
|
|
670
|
+
```
|
|
671
|
+
|
|
672
|
+
###### Returns
|
|
673
|
+
|
|
674
|
+
`unknown`
|
|
675
|
+
|
|
676
|
+
<a id="foreach"></a>
|
|
677
|
+
|
|
678
|
+
##### forEach()
|
|
679
|
+
|
|
680
|
+
```ts
|
|
681
|
+
forEach(cb: (child: RtdbDataSnapshot) => boolean | void): boolean;
|
|
682
|
+
```
|
|
683
|
+
|
|
684
|
+
###### Parameters
|
|
685
|
+
|
|
686
|
+
| Parameter | Type |
|
|
687
|
+
| :------ | :------ |
|
|
688
|
+
| `cb` | (`child`: [`RtdbDataSnapshot`](#rtdbdatasnapshot)) => `boolean` \| `void` |
|
|
689
|
+
|
|
690
|
+
###### Returns
|
|
691
|
+
|
|
692
|
+
`boolean`
|
|
693
|
+
|
|
694
|
+
<a id="haschild"></a>
|
|
695
|
+
|
|
696
|
+
##### hasChild()
|
|
697
|
+
|
|
698
|
+
```ts
|
|
699
|
+
hasChild(path: string): boolean;
|
|
700
|
+
```
|
|
701
|
+
|
|
702
|
+
###### Parameters
|
|
703
|
+
|
|
704
|
+
| Parameter | Type |
|
|
705
|
+
| :------ | :------ |
|
|
706
|
+
| `path` | `string` |
|
|
707
|
+
|
|
708
|
+
###### Returns
|
|
709
|
+
|
|
710
|
+
`boolean`
|
|
711
|
+
|
|
712
|
+
<a id="haschildren"></a>
|
|
713
|
+
|
|
714
|
+
##### hasChildren()
|
|
715
|
+
|
|
716
|
+
```ts
|
|
717
|
+
hasChildren(): boolean;
|
|
718
|
+
```
|
|
719
|
+
|
|
720
|
+
###### Returns
|
|
721
|
+
|
|
722
|
+
`boolean`
|
|
723
|
+
|
|
724
|
+
<a id="tojson"></a>
|
|
725
|
+
|
|
726
|
+
##### toJSON()
|
|
727
|
+
|
|
728
|
+
```ts
|
|
729
|
+
toJSON(): unknown;
|
|
730
|
+
```
|
|
731
|
+
|
|
732
|
+
###### Returns
|
|
733
|
+
|
|
734
|
+
`unknown`
|
|
735
|
+
|
|
736
|
+
<a id="val"></a>
|
|
737
|
+
|
|
738
|
+
##### val()
|
|
739
|
+
|
|
740
|
+
```ts
|
|
741
|
+
val(): unknown;
|
|
742
|
+
```
|
|
743
|
+
|
|
744
|
+
###### Returns
|
|
745
|
+
|
|
746
|
+
`unknown`
|
|
747
|
+
|
|
748
|
+
***
|
|
749
|
+
|
|
750
|
+
<a id="rtdbrefhandle"></a>
|
|
751
|
+
|
|
752
|
+
### RtdbRefHandle
|
|
753
|
+
|
|
754
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
755
|
+
|
|
756
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
757
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
758
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
759
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
760
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
761
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
762
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
763
|
+
|
|
764
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
765
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
766
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
767
|
+
|
|
768
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
769
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
770
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
771
|
+
|
|
772
|
+
#### Properties
|
|
773
|
+
|
|
774
|
+
| Property | Modifier | Type |
|
|
775
|
+
| :------ | :------ | :------ |
|
|
776
|
+
| <a id="key-1"></a> `key` | `readonly` | `string` |
|
|
777
|
+
| <a id="parent"></a> `parent` | `readonly` | [`RtdbRefHandle`](#rtdbrefhandle) |
|
|
778
|
+
| <a id="path-3"></a> `path` | `readonly` | `string` |
|
|
779
|
+
| <a id="port-8"></a> `port` | `readonly` | `ClientPort` |
|
|
780
|
+
| <a id="root"></a> `root` | `readonly` | [`RtdbRefHandle`](#rtdbrefhandle) |
|
|
781
|
+
|
|
782
|
+
#### Methods
|
|
783
|
+
|
|
784
|
+
<a id="tostring"></a>
|
|
785
|
+
|
|
786
|
+
##### toString()
|
|
787
|
+
|
|
788
|
+
```ts
|
|
789
|
+
toString(): string;
|
|
790
|
+
```
|
|
791
|
+
|
|
792
|
+
###### Returns
|
|
793
|
+
|
|
794
|
+
`string`
|
|
795
|
+
|
|
796
|
+
***
|
|
797
|
+
|
|
798
|
+
<a id="serializedidtokenresult"></a>
|
|
799
|
+
|
|
800
|
+
### SerializedIdTokenResult
|
|
801
|
+
|
|
802
|
+
Wire form of `getIdTokenResult()`.
|
|
803
|
+
|
|
804
|
+
#### Properties
|
|
805
|
+
|
|
806
|
+
| Property | Modifier | Type |
|
|
807
|
+
| :------ | :------ | :------ |
|
|
808
|
+
| <a id="authtime"></a> `authTime` | `readonly` | `string` |
|
|
809
|
+
| <a id="claims"></a> `claims` | `readonly` | `Record`\<`string`, `unknown`\> |
|
|
810
|
+
| <a id="expirationtime"></a> `expirationTime` | `readonly` | `string` |
|
|
811
|
+
| <a id="issuedattime"></a> `issuedAtTime` | `readonly` | `string` |
|
|
812
|
+
| <a id="signinprovider"></a> `signInProvider` | `readonly` | `string` |
|
|
813
|
+
| <a id="token"></a> `token` | `readonly` | `string` |
|
|
814
|
+
|
|
815
|
+
***
|
|
816
|
+
|
|
817
|
+
<a id="serializeduser"></a>
|
|
818
|
+
|
|
819
|
+
### SerializedUser
|
|
820
|
+
|
|
821
|
+
Wire representation of a signed-in `User`. The real `pyric/auth` `User`
|
|
822
|
+
carries methods (`getIdToken`, `getIdTokenResult`) that don't survive
|
|
823
|
+
structured clone, so the worker flattens the fields the client mirror
|
|
824
|
+
needs into a plain object. Token accessors on the client re-RPC to the
|
|
825
|
+
worker (the worker holds the one real user).
|
|
826
|
+
|
|
827
|
+
`null` means "signed out" — there is no current user.
|
|
828
|
+
|
|
829
|
+
#### Properties
|
|
830
|
+
|
|
831
|
+
| Property | Modifier | Type |
|
|
832
|
+
| :------ | :------ | :------ |
|
|
833
|
+
| <a id="displayname-2"></a> `displayName` | `readonly` | `string` |
|
|
834
|
+
| <a id="email-2"></a> `email` | `readonly` | `string` |
|
|
835
|
+
| <a id="emailverified-1"></a> `emailVerified` | `readonly` | `boolean` |
|
|
836
|
+
| <a id="isanonymous-1"></a> `isAnonymous` | `readonly` | `boolean` |
|
|
837
|
+
| <a id="phonenumber-1"></a> `phoneNumber` | `readonly` | `string` |
|
|
838
|
+
| <a id="photourl-1"></a> `photoURL` | `readonly` | `string` |
|
|
839
|
+
| <a id="providerdata-1"></a> `providerData` | `readonly` | readonly \{ `displayName`: `string`; `email`: `string`; `phoneNumber`: `string`; `photoURL`: `string`; `providerId`: `string`; `uid`: `string`; \}[] |
|
|
840
|
+
| <a id="providerid-3"></a> `providerId` | `readonly` | `string` |
|
|
841
|
+
| <a id="uid-2"></a> `uid` | `readonly` | `string` |
|
|
842
|
+
|
|
843
|
+
***
|
|
844
|
+
|
|
845
|
+
<a id="serializedusercredential"></a>
|
|
846
|
+
|
|
847
|
+
### SerializedUserCredential
|
|
848
|
+
|
|
849
|
+
Wire form of a `UserCredential` returned by the sign-in/create ops.
|
|
850
|
+
|
|
851
|
+
#### Properties
|
|
852
|
+
|
|
853
|
+
| Property | Modifier | Type |
|
|
854
|
+
| :------ | :------ | :------ |
|
|
855
|
+
| <a id="operationtype-1"></a> `operationType` | `readonly` | `"signIn"` \| `"reauthenticate"` \| `"link"` |
|
|
856
|
+
| <a id="providerid-4"></a> `providerId` | `readonly` | `string` |
|
|
857
|
+
| <a id="user-1"></a> `user` | `readonly` | [`SerializedUser`](#serializeduser) |
|
|
858
|
+
|
|
859
|
+
## Type Aliases
|
|
860
|
+
|
|
861
|
+
<a id="anyhandle"></a>
|
|
862
|
+
|
|
863
|
+
### AnyHandle
|
|
864
|
+
|
|
865
|
+
```ts
|
|
866
|
+
type AnyHandle =
|
|
867
|
+
| ClientDb
|
|
868
|
+
| DocRefHandle
|
|
869
|
+
| CollRefHandle
|
|
870
|
+
| QueryHandle;
|
|
871
|
+
```
|
|
872
|
+
|
|
873
|
+
Union of all client handles.
|
|
874
|
+
|
|
875
|
+
***
|
|
876
|
+
|
|
877
|
+
<a id="authpersistencemode"></a>
|
|
878
|
+
|
|
879
|
+
### AuthPersistenceMode
|
|
880
|
+
|
|
881
|
+
```ts
|
|
882
|
+
type AuthPersistenceMode = "LOCAL" | "SESSION" | "NONE";
|
|
883
|
+
```
|
|
884
|
+
|
|
885
|
+
Persistence mode for the worker's shared auth session.
|
|
886
|
+
Mirrors `pyric/auth`'s `Persistence.type`. `'NONE'` (inMemoryPersistence)
|
|
887
|
+
disables the IndexedDB session record so a full close does NOT keep the
|
|
888
|
+
user signed in; `'LOCAL'` and `'SESSION'` both persist the session in
|
|
889
|
+
this single-backend model (see SESSION/LOCAL collapse note in host.ts).
|
|
890
|
+
|
|
891
|
+
***
|
|
892
|
+
|
|
893
|
+
<a id="presenceclientkind"></a>
|
|
894
|
+
|
|
895
|
+
### PresenceClientKind
|
|
896
|
+
|
|
897
|
+
```ts
|
|
898
|
+
type PresenceClientKind = "app" | "studio";
|
|
899
|
+
```
|
|
900
|
+
|
|
901
|
+
Logical page kind for presence (#227).
|
|
902
|
+
|
|
903
|
+
***
|
|
904
|
+
|
|
905
|
+
<a id="presencevisibility"></a>
|
|
906
|
+
|
|
907
|
+
### PresenceVisibility
|
|
908
|
+
|
|
909
|
+
```ts
|
|
910
|
+
type PresenceVisibility = "visible" | "hidden";
|
|
911
|
+
```
|
|
912
|
+
|
|
913
|
+
Page Visibility API state carried on presence records.
|
|
914
|
+
|
|
915
|
+
***
|
|
916
|
+
|
|
917
|
+
<a id="unsubscribe"></a>
|
|
918
|
+
|
|
919
|
+
### Unsubscribe()
|
|
920
|
+
|
|
921
|
+
```ts
|
|
922
|
+
type Unsubscribe = () => void;
|
|
923
|
+
```
|
|
924
|
+
|
|
925
|
+
Unsubscribe function returned by every streaming subscription.
|
|
926
|
+
|
|
927
|
+
#### Returns
|
|
928
|
+
|
|
929
|
+
`void`
|
|
930
|
+
|
|
931
|
+
## Variables
|
|
932
|
+
|
|
933
|
+
<a id="browserlocalpersistence"></a>
|
|
934
|
+
|
|
935
|
+
### browserLocalPersistence
|
|
936
|
+
|
|
937
|
+
```ts
|
|
938
|
+
const browserLocalPersistence: {
|
|
939
|
+
type: "LOCAL";
|
|
940
|
+
};
|
|
941
|
+
```
|
|
942
|
+
|
|
943
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
944
|
+
|
|
945
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
946
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
947
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
948
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
949
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
950
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
951
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
952
|
+
|
|
953
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
954
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
955
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
956
|
+
|
|
957
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
958
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
959
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
960
|
+
|
|
961
|
+
#### Type Declaration
|
|
962
|
+
|
|
963
|
+
<a id="type"></a>
|
|
964
|
+
|
|
965
|
+
##### type
|
|
966
|
+
|
|
967
|
+
```ts
|
|
968
|
+
readonly type: "LOCAL";
|
|
969
|
+
```
|
|
970
|
+
|
|
971
|
+
***
|
|
972
|
+
|
|
973
|
+
<a id="browsersessionpersistence"></a>
|
|
974
|
+
|
|
975
|
+
### browserSessionPersistence
|
|
976
|
+
|
|
977
|
+
```ts
|
|
978
|
+
const browserSessionPersistence: {
|
|
979
|
+
type: "SESSION";
|
|
980
|
+
};
|
|
981
|
+
```
|
|
982
|
+
|
|
983
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
984
|
+
|
|
985
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
986
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
987
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
988
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
989
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
990
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
991
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
992
|
+
|
|
993
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
994
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
995
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
996
|
+
|
|
997
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
998
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
999
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
1000
|
+
|
|
1001
|
+
#### Type Declaration
|
|
1002
|
+
|
|
1003
|
+
<a id="type-1"></a>
|
|
1004
|
+
|
|
1005
|
+
##### type
|
|
1006
|
+
|
|
1007
|
+
```ts
|
|
1008
|
+
readonly type: "SESSION";
|
|
1009
|
+
```
|
|
1010
|
+
|
|
1011
|
+
***
|
|
1012
|
+
|
|
1013
|
+
<a id="inmemorypersistence"></a>
|
|
1014
|
+
|
|
1015
|
+
### inMemoryPersistence
|
|
1016
|
+
|
|
1017
|
+
```ts
|
|
1018
|
+
const inMemoryPersistence: {
|
|
1019
|
+
type: "NONE";
|
|
1020
|
+
};
|
|
1021
|
+
```
|
|
1022
|
+
|
|
1023
|
+
Persistence markers — mirror `firebase/auth` / `pyric/auth`.
|
|
1024
|
+
|
|
1025
|
+
#### Type Declaration
|
|
1026
|
+
|
|
1027
|
+
<a id="type-2"></a>
|
|
1028
|
+
|
|
1029
|
+
##### type
|
|
1030
|
+
|
|
1031
|
+
```ts
|
|
1032
|
+
readonly type: "NONE";
|
|
1033
|
+
```
|
|
1034
|
+
|
|
1035
|
+
***
|
|
1036
|
+
|
|
1037
|
+
<a id="presence_heartbeat_interval_ms"></a>
|
|
1038
|
+
|
|
1039
|
+
### PRESENCE\_HEARTBEAT\_INTERVAL\_MS
|
|
1040
|
+
|
|
1041
|
+
```ts
|
|
1042
|
+
const PRESENCE_HEARTBEAT_INTERVAL_MS: 15000 = 15000;
|
|
1043
|
+
```
|
|
1044
|
+
|
|
1045
|
+
Suggested client heartbeat interval.
|
|
1046
|
+
|
|
1047
|
+
***
|
|
1048
|
+
|
|
1049
|
+
<a id="presence_stale_ms"></a>
|
|
1050
|
+
|
|
1051
|
+
### PRESENCE\_STALE\_MS
|
|
1052
|
+
|
|
1053
|
+
```ts
|
|
1054
|
+
const PRESENCE_STALE_MS: 90000 = 90000;
|
|
1055
|
+
```
|
|
1056
|
+
|
|
1057
|
+
Lease TTL. Sized to tolerate one delayed background-tab heartbeat under
|
|
1058
|
+
typical timer throttling (~1/min) without falsely evicting a live page.
|
|
1059
|
+
|
|
1060
|
+
## Functions
|
|
1061
|
+
|
|
1062
|
+
<a id="acceptprovidercredential"></a>
|
|
1063
|
+
|
|
1064
|
+
### acceptProviderCredential()
|
|
1065
|
+
|
|
1066
|
+
```ts
|
|
1067
|
+
function acceptProviderCredential(auth: ClientAuth, identity: ResolvedIdentity): Promise<ClientUserCredential>;
|
|
1068
|
+
```
|
|
1069
|
+
|
|
1070
|
+
Bridge a provider identity resolved IN-PAGE to the worker (the provider
|
|
1071
|
+
sign-in seam). The entry adapter's worker-path `signInWithPopup`/
|
|
1072
|
+
`signInWithRedirect` runs the in-page `AuthFlowResolver` (which can't cross
|
|
1073
|
+
the worker port), then calls this with the picked identity; the worker seeds
|
|
1074
|
+
it + signs it in, returning a worker-backed credential. The mirror updates
|
|
1075
|
+
eagerly (like the email/anon paths) so a synchronous `auth.currentUser`
|
|
1076
|
+
read right after the await reflects the new user.
|
|
1077
|
+
|
|
1078
|
+
#### Parameters
|
|
1079
|
+
|
|
1080
|
+
| Parameter | Type |
|
|
1081
|
+
| :------ | :------ |
|
|
1082
|
+
| `auth` | [`ClientAuth`](#clientauth) |
|
|
1083
|
+
| `identity` | [`ResolvedIdentity`](#resolvedidentity) |
|
|
1084
|
+
|
|
1085
|
+
#### Returns
|
|
1086
|
+
|
|
1087
|
+
`Promise`\<[`ClientUserCredential`](#clientusercredential)\>
|
|
1088
|
+
|
|
1089
|
+
***
|
|
1090
|
+
|
|
1091
|
+
<a id="adddoc"></a>
|
|
1092
|
+
|
|
1093
|
+
### addDoc()
|
|
1094
|
+
|
|
1095
|
+
```ts
|
|
1096
|
+
function addDoc(coll: CollRefHandle, data: Record<string, unknown>): Promise<DocRefHandle>;
|
|
1097
|
+
```
|
|
1098
|
+
|
|
1099
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
1100
|
+
|
|
1101
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
1102
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
1103
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
1104
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
1105
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
1106
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
1107
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
1108
|
+
|
|
1109
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
1110
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
1111
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
1112
|
+
|
|
1113
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
1114
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
1115
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
1116
|
+
|
|
1117
|
+
#### Parameters
|
|
1118
|
+
|
|
1119
|
+
| Parameter | Type |
|
|
1120
|
+
| :------ | :------ |
|
|
1121
|
+
| `coll` | [`CollRefHandle`](#collrefhandle) |
|
|
1122
|
+
| `data` | `Record`\<`string`, `unknown`\> |
|
|
1123
|
+
|
|
1124
|
+
#### Returns
|
|
1125
|
+
|
|
1126
|
+
`Promise`\<[`DocRefHandle`](#docrefhandle)\>
|
|
1127
|
+
|
|
1128
|
+
***
|
|
1129
|
+
|
|
1130
|
+
<a id="adminclearusers"></a>
|
|
1131
|
+
|
|
1132
|
+
### adminClearUsers()
|
|
1133
|
+
|
|
1134
|
+
```ts
|
|
1135
|
+
function adminClearUsers(auth: ClientAuth): Promise<void>;
|
|
1136
|
+
```
|
|
1137
|
+
|
|
1138
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
1139
|
+
|
|
1140
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
1141
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
1142
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
1143
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
1144
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
1145
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
1146
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
1147
|
+
|
|
1148
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
1149
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
1150
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
1151
|
+
|
|
1152
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
1153
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
1154
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
1155
|
+
|
|
1156
|
+
#### Parameters
|
|
1157
|
+
|
|
1158
|
+
| Parameter | Type |
|
|
1159
|
+
| :------ | :------ |
|
|
1160
|
+
| `auth` | [`ClientAuth`](#clientauth) |
|
|
1161
|
+
|
|
1162
|
+
#### Returns
|
|
1163
|
+
|
|
1164
|
+
`Promise`\<`void`\>
|
|
1165
|
+
|
|
1166
|
+
***
|
|
1167
|
+
|
|
1168
|
+
<a id="admincreateuser"></a>
|
|
1169
|
+
|
|
1170
|
+
### adminCreateUser()
|
|
1171
|
+
|
|
1172
|
+
```ts
|
|
1173
|
+
function adminCreateUser(auth: ClientAuth, request: CreateUserRequest): Promise<AuthUserRecord>;
|
|
1174
|
+
```
|
|
1175
|
+
|
|
1176
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
1177
|
+
|
|
1178
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
1179
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
1180
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
1181
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
1182
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
1183
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
1184
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
1185
|
+
|
|
1186
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
1187
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
1188
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
1189
|
+
|
|
1190
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
1191
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
1192
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
1193
|
+
|
|
1194
|
+
#### Parameters
|
|
1195
|
+
|
|
1196
|
+
| Parameter | Type |
|
|
1197
|
+
| :------ | :------ |
|
|
1198
|
+
| `auth` | [`ClientAuth`](#clientauth) |
|
|
1199
|
+
| `request` | `CreateUserRequest` |
|
|
1200
|
+
|
|
1201
|
+
#### Returns
|
|
1202
|
+
|
|
1203
|
+
`Promise`\<`AuthUserRecord`\>
|
|
1204
|
+
|
|
1205
|
+
***
|
|
1206
|
+
|
|
1207
|
+
<a id="admindeletedocument"></a>
|
|
1208
|
+
|
|
1209
|
+
### adminDeleteDocument()
|
|
1210
|
+
|
|
1211
|
+
```ts
|
|
1212
|
+
function adminDeleteDocument(db: ClientDb, path: string): Promise<boolean>;
|
|
1213
|
+
```
|
|
1214
|
+
|
|
1215
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
1216
|
+
|
|
1217
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
1218
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
1219
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
1220
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
1221
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
1222
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
1223
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
1224
|
+
|
|
1225
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
1226
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
1227
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
1228
|
+
|
|
1229
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
1230
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
1231
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
1232
|
+
|
|
1233
|
+
#### Parameters
|
|
1234
|
+
|
|
1235
|
+
| Parameter | Type |
|
|
1236
|
+
| :------ | :------ |
|
|
1237
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
1238
|
+
| `path` | `string` |
|
|
1239
|
+
|
|
1240
|
+
#### Returns
|
|
1241
|
+
|
|
1242
|
+
`Promise`\<`boolean`\>
|
|
1243
|
+
|
|
1244
|
+
***
|
|
1245
|
+
|
|
1246
|
+
<a id="admindeletertdbvalue"></a>
|
|
1247
|
+
|
|
1248
|
+
### adminDeleteRtdbValue()
|
|
1249
|
+
|
|
1250
|
+
```ts
|
|
1251
|
+
function adminDeleteRtdbValue(db: ClientDb | ClientRtdb, path: string): Promise<void>;
|
|
1252
|
+
```
|
|
1253
|
+
|
|
1254
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
1255
|
+
|
|
1256
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
1257
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
1258
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
1259
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
1260
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
1261
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
1262
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
1263
|
+
|
|
1264
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
1265
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
1266
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
1267
|
+
|
|
1268
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
1269
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
1270
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
1271
|
+
|
|
1272
|
+
#### Parameters
|
|
1273
|
+
|
|
1274
|
+
| Parameter | Type |
|
|
1275
|
+
| :------ | :------ |
|
|
1276
|
+
| `db` | [`ClientDb`](#clientdb) \| [`ClientRtdb`](#clientrtdb) |
|
|
1277
|
+
| `path` | `string` |
|
|
1278
|
+
|
|
1279
|
+
#### Returns
|
|
1280
|
+
|
|
1281
|
+
`Promise`\<`void`\>
|
|
1282
|
+
|
|
1283
|
+
***
|
|
1284
|
+
|
|
1285
|
+
<a id="admindeleteuser"></a>
|
|
1286
|
+
|
|
1287
|
+
### adminDeleteUser()
|
|
1288
|
+
|
|
1289
|
+
```ts
|
|
1290
|
+
function adminDeleteUser(auth: ClientAuth, uid: string): Promise<void>;
|
|
1291
|
+
```
|
|
1292
|
+
|
|
1293
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
1294
|
+
|
|
1295
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
1296
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
1297
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
1298
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
1299
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
1300
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
1301
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
1302
|
+
|
|
1303
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
1304
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
1305
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
1306
|
+
|
|
1307
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
1308
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
1309
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
1310
|
+
|
|
1311
|
+
#### Parameters
|
|
1312
|
+
|
|
1313
|
+
| Parameter | Type |
|
|
1314
|
+
| :------ | :------ |
|
|
1315
|
+
| `auth` | [`ClientAuth`](#clientauth) |
|
|
1316
|
+
| `uid` | `string` |
|
|
1317
|
+
|
|
1318
|
+
#### Returns
|
|
1319
|
+
|
|
1320
|
+
`Promise`\<`void`\>
|
|
1321
|
+
|
|
1322
|
+
***
|
|
1323
|
+
|
|
1324
|
+
<a id="admingetdocument"></a>
|
|
1325
|
+
|
|
1326
|
+
### adminGetDocument()
|
|
1327
|
+
|
|
1328
|
+
```ts
|
|
1329
|
+
function adminGetDocument(db: ClientDb, path: string): Promise<Record<string, unknown>>;
|
|
1330
|
+
```
|
|
1331
|
+
|
|
1332
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
1333
|
+
|
|
1334
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
1335
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
1336
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
1337
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
1338
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
1339
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
1340
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
1341
|
+
|
|
1342
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
1343
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
1344
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
1345
|
+
|
|
1346
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
1347
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
1348
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
1349
|
+
|
|
1350
|
+
#### Parameters
|
|
1351
|
+
|
|
1352
|
+
| Parameter | Type |
|
|
1353
|
+
| :------ | :------ |
|
|
1354
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
1355
|
+
| `path` | `string` |
|
|
1356
|
+
|
|
1357
|
+
#### Returns
|
|
1358
|
+
|
|
1359
|
+
`Promise`\<`Record`\<`string`, `unknown`\>\>
|
|
1360
|
+
|
|
1361
|
+
***
|
|
1362
|
+
|
|
1363
|
+
<a id="adminlistdocuments"></a>
|
|
1364
|
+
|
|
1365
|
+
### adminListDocuments()
|
|
1366
|
+
|
|
1367
|
+
```ts
|
|
1368
|
+
function adminListDocuments(db: ClientDb, path: string): Promise<{
|
|
1369
|
+
data: unknown;
|
|
1370
|
+
path: string;
|
|
1371
|
+
phantom?: boolean;
|
|
1372
|
+
}[]>;
|
|
1373
|
+
```
|
|
1374
|
+
|
|
1375
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
1376
|
+
|
|
1377
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
1378
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
1379
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
1380
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
1381
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
1382
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
1383
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
1384
|
+
|
|
1385
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
1386
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
1387
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
1388
|
+
|
|
1389
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
1390
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
1391
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
1392
|
+
|
|
1393
|
+
#### Parameters
|
|
1394
|
+
|
|
1395
|
+
| Parameter | Type |
|
|
1396
|
+
| :------ | :------ |
|
|
1397
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
1398
|
+
| `path` | `string` |
|
|
1399
|
+
|
|
1400
|
+
#### Returns
|
|
1401
|
+
|
|
1402
|
+
`Promise`\<\{
|
|
1403
|
+
`data`: `unknown`;
|
|
1404
|
+
`path`: `string`;
|
|
1405
|
+
`phantom?`: `boolean`;
|
|
1406
|
+
\}[]\>
|
|
1407
|
+
|
|
1408
|
+
***
|
|
1409
|
+
|
|
1410
|
+
<a id="adminreadrtdbstate"></a>
|
|
1411
|
+
|
|
1412
|
+
### adminReadRtdbState()
|
|
1413
|
+
|
|
1414
|
+
```ts
|
|
1415
|
+
function adminReadRtdbState(db: ClientDb | ClientRtdb): Promise<unknown>;
|
|
1416
|
+
```
|
|
1417
|
+
|
|
1418
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
1419
|
+
|
|
1420
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
1421
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
1422
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
1423
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
1424
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
1425
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
1426
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
1427
|
+
|
|
1428
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
1429
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
1430
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
1431
|
+
|
|
1432
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
1433
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
1434
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
1435
|
+
|
|
1436
|
+
#### Parameters
|
|
1437
|
+
|
|
1438
|
+
| Parameter | Type |
|
|
1439
|
+
| :------ | :------ |
|
|
1440
|
+
| `db` | [`ClientDb`](#clientdb) \| [`ClientRtdb`](#clientrtdb) |
|
|
1441
|
+
|
|
1442
|
+
#### Returns
|
|
1443
|
+
|
|
1444
|
+
`Promise`\<`unknown`\>
|
|
1445
|
+
|
|
1446
|
+
***
|
|
1447
|
+
|
|
1448
|
+
<a id="adminreadstate"></a>
|
|
1449
|
+
|
|
1450
|
+
### adminReadState()
|
|
1451
|
+
|
|
1452
|
+
```ts
|
|
1453
|
+
function adminReadState(db: ClientDb, opts?: {
|
|
1454
|
+
maxDepth?: number;
|
|
1455
|
+
path?: string;
|
|
1456
|
+
}): Promise<Record<string, unknown>>;
|
|
1457
|
+
```
|
|
1458
|
+
|
|
1459
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
1460
|
+
|
|
1461
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
1462
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
1463
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
1464
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
1465
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
1466
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
1467
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
1468
|
+
|
|
1469
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
1470
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
1471
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
1472
|
+
|
|
1473
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
1474
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
1475
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
1476
|
+
|
|
1477
|
+
#### Parameters
|
|
1478
|
+
|
|
1479
|
+
| Parameter | Type |
|
|
1480
|
+
| :------ | :------ |
|
|
1481
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
1482
|
+
| `opts?` | \{ `maxDepth?`: `number`; `path?`: `string`; \} |
|
|
1483
|
+
| `opts.maxDepth?` | `number` |
|
|
1484
|
+
| `opts.path?` | `string` |
|
|
1485
|
+
|
|
1486
|
+
#### Returns
|
|
1487
|
+
|
|
1488
|
+
`Promise`\<`Record`\<`string`, `unknown`\>\>
|
|
1489
|
+
|
|
1490
|
+
***
|
|
1491
|
+
|
|
1492
|
+
<a id="adminsetdocument"></a>
|
|
1493
|
+
|
|
1494
|
+
### adminSetDocument()
|
|
1495
|
+
|
|
1496
|
+
```ts
|
|
1497
|
+
function adminSetDocument(
|
|
1498
|
+
db: ClientDb,
|
|
1499
|
+
path: string,
|
|
1500
|
+
data: unknown): Promise<void>;
|
|
1501
|
+
```
|
|
1502
|
+
|
|
1503
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
1504
|
+
|
|
1505
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
1506
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
1507
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
1508
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
1509
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
1510
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
1511
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
1512
|
+
|
|
1513
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
1514
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
1515
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
1516
|
+
|
|
1517
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
1518
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
1519
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
1520
|
+
|
|
1521
|
+
#### Parameters
|
|
1522
|
+
|
|
1523
|
+
| Parameter | Type |
|
|
1524
|
+
| :------ | :------ |
|
|
1525
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
1526
|
+
| `path` | `string` |
|
|
1527
|
+
| `data` | `unknown` |
|
|
1528
|
+
|
|
1529
|
+
#### Returns
|
|
1530
|
+
|
|
1531
|
+
`Promise`\<`void`\>
|
|
1532
|
+
|
|
1533
|
+
***
|
|
1534
|
+
|
|
1535
|
+
<a id="adminsetrtdbvalue"></a>
|
|
1536
|
+
|
|
1537
|
+
### adminSetRtdbValue()
|
|
1538
|
+
|
|
1539
|
+
```ts
|
|
1540
|
+
function adminSetRtdbValue(
|
|
1541
|
+
db: ClientDb | ClientRtdb,
|
|
1542
|
+
path: string,
|
|
1543
|
+
value: unknown): Promise<void>;
|
|
1544
|
+
```
|
|
1545
|
+
|
|
1546
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
1547
|
+
|
|
1548
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
1549
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
1550
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
1551
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
1552
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
1553
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
1554
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
1555
|
+
|
|
1556
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
1557
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
1558
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
1559
|
+
|
|
1560
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
1561
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
1562
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
1563
|
+
|
|
1564
|
+
#### Parameters
|
|
1565
|
+
|
|
1566
|
+
| Parameter | Type |
|
|
1567
|
+
| :------ | :------ |
|
|
1568
|
+
| `db` | [`ClientDb`](#clientdb) \| [`ClientRtdb`](#clientrtdb) |
|
|
1569
|
+
| `path` | `string` |
|
|
1570
|
+
| `value` | `unknown` |
|
|
1571
|
+
|
|
1572
|
+
#### Returns
|
|
1573
|
+
|
|
1574
|
+
`Promise`\<`void`\>
|
|
1575
|
+
|
|
1576
|
+
***
|
|
1577
|
+
|
|
1578
|
+
<a id="adminsubscribertdbvalue"></a>
|
|
1579
|
+
|
|
1580
|
+
### adminSubscribeRtdbValue()
|
|
1581
|
+
|
|
1582
|
+
```ts
|
|
1583
|
+
function adminSubscribeRtdbValue(
|
|
1584
|
+
db: ClientDb | ClientRtdb,
|
|
1585
|
+
path: string,
|
|
1586
|
+
next: (value: unknown) => void,
|
|
1587
|
+
error?: (err: unknown) => void): Unsubscribe;
|
|
1588
|
+
```
|
|
1589
|
+
|
|
1590
|
+
Subscribe to the raw value at an RTDB path with the ADMIN lens (Pyric Studio
|
|
1591
|
+
data viewer). Rides the same `{service:'rtdb'}` value-subscription channel as
|
|
1592
|
+
`rtdbOnValue`, but pins `actAs: {mode:'admin'}` per-sub instead of following
|
|
1593
|
+
the module default lens, so Studio's viewer stays admin (PRINCIPLES M3) while
|
|
1594
|
+
the page's own listeners keep their session semantics.
|
|
1595
|
+
|
|
1596
|
+
`next` receives the plain JSON value at `path` (`null` when absent) on
|
|
1597
|
+
subscribe and again after every write that changes the subtree.
|
|
1598
|
+
|
|
1599
|
+
#### Parameters
|
|
1600
|
+
|
|
1601
|
+
| Parameter | Type |
|
|
1602
|
+
| :------ | :------ |
|
|
1603
|
+
| `db` | [`ClientDb`](#clientdb) \| [`ClientRtdb`](#clientrtdb) |
|
|
1604
|
+
| `path` | `string` |
|
|
1605
|
+
| `next` | (`value`: `unknown`) => `void` |
|
|
1606
|
+
| `error?` | (`err`: `unknown`) => `void` |
|
|
1607
|
+
|
|
1608
|
+
#### Returns
|
|
1609
|
+
|
|
1610
|
+
[`Unsubscribe`](#unsubscribe)
|
|
1611
|
+
|
|
1612
|
+
***
|
|
1613
|
+
|
|
1614
|
+
<a id="adminupdatertdbvalue"></a>
|
|
1615
|
+
|
|
1616
|
+
### adminUpdateRtdbValue()
|
|
1617
|
+
|
|
1618
|
+
```ts
|
|
1619
|
+
function adminUpdateRtdbValue(
|
|
1620
|
+
db: ClientDb | ClientRtdb,
|
|
1621
|
+
path: string,
|
|
1622
|
+
values: Record<string, unknown>): Promise<void>;
|
|
1623
|
+
```
|
|
1624
|
+
|
|
1625
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
1626
|
+
|
|
1627
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
1628
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
1629
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
1630
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
1631
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
1632
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
1633
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
1634
|
+
|
|
1635
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
1636
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
1637
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
1638
|
+
|
|
1639
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
1640
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
1641
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
1642
|
+
|
|
1643
|
+
#### Parameters
|
|
1644
|
+
|
|
1645
|
+
| Parameter | Type |
|
|
1646
|
+
| :------ | :------ |
|
|
1647
|
+
| `db` | [`ClientDb`](#clientdb) \| [`ClientRtdb`](#clientrtdb) |
|
|
1648
|
+
| `path` | `string` |
|
|
1649
|
+
| `values` | `Record`\<`string`, `unknown`\> |
|
|
1650
|
+
|
|
1651
|
+
#### Returns
|
|
1652
|
+
|
|
1653
|
+
`Promise`\<`void`\>
|
|
1654
|
+
|
|
1655
|
+
***
|
|
1656
|
+
|
|
1657
|
+
<a id="adminupdateuser"></a>
|
|
1658
|
+
|
|
1659
|
+
### adminUpdateUser()
|
|
1660
|
+
|
|
1661
|
+
```ts
|
|
1662
|
+
function adminUpdateUser(
|
|
1663
|
+
auth: ClientAuth,
|
|
1664
|
+
uid: string,
|
|
1665
|
+
request: UpdateUserRequest): Promise<AuthUserRecord>;
|
|
1666
|
+
```
|
|
1667
|
+
|
|
1668
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
1669
|
+
|
|
1670
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
1671
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
1672
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
1673
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
1674
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
1675
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
1676
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
1677
|
+
|
|
1678
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
1679
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
1680
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
1681
|
+
|
|
1682
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
1683
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
1684
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
1685
|
+
|
|
1686
|
+
#### Parameters
|
|
1687
|
+
|
|
1688
|
+
| Parameter | Type |
|
|
1689
|
+
| :------ | :------ |
|
|
1690
|
+
| `auth` | [`ClientAuth`](#clientauth) |
|
|
1691
|
+
| `uid` | `string` |
|
|
1692
|
+
| `request` | `UpdateUserRequest` |
|
|
1693
|
+
|
|
1694
|
+
#### Returns
|
|
1695
|
+
|
|
1696
|
+
`Promise`\<`AuthUserRecord`\>
|
|
1697
|
+
|
|
1698
|
+
***
|
|
1699
|
+
|
|
1700
|
+
<a id="and"></a>
|
|
1701
|
+
|
|
1702
|
+
### and()
|
|
1703
|
+
|
|
1704
|
+
```ts
|
|
1705
|
+
function and(...filters: QueryConstraintHandle[]): QueryConstraintHandle;
|
|
1706
|
+
```
|
|
1707
|
+
|
|
1708
|
+
AND composite filter — every operand must match. See [or](#or).
|
|
1709
|
+
|
|
1710
|
+
#### Parameters
|
|
1711
|
+
|
|
1712
|
+
| Parameter | Type |
|
|
1713
|
+
| :------ | :------ |
|
|
1714
|
+
| ...`filters` | `QueryConstraintHandle`[] |
|
|
1715
|
+
|
|
1716
|
+
#### Returns
|
|
1717
|
+
|
|
1718
|
+
`QueryConstraintHandle`
|
|
1719
|
+
|
|
1720
|
+
***
|
|
1721
|
+
|
|
1722
|
+
<a id="arrayremove"></a>
|
|
1723
|
+
|
|
1724
|
+
### arrayRemove()
|
|
1725
|
+
|
|
1726
|
+
```ts
|
|
1727
|
+
function arrayRemove(...values: unknown[]): SentinelMarker;
|
|
1728
|
+
```
|
|
1729
|
+
|
|
1730
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
1731
|
+
|
|
1732
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
1733
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
1734
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
1735
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
1736
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
1737
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
1738
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
1739
|
+
|
|
1740
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
1741
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
1742
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
1743
|
+
|
|
1744
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
1745
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
1746
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
1747
|
+
|
|
1748
|
+
#### Parameters
|
|
1749
|
+
|
|
1750
|
+
| Parameter | Type |
|
|
1751
|
+
| :------ | :------ |
|
|
1752
|
+
| ...`values` | `unknown`[] |
|
|
1753
|
+
|
|
1754
|
+
#### Returns
|
|
1755
|
+
|
|
1756
|
+
`SentinelMarker`
|
|
1757
|
+
|
|
1758
|
+
***
|
|
1759
|
+
|
|
1760
|
+
<a id="arrayunion"></a>
|
|
1761
|
+
|
|
1762
|
+
### arrayUnion()
|
|
1763
|
+
|
|
1764
|
+
```ts
|
|
1765
|
+
function arrayUnion(...values: unknown[]): SentinelMarker;
|
|
1766
|
+
```
|
|
1767
|
+
|
|
1768
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
1769
|
+
|
|
1770
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
1771
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
1772
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
1773
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
1774
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
1775
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
1776
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
1777
|
+
|
|
1778
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
1779
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
1780
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
1781
|
+
|
|
1782
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
1783
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
1784
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
1785
|
+
|
|
1786
|
+
#### Parameters
|
|
1787
|
+
|
|
1788
|
+
| Parameter | Type |
|
|
1789
|
+
| :------ | :------ |
|
|
1790
|
+
| ...`values` | `unknown`[] |
|
|
1791
|
+
|
|
1792
|
+
#### Returns
|
|
1793
|
+
|
|
1794
|
+
`SentinelMarker`
|
|
1795
|
+
|
|
1796
|
+
***
|
|
1797
|
+
|
|
1798
|
+
<a id="average"></a>
|
|
1799
|
+
|
|
1800
|
+
### average()
|
|
1801
|
+
|
|
1802
|
+
```ts
|
|
1803
|
+
function average(field: string): AggregateFieldDescriptor;
|
|
1804
|
+
```
|
|
1805
|
+
|
|
1806
|
+
Factory: average-of-`field` aggregate. Empty input yields `null`.
|
|
1807
|
+
|
|
1808
|
+
#### Parameters
|
|
1809
|
+
|
|
1810
|
+
| Parameter | Type |
|
|
1811
|
+
| :------ | :------ |
|
|
1812
|
+
| `field` | `string` |
|
|
1813
|
+
|
|
1814
|
+
#### Returns
|
|
1815
|
+
|
|
1816
|
+
`AggregateFieldDescriptor`
|
|
1817
|
+
|
|
1818
|
+
***
|
|
1819
|
+
|
|
1820
|
+
<a id="calltool"></a>
|
|
1821
|
+
|
|
1822
|
+
### callTool()
|
|
1823
|
+
|
|
1824
|
+
```ts
|
|
1825
|
+
function callTool(
|
|
1826
|
+
db: ClientDb,
|
|
1827
|
+
name: string,
|
|
1828
|
+
args: Record<string, unknown>): Promise<{
|
|
1829
|
+
data?: unknown;
|
|
1830
|
+
ok: boolean;
|
|
1831
|
+
summary: string;
|
|
1832
|
+
}>;
|
|
1833
|
+
```
|
|
1834
|
+
|
|
1835
|
+
Forward an agent tool-call to the worker so it executes against the SAME
|
|
1836
|
+
sandbox the app + Studio use. The worker runs the canonical tool dispatcher
|
|
1837
|
+
(`buildSandboxDispatcher`) and replies with the `{ ok, summary, data }`
|
|
1838
|
+
result. Used by the bridge peer on the worker path (`connectBridgePeer` in
|
|
1839
|
+
`entries/runtime.ts`) so the agent shares the one authoritative sandbox.
|
|
1840
|
+
|
|
1841
|
+
#### Parameters
|
|
1842
|
+
|
|
1843
|
+
| Parameter | Type |
|
|
1844
|
+
| :------ | :------ |
|
|
1845
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
1846
|
+
| `name` | `string` |
|
|
1847
|
+
| `args` | `Record`\<`string`, `unknown`\> |
|
|
1848
|
+
|
|
1849
|
+
#### Returns
|
|
1850
|
+
|
|
1851
|
+
`Promise`\<\{
|
|
1852
|
+
`data?`: `unknown`;
|
|
1853
|
+
`ok`: `boolean`;
|
|
1854
|
+
`summary`: `string`;
|
|
1855
|
+
\}\>
|
|
1856
|
+
|
|
1857
|
+
***
|
|
1858
|
+
|
|
1859
|
+
<a id="collection"></a>
|
|
1860
|
+
|
|
1861
|
+
### collection()
|
|
1862
|
+
|
|
1863
|
+
```ts
|
|
1864
|
+
function collection(parent: ClientDb | DocRefHandle, ...pathSegments: string[]): CollRefHandle;
|
|
1865
|
+
```
|
|
1866
|
+
|
|
1867
|
+
Build a collection reference. Mirrors `pyric/firestore`'s `collection(db, path)`.
|
|
1868
|
+
|
|
1869
|
+
#### Parameters
|
|
1870
|
+
|
|
1871
|
+
| Parameter | Type |
|
|
1872
|
+
| :------ | :------ |
|
|
1873
|
+
| `parent` | [`ClientDb`](#clientdb) \| [`DocRefHandle`](#docrefhandle) |
|
|
1874
|
+
| ...`pathSegments` | `string`[] |
|
|
1875
|
+
|
|
1876
|
+
#### Returns
|
|
1877
|
+
|
|
1878
|
+
[`CollRefHandle`](#collrefhandle)
|
|
1879
|
+
|
|
1880
|
+
***
|
|
1881
|
+
|
|
1882
|
+
<a id="collectiongroup"></a>
|
|
1883
|
+
|
|
1884
|
+
### collectionGroup()
|
|
1885
|
+
|
|
1886
|
+
```ts
|
|
1887
|
+
function collectionGroup(db: ClientDb, collectionId: string): QueryHandle;
|
|
1888
|
+
```
|
|
1889
|
+
|
|
1890
|
+
Build a collection-group query. Mirrors `pyric/firestore`'s `collectionGroup(db, id)`.
|
|
1891
|
+
|
|
1892
|
+
#### Parameters
|
|
1893
|
+
|
|
1894
|
+
| Parameter | Type |
|
|
1895
|
+
| :------ | :------ |
|
|
1896
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
1897
|
+
| `collectionId` | `string` |
|
|
1898
|
+
|
|
1899
|
+
#### Returns
|
|
1900
|
+
|
|
1901
|
+
[`QueryHandle`](#queryhandle)
|
|
1902
|
+
|
|
1903
|
+
***
|
|
1904
|
+
|
|
1905
|
+
<a id="connectauthemulator"></a>
|
|
1906
|
+
|
|
1907
|
+
### connectAuthEmulator()
|
|
1908
|
+
|
|
1909
|
+
```ts
|
|
1910
|
+
function connectAuthEmulator(
|
|
1911
|
+
_auth: ClientAuth,
|
|
1912
|
+
_url: string,
|
|
1913
|
+
_options?: {
|
|
1914
|
+
disableWarnings?: boolean;
|
|
1915
|
+
}): void;
|
|
1916
|
+
```
|
|
1917
|
+
|
|
1918
|
+
Connect to the auth emulator. No-op shim over the worker: the worker's
|
|
1919
|
+
sandbox IS the emulator-equivalent backend, so there's nothing to point at.
|
|
1920
|
+
Present for surface parity so app code that calls it doesn't break.
|
|
1921
|
+
|
|
1922
|
+
#### Parameters
|
|
1923
|
+
|
|
1924
|
+
| Parameter | Type |
|
|
1925
|
+
| :------ | :------ |
|
|
1926
|
+
| `_auth` | [`ClientAuth`](#clientauth) |
|
|
1927
|
+
| `_url` | `string` |
|
|
1928
|
+
| `_options?` | \{ `disableWarnings?`: `boolean`; \} |
|
|
1929
|
+
| `_options.disableWarnings?` | `boolean` |
|
|
1930
|
+
|
|
1931
|
+
#### Returns
|
|
1932
|
+
|
|
1933
|
+
`void`
|
|
1934
|
+
|
|
1935
|
+
***
|
|
1936
|
+
|
|
1937
|
+
<a id="count"></a>
|
|
1938
|
+
|
|
1939
|
+
### count()
|
|
1940
|
+
|
|
1941
|
+
```ts
|
|
1942
|
+
function count(): AggregateFieldDescriptor;
|
|
1943
|
+
```
|
|
1944
|
+
|
|
1945
|
+
Factory: count() aggregate field. Mirrors `pyric/firestore`'s `count()`.
|
|
1946
|
+
|
|
1947
|
+
#### Returns
|
|
1948
|
+
|
|
1949
|
+
`AggregateFieldDescriptor`
|
|
1950
|
+
|
|
1951
|
+
***
|
|
1952
|
+
|
|
1953
|
+
<a id="createuserwithemailandpassword"></a>
|
|
1954
|
+
|
|
1955
|
+
### createUserWithEmailAndPassword()
|
|
1956
|
+
|
|
1957
|
+
```ts
|
|
1958
|
+
function createUserWithEmailAndPassword(
|
|
1959
|
+
auth: ClientAuth,
|
|
1960
|
+
email: string,
|
|
1961
|
+
password: string): Promise<ClientUserCredential>;
|
|
1962
|
+
```
|
|
1963
|
+
|
|
1964
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
1965
|
+
|
|
1966
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
1967
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
1968
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
1969
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
1970
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
1971
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
1972
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
1973
|
+
|
|
1974
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
1975
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
1976
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
1977
|
+
|
|
1978
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
1979
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
1980
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
1981
|
+
|
|
1982
|
+
#### Parameters
|
|
1983
|
+
|
|
1984
|
+
| Parameter | Type |
|
|
1985
|
+
| :------ | :------ |
|
|
1986
|
+
| `auth` | [`ClientAuth`](#clientauth) |
|
|
1987
|
+
| `email` | `string` |
|
|
1988
|
+
| `password` | `string` |
|
|
1989
|
+
|
|
1990
|
+
#### Returns
|
|
1991
|
+
|
|
1992
|
+
`Promise`\<[`ClientUserCredential`](#clientusercredential)\>
|
|
1993
|
+
|
|
1994
|
+
***
|
|
1995
|
+
|
|
1996
|
+
<a id="deletedoc"></a>
|
|
1997
|
+
|
|
1998
|
+
### deleteDoc()
|
|
1999
|
+
|
|
2000
|
+
```ts
|
|
2001
|
+
function deleteDoc(ref: DocRefHandle): Promise<void>;
|
|
2002
|
+
```
|
|
2003
|
+
|
|
2004
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
2005
|
+
|
|
2006
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
2007
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
2008
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
2009
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
2010
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
2011
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
2012
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
2013
|
+
|
|
2014
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
2015
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
2016
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
2017
|
+
|
|
2018
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
2019
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
2020
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
2021
|
+
|
|
2022
|
+
#### Parameters
|
|
2023
|
+
|
|
2024
|
+
| Parameter | Type |
|
|
2025
|
+
| :------ | :------ |
|
|
2026
|
+
| `ref` | [`DocRefHandle`](#docrefhandle) |
|
|
2027
|
+
|
|
2028
|
+
#### Returns
|
|
2029
|
+
|
|
2030
|
+
`Promise`\<`void`\>
|
|
2031
|
+
|
|
2032
|
+
***
|
|
2033
|
+
|
|
2034
|
+
<a id="deletefield"></a>
|
|
2035
|
+
|
|
2036
|
+
### deleteField()
|
|
2037
|
+
|
|
2038
|
+
```ts
|
|
2039
|
+
function deleteField(): SentinelMarker;
|
|
2040
|
+
```
|
|
2041
|
+
|
|
2042
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
2043
|
+
|
|
2044
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
2045
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
2046
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
2047
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
2048
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
2049
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
2050
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
2051
|
+
|
|
2052
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
2053
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
2054
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
2055
|
+
|
|
2056
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
2057
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
2058
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
2059
|
+
|
|
2060
|
+
#### Returns
|
|
2061
|
+
|
|
2062
|
+
`SentinelMarker`
|
|
2063
|
+
|
|
2064
|
+
***
|
|
2065
|
+
|
|
2066
|
+
<a id="deleteobject"></a>
|
|
2067
|
+
|
|
2068
|
+
### deleteObject()
|
|
2069
|
+
|
|
2070
|
+
```ts
|
|
2071
|
+
function deleteObject(reference: ClientStorageReference): Promise<void>;
|
|
2072
|
+
```
|
|
2073
|
+
|
|
2074
|
+
Delete the object at the reference's path (idempotent — missing = no-op,
|
|
2075
|
+
matching the sandbox backend's delete semantics).
|
|
2076
|
+
|
|
2077
|
+
#### Parameters
|
|
2078
|
+
|
|
2079
|
+
| Parameter | Type |
|
|
2080
|
+
| :------ | :------ |
|
|
2081
|
+
| `reference` | [`ClientStorageReference`](#clientstoragereference) |
|
|
2082
|
+
|
|
2083
|
+
#### Returns
|
|
2084
|
+
|
|
2085
|
+
`Promise`\<`void`\>
|
|
2086
|
+
|
|
2087
|
+
***
|
|
2088
|
+
|
|
2089
|
+
<a id="deleteworkerbranch"></a>
|
|
2090
|
+
|
|
2091
|
+
### deleteWorkerBranch()
|
|
2092
|
+
|
|
2093
|
+
```ts
|
|
2094
|
+
function deleteWorkerBranch(db: ClientDb, name: string): Promise<void>;
|
|
2095
|
+
```
|
|
2096
|
+
|
|
2097
|
+
Phase 3: delete a named branch.
|
|
2098
|
+
|
|
2099
|
+
#### Parameters
|
|
2100
|
+
|
|
2101
|
+
| Parameter | Type |
|
|
2102
|
+
| :------ | :------ |
|
|
2103
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
2104
|
+
| `name` | `string` |
|
|
2105
|
+
|
|
2106
|
+
#### Returns
|
|
2107
|
+
|
|
2108
|
+
`Promise`\<`void`\>
|
|
2109
|
+
|
|
2110
|
+
***
|
|
2111
|
+
|
|
2112
|
+
<a id="doc"></a>
|
|
2113
|
+
|
|
2114
|
+
### doc()
|
|
2115
|
+
|
|
2116
|
+
```ts
|
|
2117
|
+
function doc(parent: ClientDb | CollRefHandle, ...pathSegments: string[]): DocRefHandle;
|
|
2118
|
+
```
|
|
2119
|
+
|
|
2120
|
+
Build a document reference. Mirrors `pyric/firestore`'s `doc(db, path)`.
|
|
2121
|
+
|
|
2122
|
+
WHY CLIENT-SIDE: Firebase's `doc()` is synchronous and path-only — it
|
|
2123
|
+
needs no data from the sandbox. We build a descriptor object here and
|
|
2124
|
+
include the port so execution calls can route to the worker.
|
|
2125
|
+
|
|
2126
|
+
#### Parameters
|
|
2127
|
+
|
|
2128
|
+
| Parameter | Type |
|
|
2129
|
+
| :------ | :------ |
|
|
2130
|
+
| `parent` | [`ClientDb`](#clientdb) \| [`CollRefHandle`](#collrefhandle) |
|
|
2131
|
+
| ...`pathSegments` | `string`[] |
|
|
2132
|
+
|
|
2133
|
+
#### Returns
|
|
2134
|
+
|
|
2135
|
+
[`DocRefHandle`](#docrefhandle)
|
|
2136
|
+
|
|
2137
|
+
***
|
|
2138
|
+
|
|
2139
|
+
<a id="endat"></a>
|
|
2140
|
+
|
|
2141
|
+
### endAt()
|
|
2142
|
+
|
|
2143
|
+
```ts
|
|
2144
|
+
function endAt(...values: unknown[]): QueryConstraintHandle;
|
|
2145
|
+
```
|
|
2146
|
+
|
|
2147
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
2148
|
+
|
|
2149
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
2150
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
2151
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
2152
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
2153
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
2154
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
2155
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
2156
|
+
|
|
2157
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
2158
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
2159
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
2160
|
+
|
|
2161
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
2162
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
2163
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
2164
|
+
|
|
2165
|
+
#### Parameters
|
|
2166
|
+
|
|
2167
|
+
| Parameter | Type |
|
|
2168
|
+
| :------ | :------ |
|
|
2169
|
+
| ...`values` | `unknown`[] |
|
|
2170
|
+
|
|
2171
|
+
#### Returns
|
|
2172
|
+
|
|
2173
|
+
`QueryConstraintHandle`
|
|
2174
|
+
|
|
2175
|
+
***
|
|
2176
|
+
|
|
2177
|
+
<a id="endbefore"></a>
|
|
2178
|
+
|
|
2179
|
+
### endBefore()
|
|
2180
|
+
|
|
2181
|
+
```ts
|
|
2182
|
+
function endBefore(...values: unknown[]): QueryConstraintHandle;
|
|
2183
|
+
```
|
|
2184
|
+
|
|
2185
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
2186
|
+
|
|
2187
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
2188
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
2189
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
2190
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
2191
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
2192
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
2193
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
2194
|
+
|
|
2195
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
2196
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
2197
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
2198
|
+
|
|
2199
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
2200
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
2201
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
2202
|
+
|
|
2203
|
+
#### Parameters
|
|
2204
|
+
|
|
2205
|
+
| Parameter | Type |
|
|
2206
|
+
| :------ | :------ |
|
|
2207
|
+
| ...`values` | `unknown`[] |
|
|
2208
|
+
|
|
2209
|
+
#### Returns
|
|
2210
|
+
|
|
2211
|
+
`QueryConstraintHandle`
|
|
2212
|
+
|
|
2213
|
+
***
|
|
2214
|
+
|
|
2215
|
+
<a id="eventhistory"></a>
|
|
2216
|
+
|
|
2217
|
+
### eventHistory()
|
|
2218
|
+
|
|
2219
|
+
```ts
|
|
2220
|
+
function eventHistory(db: ClientDb): Promise<readonly SandboxEvent[]>;
|
|
2221
|
+
```
|
|
2222
|
+
|
|
2223
|
+
Fetch the worker sandbox's event history as a one-shot snapshot (every event
|
|
2224
|
+
so far). Opens a transient stream sub, resolves with the initial history
|
|
2225
|
+
batch, and tears the sub down immediately — so it never holds a live
|
|
2226
|
+
subscription. Useful for a late, snapshot-only consumer.
|
|
2227
|
+
|
|
2228
|
+
#### Parameters
|
|
2229
|
+
|
|
2230
|
+
| Parameter | Type |
|
|
2231
|
+
| :------ | :------ |
|
|
2232
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
2233
|
+
|
|
2234
|
+
#### Returns
|
|
2235
|
+
|
|
2236
|
+
`Promise`\<readonly `SandboxEvent`[]\>
|
|
2237
|
+
|
|
2238
|
+
***
|
|
2239
|
+
|
|
2240
|
+
<a id="exportworkerstate"></a>
|
|
2241
|
+
|
|
2242
|
+
### exportWorkerState()
|
|
2243
|
+
|
|
2244
|
+
```ts
|
|
2245
|
+
function exportWorkerState(db: ClientDb): Promise<string>;
|
|
2246
|
+
```
|
|
2247
|
+
|
|
2248
|
+
Phase 2 (transfer): export the FULL sandbox state as a portable bundle string
|
|
2249
|
+
(the chunk format the persist layer uses, so wrapper types round-trip). Save
|
|
2250
|
+
it to a file and [importWorkerState](#importworkerstate) it into another instance.
|
|
2251
|
+
|
|
2252
|
+
#### Parameters
|
|
2253
|
+
|
|
2254
|
+
| Parameter | Type |
|
|
2255
|
+
| :------ | :------ |
|
|
2256
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
2257
|
+
|
|
2258
|
+
#### Returns
|
|
2259
|
+
|
|
2260
|
+
`Promise`\<`string`\>
|
|
2261
|
+
|
|
2262
|
+
***
|
|
2263
|
+
|
|
2264
|
+
<a id="getactiverules"></a>
|
|
2265
|
+
|
|
2266
|
+
### getActiveRules()
|
|
2267
|
+
|
|
2268
|
+
```ts
|
|
2269
|
+
function getActiveRules(db: ClientDb | ClientRtdb, service?: "firestore" | "database"): Promise<unknown>;
|
|
2270
|
+
```
|
|
2271
|
+
|
|
2272
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
2273
|
+
|
|
2274
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
2275
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
2276
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
2277
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
2278
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
2279
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
2280
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
2281
|
+
|
|
2282
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
2283
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
2284
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
2285
|
+
|
|
2286
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
2287
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
2288
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
2289
|
+
|
|
2290
|
+
#### Parameters
|
|
2291
|
+
|
|
2292
|
+
| Parameter | Type |
|
|
2293
|
+
| :------ | :------ |
|
|
2294
|
+
| `db` | [`ClientDb`](#clientdb) \| [`ClientRtdb`](#clientrtdb) |
|
|
2295
|
+
| `service?` | `"firestore"` \| `"database"` |
|
|
2296
|
+
|
|
2297
|
+
#### Returns
|
|
2298
|
+
|
|
2299
|
+
`Promise`\<`unknown`\>
|
|
2300
|
+
|
|
2301
|
+
***
|
|
2302
|
+
|
|
2303
|
+
<a id="getaggregatefromserver"></a>
|
|
2304
|
+
|
|
2305
|
+
### getAggregateFromServer()
|
|
2306
|
+
|
|
2307
|
+
```ts
|
|
2308
|
+
function getAggregateFromServer<S>(source: CollRefHandle | QueryHandle, spec: S): Promise<{
|
|
2309
|
+
data: { [K in string | number | symbol]: number };
|
|
2310
|
+
}>;
|
|
2311
|
+
```
|
|
2312
|
+
|
|
2313
|
+
Run a multi-field aggregate on the worker. Mirrors `pyric/firestore`'s
|
|
2314
|
+
`getAggregateFromServer(query, spec)`: spec entries are keyed by
|
|
2315
|
+
caller-chosen aliases; `.data()` returns the numbers under the same keys
|
|
2316
|
+
(`average` over no rows is `null`).
|
|
2317
|
+
|
|
2318
|
+
#### Type Parameters
|
|
2319
|
+
|
|
2320
|
+
| Type Parameter |
|
|
2321
|
+
| :------ |
|
|
2322
|
+
| `S` *extends* `AggregateSpecDescriptor` |
|
|
2323
|
+
|
|
2324
|
+
#### Parameters
|
|
2325
|
+
|
|
2326
|
+
| Parameter | Type |
|
|
2327
|
+
| :------ | :------ |
|
|
2328
|
+
| `source` | [`CollRefHandle`](#collrefhandle) \| [`QueryHandle`](#queryhandle) |
|
|
2329
|
+
| `spec` | `S` |
|
|
2330
|
+
|
|
2331
|
+
#### Returns
|
|
2332
|
+
|
|
2333
|
+
`Promise`\<\{
|
|
2334
|
+
`data`: \{ \[K in string \| number \| symbol\]: number \};
|
|
2335
|
+
\}\>
|
|
2336
|
+
|
|
2337
|
+
***
|
|
2338
|
+
|
|
2339
|
+
<a id="getauth"></a>
|
|
2340
|
+
|
|
2341
|
+
### getAuth()
|
|
2342
|
+
|
|
2343
|
+
```ts
|
|
2344
|
+
function getAuth(source: string | ClientDb | URL, name?: string): ClientAuth;
|
|
2345
|
+
```
|
|
2346
|
+
|
|
2347
|
+
Get the worker-backed Auth handle.
|
|
2348
|
+
|
|
2349
|
+
Mirrors `pyric/auth`'s `getAuth(sandbox)` / `firebase/auth`'s
|
|
2350
|
+
`getAuth(app)` — but the input is either an existing `ClientDb` (reusing
|
|
2351
|
+
its port, the common case in serve where Firestore + auth share one
|
|
2352
|
+
worker) or a worker URL (standalone).
|
|
2353
|
+
|
|
2354
|
+
The returned handle seeds its `currentUser` mirror by opening an internal
|
|
2355
|
+
authState subscription that keeps it live across tabs.
|
|
2356
|
+
|
|
2357
|
+
#### Parameters
|
|
2358
|
+
|
|
2359
|
+
| Parameter | Type |
|
|
2360
|
+
| :------ | :------ |
|
|
2361
|
+
| `source` | `string` \| [`ClientDb`](#clientdb) \| `URL` |
|
|
2362
|
+
| `name?` | `string` |
|
|
2363
|
+
|
|
2364
|
+
#### Returns
|
|
2365
|
+
|
|
2366
|
+
[`ClientAuth`](#clientauth)
|
|
2367
|
+
|
|
2368
|
+
***
|
|
2369
|
+
|
|
2370
|
+
<a id="getblob"></a>
|
|
2371
|
+
|
|
2372
|
+
### getBlob()
|
|
2373
|
+
|
|
2374
|
+
```ts
|
|
2375
|
+
function getBlob(reference: ClientStorageReference): Promise<Blob>;
|
|
2376
|
+
```
|
|
2377
|
+
|
|
2378
|
+
Read an object's bytes as a Blob (Pyric Studio inspector preview).
|
|
2379
|
+
MessagePort-only — a Blob cannot cross the JSON bridge relay.
|
|
2380
|
+
|
|
2381
|
+
#### Parameters
|
|
2382
|
+
|
|
2383
|
+
| Parameter | Type |
|
|
2384
|
+
| :------ | :------ |
|
|
2385
|
+
| `reference` | [`ClientStorageReference`](#clientstoragereference) |
|
|
2386
|
+
|
|
2387
|
+
#### Returns
|
|
2388
|
+
|
|
2389
|
+
`Promise`\<`Blob`\>
|
|
2390
|
+
|
|
2391
|
+
***
|
|
2392
|
+
|
|
2393
|
+
<a id="getbytes"></a>
|
|
2394
|
+
|
|
2395
|
+
### getBytes()
|
|
2396
|
+
|
|
2397
|
+
```ts
|
|
2398
|
+
function getBytes(reference: ClientStorageReference, maxDownloadSizeBytes?: number): Promise<ArrayBuffer>;
|
|
2399
|
+
```
|
|
2400
|
+
|
|
2401
|
+
Read an object's bytes (JSON-safe base64 op → `ArrayBuffer`). Mirrors
|
|
2402
|
+
`pyric/storage`'s `getBytes`, including the optional client-side cap.
|
|
2403
|
+
|
|
2404
|
+
#### Parameters
|
|
2405
|
+
|
|
2406
|
+
| Parameter | Type |
|
|
2407
|
+
| :------ | :------ |
|
|
2408
|
+
| `reference` | [`ClientStorageReference`](#clientstoragereference) |
|
|
2409
|
+
| `maxDownloadSizeBytes?` | `number` |
|
|
2410
|
+
|
|
2411
|
+
#### Returns
|
|
2412
|
+
|
|
2413
|
+
`Promise`\<`ArrayBuffer`\>
|
|
2414
|
+
|
|
2415
|
+
***
|
|
2416
|
+
|
|
2417
|
+
<a id="getcountfromserver"></a>
|
|
2418
|
+
|
|
2419
|
+
### getCountFromServer()
|
|
2420
|
+
|
|
2421
|
+
```ts
|
|
2422
|
+
function getCountFromServer(source: CollRefHandle | QueryHandle): Promise<{
|
|
2423
|
+
data: {
|
|
2424
|
+
count: number;
|
|
2425
|
+
};
|
|
2426
|
+
}>;
|
|
2427
|
+
```
|
|
2428
|
+
|
|
2429
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
2430
|
+
|
|
2431
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
2432
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
2433
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
2434
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
2435
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
2436
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
2437
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
2438
|
+
|
|
2439
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
2440
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
2441
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
2442
|
+
|
|
2443
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
2444
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
2445
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
2446
|
+
|
|
2447
|
+
#### Parameters
|
|
2448
|
+
|
|
2449
|
+
| Parameter | Type |
|
|
2450
|
+
| :------ | :------ |
|
|
2451
|
+
| `source` | [`CollRefHandle`](#collrefhandle) \| [`QueryHandle`](#queryhandle) |
|
|
2452
|
+
|
|
2453
|
+
#### Returns
|
|
2454
|
+
|
|
2455
|
+
`Promise`\<\{
|
|
2456
|
+
`data`: \{
|
|
2457
|
+
`count`: `number`;
|
|
2458
|
+
\};
|
|
2459
|
+
\}\>
|
|
2460
|
+
|
|
2461
|
+
***
|
|
2462
|
+
|
|
2463
|
+
<a id="getdoc"></a>
|
|
2464
|
+
|
|
2465
|
+
### getDoc()
|
|
2466
|
+
|
|
2467
|
+
```ts
|
|
2468
|
+
function getDoc(ref: DocRefHandle): Promise<ClientDocSnapshot>;
|
|
2469
|
+
```
|
|
2470
|
+
|
|
2471
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
2472
|
+
|
|
2473
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
2474
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
2475
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
2476
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
2477
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
2478
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
2479
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
2480
|
+
|
|
2481
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
2482
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
2483
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
2484
|
+
|
|
2485
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
2486
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
2487
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
2488
|
+
|
|
2489
|
+
#### Parameters
|
|
2490
|
+
|
|
2491
|
+
| Parameter | Type |
|
|
2492
|
+
| :------ | :------ |
|
|
2493
|
+
| `ref` | [`DocRefHandle`](#docrefhandle) |
|
|
2494
|
+
|
|
2495
|
+
#### Returns
|
|
2496
|
+
|
|
2497
|
+
`Promise`\<[`ClientDocSnapshot`](#clientdocsnapshot)\>
|
|
2498
|
+
|
|
2499
|
+
***
|
|
2500
|
+
|
|
2501
|
+
<a id="getdocs"></a>
|
|
2502
|
+
|
|
2503
|
+
### getDocs()
|
|
2504
|
+
|
|
2505
|
+
```ts
|
|
2506
|
+
function getDocs(source: CollRefHandle | QueryHandle): Promise<ClientQuerySnapshot>;
|
|
2507
|
+
```
|
|
2508
|
+
|
|
2509
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
2510
|
+
|
|
2511
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
2512
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
2513
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
2514
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
2515
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
2516
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
2517
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
2518
|
+
|
|
2519
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
2520
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
2521
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
2522
|
+
|
|
2523
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
2524
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
2525
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
2526
|
+
|
|
2527
|
+
#### Parameters
|
|
2528
|
+
|
|
2529
|
+
| Parameter | Type |
|
|
2530
|
+
| :------ | :------ |
|
|
2531
|
+
| `source` | [`CollRefHandle`](#collrefhandle) \| [`QueryHandle`](#queryhandle) |
|
|
2532
|
+
|
|
2533
|
+
#### Returns
|
|
2534
|
+
|
|
2535
|
+
`Promise`\<[`ClientQuerySnapshot`](#clientquerysnapshot)\>
|
|
2536
|
+
|
|
2537
|
+
***
|
|
2538
|
+
|
|
2539
|
+
<a id="getdownloadurl"></a>
|
|
2540
|
+
|
|
2541
|
+
### getDownloadURL()
|
|
2542
|
+
|
|
2543
|
+
```ts
|
|
2544
|
+
function getDownloadURL(reference: ClientStorageReference): Promise<string>;
|
|
2545
|
+
```
|
|
2546
|
+
|
|
2547
|
+
Return a page-owned URL for an object read through the SharedWorker.
|
|
2548
|
+
|
|
2549
|
+
#### Parameters
|
|
2550
|
+
|
|
2551
|
+
| Parameter | Type |
|
|
2552
|
+
| :------ | :------ |
|
|
2553
|
+
| `reference` | [`ClientStorageReference`](#clientstoragereference) |
|
|
2554
|
+
|
|
2555
|
+
#### Returns
|
|
2556
|
+
|
|
2557
|
+
`Promise`\<`string`\>
|
|
2558
|
+
|
|
2559
|
+
***
|
|
2560
|
+
|
|
2561
|
+
<a id="getfirestore"></a>
|
|
2562
|
+
|
|
2563
|
+
### getFirestore()
|
|
2564
|
+
|
|
2565
|
+
```ts
|
|
2566
|
+
function getFirestore(workerUrl: string | URL, name?: string): ClientDb;
|
|
2567
|
+
```
|
|
2568
|
+
|
|
2569
|
+
Connect to the SharedWorker and return a client Firestore handle.
|
|
2570
|
+
|
|
2571
|
+
Pass the URL of the SharedWorker script as `workerUrl`. Under `pyric dev`
|
|
2572
|
+
this is `/__pyric/sdk/worker.js`; for tests or standalone use, pass the path
|
|
2573
|
+
explicitly.
|
|
2574
|
+
|
|
2575
|
+
`getFirestore` mirrors `pyric/firestore`'s `getFirestore(sandbox)` shape
|
|
2576
|
+
but returns a `ClientDb` backed by a `MessagePort` instead of a sandbox.
|
|
2577
|
+
|
|
2578
|
+
#### Parameters
|
|
2579
|
+
|
|
2580
|
+
| Parameter | Type |
|
|
2581
|
+
| :------ | :------ |
|
|
2582
|
+
| `workerUrl` | `string` \| `URL` |
|
|
2583
|
+
| `name?` | `string` |
|
|
2584
|
+
|
|
2585
|
+
#### Returns
|
|
2586
|
+
|
|
2587
|
+
[`ClientDb`](#clientdb)
|
|
2588
|
+
|
|
2589
|
+
***
|
|
2590
|
+
|
|
2591
|
+
<a id="getidtoken-2"></a>
|
|
2592
|
+
|
|
2593
|
+
### getIdToken()
|
|
2594
|
+
|
|
2595
|
+
```ts
|
|
2596
|
+
function getIdToken(user: ClientUser, forceRefresh?: boolean): Promise<string>;
|
|
2597
|
+
```
|
|
2598
|
+
|
|
2599
|
+
Top-level mirror of `firebase/auth`'s `getIdToken(user)`.
|
|
2600
|
+
|
|
2601
|
+
#### Parameters
|
|
2602
|
+
|
|
2603
|
+
| Parameter | Type |
|
|
2604
|
+
| :------ | :------ |
|
|
2605
|
+
| `user` | [`ClientUser`](#clientuser) |
|
|
2606
|
+
| `forceRefresh?` | `boolean` |
|
|
2607
|
+
|
|
2608
|
+
#### Returns
|
|
2609
|
+
|
|
2610
|
+
`Promise`\<`string`\>
|
|
2611
|
+
|
|
2612
|
+
***
|
|
2613
|
+
|
|
2614
|
+
<a id="getidtokenresult-2"></a>
|
|
2615
|
+
|
|
2616
|
+
### getIdTokenResult()
|
|
2617
|
+
|
|
2618
|
+
```ts
|
|
2619
|
+
function getIdTokenResult(user: ClientUser, forceRefresh?: boolean): Promise<SerializedIdTokenResult>;
|
|
2620
|
+
```
|
|
2621
|
+
|
|
2622
|
+
Top-level mirror of `firebase/auth`'s `getIdTokenResult(user)`.
|
|
2623
|
+
|
|
2624
|
+
#### Parameters
|
|
2625
|
+
|
|
2626
|
+
| Parameter | Type |
|
|
2627
|
+
| :------ | :------ |
|
|
2628
|
+
| `user` | [`ClientUser`](#clientuser) |
|
|
2629
|
+
| `forceRefresh?` | `boolean` |
|
|
2630
|
+
|
|
2631
|
+
#### Returns
|
|
2632
|
+
|
|
2633
|
+
`Promise`\<[`SerializedIdTokenResult`](#serializedidtokenresult)\>
|
|
2634
|
+
|
|
2635
|
+
***
|
|
2636
|
+
|
|
2637
|
+
<a id="getlens"></a>
|
|
2638
|
+
|
|
2639
|
+
### getLens()
|
|
2640
|
+
|
|
2641
|
+
```ts
|
|
2642
|
+
function getLens(): any;
|
|
2643
|
+
```
|
|
2644
|
+
|
|
2645
|
+
The active default lens (read-only view), for Studio UI to reflect state.
|
|
2646
|
+
|
|
2647
|
+
#### Returns
|
|
2648
|
+
|
|
2649
|
+
`any`
|
|
2650
|
+
|
|
2651
|
+
***
|
|
2652
|
+
|
|
2653
|
+
<a id="getmetadata"></a>
|
|
2654
|
+
|
|
2655
|
+
### getMetadata()
|
|
2656
|
+
|
|
2657
|
+
```ts
|
|
2658
|
+
function getMetadata(reference: ClientStorageReference): Promise<FullMetadata>;
|
|
2659
|
+
```
|
|
2660
|
+
|
|
2661
|
+
Read an object's metadata (Pyric Studio inspector).
|
|
2662
|
+
|
|
2663
|
+
#### Parameters
|
|
2664
|
+
|
|
2665
|
+
| Parameter | Type |
|
|
2666
|
+
| :------ | :------ |
|
|
2667
|
+
| `reference` | [`ClientStorageReference`](#clientstoragereference) |
|
|
2668
|
+
|
|
2669
|
+
#### Returns
|
|
2670
|
+
|
|
2671
|
+
`Promise`\<`FullMetadata`\>
|
|
2672
|
+
|
|
2673
|
+
***
|
|
2674
|
+
|
|
2675
|
+
<a id="getproviderconfig"></a>
|
|
2676
|
+
|
|
2677
|
+
### getProviderConfig()
|
|
2678
|
+
|
|
2679
|
+
```ts
|
|
2680
|
+
function getProviderConfig(auth: ClientAuth): Promise<{
|
|
2681
|
+
enabled: boolean;
|
|
2682
|
+
providerId: string;
|
|
2683
|
+
}[]>;
|
|
2684
|
+
```
|
|
2685
|
+
|
|
2686
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
2687
|
+
|
|
2688
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
2689
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
2690
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
2691
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
2692
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
2693
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
2694
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
2695
|
+
|
|
2696
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
2697
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
2698
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
2699
|
+
|
|
2700
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
2701
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
2702
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
2703
|
+
|
|
2704
|
+
#### Parameters
|
|
2705
|
+
|
|
2706
|
+
| Parameter | Type |
|
|
2707
|
+
| :------ | :------ |
|
|
2708
|
+
| `auth` | [`ClientAuth`](#clientauth) |
|
|
2709
|
+
|
|
2710
|
+
#### Returns
|
|
2711
|
+
|
|
2712
|
+
`Promise`\<\{
|
|
2713
|
+
`enabled`: `boolean`;
|
|
2714
|
+
`providerId`: `string`;
|
|
2715
|
+
\}[]\>
|
|
2716
|
+
|
|
2717
|
+
***
|
|
2718
|
+
|
|
2719
|
+
<a id="getrulesstatus"></a>
|
|
2720
|
+
|
|
2721
|
+
### getRulesStatus()
|
|
2722
|
+
|
|
2723
|
+
```ts
|
|
2724
|
+
function getRulesStatus(db: ClientDb | ClientRtdb, service?: "firestore" | "database"): Promise<unknown>;
|
|
2725
|
+
```
|
|
2726
|
+
|
|
2727
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
2728
|
+
|
|
2729
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
2730
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
2731
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
2732
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
2733
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
2734
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
2735
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
2736
|
+
|
|
2737
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
2738
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
2739
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
2740
|
+
|
|
2741
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
2742
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
2743
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
2744
|
+
|
|
2745
|
+
#### Parameters
|
|
2746
|
+
|
|
2747
|
+
| Parameter | Type |
|
|
2748
|
+
| :------ | :------ |
|
|
2749
|
+
| `db` | [`ClientDb`](#clientdb) \| [`ClientRtdb`](#clientrtdb) |
|
|
2750
|
+
| `service?` | `"firestore"` \| `"database"` |
|
|
2751
|
+
|
|
2752
|
+
#### Returns
|
|
2753
|
+
|
|
2754
|
+
`Promise`\<`unknown`\>
|
|
2755
|
+
|
|
2756
|
+
***
|
|
2757
|
+
|
|
2758
|
+
<a id="getsnapshot"></a>
|
|
2759
|
+
|
|
2760
|
+
### getSnapshot()
|
|
2761
|
+
|
|
2762
|
+
```ts
|
|
2763
|
+
function getSnapshot(db: ClientDb): Promise<SandboxSnapshot>;
|
|
2764
|
+
```
|
|
2765
|
+
|
|
2766
|
+
Export the current sandbox snapshot (Pyric Studio rules re-run). Studio forks
|
|
2767
|
+
it locally to test a denied op against edited rules or re-issue it as the
|
|
2768
|
+
attempting user, on a throwaway branch (no live mutation).
|
|
2769
|
+
|
|
2770
|
+
#### Parameters
|
|
2771
|
+
|
|
2772
|
+
| Parameter | Type |
|
|
2773
|
+
| :------ | :------ |
|
|
2774
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
2775
|
+
|
|
2776
|
+
#### Returns
|
|
2777
|
+
|
|
2778
|
+
`Promise`\<`SandboxSnapshot`\>
|
|
2779
|
+
|
|
2780
|
+
***
|
|
2781
|
+
|
|
2782
|
+
<a id="getstorage"></a>
|
|
2783
|
+
|
|
2784
|
+
### getStorage()
|
|
2785
|
+
|
|
2786
|
+
```ts
|
|
2787
|
+
function getStorage(source: string | ClientDb | URL, name?: string): ClientFirebaseStorage;
|
|
2788
|
+
```
|
|
2789
|
+
|
|
2790
|
+
Get the worker-backed Storage handle. Like `getAuth`, accepts an existing
|
|
2791
|
+
`ClientDb` (reusing its port) or a worker URL (standalone).
|
|
2792
|
+
|
|
2793
|
+
#### Parameters
|
|
2794
|
+
|
|
2795
|
+
| Parameter | Type |
|
|
2796
|
+
| :------ | :------ |
|
|
2797
|
+
| `source` | `string` \| [`ClientDb`](#clientdb) \| `URL` |
|
|
2798
|
+
| `name?` | `string` |
|
|
2799
|
+
|
|
2800
|
+
#### Returns
|
|
2801
|
+
|
|
2802
|
+
[`ClientFirebaseStorage`](#clientfirebasestorage)
|
|
2803
|
+
|
|
2804
|
+
***
|
|
2805
|
+
|
|
2806
|
+
<a id="getworkerinstanceid"></a>
|
|
2807
|
+
|
|
2808
|
+
### getWorkerInstanceId()
|
|
2809
|
+
|
|
2810
|
+
```ts
|
|
2811
|
+
function getWorkerInstanceId(db: ClientDb): Promise<string>;
|
|
2812
|
+
```
|
|
2813
|
+
|
|
2814
|
+
Ask the worker for its stable per-instance id (see host `INSTANCE_ID_KEY`).
|
|
2815
|
+
Studio renders a human-friendly form so a user can tell which sandbox instance
|
|
2816
|
+
they're looking at — the same `localhost:<port>` in a different browser profile
|
|
2817
|
+
is a SEPARATE sandbox (a separate SharedWorker + IndexedDB), and this is how
|
|
2818
|
+
the two are told apart.
|
|
2819
|
+
|
|
2820
|
+
#### Parameters
|
|
2821
|
+
|
|
2822
|
+
| Parameter | Type |
|
|
2823
|
+
| :------ | :------ |
|
|
2824
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
2825
|
+
|
|
2826
|
+
#### Returns
|
|
2827
|
+
|
|
2828
|
+
`Promise`\<`string`\>
|
|
2829
|
+
|
|
2830
|
+
***
|
|
2831
|
+
|
|
2832
|
+
<a id="getworkerversion"></a>
|
|
2833
|
+
|
|
2834
|
+
### getWorkerVersion()
|
|
2835
|
+
|
|
2836
|
+
```ts
|
|
2837
|
+
function getWorkerVersion(db: ClientDb): Promise<string>;
|
|
2838
|
+
```
|
|
2839
|
+
|
|
2840
|
+
Ask the worker for its baked build version (staleness guard). The page
|
|
2841
|
+
compares it to the served bundle version and warns when a still-running OLD
|
|
2842
|
+
worker is older than what's served (a SharedWorker can't hot-update).
|
|
2843
|
+
|
|
2844
|
+
#### Parameters
|
|
2845
|
+
|
|
2846
|
+
| Parameter | Type |
|
|
2847
|
+
| :------ | :------ |
|
|
2848
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
2849
|
+
|
|
2850
|
+
#### Returns
|
|
2851
|
+
|
|
2852
|
+
`Promise`\<`string`\>
|
|
2853
|
+
|
|
2854
|
+
***
|
|
2855
|
+
|
|
2856
|
+
<a id="importworkerstate"></a>
|
|
2857
|
+
|
|
2858
|
+
### importWorkerState()
|
|
2859
|
+
|
|
2860
|
+
```ts
|
|
2861
|
+
function importWorkerState(db: ClientDb, bundle: string): Promise<void>;
|
|
2862
|
+
```
|
|
2863
|
+
|
|
2864
|
+
Phase 2 (clobber): replace this sandbox's ENTIRE state with `bundle`.
|
|
2865
|
+
|
|
2866
|
+
#### Parameters
|
|
2867
|
+
|
|
2868
|
+
| Parameter | Type |
|
|
2869
|
+
| :------ | :------ |
|
|
2870
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
2871
|
+
| `bundle` | `string` |
|
|
2872
|
+
|
|
2873
|
+
#### Returns
|
|
2874
|
+
|
|
2875
|
+
`Promise`\<`void`\>
|
|
2876
|
+
|
|
2877
|
+
***
|
|
2878
|
+
|
|
2879
|
+
<a id="increment"></a>
|
|
2880
|
+
|
|
2881
|
+
### increment()
|
|
2882
|
+
|
|
2883
|
+
```ts
|
|
2884
|
+
function increment(n: number): SentinelMarker;
|
|
2885
|
+
```
|
|
2886
|
+
|
|
2887
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
2888
|
+
|
|
2889
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
2890
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
2891
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
2892
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
2893
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
2894
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
2895
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
2896
|
+
|
|
2897
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
2898
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
2899
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
2900
|
+
|
|
2901
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
2902
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
2903
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
2904
|
+
|
|
2905
|
+
#### Parameters
|
|
2906
|
+
|
|
2907
|
+
| Parameter | Type |
|
|
2908
|
+
| :------ | :------ |
|
|
2909
|
+
| `n` | `number` |
|
|
2910
|
+
|
|
2911
|
+
#### Returns
|
|
2912
|
+
|
|
2913
|
+
`SentinelMarker`
|
|
2914
|
+
|
|
2915
|
+
***
|
|
2916
|
+
|
|
2917
|
+
<a id="limit"></a>
|
|
2918
|
+
|
|
2919
|
+
### limit()
|
|
2920
|
+
|
|
2921
|
+
```ts
|
|
2922
|
+
function limit(n: number): QueryConstraintHandle;
|
|
2923
|
+
```
|
|
2924
|
+
|
|
2925
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
2926
|
+
|
|
2927
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
2928
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
2929
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
2930
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
2931
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
2932
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
2933
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
2934
|
+
|
|
2935
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
2936
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
2937
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
2938
|
+
|
|
2939
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
2940
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
2941
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
2942
|
+
|
|
2943
|
+
#### Parameters
|
|
2944
|
+
|
|
2945
|
+
| Parameter | Type |
|
|
2946
|
+
| :------ | :------ |
|
|
2947
|
+
| `n` | `number` |
|
|
2948
|
+
|
|
2949
|
+
#### Returns
|
|
2950
|
+
|
|
2951
|
+
`QueryConstraintHandle`
|
|
2952
|
+
|
|
2953
|
+
***
|
|
2954
|
+
|
|
2955
|
+
<a id="limittolast"></a>
|
|
2956
|
+
|
|
2957
|
+
### limitToLast()
|
|
2958
|
+
|
|
2959
|
+
```ts
|
|
2960
|
+
function limitToLast(n: number): QueryConstraintHandle;
|
|
2961
|
+
```
|
|
2962
|
+
|
|
2963
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
2964
|
+
|
|
2965
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
2966
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
2967
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
2968
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
2969
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
2970
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
2971
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
2972
|
+
|
|
2973
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
2974
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
2975
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
2976
|
+
|
|
2977
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
2978
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
2979
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
2980
|
+
|
|
2981
|
+
#### Parameters
|
|
2982
|
+
|
|
2983
|
+
| Parameter | Type |
|
|
2984
|
+
| :------ | :------ |
|
|
2985
|
+
| `n` | `number` |
|
|
2986
|
+
|
|
2987
|
+
#### Returns
|
|
2988
|
+
|
|
2989
|
+
`QueryConstraintHandle`
|
|
2990
|
+
|
|
2991
|
+
***
|
|
2992
|
+
|
|
2993
|
+
<a id="listall"></a>
|
|
2994
|
+
|
|
2995
|
+
### listAll()
|
|
2996
|
+
|
|
2997
|
+
```ts
|
|
2998
|
+
function listAll(reference: ClientStorageReference): Promise<{
|
|
2999
|
+
items: ClientStorageReference[];
|
|
3000
|
+
prefixes: ClientStorageReference[];
|
|
3001
|
+
}>;
|
|
3002
|
+
```
|
|
3003
|
+
|
|
3004
|
+
Enumerate immediate child items + sub-prefixes under a ref (Pyric Studio
|
|
3005
|
+
data browse). The host enforces `read` rules on the scanned prefix.
|
|
3006
|
+
|
|
3007
|
+
#### Parameters
|
|
3008
|
+
|
|
3009
|
+
| Parameter | Type |
|
|
3010
|
+
| :------ | :------ |
|
|
3011
|
+
| `reference` | [`ClientStorageReference`](#clientstoragereference) |
|
|
3012
|
+
|
|
3013
|
+
#### Returns
|
|
3014
|
+
|
|
3015
|
+
`Promise`\<\{
|
|
3016
|
+
`items`: [`ClientStorageReference`](#clientstoragereference)[];
|
|
3017
|
+
`prefixes`: [`ClientStorageReference`](#clientstoragereference)[];
|
|
3018
|
+
\}\>
|
|
3019
|
+
|
|
3020
|
+
***
|
|
3021
|
+
|
|
3022
|
+
<a id="listrootcollections"></a>
|
|
3023
|
+
|
|
3024
|
+
### listRootCollections()
|
|
3025
|
+
|
|
3026
|
+
```ts
|
|
3027
|
+
function listRootCollections(db: ClientDb): Promise<string[]>;
|
|
3028
|
+
```
|
|
3029
|
+
|
|
3030
|
+
Enumerate root collection ids (Pyric Studio data browse). The modular SDK has
|
|
3031
|
+
no client `listCollections`, so the host scans the sandbox keyspace and
|
|
3032
|
+
returns the ids. Lens is attached (via dataRpc) but the host enumeration is
|
|
3033
|
+
lens-independent.
|
|
3034
|
+
|
|
3035
|
+
#### Parameters
|
|
3036
|
+
|
|
3037
|
+
| Parameter | Type |
|
|
3038
|
+
| :------ | :------ |
|
|
3039
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
3040
|
+
|
|
3041
|
+
#### Returns
|
|
3042
|
+
|
|
3043
|
+
`Promise`\<`string`[]\>
|
|
3044
|
+
|
|
3045
|
+
***
|
|
3046
|
+
|
|
3047
|
+
<a id="listsubcollections"></a>
|
|
3048
|
+
|
|
3049
|
+
### listSubcollections()
|
|
3050
|
+
|
|
3051
|
+
```ts
|
|
3052
|
+
function listSubcollections(db: ClientDb, docPath: string): Promise<string[]>;
|
|
3053
|
+
```
|
|
3054
|
+
|
|
3055
|
+
Enumerate subcollection ids under a document path (Pyric Studio data browse).
|
|
3056
|
+
|
|
3057
|
+
#### Parameters
|
|
3058
|
+
|
|
3059
|
+
| Parameter | Type |
|
|
3060
|
+
| :------ | :------ |
|
|
3061
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
3062
|
+
| `docPath` | `string` |
|
|
3063
|
+
|
|
3064
|
+
#### Returns
|
|
3065
|
+
|
|
3066
|
+
`Promise`\<`string`[]\>
|
|
3067
|
+
|
|
3068
|
+
***
|
|
3069
|
+
|
|
3070
|
+
<a id="listusers"></a>
|
|
3071
|
+
|
|
3072
|
+
### listUsers()
|
|
3073
|
+
|
|
3074
|
+
```ts
|
|
3075
|
+
function listUsers(auth: ClientAuth): Promise<AuthUserRecord[]>;
|
|
3076
|
+
```
|
|
3077
|
+
|
|
3078
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
3079
|
+
|
|
3080
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
3081
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
3082
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
3083
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
3084
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
3085
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
3086
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
3087
|
+
|
|
3088
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
3089
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
3090
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
3091
|
+
|
|
3092
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
3093
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
3094
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
3095
|
+
|
|
3096
|
+
#### Parameters
|
|
3097
|
+
|
|
3098
|
+
| Parameter | Type |
|
|
3099
|
+
| :------ | :------ |
|
|
3100
|
+
| `auth` | [`ClientAuth`](#clientauth) |
|
|
3101
|
+
|
|
3102
|
+
#### Returns
|
|
3103
|
+
|
|
3104
|
+
`Promise`\<`AuthUserRecord`[]\>
|
|
3105
|
+
|
|
3106
|
+
***
|
|
3107
|
+
|
|
3108
|
+
<a id="listworkerbranches"></a>
|
|
3109
|
+
|
|
3110
|
+
### listWorkerBranches()
|
|
3111
|
+
|
|
3112
|
+
```ts
|
|
3113
|
+
function listWorkerBranches(db: ClientDb): Promise<string[]>;
|
|
3114
|
+
```
|
|
3115
|
+
|
|
3116
|
+
Phase 3: list this instance's saved branch names.
|
|
3117
|
+
|
|
3118
|
+
#### Parameters
|
|
3119
|
+
|
|
3120
|
+
| Parameter | Type |
|
|
3121
|
+
| :------ | :------ |
|
|
3122
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
3123
|
+
|
|
3124
|
+
#### Returns
|
|
3125
|
+
|
|
3126
|
+
`Promise`\<`string`[]\>
|
|
3127
|
+
|
|
3128
|
+
***
|
|
3129
|
+
|
|
3130
|
+
<a id="mintpresenceclientid"></a>
|
|
3131
|
+
|
|
3132
|
+
### mintPresenceClientId()
|
|
3133
|
+
|
|
3134
|
+
```ts
|
|
3135
|
+
function mintPresenceClientId(): string;
|
|
3136
|
+
```
|
|
3137
|
+
|
|
3138
|
+
Mint a random client id (page-lifetime).
|
|
3139
|
+
|
|
3140
|
+
#### Returns
|
|
3141
|
+
|
|
3142
|
+
`string`
|
|
3143
|
+
|
|
3144
|
+
***
|
|
3145
|
+
|
|
3146
|
+
<a id="onauthstatechanged"></a>
|
|
3147
|
+
|
|
3148
|
+
### onAuthStateChanged()
|
|
3149
|
+
|
|
3150
|
+
```ts
|
|
3151
|
+
function onAuthStateChanged(auth: ClientAuth, callback: (user: ClientUser) => void): Unsubscribe;
|
|
3152
|
+
```
|
|
3153
|
+
|
|
3154
|
+
Subscribe to auth-state changes. Mirrors `firebase/auth`'s
|
|
3155
|
+
`onAuthStateChanged`. Fires immediately with THIS PORT's current session,
|
|
3156
|
+
then on every change to it (#754: sessions are per-port — another tab's
|
|
3157
|
+
sign-in is a different user, not an update to this one). Updates the
|
|
3158
|
+
handle's `currentUser` mirror before invoking the callback.
|
|
3159
|
+
|
|
3160
|
+
#### Parameters
|
|
3161
|
+
|
|
3162
|
+
| Parameter | Type |
|
|
3163
|
+
| :------ | :------ |
|
|
3164
|
+
| `auth` | [`ClientAuth`](#clientauth) |
|
|
3165
|
+
| `callback` | (`user`: [`ClientUser`](#clientuser)) => `void` |
|
|
3166
|
+
|
|
3167
|
+
#### Returns
|
|
3168
|
+
|
|
3169
|
+
[`Unsubscribe`](#unsubscribe)
|
|
3170
|
+
|
|
3171
|
+
***
|
|
3172
|
+
|
|
3173
|
+
<a id="onidtokenchanged"></a>
|
|
3174
|
+
|
|
3175
|
+
### onIdTokenChanged()
|
|
3176
|
+
|
|
3177
|
+
```ts
|
|
3178
|
+
function onIdTokenChanged(auth: ClientAuth, callback: (user: ClientUser) => void): Unsubscribe;
|
|
3179
|
+
```
|
|
3180
|
+
|
|
3181
|
+
Subscribe to ID-token changes. Mirrors `firebase/auth`'s
|
|
3182
|
+
`onIdTokenChanged` — fires on THIS PORT's identity transitions (per-port
|
|
3183
|
+
sessions, #754).
|
|
3184
|
+
|
|
3185
|
+
#### Parameters
|
|
3186
|
+
|
|
3187
|
+
| Parameter | Type |
|
|
3188
|
+
| :------ | :------ |
|
|
3189
|
+
| `auth` | [`ClientAuth`](#clientauth) |
|
|
3190
|
+
| `callback` | (`user`: [`ClientUser`](#clientuser)) => `void` |
|
|
3191
|
+
|
|
3192
|
+
#### Returns
|
|
3193
|
+
|
|
3194
|
+
[`Unsubscribe`](#unsubscribe)
|
|
3195
|
+
|
|
3196
|
+
***
|
|
3197
|
+
|
|
3198
|
+
<a id="onsnapshot"></a>
|
|
3199
|
+
|
|
3200
|
+
### onSnapshot()
|
|
3201
|
+
|
|
3202
|
+
```ts
|
|
3203
|
+
function onSnapshot(
|
|
3204
|
+
target:
|
|
3205
|
+
| DocRefHandle
|
|
3206
|
+
| CollRefHandle
|
|
3207
|
+
| QueryHandle,
|
|
3208
|
+
callback: (snap:
|
|
3209
|
+
| ClientDocSnapshot
|
|
3210
|
+
| ClientQuerySnapshot) => void,
|
|
3211
|
+
errorCallback?: (err: unknown) => void): Unsubscribe;
|
|
3212
|
+
```
|
|
3213
|
+
|
|
3214
|
+
Subscribe to a document or query. Mirrors `pyric/firestore`'s `onSnapshot`.
|
|
3215
|
+
|
|
3216
|
+
Returns an `unsub` function. Sends `{ t:'unsub', subId }` to the worker
|
|
3217
|
+
to deregister the listener on the worker side.
|
|
3218
|
+
|
|
3219
|
+
#### Parameters
|
|
3220
|
+
|
|
3221
|
+
| Parameter | Type |
|
|
3222
|
+
| :------ | :------ |
|
|
3223
|
+
| `target` | \| [`DocRefHandle`](#docrefhandle) \| [`CollRefHandle`](#collrefhandle) \| [`QueryHandle`](#queryhandle) |
|
|
3224
|
+
| `callback` | (`snap`: \| [`ClientDocSnapshot`](#clientdocsnapshot) \| [`ClientQuerySnapshot`](#clientquerysnapshot)) => `void` |
|
|
3225
|
+
| `errorCallback?` | (`err`: `unknown`) => `void` |
|
|
3226
|
+
|
|
3227
|
+
#### Returns
|
|
3228
|
+
|
|
3229
|
+
[`Unsubscribe`](#unsubscribe)
|
|
3230
|
+
|
|
3231
|
+
***
|
|
3232
|
+
|
|
3233
|
+
<a id="or"></a>
|
|
3234
|
+
|
|
3235
|
+
### or()
|
|
3236
|
+
|
|
3237
|
+
```ts
|
|
3238
|
+
function or(...filters: QueryConstraintHandle[]): QueryConstraintHandle;
|
|
3239
|
+
```
|
|
3240
|
+
|
|
3241
|
+
OR composite filter — at least one operand must match. Operands must be
|
|
3242
|
+
filters (`where()`, or nested `or()`/`and()`). Mirrors `pyric/firestore`'s
|
|
3243
|
+
`or(...)`; the worker rebuilds it with the real modular factory.
|
|
3244
|
+
|
|
3245
|
+
#### Parameters
|
|
3246
|
+
|
|
3247
|
+
| Parameter | Type |
|
|
3248
|
+
| :------ | :------ |
|
|
3249
|
+
| ...`filters` | `QueryConstraintHandle`[] |
|
|
3250
|
+
|
|
3251
|
+
#### Returns
|
|
3252
|
+
|
|
3253
|
+
`QueryConstraintHandle`
|
|
3254
|
+
|
|
3255
|
+
***
|
|
3256
|
+
|
|
3257
|
+
<a id="orderby"></a>
|
|
3258
|
+
|
|
3259
|
+
### orderBy()
|
|
3260
|
+
|
|
3261
|
+
```ts
|
|
3262
|
+
function orderBy(field: string, direction?: "asc" | "desc"): QueryConstraintHandle;
|
|
3263
|
+
```
|
|
3264
|
+
|
|
3265
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
3266
|
+
|
|
3267
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
3268
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
3269
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
3270
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
3271
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
3272
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
3273
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
3274
|
+
|
|
3275
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
3276
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
3277
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
3278
|
+
|
|
3279
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
3280
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
3281
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
3282
|
+
|
|
3283
|
+
#### Parameters
|
|
3284
|
+
|
|
3285
|
+
| Parameter | Type |
|
|
3286
|
+
| :------ | :------ |
|
|
3287
|
+
| `field` | `string` |
|
|
3288
|
+
| `direction?` | `"asc"` \| `"desc"` |
|
|
3289
|
+
|
|
3290
|
+
#### Returns
|
|
3291
|
+
|
|
3292
|
+
`QueryConstraintHandle`
|
|
3293
|
+
|
|
3294
|
+
***
|
|
3295
|
+
|
|
3296
|
+
<a id="query"></a>
|
|
3297
|
+
|
|
3298
|
+
### query()
|
|
3299
|
+
|
|
3300
|
+
```ts
|
|
3301
|
+
function query(source: CollRefHandle | QueryHandle, ...constraints: QueryConstraintHandle[]): QueryHandle;
|
|
3302
|
+
```
|
|
3303
|
+
|
|
3304
|
+
Apply query constraints to a source ref or query.
|
|
3305
|
+
Mirrors `pyric/firestore`'s `query(source, ...constraints)`.
|
|
3306
|
+
|
|
3307
|
+
#### Parameters
|
|
3308
|
+
|
|
3309
|
+
| Parameter | Type |
|
|
3310
|
+
| :------ | :------ |
|
|
3311
|
+
| `source` | [`CollRefHandle`](#collrefhandle) \| [`QueryHandle`](#queryhandle) |
|
|
3312
|
+
| ...`constraints` | `QueryConstraintHandle`[] |
|
|
3313
|
+
|
|
3314
|
+
#### Returns
|
|
3315
|
+
|
|
3316
|
+
[`QueryHandle`](#queryhandle)
|
|
3317
|
+
|
|
3318
|
+
***
|
|
3319
|
+
|
|
3320
|
+
<a id="ref-2"></a>
|
|
3321
|
+
|
|
3322
|
+
### ref()
|
|
3323
|
+
|
|
3324
|
+
```ts
|
|
3325
|
+
function ref(parent:
|
|
3326
|
+
| ClientFirebaseStorage
|
|
3327
|
+
| ClientStorageReference, path?: string): ClientStorageReference;
|
|
3328
|
+
```
|
|
3329
|
+
|
|
3330
|
+
Build a Storage reference. Mirrors `pyric/storage`'s `ref(storage, path?)` /
|
|
3331
|
+
`ref(parentRef, path)`. Client-side path math; no RPC.
|
|
3332
|
+
|
|
3333
|
+
#### Parameters
|
|
3334
|
+
|
|
3335
|
+
| Parameter | Type |
|
|
3336
|
+
| :------ | :------ |
|
|
3337
|
+
| `parent` | \| [`ClientFirebaseStorage`](#clientfirebasestorage) \| [`ClientStorageReference`](#clientstoragereference) |
|
|
3338
|
+
| `path?` | `string` |
|
|
3339
|
+
|
|
3340
|
+
#### Returns
|
|
3341
|
+
|
|
3342
|
+
[`ClientStorageReference`](#clientstoragereference)
|
|
3343
|
+
|
|
3344
|
+
***
|
|
3345
|
+
|
|
3346
|
+
<a id="relayworkerop"></a>
|
|
3347
|
+
|
|
3348
|
+
### relayWorkerOp()
|
|
3349
|
+
|
|
3350
|
+
```ts
|
|
3351
|
+
function relayWorkerOp(db: ClientDb, op: WorkerOpPayload): Promise<unknown>;
|
|
3352
|
+
```
|
|
3353
|
+
|
|
3354
|
+
Relay one raw worker-protocol op into the SharedWorker. `op` is the op
|
|
3355
|
+
message minus `t`/`id` (the `WorkerOpPayload` wire shape); resolves with
|
|
3356
|
+
the worker's `res.value`, rejects with an Error carrying `.code`.
|
|
3357
|
+
|
|
3358
|
+
#### Parameters
|
|
3359
|
+
|
|
3360
|
+
| Parameter | Type |
|
|
3361
|
+
| :------ | :------ |
|
|
3362
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
3363
|
+
| `op` | `WorkerOpPayload` |
|
|
3364
|
+
|
|
3365
|
+
#### Returns
|
|
3366
|
+
|
|
3367
|
+
`Promise`\<`unknown`\>
|
|
3368
|
+
|
|
3369
|
+
***
|
|
3370
|
+
|
|
3371
|
+
<a id="relayworkersub"></a>
|
|
3372
|
+
|
|
3373
|
+
### relayWorkerSub()
|
|
3374
|
+
|
|
3375
|
+
```ts
|
|
3376
|
+
function relayWorkerSub(
|
|
3377
|
+
db: ClientDb,
|
|
3378
|
+
sub: WorkerSubPayload,
|
|
3379
|
+
onValue: (value: unknown) => void): () => void;
|
|
3380
|
+
```
|
|
3381
|
+
|
|
3382
|
+
Relay a raw worker-protocol subscription into the SharedWorker. `sub` is
|
|
3383
|
+
the sub message minus `t`/`subId` (the `WorkerSubPayload` wire shape).
|
|
3384
|
+
`onValue` receives every snap value VERBATIM — including the worker host's
|
|
3385
|
+
`{ __error: { code, message } }` establishment-failure convention (listener
|
|
3386
|
+
errors are re-wrapped into the same shape so the far side sees one form).
|
|
3387
|
+
Returns the unsubscribe function.
|
|
3388
|
+
|
|
3389
|
+
The unified event stream (`target: 'events'`) is NOT relayable yet — its
|
|
3390
|
+
history batches aren't coalescible, so it needs bounded backpressure first
|
|
3391
|
+
(slice 2).
|
|
3392
|
+
|
|
3393
|
+
#### Parameters
|
|
3394
|
+
|
|
3395
|
+
| Parameter | Type |
|
|
3396
|
+
| :------ | :------ |
|
|
3397
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
3398
|
+
| `sub` | `WorkerSubPayload` |
|
|
3399
|
+
| `onValue` | (`value`: `unknown`) => `void` |
|
|
3400
|
+
|
|
3401
|
+
#### Returns
|
|
3402
|
+
|
|
3403
|
+
```ts
|
|
3404
|
+
(): void;
|
|
3405
|
+
```
|
|
3406
|
+
|
|
3407
|
+
##### Returns
|
|
3408
|
+
|
|
3409
|
+
`void`
|
|
3410
|
+
|
|
3411
|
+
***
|
|
3412
|
+
|
|
3413
|
+
<a id="rtdbchild"></a>
|
|
3414
|
+
|
|
3415
|
+
### rtdbChild()
|
|
3416
|
+
|
|
3417
|
+
```ts
|
|
3418
|
+
function rtdbChild(parent: RtdbRefHandle, path: string): RtdbRefHandle;
|
|
3419
|
+
```
|
|
3420
|
+
|
|
3421
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
3422
|
+
|
|
3423
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
3424
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
3425
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
3426
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
3427
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
3428
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
3429
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
3430
|
+
|
|
3431
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
3432
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
3433
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
3434
|
+
|
|
3435
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
3436
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
3437
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
3438
|
+
|
|
3439
|
+
#### Parameters
|
|
3440
|
+
|
|
3441
|
+
| Parameter | Type |
|
|
3442
|
+
| :------ | :------ |
|
|
3443
|
+
| `parent` | [`RtdbRefHandle`](#rtdbrefhandle) |
|
|
3444
|
+
| `path` | `string` |
|
|
3445
|
+
|
|
3446
|
+
#### Returns
|
|
3447
|
+
|
|
3448
|
+
[`RtdbRefHandle`](#rtdbrefhandle)
|
|
3449
|
+
|
|
3450
|
+
***
|
|
3451
|
+
|
|
3452
|
+
<a id="rtdbconnectdatabaseemulator"></a>
|
|
3453
|
+
|
|
3454
|
+
### rtdbConnectDatabaseEmulator()
|
|
3455
|
+
|
|
3456
|
+
```ts
|
|
3457
|
+
function rtdbConnectDatabaseEmulator(): void;
|
|
3458
|
+
```
|
|
3459
|
+
|
|
3460
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
3461
|
+
|
|
3462
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
3463
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
3464
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
3465
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
3466
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
3467
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
3468
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
3469
|
+
|
|
3470
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
3471
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
3472
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
3473
|
+
|
|
3474
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
3475
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
3476
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
3477
|
+
|
|
3478
|
+
#### Returns
|
|
3479
|
+
|
|
3480
|
+
`void`
|
|
3481
|
+
|
|
3482
|
+
***
|
|
3483
|
+
|
|
3484
|
+
<a id="rtdbget"></a>
|
|
3485
|
+
|
|
3486
|
+
### rtdbGet()
|
|
3487
|
+
|
|
3488
|
+
```ts
|
|
3489
|
+
function rtdbGet(r: RtdbRefHandle): Promise<RtdbDataSnapshot>;
|
|
3490
|
+
```
|
|
3491
|
+
|
|
3492
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
3493
|
+
|
|
3494
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
3495
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
3496
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
3497
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
3498
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
3499
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
3500
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
3501
|
+
|
|
3502
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
3503
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
3504
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
3505
|
+
|
|
3506
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
3507
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
3508
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
3509
|
+
|
|
3510
|
+
#### Parameters
|
|
3511
|
+
|
|
3512
|
+
| Parameter | Type |
|
|
3513
|
+
| :------ | :------ |
|
|
3514
|
+
| `r` | [`RtdbRefHandle`](#rtdbrefhandle) |
|
|
3515
|
+
|
|
3516
|
+
#### Returns
|
|
3517
|
+
|
|
3518
|
+
`Promise`\<[`RtdbDataSnapshot`](#rtdbdatasnapshot)\>
|
|
3519
|
+
|
|
3520
|
+
***
|
|
3521
|
+
|
|
3522
|
+
<a id="rtdbgetdatabase"></a>
|
|
3523
|
+
|
|
3524
|
+
### rtdbGetDatabase()
|
|
3525
|
+
|
|
3526
|
+
```ts
|
|
3527
|
+
function rtdbGetDatabase(source?: string | ClientDb | URL, name?: string): ClientRtdb;
|
|
3528
|
+
```
|
|
3529
|
+
|
|
3530
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
3531
|
+
|
|
3532
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
3533
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
3534
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
3535
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
3536
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
3537
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
3538
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
3539
|
+
|
|
3540
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
3541
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
3542
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
3543
|
+
|
|
3544
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
3545
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
3546
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
3547
|
+
|
|
3548
|
+
#### Parameters
|
|
3549
|
+
|
|
3550
|
+
| Parameter | Type |
|
|
3551
|
+
| :------ | :------ |
|
|
3552
|
+
| `source?` | `string` \| [`ClientDb`](#clientdb) \| `URL` |
|
|
3553
|
+
| `name?` | `string` |
|
|
3554
|
+
|
|
3555
|
+
#### Returns
|
|
3556
|
+
|
|
3557
|
+
[`ClientRtdb`](#clientrtdb)
|
|
3558
|
+
|
|
3559
|
+
***
|
|
3560
|
+
|
|
3561
|
+
<a id="rtdboff"></a>
|
|
3562
|
+
|
|
3563
|
+
### rtdbOff()
|
|
3564
|
+
|
|
3565
|
+
```ts
|
|
3566
|
+
function rtdbOff(
|
|
3567
|
+
_r: RtdbRefHandle,
|
|
3568
|
+
_eventType?: unknown,
|
|
3569
|
+
_callback?: unknown): void;
|
|
3570
|
+
```
|
|
3571
|
+
|
|
3572
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
3573
|
+
|
|
3574
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
3575
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
3576
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
3577
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
3578
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
3579
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
3580
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
3581
|
+
|
|
3582
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
3583
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
3584
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
3585
|
+
|
|
3586
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
3587
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
3588
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
3589
|
+
|
|
3590
|
+
#### Parameters
|
|
3591
|
+
|
|
3592
|
+
| Parameter | Type |
|
|
3593
|
+
| :------ | :------ |
|
|
3594
|
+
| `_r` | [`RtdbRefHandle`](#rtdbrefhandle) |
|
|
3595
|
+
| `_eventType?` | `unknown` |
|
|
3596
|
+
| `_callback?` | `unknown` |
|
|
3597
|
+
|
|
3598
|
+
#### Returns
|
|
3599
|
+
|
|
3600
|
+
`void`
|
|
3601
|
+
|
|
3602
|
+
***
|
|
3603
|
+
|
|
3604
|
+
<a id="rtdbonvalue"></a>
|
|
3605
|
+
|
|
3606
|
+
### rtdbOnValue()
|
|
3607
|
+
|
|
3608
|
+
```ts
|
|
3609
|
+
function rtdbOnValue(
|
|
3610
|
+
r: RtdbRefHandle,
|
|
3611
|
+
next: (snap: RtdbDataSnapshot) => void,
|
|
3612
|
+
error?: (err: unknown) => void): Unsubscribe;
|
|
3613
|
+
```
|
|
3614
|
+
|
|
3615
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
3616
|
+
|
|
3617
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
3618
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
3619
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
3620
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
3621
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
3622
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
3623
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
3624
|
+
|
|
3625
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
3626
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
3627
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
3628
|
+
|
|
3629
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
3630
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
3631
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
3632
|
+
|
|
3633
|
+
#### Parameters
|
|
3634
|
+
|
|
3635
|
+
| Parameter | Type |
|
|
3636
|
+
| :------ | :------ |
|
|
3637
|
+
| `r` | [`RtdbRefHandle`](#rtdbrefhandle) |
|
|
3638
|
+
| `next` | (`snap`: [`RtdbDataSnapshot`](#rtdbdatasnapshot)) => `void` |
|
|
3639
|
+
| `error?` | (`err`: `unknown`) => `void` |
|
|
3640
|
+
|
|
3641
|
+
#### Returns
|
|
3642
|
+
|
|
3643
|
+
[`Unsubscribe`](#unsubscribe)
|
|
3644
|
+
|
|
3645
|
+
***
|
|
3646
|
+
|
|
3647
|
+
<a id="rtdbpush"></a>
|
|
3648
|
+
|
|
3649
|
+
### rtdbPush()
|
|
3650
|
+
|
|
3651
|
+
```ts
|
|
3652
|
+
function rtdbPush(r: RtdbRefHandle, value?: unknown): RtdbRefHandle & PromiseLike<RtdbRefHandle>;
|
|
3653
|
+
```
|
|
3654
|
+
|
|
3655
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
3656
|
+
|
|
3657
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
3658
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
3659
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
3660
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
3661
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
3662
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
3663
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
3664
|
+
|
|
3665
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
3666
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
3667
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
3668
|
+
|
|
3669
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
3670
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
3671
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
3672
|
+
|
|
3673
|
+
#### Parameters
|
|
3674
|
+
|
|
3675
|
+
| Parameter | Type |
|
|
3676
|
+
| :------ | :------ |
|
|
3677
|
+
| `r` | [`RtdbRefHandle`](#rtdbrefhandle) |
|
|
3678
|
+
| `value?` | `unknown` |
|
|
3679
|
+
|
|
3680
|
+
#### Returns
|
|
3681
|
+
|
|
3682
|
+
[`RtdbRefHandle`](#rtdbrefhandle) & `PromiseLike`\<[`RtdbRefHandle`](#rtdbrefhandle)\>
|
|
3683
|
+
|
|
3684
|
+
***
|
|
3685
|
+
|
|
3686
|
+
<a id="rtdbref"></a>
|
|
3687
|
+
|
|
3688
|
+
### rtdbRef()
|
|
3689
|
+
|
|
3690
|
+
```ts
|
|
3691
|
+
function rtdbRef(db: ClientRtdb, path?: string): RtdbRefHandle;
|
|
3692
|
+
```
|
|
3693
|
+
|
|
3694
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
3695
|
+
|
|
3696
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
3697
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
3698
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
3699
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
3700
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
3701
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
3702
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
3703
|
+
|
|
3704
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
3705
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
3706
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
3707
|
+
|
|
3708
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
3709
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
3710
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
3711
|
+
|
|
3712
|
+
#### Parameters
|
|
3713
|
+
|
|
3714
|
+
| Parameter | Type |
|
|
3715
|
+
| :------ | :------ |
|
|
3716
|
+
| `db` | [`ClientRtdb`](#clientrtdb) |
|
|
3717
|
+
| `path?` | `string` |
|
|
3718
|
+
|
|
3719
|
+
#### Returns
|
|
3720
|
+
|
|
3721
|
+
[`RtdbRefHandle`](#rtdbrefhandle)
|
|
3722
|
+
|
|
3723
|
+
***
|
|
3724
|
+
|
|
3725
|
+
<a id="rtdbremove"></a>
|
|
3726
|
+
|
|
3727
|
+
### rtdbRemove()
|
|
3728
|
+
|
|
3729
|
+
```ts
|
|
3730
|
+
function rtdbRemove(r: RtdbRefHandle): Promise<void>;
|
|
3731
|
+
```
|
|
3732
|
+
|
|
3733
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
3734
|
+
|
|
3735
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
3736
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
3737
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
3738
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
3739
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
3740
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
3741
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
3742
|
+
|
|
3743
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
3744
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
3745
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
3746
|
+
|
|
3747
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
3748
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
3749
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
3750
|
+
|
|
3751
|
+
#### Parameters
|
|
3752
|
+
|
|
3753
|
+
| Parameter | Type |
|
|
3754
|
+
| :------ | :------ |
|
|
3755
|
+
| `r` | [`RtdbRefHandle`](#rtdbrefhandle) |
|
|
3756
|
+
|
|
3757
|
+
#### Returns
|
|
3758
|
+
|
|
3759
|
+
`Promise`\<`void`\>
|
|
3760
|
+
|
|
3761
|
+
***
|
|
3762
|
+
|
|
3763
|
+
<a id="rtdbservertimestamp"></a>
|
|
3764
|
+
|
|
3765
|
+
### rtdbServerTimestamp()
|
|
3766
|
+
|
|
3767
|
+
```ts
|
|
3768
|
+
function rtdbServerTimestamp(): {
|
|
3769
|
+
};
|
|
3770
|
+
```
|
|
3771
|
+
|
|
3772
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
3773
|
+
|
|
3774
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
3775
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
3776
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
3777
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
3778
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
3779
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
3780
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
3781
|
+
|
|
3782
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
3783
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
3784
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
3785
|
+
|
|
3786
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
3787
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
3788
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
3789
|
+
|
|
3790
|
+
#### Returns
|
|
3791
|
+
|
|
3792
|
+
```ts
|
|
3793
|
+
{
|
|
3794
|
+
}
|
|
3795
|
+
```
|
|
3796
|
+
|
|
3797
|
+
***
|
|
3798
|
+
|
|
3799
|
+
<a id="rtdbset"></a>
|
|
3800
|
+
|
|
3801
|
+
### rtdbSet()
|
|
3802
|
+
|
|
3803
|
+
```ts
|
|
3804
|
+
function rtdbSet(r: RtdbRefHandle, value: unknown): Promise<void>;
|
|
3805
|
+
```
|
|
3806
|
+
|
|
3807
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
3808
|
+
|
|
3809
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
3810
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
3811
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
3812
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
3813
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
3814
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
3815
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
3816
|
+
|
|
3817
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
3818
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
3819
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
3820
|
+
|
|
3821
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
3822
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
3823
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
3824
|
+
|
|
3825
|
+
#### Parameters
|
|
3826
|
+
|
|
3827
|
+
| Parameter | Type |
|
|
3828
|
+
| :------ | :------ |
|
|
3829
|
+
| `r` | [`RtdbRefHandle`](#rtdbrefhandle) |
|
|
3830
|
+
| `value` | `unknown` |
|
|
3831
|
+
|
|
3832
|
+
#### Returns
|
|
3833
|
+
|
|
3834
|
+
`Promise`\<`void`\>
|
|
3835
|
+
|
|
3836
|
+
***
|
|
3837
|
+
|
|
3838
|
+
<a id="rtdbupdate"></a>
|
|
3839
|
+
|
|
3840
|
+
### rtdbUpdate()
|
|
3841
|
+
|
|
3842
|
+
```ts
|
|
3843
|
+
function rtdbUpdate(r: RtdbRefHandle, values: Record<string, unknown>): Promise<void>;
|
|
3844
|
+
```
|
|
3845
|
+
|
|
3846
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
3847
|
+
|
|
3848
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
3849
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
3850
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
3851
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
3852
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
3853
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
3854
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
3855
|
+
|
|
3856
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
3857
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
3858
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
3859
|
+
|
|
3860
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
3861
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
3862
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
3863
|
+
|
|
3864
|
+
#### Parameters
|
|
3865
|
+
|
|
3866
|
+
| Parameter | Type |
|
|
3867
|
+
| :------ | :------ |
|
|
3868
|
+
| `r` | [`RtdbRefHandle`](#rtdbrefhandle) |
|
|
3869
|
+
| `values` | `Record`\<`string`, `unknown`\> |
|
|
3870
|
+
|
|
3871
|
+
#### Returns
|
|
3872
|
+
|
|
3873
|
+
`Promise`\<`void`\>
|
|
3874
|
+
|
|
3875
|
+
***
|
|
3876
|
+
|
|
3877
|
+
<a id="runtransaction"></a>
|
|
3878
|
+
|
|
3879
|
+
### runTransaction()
|
|
3880
|
+
|
|
3881
|
+
```ts
|
|
3882
|
+
function runTransaction<R>(db: ClientDb, updateFn: (txn: ClientTransaction) => R | Promise<R>): Promise<R>;
|
|
3883
|
+
```
|
|
3884
|
+
|
|
3885
|
+
Run a transaction. Mirrors `pyric/firestore`'s `runTransaction(db, fn)`.
|
|
3886
|
+
|
|
3887
|
+
MULTI-TAB CORRECTNESS — READ-SET VALIDATION + RETRY
|
|
3888
|
+
----------------------------------------------------
|
|
3889
|
+
A transaction spans two messages: the `txn.get` RPC (read) and the
|
|
3890
|
+
`txnCommit` RPC (commit). Between those two messages another tab may
|
|
3891
|
+
write to a doc the current tab read — a silent lost update without
|
|
3892
|
+
validation. We fix this the standard way:
|
|
3893
|
+
|
|
3894
|
+
1. Each `txn.get(ref)` records `{ path, data }` in a per-attempt
|
|
3895
|
+
read-set (`data` is the raw `SerializedDocData` the worker
|
|
3896
|
+
returned, or `null` if the doc was missing).
|
|
3897
|
+
2. `txnCommit` carries both `reads` (the read-set) and `writes`.
|
|
3898
|
+
3. The worker re-reads each doc inside a sandbox transaction, re-
|
|
3899
|
+
serializes it the same way, and compares the JSON strings.
|
|
3900
|
+
Any mismatch → `{ ok: false, error: { code: 'aborted' } }`.
|
|
3901
|
+
4. On `aborted`, the client discards the result of `updateFn` and
|
|
3902
|
+
re-runs it with a fresh transaction object (fresh reads, empty
|
|
3903
|
+
write buffer). Up to `TXN_MAX_ATTEMPTS` attempts are made.
|
|
3904
|
+
5. After the cap, throws an error with `.code === 'aborted'`.
|
|
3905
|
+
|
|
3906
|
+
This matches real Firestore's behaviour: the SDK retries `updateFn`
|
|
3907
|
+
on conflict rather than surfacing the error immediately.
|
|
3908
|
+
|
|
3909
|
+
#### Type Parameters
|
|
3910
|
+
|
|
3911
|
+
| Type Parameter |
|
|
3912
|
+
| :------ |
|
|
3913
|
+
| `R` |
|
|
3914
|
+
|
|
3915
|
+
#### Parameters
|
|
3916
|
+
|
|
3917
|
+
| Parameter | Type |
|
|
3918
|
+
| :------ | :------ |
|
|
3919
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
3920
|
+
| `updateFn` | (`txn`: [`ClientTransaction`](#clienttransaction)) => `R` \| `Promise`\<`R`\> |
|
|
3921
|
+
|
|
3922
|
+
#### Returns
|
|
3923
|
+
|
|
3924
|
+
`Promise`\<`R`\>
|
|
3925
|
+
|
|
3926
|
+
***
|
|
3927
|
+
|
|
3928
|
+
<a id="saveworkerbranch"></a>
|
|
3929
|
+
|
|
3930
|
+
### saveWorkerBranch()
|
|
3931
|
+
|
|
3932
|
+
```ts
|
|
3933
|
+
function saveWorkerBranch(db: ClientDb, name: string): Promise<void>;
|
|
3934
|
+
```
|
|
3935
|
+
|
|
3936
|
+
Phase 3: save the live sandbox as a named branch (a saved state bundle).
|
|
3937
|
+
|
|
3938
|
+
#### Parameters
|
|
3939
|
+
|
|
3940
|
+
| Parameter | Type |
|
|
3941
|
+
| :------ | :------ |
|
|
3942
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
3943
|
+
| `name` | `string` |
|
|
3944
|
+
|
|
3945
|
+
#### Returns
|
|
3946
|
+
|
|
3947
|
+
`Promise`\<`void`\>
|
|
3948
|
+
|
|
3949
|
+
***
|
|
3950
|
+
|
|
3951
|
+
<a id="servertimestamp"></a>
|
|
3952
|
+
|
|
3953
|
+
### serverTimestamp()
|
|
3954
|
+
|
|
3955
|
+
```ts
|
|
3956
|
+
function serverTimestamp(): SentinelMarker;
|
|
3957
|
+
```
|
|
3958
|
+
|
|
3959
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
3960
|
+
|
|
3961
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
3962
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
3963
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
3964
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
3965
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
3966
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
3967
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
3968
|
+
|
|
3969
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
3970
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
3971
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
3972
|
+
|
|
3973
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
3974
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
3975
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
3976
|
+
|
|
3977
|
+
#### Returns
|
|
3978
|
+
|
|
3979
|
+
`SentinelMarker`
|
|
3980
|
+
|
|
3981
|
+
***
|
|
3982
|
+
|
|
3983
|
+
<a id="setdatabaserules"></a>
|
|
3984
|
+
|
|
3985
|
+
### setDatabaseRules()
|
|
3986
|
+
|
|
3987
|
+
```ts
|
|
3988
|
+
function setDatabaseRules(db: ClientDb | ClientRtdb, source: unknown): Promise<{
|
|
3989
|
+
messages: unknown[];
|
|
3990
|
+
ok: boolean;
|
|
3991
|
+
}>;
|
|
3992
|
+
```
|
|
3993
|
+
|
|
3994
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
3995
|
+
|
|
3996
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
3997
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
3998
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
3999
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
4000
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
4001
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
4002
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
4003
|
+
|
|
4004
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
4005
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
4006
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
4007
|
+
|
|
4008
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
4009
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
4010
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
4011
|
+
|
|
4012
|
+
#### Parameters
|
|
4013
|
+
|
|
4014
|
+
| Parameter | Type |
|
|
4015
|
+
| :------ | :------ |
|
|
4016
|
+
| `db` | [`ClientDb`](#clientdb) \| [`ClientRtdb`](#clientrtdb) |
|
|
4017
|
+
| `source` | `unknown` |
|
|
4018
|
+
|
|
4019
|
+
#### Returns
|
|
4020
|
+
|
|
4021
|
+
`Promise`\<\{
|
|
4022
|
+
`messages`: `unknown`[];
|
|
4023
|
+
`ok`: `boolean`;
|
|
4024
|
+
\}\>
|
|
4025
|
+
|
|
4026
|
+
***
|
|
4027
|
+
|
|
4028
|
+
<a id="setdoc"></a>
|
|
4029
|
+
|
|
4030
|
+
### setDoc()
|
|
4031
|
+
|
|
4032
|
+
```ts
|
|
4033
|
+
function setDoc(
|
|
4034
|
+
ref: DocRefHandle,
|
|
4035
|
+
data: Record<string, unknown>,
|
|
4036
|
+
options?: {
|
|
4037
|
+
merge?: boolean;
|
|
4038
|
+
mergeFields?: string[];
|
|
4039
|
+
}): Promise<void>;
|
|
4040
|
+
```
|
|
4041
|
+
|
|
4042
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
4043
|
+
|
|
4044
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
4045
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
4046
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
4047
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
4048
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
4049
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
4050
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
4051
|
+
|
|
4052
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
4053
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
4054
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
4055
|
+
|
|
4056
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
4057
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
4058
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
4059
|
+
|
|
4060
|
+
#### Parameters
|
|
4061
|
+
|
|
4062
|
+
| Parameter | Type |
|
|
4063
|
+
| :------ | :------ |
|
|
4064
|
+
| `ref` | [`DocRefHandle`](#docrefhandle) |
|
|
4065
|
+
| `data` | `Record`\<`string`, `unknown`\> |
|
|
4066
|
+
| `options?` | \{ `merge?`: `boolean`; `mergeFields?`: `string`[]; \} |
|
|
4067
|
+
| `options.merge?` | `boolean` |
|
|
4068
|
+
| `options.mergeFields?` | `string`[] |
|
|
4069
|
+
|
|
4070
|
+
#### Returns
|
|
4071
|
+
|
|
4072
|
+
`Promise`\<`void`\>
|
|
4073
|
+
|
|
4074
|
+
***
|
|
4075
|
+
|
|
4076
|
+
<a id="setfirestorerules"></a>
|
|
4077
|
+
|
|
4078
|
+
### setFirestoreRules()
|
|
4079
|
+
|
|
4080
|
+
```ts
|
|
4081
|
+
function setFirestoreRules(db: ClientDb, source: string): Promise<{
|
|
4082
|
+
messages: unknown[];
|
|
4083
|
+
ok: boolean;
|
|
4084
|
+
warnings: unknown[];
|
|
4085
|
+
}>;
|
|
4086
|
+
```
|
|
4087
|
+
|
|
4088
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
4089
|
+
|
|
4090
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
4091
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
4092
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
4093
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
4094
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
4095
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
4096
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
4097
|
+
|
|
4098
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
4099
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
4100
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
4101
|
+
|
|
4102
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
4103
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
4104
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
4105
|
+
|
|
4106
|
+
#### Parameters
|
|
4107
|
+
|
|
4108
|
+
| Parameter | Type |
|
|
4109
|
+
| :------ | :------ |
|
|
4110
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
4111
|
+
| `source` | `string` |
|
|
4112
|
+
|
|
4113
|
+
#### Returns
|
|
4114
|
+
|
|
4115
|
+
`Promise`\<\{
|
|
4116
|
+
`messages`: `unknown`[];
|
|
4117
|
+
`ok`: `boolean`;
|
|
4118
|
+
`warnings`: `unknown`[];
|
|
4119
|
+
\}\>
|
|
4120
|
+
|
|
4121
|
+
***
|
|
4122
|
+
|
|
4123
|
+
<a id="setlens"></a>
|
|
4124
|
+
|
|
4125
|
+
### setLens()
|
|
4126
|
+
|
|
4127
|
+
```ts
|
|
4128
|
+
function setLens(lens: any): void;
|
|
4129
|
+
```
|
|
4130
|
+
|
|
4131
|
+
Set the default auth lens applied to subsequent Firestore DATA ops from this
|
|
4132
|
+
client (Pyric Studio). Pass `{ mode: 'as', uid }` to read/write AS a user
|
|
4133
|
+
(rules apply), `{ mode: 'admin' }` for the admin lens, or
|
|
4134
|
+
`{ mode: 'app-session' }` / `undefined` to revert to the app's own session.
|
|
4135
|
+
|
|
4136
|
+
The lens is process-wide for this client module (one served page = one
|
|
4137
|
+
worker port), mirroring how Studio drives a single active identity at a time.
|
|
4138
|
+
Auth ops are unaffected — they always operate the real session.
|
|
4139
|
+
|
|
4140
|
+
#### Parameters
|
|
4141
|
+
|
|
4142
|
+
| Parameter | Type |
|
|
4143
|
+
| :------ | :------ |
|
|
4144
|
+
| `lens` | `any` |
|
|
4145
|
+
|
|
4146
|
+
#### Returns
|
|
4147
|
+
|
|
4148
|
+
`void`
|
|
4149
|
+
|
|
4150
|
+
***
|
|
4151
|
+
|
|
4152
|
+
<a id="setopissuer"></a>
|
|
4153
|
+
|
|
4154
|
+
### setOpIssuer()
|
|
4155
|
+
|
|
4156
|
+
```ts
|
|
4157
|
+
function setOpIssuer(source: "studio"): void;
|
|
4158
|
+
```
|
|
4159
|
+
|
|
4160
|
+
Declare who issues the ops this client module constructs. See \_opIssuer.
|
|
4161
|
+
|
|
4162
|
+
#### Parameters
|
|
4163
|
+
|
|
4164
|
+
| Parameter | Type |
|
|
4165
|
+
| :------ | :------ |
|
|
4166
|
+
| `source` | `"studio"` |
|
|
4167
|
+
|
|
4168
|
+
#### Returns
|
|
4169
|
+
|
|
4170
|
+
`void`
|
|
4171
|
+
|
|
4172
|
+
***
|
|
4173
|
+
|
|
4174
|
+
<a id="setpersistence"></a>
|
|
4175
|
+
|
|
4176
|
+
### setPersistence()
|
|
4177
|
+
|
|
4178
|
+
```ts
|
|
4179
|
+
function setPersistence(auth: ClientAuth, persistence: ClientPersistence): Promise<void>;
|
|
4180
|
+
```
|
|
4181
|
+
|
|
4182
|
+
Record the session-persistence mode on the worker (surface parity). The
|
|
4183
|
+
effective persistence is CLIENT-side (#754): the entry adapter mirrors the
|
|
4184
|
+
mode into the page's SessionStore, which decides where — or whether — this
|
|
4185
|
+
tab's session uid is stored for reload restore.
|
|
4186
|
+
|
|
4187
|
+
#### Parameters
|
|
4188
|
+
|
|
4189
|
+
| Parameter | Type |
|
|
4190
|
+
| :------ | :------ |
|
|
4191
|
+
| `auth` | [`ClientAuth`](#clientauth) |
|
|
4192
|
+
| `persistence` | `ClientPersistence` |
|
|
4193
|
+
|
|
4194
|
+
#### Returns
|
|
4195
|
+
|
|
4196
|
+
`Promise`\<`void`\>
|
|
4197
|
+
|
|
4198
|
+
***
|
|
4199
|
+
|
|
4200
|
+
<a id="setproviderconfig"></a>
|
|
4201
|
+
|
|
4202
|
+
### setProviderConfig()
|
|
4203
|
+
|
|
4204
|
+
```ts
|
|
4205
|
+
function setProviderConfig(
|
|
4206
|
+
auth: ClientAuth,
|
|
4207
|
+
providerId: string,
|
|
4208
|
+
enabled: boolean): Promise<void>;
|
|
4209
|
+
```
|
|
4210
|
+
|
|
4211
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
4212
|
+
|
|
4213
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
4214
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
4215
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
4216
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
4217
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
4218
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
4219
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
4220
|
+
|
|
4221
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
4222
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
4223
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
4224
|
+
|
|
4225
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
4226
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
4227
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
4228
|
+
|
|
4229
|
+
#### Parameters
|
|
4230
|
+
|
|
4231
|
+
| Parameter | Type |
|
|
4232
|
+
| :------ | :------ |
|
|
4233
|
+
| `auth` | [`ClientAuth`](#clientauth) |
|
|
4234
|
+
| `providerId` | `string` |
|
|
4235
|
+
| `enabled` | `boolean` |
|
|
4236
|
+
|
|
4237
|
+
#### Returns
|
|
4238
|
+
|
|
4239
|
+
`Promise`\<`void`\>
|
|
4240
|
+
|
|
4241
|
+
***
|
|
4242
|
+
|
|
4243
|
+
<a id="setrules"></a>
|
|
4244
|
+
|
|
4245
|
+
### setRules()
|
|
4246
|
+
|
|
4247
|
+
```ts
|
|
4248
|
+
function setRules(db: ClientDb, source: string): Promise<{
|
|
4249
|
+
warnings: unknown[];
|
|
4250
|
+
}>;
|
|
4251
|
+
```
|
|
4252
|
+
|
|
4253
|
+
Deploy new rules to the worker's sandbox. Active onSnapshot listeners
|
|
4254
|
+
that were allowed by the old rules may start receiving error callbacks
|
|
4255
|
+
if the new rules deny them.
|
|
4256
|
+
|
|
4257
|
+
#### Parameters
|
|
4258
|
+
|
|
4259
|
+
| Parameter | Type |
|
|
4260
|
+
| :------ | :------ |
|
|
4261
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
4262
|
+
| `source` | `string` |
|
|
4263
|
+
|
|
4264
|
+
#### Returns
|
|
4265
|
+
|
|
4266
|
+
`Promise`\<\{
|
|
4267
|
+
`warnings`: `unknown`[];
|
|
4268
|
+
\}\>
|
|
4269
|
+
|
|
4270
|
+
***
|
|
4271
|
+
|
|
4272
|
+
<a id="signinanonymously"></a>
|
|
4273
|
+
|
|
4274
|
+
### signInAnonymously()
|
|
4275
|
+
|
|
4276
|
+
```ts
|
|
4277
|
+
function signInAnonymously(auth: ClientAuth): Promise<ClientUserCredential>;
|
|
4278
|
+
```
|
|
4279
|
+
|
|
4280
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
4281
|
+
|
|
4282
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
4283
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
4284
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
4285
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
4286
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
4287
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
4288
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
4289
|
+
|
|
4290
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
4291
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
4292
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
4293
|
+
|
|
4294
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
4295
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
4296
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
4297
|
+
|
|
4298
|
+
#### Parameters
|
|
4299
|
+
|
|
4300
|
+
| Parameter | Type |
|
|
4301
|
+
| :------ | :------ |
|
|
4302
|
+
| `auth` | [`ClientAuth`](#clientauth) |
|
|
4303
|
+
|
|
4304
|
+
#### Returns
|
|
4305
|
+
|
|
4306
|
+
`Promise`\<[`ClientUserCredential`](#clientusercredential)\>
|
|
4307
|
+
|
|
4308
|
+
***
|
|
4309
|
+
|
|
4310
|
+
<a id="signinwithemailandpassword"></a>
|
|
4311
|
+
|
|
4312
|
+
### signInWithEmailAndPassword()
|
|
4313
|
+
|
|
4314
|
+
```ts
|
|
4315
|
+
function signInWithEmailAndPassword(
|
|
4316
|
+
auth: ClientAuth,
|
|
4317
|
+
email: string,
|
|
4318
|
+
password: string): Promise<ClientUserCredential>;
|
|
4319
|
+
```
|
|
4320
|
+
|
|
4321
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
4322
|
+
|
|
4323
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
4324
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
4325
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
4326
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
4327
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
4328
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
4329
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
4330
|
+
|
|
4331
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
4332
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
4333
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
4334
|
+
|
|
4335
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
4336
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
4337
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
4338
|
+
|
|
4339
|
+
#### Parameters
|
|
4340
|
+
|
|
4341
|
+
| Parameter | Type |
|
|
4342
|
+
| :------ | :------ |
|
|
4343
|
+
| `auth` | [`ClientAuth`](#clientauth) |
|
|
4344
|
+
| `email` | `string` |
|
|
4345
|
+
| `password` | `string` |
|
|
4346
|
+
|
|
4347
|
+
#### Returns
|
|
4348
|
+
|
|
4349
|
+
`Promise`\<[`ClientUserCredential`](#clientusercredential)\>
|
|
4350
|
+
|
|
4351
|
+
***
|
|
4352
|
+
|
|
4353
|
+
<a id="signout"></a>
|
|
4354
|
+
|
|
4355
|
+
### signOut()
|
|
4356
|
+
|
|
4357
|
+
```ts
|
|
4358
|
+
function signOut(auth: ClientAuth): Promise<void>;
|
|
4359
|
+
```
|
|
4360
|
+
|
|
4361
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
4362
|
+
|
|
4363
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
4364
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
4365
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
4366
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
4367
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
4368
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
4369
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
4370
|
+
|
|
4371
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
4372
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
4373
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
4374
|
+
|
|
4375
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
4376
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
4377
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
4378
|
+
|
|
4379
|
+
#### Parameters
|
|
4380
|
+
|
|
4381
|
+
| Parameter | Type |
|
|
4382
|
+
| :------ | :------ |
|
|
4383
|
+
| `auth` | [`ClientAuth`](#clientauth) |
|
|
4384
|
+
|
|
4385
|
+
#### Returns
|
|
4386
|
+
|
|
4387
|
+
`Promise`\<`void`\>
|
|
4388
|
+
|
|
4389
|
+
***
|
|
4390
|
+
|
|
4391
|
+
<a id="startafter"></a>
|
|
4392
|
+
|
|
4393
|
+
### startAfter()
|
|
4394
|
+
|
|
4395
|
+
```ts
|
|
4396
|
+
function startAfter(...values: unknown[]): QueryConstraintHandle;
|
|
4397
|
+
```
|
|
4398
|
+
|
|
4399
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
4400
|
+
|
|
4401
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
4402
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
4403
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
4404
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
4405
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
4406
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
4407
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
4408
|
+
|
|
4409
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
4410
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
4411
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
4412
|
+
|
|
4413
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
4414
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
4415
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
4416
|
+
|
|
4417
|
+
#### Parameters
|
|
4418
|
+
|
|
4419
|
+
| Parameter | Type |
|
|
4420
|
+
| :------ | :------ |
|
|
4421
|
+
| ...`values` | `unknown`[] |
|
|
4422
|
+
|
|
4423
|
+
#### Returns
|
|
4424
|
+
|
|
4425
|
+
`QueryConstraintHandle`
|
|
4426
|
+
|
|
4427
|
+
***
|
|
4428
|
+
|
|
4429
|
+
<a id="startat"></a>
|
|
4430
|
+
|
|
4431
|
+
### startAt()
|
|
4432
|
+
|
|
4433
|
+
```ts
|
|
4434
|
+
function startAt(...values: unknown[]): QueryConstraintHandle;
|
|
4435
|
+
```
|
|
4436
|
+
|
|
4437
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
4438
|
+
|
|
4439
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
4440
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
4441
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
4442
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
4443
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
4444
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
4445
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
4446
|
+
|
|
4447
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
4448
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
4449
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
4450
|
+
|
|
4451
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
4452
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
4453
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
4454
|
+
|
|
4455
|
+
#### Parameters
|
|
4456
|
+
|
|
4457
|
+
| Parameter | Type |
|
|
4458
|
+
| :------ | :------ |
|
|
4459
|
+
| ...`values` | `unknown`[] |
|
|
4460
|
+
|
|
4461
|
+
#### Returns
|
|
4462
|
+
|
|
4463
|
+
`QueryConstraintHandle`
|
|
4464
|
+
|
|
4465
|
+
***
|
|
4466
|
+
|
|
4467
|
+
<a id="startpresence"></a>
|
|
4468
|
+
|
|
4469
|
+
### startPresence()
|
|
4470
|
+
|
|
4471
|
+
```ts
|
|
4472
|
+
function startPresence(opts: StartPresenceOptions): PresenceSession;
|
|
4473
|
+
```
|
|
4474
|
+
|
|
4475
|
+
Register this page with the worker and keep the lease alive until
|
|
4476
|
+
[PresenceSession.stop](#stop) or `pagehide`.
|
|
4477
|
+
|
|
4478
|
+
#### Parameters
|
|
4479
|
+
|
|
4480
|
+
| Parameter | Type |
|
|
4481
|
+
| :------ | :------ |
|
|
4482
|
+
| `opts` | `StartPresenceOptions` |
|
|
4483
|
+
|
|
4484
|
+
#### Returns
|
|
4485
|
+
|
|
4486
|
+
[`PresenceSession`](#presencesession)
|
|
4487
|
+
|
|
4488
|
+
***
|
|
4489
|
+
|
|
4490
|
+
<a id="subscribeevents"></a>
|
|
4491
|
+
|
|
4492
|
+
### subscribeEvents()
|
|
4493
|
+
|
|
4494
|
+
```ts
|
|
4495
|
+
function subscribeEvents(db: ClientDb, callback: (events: readonly SandboxEvent[]) => void): Unsubscribe;
|
|
4496
|
+
```
|
|
4497
|
+
|
|
4498
|
+
Subscribe to the worker sandbox's unified event stream. The callback fires
|
|
4499
|
+
with each delivered BATCH of events — the FIRST call carries the initial
|
|
4500
|
+
`history()` snapshot (possibly empty), each subsequent call carries one live
|
|
4501
|
+
event. Returns an unsubscribe that deregisters on the worker.
|
|
4502
|
+
|
|
4503
|
+
This is the live counterpart to `sandbox.onEvent` + an initial `history()`
|
|
4504
|
+
fold, collapsed into one subscription so a late subscriber never misses the
|
|
4505
|
+
backlog.
|
|
4506
|
+
|
|
4507
|
+
#### Parameters
|
|
4508
|
+
|
|
4509
|
+
| Parameter | Type |
|
|
4510
|
+
| :------ | :------ |
|
|
4511
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
4512
|
+
| `callback` | (`events`: readonly `SandboxEvent`[]) => `void` |
|
|
4513
|
+
|
|
4514
|
+
#### Returns
|
|
4515
|
+
|
|
4516
|
+
[`Unsubscribe`](#unsubscribe)
|
|
4517
|
+
|
|
4518
|
+
***
|
|
4519
|
+
|
|
4520
|
+
<a id="subscribepresence"></a>
|
|
4521
|
+
|
|
4522
|
+
### subscribePresence()
|
|
4523
|
+
|
|
4524
|
+
```ts
|
|
4525
|
+
function subscribePresence(db: ClientDb, callback: (snapshot: PresenceSnapshot) => void): Unsubscribe;
|
|
4526
|
+
```
|
|
4527
|
+
|
|
4528
|
+
Subscribe to the worker's authoritative presence snapshot. The callback
|
|
4529
|
+
fires immediately with the current snapshot, then on every change.
|
|
4530
|
+
|
|
4531
|
+
#### Parameters
|
|
4532
|
+
|
|
4533
|
+
| Parameter | Type |
|
|
4534
|
+
| :------ | :------ |
|
|
4535
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
4536
|
+
| `callback` | (`snapshot`: [`PresenceSnapshot`](#presencesnapshot)) => `void` |
|
|
4537
|
+
|
|
4538
|
+
#### Returns
|
|
4539
|
+
|
|
4540
|
+
[`Unsubscribe`](#unsubscribe)
|
|
4541
|
+
|
|
4542
|
+
***
|
|
4543
|
+
|
|
4544
|
+
<a id="sum"></a>
|
|
4545
|
+
|
|
4546
|
+
### sum()
|
|
4547
|
+
|
|
4548
|
+
```ts
|
|
4549
|
+
function sum(field: string): AggregateFieldDescriptor;
|
|
4550
|
+
```
|
|
4551
|
+
|
|
4552
|
+
Factory: sum-of-`field` aggregate. Mirrors `pyric/firestore`'s `sum()`.
|
|
4553
|
+
|
|
4554
|
+
#### Parameters
|
|
4555
|
+
|
|
4556
|
+
| Parameter | Type |
|
|
4557
|
+
| :------ | :------ |
|
|
4558
|
+
| `field` | `string` |
|
|
4559
|
+
|
|
4560
|
+
#### Returns
|
|
4561
|
+
|
|
4562
|
+
`AggregateFieldDescriptor`
|
|
4563
|
+
|
|
4564
|
+
***
|
|
4565
|
+
|
|
4566
|
+
<a id="switchworkerbranch"></a>
|
|
4567
|
+
|
|
4568
|
+
### switchWorkerBranch()
|
|
4569
|
+
|
|
4570
|
+
```ts
|
|
4571
|
+
function switchWorkerBranch(db: ClientDb, name: string): Promise<void>;
|
|
4572
|
+
```
|
|
4573
|
+
|
|
4574
|
+
Phase 3 (clobber): switch the live sandbox to a named branch's state.
|
|
4575
|
+
|
|
4576
|
+
#### Parameters
|
|
4577
|
+
|
|
4578
|
+
| Parameter | Type |
|
|
4579
|
+
| :------ | :------ |
|
|
4580
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
4581
|
+
| `name` | `string` |
|
|
4582
|
+
|
|
4583
|
+
#### Returns
|
|
4584
|
+
|
|
4585
|
+
`Promise`\<`void`\>
|
|
4586
|
+
|
|
4587
|
+
***
|
|
4588
|
+
|
|
4589
|
+
<a id="updatedoc"></a>
|
|
4590
|
+
|
|
4591
|
+
### updateDoc()
|
|
4592
|
+
|
|
4593
|
+
```ts
|
|
4594
|
+
function updateDoc(ref: DocRefHandle, data: Record<string, unknown>): Promise<void>;
|
|
4595
|
+
```
|
|
4596
|
+
|
|
4597
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
4598
|
+
|
|
4599
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
4600
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
4601
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
4602
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
4603
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
4604
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
4605
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
4606
|
+
|
|
4607
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
4608
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
4609
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
4610
|
+
|
|
4611
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
4612
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
4613
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
4614
|
+
|
|
4615
|
+
#### Parameters
|
|
4616
|
+
|
|
4617
|
+
| Parameter | Type |
|
|
4618
|
+
| :------ | :------ |
|
|
4619
|
+
| `ref` | [`DocRefHandle`](#docrefhandle) |
|
|
4620
|
+
| `data` | `Record`\<`string`, `unknown`\> |
|
|
4621
|
+
|
|
4622
|
+
#### Returns
|
|
4623
|
+
|
|
4624
|
+
`Promise`\<`void`\>
|
|
4625
|
+
|
|
4626
|
+
***
|
|
4627
|
+
|
|
4628
|
+
<a id="uploadbytes"></a>
|
|
4629
|
+
|
|
4630
|
+
### uploadBytes()
|
|
4631
|
+
|
|
4632
|
+
```ts
|
|
4633
|
+
function uploadBytes(
|
|
4634
|
+
reference: ClientStorageReference,
|
|
4635
|
+
data: Blob | ArrayBuffer | Uint8Array<ArrayBufferLike>,
|
|
4636
|
+
metadata?: ClientSettableMetadata): Promise<{
|
|
4637
|
+
metadata: FullMetadata;
|
|
4638
|
+
ref: ClientStorageReference;
|
|
4639
|
+
}>;
|
|
4640
|
+
```
|
|
4641
|
+
|
|
4642
|
+
Upload bytes at the reference's path (replaces existing content).
|
|
4643
|
+
Mirrors `pyric/storage`'s `uploadBytes` result shape.
|
|
4644
|
+
|
|
4645
|
+
#### Parameters
|
|
4646
|
+
|
|
4647
|
+
| Parameter | Type |
|
|
4648
|
+
| :------ | :------ |
|
|
4649
|
+
| `reference` | [`ClientStorageReference`](#clientstoragereference) |
|
|
4650
|
+
| `data` | `Blob` \| `ArrayBuffer` \| `Uint8Array`\<`ArrayBufferLike`\> |
|
|
4651
|
+
| `metadata?` | [`ClientSettableMetadata`](#clientsettablemetadata) |
|
|
4652
|
+
|
|
4653
|
+
#### Returns
|
|
4654
|
+
|
|
4655
|
+
`Promise`\<\{
|
|
4656
|
+
`metadata`: `FullMetadata`;
|
|
4657
|
+
`ref`: [`ClientStorageReference`](#clientstoragereference);
|
|
4658
|
+
\}\>
|
|
4659
|
+
|
|
4660
|
+
***
|
|
4661
|
+
|
|
4662
|
+
<a id="where"></a>
|
|
4663
|
+
|
|
4664
|
+
### where()
|
|
4665
|
+
|
|
4666
|
+
```ts
|
|
4667
|
+
function where(
|
|
4668
|
+
field: string,
|
|
4669
|
+
op: string,
|
|
4670
|
+
value: unknown): QueryConstraintHandle;
|
|
4671
|
+
```
|
|
4672
|
+
|
|
4673
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
4674
|
+
|
|
4675
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
4676
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
4677
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
4678
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
4679
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
4680
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
4681
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
4682
|
+
|
|
4683
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
4684
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
4685
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
4686
|
+
|
|
4687
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
4688
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
4689
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
4690
|
+
|
|
4691
|
+
#### Parameters
|
|
4692
|
+
|
|
4693
|
+
| Parameter | Type |
|
|
4694
|
+
| :------ | :------ |
|
|
4695
|
+
| `field` | `string` |
|
|
4696
|
+
| `op` | `string` |
|
|
4697
|
+
| `value` | `unknown` |
|
|
4698
|
+
|
|
4699
|
+
#### Returns
|
|
4700
|
+
|
|
4701
|
+
`QueryConstraintHandle`
|
|
4702
|
+
|
|
4703
|
+
***
|
|
4704
|
+
|
|
4705
|
+
<a id="writebatch"></a>
|
|
4706
|
+
|
|
4707
|
+
### writeBatch()
|
|
4708
|
+
|
|
4709
|
+
```ts
|
|
4710
|
+
function writeBatch(db: ClientDb): ClientWriteBatch;
|
|
4711
|
+
```
|
|
4712
|
+
|
|
4713
|
+
Browser-safe SharedWorker CLIENT surface (Pyric Studio data plane).
|
|
4714
|
+
|
|
4715
|
+
This barrel exports ONLY the leaf client + the wire-protocol types — the
|
|
4716
|
+
pieces a browser app (the served page, or Pyric Studio's Vite app) imports to
|
|
4717
|
+
connect to the `pyric-shared-worker` over its `MessagePort`. It deliberately
|
|
4718
|
+
does NOT re-export `host.ts`/`entry.ts`:
|
|
4719
|
+
- `host.ts` imports the full `pyric/firestore` + `pyric/auth` engine (it IS
|
|
4720
|
+
the backend) — node/engine-heavy, never wanted in a page bundle.
|
|
4721
|
+
- `entry.ts` references `SharedWorkerGlobalScope` and is esbuild-only.
|
|
4722
|
+
|
|
4723
|
+
`client.ts` imports only the value codec (`pyric/firestore-values`, a leaf)
|
|
4724
|
+
and type-only `pyric/sandbox` (erased at build), so this entry stays free of
|
|
4725
|
+
the ~10 MB rules/sandbox engine — safe to import from any browser app.
|
|
4726
|
+
|
|
4727
|
+
Exposed by `@pyric/cli`'s `./serve/worker` package export so Studio can
|
|
4728
|
+
`import { getFirestore, subscribeEvents, setLens } from
|
|
4729
|
+
'@pyric/cli/serve/worker'` and reach the live SharedWorker backend.
|
|
4730
|
+
|
|
4731
|
+
#### Parameters
|
|
4732
|
+
|
|
4733
|
+
| Parameter | Type |
|
|
4734
|
+
| :------ | :------ |
|
|
4735
|
+
| `db` | [`ClientDb`](#clientdb) |
|
|
4736
|
+
|
|
4737
|
+
#### Returns
|
|
4738
|
+
|
|
4739
|
+
[`ClientWriteBatch`](#clientwritebatch)
|