pyric 0.0.1 → 0.1.0-alpha.8
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 +138 -2
- package/README.md.orig +54 -0
- 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 +110 -3
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `DocumentRefImpl` — Admin-SDK-compat `DocumentReference` backed by
|
|
3
|
+
* `LocalEnvironment`.
|
|
4
|
+
*
|
|
5
|
+
* Ported from bench's `pilot/src/firestore-wrapper.ts:213-270`. The
|
|
6
|
+
* behavioral nuance worth a comment is `set()`: the simulator's
|
|
7
|
+
* evaluator wants distinct `'create'` / `'update'` rule clauses (no
|
|
8
|
+
* `allow set:` syntax). So `set()` peeks at `getDocument(path)`,
|
|
9
|
+
* dispatches to `create` if absent / `update` if present.
|
|
10
|
+
*
|
|
11
|
+
* Differences from the bench source:
|
|
12
|
+
* - Plain `Error` throws → `FirestoreCompatError` with the typed
|
|
13
|
+
* `FirestoreErrorCode` from the SDK's `OperationResult.error`.
|
|
14
|
+
* Falls back to `'permission-denied'` if the simulator returned a
|
|
15
|
+
* denial without a structured error (defense-in-depth — slice-1
|
|
16
|
+
* review locked that every denial carries `error`, but the
|
|
17
|
+
* fallback keeps the wrapper honest if that invariant ever slips).
|
|
18
|
+
* - The `update`-as-partial vs Firestore-`set`-as-replace divergence
|
|
19
|
+
* is documented (and locked) at the design-doc level — see
|
|
20
|
+
* the design rationale.
|
|
21
|
+
*/
|
|
22
|
+
import type { LocalEnvironment } from 'pyric/sandbox/internal';
|
|
23
|
+
import { type AuthContext, type CollectionReference, type DocumentData, type DocumentReference, type DocumentSnapshot, type OperationOptions, type SetOptions } from './types.js';
|
|
24
|
+
export declare class DocumentRefImpl implements DocumentReference {
|
|
25
|
+
private readonly env;
|
|
26
|
+
private readonly auth;
|
|
27
|
+
private readonly bypassRules;
|
|
28
|
+
readonly id: string;
|
|
29
|
+
readonly path: string;
|
|
30
|
+
constructor(env: LocalEnvironment, auth: AuthContext, path: string, bypassRules?: boolean);
|
|
31
|
+
get parent(): CollectionReference;
|
|
32
|
+
collection(name: string): CollectionReference;
|
|
33
|
+
get(opts?: OperationOptions): Promise<DocumentSnapshot>;
|
|
34
|
+
set(data: DocumentData, options?: SetOptions): Promise<void>;
|
|
35
|
+
update(data: DocumentData, opts?: OperationOptions): Promise<void>;
|
|
36
|
+
delete(opts?: OperationOptions): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=doc-ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc-ref.d.ts","sourceRoot":"","sources":["../../../../src/sandbox/firestore/admin-compat/doc-ref.ts"],"names":[],"mappings":"AAA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apper.ts:213-270`. The
|
|
6
|
+
* behavioral nuance worth a comment is `set()`: the simulator's
|
|
7
|
+
* evaluator wants distinct `'create'` / `'update'` rule clauses (no
|
|
8
|
+
* `allow set:` syntax). So `set()` peeks at `getDocument(path)`,
|
|
9
|
+
* dispatches to `create` if absent / `update` if present.
|
|
10
|
+
*
|
|
11
|
+
* Differences from the bench source:
|
|
12
|
+
* - Plain `Error` throws → `FirestoreCompatError` with the typed
|
|
13
|
+
* `FirestoreErrorCode` from the SDK's `OperationResult.error`.
|
|
14
|
+
* Falls back to `'permission-denied'` if the simulator returned a
|
|
15
|
+
* denial without a structured error (defense-in-depth — slice-1
|
|
16
|
+
* review locked that every denial carries `error`, but the
|
|
17
|
+
* fallback keeps the wrapper honest if that invariant ever slips).
|
|
18
|
+
* - The `update`-as-partial vs Firestore-`set`-as-replace divergence
|
|
19
|
+
* is documented (and locked) at the design-doc level — see
|
|
20
|
+
* the design rationale.
|
|
21
|
+
*/
|
|
22
|
+
import { makeError } from 'pyric/sandbox/internal';
|
|
23
|
+
import { lastSegment, parentCollectionPath } from './paths.js';
|
|
24
|
+
import { makeDocSnapshot } from './snapshots.js';
|
|
25
|
+
import { CollectionRefImpl } from './query.js';
|
|
26
|
+
import { FirestoreCompatError, } from './types.js';
|
|
27
|
+
/**
|
|
28
|
+
* Convert a denied `OperationResult` into a typed throwable. Prefers
|
|
29
|
+
* the result's structured error; falls back to `'permission-denied'`
|
|
30
|
+
* with a stitched-together message from `debugMessages`.
|
|
31
|
+
*/
|
|
32
|
+
function throwFromDenial(result, contextLabel) {
|
|
33
|
+
if (result.error) {
|
|
34
|
+
throw new FirestoreCompatError(result.error);
|
|
35
|
+
}
|
|
36
|
+
const msg = result.debugMessages.length > 0
|
|
37
|
+
? result.debugMessages.join('; ')
|
|
38
|
+
: '(no debug message)';
|
|
39
|
+
throw new FirestoreCompatError(makeError('permission-denied', `${contextLabel}: ${msg}`));
|
|
40
|
+
}
|
|
41
|
+
export class DocumentRefImpl {
|
|
42
|
+
env;
|
|
43
|
+
auth;
|
|
44
|
+
bypassRules;
|
|
45
|
+
id;
|
|
46
|
+
path;
|
|
47
|
+
constructor(env, auth, path,
|
|
48
|
+
// Studio admin lens (Gap #2) — stamped onto every Operation this ref
|
|
49
|
+
// issues. Inherited by child collection refs. Default false.
|
|
50
|
+
bypassRules = false) {
|
|
51
|
+
this.env = env;
|
|
52
|
+
this.auth = auth;
|
|
53
|
+
this.bypassRules = bypassRules;
|
|
54
|
+
this.path = path;
|
|
55
|
+
this.id = lastSegment(path);
|
|
56
|
+
}
|
|
57
|
+
get parent() {
|
|
58
|
+
return new CollectionRefImpl(this.env, this.auth, parentCollectionPath(this.path), this.bypassRules);
|
|
59
|
+
}
|
|
60
|
+
collection(name) {
|
|
61
|
+
return new CollectionRefImpl(this.env, this.auth, `${this.path}/${name}`, this.bypassRules);
|
|
62
|
+
}
|
|
63
|
+
async get(opts) {
|
|
64
|
+
const result = this.env.execute({
|
|
65
|
+
method: 'get',
|
|
66
|
+
path: this.path,
|
|
67
|
+
auth: opts?.auth !== undefined ? opts.auth : this.auth,
|
|
68
|
+
bypassRules: this.bypassRules,
|
|
69
|
+
});
|
|
70
|
+
if (!result.allowed)
|
|
71
|
+
throwFromDenial(result, 'get denied');
|
|
72
|
+
// execute() returns `data: undefined` for "denied" and `data: null`
|
|
73
|
+
// for "doc absent (rule allowed)". makeDocSnapshot treats both as
|
|
74
|
+
// "not exists", which matches Admin SDK's `snap.exists === false`
|
|
75
|
+
// for a get of a missing doc.
|
|
76
|
+
const data = result.data === undefined || result.data === null
|
|
77
|
+
? undefined
|
|
78
|
+
: result.data;
|
|
79
|
+
return makeDocSnapshot(this, data);
|
|
80
|
+
}
|
|
81
|
+
async set(data, options) {
|
|
82
|
+
// Three branches — each rides on the same execute() pipeline but
|
|
83
|
+
// chooses a different combination of (rule clause, storage mode):
|
|
84
|
+
//
|
|
85
|
+
// - default: rule clause picked by execute() (create / update),
|
|
86
|
+
// storage REPLACES via the `'set'` method. Matches Firestore
|
|
87
|
+
// `set(data)` semantics.
|
|
88
|
+
// - { merge: true }: shallow-merge every top-level field via the
|
|
89
|
+
// `'update'` rule clause + storage update (which merges).
|
|
90
|
+
// Falls back to `'create'` when the doc is absent.
|
|
91
|
+
// - { mergeFields: [...] }: project `data` to just the listed
|
|
92
|
+
// top-level fields, then dispatch the same way as merge:true.
|
|
93
|
+
const auth = options?.auth !== undefined ? options.auth : this.auth;
|
|
94
|
+
if (options?.mergeFields !== undefined) {
|
|
95
|
+
// FS-B6: pass the full data + the field-path mask to the merge
|
|
96
|
+
// engine. It deep-merges only the listed (dot-separated) paths into
|
|
97
|
+
// the existing doc — dropping the old shallow top-level projection.
|
|
98
|
+
const mergeFields = options.mergeFields.map((f) => String(f));
|
|
99
|
+
const existing = this.env.getDocument(this.path);
|
|
100
|
+
const method = existing === null ? 'create' : 'update';
|
|
101
|
+
const result = this.env.execute({
|
|
102
|
+
method, path: this.path, data, auth, merge: { mergeFields },
|
|
103
|
+
bypassRules: this.bypassRules,
|
|
104
|
+
});
|
|
105
|
+
if (!result.allowed)
|
|
106
|
+
throwFromDenial(result, `set denied (as ${method})`);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (options?.merge === true) {
|
|
110
|
+
// FS-B6: deep-merge nested maps into the existing doc instead of the
|
|
111
|
+
// old shallow top-level spread.
|
|
112
|
+
const existing = this.env.getDocument(this.path);
|
|
113
|
+
const method = existing === null ? 'create' : 'update';
|
|
114
|
+
const result = this.env.execute({
|
|
115
|
+
method, path: this.path, data, auth, merge: true,
|
|
116
|
+
bypassRules: this.bypassRules,
|
|
117
|
+
});
|
|
118
|
+
if (!result.allowed)
|
|
119
|
+
throwFromDenial(result, `set denied (as ${method})`);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
// Default — replace semantics. The simulator's `'set'` method
|
|
123
|
+
// translates to `create` / `update` for rules eval but routes to
|
|
124
|
+
// `state.set` (replace) for storage.
|
|
125
|
+
const result = this.env.execute({
|
|
126
|
+
method: 'set', path: this.path, data, auth,
|
|
127
|
+
bypassRules: this.bypassRules,
|
|
128
|
+
});
|
|
129
|
+
if (!result.allowed)
|
|
130
|
+
throwFromDenial(result, 'set denied');
|
|
131
|
+
}
|
|
132
|
+
async update(data, opts) {
|
|
133
|
+
const result = this.env.execute({
|
|
134
|
+
method: 'update',
|
|
135
|
+
path: this.path,
|
|
136
|
+
data,
|
|
137
|
+
auth: opts?.auth !== undefined ? opts.auth : this.auth,
|
|
138
|
+
bypassRules: this.bypassRules,
|
|
139
|
+
});
|
|
140
|
+
if (!result.allowed)
|
|
141
|
+
throwFromDenial(result, 'update denied');
|
|
142
|
+
}
|
|
143
|
+
async delete(opts) {
|
|
144
|
+
const result = this.env.execute({
|
|
145
|
+
method: 'delete',
|
|
146
|
+
path: this.path,
|
|
147
|
+
auth: opts?.auth !== undefined ? opts.auth : this.auth,
|
|
148
|
+
bypassRules: this.bypassRules,
|
|
149
|
+
});
|
|
150
|
+
if (!result.allowed)
|
|
151
|
+
throwFromDenial(result, 'delete denied');
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=doc-ref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc-ref.js","sourceRoot":"","sources":["../../../../src/sandbox/firestore/admin-compat/doc-ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EACL,oBAAoB,GAQrB,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,SAAS,eAAe,CACtB,MAAuB,EACvB,YAAoB;IAEpB,IAAI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4
|
+
*
|
|
5
|
+
* Path-shape validation lives at the input boundary so a typo'd path
|
|
6
|
+
* surfaces as `'invalid-argument'` rather than a downstream
|
|
7
|
+
* `'unimplemented'`/`'permission-denied'` blur. Slice 4 wires the
|
|
8
|
+
* remaining method bodies (batch, runTransaction).
|
|
9
|
+
*
|
|
10
|
+
* `runTransaction` carries two locked translations:
|
|
11
|
+
*
|
|
12
|
+
* - **Divergence #4-A:** the simulator throws `ReadAfterWriteError`
|
|
13
|
+
* (a plain `Error` subclass carrying `.simError`) when a tx reads
|
|
14
|
+
* after writing. Translate the throw into a typed
|
|
15
|
+
* `FirestoreCompatError { code: 'failed-precondition' }` so
|
|
16
|
+
* callers can `if (e.code === 'failed-precondition')` without
|
|
17
|
+
* instanceof-checking against an SDK-internal class.
|
|
18
|
+
*
|
|
19
|
+
* - **Divergence #4-B:** the simulator's `transaction()` returns
|
|
20
|
+
* `TransactionResult.allowed === false` (with a typed `error`)
|
|
21
|
+
* when a queued write fails at commit (e.g., `tx.create` on an
|
|
22
|
+
* existing doc). Surface the typed error directly so the
|
|
23
|
+
* `'already-exists'` code reaches the caller.
|
|
24
|
+
*
|
|
25
|
+
* The `await` on the env.transaction call is load-bearing: bench
|
|
26
|
+
* wrapper line 195 documents that without it, an async callback
|
|
27
|
+
* leaves `result` as a Promise object whose `.allowed` is undefined,
|
|
28
|
+
* which we'd then misread as a denial.
|
|
29
|
+
*
|
|
30
|
+
* See the design rationale for slice contracts.
|
|
31
|
+
*/
|
|
32
|
+
import type { LocalEnvironment } from 'pyric/sandbox/internal';
|
|
33
|
+
import { type AuthContext, type CollectionReference, type DocumentReference, type Firestore, type OperationOptions, type Query, type Transaction, type WriteBatch } from './types.js';
|
|
34
|
+
export declare class FirestoreImpl implements Firestore {
|
|
35
|
+
private readonly env;
|
|
36
|
+
private readonly auth;
|
|
37
|
+
private readonly bypassRules;
|
|
38
|
+
constructor(env: LocalEnvironment, auth: AuthContext, bypassRules?: boolean);
|
|
39
|
+
collection(path: string): CollectionReference;
|
|
40
|
+
doc(path: string): DocumentReference;
|
|
41
|
+
collectionGroup(collectionId: string): Query;
|
|
42
|
+
batch(): WriteBatch;
|
|
43
|
+
runTransaction<R>(fn: (tx: Transaction) => Promise<R> | R, opts?: OperationOptions): Promise<R>;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=firestore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firestore.d.ts","sourceRoot":"","sources":["../../../../src/sandbox/firestore/admin-compat/firestore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAQ/D,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,UAAU,EAChB,MAAM,YAAY,CAAC;AAEpB,qBAAa,aAAc,YAAW,SAAS;IAE3C,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAKrB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBANX,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,WAAW,EAKjB,WAAW,GAAE,OAAe;IAG/C,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB;IAY7C,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB;IAYpC,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,KAAK;IAc5C,KAAK,IAAI,UAAU;IAIb,cAAc,CAAC,CAAC,EACpB,EAAE,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,EACvC,IAAI,CAAC,EAAE,gBAAgB,GACtB,OAAO,CAAC,CAAC,CAAC;CA0Cd"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `FirestoreImpl` — top-level Admin-SDK-compat handle backed by a
|
|
3
|
+
* `LocalEnvironment`.
|
|
4
|
+
*
|
|
5
|
+
* Path-shape validation lives at the input boundary so a typo'd path
|
|
6
|
+
* surfaces as `'invalid-argument'` rather than a downstream
|
|
7
|
+
* `'unimplemented'`/`'permission-denied'` blur. Slice 4 wires the
|
|
8
|
+
* remaining method bodies (batch, runTransaction).
|
|
9
|
+
*
|
|
10
|
+
* `runTransaction` carries two locked translations:
|
|
11
|
+
*
|
|
12
|
+
* - **Divergence #4-A:** the simulator throws `ReadAfterWriteError`
|
|
13
|
+
* (a plain `Error` subclass carrying `.simError`) when a tx reads
|
|
14
|
+
* after writing. Translate the throw into a typed
|
|
15
|
+
* `FirestoreCompatError { code: 'failed-precondition' }` so
|
|
16
|
+
* callers can `if (e.code === 'failed-precondition')` without
|
|
17
|
+
* instanceof-checking against an SDK-internal class.
|
|
18
|
+
*
|
|
19
|
+
* - **Divergence #4-B:** the simulator's `transaction()` returns
|
|
20
|
+
* `TransactionResult.allowed === false` (with a typed `error`)
|
|
21
|
+
* when a queued write fails at commit (e.g., `tx.create` on an
|
|
22
|
+
* existing doc). Surface the typed error directly so the
|
|
23
|
+
* `'already-exists'` code reaches the caller.
|
|
24
|
+
*
|
|
25
|
+
* The `await` on the env.transaction call is load-bearing: bench
|
|
26
|
+
* wrapper line 195 documents that without it, an async callback
|
|
27
|
+
* leaves `result` as a Promise object whose `.allowed` is undefined,
|
|
28
|
+
* which we'd then misread as a denial.
|
|
29
|
+
*
|
|
30
|
+
* See the design rationale for slice contracts.
|
|
31
|
+
*/
|
|
32
|
+
import { makeError } from 'pyric/sandbox/internal';
|
|
33
|
+
import { ReadAfterWriteError } from 'pyric/sandbox/internal';
|
|
34
|
+
import { isCollectionPath, isDocumentPath } from './paths.js';
|
|
35
|
+
import { CollectionGroupQueryImpl, CollectionRefImpl } from './query.js';
|
|
36
|
+
import { DocumentRefImpl } from './doc-ref.js';
|
|
37
|
+
import { WriteBatchImpl } from './batch.js';
|
|
38
|
+
import { TransactionImpl } from './transaction.js';
|
|
39
|
+
import { FirestoreCompatError, } from './types.js';
|
|
40
|
+
export class FirestoreImpl {
|
|
41
|
+
env;
|
|
42
|
+
auth;
|
|
43
|
+
bypassRules;
|
|
44
|
+
constructor(env, auth,
|
|
45
|
+
// Studio admin lens (Gap #2): when true, every op produced by this
|
|
46
|
+
// handle (and the refs/batch/tx it spawns) carries `bypassRules`, so
|
|
47
|
+
// the LocalEnvironment skips rule evaluation. Threaded down to each
|
|
48
|
+
// child impl alongside `auth`. Default false → rules enforced.
|
|
49
|
+
bypassRules = false) {
|
|
50
|
+
this.env = env;
|
|
51
|
+
this.auth = auth;
|
|
52
|
+
this.bypassRules = bypassRules;
|
|
53
|
+
}
|
|
54
|
+
collection(path) {
|
|
55
|
+
if (!isCollectionPath(path)) {
|
|
56
|
+
throw new FirestoreCompatError(makeError('invalid-argument', `collection path must have an odd number of segments: ${path}`));
|
|
57
|
+
}
|
|
58
|
+
return new CollectionRefImpl(this.env, this.auth, path, this.bypassRules);
|
|
59
|
+
}
|
|
60
|
+
doc(path) {
|
|
61
|
+
if (!isDocumentPath(path)) {
|
|
62
|
+
throw new FirestoreCompatError(makeError('invalid-argument', `document path must have an even number of segments: ${path}`));
|
|
63
|
+
}
|
|
64
|
+
return new DocumentRefImpl(this.env, this.auth, path, this.bypassRules);
|
|
65
|
+
}
|
|
66
|
+
collectionGroup(collectionId) {
|
|
67
|
+
if (collectionId.length === 0 || collectionId.includes('/')) {
|
|
68
|
+
throw new FirestoreCompatError(makeError('invalid-argument', `collection group id must be a single non-empty segment with no '/': ${collectionId}`));
|
|
69
|
+
}
|
|
70
|
+
return new CollectionGroupQueryImpl(this.env, this.auth, collectionId, [], [], undefined, false, undefined, undefined, this.bypassRules);
|
|
71
|
+
}
|
|
72
|
+
batch() {
|
|
73
|
+
return new WriteBatchImpl(this.env, this.auth, this.bypassRules);
|
|
74
|
+
}
|
|
75
|
+
async runTransaction(fn, opts) {
|
|
76
|
+
let result;
|
|
77
|
+
try {
|
|
78
|
+
// The await is load-bearing: see header for the bench-line-195
|
|
79
|
+
// note. Sync-callback path collapses through the same await with
|
|
80
|
+
// no functional difference.
|
|
81
|
+
result = await this.env.transaction((simTx) => {
|
|
82
|
+
const tx = new TransactionImpl(simTx);
|
|
83
|
+
return fn(tx);
|
|
84
|
+
}, {
|
|
85
|
+
auth: opts?.auth !== undefined ? opts.auth : this.auth,
|
|
86
|
+
bypassRules: this.bypassRules,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
catch (e) {
|
|
90
|
+
// Divergence #4-A: ReadAfterWriteError → typed
|
|
91
|
+
// 'failed-precondition'. Other throws (callback throws, sentinel
|
|
92
|
+
// resolution errors that escape to here) propagate untouched —
|
|
93
|
+
// they aren't wrapper-translatable.
|
|
94
|
+
if (e instanceof ReadAfterWriteError) {
|
|
95
|
+
throw new FirestoreCompatError(e.simError);
|
|
96
|
+
}
|
|
97
|
+
throw e;
|
|
98
|
+
}
|
|
99
|
+
if (!result.allowed) {
|
|
100
|
+
// Divergence #4-B (and the broader denial case): the simulator
|
|
101
|
+
// attaches a typed `error` to any non-allowed result. Surface
|
|
102
|
+
// it directly so codes like 'already-exists' reach the caller.
|
|
103
|
+
if (result.error) {
|
|
104
|
+
throw new FirestoreCompatError(result.error);
|
|
105
|
+
}
|
|
106
|
+
// Defensive — should be unreachable under Item 6 invariant.
|
|
107
|
+
const denied = result.writes.find((w) => !w.allowed);
|
|
108
|
+
const msg = denied?.debugMessages.join('; ') ?? 'transaction denied at commit';
|
|
109
|
+
throw new FirestoreCompatError(makeError('permission-denied', `transaction failed: ${msg}`));
|
|
110
|
+
}
|
|
111
|
+
return result.returnValue;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=firestore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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C,CAAC,IAAI,CAAC,IAAI;gBACtD,WAAW,EAAE,IAAI,CAAC,WAAW;aAC9B,CACF,CAAC;QACJ,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,+CAA+C;YAC/C,iEAAiE;YACjE,+DAA+D;YAC/D,oCAAoC;YACpC,IAAI,CAAC,YAAY,mBAAmB,EAAE,CAAC;gBACrC,MAAM,IAAI,oBAAoB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;YAC7C,CAAC;YACD,MAAM,CAAC,CAAC;QACV,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,+DAA+D;YAC/D,8DAA8D;YAC9D,+DAA+D;YAC/D,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;gBACjB,MAAM,IAAI,oBAAoB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC/C,CAAC;YACD,4DAA4D;YAC5D,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;YACrD,MAAM,GAAG,GAAG,MAAM,EAAE,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,8BAA8B,CAAC;YAC/E,MAAM,IAAI,oBAAoB,CAC5B,SAAS,CAAC,mBAAmB,EAAE,uBAAuB,GAAG,EAAE,CAAC,CAC7D,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC,WAAgB,CAAC;IACjC,CAAC;CACF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Admin-SDK-compat Firestore wrapper for `LocalEnvironment`.
|
|
3
|
+
*
|
|
4
|
+
* Lets agent code written against the firebase-admin Firestore surface
|
|
5
|
+
* run unchanged against the SDK's local simulator. Design rationale +
|
|
6
|
+
* locked divergences live in the design rationale;
|
|
7
|
+
* implementation slicing in the design rationale.
|
|
8
|
+
*
|
|
9
|
+
* Slice 1: shipped public types + a stub `createCompatFirestore`.
|
|
10
|
+
* Slice 2 (this commit): real `FirestoreImpl` with path-shape validation
|
|
11
|
+
* on `collection`/`doc`. The collection/doc/batch/runTransaction bodies
|
|
12
|
+
* still throw `'unimplemented'` until slices 3 + 4 land — but the class
|
|
13
|
+
* shape is final and the path-validation errors users hit first are
|
|
14
|
+
* already typed correctly (`invalid-argument`, not `unimplemented`).
|
|
15
|
+
*/
|
|
16
|
+
import type { LocalEnvironment } from 'pyric/sandbox/internal';
|
|
17
|
+
import { type AuthContext, type Firestore } from './types.js';
|
|
18
|
+
export { FirestoreCompatError, FieldValue, Timestamp, } from './types.js';
|
|
19
|
+
export type { AggregateField, AggregateQuerySnapshot, AggregateSpec, Filter, AuthContext, CollectionReference, DocumentData, DocumentReference, DocumentSnapshot, FieldValueSentinel, Firestore, FirestoreErrorCode, FirestoreEvalRequest, FirestoreEvalResource, FirestoreSimError, OperationOptions, OrderDirection, Query, QueryDocumentSnapshot, QuerySnapshot, SetOptions, Transaction, WhereFilterOp, WriteBatch, } from './types.js';
|
|
20
|
+
export interface CreateCompatFirestoreOptions {
|
|
21
|
+
/**
|
|
22
|
+
* Default auth context applied to every operation. Per-op overrides
|
|
23
|
+
* land in slice 3 (constructor-default + per-op override pattern from
|
|
24
|
+
* divergence #6).
|
|
25
|
+
*/
|
|
26
|
+
auth?: AuthContext;
|
|
27
|
+
/**
|
|
28
|
+
* Studio admin lens (Pyric Studio Gap #2). When `true`, the returned
|
|
29
|
+
* handle's operations BYPASS security rules — every read/write is
|
|
30
|
+
* treated as ALLOW (the modular-shaped equivalent of `sandbox.admin.*`).
|
|
31
|
+
* Storage preconditions and the event/listener path are unchanged; only
|
|
32
|
+
* rule evaluation is skipped. Default `false` → rules enforced under
|
|
33
|
+
* `auth`. Used by `getAdminFirestore` (see `pyric-admin` and
|
|
34
|
+
* `pyric/firestore`).
|
|
35
|
+
*/
|
|
36
|
+
bypassRules?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Construct an Admin-SDK-compat Firestore handle backed by a
|
|
40
|
+
* `LocalEnvironment`. Slice 2 returns a real `FirestoreImpl` with
|
|
41
|
+
* working path-shape validation; the per-method bodies still throw
|
|
42
|
+
* `'unimplemented'` until slices 3 + 4 land.
|
|
43
|
+
*/
|
|
44
|
+
export declare function createCompatFirestore(env: LocalEnvironment, opts?: CreateCompatFirestoreOptions): Firestore;
|
|
45
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sandbox/firestore/admin-compat/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,SAAS,EACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,SAAS,GACV,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,cAAc,EACd,sBAAsB,EACtB,aAAa,EACb,MAAM,EACN,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,EACT,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,KAAK,EACL,qBAAqB,EACrB,aAAa,EACb,UAAU,EACV,WAAW,EACX,aAAa,EACb,UAAU,GACX,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,gBAAgB,EACrB,IAAI,CAAC,EAAE,4BAA4B,GAClC,SAAS,CAEX"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Admin-SDK-compat Firestore wrapper for `LocalEnvironment`.
|
|
3
|
+
*
|
|
4
|
+
* Lets agent code written against the firebase-admin Firestore surface
|
|
5
|
+
* run unchanged against the SDK's local simulator. Design rationale +
|
|
6
|
+
* locked divergences live in the design rationale;
|
|
7
|
+
* implementation slicing in the design rationale.
|
|
8
|
+
*
|
|
9
|
+
* Slice 1: shipped public types + a stub `createCompatFirestore`.
|
|
10
|
+
* Slice 2 (this commit): real `FirestoreImpl` with path-shape validation
|
|
11
|
+
* on `collection`/`doc`. The collection/doc/batch/runTransaction bodies
|
|
12
|
+
* still throw `'unimplemented'` until slices 3 + 4 land — but the class
|
|
13
|
+
* shape is final and the path-validation errors users hit first are
|
|
14
|
+
* already typed correctly (`invalid-argument`, not `unimplemented`).
|
|
15
|
+
*/
|
|
16
|
+
import { FirestoreImpl } from './firestore.js';
|
|
17
|
+
export { FirestoreCompatError, FieldValue, Timestamp, } from './types.js';
|
|
18
|
+
/**
|
|
19
|
+
* Construct an Admin-SDK-compat Firestore handle backed by a
|
|
20
|
+
* `LocalEnvironment`. Slice 2 returns a real `FirestoreImpl` with
|
|
21
|
+
* working path-shape validation; the per-method bodies still throw
|
|
22
|
+
* `'unimplemented'` until slices 3 + 4 land.
|
|
23
|
+
*/
|
|
24
|
+
export function createCompatFirestore(env, opts) {
|
|
25
|
+
return new FirestoreImpl(env, opts?.auth ?? null, opts?.bypassRules ?? false);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/sandbox/firestore/admin-compat/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAM/C,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,SAAS,GACV,MAAM,YAAY,CAAC;AAgDpB;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CACnC,GAAqB,EACrB,IAAmC;IAEnC,OAAO,IAAI,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,IAAI,EAAE,WAAW,IAAI,KAAK,CAAC,CAAC;AAChF,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path helpers for the Admin-SDK-compat Firestore wrapper.
|
|
3
|
+
*
|
|
4
|
+
* Ported verbatim from bench's `pilot/src/firestore-wrapper.ts`
|
|
5
|
+
* (see the design rationale slice 2). Centralized
|
|
6
|
+
* here so `doc-ref.ts`, `query.ts`, and `firestore.ts` share one
|
|
7
|
+
* canonical segment-shape understanding — Admin SDK's even-segments-=-doc
|
|
8
|
+
* /odd-segments-=-collection convention is enforced at the wrapper's
|
|
9
|
+
* input boundary, before anything reaches `LocalEnvironment`.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Split a Firestore path into segments, dropping leading/trailing
|
|
13
|
+
* slashes. Empty input yields `['']` (downstream callers treat that as
|
|
14
|
+
* an invalid path via the *Path predicates).
|
|
15
|
+
*/
|
|
16
|
+
export declare function pathSegments(path: string): string[];
|
|
17
|
+
/**
|
|
18
|
+
* True iff `path` has an even, non-zero segment count — Admin SDK's
|
|
19
|
+
* shape rule for document paths (`collection/doc[/sub/doc]*`).
|
|
20
|
+
*/
|
|
21
|
+
export declare function isDocumentPath(path: string): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* True iff `path` has an odd segment count — Admin SDK's shape rule
|
|
24
|
+
* for collection paths (`collection[/doc/sub]*`).
|
|
25
|
+
*/
|
|
26
|
+
export declare function isCollectionPath(path: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Last segment of `path`. Used to derive `DocumentReference.id` /
|
|
29
|
+
* `CollectionReference.id` from full paths.
|
|
30
|
+
*/
|
|
31
|
+
export declare function lastSegment(path: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* Drop the trailing segment of a document path to get the collection
|
|
34
|
+
* that contains it. Used by `DocumentReference.parent`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function parentCollectionPath(docPath: string): string;
|
|
37
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../../src/sandbox/firestore/admin-compat/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAEnD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGhD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAG5D"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path helpers for the Admin-SDK-compat Firestore wrapper.
|
|
3
|
+
*
|
|
4
|
+
* Ported verbatim from bench's `pilot/src/firestore-wrapper.ts`
|
|
5
|
+
* (see the design rationale slice 2). Centralized
|
|
6
|
+
* here so `doc-ref.ts`, `query.ts`, and `firestore.ts` share one
|
|
7
|
+
* canonical segment-shape understanding — Admin SDK's even-segments-=-doc
|
|
8
|
+
* /odd-segments-=-collection convention is enforced at the wrapper's
|
|
9
|
+
* input boundary, before anything reaches `LocalEnvironment`.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Split a Firestore path into segments, dropping leading/trailing
|
|
13
|
+
* slashes. Empty input yields `['']` (downstream callers treat that as
|
|
14
|
+
* an invalid path via the *Path predicates).
|
|
15
|
+
*/
|
|
16
|
+
export function pathSegments(path) {
|
|
17
|
+
return path.replace(/^\/+|\/+$/g, '').split('/');
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* True iff `path` has an even, non-zero segment count — Admin SDK's
|
|
21
|
+
* shape rule for document paths (`collection/doc[/sub/doc]*`).
|
|
22
|
+
*/
|
|
23
|
+
export function isDocumentPath(path) {
|
|
24
|
+
return pathSegments(path).length % 2 === 0 && pathSegments(path).length > 0;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* True iff `path` has an odd segment count — Admin SDK's shape rule
|
|
28
|
+
* for collection paths (`collection[/doc/sub]*`).
|
|
29
|
+
*/
|
|
30
|
+
export function isCollectionPath(path) {
|
|
31
|
+
return pathSegments(path).length % 2 === 1;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Last segment of `path`. Used to derive `DocumentReference.id` /
|
|
35
|
+
* `CollectionReference.id` from full paths.
|
|
36
|
+
*/
|
|
37
|
+
export function lastSegment(path) {
|
|
38
|
+
const segs = pathSegments(path);
|
|
39
|
+
return segs[segs.length - 1] ?? '';
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Drop the trailing segment of a document path to get the collection
|
|
43
|
+
* that contains it. Used by `DocumentReference.parent`.
|
|
44
|
+
*/
|
|
45
|
+
export function parentCollectionPath(docPath) {
|
|
46
|
+
const segs = pathSegments(docPath);
|
|
47
|
+
return segs.slice(0, -1).join('/');
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../../src/sandbox/firestore/admin-compat/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACnD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AAC9E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC;AAC7C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAChC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AACrC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IACnC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACrC,CAAC"}
|