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,769 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox backend for `pyric/auth`.
|
|
3
|
+
*
|
|
4
|
+
* Owns four pieces of per-sandbox state:
|
|
5
|
+
* 1. In-memory user database — emails / passwords / customClaims
|
|
6
|
+
* seeded via `sandbox.seedUsers(auth, …)` plus accounts created
|
|
7
|
+
* through `createUserWithEmailAndPassword`.
|
|
8
|
+
* 2. Listener registries — one for `onAuthStateChanged`, one for
|
|
9
|
+
* `onIdTokenChanged`. Both fire on user change; the
|
|
10
|
+
* `onIdTokenChanged` registry ALSO fires on a forced ID-token
|
|
11
|
+
* refresh (matches prod — see oracle observation
|
|
12
|
+
* `auth-onidtokenchanged-force-refresh.json`).
|
|
13
|
+
* 3. Mock-result registry — pre-staged `UserCredential`s consumed by
|
|
14
|
+
* `signInWithPopup` / `signInWithCredential`. Keyed by
|
|
15
|
+
* `providerId`; one slot per provider.
|
|
16
|
+
* 4. Token cache — current ID token string + IdTokenResult per uid.
|
|
17
|
+
* A fresh token is minted on each setCurrentUser transition into
|
|
18
|
+
* a non-null user (new session = new token) and on each
|
|
19
|
+
* `getIdToken(forceRefresh=true)`. Subsequent
|
|
20
|
+
* `getIdToken(false)` reads return the cached token (matches
|
|
21
|
+
* prod — see `auth-getidtoken-force-refresh.json`).
|
|
22
|
+
*
|
|
23
|
+
* The "current user" itself lives on `sandbox.currentUser`. We don't
|
|
24
|
+
* shadow it — the source of truth is the sandbox so future
|
|
25
|
+
* `getFirestore(sandbox)` overloads (deferred follow-up PR) can read
|
|
26
|
+
* the same value per-call.
|
|
27
|
+
*
|
|
28
|
+
* `signInAnonymously` / `signInWithEmailAndPassword` / `signOut` /
|
|
29
|
+
* `sandbox.setUser` all flow through {@link setCurrentUser}, which
|
|
30
|
+
* writes `sandbox.currentUser` and fans out to both listener
|
|
31
|
+
* registries. The sandbox's own `currentUser` setter is idempotent,
|
|
32
|
+
* so calling it with the same identity twice is a no-op.
|
|
33
|
+
*/
|
|
34
|
+
import { FirebaseError } from 'firebase/app';
|
|
35
|
+
import type { AuthState, Sandbox } from 'pyric/sandbox';
|
|
36
|
+
import { type AuthFlowResolver, type AuthObserver, type IdTokenResult, type Unsubscribe, type User, type UserCredential } from './types.js';
|
|
37
|
+
/** Seed record for `sandbox.seedUsers`. */
|
|
38
|
+
/** Stand-in password for exported provider-flow identities that never had
|
|
39
|
+
* one — keeps `exportUsers` → `seedUsers` round-trips lossless without
|
|
40
|
+
* widening the `SeedUser` shape. Not a secret: sandbox-only. */
|
|
41
|
+
export declare const NO_PASSWORD_SENTINEL = "__pyric_no_password__";
|
|
42
|
+
export interface SeedUser {
|
|
43
|
+
uid: string;
|
|
44
|
+
email: string;
|
|
45
|
+
password: string;
|
|
46
|
+
displayName?: string;
|
|
47
|
+
customClaims?: Record<string, unknown>;
|
|
48
|
+
/** Originating provider for this identity (e.g. `'google.com'`).
|
|
49
|
+
* Defaults to `'password'` — the natural provider for a record
|
|
50
|
+
* seeded with an email + password. A host seeding popup-flow
|
|
51
|
+
* identities passes the real provider so `listIdentities` /
|
|
52
|
+
* `IdTokenResult.signInProvider` label them correctly. */
|
|
53
|
+
providerId?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Request for {@link SandboxBackend.mintDetachedSession} — one variant
|
|
57
|
+
* per client sign-in shape, plus `uid` for existing identities
|
|
58
|
+
* (session restore, provider-bridge accept).
|
|
59
|
+
*/
|
|
60
|
+
export type MintSessionRequest = {
|
|
61
|
+
kind: 'anonymous';
|
|
62
|
+
} | {
|
|
63
|
+
kind: 'password';
|
|
64
|
+
email: string;
|
|
65
|
+
password: string;
|
|
66
|
+
} | {
|
|
67
|
+
kind: 'createPassword';
|
|
68
|
+
email: string;
|
|
69
|
+
password: string;
|
|
70
|
+
} | {
|
|
71
|
+
kind: 'uid';
|
|
72
|
+
uid: string;
|
|
73
|
+
};
|
|
74
|
+
/** A minted per-connection session: the `User` plus the {@link AuthState}
|
|
75
|
+
* its data contexts should carry (`sandbox.withAuth(state)`). */
|
|
76
|
+
export interface MintedSession {
|
|
77
|
+
user: User;
|
|
78
|
+
state: NonNullable<AuthState>;
|
|
79
|
+
}
|
|
80
|
+
/** One linked provider on a stored user. Emulator-shaped (the
|
|
81
|
+
* Identity Toolkit `providerUserInfo` array) — an array rather than
|
|
82
|
+
* a single string so account linking can extend it later. */
|
|
83
|
+
export interface ProviderUserInfo {
|
|
84
|
+
providerId: string;
|
|
85
|
+
}
|
|
86
|
+
/** "Add account" field set for {@link SandboxBackend.createSignInCredential}
|
|
87
|
+
* — mirrors the emulator's add-user form (`customAttributes` →
|
|
88
|
+
* `customClaims`). */
|
|
89
|
+
export interface SignInIdentitySpec {
|
|
90
|
+
/** Defaults to `'<providerId>:<email>'`. */
|
|
91
|
+
uid?: string;
|
|
92
|
+
email: string;
|
|
93
|
+
displayName?: string;
|
|
94
|
+
customClaims?: Record<string, unknown>;
|
|
95
|
+
}
|
|
96
|
+
/** Internal record in the in-memory user DB. `email`/`password` are
|
|
97
|
+
* null for identities that never had them (anonymous users,
|
|
98
|
+
* popup-only identities recorded at sign-in time). */
|
|
99
|
+
interface StoredUser {
|
|
100
|
+
uid: string;
|
|
101
|
+
email: string | null;
|
|
102
|
+
password: string | null;
|
|
103
|
+
displayName: string | null;
|
|
104
|
+
phoneNumber: string | null;
|
|
105
|
+
photoUrl: string | null;
|
|
106
|
+
customClaims: Record<string, unknown>;
|
|
107
|
+
isAnonymous: boolean;
|
|
108
|
+
/** Linked providers. Empty for anonymous users (matches the
|
|
109
|
+
* emulator: anonymous accounts carry no providerUserInfo; their
|
|
110
|
+
* provider surfaces as `sign_in_provider: 'anonymous'` on the
|
|
111
|
+
* token instead). */
|
|
112
|
+
providerUserInfo: ProviderUserInfo[];
|
|
113
|
+
/** Disabled accounts reject every sign-in attempt with
|
|
114
|
+
* `auth/user-disabled` (faithful to prod). */
|
|
115
|
+
disabled: boolean;
|
|
116
|
+
emailVerified: boolean;
|
|
117
|
+
/** ISO timestamp — when the record entered the user DB. */
|
|
118
|
+
createdAt: string;
|
|
119
|
+
/** ISO timestamp of the most recent sign-in, or null if this
|
|
120
|
+
* identity never signed in. */
|
|
121
|
+
lastLoginAt: string | null;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Public per-user record for the user-admin surface
|
|
125
|
+
* (`sandbox.listUsers` & co.) — emulator-REST-shaped (Identity
|
|
126
|
+
* Toolkit `accounts:lookup` field names, ISO timestamps).
|
|
127
|
+
*/
|
|
128
|
+
export interface AuthUserRecord {
|
|
129
|
+
uid: string;
|
|
130
|
+
email: string | null;
|
|
131
|
+
displayName: string | null;
|
|
132
|
+
phoneNumber: string | null;
|
|
133
|
+
photoUrl: string | null;
|
|
134
|
+
customClaims: Record<string, unknown>;
|
|
135
|
+
providerUserInfo: ProviderUserInfo[];
|
|
136
|
+
isAnonymous: boolean;
|
|
137
|
+
disabled: boolean;
|
|
138
|
+
emailVerified: boolean;
|
|
139
|
+
/** ISO timestamp. */
|
|
140
|
+
createdAt: string;
|
|
141
|
+
/** ISO timestamp, or null if the identity never signed in. */
|
|
142
|
+
lastLoginAt: string | null;
|
|
143
|
+
}
|
|
144
|
+
/** `sandbox.createUser` request. Everything optional except that a
|
|
145
|
+
* `password` requires an `email` to be useful for sign-in. */
|
|
146
|
+
export interface CreateUserRequest {
|
|
147
|
+
/** Defaults to a generated `user-<N>` uid. */
|
|
148
|
+
uid?: string;
|
|
149
|
+
email?: string;
|
|
150
|
+
password?: string;
|
|
151
|
+
displayName?: string;
|
|
152
|
+
phoneNumber?: string;
|
|
153
|
+
photoUrl?: string;
|
|
154
|
+
customClaims?: Record<string, unknown>;
|
|
155
|
+
disabled?: boolean;
|
|
156
|
+
emailVerified?: boolean;
|
|
157
|
+
/** Linked OAuth providers to create the user with (dedup by
|
|
158
|
+
* providerId; multiple providers per user are supported). Same
|
|
159
|
+
* rules as {@link UpdateUserRequest.providerUserInfo}: `password`
|
|
160
|
+
* is credential-derived (send `password` to link it) and
|
|
161
|
+
* `anonymous` is token-level — neither can be forged here. */
|
|
162
|
+
providerUserInfo?: ProviderUserInfo[];
|
|
163
|
+
}
|
|
164
|
+
/** `sandbox.updateUser` request — `undefined` fields are left
|
|
165
|
+
* untouched; `displayName: null` clears it. `customClaims` replaces
|
|
166
|
+
* the whole map (admin `setCustomUserClaims` semantics). */
|
|
167
|
+
export interface UpdateUserRequest {
|
|
168
|
+
displayName?: string | null;
|
|
169
|
+
email?: string;
|
|
170
|
+
password?: string;
|
|
171
|
+
customClaims?: Record<string, unknown>;
|
|
172
|
+
disabled?: boolean;
|
|
173
|
+
emailVerified?: boolean;
|
|
174
|
+
/** REPLACES the user's linked OAuth providers (dedup by providerId;
|
|
175
|
+
* multiple providers per user are supported — the record's
|
|
176
|
+
* `providerUserInfo` is an array precisely for account linking).
|
|
177
|
+
* The `password` entry is credential-derived and managed by the
|
|
178
|
+
* backend: it survives the replacement while the user has a
|
|
179
|
+
* password and cannot be linked through this field; `anonymous`
|
|
180
|
+
* is a token-level provider, never a linked entry. */
|
|
181
|
+
providerUserInfo?: ProviderUserInfo[];
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Per-sandbox backend state. One instance per `getAuth(sandbox)` —
|
|
185
|
+
* memoized so repeat calls return the same backing store (matches
|
|
186
|
+
* `firebase/auth`'s `getAuth(app)` idempotency).
|
|
187
|
+
*/
|
|
188
|
+
export declare class SandboxBackend {
|
|
189
|
+
/** Email → stored user. Lowercase keys so lookups are case-
|
|
190
|
+
* insensitive (matches upstream). */
|
|
191
|
+
private readonly usersByEmail;
|
|
192
|
+
/** UID → stored user. Lets `setUser` resolve customClaims for an
|
|
193
|
+
* arbitrary uid without scanning the email index. */
|
|
194
|
+
private readonly usersByUid;
|
|
195
|
+
/** onAuthStateChanged registrations. Array, NOT a Set, so duplicate
|
|
196
|
+
* observer functions register independently — upstream backs each
|
|
197
|
+
* registry with an array (`util/src/subscribe.ts:191` pushes; dups
|
|
198
|
+
* allowed) and `unsubscribeOne(i)` removes by *index*, so the same
|
|
199
|
+
* fn subscribed twice fires twice and one unsubscribe removes one
|
|
200
|
+
* registration (AUTH-B4). Each record carries its own initial-fire
|
|
201
|
+
* bookkeeping so a shared per-observer dedup can't suppress a
|
|
202
|
+
* resubscribe or a second registration of the same fn (AUTH-B3). */
|
|
203
|
+
private readonly authStateSubs;
|
|
204
|
+
/** onIdTokenChanged registrations. Same array semantics. */
|
|
205
|
+
private readonly idTokenSubs;
|
|
206
|
+
/** `subscribeUsers` subscribers — coarse "user DB changed"
|
|
207
|
+
* callbacks; listeners re-list via `listUsers`. */
|
|
208
|
+
private readonly userDbSubs;
|
|
209
|
+
/** Monotonic uid counter for `createUser` calls without a uid. */
|
|
210
|
+
private nextAdminUserId;
|
|
211
|
+
/** Pre-staged sign-in results, keyed by providerId. The one-shot tier
|
|
212
|
+
* of the popup/redirect resolver precedence (see `index.ts`
|
|
213
|
+
* `signInWithPopup`): consumed when no resolver is injected, so
|
|
214
|
+
* headless conformance fixtures stay deterministic. */
|
|
215
|
+
private readonly mockResults;
|
|
216
|
+
/** Injected popup/redirect resolver — the analog of browser
|
|
217
|
+
* `getAuth` wiring `browserPopupRedirectResolver`. Null until a host
|
|
218
|
+
* (the playground) installs one via `sandbox.setAuthFlowResolver`. */
|
|
219
|
+
private resolver;
|
|
220
|
+
/** Pending `getRedirectResult` payload — set by `signInWithRedirect`,
|
|
221
|
+
* returned-and-cleared by `getRedirectResult` (one-shot, matches prod). */
|
|
222
|
+
private redirectResult;
|
|
223
|
+
/** Monotonic uid counter for anonymous users. */
|
|
224
|
+
private nextAnonymousId;
|
|
225
|
+
/** Underlying sandbox — written to on every sign-in/out. */
|
|
226
|
+
private readonly sandbox;
|
|
227
|
+
/** Cached `User` for `auth.currentUser` snapshots. Recomputed when
|
|
228
|
+
* the sandbox's currentUser changes; null on signed-out. */
|
|
229
|
+
private cachedUser;
|
|
230
|
+
/** The uid `onAuthStateChanged` was last notified with. Mirrors
|
|
231
|
+
* upstream's `lastNotifiedUid` (`auth_impl.ts:720`): auth-state only
|
|
232
|
+
* re-fires when this changes, so a same-uid profile-shape change or a
|
|
233
|
+
* same-uid re-sign-in does NOT re-fire auth-state (AUTH-B7). */
|
|
234
|
+
private lastNotifiedUid;
|
|
235
|
+
/** True while {@link setCurrentUser} is driving a transition through
|
|
236
|
+
* the sandbox setter. The synchronous `onCurrentUserChanged`
|
|
237
|
+
* subscriber checks this so it doesn't double-notify — setCurrentUser
|
|
238
|
+
* owns the fan-out decision (id-token always, auth-state on uid
|
|
239
|
+
* change). The subscriber only notifies for EXTERNAL mutations
|
|
240
|
+
* (direct sandbox writes, `reset()`, another handle). */
|
|
241
|
+
private applyingTransition;
|
|
242
|
+
/** Per-uid current ID token + result. Refreshed on each
|
|
243
|
+
* `getIdToken(forceRefresh=true)` and on each new sign-in
|
|
244
|
+
* transition (so a sign-out / sign-in round-trip mints a fresh
|
|
245
|
+
* token, matching prod's "new session = new token" semantics).
|
|
246
|
+
* Subsequent `getIdToken(false)` reads return the cached value. */
|
|
247
|
+
private readonly tokenCache;
|
|
248
|
+
/** Monotonic counter used to disambiguate freshly-minted tokens
|
|
249
|
+
* for the same uid + claims map. Without this, two refreshes that
|
|
250
|
+
* happen within the same millisecond would hash to the same
|
|
251
|
+
* string (claims map + iat tie-breaker not enough). */
|
|
252
|
+
private nextTokenSerial;
|
|
253
|
+
/**
|
|
254
|
+
* Current persistence mode — mirrors the real Firebase SDK's
|
|
255
|
+
* `setPersistence` semantics. Default is `'LOCAL'` (Firebase default:
|
|
256
|
+
* `browserLocalPersistence` keeps you signed in across reloads and
|
|
257
|
+
* browser restarts).
|
|
258
|
+
*
|
|
259
|
+
* Stored here on the backend so the persistence controller can read it
|
|
260
|
+
* without knowing about auth internals. The `auth/index.ts` top-level
|
|
261
|
+
* `setPersistence` function writes this via `setPersistenceMode`; the
|
|
262
|
+
* controller reads it via `getPersistenceMode` on every session save.
|
|
263
|
+
*
|
|
264
|
+
* Subscribers to persistence-mode changes (the set holding the
|
|
265
|
+
* controller's session-save callback) are notified by `setPersistenceMode`
|
|
266
|
+
* so a `setPersistence` call that changes the mode immediately migrates
|
|
267
|
+
* the session to the new store without waiting for the next sign-in.
|
|
268
|
+
*/
|
|
269
|
+
private persistenceMode;
|
|
270
|
+
/** Per-uid provider of the *current/most-recent* sign-in session —
|
|
271
|
+
* backs `IdTokenResult.signInProvider` and the synthesized
|
|
272
|
+
* `firebase.sign_in_provider` token claim. Written by each
|
|
273
|
+
* sign-in path via {@link setCurrentUser}'s `signInProvider`
|
|
274
|
+
* argument; `null` for identities driven directly through the
|
|
275
|
+
* test driver (`sandbox.setUser`), which has no prod analog. */
|
|
276
|
+
private readonly signInProviderByUid;
|
|
277
|
+
/**
|
|
278
|
+
* Sign-in provider enablement — mirrors a real Firebase project's
|
|
279
|
+
* Authentication → Sign-in method toggles. GATED at every provider
|
|
280
|
+
* entry point OF THE ENFORCING BACKEND (owner decision — full
|
|
281
|
+
* fidelity): `resolveFlow` (`signInWithPopup`/`signInWithRedirect`),
|
|
282
|
+
* `signInWithCredential`, `createUserWithEmailAndPassword`/
|
|
283
|
+
* `signInWithEmailAndPassword` (the `'password'` provider), and
|
|
284
|
+
* `signInAnonymously` (the `'anonymous'` provider). A disabled
|
|
285
|
+
* provider throws the same `auth/operation-not-allowed` prod throws
|
|
286
|
+
* — a code deliberately distinct from `auth/argument-error` (which
|
|
287
|
+
* keeps meaning "no resolver/mock wired" for an ENABLED-but-unmocked
|
|
288
|
+
* OAuth provider).
|
|
289
|
+
*
|
|
290
|
+
* DELEGATION ESCAPE HATCH ({@link providerEnforcementDelegated}): a
|
|
291
|
+
* backend that is merely a UI vehicle for a REMOTE authority — the
|
|
292
|
+
* served worker path's page-local sandbox, whose popup picker
|
|
293
|
+
* resolves identities that a SharedWorker then gates + signs in —
|
|
294
|
+
* can delegate enforcement to that authority. With delegation on,
|
|
295
|
+
* {@link assertProviderEnabled} is a no-op HERE and the authority's
|
|
296
|
+
* own (undelegated) backend gate is the one that decides.
|
|
297
|
+
*
|
|
298
|
+
* DEFAULTS DIVERGE FROM A FRESH REAL PROJECT (owner decision,
|
|
299
|
+
* documented): prod ships every provider OFF until an admin flips it
|
|
300
|
+
* on in the console. The sandbox ships `'password'` and `'anonymous'`
|
|
301
|
+
* ON — everything else (`google.com`, `github.com`, `apple.com`,
|
|
302
|
+
* `microsoft.com`, custom OAuth ids, …) OFF — so the enforcement is
|
|
303
|
+
* identical to prod but the DEFAULTS are friendlier: every existing
|
|
304
|
+
* sandbox flow that never called `sandbox.setAuthProviderConfig`
|
|
305
|
+
* keeps signing in via email/password and anonymous auth unchanged
|
|
306
|
+
* after this landed.
|
|
307
|
+
*/
|
|
308
|
+
private readonly providerConfig;
|
|
309
|
+
/** Subscribers to provider-config changes — the config analog of
|
|
310
|
+
* {@link userDbSubs}. Same coarse contract: no payload, re-read via
|
|
311
|
+
* {@link listProviderConfig} on each callback. */
|
|
312
|
+
private readonly providerConfigSubs;
|
|
313
|
+
/** When true, THIS backend's provider gate is delegated to a remote
|
|
314
|
+
* authority (see the {@link providerConfig} docstring's delegation
|
|
315
|
+
* section) — {@link assertProviderEnabled} becomes a no-op. Not
|
|
316
|
+
* persisted: a runtime wiring decision, not project config. */
|
|
317
|
+
private providerEnforcementDelegated;
|
|
318
|
+
constructor(sandbox: Sandbox);
|
|
319
|
+
/** Snapshot of the current user — backs `auth.currentUser`. */
|
|
320
|
+
getCurrentUser(): User | null;
|
|
321
|
+
/**
|
|
322
|
+
* Subscribe to user change. Fires *immediately* on subscribe with
|
|
323
|
+
* the current value (mirrors `firebase/auth`'s
|
|
324
|
+
* `onAuthStateChanged` semantics).
|
|
325
|
+
*
|
|
326
|
+
* `kind: 'auth-state'` and `kind: 'id-token'` share the identity-
|
|
327
|
+
* transition fan-out path; additionally, `getIdToken(true)` fans
|
|
328
|
+
* out to the `'id-token'` registry only (without re-firing
|
|
329
|
+
* `'auth-state'`). Matches prod: `onIdTokenChanged` sees both
|
|
330
|
+
* identity changes AND forced token refreshes.
|
|
331
|
+
*/
|
|
332
|
+
subscribe(kind: 'auth-state' | 'id-token', observer: AuthObserver): Unsubscribe;
|
|
333
|
+
/**
|
|
334
|
+
* Notify the requested registries of the current user. Snapshots
|
|
335
|
+
* the registration list before iteration so unsubscribes during
|
|
336
|
+
* emission don't skip remaining subscribers (upstream semantics).
|
|
337
|
+
*
|
|
338
|
+
* `kind: 'both'` (default) fires both auth-state and id-token
|
|
339
|
+
* registries — used for identity transitions.
|
|
340
|
+
* `kind: 'id-token'` fires ONLY the id-token registry — used for
|
|
341
|
+
* forced token refreshes, where the user identity hasn't changed
|
|
342
|
+
* but the token has. Matches prod: `onIdTokenChanged` sees refresh
|
|
343
|
+
* events; `onAuthStateChanged` does not.
|
|
344
|
+
*/
|
|
345
|
+
private fanOut;
|
|
346
|
+
/**
|
|
347
|
+
* Mirror of upstream `notifyAuthListeners` (`auth_impl.ts:714-723`):
|
|
348
|
+
* - `onIdTokenChanged` fires on EVERY notify (every identity update,
|
|
349
|
+
* including a same-uid re-sign-in that mints a fresh token —
|
|
350
|
+
* AUTH-B8);
|
|
351
|
+
* - `onAuthStateChanged` fires ONLY when the uid changed vs the last
|
|
352
|
+
* notification (`lastNotifiedUid`) — a same-uid profile-shape
|
|
353
|
+
* change does NOT re-fire auth-state (AUTH-B7).
|
|
354
|
+
* Call this after `cachedUser` is updated.
|
|
355
|
+
*/
|
|
356
|
+
private notifyAuthListeners;
|
|
357
|
+
private deliverOne;
|
|
358
|
+
/** Build a fresh {@link StoredUser} with admin-field defaults. */
|
|
359
|
+
private makeStored;
|
|
360
|
+
/** Fan a coarse "user DB changed" notification out to
|
|
361
|
+
* `subscribeUsers` listeners. Snapshotted iteration; throwing
|
|
362
|
+
* listeners are isolated (same policy as the auth observers). */
|
|
363
|
+
private notifyUsersChanged;
|
|
364
|
+
/**
|
|
365
|
+
* Emit an auth {@link ServiceMutationEvent} onto the sandbox's unified
|
|
366
|
+
* `onEvent`/`history()` stream (Pyric Studio keystone). Best-effort and
|
|
367
|
+
* fully isolated — a throw from the emit path (or a sandbox that somehow
|
|
368
|
+
* isn't a real `SandboxImpl`) must NOT break the auth operation that
|
|
369
|
+
* triggered it, so we swallow. `auth` defaults to the current sandbox
|
|
370
|
+
* identity; admin ops (createUser/updateUser/deleteUser) pass `null`
|
|
371
|
+
* since they have no acting session. `actor` defaults to `{ kind: 'app' }`
|
|
372
|
+
* via `stampProvenance`.
|
|
373
|
+
*/
|
|
374
|
+
private emitAuthEvent;
|
|
375
|
+
/** Subscribe to user-DB mutations (seed/create/update/delete/clear,
|
|
376
|
+
* provider links, lastLoginAt bumps). Coarse: no payload, no
|
|
377
|
+
* initial fire — re-list via `listUsers` on each callback. */
|
|
378
|
+
subscribeUsers(cb: () => void): Unsubscribe;
|
|
379
|
+
/** Whether `providerId` is currently enabled. Unknown providers
|
|
380
|
+
* (never toggled) default to `false` — matches a fresh real project,
|
|
381
|
+
* EXCEPT `'password'`/`'anonymous'`, which start `true` (see the
|
|
382
|
+
* {@link providerConfig} docstring for the rationale). */
|
|
383
|
+
isProviderEnabled(providerId: string): boolean;
|
|
384
|
+
/** Every provider this backend has an explicit enablement for —
|
|
385
|
+
* seeded defaults (`password`, `anonymous`) plus anything a host
|
|
386
|
+
* toggled via {@link setProviderConfig}. */
|
|
387
|
+
listProviderConfig(): Array<{
|
|
388
|
+
providerId: string;
|
|
389
|
+
enabled: boolean;
|
|
390
|
+
}>;
|
|
391
|
+
/** Toggle a provider on/off. No-op (no notify) when the value is
|
|
392
|
+
* already what was requested — mirrors {@link setPersistenceMode}'s
|
|
393
|
+
* dedup so a redundant toggle doesn't churn subscribers / flushes. */
|
|
394
|
+
setProviderConfig(providerId: string, enabled: boolean): void;
|
|
395
|
+
private notifyProviderConfigChanged;
|
|
396
|
+
/** Subscribe to provider-config mutations. Coarse: no payload, no
|
|
397
|
+
* initial fire — re-read via {@link listProviderConfig} on each
|
|
398
|
+
* callback (same contract as {@link subscribeUsers}). */
|
|
399
|
+
subscribeProviderConfig(cb: () => void): Unsubscribe;
|
|
400
|
+
/**
|
|
401
|
+
* Mark this backend's provider gate as delegated to (or reclaimed
|
|
402
|
+
* from) a remote authority. See the {@link providerConfig} docstring:
|
|
403
|
+
* the served worker path sets this on the PAGE-LOCAL sandbox so the
|
|
404
|
+
* popup picker opens regardless of local toggles — the SharedWorker's
|
|
405
|
+
* `auth.acceptIdentity` gate (against the worker's own, undelegated
|
|
406
|
+
* backend) is the enforcement point.
|
|
407
|
+
*/
|
|
408
|
+
setProviderEnforcementDelegated(delegated: boolean): void;
|
|
409
|
+
/**
|
|
410
|
+
* Gate a provider entry point. Throws real Firebase's
|
|
411
|
+
* `auth/operation-not-allowed` (exactly the code/shape prod throws
|
|
412
|
+
* for a disabled sign-in method) when `providerId` is off. Called by
|
|
413
|
+
* every provider-flow entry point in `index.ts` BEFORE any other
|
|
414
|
+
* work, so a disabled provider never touches the user DB / mock
|
|
415
|
+
* registry / resolver. A no-op when enforcement is delegated to a
|
|
416
|
+
* remote authority ({@link setProviderEnforcementDelegated}).
|
|
417
|
+
*/
|
|
418
|
+
assertProviderEnabled(providerId: string): void;
|
|
419
|
+
/** Snapshot the full provider-config map for the persistable-service
|
|
420
|
+
* `snapshot()` hook — plain JSON, ready to embed under the `auth`
|
|
421
|
+
* service's `providers` key. */
|
|
422
|
+
exportProviderConfig(): Record<string, boolean>;
|
|
423
|
+
/**
|
|
424
|
+
* Restore provider config from a persisted blob — a REPLACE, not a
|
|
425
|
+
* merge (same policy as `seedUsers`'s persistence path: the map
|
|
426
|
+
* becomes EXACTLY what `data` holds). When `data` is missing/invalid
|
|
427
|
+
* — including every blob written BEFORE this feature landed, which
|
|
428
|
+
* has no `providers` key at all — falls back to the documented
|
|
429
|
+
* defaults (`password`/`anonymous` enabled) rather than leaving the
|
|
430
|
+
* map empty, so an old `--persist` file doesn't silently lock
|
|
431
|
+
* existing sandbox flows out of email/password + anonymous sign-in.
|
|
432
|
+
*/
|
|
433
|
+
restoreProviderConfig(data: Record<string, boolean> | undefined): void;
|
|
434
|
+
/**
|
|
435
|
+
* Read the current persistence mode. Used by the session-persistence
|
|
436
|
+
* controller to decide which web-storage slot (local / session) to
|
|
437
|
+
* write the signed-in uid into.
|
|
438
|
+
*
|
|
439
|
+
* The default value is `'LOCAL'` — matches Firebase's default of
|
|
440
|
+
* `browserLocalPersistence` (you stay signed in across page reloads
|
|
441
|
+
* and browser restarts unless you explicitly call `setPersistence`).
|
|
442
|
+
*/
|
|
443
|
+
getPersistenceMode(): 'LOCAL' | 'SESSION' | 'NONE';
|
|
444
|
+
/**
|
|
445
|
+
* Record the new persistence mode. Called by the auth `setPersistence`
|
|
446
|
+
* function when the sandbox target receives a mode change.
|
|
447
|
+
*
|
|
448
|
+
* Changing the mode notifies the session-change subscribers so the
|
|
449
|
+
* persistence controller can IMMEDIATELY migrate the stored uid to
|
|
450
|
+
* the new web-storage slot — matching the real SDK's behavior where
|
|
451
|
+
* `setPersistence` carries the active session across modes before
|
|
452
|
+
* returning.
|
|
453
|
+
*
|
|
454
|
+
* Why notify on mode change (not just on sign-in/out): the session
|
|
455
|
+
* controller subscribes to "something about this session changed"
|
|
456
|
+
* events and re-reads both `currentUid()` and `mode()` on each fire.
|
|
457
|
+
* Notifying here lets the controller react to a mode change with the
|
|
458
|
+
* same code path as a sign-in/out, rather than a separate migration
|
|
459
|
+
* hook.
|
|
460
|
+
*/
|
|
461
|
+
setPersistenceMode(mode: 'LOCAL' | 'SESSION' | 'NONE'): void;
|
|
462
|
+
/**
|
|
463
|
+
* Subscribers that need to react to ANY session state change —
|
|
464
|
+
* sign-in, sign-out, or persistence-mode change. The controller
|
|
465
|
+
* installs one subscriber here to drive session saves.
|
|
466
|
+
*
|
|
467
|
+
* Separate from `currentUserSubs` (on the sandbox) because we need
|
|
468
|
+
* to fire on mode changes (which don't change the currentUser) and
|
|
469
|
+
* because the backend owns the mode — it's cleaner to keep both
|
|
470
|
+
* signals on the same object.
|
|
471
|
+
*/
|
|
472
|
+
private readonly sessionChangeSubs;
|
|
473
|
+
/** Notify all session-change subscribers. Used by `setCurrentUser`
|
|
474
|
+
* (sign-in / sign-out) and by `setPersistenceMode` (mode change). */
|
|
475
|
+
private notifySessionChanged;
|
|
476
|
+
/**
|
|
477
|
+
* Subscribe to session-level changes: sign-in, sign-out, and
|
|
478
|
+
* persistence-mode changes. The persistence controller installs one
|
|
479
|
+
* subscription here and re-saves the session on every fire.
|
|
480
|
+
*
|
|
481
|
+
* This is the mechanism the `PersistableService.session.subscribe`
|
|
482
|
+
* hook exposes — the controller doesn't need to know it's subscribing
|
|
483
|
+
* to two separate event sources (sign-in/out AND mode); they both
|
|
484
|
+
* flow through this one subscription.
|
|
485
|
+
*/
|
|
486
|
+
subscribeSession(cb: () => void): Unsubscribe;
|
|
487
|
+
seedUsers(users: ReadonlyArray<SeedUser>): void;
|
|
488
|
+
/**
|
|
489
|
+
* Export the user DB as `SeedUser`s — the exact shape `seedUsers`
|
|
490
|
+
* accepts, so export → seed round-trips (the persistence substrate,
|
|
491
|
+
* the design rationale section 3c). Identities with an email but no
|
|
492
|
+
* password (provider-flow users created via `createSignInCredential`)
|
|
493
|
+
* export with {@link NO_PASSWORD_SENTINEL} so they survive the
|
|
494
|
+
* round-trip (same trick hosts already use when seeding popup
|
|
495
|
+
* identities). Anonymous users (no email) are NOT exported — they are
|
|
496
|
+
* ephemeral by design; documented divergence from prod's persisted
|
|
497
|
+
* anonymous sessions.
|
|
498
|
+
*/
|
|
499
|
+
exportUsers(): SeedUser[];
|
|
500
|
+
/**
|
|
501
|
+
* Re-establish a signed-in session for an EXISTING identity — the
|
|
502
|
+
* substrate behind web-storage session persistence (`setPersistence`
|
|
503
|
+
* parity at the serve layer). Fires the auth-state listeners exactly
|
|
504
|
+
* like a real restored session. Throws `auth/user-not-found` for
|
|
505
|
+
* unknown uids and `auth/user-disabled` for disabled accounts (a
|
|
506
|
+
* restore is a sign-in).
|
|
507
|
+
*/
|
|
508
|
+
restoreSession(uid: string): User;
|
|
509
|
+
findByEmail(email: string): StoredUser | undefined;
|
|
510
|
+
createEmailPasswordUser(email: string, password: string): StoredUser;
|
|
511
|
+
/**
|
|
512
|
+
* Set the active user. Owns the fan-out decision directly (rather than
|
|
513
|
+
* leaning on the sandbox setter's structural-equality dedup), so it can
|
|
514
|
+
* mirror upstream `notifyAuthListeners`: `onIdTokenChanged` fires on
|
|
515
|
+
* every sign-in (incl. a same-uid re-sign-in that mints a fresh token —
|
|
516
|
+
* AUTH-B8), while `onAuthStateChanged` fires only on a uid change
|
|
517
|
+
* (AUTH-B7). The `applyingTransition` guard suppresses the synchronous
|
|
518
|
+
* `onCurrentUserChanged` subscriber so we don't double-notify.
|
|
519
|
+
*
|
|
520
|
+
* `signInProvider` (when passed) records the provider of THIS
|
|
521
|
+
* sign-in session — it feeds `IdTokenResult.signInProvider` and the
|
|
522
|
+
* synthesized `firebase.sign_in_provider` claim. Omitted by the
|
|
523
|
+
* test driver (`sandbox.setUser`), which leaves any previous value
|
|
524
|
+
* in place.
|
|
525
|
+
*/
|
|
526
|
+
setCurrentUser(user: User | null, signInProvider?: string | null): void;
|
|
527
|
+
setMockResult(providerId: string, result: UserCredential): void;
|
|
528
|
+
consumeMockResult(providerId: string): UserCredential | undefined;
|
|
529
|
+
setResolver(resolver: AuthFlowResolver | null): void;
|
|
530
|
+
getResolver(): AuthFlowResolver | null;
|
|
531
|
+
/** Stash the credential a `signInWithRedirect` produced; `getRedirectResult`
|
|
532
|
+
* returns-and-clears it. */
|
|
533
|
+
setRedirectResult(result: UserCredential): void;
|
|
534
|
+
takeRedirectResult(): UserCredential | null;
|
|
535
|
+
/**
|
|
536
|
+
* Record a provider-flow sign-in (popup / redirect / credential)
|
|
537
|
+
* against the user DB so the identity shows up in `listIdentities`
|
|
538
|
+
* with its real provider. Upserts: unknown uids get a fresh record
|
|
539
|
+
* (no password — these identities can't sign in via
|
|
540
|
+
* `signInWithEmailAndPassword`); known uids get the provider
|
|
541
|
+
* appended to `providerUserInfo` if it isn't already linked.
|
|
542
|
+
*/
|
|
543
|
+
recordProviderSignIn(user: User, providerId: string): void;
|
|
544
|
+
/**
|
|
545
|
+
* Mint a sign-in credential for a host-driven flow (the account
|
|
546
|
+
* picker behind `AuthFlowResolver`). Token + claims synthesis is
|
|
547
|
+
* backend-owned: the returned `User`'s `getIdToken` /
|
|
548
|
+
* `getIdTokenResult` route through this backend's token cache, so
|
|
549
|
+
* helper-driven sign-ins get real (cached, refreshable,
|
|
550
|
+
* provider-labeled) sandbox tokens instead of host-synthesized
|
|
551
|
+
* strings.
|
|
552
|
+
*
|
|
553
|
+
* Two request shapes:
|
|
554
|
+
* - `{providerId, uid}` — credential for an EXISTING identity
|
|
555
|
+
* (the picker's "pick" action). Throws `invalid-argument` for
|
|
556
|
+
* unknown uids.
|
|
557
|
+
* - `{providerId, spec}` — upsert a new identity (the picker's
|
|
558
|
+
* "add account"). If `spec.email` already belongs to a stored
|
|
559
|
+
* user, that identity is reused and the provider linked
|
|
560
|
+
* (Google-style same-email account reuse); otherwise a fresh
|
|
561
|
+
* record is created with uid `spec.uid ?? '<providerId>:<email>'`
|
|
562
|
+
* and NO password (provider identities can't sign in via
|
|
563
|
+
* `signInWithEmailAndPassword`).
|
|
564
|
+
*
|
|
565
|
+
* In both shapes the provider is linked into `providerUserInfo`.
|
|
566
|
+
* The credential does NOT sign the user in — hand it to the
|
|
567
|
+
* resolver's promise; `signInWithPopup`/`signInWithRedirect`
|
|
568
|
+
* complete the sign-in.
|
|
569
|
+
*/
|
|
570
|
+
createSignInCredential(req: {
|
|
571
|
+
providerId: string;
|
|
572
|
+
uid: string;
|
|
573
|
+
} | {
|
|
574
|
+
providerId: string;
|
|
575
|
+
spec: SignInIdentitySpec;
|
|
576
|
+
}): UserCredential;
|
|
577
|
+
/** Snapshot of every known identity (seeded + created), for a host
|
|
578
|
+
* account-picker UI. No `firebase/auth` equivalent — sandbox-only.
|
|
579
|
+
*
|
|
580
|
+
* `providerId` is the primary provider label (first linked
|
|
581
|
+
* provider, or `'anonymous'` for anonymous users);
|
|
582
|
+
* `providerUserInfo` is the full emulator-shaped array. */
|
|
583
|
+
listIdentities(): Array<{
|
|
584
|
+
uid: string;
|
|
585
|
+
email: string | null;
|
|
586
|
+
displayName: string | null;
|
|
587
|
+
providerId: string;
|
|
588
|
+
providerUserInfo: ProviderUserInfo[];
|
|
589
|
+
isAnonymous: boolean;
|
|
590
|
+
customClaims: Record<string, unknown>;
|
|
591
|
+
}>;
|
|
592
|
+
/** Public snapshot of a stored user. Defensive copies — mutating a
|
|
593
|
+
* returned record never touches the DB. */
|
|
594
|
+
private toRecord;
|
|
595
|
+
/** Every user in the DB (seeded, created, signed-in-via-provider,
|
|
596
|
+
* anonymous), as admin records. */
|
|
597
|
+
listUsers(): AuthUserRecord[];
|
|
598
|
+
/** Sanitize an admin-supplied linked-provider list (create + update):
|
|
599
|
+
* dedup by providerId, reject empty ids, and refuse the two ids that
|
|
600
|
+
* are NOT linkable entries — `password` is credential-derived (a
|
|
601
|
+
* password on the account links it; it leads the list when present)
|
|
602
|
+
* and `anonymous` surfaces on the token, never on the record. */
|
|
603
|
+
private sanitizeLinkedProviders;
|
|
604
|
+
/** Admin user creation. Does NOT sign the user in (unlike
|
|
605
|
+
* `createUserWithEmailAndPassword`) — matches the emulator's
|
|
606
|
+
* add-user flow / admin SDK semantics. */
|
|
607
|
+
createUser(req: CreateUserRequest): AuthUserRecord;
|
|
608
|
+
/** Admin user update. `undefined` fields untouched; `customClaims`
|
|
609
|
+
* replaces the whole map (admin `setCustomUserClaims` semantics).
|
|
610
|
+
* Claims changes reach an ACTIVE session only on the next token
|
|
611
|
+
* refresh / sign-in — same propagation story as prod. */
|
|
612
|
+
updateUser(uid: string, update: UpdateUserRequest): AuthUserRecord;
|
|
613
|
+
/** Admin user deletion. The active session (if it's this user) is
|
|
614
|
+
* NOT terminated — matches prod, where admin deletion doesn't kill
|
|
615
|
+
* live client sessions until the token is revoked/refreshed. */
|
|
616
|
+
deleteUser(uid: string): void;
|
|
617
|
+
/** Drop every user record (the emulator's "delete all accounts").
|
|
618
|
+
* Active sessions are untouched, like {@link deleteUser}. */
|
|
619
|
+
clearUsers(): void;
|
|
620
|
+
/** Throw `auth/user-disabled` if the uid resolves to a disabled
|
|
621
|
+
* record. Called by every provider-flow sign-in path; the
|
|
622
|
+
* email/password path runs the same check inside
|
|
623
|
+
* {@link validatePassword}. */
|
|
624
|
+
assertSignInAllowed(uid: string): void;
|
|
625
|
+
/**
|
|
626
|
+
* Mint a `User` shell for the given stored record. Used by all
|
|
627
|
+
* email/password and popup sign-in paths.
|
|
628
|
+
*/
|
|
629
|
+
buildUserFromStored(stored: StoredUser): User;
|
|
630
|
+
/** Mint a fresh anonymous user with an auto-generated uid. Records
|
|
631
|
+
* the identity in the user DB (empty `providerUserInfo`, matching
|
|
632
|
+
* the emulator) so `listIdentities` / future user-admin surfaces
|
|
633
|
+
* see anonymous accounts too. */
|
|
634
|
+
mintAnonymousUser(): User;
|
|
635
|
+
/**
|
|
636
|
+
* Mint a session identity WITHOUT making it the global current user —
|
|
637
|
+
* the substrate for per-connection identity at the serve layer (one
|
|
638
|
+
* SharedWorker sandbox, N tab sessions; issue #754). Performs a real
|
|
639
|
+
* sign-in's bookkeeping — provider record, `lastLoginAt` bump, a fresh
|
|
640
|
+
* token (new session = new token), the `sign_in` activity event — but
|
|
641
|
+
* leaves `sandbox.currentUser`, the auth-state listeners, and the
|
|
642
|
+
* session-change subscribers untouched.
|
|
643
|
+
*
|
|
644
|
+
* Returns the `User` plus the {@link AuthState} a data context should
|
|
645
|
+
* carry (`sandbox.withAuth(state)`) so rules evaluate exactly as they
|
|
646
|
+
* would for a globally signed-in user (`request.auth.uid` + custom
|
|
647
|
+
* claims on `request.auth.token`).
|
|
648
|
+
*
|
|
649
|
+
* GATING: `'anonymous'` / `'password'` / `'createPassword'` run through
|
|
650
|
+
* {@link assertProviderEnabled} — this is the path the served worker's
|
|
651
|
+
* per-port sessions actually use (`sandbox.mintSession`, NOT the
|
|
652
|
+
* `index.ts` free functions), so without this the provider toggle would
|
|
653
|
+
* have zero effect in `pyric dev`/Studio's served mode, the primary
|
|
654
|
+
* product surface. `'uid'` (session RESTORE for an existing identity —
|
|
655
|
+
* a page reload re-establishing a previously-valid session) is
|
|
656
|
+
* deliberately NOT gated, matching {@link restoreSession}: disabling a
|
|
657
|
+
* provider after the fact doesn't retroactively invalidate an already-
|
|
658
|
+
* authenticated session, same as real Firebase.
|
|
659
|
+
*/
|
|
660
|
+
mintDetachedSession(request: MintSessionRequest): MintedSession;
|
|
661
|
+
/** The shared sign-in bookkeeping behind {@link mintDetachedSession} —
|
|
662
|
+
* everything {@link setCurrentUser} does for a real sign-in EXCEPT the
|
|
663
|
+
* global-session parts. */
|
|
664
|
+
private establishDetachedSession;
|
|
665
|
+
/** Reconstruct a `User` object from an {@link AuthState}. Returns
|
|
666
|
+
* `null` for `null` input. Used to mirror sandbox-level state
|
|
667
|
+
* changes that didn't originate from this backend. */
|
|
668
|
+
private buildUserFromState;
|
|
669
|
+
/**
|
|
670
|
+
* Mint a fresh `{ token, result }` for the given uid + claims. Used
|
|
671
|
+
* both on initial `getIdToken` (cache miss) and on a forced
|
|
672
|
+
* refresh. Each call advances {@link nextTokenSerial} so two
|
|
673
|
+
* refreshes inside the same millisecond still produce distinct
|
|
674
|
+
* token strings.
|
|
675
|
+
*/
|
|
676
|
+
private mintToken;
|
|
677
|
+
/**
|
|
678
|
+
* Get-or-mint the ID token entry for a uid. `forceRefresh: true`
|
|
679
|
+
* always mints a fresh token, overwrites the cache, and fires the
|
|
680
|
+
* `onIdTokenChanged` listeners (NOT `onAuthStateChanged` — the
|
|
681
|
+
* user identity didn't change). Matches prod oracle observations:
|
|
682
|
+
*
|
|
683
|
+
* - `auth-getidtoken-force-refresh.json` — forceRefresh returns a
|
|
684
|
+
* different string than the previous read; a subsequent
|
|
685
|
+
* getIdToken(false) returns the new (cached) token.
|
|
686
|
+
* - `auth-onidtokenchanged-force-refresh.json` — onIdTokenChanged
|
|
687
|
+
* fires after a forced refresh.
|
|
688
|
+
*/
|
|
689
|
+
getIdTokenFor(uid: string, claims: Record<string, unknown>, forceRefresh: boolean): string;
|
|
690
|
+
/** {@link getIdTokenFor} variant returning the full IdTokenResult.
|
|
691
|
+
* Same cache + fan-out semantics. */
|
|
692
|
+
getIdTokenResultFor(uid: string, claims: Record<string, unknown>, forceRefresh: boolean): IdTokenResult;
|
|
693
|
+
/**
|
|
694
|
+
* Build a `User` shell whose `getIdToken` / `getIdTokenResult`
|
|
695
|
+
* route through the backend's token cache. The User object closes
|
|
696
|
+
* over its uid + claims; the cache is owned by the backend so all
|
|
697
|
+
* User instances for the same uid agree on the current token.
|
|
698
|
+
*/
|
|
699
|
+
private makeUser;
|
|
700
|
+
/**
|
|
701
|
+
* Update a signed-in user's profile (`displayName` / `photoURL`) — the
|
|
702
|
+
* backend behind the top-level `updateProfile(user, profile)`.
|
|
703
|
+
*
|
|
704
|
+
* Updates the stored record, then mutates the passed `user` AND
|
|
705
|
+
* `this.cachedUser` IN PLACE when their uid matches (the `User` fields are
|
|
706
|
+
* TS-`readonly` but runtime-mutable, so held references — including
|
|
707
|
+
* `auth.currentUser` — reflect the change without a re-read). Only a field
|
|
708
|
+
* whose `profile.<field> !== undefined` is applied, so `null` clears and
|
|
709
|
+
* `undefined` leaves the field untouched.
|
|
710
|
+
*
|
|
711
|
+
* Fires the coarse user-DB change (`notifyUsersChanged`) + a `user_update`
|
|
712
|
+
* activity event, but does NOT fan out auth-state / id-token listeners:
|
|
713
|
+
* real `firebase/auth.updateProfile` does not fire `onAuthStateChanged` /
|
|
714
|
+
* `onIdTokenChanged`.
|
|
715
|
+
*/
|
|
716
|
+
updateProfileFor(user: User, profile: {
|
|
717
|
+
displayName?: string | null;
|
|
718
|
+
photoURL?: string | null;
|
|
719
|
+
}): void;
|
|
720
|
+
/** Mutate a `User`'s `displayName` / `photoURL` (and the first
|
|
721
|
+
* `providerData` entry's, when present) in place. `readonly` at the type
|
|
722
|
+
* level, mutable at runtime — cast through a Mutable helper. Only applies a
|
|
723
|
+
* field when it was explicitly provided (`!== undefined`). */
|
|
724
|
+
private applyProfileToUser;
|
|
725
|
+
/**
|
|
726
|
+
* Worker-path `updateProfile`: update the stored record for `uid`
|
|
727
|
+
* (+ mutate `this.cachedUser` in place if it matches), then return the
|
|
728
|
+
* refreshed {@link AuthUserRecord}. The worker holds the real per-port
|
|
729
|
+
* session `User` and mutates it separately (host-auth.ts). Throws
|
|
730
|
+
* `auth/user-not-found` for an unknown uid.
|
|
731
|
+
*/
|
|
732
|
+
updateProfileByUid(uid: string, profile: {
|
|
733
|
+
displayName?: string | null;
|
|
734
|
+
photoURL?: string | null;
|
|
735
|
+
}): AuthUserRecord;
|
|
736
|
+
/** Live customClaims for a uid — the current value in the user DB,
|
|
737
|
+
* falling back to `fallback` for uids the DB doesn't track (anonymous
|
|
738
|
+
* / popup users). Used so a re-seed / `updateUser` is reflected in
|
|
739
|
+
* held users' forced-refresh tokens (AUTH-B10). */
|
|
740
|
+
private liveClaims;
|
|
741
|
+
/** Internal validator for email/password — checks the password
|
|
742
|
+
* matches the stored record. Throws `auth/invalid-email` on a
|
|
743
|
+
* malformed email, `auth/wrong-password` on mismatch,
|
|
744
|
+
* `auth/user-not-found` if the email isn't seeded.
|
|
745
|
+
*
|
|
746
|
+
* Format validation fires BEFORE the user-DB lookup so callers
|
|
747
|
+
* shipping malformed inputs see the same `auth/invalid-email`
|
|
748
|
+
* prod returns — they wouldn't reach the missing-user path in
|
|
749
|
+
* production either. Password-strength is NOT enforced on sign-in
|
|
750
|
+
* (a previously-weak seeded password should still let the user
|
|
751
|
+
* in); only `createUserWithEmailAndPassword` runs the strength
|
|
752
|
+
* check, mirroring prod. */
|
|
753
|
+
validatePassword(email: string, password: string): StoredUser;
|
|
754
|
+
}
|
|
755
|
+
/**
|
|
756
|
+
* Build a real `FirebaseError` (the same class `firebase/auth` throws),
|
|
757
|
+
* with the prod message wrapper `Firebase: <message> (<code>).`
|
|
758
|
+
* (`clones/.../util/src/errors.ts:121` — `${serviceName}: ${message}
|
|
759
|
+
* (${fullCode}).`, serviceName `Firebase`). So consumer code that does
|
|
760
|
+
* `err instanceof FirebaseError` or matches on the wrapped message sees
|
|
761
|
+
* the same shape sandbox vs prod (AUTH-GAP). `.code` is preserved.
|
|
762
|
+
*
|
|
763
|
+
* Oracle-pinned shapes this reproduces:
|
|
764
|
+
* - `Firebase: Error (auth/invalid-email).`
|
|
765
|
+
* - `Firebase: Password should be at least 6 characters (auth/weak-password).`
|
|
766
|
+
*/
|
|
767
|
+
export declare function makeAuthError(code: string, message: string): FirebaseError;
|
|
768
|
+
export {};
|
|
769
|
+
//# sourceMappingURL=sandbox-backend.d.ts.map
|