pyric 0.0.1 → 0.1.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -1
- package/dist/app/index.d.ts +81 -0
- package/dist/app/index.d.ts.map +1 -0
- package/dist/app/index.js +78 -0
- package/dist/app/index.js.map +1 -0
- package/dist/auth/index.d.ts +346 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +701 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/prod-backend.d.ts +39 -0
- package/dist/auth/prod-backend.d.ts.map +1 -0
- package/dist/auth/prod-backend.js +179 -0
- package/dist/auth/prod-backend.js.map +1 -0
- package/dist/auth/providers.d.ts +107 -0
- package/dist/auth/providers.d.ts.map +1 -0
- package/dist/auth/providers.js +138 -0
- package/dist/auth/providers.js.map +1 -0
- package/dist/auth/sandbox-backend.d.ts +769 -0
- package/dist/auth/sandbox-backend.d.ts.map +1 -0
- package/dist/auth/sandbox-backend.js +1598 -0
- package/dist/auth/sandbox-backend.js.map +1 -0
- package/dist/auth/target.d.ts +40 -0
- package/dist/auth/target.d.ts.map +1 -0
- package/dist/auth/target.js +28 -0
- package/dist/auth/target.js.map +1 -0
- package/dist/auth/types.d.ts +252 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +26 -0
- package/dist/auth/types.js.map +1 -0
- package/dist/database/constraints/atoms.d.ts +29 -0
- package/dist/database/constraints/atoms.d.ts.map +1 -0
- package/dist/database/constraints/atoms.js +43 -0
- package/dist/database/constraints/atoms.js.map +1 -0
- package/dist/database/constraints/compose.d.ts +16 -0
- package/dist/database/constraints/compose.d.ts.map +1 -0
- package/dist/database/constraints/compose.js +15 -0
- package/dist/database/constraints/compose.js.map +1 -0
- package/dist/database/constraints/data.d.ts +30 -0
- package/dist/database/constraints/data.d.ts.map +1 -0
- package/dist/database/constraints/data.js +46 -0
- package/dist/database/constraints/data.js.map +1 -0
- package/dist/database/constraints/document.d.ts +42 -0
- package/dist/database/constraints/document.d.ts.map +1 -0
- package/dist/database/constraints/document.js +86 -0
- package/dist/database/constraints/document.js.map +1 -0
- package/dist/database/constraints/game.d.ts +30 -0
- package/dist/database/constraints/game.d.ts.map +1 -0
- package/dist/database/constraints/game.js +49 -0
- package/dist/database/constraints/game.js.map +1 -0
- package/dist/database/constraints/index.d.ts +12 -0
- package/dist/database/constraints/index.d.ts.map +1 -0
- package/dist/database/constraints/index.js +9 -0
- package/dist/database/constraints/index.js.map +1 -0
- package/dist/database/constraints/policies.d.ts +16 -0
- package/dist/database/constraints/policies.d.ts.map +1 -0
- package/dist/database/constraints/policies.js +17 -0
- package/dist/database/constraints/policies.js.map +1 -0
- package/dist/database/constraints/ruleset.d.ts +5 -0
- package/dist/database/constraints/ruleset.d.ts.map +1 -0
- package/dist/database/constraints/ruleset.js +132 -0
- package/dist/database/constraints/ruleset.js.map +1 -0
- package/dist/database/constraints/schema.d.ts +17 -0
- package/dist/database/constraints/schema.d.ts.map +1 -0
- package/dist/database/constraints/schema.js +74 -0
- package/dist/database/constraints/schema.js.map +1 -0
- package/dist/database/constraints/types.d.ts +22 -0
- package/dist/database/constraints/types.d.ts.map +1 -0
- package/dist/database/constraints/types.js +2 -0
- package/dist/database/constraints/types.js.map +1 -0
- package/dist/database/crawl/handler.d.ts +7 -0
- package/dist/database/crawl/handler.d.ts.map +1 -0
- package/dist/database/crawl/handler.js +91 -0
- package/dist/database/crawl/handler.js.map +1 -0
- package/dist/database/crawl/semaphore.d.ts +9 -0
- package/dist/database/crawl/semaphore.d.ts.map +1 -0
- package/dist/database/crawl/semaphore.js +27 -0
- package/dist/database/crawl/semaphore.js.map +1 -0
- package/dist/database/crawl/spec.d.ts +33 -0
- package/dist/database/crawl/spec.d.ts.map +1 -0
- package/dist/database/crawl/spec.js +12 -0
- package/dist/database/crawl/spec.js.map +1 -0
- package/dist/database/data/handler.d.ts +9 -0
- package/dist/database/data/handler.d.ts.map +1 -0
- package/dist/database/data/handler.js +96 -0
- package/dist/database/data/handler.js.map +1 -0
- package/dist/database/data/spec.d.ts +77 -0
- package/dist/database/data/spec.d.ts.map +1 -0
- package/dist/database/data/spec.js +17 -0
- package/dist/database/data/spec.js.map +1 -0
- package/dist/database/data/validated.d.ts +8 -0
- package/dist/database/data/validated.d.ts.map +1 -0
- package/dist/database/data/validated.js +99 -0
- package/dist/database/data/validated.js.map +1 -0
- package/dist/database/grammar/RtdbExpr.ohm +98 -0
- package/dist/database/grammar/RtdbExpr.ohm.generated.d.ts +2 -0
- package/dist/database/grammar/RtdbExpr.ohm.generated.d.ts.map +1 -0
- package/dist/database/grammar/RtdbExpr.ohm.generated.js +103 -0
- package/dist/database/grammar/RtdbExpr.ohm.generated.js.map +1 -0
- package/dist/database/grammar/RtdbExprParser.d.ts +5 -0
- package/dist/database/grammar/RtdbExprParser.d.ts.map +1 -0
- package/dist/database/grammar/RtdbExprParser.js +53 -0
- package/dist/database/grammar/RtdbExprParser.js.map +1 -0
- package/dist/database/grammar/linter.d.ts +3 -0
- package/dist/database/grammar/linter.d.ts.map +1 -0
- package/dist/database/grammar/linter.js +66 -0
- package/dist/database/grammar/linter.js.map +1 -0
- package/dist/database/grammar/simulator.d.ts +31 -0
- package/dist/database/grammar/simulator.d.ts.map +1 -0
- package/dist/database/grammar/simulator.js +255 -0
- package/dist/database/grammar/simulator.js.map +1 -0
- package/dist/database/grammar/validator.d.ts +3 -0
- package/dist/database/grammar/validator.d.ts.map +1 -0
- package/dist/database/grammar/validator.js +84 -0
- package/dist/database/grammar/validator.js.map +1 -0
- package/dist/database/host.d.ts +50 -0
- package/dist/database/host.d.ts.map +1 -0
- package/dist/database/host.js +41 -0
- package/dist/database/host.js.map +1 -0
- package/dist/database/index.d.ts +40 -0
- package/dist/database/index.d.ts.map +1 -0
- package/dist/database/index.js +47 -0
- package/dist/database/index.js.map +1 -0
- package/dist/database/initialize-from-app.d.ts +28 -0
- package/dist/database/initialize-from-app.d.ts.map +1 -0
- package/dist/database/initialize-from-app.js +23 -0
- package/dist/database/initialize-from-app.js.map +1 -0
- package/dist/database/ir/handler.d.ts +6 -0
- package/dist/database/ir/handler.d.ts.map +1 -0
- package/dist/database/ir/handler.js +52 -0
- package/dist/database/ir/handler.js.map +1 -0
- package/dist/database/ir/spec.d.ts +25 -0
- package/dist/database/ir/spec.d.ts.map +1 -0
- package/dist/database/ir/spec.js +11 -0
- package/dist/database/ir/spec.js.map +1 -0
- package/dist/database/mapper.d.ts +9 -0
- package/dist/database/mapper.d.ts.map +1 -0
- package/dist/database/mapper.js +115 -0
- package/dist/database/mapper.js.map +1 -0
- package/dist/database/modular.d.ts +604 -0
- package/dist/database/modular.d.ts.map +1 -0
- package/dist/database/modular.js +1226 -0
- package/dist/database/modular.js.map +1 -0
- package/dist/database/replay.d.ts +33 -0
- package/dist/database/replay.d.ts.map +1 -0
- package/dist/database/replay.js +124 -0
- package/dist/database/replay.js.map +1 -0
- package/dist/database/resolver.d.ts +4 -0
- package/dist/database/resolver.d.ts.map +1 -0
- package/dist/database/resolver.js +66 -0
- package/dist/database/resolver.js.map +1 -0
- package/dist/database/sandbox/backend.d.ts +403 -0
- package/dist/database/sandbox/backend.d.ts.map +1 -0
- package/dist/database/sandbox/backend.js +1467 -0
- package/dist/database/sandbox/backend.js.map +1 -0
- package/dist/database/sandbox/data-tree.d.ts +123 -0
- package/dist/database/sandbox/data-tree.d.ts.map +1 -0
- package/dist/database/sandbox/data-tree.js +310 -0
- package/dist/database/sandbox/data-tree.js.map +1 -0
- package/dist/database/sandbox/normalize.d.ts +77 -0
- package/dist/database/sandbox/normalize.d.ts.map +1 -0
- package/dist/database/sandbox/normalize.js +165 -0
- package/dist/database/sandbox/normalize.js.map +1 -0
- package/dist/database/sandbox/push-id.d.ts +32 -0
- package/dist/database/sandbox/push-id.d.ts.map +1 -0
- package/dist/database/sandbox/push-id.js +82 -0
- package/dist/database/sandbox/push-id.js.map +1 -0
- package/dist/database/sandbox/query.d.ts +175 -0
- package/dist/database/sandbox/query.d.ts.map +1 -0
- package/dist/database/sandbox/query.js +269 -0
- package/dist/database/sandbox/query.js.map +1 -0
- package/dist/database/sandbox/rules-eval.d.ts +69 -0
- package/dist/database/sandbox/rules-eval.d.ts.map +1 -0
- package/dist/database/sandbox/rules-eval.js +124 -0
- package/dist/database/sandbox/rules-eval.js.map +1 -0
- package/dist/database/sandbox/sentinels.d.ts +71 -0
- package/dist/database/sandbox/sentinels.d.ts.map +1 -0
- package/dist/database/sandbox/sentinels.js +92 -0
- package/dist/database/sandbox/sentinels.js.map +1 -0
- package/dist/database/simulation/handler.d.ts +6 -0
- package/dist/database/simulation/handler.d.ts.map +1 -0
- package/dist/database/simulation/handler.js +236 -0
- package/dist/database/simulation/handler.js.map +1 -0
- package/dist/database/simulation/spec.d.ts +69 -0
- package/dist/database/simulation/spec.d.ts.map +1 -0
- package/dist/database/simulation/spec.js +25 -0
- package/dist/database/simulation/spec.js.map +1 -0
- package/dist/database/tools.d.ts +22 -0
- package/dist/database/tools.d.ts.map +1 -0
- package/dist/database/tools.js +272 -0
- package/dist/database/tools.js.map +1 -0
- package/dist/database/types.d.ts +210 -0
- package/dist/database/types.d.ts.map +1 -0
- package/dist/database/types.js +26 -0
- package/dist/database/types.js.map +1 -0
- package/dist/database/write/handler.d.ts +7 -0
- package/dist/database/write/handler.d.ts.map +1 -0
- package/dist/database/write/handler.js +42 -0
- package/dist/database/write/handler.js.map +1 -0
- package/dist/database/write/spec.d.ts +18 -0
- package/dist/database/write/spec.d.ts.map +1 -0
- package/dist/database/write/spec.js +7 -0
- package/dist/database/write/spec.js.map +1 -0
- package/dist/firestore/index.d.ts +533 -0
- package/dist/firestore/index.d.ts.map +1 -0
- package/dist/firestore/index.js +1536 -0
- package/dist/firestore/index.js.map +1 -0
- package/dist/firestore/tools.d.ts +67 -0
- package/dist/firestore/tools.d.ts.map +1 -0
- package/dist/firestore/tools.js +318 -0
- package/dist/firestore/tools.js.map +1 -0
- package/dist/firestore-values/index.d.ts +63 -0
- package/dist/firestore-values/index.d.ts.map +1 -0
- package/dist/firestore-values/index.js +148 -0
- package/dist/firestore-values/index.js.map +1 -0
- package/dist/project-scope.d.ts +5 -0
- package/dist/project-scope.d.ts.map +1 -0
- package/dist/project-scope.js +2 -0
- package/dist/project-scope.js.map +1 -0
- package/dist/rules/extract.d.ts +28 -0
- package/dist/rules/extract.d.ts.map +1 -0
- package/dist/rules/extract.js +25 -0
- package/dist/rules/extract.js.map +1 -0
- package/dist/rules/generators/assembler.d.ts +19 -0
- package/dist/rules/generators/assembler.d.ts.map +1 -0
- package/dist/rules/generators/assembler.js +292 -0
- package/dist/rules/generators/assembler.js.map +1 -0
- package/dist/rules/generators/expressions.d.ts +52 -0
- package/dist/rules/generators/expressions.d.ts.map +1 -0
- package/dist/rules/generators/expressions.js +117 -0
- package/dist/rules/generators/expressions.js.map +1 -0
- package/dist/rules/generators/grid.d.ts +22 -0
- package/dist/rules/generators/grid.d.ts.map +1 -0
- package/dist/rules/generators/grid.js +52 -0
- package/dist/rules/generators/grid.js.map +1 -0
- package/dist/rules/grammar/FirestoreAST.d.ts +129 -0
- package/dist/rules/grammar/FirestoreAST.d.ts.map +1 -0
- package/dist/rules/grammar/FirestoreAST.js +3 -0
- package/dist/rules/grammar/FirestoreAST.js.map +1 -0
- package/dist/rules/grammar/FirestoreAssembler.d.ts +5 -0
- package/dist/rules/grammar/FirestoreAssembler.d.ts.map +1 -0
- package/dist/rules/grammar/FirestoreAssembler.js +158 -0
- package/dist/rules/grammar/FirestoreAssembler.js.map +1 -0
- package/dist/rules/grammar/FirestoreParser.d.ts +46 -0
- package/dist/rules/grammar/FirestoreParser.d.ts.map +1 -0
- package/dist/rules/grammar/FirestoreParser.js +409 -0
- package/dist/rules/grammar/FirestoreParser.js.map +1 -0
- package/dist/rules/grammar/FirestoreRules.ohm +229 -0
- package/dist/rules/grammar/FirestoreRules.ohm.generated.d.ts +2 -0
- package/dist/rules/grammar/FirestoreRules.ohm.generated.d.ts.map +1 -0
- package/dist/rules/grammar/FirestoreRules.ohm.generated.js +234 -0
- package/dist/rules/grammar/FirestoreRules.ohm.generated.js.map +1 -0
- package/dist/rules/grammar/FirestoreValidator.d.ts +10 -0
- package/dist/rules/grammar/FirestoreValidator.d.ts.map +1 -0
- package/dist/rules/grammar/FirestoreValidator.js +482 -0
- package/dist/rules/grammar/FirestoreValidator.js.map +1 -0
- package/dist/rules/index.d.ts +67 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +80 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/indexes/extract/annotation-collect.d.ts +42 -0
- package/dist/rules/indexes/extract/annotation-collect.d.ts.map +1 -0
- package/dist/rules/indexes/extract/annotation-collect.js +69 -0
- package/dist/rules/indexes/extract/annotation-collect.js.map +1 -0
- package/dist/rules/indexes/extract/annotations.d.ts +50 -0
- package/dist/rules/indexes/extract/annotations.d.ts.map +1 -0
- package/dist/rules/indexes/extract/annotations.js +144 -0
- package/dist/rules/indexes/extract/annotations.js.map +1 -0
- package/dist/rules/indexes/extract/ast.d.ts +54 -0
- package/dist/rules/indexes/extract/ast.d.ts.map +1 -0
- package/dist/rules/indexes/extract/ast.js +119 -0
- package/dist/rules/indexes/extract/ast.js.map +1 -0
- package/dist/rules/indexes/extract/classify.d.ts +41 -0
- package/dist/rules/indexes/extract/classify.d.ts.map +1 -0
- package/dist/rules/indexes/extract/classify.js +138 -0
- package/dist/rules/indexes/extract/classify.js.map +1 -0
- package/dist/rules/indexes/extract/composite.d.ts +38 -0
- package/dist/rules/indexes/extract/composite.d.ts.map +1 -0
- package/dist/rules/indexes/extract/composite.js +85 -0
- package/dist/rules/indexes/extract/composite.js.map +1 -0
- package/dist/rules/indexes/extract/dataflow.d.ts +45 -0
- package/dist/rules/indexes/extract/dataflow.d.ts.map +1 -0
- package/dist/rules/indexes/extract/dataflow.js +200 -0
- package/dist/rules/indexes/extract/dataflow.js.map +1 -0
- package/dist/rules/indexes/extract/enumerate.d.ts +41 -0
- package/dist/rules/indexes/extract/enumerate.d.ts.map +1 -0
- package/dist/rules/indexes/extract/enumerate.js +163 -0
- package/dist/rules/indexes/extract/enumerate.js.map +1 -0
- package/dist/rules/indexes/extract/extractor.d.ts +3 -0
- package/dist/rules/indexes/extract/extractor.d.ts.map +1 -0
- package/dist/rules/indexes/extract/extractor.js +274 -0
- package/dist/rules/indexes/extract/extractor.js.map +1 -0
- package/dist/rules/indexes/extract/types.d.ts +211 -0
- package/dist/rules/indexes/extract/types.d.ts.map +1 -0
- package/dist/rules/indexes/extract/types.js +14 -0
- package/dist/rules/indexes/extract/types.js.map +1 -0
- package/dist/rules/indexes/extractHandler.d.ts +16 -0
- package/dist/rules/indexes/extractHandler.d.ts.map +1 -0
- package/dist/rules/indexes/extractHandler.js +100 -0
- package/dist/rules/indexes/extractHandler.js.map +1 -0
- package/dist/rules/indexes/extractTool.d.ts +15 -0
- package/dist/rules/indexes/extractTool.d.ts.map +1 -0
- package/dist/rules/indexes/extractTool.js +55 -0
- package/dist/rules/indexes/extractTool.js.map +1 -0
- package/dist/rules/indexes/types.d.ts +71 -0
- package/dist/rules/indexes/types.d.ts.map +1 -0
- package/dist/rules/indexes/types.js +15 -0
- package/dist/rules/indexes/types.js.map +1 -0
- package/dist/rules/inspect/handler.d.ts +6 -0
- package/dist/rules/inspect/handler.d.ts.map +1 -0
- package/dist/rules/inspect/handler.js +144 -0
- package/dist/rules/inspect/handler.js.map +1 -0
- package/dist/rules/inspect/spec.d.ts +37 -0
- package/dist/rules/inspect/spec.d.ts.map +1 -0
- package/dist/rules/inspect/spec.js +2 -0
- package/dist/rules/inspect/spec.js.map +1 -0
- package/dist/rules/inspect/tools.d.ts +21 -0
- package/dist/rules/inspect/tools.d.ts.map +1 -0
- package/dist/rules/inspect/tools.js +21 -0
- package/dist/rules/inspect/tools.js.map +1 -0
- package/dist/rules/linter/ast-utils.d.ts +97 -0
- package/dist/rules/linter/ast-utils.d.ts.map +1 -0
- package/dist/rules/linter/ast-utils.js +491 -0
- package/dist/rules/linter/ast-utils.js.map +1 -0
- package/dist/rules/linter/hallucinations.d.ts +34 -0
- package/dist/rules/linter/hallucinations.d.ts.map +1 -0
- package/dist/rules/linter/hallucinations.js +334 -0
- package/dist/rules/linter/hallucinations.js.map +1 -0
- package/dist/rules/linter/linter.d.ts +84 -0
- package/dist/rules/linter/linter.d.ts.map +1 -0
- package/dist/rules/linter/linter.js +784 -0
- package/dist/rules/linter/linter.js.map +1 -0
- package/dist/rules/modules/resolver-browser.d.ts +41 -0
- package/dist/rules/modules/resolver-browser.d.ts.map +1 -0
- package/dist/rules/modules/resolver-browser.js +63 -0
- package/dist/rules/modules/resolver-browser.js.map +1 -0
- package/dist/rules/modules/resolver-core.d.ts +51 -0
- package/dist/rules/modules/resolver-core.d.ts.map +1 -0
- package/dist/rules/modules/resolver-core.js +338 -0
- package/dist/rules/modules/resolver-core.js.map +1 -0
- package/dist/rules/modules/resolver.d.ts +17 -0
- package/dist/rules/modules/resolver.d.ts.map +1 -0
- package/dist/rules/modules/resolver.js +49 -0
- package/dist/rules/modules/resolver.js.map +1 -0
- package/dist/rules/modules/stdlib/atomic.rules +52 -0
- package/dist/rules/modules/stdlib/atomic.test.json +152 -0
- package/dist/rules/modules/stdlib/auth.rules +7 -0
- package/dist/rules/modules/stdlib/auth.test.json +53 -0
- package/dist/rules/modules/stdlib/content.rules +50 -0
- package/dist/rules/modules/stdlib/content.test.json +238 -0
- package/dist/rules/modules/stdlib/counters.rules +41 -0
- package/dist/rules/modules/stdlib/counters.test.json +254 -0
- package/dist/rules/modules/stdlib/geometry.rules +43 -0
- package/dist/rules/modules/stdlib/geometry.test.json +200 -0
- package/dist/rules/modules/stdlib/joining.rules +49 -0
- package/dist/rules/modules/stdlib/joining.test.json +287 -0
- package/dist/rules/modules/stdlib/lifecycle.rules +51 -0
- package/dist/rules/modules/stdlib/lifecycle.test.json +288 -0
- package/dist/rules/modules/stdlib/lobby.rules +44 -0
- package/dist/rules/modules/stdlib/lobby.test.json +32 -0
- package/dist/rules/modules/stdlib/membership.rules +40 -0
- package/dist/rules/modules/stdlib/membership.test.json +107 -0
- package/dist/rules/modules/stdlib/spaces.rules +46 -0
- package/dist/rules/modules/stdlib/spaces.test.json +392 -0
- package/dist/rules/modules/stdlib/state.rules +28 -0
- package/dist/rules/modules/stdlib/state.test.json +55 -0
- package/dist/rules/modules/stdlib/timing.rules +20 -0
- package/dist/rules/modules/stdlib/timing.test.json +106 -0
- package/dist/rules/modules/stdlib/transitions.rules +34 -0
- package/dist/rules/modules/stdlib/transitions.test.json +86 -0
- package/dist/rules/modules/stdlib/turns.rules +27 -0
- package/dist/rules/modules/stdlib/turns.test.json +64 -0
- package/dist/rules/modules/stdlib/validation.rules +31 -0
- package/dist/rules/modules/stdlib/validation.test.json +184 -0
- package/dist/rules/modules/stdlib-content.d.ts +11 -0
- package/dist/rules/modules/stdlib-content.d.ts.map +1 -0
- package/dist/rules/modules/stdlib-content.js +590 -0
- package/dist/rules/modules/stdlib-content.js.map +1 -0
- package/dist/rules/node.d.ts +17 -0
- package/dist/rules/node.d.ts.map +1 -0
- package/dist/rules/node.js +21 -0
- package/dist/rules/node.js.map +1 -0
- package/dist/rules/rtdb.d.ts +28 -0
- package/dist/rules/rtdb.d.ts.map +1 -0
- package/dist/rules/rtdb.js +15 -0
- package/dist/rules/rtdb.js.map +1 -0
- package/dist/rules/simulator/evaluator.d.ts +179 -0
- package/dist/rules/simulator/evaluator.d.ts.map +1 -0
- package/dist/rules/simulator/evaluator.js +1221 -0
- package/dist/rules/simulator/evaluator.js.map +1 -0
- package/dist/rules/simulator/expression/eval-errors.d.ts +86 -0
- package/dist/rules/simulator/expression/eval-errors.d.ts.map +1 -0
- package/dist/rules/simulator/expression/eval-errors.js +68 -0
- package/dist/rules/simulator/expression/eval-errors.js.map +1 -0
- package/dist/rules/simulator/expression/evaluator.d.ts +43 -0
- package/dist/rules/simulator/expression/evaluator.d.ts.map +1 -0
- package/dist/rules/simulator/expression/evaluator.js +298 -0
- package/dist/rules/simulator/expression/evaluator.js.map +1 -0
- package/dist/rules/simulator/expression/lexer.d.ts +36 -0
- package/dist/rules/simulator/expression/lexer.d.ts.map +1 -0
- package/dist/rules/simulator/expression/lexer.js +318 -0
- package/dist/rules/simulator/expression/lexer.js.map +1 -0
- package/dist/rules/simulator/expression/parser.d.ts +39 -0
- package/dist/rules/simulator/expression/parser.d.ts.map +1 -0
- package/dist/rules/simulator/expression/parser.js +329 -0
- package/dist/rules/simulator/expression/parser.js.map +1 -0
- package/dist/rules/simulator/expression/types.d.ts +137 -0
- package/dist/rules/simulator/expression/types.d.ts.map +1 -0
- package/dist/rules/simulator/expression/types.js +90 -0
- package/dist/rules/simulator/expression/types.js.map +1 -0
- package/dist/rules/simulator/expression/walk-data.d.ts +52 -0
- package/dist/rules/simulator/expression/walk-data.d.ts.map +1 -0
- package/dist/rules/simulator/expression/walk-data.js +167 -0
- package/dist/rules/simulator/expression/walk-data.js.map +1 -0
- package/dist/rules/simulator/firestore-set.d.ts +25 -0
- package/dist/rules/simulator/firestore-set.d.ts.map +1 -0
- package/dist/rules/simulator/firestore-set.js +89 -0
- package/dist/rules/simulator/firestore-set.js.map +1 -0
- package/dist/rules/simulator/handler.d.ts +36 -0
- package/dist/rules/simulator/handler.d.ts.map +1 -0
- package/dist/rules/simulator/handler.js +583 -0
- package/dist/rules/simulator/handler.js.map +1 -0
- package/dist/rules/simulator/mapdiff.d.ts +29 -0
- package/dist/rules/simulator/mapdiff.d.ts.map +1 -0
- package/dist/rules/simulator/mapdiff.js +72 -0
- package/dist/rules/simulator/mapdiff.js.map +1 -0
- package/dist/rules/simulator/project-after-state.d.ts +33 -0
- package/dist/rules/simulator/project-after-state.d.ts.map +1 -0
- package/dist/rules/simulator/project-after-state.js +88 -0
- package/dist/rules/simulator/project-after-state.js.map +1 -0
- package/dist/rules/simulator/query-proof.d.ts +80 -0
- package/dist/rules/simulator/query-proof.d.ts.map +1 -0
- package/dist/rules/simulator/query-proof.js +142 -0
- package/dist/rules/simulator/query-proof.js.map +1 -0
- package/dist/rules/simulator/value-equality.d.ts +8 -0
- package/dist/rules/simulator/value-equality.d.ts.map +1 -0
- package/dist/rules/simulator/value-equality.js +40 -0
- package/dist/rules/simulator/value-equality.js.map +1 -0
- package/dist/rules/simulator/wrappers/base.d.ts +129 -0
- package/dist/rules/simulator/wrappers/base.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/base.js +90 -0
- package/dist/rules/simulator/wrappers/base.js.map +1 -0
- package/dist/rules/simulator/wrappers/bytes.d.ts +45 -0
- package/dist/rules/simulator/wrappers/bytes.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/bytes.js +130 -0
- package/dist/rules/simulator/wrappers/bytes.js.map +1 -0
- package/dist/rules/simulator/wrappers/duration.d.ts +76 -0
- package/dist/rules/simulator/wrappers/duration.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/duration.js +176 -0
- package/dist/rules/simulator/wrappers/duration.js.map +1 -0
- package/dist/rules/simulator/wrappers/float.d.ts +52 -0
- package/dist/rules/simulator/wrappers/float.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/float.js +88 -0
- package/dist/rules/simulator/wrappers/float.js.map +1 -0
- package/dist/rules/simulator/wrappers/latlng.d.ts +40 -0
- package/dist/rules/simulator/wrappers/latlng.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/latlng.js +100 -0
- package/dist/rules/simulator/wrappers/latlng.js.map +1 -0
- package/dist/rules/simulator/wrappers/path.d.ts +75 -0
- package/dist/rules/simulator/wrappers/path.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/path.js +158 -0
- package/dist/rules/simulator/wrappers/path.js.map +1 -0
- package/dist/rules/simulator/wrappers/reference.d.ts +82 -0
- package/dist/rules/simulator/wrappers/reference.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/reference.js +145 -0
- package/dist/rules/simulator/wrappers/reference.js.map +1 -0
- package/dist/rules/simulator/wrappers/timestamp.d.ts +86 -0
- package/dist/rules/simulator/wrappers/timestamp.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/timestamp.js +207 -0
- package/dist/rules/simulator/wrappers/timestamp.js.map +1 -0
- package/dist/rules/simulator/wrappers/vector.d.ts +43 -0
- package/dist/rules/simulator/wrappers/vector.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/vector.js +80 -0
- package/dist/rules/simulator/wrappers/vector.js.map +1 -0
- package/dist/rules/simulator-tools-impl.d.ts +64 -0
- package/dist/rules/simulator-tools-impl.d.ts.map +1 -0
- package/dist/rules/simulator-tools-impl.js +462 -0
- package/dist/rules/simulator-tools-impl.js.map +1 -0
- package/dist/rules/simulator.d.ts +20 -0
- package/dist/rules/simulator.d.ts.map +1 -0
- package/dist/rules/simulator.js +24 -0
- package/dist/rules/simulator.js.map +1 -0
- package/dist/rules/stdlib-modules.d.ts +73 -0
- package/dist/rules/stdlib-modules.d.ts.map +1 -0
- package/dist/rules/stdlib-modules.js +849 -0
- package/dist/rules/stdlib-modules.js.map +1 -0
- package/dist/rules/stdlib-tools.d.ts +19 -0
- package/dist/rules/stdlib-tools.d.ts.map +1 -0
- package/dist/rules/stdlib-tools.js +164 -0
- package/dist/rules/stdlib-tools.js.map +1 -0
- package/dist/rules/test/handler.d.ts +9 -0
- package/dist/rules/test/handler.d.ts.map +1 -0
- package/dist/rules/test/handler.js +124 -0
- package/dist/rules/test/handler.js.map +1 -0
- package/dist/rules/test/spec.d.ts +517 -0
- package/dist/rules/test/spec.d.ts.map +1 -0
- package/dist/rules/test/spec.js +227 -0
- package/dist/rules/test/spec.js.map +1 -0
- package/dist/rules/tools.d.ts +41 -0
- package/dist/rules/tools.d.ts.map +1 -0
- package/dist/rules/tools.js +124 -0
- package/dist/rules/tools.js.map +1 -0
- package/dist/rules/write/handler.d.ts +6 -0
- package/dist/rules/write/handler.d.ts.map +1 -0
- package/dist/rules/write/handler.js +126 -0
- package/dist/rules/write/handler.js.map +1 -0
- package/dist/rules/write/spec.d.ts +28 -0
- package/dist/rules/write/spec.d.ts.map +1 -0
- package/dist/rules/write/spec.js +2 -0
- package/dist/rules/write/spec.js.map +1 -0
- package/dist/sandbox/admin-compat.d.ts +20 -0
- package/dist/sandbox/admin-compat.d.ts.map +1 -0
- package/dist/sandbox/admin-compat.js +19 -0
- package/dist/sandbox/admin-compat.js.map +1 -0
- package/dist/sandbox/admin-firestore/error-translation.d.ts +86 -0
- package/dist/sandbox/admin-firestore/error-translation.d.ts.map +1 -0
- package/dist/sandbox/admin-firestore/error-translation.js +204 -0
- package/dist/sandbox/admin-firestore/error-translation.js.map +1 -0
- package/dist/sandbox/admin-firestore/index.d.ts +169 -0
- package/dist/sandbox/admin-firestore/index.d.ts.map +1 -0
- package/dist/sandbox/admin-firestore/index.js +456 -0
- package/dist/sandbox/admin-firestore/index.js.map +1 -0
- package/dist/sandbox/admin-firestore/remote.d.ts +97 -0
- package/dist/sandbox/admin-firestore/remote.d.ts.map +1 -0
- package/dist/sandbox/admin-firestore/remote.js +735 -0
- package/dist/sandbox/admin-firestore/remote.js.map +1 -0
- package/dist/sandbox/branches/index.d.ts +141 -0
- package/dist/sandbox/branches/index.d.ts.map +1 -0
- package/dist/sandbox/branches/index.js +327 -0
- package/dist/sandbox/branches/index.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/batch.d.ts +34 -0
- package/dist/sandbox/firestore/admin-compat/batch.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/batch.js +73 -0
- package/dist/sandbox/firestore/admin-compat/batch.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/doc-ref.d.ts +38 -0
- package/dist/sandbox/firestore/admin-compat/doc-ref.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/doc-ref.js +154 -0
- package/dist/sandbox/firestore/admin-compat/doc-ref.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/firestore.d.ts +45 -0
- package/dist/sandbox/firestore/admin-compat/firestore.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/firestore.js +114 -0
- package/dist/sandbox/firestore/admin-compat/firestore.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/index.d.ts +45 -0
- package/dist/sandbox/firestore/admin-compat/index.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/index.js +27 -0
- package/dist/sandbox/firestore/admin-compat/index.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/paths.d.ts +37 -0
- package/dist/sandbox/firestore/admin-compat/paths.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/paths.js +49 -0
- package/dist/sandbox/firestore/admin-compat/paths.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/query.d.ts +261 -0
- package/dist/sandbox/firestore/admin-compat/query.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/query.js +704 -0
- package/dist/sandbox/firestore/admin-compat/query.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/read-translation.d.ts +8 -0
- package/dist/sandbox/firestore/admin-compat/read-translation.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/read-translation.js +59 -0
- package/dist/sandbox/firestore/admin-compat/read-translation.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/snapshots.d.ts +39 -0
- package/dist/sandbox/firestore/admin-compat/snapshots.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/snapshots.js +50 -0
- package/dist/sandbox/firestore/admin-compat/snapshots.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/transaction.d.ts +35 -0
- package/dist/sandbox/firestore/admin-compat/transaction.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/transaction.js +88 -0
- package/dist/sandbox/firestore/admin-compat/transaction.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/types.d.ts +297 -0
- package/dist/sandbox/firestore/admin-compat/types.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/types.js +127 -0
- package/dist/sandbox/firestore/admin-compat/types.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/value-order.d.ts +49 -0
- package/dist/sandbox/firestore/admin-compat/value-order.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/value-order.js +172 -0
- package/dist/sandbox/firestore/admin-compat/value-order.js.map +1 -0
- package/dist/sandbox/firestore/auto-id.d.ts +26 -0
- package/dist/sandbox/firestore/auto-id.d.ts.map +1 -0
- package/dist/sandbox/firestore/auto-id.js +36 -0
- package/dist/sandbox/firestore/auto-id.js.map +1 -0
- package/dist/sandbox/firestore/converters/bytes-geopoint.d.ts +48 -0
- package/dist/sandbox/firestore/converters/bytes-geopoint.d.ts.map +1 -0
- package/dist/sandbox/firestore/converters/bytes-geopoint.js +85 -0
- package/dist/sandbox/firestore/converters/bytes-geopoint.js.map +1 -0
- package/dist/sandbox/firestore/converters/fieldvalue.d.ts +69 -0
- package/dist/sandbox/firestore/converters/fieldvalue.d.ts.map +1 -0
- package/dist/sandbox/firestore/converters/fieldvalue.js +166 -0
- package/dist/sandbox/firestore/converters/fieldvalue.js.map +1 -0
- package/dist/sandbox/firestore/converters/reference.d.ts +31 -0
- package/dist/sandbox/firestore/converters/reference.d.ts.map +1 -0
- package/dist/sandbox/firestore/converters/reference.js +51 -0
- package/dist/sandbox/firestore/converters/reference.js.map +1 -0
- package/dist/sandbox/firestore/converters/timestamp.d.ts +32 -0
- package/dist/sandbox/firestore/converters/timestamp.d.ts.map +1 -0
- package/dist/sandbox/firestore/converters/timestamp.js +63 -0
- package/dist/sandbox/firestore/converters/timestamp.js.map +1 -0
- package/dist/sandbox/firestore/converters/user-timestamp.d.ts +46 -0
- package/dist/sandbox/firestore/converters/user-timestamp.d.ts.map +1 -0
- package/dist/sandbox/firestore/converters/user-timestamp.js +65 -0
- package/dist/sandbox/firestore/converters/user-timestamp.js.map +1 -0
- package/dist/sandbox/firestore/converters/vector.d.ts +24 -0
- package/dist/sandbox/firestore/converters/vector.d.ts.map +1 -0
- package/dist/sandbox/firestore/converters/vector.js +53 -0
- package/dist/sandbox/firestore/converters/vector.js.map +1 -0
- package/dist/sandbox/firestore/errors.d.ts +82 -0
- package/dist/sandbox/firestore/errors.d.ts.map +1 -0
- package/dist/sandbox/firestore/errors.js +54 -0
- package/dist/sandbox/firestore/errors.js.map +1 -0
- package/dist/sandbox/firestore/event-log.d.ts +99 -0
- package/dist/sandbox/firestore/event-log.d.ts.map +1 -0
- package/dist/sandbox/firestore/event-log.js +67 -0
- package/dist/sandbox/firestore/event-log.js.map +1 -0
- package/dist/sandbox/firestore/field-merge.d.ts +64 -0
- package/dist/sandbox/firestore/field-merge.d.ts.map +1 -0
- package/dist/sandbox/firestore/field-merge.js +221 -0
- package/dist/sandbox/firestore/field-merge.js.map +1 -0
- package/dist/sandbox/firestore/list-query-proof.d.ts +77 -0
- package/dist/sandbox/firestore/list-query-proof.d.ts.map +1 -0
- package/dist/sandbox/firestore/list-query-proof.js +170 -0
- package/dist/sandbox/firestore/list-query-proof.js.map +1 -0
- package/dist/sandbox/firestore/local-environment.d.ts +806 -0
- package/dist/sandbox/firestore/local-environment.d.ts.map +1 -0
- package/dist/sandbox/firestore/local-environment.js +3028 -0
- package/dist/sandbox/firestore/local-environment.js.map +1 -0
- package/dist/sandbox/firestore/local-state.d.ts +196 -0
- package/dist/sandbox/firestore/local-state.d.ts.map +1 -0
- package/dist/sandbox/firestore/local-state.js +413 -0
- package/dist/sandbox/firestore/local-state.js.map +1 -0
- package/dist/sandbox/firestore/overlay-backing.d.ts +44 -0
- package/dist/sandbox/firestore/overlay-backing.d.ts.map +1 -0
- package/dist/sandbox/firestore/overlay-backing.js +82 -0
- package/dist/sandbox/firestore/overlay-backing.js.map +1 -0
- package/dist/sandbox/firestore/sentinel-capture.d.ts +30 -0
- package/dist/sandbox/firestore/sentinel-capture.d.ts.map +1 -0
- package/dist/sandbox/firestore/sentinel-capture.js +61 -0
- package/dist/sandbox/firestore/sentinel-capture.js.map +1 -0
- package/dist/sandbox/firestore/snapshot-listeners.d.ts +284 -0
- package/dist/sandbox/firestore/snapshot-listeners.d.ts.map +1 -0
- package/dist/sandbox/firestore/snapshot-listeners.js +194 -0
- package/dist/sandbox/firestore/snapshot-listeners.js.map +1 -0
- package/dist/sandbox/firestore/topk.d.ts +12 -0
- package/dist/sandbox/firestore/topk.d.ts.map +1 -0
- package/dist/sandbox/firestore/topk.js +42 -0
- package/dist/sandbox/firestore/topk.js.map +1 -0
- package/dist/sandbox/firestore/transaction-merge.d.ts +55 -0
- package/dist/sandbox/firestore/transaction-merge.d.ts.map +1 -0
- package/dist/sandbox/firestore/transaction-merge.js +107 -0
- package/dist/sandbox/firestore/transaction-merge.js.map +1 -0
- package/dist/sandbox/firestore/transaction-types.d.ts +152 -0
- package/dist/sandbox/firestore/transaction-types.d.ts.map +1 -0
- package/dist/sandbox/firestore/transaction-types.js +10 -0
- package/dist/sandbox/firestore/transaction-types.js.map +1 -0
- package/dist/sandbox/firestore/transaction.d.ts +79 -0
- package/dist/sandbox/firestore/transaction.d.ts.map +1 -0
- package/dist/sandbox/firestore/transaction.js +95 -0
- package/dist/sandbox/firestore/transaction.js.map +1 -0
- package/dist/sandbox/firestore/value-equality.d.ts +2 -0
- package/dist/sandbox/firestore/value-equality.d.ts.map +1 -0
- package/dist/sandbox/firestore/value-equality.js +35 -0
- package/dist/sandbox/firestore/value-equality.js.map +1 -0
- package/dist/sandbox/firestore/value-resolver.d.ts +172 -0
- package/dist/sandbox/firestore/value-resolver.d.ts.map +1 -0
- package/dist/sandbox/firestore/value-resolver.js +221 -0
- package/dist/sandbox/firestore/value-resolver.js.map +1 -0
- package/dist/sandbox/firestore/wire-encoder.d.ts +14 -0
- package/dist/sandbox/firestore/wire-encoder.d.ts.map +1 -0
- package/dist/sandbox/firestore/wire-encoder.js +130 -0
- package/dist/sandbox/firestore/wire-encoder.js.map +1 -0
- package/dist/sandbox/index.d.ts +50 -0
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/index.js +63 -0
- package/dist/sandbox/index.js.map +1 -0
- package/dist/sandbox/internal/index.d.ts +36 -0
- package/dist/sandbox/internal/index.d.ts.map +1 -0
- package/dist/sandbox/internal/index.js +72 -0
- package/dist/sandbox/internal/index.js.map +1 -0
- package/dist/sandbox/internal/sandbox-impl.d.ts +343 -0
- package/dist/sandbox/internal/sandbox-impl.d.ts.map +1 -0
- package/dist/sandbox/internal/sandbox-impl.js +718 -0
- package/dist/sandbox/internal/sandbox-impl.js.map +1 -0
- package/dist/sandbox/persistence/backends.d.ts +37 -0
- package/dist/sandbox/persistence/backends.d.ts.map +1 -0
- package/dist/sandbox/persistence/backends.js +202 -0
- package/dist/sandbox/persistence/backends.js.map +1 -0
- package/dist/sandbox/persistence/chunk-format.d.ts +58 -0
- package/dist/sandbox/persistence/chunk-format.d.ts.map +1 -0
- package/dist/sandbox/persistence/chunk-format.js +163 -0
- package/dist/sandbox/persistence/chunk-format.js.map +1 -0
- package/dist/sandbox/persistence/controller.d.ts +39 -0
- package/dist/sandbox/persistence/controller.d.ts.map +1 -0
- package/dist/sandbox/persistence/controller.js +605 -0
- package/dist/sandbox/persistence/controller.js.map +1 -0
- package/dist/sandbox/persistence/index.d.ts +13 -0
- package/dist/sandbox/persistence/index.d.ts.map +1 -0
- package/dist/sandbox/persistence/index.js +5 -0
- package/dist/sandbox/persistence/index.js.map +1 -0
- package/dist/sandbox/persistence/serialize.d.ts +53 -0
- package/dist/sandbox/persistence/serialize.d.ts.map +1 -0
- package/dist/sandbox/persistence/serialize.js +98 -0
- package/dist/sandbox/persistence/serialize.js.map +1 -0
- package/dist/sandbox/persistence/types.d.ts +118 -0
- package/dist/sandbox/persistence/types.d.ts.map +1 -0
- package/dist/sandbox/persistence/types.js +15 -0
- package/dist/sandbox/persistence/types.js.map +1 -0
- package/dist/sandbox/remote.d.ts +118 -0
- package/dist/sandbox/remote.d.ts.map +1 -0
- package/dist/sandbox/remote.js +60 -0
- package/dist/sandbox/remote.js.map +1 -0
- package/dist/sandbox/replay/index.d.ts +106 -0
- package/dist/sandbox/replay/index.d.ts.map +1 -0
- package/dist/sandbox/replay/index.js +246 -0
- package/dist/sandbox/replay/index.js.map +1 -0
- package/dist/sandbox/sandbox-context.d.ts +40 -0
- package/dist/sandbox/sandbox-context.d.ts.map +1 -0
- package/dist/sandbox/sandbox-context.js +72 -0
- package/dist/sandbox/sandbox-context.js.map +1 -0
- package/dist/sandbox/tab-sync/index.d.ts +120 -0
- package/dist/sandbox/tab-sync/index.d.ts.map +1 -0
- package/dist/sandbox/tab-sync/index.js +272 -0
- package/dist/sandbox/tab-sync/index.js.map +1 -0
- package/dist/sandbox/types.d.ts +1235 -0
- package/dist/sandbox/types.d.ts.map +1 -0
- package/dist/sandbox/types.js +46 -0
- package/dist/sandbox/types.js.map +1 -0
- package/dist/storage/admin/api.d.ts +206 -0
- package/dist/storage/admin/api.d.ts.map +1 -0
- package/dist/storage/admin/api.js +349 -0
- package/dist/storage/admin/api.js.map +1 -0
- package/dist/storage/admin/handler.d.ts +29 -0
- package/dist/storage/admin/handler.d.ts.map +1 -0
- package/dist/storage/admin/handler.js +82 -0
- package/dist/storage/admin/handler.js.map +1 -0
- package/dist/storage/admin/spec.d.ts +64 -0
- package/dist/storage/admin/spec.d.ts.map +1 -0
- package/dist/storage/admin/spec.js +8 -0
- package/dist/storage/admin/spec.js.map +1 -0
- package/dist/storage/admin/tools.d.ts +23 -0
- package/dist/storage/admin/tools.d.ts.map +1 -0
- package/dist/storage/admin/tools.js +90 -0
- package/dist/storage/admin/tools.js.map +1 -0
- package/dist/storage/download.d.ts +27 -0
- package/dist/storage/download.d.ts.map +1 -0
- package/dist/storage/download.js +136 -0
- package/dist/storage/download.js.map +1 -0
- package/dist/storage/enforce.d.ts +26 -0
- package/dist/storage/enforce.d.ts.map +1 -0
- package/dist/storage/enforce.js +16 -0
- package/dist/storage/enforce.js.map +1 -0
- package/dist/storage/errors.d.ts +46 -0
- package/dist/storage/errors.d.ts.map +1 -0
- package/dist/storage/errors.js +62 -0
- package/dist/storage/errors.js.map +1 -0
- package/dist/storage/index.d.ts +49 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +60 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/internal.d.ts +18 -0
- package/dist/storage/internal.d.ts.map +1 -0
- package/dist/storage/internal.js +18 -0
- package/dist/storage/internal.js.map +1 -0
- package/dist/storage/list.d.ts +17 -0
- package/dist/storage/list.d.ts.map +1 -0
- package/dist/storage/list.js +91 -0
- package/dist/storage/list.js.map +1 -0
- package/dist/storage/metadata.d.ts +86 -0
- package/dist/storage/metadata.d.ts.map +1 -0
- package/dist/storage/metadata.js +167 -0
- package/dist/storage/metadata.js.map +1 -0
- package/dist/storage/persistence.d.ts +134 -0
- package/dist/storage/persistence.d.ts.map +1 -0
- package/dist/storage/persistence.js +132 -0
- package/dist/storage/persistence.js.map +1 -0
- package/dist/storage/reference.d.ts +63 -0
- package/dist/storage/reference.d.ts.map +1 -0
- package/dist/storage/reference.js +156 -0
- package/dist/storage/reference.js.map +1 -0
- package/dist/storage/rules.d.ts +176 -0
- package/dist/storage/rules.d.ts.map +1 -0
- package/dist/storage/rules.js +621 -0
- package/dist/storage/rules.js.map +1 -0
- package/dist/storage/service.d.ts +139 -0
- package/dist/storage/service.d.ts.map +1 -0
- package/dist/storage/service.js +241 -0
- package/dist/storage/service.js.map +1 -0
- package/dist/storage/upload.d.ts +43 -0
- package/dist/storage/upload.d.ts.map +1 -0
- package/dist/storage/upload.js +235 -0
- package/dist/storage/upload.js.map +1 -0
- package/package.json +109 -3
|
@@ -0,0 +1,701 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pyric/auth` — modular Web-SDK Auth adapter for the Pyric
|
|
3
|
+
* sandbox.
|
|
4
|
+
*
|
|
5
|
+
* Mirrors `firebase/auth`'s tree-shakable free-function surface
|
|
6
|
+
* (`getAuth`, `signInAnonymously`, `signInWithEmailAndPassword`,
|
|
7
|
+
* `onAuthStateChanged`, `signInWithPopup`, `GoogleAuthProvider`, …)
|
|
8
|
+
* with two backends picked at init:
|
|
9
|
+
*
|
|
10
|
+
* - **Sandbox target** — in-memory user DB + listener registry,
|
|
11
|
+
* drives `sandbox.currentUser` so service factories (a future
|
|
12
|
+
* `getFirestore(sandbox)` overload, follow-up PR) see identity
|
|
13
|
+
* changes without re-binding.
|
|
14
|
+
* - **Prod target** — delegates straight to `firebase/auth`.
|
|
15
|
+
*
|
|
16
|
+
* Same call surface across both. Agent code that writes against the
|
|
17
|
+
* sandbox during iteration runs unmodified against prod at deploy.
|
|
18
|
+
*
|
|
19
|
+
* Dual-target dispatch follows the same pattern as `pyric/firestore`:
|
|
20
|
+
* - {@link TARGET_SYMBOL} brands every {@link Auth} handle.
|
|
21
|
+
* - {@link targetOf} (internal) reads it and switches on
|
|
22
|
+
* `target.kind`.
|
|
23
|
+
*
|
|
24
|
+
* Sandbox-only test driver lives under {@link sandbox}, mirroring
|
|
25
|
+
* `pyric/firestore`'s `sandbox.setRules` etc. — each method throws
|
|
26
|
+
* `failed-precondition` if called against a prod-backed handle.
|
|
27
|
+
*
|
|
28
|
+
* v0 scope is deliberately minimal. The deny-list is documented in
|
|
29
|
+
* `docs/reference/feature-matrix.md`; agent `appSource` that imports
|
|
30
|
+
* any of those will fail to bundle once the playground's
|
|
31
|
+
* `firebase/auth` → `pyric/auth` alias swap lands.
|
|
32
|
+
*/
|
|
33
|
+
import { SandboxError } from 'pyric/sandbox';
|
|
34
|
+
import * as fb from 'firebase/auth';
|
|
35
|
+
// Phase 3 unified app handle. Adapter dispatch reads `APP_TARGET` and
|
|
36
|
+
// routes to the existing direct-handle path (sandbox vs prod).
|
|
37
|
+
import { APP_TARGET } from 'pyric/app';
|
|
38
|
+
import { SandboxBackend, makeAuthError, } from './sandbox-backend.js';
|
|
39
|
+
import { targetOf } from './target.js';
|
|
40
|
+
import { TARGET_SYMBOL, USER_INTERNAL, } from './types.js';
|
|
41
|
+
import { prodCreateUserWithEmailAndPassword, prodCurrentUser, prodGetRedirectResult, prodOnAuthStateChanged, prodOnIdTokenChanged, prodSetPersistence, prodSignInAnonymously, prodSignInWithCredential, prodSignInWithEmailAndPassword, prodSignInWithPopup, prodSignInWithRedirect, prodSignOut, } from './prod-backend.js';
|
|
42
|
+
export { TARGET_SYMBOL } from './types.js';
|
|
43
|
+
// ─── Re-exports: provider classes ─────────────────────────────────────
|
|
44
|
+
export { EmailAuthProvider, FacebookAuthProvider, GithubAuthProvider, GoogleAuthProvider, OAuthProvider, FEDERATED_PROVIDER_IDS, } from './providers.js';
|
|
45
|
+
// ─── Persistence markers ──────────────────────────────────────────────
|
|
46
|
+
//
|
|
47
|
+
// Opaque markers — sandbox treats them as no-ops, prod backend maps
|
|
48
|
+
// them to upstream's `inMemoryPersistence` / `browserSessionPersistence`
|
|
49
|
+
// / `browserLocalPersistence` singletons via `setPersistence`.
|
|
50
|
+
export const inMemoryPersistence = { type: 'NONE' };
|
|
51
|
+
export const browserSessionPersistence = { type: 'SESSION' };
|
|
52
|
+
export const browserLocalPersistence = { type: 'LOCAL' };
|
|
53
|
+
// ─── Memoization: one backend per sandbox ─────────────────────────────
|
|
54
|
+
//
|
|
55
|
+
// `firebase/auth.getAuth(app)` is idempotent — repeat calls for the
|
|
56
|
+
// same app return the same Auth instance. Mirror that on the sandbox
|
|
57
|
+
// side so listeners registered against one handle see changes
|
|
58
|
+
// driven through another handle for the same sandbox.
|
|
59
|
+
const sandboxBackends = new WeakMap();
|
|
60
|
+
const sandboxHandles = new WeakMap();
|
|
61
|
+
// Prod handles are memoized per underlying `fb.Auth`. `fb.getAuth(app)`
|
|
62
|
+
// is itself idempotent (same `fb.Auth` per app), but our *wrapper*
|
|
63
|
+
// handle was minted fresh on every `getAuth(app)` call — so
|
|
64
|
+
// `getAuth(app) !== getAuth(app)`, contradicting the docstring + COMPAT.
|
|
65
|
+
// Keying on the resolved `fb.Auth` makes the wrapper idempotent too,
|
|
66
|
+
// matching the sandbox side (AUTH-B6).
|
|
67
|
+
const prodHandles = new WeakMap();
|
|
68
|
+
function backendFor(sandbox) {
|
|
69
|
+
let backend = sandboxBackends.get(sandbox);
|
|
70
|
+
if (!backend) {
|
|
71
|
+
backend = new SandboxBackend(sandbox);
|
|
72
|
+
sandboxBackends.set(sandbox, backend);
|
|
73
|
+
// Register the auth user DB as a persistable service on the sandbox.
|
|
74
|
+
// This is the primary hook that makes `enablePersistence` include auth
|
|
75
|
+
// users in the serialized blob and restore them on reload.
|
|
76
|
+
//
|
|
77
|
+
// Registration is guarded by the backendFor memoization — we only
|
|
78
|
+
// reach this branch ONCE per sandbox, so double-registration is
|
|
79
|
+
// impossible in practice. `registerPersistableService` throws on
|
|
80
|
+
// duplicates anyway, which would surface as a bug if the invariant
|
|
81
|
+
// were ever broken.
|
|
82
|
+
//
|
|
83
|
+
// Capture `backend` in the closure via a local so the let-binding
|
|
84
|
+
// can be reassigned without breaking the hooks (TypeScript narrows it
|
|
85
|
+
// as non-null here, but the closures below need a stable reference).
|
|
86
|
+
const capturedBackend = backend;
|
|
87
|
+
sandbox.registerPersistableService('auth', {
|
|
88
|
+
snapshot: () => ({
|
|
89
|
+
users: capturedBackend.exportUsers(),
|
|
90
|
+
providers: capturedBackend.exportProviderConfig(),
|
|
91
|
+
}),
|
|
92
|
+
restore: (data) => {
|
|
93
|
+
const d = data;
|
|
94
|
+
// Restore is a REPLACE, not a merge: the user DB becomes EXACTLY what
|
|
95
|
+
// the snapshot holds. On boot / late-registration the backend is empty,
|
|
96
|
+
// so clearUsers() is a no-op; for a runtime `sandbox.loadSnapshot()`
|
|
97
|
+
// (transfer / branch switch) it drops users that diverged after the
|
|
98
|
+
// snapshot was taken, so the clobber is total.
|
|
99
|
+
capturedBackend.clearUsers();
|
|
100
|
+
if (Array.isArray(d?.users) && d.users.length > 0) {
|
|
101
|
+
capturedBackend.seedUsers(d.users);
|
|
102
|
+
}
|
|
103
|
+
// Same REPLACE policy for provider config. `restoreProviderConfig`
|
|
104
|
+
// falls back to the documented defaults when `d?.providers` is
|
|
105
|
+
// missing (a blob written before this feature existed), so older
|
|
106
|
+
// `--persist` files don't silently disable password/anonymous.
|
|
107
|
+
capturedBackend.restoreProviderConfig(d?.providers);
|
|
108
|
+
},
|
|
109
|
+
subscribe: (onChange) => {
|
|
110
|
+
const unsubUsers = capturedBackend.subscribeUsers(onChange);
|
|
111
|
+
const unsubProviders = capturedBackend.subscribeProviderConfig(onChange);
|
|
112
|
+
return () => {
|
|
113
|
+
unsubUsers();
|
|
114
|
+
unsubProviders();
|
|
115
|
+
};
|
|
116
|
+
},
|
|
117
|
+
// Session hooks — the persistence controller uses these to save and
|
|
118
|
+
// restore the CURRENTLY SIGNED-IN USER (the session), separate from
|
|
119
|
+
// the user database (handled above by snapshot/restore). The controller
|
|
120
|
+
// only activates session persistence when `sessionStorage` is injected
|
|
121
|
+
// into `enablePersistence` options; when omitted the hooks exist but
|
|
122
|
+
// are never called (no fake durability in non-browser environments).
|
|
123
|
+
session: {
|
|
124
|
+
currentUid: () => sandbox.currentUser?.uid ?? null,
|
|
125
|
+
restore: (uid) => capturedBackend.restoreSession(uid),
|
|
126
|
+
mode: () => capturedBackend.getPersistenceMode(),
|
|
127
|
+
subscribe: (onChange) => capturedBackend.subscribeSession(onChange),
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
return backend;
|
|
132
|
+
}
|
|
133
|
+
export function getAuth(target) {
|
|
134
|
+
// PyricApp dispatch: inspect the brand and forward to the existing
|
|
135
|
+
// direct-handle path. Ordered ABOVE the structural `isSandbox`
|
|
136
|
+
// sniff so a PyricApp's outer object (which doesn't itself carry
|
|
137
|
+
// `withAuth`) doesn't accidentally match either branch — and so a
|
|
138
|
+
// sandbox-app routes into the cached sandbox handle.
|
|
139
|
+
if (isPyricApp(target)) {
|
|
140
|
+
return target[APP_TARGET] === 'sandbox'
|
|
141
|
+
? getAuth(target.sandbox)
|
|
142
|
+
: getAuth(target.firebaseApp);
|
|
143
|
+
}
|
|
144
|
+
if (isSandbox(target)) {
|
|
145
|
+
let handle = sandboxHandles.get(target);
|
|
146
|
+
if (handle)
|
|
147
|
+
return handle;
|
|
148
|
+
const backend = backendFor(target);
|
|
149
|
+
const t = { kind: 'sandbox', sandbox: target, backend };
|
|
150
|
+
handle = makeAuthHandle(t);
|
|
151
|
+
sandboxHandles.set(target, handle);
|
|
152
|
+
return handle;
|
|
153
|
+
}
|
|
154
|
+
const fbAuth = fb.getAuth(target);
|
|
155
|
+
let handle = prodHandles.get(fbAuth);
|
|
156
|
+
if (handle)
|
|
157
|
+
return handle;
|
|
158
|
+
const t = { kind: 'prod', auth: fbAuth };
|
|
159
|
+
handle = makeAuthHandle(t);
|
|
160
|
+
prodHandles.set(fbAuth, handle);
|
|
161
|
+
return handle;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Brand-based test for the {@link PyricApp} overload. Reads the
|
|
165
|
+
* `APP_TARGET` symbol that `pyric/app`'s `initializeApp` stamps on
|
|
166
|
+
* every handle. Cheap + collision-free: a `Sandbox` / `FirebaseApp`
|
|
167
|
+
* will never carry this symbol.
|
|
168
|
+
*/
|
|
169
|
+
function isPyricApp(target) {
|
|
170
|
+
return (target !== null
|
|
171
|
+
&& typeof target === 'object'
|
|
172
|
+
&& APP_TARGET in target);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Brand-based discriminator for `getAuth`. A {@link Sandbox} carries
|
|
176
|
+
* the `onCurrentUserChanged` method (and `currentUser` accessor)
|
|
177
|
+
* which a `FirebaseApp` will never have; structural sniff is cheap
|
|
178
|
+
* and stable.
|
|
179
|
+
*/
|
|
180
|
+
function isSandbox(target) {
|
|
181
|
+
return (typeof target === 'object'
|
|
182
|
+
&& target !== null
|
|
183
|
+
&& typeof target.onCurrentUserChanged === 'function'
|
|
184
|
+
&& typeof target.withAuth === 'function');
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Build an Auth handle. `currentUser` is a getter so each access
|
|
188
|
+
* reads through to the live backend state — consumer code that holds
|
|
189
|
+
* an `auth` reference always sees the latest user (matches
|
|
190
|
+
* `firebase/auth`).
|
|
191
|
+
*/
|
|
192
|
+
function makeAuthHandle(target) {
|
|
193
|
+
const handle = {
|
|
194
|
+
[TARGET_SYMBOL]: target,
|
|
195
|
+
// Method form of `signOut(auth)` — `firebase/auth`'s `Auth` exposes
|
|
196
|
+
// both the free function and this method (AUTH-GAP). Delegates to the
|
|
197
|
+
// free function so the two share one code path.
|
|
198
|
+
signOut() {
|
|
199
|
+
return signOut(handle);
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
return Object.defineProperty(handle, 'currentUser', {
|
|
203
|
+
enumerable: true,
|
|
204
|
+
get() {
|
|
205
|
+
return target.kind === 'sandbox'
|
|
206
|
+
? target.backend.getCurrentUser()
|
|
207
|
+
: prodCurrentUser(target.auth);
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
// ─── Emulator wiring ──────────────────────────────────────────────────
|
|
212
|
+
/**
|
|
213
|
+
* `connectAuthEmulator(auth, url, options?)` — on sandbox handles
|
|
214
|
+
* this is a no-op (the sandbox IS the emulator); on prod it
|
|
215
|
+
* delegates straight to `firebase/auth.connectAuthEmulator`.
|
|
216
|
+
*
|
|
217
|
+
* Same signature as upstream so consumer code that calls this at
|
|
218
|
+
* init time works against both backends unchanged.
|
|
219
|
+
*/
|
|
220
|
+
export function connectAuthEmulator(auth, url, options) {
|
|
221
|
+
const target = targetOf(auth);
|
|
222
|
+
if (target.kind === 'sandbox')
|
|
223
|
+
return;
|
|
224
|
+
// Upstream types require `disableWarnings: boolean` (not optional);
|
|
225
|
+
// normalize to false when callers omit it.
|
|
226
|
+
fb.connectAuthEmulator(target.auth, url, {
|
|
227
|
+
disableWarnings: options?.disableWarnings ?? false,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
// ─── Sign-in / out free functions ─────────────────────────────────────
|
|
231
|
+
export async function signInAnonymously(auth) {
|
|
232
|
+
const target = targetOf(auth);
|
|
233
|
+
if (target.kind === 'prod')
|
|
234
|
+
return prodSignInAnonymously(target.auth);
|
|
235
|
+
target.backend.assertProviderEnabled('anonymous');
|
|
236
|
+
// Match `firebase/auth` semantics: if there's already an anonymous
|
|
237
|
+
// user signed in, reuse them rather than minting a fresh uid.
|
|
238
|
+
// Production persists anonymous users across page loads via the
|
|
239
|
+
// configured Persistence; the sandbox has no equivalent, but within
|
|
240
|
+
// a single sandbox lifetime an already-signed-in anonymous user is
|
|
241
|
+
// the same identity from the consumer's perspective. Without this
|
|
242
|
+
// check, React StrictMode (or any double-mount pattern) leaks a
|
|
243
|
+
// new anonymous user per mount — `anonymous-1`, `anonymous-2`, …
|
|
244
|
+
// each with their own owner-only profile docs nobody can clean up.
|
|
245
|
+
const existing = target.backend.getCurrentUser();
|
|
246
|
+
if (existing && existing.isAnonymous) {
|
|
247
|
+
return { user: existing, providerId: null, operationType: 'signIn' };
|
|
248
|
+
}
|
|
249
|
+
const user = target.backend.mintAnonymousUser();
|
|
250
|
+
target.backend.setCurrentUser(user, 'anonymous');
|
|
251
|
+
return { user, providerId: null, operationType: 'signIn' };
|
|
252
|
+
}
|
|
253
|
+
export async function signInWithEmailAndPassword(auth, email, password) {
|
|
254
|
+
const target = targetOf(auth);
|
|
255
|
+
if (target.kind === 'prod') {
|
|
256
|
+
return prodSignInWithEmailAndPassword(target.auth, email, password);
|
|
257
|
+
}
|
|
258
|
+
target.backend.assertProviderEnabled('password');
|
|
259
|
+
const stored = target.backend.validatePassword(email, password);
|
|
260
|
+
const user = target.backend.buildUserFromStored(stored);
|
|
261
|
+
// The backend records the originating provider ('password') on the
|
|
262
|
+
// identity for provider tracking, while the credential's providerId
|
|
263
|
+
// stays null for email/password — matches prod. Upstream
|
|
264
|
+
// `providerIdForResponse` returns null when the token response carries
|
|
265
|
+
// no providerId (email/password responses don't; only OAuth/phone do —
|
|
266
|
+
// `core/user/user_credential_impl.ts:84-96`). Oracle:
|
|
267
|
+
// scripts/oracle/observations/auth-createUser-operationType.json pins
|
|
268
|
+
// providerId: null against prod (AUTH-B2).
|
|
269
|
+
target.backend.setCurrentUser(user, 'password');
|
|
270
|
+
return { user, providerId: null, operationType: 'signIn' };
|
|
271
|
+
}
|
|
272
|
+
export async function createUserWithEmailAndPassword(auth, email, password) {
|
|
273
|
+
const target = targetOf(auth);
|
|
274
|
+
if (target.kind === 'prod') {
|
|
275
|
+
return prodCreateUserWithEmailAndPassword(target.auth, email, password);
|
|
276
|
+
}
|
|
277
|
+
target.backend.assertProviderEnabled('password');
|
|
278
|
+
const stored = target.backend.createEmailPasswordUser(email, password);
|
|
279
|
+
const user = target.backend.buildUserFromStored(stored);
|
|
280
|
+
// providerId: null — same rationale as signInWithEmailAndPassword above
|
|
281
|
+
// (the exact field the oracle capture contradicted; audit H6 / AUTH-B2);
|
|
282
|
+
// 'password' still recorded on the identity for provider tracking.
|
|
283
|
+
target.backend.setCurrentUser(user, 'password');
|
|
284
|
+
return { user, providerId: null, operationType: 'signIn' };
|
|
285
|
+
}
|
|
286
|
+
export async function signOut(auth) {
|
|
287
|
+
const target = targetOf(auth);
|
|
288
|
+
if (target.kind === 'prod')
|
|
289
|
+
return prodSignOut(target.auth);
|
|
290
|
+
target.backend.setCurrentUser(null);
|
|
291
|
+
}
|
|
292
|
+
export async function setPersistence(auth, persistence) {
|
|
293
|
+
const target = targetOf(auth);
|
|
294
|
+
if (target.kind === 'prod')
|
|
295
|
+
return prodSetPersistence(target.auth, persistence);
|
|
296
|
+
// Sandbox: record the mode on the backend so the persistence controller
|
|
297
|
+
// can pick the right web-storage slot (local / session / none) for the
|
|
298
|
+
// current session. The backend's setPersistenceMode notifies session-
|
|
299
|
+
// change subscribers, causing the controller to immediately migrate any
|
|
300
|
+
// stored uid to the new store — matching the real SDK's setMode behavior
|
|
301
|
+
// where the active session follows the new persistence target.
|
|
302
|
+
//
|
|
303
|
+
// Mode mapping: our persistence markers carry `.type` strings that match
|
|
304
|
+
// the `'LOCAL' | 'SESSION' | 'NONE'` enum exactly.
|
|
305
|
+
// inMemoryPersistence → { type: 'NONE' }
|
|
306
|
+
// browserSessionPersistence → { type: 'SESSION' }
|
|
307
|
+
// browserLocalPersistence → { type: 'LOCAL' }
|
|
308
|
+
const modeMap = {
|
|
309
|
+
LOCAL: 'LOCAL',
|
|
310
|
+
SESSION: 'SESSION',
|
|
311
|
+
NONE: 'NONE',
|
|
312
|
+
};
|
|
313
|
+
const mode = modeMap[persistence.type] ?? 'LOCAL';
|
|
314
|
+
target.backend.setPersistenceMode(mode);
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Resolve a popup/redirect sign-in to a `UserCredential`, mirroring
|
|
318
|
+
* `firebase/auth`'s `_withDefaultResolver` precedence:
|
|
319
|
+
* per-call resolver → injected resolver → one-shot mock → throw.
|
|
320
|
+
* With nothing configured it throws `auth/argument-error` (exactly what
|
|
321
|
+
* upstream throws with no resolver), naming the API that was actually
|
|
322
|
+
* called. The one-shot mock keeps headless conformance deterministic.
|
|
323
|
+
*/
|
|
324
|
+
async function resolveFlow(backend, provider, authType, perCall, kind) {
|
|
325
|
+
// Gate BEFORE touching the resolver/mock registry, so a disabled provider
|
|
326
|
+
// throws `auth/operation-not-allowed` — distinct from the `auth/argument-
|
|
327
|
+
// error` below, which keeps meaning "enabled, but no resolver/mock wired".
|
|
328
|
+
backend.assertProviderEnabled(provider.providerId);
|
|
329
|
+
const req = { providerId: provider.providerId, authType };
|
|
330
|
+
const resolver = perCall ?? backend.getResolver();
|
|
331
|
+
if (resolver)
|
|
332
|
+
return kind === 'popup' ? resolver.openPopup(req) : resolver.openRedirect(req);
|
|
333
|
+
const mock = backend.consumeMockResult(provider.providerId);
|
|
334
|
+
if (mock)
|
|
335
|
+
return mock;
|
|
336
|
+
const api = kind === 'popup' ? 'signInWithPopup' : 'signInWithRedirect';
|
|
337
|
+
throw makeAuthError('auth/argument-error', `${api}(provider: ${provider.providerId}): no AuthFlowResolver configured. Inject one with sandbox.setAuthFlowResolver(auth, resolver), pass one as the 3rd argument, or pre-stage a result with sandbox.mockSignInResult(auth, {user, providerId: '${provider.providerId}', …}).`);
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* The `resolver` argument is sandbox-only: on a prod-backed handle the
|
|
341
|
+
* call delegates to `firebase/auth`, which uses its own platform default
|
|
342
|
+
* (browser) resolver, and this argument is ignored.
|
|
343
|
+
*/
|
|
344
|
+
export async function signInWithPopup(auth, provider, resolver) {
|
|
345
|
+
const target = targetOf(auth);
|
|
346
|
+
if (target.kind === 'prod')
|
|
347
|
+
return prodSignInWithPopup(target.auth, provider);
|
|
348
|
+
const cred = await resolveFlow(target.backend, provider, 'signIn', resolver, 'popup');
|
|
349
|
+
const providerId = cred.providerId ?? provider.providerId;
|
|
350
|
+
target.backend.assertSignInAllowed(cred.user.uid);
|
|
351
|
+
target.backend.recordProviderSignIn(cred.user, providerId);
|
|
352
|
+
target.backend.setCurrentUser(cred.user, providerId);
|
|
353
|
+
return cred;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* The `resolver` argument is sandbox-only — see {@link signInWithPopup}.
|
|
357
|
+
*/
|
|
358
|
+
export async function signInWithRedirect(auth, provider, resolver) {
|
|
359
|
+
const target = targetOf(auth);
|
|
360
|
+
if (target.kind === 'prod')
|
|
361
|
+
return prodSignInWithRedirect(target.auth, provider);
|
|
362
|
+
// Sandbox has no navigation, so the resolver resolves inline; stash the
|
|
363
|
+
// credential + sign in so getRedirectResult returns it once (matches the
|
|
364
|
+
// observable prod outcome: after the redirect completes the user is
|
|
365
|
+
// signed in and getRedirectResult yields the credential).
|
|
366
|
+
const cred = await resolveFlow(target.backend, provider, 'signIn', resolver, 'redirect');
|
|
367
|
+
const providerId = cred.providerId ?? provider.providerId;
|
|
368
|
+
target.backend.assertSignInAllowed(cred.user.uid);
|
|
369
|
+
target.backend.setRedirectResult(cred);
|
|
370
|
+
target.backend.recordProviderSignIn(cred.user, providerId);
|
|
371
|
+
target.backend.setCurrentUser(cred.user, providerId);
|
|
372
|
+
}
|
|
373
|
+
export async function getRedirectResult(auth, _resolver) {
|
|
374
|
+
const target = targetOf(auth);
|
|
375
|
+
if (target.kind === 'prod')
|
|
376
|
+
return prodGetRedirectResult(target.auth);
|
|
377
|
+
return target.backend.takeRedirectResult();
|
|
378
|
+
}
|
|
379
|
+
export async function signInWithCredential(auth, credential) {
|
|
380
|
+
const target = targetOf(auth);
|
|
381
|
+
if (target.kind === 'prod')
|
|
382
|
+
return prodSignInWithCredential(target.auth, credential);
|
|
383
|
+
const providerId = credential.providerId;
|
|
384
|
+
// Gate BEFORE consuming the mock — see the `resolveFlow` gating note above
|
|
385
|
+
// for why `operation-not-allowed` must fire ahead of the mock-registry check.
|
|
386
|
+
target.backend.assertProviderEnabled(providerId);
|
|
387
|
+
const mock = target.backend.consumeMockResult(providerId);
|
|
388
|
+
if (!mock) {
|
|
389
|
+
throw makeAuthError('auth/no-mock-configured', `signInWithCredential(providerId: ${providerId}): no mock configured. Pre-stage with sandbox.mockSignInResult(auth, {user, providerId: '${providerId}', …}).`);
|
|
390
|
+
}
|
|
391
|
+
const credProviderId = mock.providerId ?? providerId;
|
|
392
|
+
target.backend.assertSignInAllowed(mock.user.uid);
|
|
393
|
+
target.backend.recordProviderSignIn(mock.user, credProviderId);
|
|
394
|
+
target.backend.setCurrentUser(mock.user, credProviderId);
|
|
395
|
+
return mock;
|
|
396
|
+
}
|
|
397
|
+
// ─── Observers ────────────────────────────────────────────────────────
|
|
398
|
+
export function onAuthStateChanged(auth, observer) {
|
|
399
|
+
const target = targetOf(auth);
|
|
400
|
+
if (target.kind === 'prod')
|
|
401
|
+
return prodOnAuthStateChanged(target.auth, observer);
|
|
402
|
+
return target.backend.subscribe('auth-state', observer);
|
|
403
|
+
}
|
|
404
|
+
export function onIdTokenChanged(auth, observer) {
|
|
405
|
+
const target = targetOf(auth);
|
|
406
|
+
if (target.kind === 'prod')
|
|
407
|
+
return prodOnIdTokenChanged(target.auth, observer);
|
|
408
|
+
// Sandbox: fires on identity transitions AND on
|
|
409
|
+
// `getIdToken(true)` forced refreshes — matches prod.
|
|
410
|
+
// Oracle: scripts/oracle/observations/auth-onidtokenchanged-force-refresh.json.
|
|
411
|
+
return target.backend.subscribe('id-token', observer);
|
|
412
|
+
}
|
|
413
|
+
// ─── Token accessors ──────────────────────────────────────────────────
|
|
414
|
+
/**
|
|
415
|
+
* Top-level mirror of `firebase/auth`'s `getIdToken(user)`. Delegates
|
|
416
|
+
* to the method on the user handle, so it works on both backends.
|
|
417
|
+
*
|
|
418
|
+
* Parity provenance: W1.5 grid (2026-06-10) — generated apps import
|
|
419
|
+
* the modular free function, and its absence failed every render of
|
|
420
|
+
* the claims-driven fixtures.
|
|
421
|
+
*/
|
|
422
|
+
export async function getIdToken(user, forceRefresh) {
|
|
423
|
+
return user.getIdToken(forceRefresh);
|
|
424
|
+
}
|
|
425
|
+
/** Top-level mirror of `firebase/auth`'s `getIdTokenResult(user)`. */
|
|
426
|
+
export async function getIdTokenResult(user, forceRefresh) {
|
|
427
|
+
return user.getIdTokenResult(forceRefresh);
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Top-level mirror of `firebase/auth`'s `updateProfile(user, profile)`.
|
|
431
|
+
* Updates the signed-in user's `displayName` / `photoURL` — pass `null` to
|
|
432
|
+
* clear a field, omit it to leave it untouched. Mutates the user object in
|
|
433
|
+
* place (held references, including `auth.currentUser`, reflect the change).
|
|
434
|
+
*
|
|
435
|
+
* Dispatches through the hidden {@link USER_INTERNAL} hook the backend stamps
|
|
436
|
+
* on every `User`, so it routes correctly WITHOUT an `auth` handle — matching
|
|
437
|
+
* upstream's user-only signature. Works on both sandbox and prod targets.
|
|
438
|
+
*
|
|
439
|
+
* Per `firebase/auth`, this does NOT fire `onAuthStateChanged` /
|
|
440
|
+
* `onIdTokenChanged`.
|
|
441
|
+
*/
|
|
442
|
+
export async function updateProfile(user, profile) {
|
|
443
|
+
const internal = user[USER_INTERNAL];
|
|
444
|
+
if (!internal) {
|
|
445
|
+
throw makeAuthError('auth/invalid-user-token', 'updateProfile: unrecognized user — was it produced by a pyric/auth sign-in?');
|
|
446
|
+
}
|
|
447
|
+
return internal.updateProfile(profile);
|
|
448
|
+
}
|
|
449
|
+
// ─── Sandbox-only test driver ─────────────────────────────────────────
|
|
450
|
+
/**
|
|
451
|
+
* Sandbox-only lifecycle / test-driver surface. Throws
|
|
452
|
+
* `failed-precondition` on prod-backed handles — mirrors the
|
|
453
|
+
* `pyric/firestore` `sandbox.*` pattern.
|
|
454
|
+
*
|
|
455
|
+
* **Naming note:** the `sandbox` export name collides with the
|
|
456
|
+
* common `const sandbox = initializeSandbox()` local. Alias on
|
|
457
|
+
* import if both are in scope:
|
|
458
|
+
*
|
|
459
|
+
* ```ts
|
|
460
|
+
* import { sandbox as authSandbox } from 'pyric/auth';
|
|
461
|
+
* import { initializeSandbox } from 'pyric/sandbox';
|
|
462
|
+
* const sandbox = initializeSandbox();
|
|
463
|
+
* const auth = getAuth(sandbox);
|
|
464
|
+
* authSandbox.seedUsers(auth, […]);
|
|
465
|
+
* ```
|
|
466
|
+
*/
|
|
467
|
+
export const sandbox = {
|
|
468
|
+
/**
|
|
469
|
+
* Force the current user (and emit to listeners). Pass `null` to
|
|
470
|
+
* sign out. Bypasses the email/password lookup — useful for
|
|
471
|
+
* driving auth state directly in tests without seeding.
|
|
472
|
+
*/
|
|
473
|
+
setUser(auth, user) {
|
|
474
|
+
requireSandbox(auth, 'sandbox.setUser').backend.setCurrentUser(user);
|
|
475
|
+
},
|
|
476
|
+
/**
|
|
477
|
+
* Install the popup/redirect resolver — the analog of browser
|
|
478
|
+
* `getAuth` wiring `browserPopupRedirectResolver`. The host
|
|
479
|
+
* (playground) sets this once; `signInWithPopup` / `signInWithRedirect`
|
|
480
|
+
* then delegate the experience to it. Pass `null` to clear.
|
|
481
|
+
*
|
|
482
|
+
* Precedence at sign-in time: a per-call resolver arg wins, then this
|
|
483
|
+
* injected one, then a one-shot `mockSignInResult`, else
|
|
484
|
+
* `auth/argument-error`.
|
|
485
|
+
*/
|
|
486
|
+
setAuthFlowResolver(auth, resolver) {
|
|
487
|
+
requireSandbox(auth, 'sandbox.setAuthFlowResolver').backend.setResolver(resolver);
|
|
488
|
+
},
|
|
489
|
+
/**
|
|
490
|
+
* Snapshot every known identity (seeded + created), for a host
|
|
491
|
+
* account-picker UI. Sandbox-only — no `firebase/auth` equivalent.
|
|
492
|
+
*/
|
|
493
|
+
listIdentities(auth) {
|
|
494
|
+
return requireSandbox(auth, 'sandbox.listIdentities').backend.listIdentities();
|
|
495
|
+
},
|
|
496
|
+
/**
|
|
497
|
+
* Mint a sign-in credential for a host-driven flow — the account
|
|
498
|
+
* picker's "pick existing" (`{providerId, uid}`) and "add account"
|
|
499
|
+
* (`{providerId, spec}`) actions. Token + claims synthesis is
|
|
500
|
+
* backend-owned (routed through the same token cache as every
|
|
501
|
+
* other sign-in), replacing host-synthesized token strings.
|
|
502
|
+
*
|
|
503
|
+
* The credential does NOT sign anyone in — resolve the pending
|
|
504
|
+
* `AuthFlowResolver` promise with it and the in-flight
|
|
505
|
+
* `signInWithPopup` / `signInWithRedirect` completes the sign-in.
|
|
506
|
+
*/
|
|
507
|
+
createSignInCredential(auth, request) {
|
|
508
|
+
return requireSandbox(auth, 'sandbox.createSignInCredential')
|
|
509
|
+
.backend.createSignInCredential(request);
|
|
510
|
+
},
|
|
511
|
+
/**
|
|
512
|
+
* Pre-stage the result that the next `signInWithPopup` /
|
|
513
|
+
* `signInWithCredential` call for the matching `providerId`
|
|
514
|
+
* returns. The one-shot tier of the resolver precedence (used when no
|
|
515
|
+
* resolver is injected) — consumed by the next sign-in call; stage
|
|
516
|
+
* again for repeat tests.
|
|
517
|
+
*/
|
|
518
|
+
mockSignInResult(auth, result) {
|
|
519
|
+
const backend = requireSandbox(auth, 'sandbox.mockSignInResult').backend;
|
|
520
|
+
const providerId = result.providerId;
|
|
521
|
+
if (!providerId) {
|
|
522
|
+
throw new SandboxError('invalid-argument', 'sandbox.mockSignInResult: result.providerId is required so the next signInWithPopup / signInWithCredential call can match.');
|
|
523
|
+
}
|
|
524
|
+
backend.setMockResult(providerId, result);
|
|
525
|
+
},
|
|
526
|
+
/**
|
|
527
|
+
* Bulk-load test users for email/password lookup. Idempotent for
|
|
528
|
+
* a given uid+email — re-seeding the same uid overwrites.
|
|
529
|
+
*/
|
|
530
|
+
seedUsers(auth, users) {
|
|
531
|
+
requireSandbox(auth, 'sandbox.seedUsers').backend.seedUsers(users);
|
|
532
|
+
},
|
|
533
|
+
/**
|
|
534
|
+
* Export the user DB in the exact shape {@link sandbox.seedUsers}
|
|
535
|
+
* accepts — `exportUsers` → `seedUsers` round-trips losslessly (the
|
|
536
|
+
* persistence substrate, the design rationale section 3c).
|
|
537
|
+
* Provider-flow identities without a password export with a documented
|
|
538
|
+
* sentinel; anonymous users are not exported (ephemeral by design).
|
|
539
|
+
*/
|
|
540
|
+
exportUsers(auth) {
|
|
541
|
+
return requireSandbox(auth, 'sandbox.exportUsers').backend.exportUsers();
|
|
542
|
+
},
|
|
543
|
+
/**
|
|
544
|
+
* Re-establish a signed-in session for an EXISTING identity — the
|
|
545
|
+
* substrate behind web-storage session persistence at the host layer.
|
|
546
|
+
* Fires auth-state listeners like a real restored session. Throws
|
|
547
|
+
* `auth/user-not-found` for unknown uids, `auth/user-disabled` for
|
|
548
|
+
* disabled accounts (a restore is a sign-in).
|
|
549
|
+
*/
|
|
550
|
+
restoreSession(auth, uid) {
|
|
551
|
+
return requireSandbox(auth, 'sandbox.restoreSession').backend.restoreSession(uid);
|
|
552
|
+
},
|
|
553
|
+
/**
|
|
554
|
+
* Mint a session identity WITHOUT signing it in globally — the
|
|
555
|
+
* substrate for **per-connection identity** at the serve layer
|
|
556
|
+
* (issue #754): one shared sandbox, N connections (tabs / clients),
|
|
557
|
+
* each with its own authenticated session. Performs a real sign-in's
|
|
558
|
+
* bookkeeping (provider record, `lastLoginAt`, a fresh token, the
|
|
559
|
+
* `sign_in` activity event) but leaves `auth.currentUser`, the
|
|
560
|
+
* auth-state listeners, and session persistence untouched.
|
|
561
|
+
*
|
|
562
|
+
* Returns the `User` plus the `AuthState` its data contexts should
|
|
563
|
+
* carry — `getFirestore(sandbox.withAuth(session.state))` evaluates
|
|
564
|
+
* rules exactly as a real sign-in would (`request.auth.uid` +
|
|
565
|
+
* custom claims on `request.auth.token`).
|
|
566
|
+
*
|
|
567
|
+
* This is an AUTHENTIC session (credentials are validated / an
|
|
568
|
+
* identity is really minted) — distinct from the rules-debugging
|
|
569
|
+
* impersonation lens, which asserts a uid without authenticating.
|
|
570
|
+
*/
|
|
571
|
+
mintSession(auth, request) {
|
|
572
|
+
return requireSandbox(auth, 'sandbox.mintSession').backend.mintDetachedSession(request);
|
|
573
|
+
},
|
|
574
|
+
// ── User-admin surface (emulator-REST-shaped) ──────────────────────
|
|
575
|
+
/**
|
|
576
|
+
* Every user in the sandbox user DB (seeded, created,
|
|
577
|
+
* signed-in-via-provider, anonymous) as {@link AuthUserRecord}s.
|
|
578
|
+
* Snapshot — subscribe to changes via {@link sandbox.subscribeUsers}.
|
|
579
|
+
*/
|
|
580
|
+
listUsers(auth) {
|
|
581
|
+
return requireSandbox(auth, 'sandbox.listUsers').backend.listUsers();
|
|
582
|
+
},
|
|
583
|
+
/**
|
|
584
|
+
* Create a user without signing them in (admin semantics — the
|
|
585
|
+
* client-mirror `createUserWithEmailAndPassword` is the
|
|
586
|
+
* signs-you-in variant). Throws `auth/uid-already-exists`,
|
|
587
|
+
* `auth/email-already-in-use`, `auth/invalid-email`,
|
|
588
|
+
* `auth/weak-password` on bad input.
|
|
589
|
+
*/
|
|
590
|
+
createUser(auth, request) {
|
|
591
|
+
return requireSandbox(auth, 'sandbox.createUser').backend.createUser(request);
|
|
592
|
+
},
|
|
593
|
+
/**
|
|
594
|
+
* Update a user. `undefined` fields untouched; `customClaims`
|
|
595
|
+
* replaces the whole map; setting `disabled: true` blocks future
|
|
596
|
+
* sign-ins with `auth/user-disabled` (active sessions continue —
|
|
597
|
+
* same as prod until token revocation).
|
|
598
|
+
*/
|
|
599
|
+
updateUser(auth, uid, update) {
|
|
600
|
+
return requireSandbox(auth, 'sandbox.updateUser').backend.updateUser(uid, update);
|
|
601
|
+
},
|
|
602
|
+
/**
|
|
603
|
+
* Update a user's PROFILE (`displayName` / `photoURL`) by uid — the
|
|
604
|
+
* backend behind the served worker path's `updateProfile`. `undefined`
|
|
605
|
+
* fields untouched; `null` clears. Returns the refreshed record; throws
|
|
606
|
+
* `auth/user-not-found` for an unknown uid. (The client-facing
|
|
607
|
+
* `updateProfile(user, …)` free function is the app-code surface; this is
|
|
608
|
+
* the by-uid op the SharedWorker host calls.)
|
|
609
|
+
*/
|
|
610
|
+
updateProfile(auth, uid, profile) {
|
|
611
|
+
return requireSandbox(auth, 'sandbox.updateProfile').backend.updateProfileByUid(uid, profile);
|
|
612
|
+
},
|
|
613
|
+
/** Delete a user record. Throws `auth/user-not-found` for unknown
|
|
614
|
+
* uids. Active sessions are not terminated (prod parity). */
|
|
615
|
+
deleteUser(auth, uid) {
|
|
616
|
+
requireSandbox(auth, 'sandbox.deleteUser').backend.deleteUser(uid);
|
|
617
|
+
},
|
|
618
|
+
/** Drop every user record — the emulator's "delete all accounts". */
|
|
619
|
+
clearUsers(auth) {
|
|
620
|
+
requireSandbox(auth, 'sandbox.clearUsers').backend.clearUsers();
|
|
621
|
+
},
|
|
622
|
+
/**
|
|
623
|
+
* Subscribe to user-DB mutations (seed / create / update / delete /
|
|
624
|
+
* clear / provider links / lastLoginAt bumps). Coarse contract: no
|
|
625
|
+
* payload, no initial fire — re-list via {@link sandbox.listUsers}
|
|
626
|
+
* in the callback.
|
|
627
|
+
*/
|
|
628
|
+
subscribeUsers(auth, callback) {
|
|
629
|
+
return requireSandbox(auth, 'sandbox.subscribeUsers').backend.subscribeUsers(callback);
|
|
630
|
+
},
|
|
631
|
+
// ── Sign-in provider config (Authentication → Sign-in method toggles) ──
|
|
632
|
+
/**
|
|
633
|
+
* Every provider this sandbox has an explicit enablement for —
|
|
634
|
+
* seeded defaults (`password`, `anonymous` — both `true`) plus
|
|
635
|
+
* anything toggled via {@link sandbox.setAuthProviderConfig}. Every
|
|
636
|
+
* OTHER providerId (`google.com`, a custom OAuth id, …) is disabled
|
|
637
|
+
* until explicitly enabled.
|
|
638
|
+
*/
|
|
639
|
+
getAuthProviderConfig(auth) {
|
|
640
|
+
return requireSandbox(auth, 'sandbox.getAuthProviderConfig').backend.listProviderConfig();
|
|
641
|
+
},
|
|
642
|
+
/**
|
|
643
|
+
* Enable/disable a sign-in provider. Gated at every provider entry
|
|
644
|
+
* point of the ENFORCING backend (`signInWithPopup`/`signInWithRedirect`,
|
|
645
|
+
* `signInWithCredential`, `createUserWithEmailAndPassword`/
|
|
646
|
+
* `signInWithEmailAndPassword` for `'password'`, `signInAnonymously`
|
|
647
|
+
* for `'anonymous'`) — disabling a provider makes the matching sign-in
|
|
648
|
+
* call throw real Firebase's `auth/operation-not-allowed`, exactly
|
|
649
|
+
* like flipping the toggle off in the real console. Survives
|
|
650
|
+
* `enablePersistence` round-trips (rides the `auth` service's
|
|
651
|
+
* snapshot alongside the user DB). A backend whose enforcement is
|
|
652
|
+
* delegated ({@link sandbox.delegateProviderEnforcement}) does NOT
|
|
653
|
+
* gate locally — the remote authority it fronts does.
|
|
654
|
+
*/
|
|
655
|
+
setAuthProviderConfig(auth, providerId, enabled) {
|
|
656
|
+
requireSandbox(auth, 'sandbox.setAuthProviderConfig').backend.setProviderConfig(providerId, enabled);
|
|
657
|
+
},
|
|
658
|
+
/**
|
|
659
|
+
* Assert a provider is enabled — throws `auth/operation-not-allowed`
|
|
660
|
+
* (the exact gate every provider entry point uses) when it is off.
|
|
661
|
+
* For hosts that ARE the enforcement authority for identities
|
|
662
|
+
* resolved elsewhere: the served SharedWorker calls this before
|
|
663
|
+
* accepting a page-resolved popup/redirect identity
|
|
664
|
+
* (`auth.acceptIdentity`), so Studio's provider toggles gate served
|
|
665
|
+
* OAuth sign-in at the shared backend, not at each page's UI shim.
|
|
666
|
+
*/
|
|
667
|
+
assertAuthProviderEnabled(auth, providerId) {
|
|
668
|
+
requireSandbox(auth, 'sandbox.assertAuthProviderEnabled').backend.assertProviderEnabled(providerId);
|
|
669
|
+
},
|
|
670
|
+
/**
|
|
671
|
+
* Delegate (or reclaim) THIS handle's provider-enablement gate to a
|
|
672
|
+
* remote authority. Serve-layer wiring: in SharedWorker mode the
|
|
673
|
+
* page-local sandbox is only the UI vehicle for popup/redirect
|
|
674
|
+
* resolution — the worker's `auth.acceptIdentity` gate (against the
|
|
675
|
+
* worker's own, undelegated config) is the real toggle enforcement —
|
|
676
|
+
* so the served `firebase/auth` entry sets `true` on the in-page
|
|
677
|
+
* handle to let the picker open regardless of local defaults. Do NOT
|
|
678
|
+
* set this on a backend that is itself the authority.
|
|
679
|
+
*/
|
|
680
|
+
delegateProviderEnforcement(auth, delegated) {
|
|
681
|
+
requireSandbox(auth, 'sandbox.delegateProviderEnforcement')
|
|
682
|
+
.backend.setProviderEnforcementDelegated(delegated);
|
|
683
|
+
},
|
|
684
|
+
/**
|
|
685
|
+
* Subscribe to provider-config mutations. Coarse contract: no
|
|
686
|
+
* payload, no initial fire — re-read via
|
|
687
|
+
* {@link sandbox.getAuthProviderConfig} in the callback (same shape
|
|
688
|
+
* as {@link sandbox.subscribeUsers}).
|
|
689
|
+
*/
|
|
690
|
+
subscribeAuthProviderConfig(auth, callback) {
|
|
691
|
+
return requireSandbox(auth, 'sandbox.subscribeAuthProviderConfig').backend.subscribeProviderConfig(callback);
|
|
692
|
+
},
|
|
693
|
+
};
|
|
694
|
+
function requireSandbox(auth, name) {
|
|
695
|
+
const target = targetOf(auth);
|
|
696
|
+
if (target.kind !== 'sandbox') {
|
|
697
|
+
throw new SandboxError('failed-precondition', `${name} is sandbox-only; this Auth handle is prod-backed.`);
|
|
698
|
+
}
|
|
699
|
+
return target;
|
|
700
|
+
}
|
|
701
|
+
//# sourceMappingURL=index.js.map
|