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,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RULES-B5 — int/float type distinction in the rules value model.
|
|
3
|
+
*
|
|
4
|
+
* Firestore Security Rules (CEL) has two distinct numeric types, `int`
|
|
5
|
+
* (INT64) and `float` (FLOAT64). The JS host has only one `number`, so
|
|
6
|
+
* `1` and `1.0` are indistinguishable at the host level — which is why
|
|
7
|
+
* the pre-fix evaluator reported `1.5 is int` → true and `1 is float` →
|
|
8
|
+
* true, and did float division for `10 / 4` (→ 2.5, where prod truncates
|
|
9
|
+
* int÷int to 2). See findings-ledger RULES-B5.
|
|
10
|
+
*
|
|
11
|
+
* The fix tags FLOAT values with this lightweight wrapper while bare JS
|
|
12
|
+
* `number` continues to mean `int`. Why wrap floats (not ints): integers
|
|
13
|
+
* are overwhelmingly the common case in rules data (counts, sizes, list
|
|
14
|
+
* indices, `request.time` millis), and every existing `typeof x ===
|
|
15
|
+
* 'number'` site already treats a bare number as an int — so wrapping the
|
|
16
|
+
* rarer float keeps the blast radius small. The evaluator unwraps floats
|
|
17
|
+
* at arithmetic/comparison boundaries via `numericValue()` and re-tags
|
|
18
|
+
* the result when either operand was a float.
|
|
19
|
+
*
|
|
20
|
+
* `is float` ↔ `value instanceof RulesFloat`; `is int` ↔ bare number.
|
|
21
|
+
* `string()` of a float keeps its decimal (`string(1.0)` → "1.0").
|
|
22
|
+
*
|
|
23
|
+
* Doc/oracle: https://firebase.google.com/docs/reference/rules/rules.Float
|
|
24
|
+
* (distinct Float type) + the CEL int/float division spec (int÷int
|
|
25
|
+
* truncates, int÷0 errors, float÷0 → NaN).
|
|
26
|
+
*/
|
|
27
|
+
import { RulesValue, NO_OP } from './base.js';
|
|
28
|
+
export class RulesFloat extends RulesValue {
|
|
29
|
+
typeName = 'float';
|
|
30
|
+
value;
|
|
31
|
+
constructor(value) {
|
|
32
|
+
super();
|
|
33
|
+
this.value = value;
|
|
34
|
+
}
|
|
35
|
+
/** Numeric coercion — float arithmetic unwraps to this raw double. */
|
|
36
|
+
valueOf() {
|
|
37
|
+
return this.value;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* `string()` of a float keeps a decimal point so the int/float
|
|
41
|
+
* distinction survives the cast: `string(1.0)` → "1.0", not "1".
|
|
42
|
+
* Non-integral floats stringify naturally (`string(1.5)` → "1.5").
|
|
43
|
+
*/
|
|
44
|
+
toString() {
|
|
45
|
+
return Number.isInteger(this.value) ? `${this.value}.0` : String(this.value);
|
|
46
|
+
}
|
|
47
|
+
toJSON() {
|
|
48
|
+
return { __type: 'float', value: this.value };
|
|
49
|
+
}
|
|
50
|
+
equals(other) {
|
|
51
|
+
// CEL compares int and float by numeric value (`1 == 1.0` → true), so
|
|
52
|
+
// equality unwraps both sides rather than gating on `instanceof`.
|
|
53
|
+
if (other instanceof RulesFloat)
|
|
54
|
+
return this.value === other.value;
|
|
55
|
+
if (typeof other === 'number')
|
|
56
|
+
return this.value === other;
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Float participates in arithmetic/comparison against bare-number ints
|
|
61
|
+
* and other floats. A float operand always yields a float result (CEL
|
|
62
|
+
* has no int÷float→int narrowing); division by zero is FLOAT division so
|
|
63
|
+
* it produces NaN (caller decides storeability) rather than erroring the
|
|
64
|
+
* way int÷0 does. NO_OP for any non-numeric operand so the evaluator's
|
|
65
|
+
* type-mismatch guard surfaces e.g. `1.5 + 'a'` as a real error.
|
|
66
|
+
*/
|
|
67
|
+
binaryOp(op, other) {
|
|
68
|
+
const r = other instanceof RulesFloat ? other.value
|
|
69
|
+
: typeof other === 'number' ? other
|
|
70
|
+
: undefined;
|
|
71
|
+
if (r === undefined)
|
|
72
|
+
return NO_OP;
|
|
73
|
+
const l = this.value;
|
|
74
|
+
switch (op) {
|
|
75
|
+
case '+': return new RulesFloat(l + r);
|
|
76
|
+
case '-': return new RulesFloat(l - r);
|
|
77
|
+
case '*': return new RulesFloat(l * r);
|
|
78
|
+
case '/': return new RulesFloat(l / r); // float ÷ 0 → ±Infinity / NaN
|
|
79
|
+
case '%': return new RulesFloat(l % r);
|
|
80
|
+
case '<': return l < r;
|
|
81
|
+
case '<=': return l <= r;
|
|
82
|
+
case '>': return l > r;
|
|
83
|
+
case '>=': return l >= r;
|
|
84
|
+
default: return NO_OP;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=float.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"float.js","sour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CAAC,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC;QAClC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;QACrB,QAAQ,EAAE,EAAE,CAAC;YACX,KAAK,GAAG,CAAC,CAAC,OAAO,IAAI,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACvC,KAAK,GAAG,CAAC,CAAC,OAAO,IAAI,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACvC,KAAK,GAAG,CAAC,CAAC,OAAO,IAAI,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACvC,KAAK,GAAG,CAAC,CAAC,OAAO,IAAI,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,8BAA8B;YACtE,KAAK,GAAG,CAAC,CAAC,OAAO,IAAI,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACvC,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACvB,KAAK,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACzB,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACvB,KAAK,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACzB,OAAO,CAAC,CAAC,OAAO,KAAK,CAAC;QACxB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LatLng wrapper for Firestore Rules `latlng` type — Item 1.1.
|
|
3
|
+
*
|
|
4
|
+
* Closes the LatLng type gap from REBUILD_PLAN.md "Current Evaluator Gap
|
|
5
|
+
* Analysis" — instance methods + the `latlng.value(lat, lng)` namespace
|
|
6
|
+
* constructor (was the entire `latlng` namespace gap).
|
|
7
|
+
*
|
|
8
|
+
* Reference surface (from REBUILD_PLAN.md "Reference Inventory"):
|
|
9
|
+
* - latitude() → Float, range [-90, 90]
|
|
10
|
+
* - longitude() → Float, range [-180, 180]
|
|
11
|
+
* - distance(other: LatLng) → Float, meters
|
|
12
|
+
* - Operators: == != only (no arithmetic — see RulesValue.binaryOp note)
|
|
13
|
+
*
|
|
14
|
+
* Construction: `latlng.value(lat, lng)` only. Production also accepts
|
|
15
|
+
* stored LatLng values from Firestore documents, but that path requires
|
|
16
|
+
* test-data sentinels we haven't introduced yet — single-source
|
|
17
|
+
* construction in 1.1 keeps the wrapper testable end-to-end.
|
|
18
|
+
*/
|
|
19
|
+
import { RulesValue, type NoOp } from './base.js';
|
|
20
|
+
export declare class LatLng extends RulesValue {
|
|
21
|
+
readonly typeName = "latlng";
|
|
22
|
+
readonly lat: number;
|
|
23
|
+
readonly lng: number;
|
|
24
|
+
constructor(lat: number, lng: number);
|
|
25
|
+
/**
|
|
26
|
+
* NaN — LatLng has no meaningful numeric coercion. The 0.B contract
|
|
27
|
+
* documents this explicitly: any rule that does arithmetic on a
|
|
28
|
+
* LatLng (e.g. `latlng + 1`) is buggy, and NaN propagation makes
|
|
29
|
+
* the failure loud rather than silent. The `binaryOp` override
|
|
30
|
+
* below also returns NO_OP for everything except `==`/`!=` (which
|
|
31
|
+
* route through `equals()` not `binaryOp`), so arithmetic falls
|
|
32
|
+
* through to the generic numeric path → NaN → comparison fails.
|
|
33
|
+
*/
|
|
34
|
+
valueOf(): number;
|
|
35
|
+
toString(): string;
|
|
36
|
+
toJSON(): unknown;
|
|
37
|
+
equals(other: unknown): boolean;
|
|
38
|
+
callMethod(method: string, args: unknown[]): unknown | NoOp;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=latlng.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"latlng.d.ts","sourceRoot":"","sources":["../../../../src/rules/simulator/wrappers/latlng.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,UAAU,EAAS,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AA0BzD,qBAAa,MAAO,SAAQ,UAAU;IACpC,QAAQ,CAAC,QAAQ,YAAY;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;gBAET,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAUpC;;;;;;;;OAQG;IACH,OAAO,IAAI,MAAM;IAIjB,QAAQ,IAAI,MAAM;IAIlB,MAAM,IAAI,OAAO;IAIjB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAQ/B,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,GAAG,IAAI;CA2B5D"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LatLng wrapper for Firestore Rules `latlng` type — Item 1.1.
|
|
3
|
+
*
|
|
4
|
+
* Closes the LatLng type gap from REBUILD_PLAN.md "Current Evaluator Gap
|
|
5
|
+
* Analysis" — instance methods + the `latlng.value(lat, lng)` namespace
|
|
6
|
+
* constructor (was the entire `latlng` namespace gap).
|
|
7
|
+
*
|
|
8
|
+
* Reference surface (from REBUILD_PLAN.md "Reference Inventory"):
|
|
9
|
+
* - latitude() → Float, range [-90, 90]
|
|
10
|
+
* - longitude() → Float, range [-180, 180]
|
|
11
|
+
* - distance(other: LatLng) → Float, meters
|
|
12
|
+
* - Operators: == != only (no arithmetic — see RulesValue.binaryOp note)
|
|
13
|
+
*
|
|
14
|
+
* Construction: `latlng.value(lat, lng)` only. Production also accepts
|
|
15
|
+
* stored LatLng values from Firestore documents, but that path requires
|
|
16
|
+
* test-data sentinels we haven't introduced yet — single-source
|
|
17
|
+
* construction in 1.1 keeps the wrapper testable end-to-end.
|
|
18
|
+
*/
|
|
19
|
+
import { RulesValue, NO_OP } from './base.js';
|
|
20
|
+
/**
|
|
21
|
+
* Distance between two points on Earth, in meters, via the haversine
|
|
22
|
+
* formula. Production uses WGS-84 ellipsoid math which differs from
|
|
23
|
+
* haversine by up to ~0.5%. We accept that drift for Item 1 — the
|
|
24
|
+
* parity pack covers exact-equality and same-point cases (where
|
|
25
|
+
* haversine == ellipsoid == 0); long-distance precision parity is
|
|
26
|
+
* deferred until a real-world rule surfaces a discrepancy in the
|
|
27
|
+
* benchmark divergence log. If/when that happens, swap the
|
|
28
|
+
* implementation here without touching the wrapper's interface.
|
|
29
|
+
*/
|
|
30
|
+
function haversineMeters(latA, lngA, latB, lngB) {
|
|
31
|
+
const R = 6371000; // mean Earth radius in meters
|
|
32
|
+
const toRad = (deg) => (deg * Math.PI) / 180;
|
|
33
|
+
const φ1 = toRad(latA);
|
|
34
|
+
const φ2 = toRad(latB);
|
|
35
|
+
const Δφ = toRad(latB - latA);
|
|
36
|
+
const Δλ = toRad(lngB - lngA);
|
|
37
|
+
const a = Math.sin(Δφ / 2) ** 2 +
|
|
38
|
+
Math.cos(φ1) * Math.cos(φ2) * Math.sin(Δλ / 2) ** 2;
|
|
39
|
+
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
|
40
|
+
return R * c;
|
|
41
|
+
}
|
|
42
|
+
export class LatLng extends RulesValue {
|
|
43
|
+
typeName = 'latlng';
|
|
44
|
+
lat;
|
|
45
|
+
lng;
|
|
46
|
+
constructor(lat, lng) {
|
|
47
|
+
super();
|
|
48
|
+
// Don't validate range here — production accepts out-of-range values
|
|
49
|
+
// via stored data and only the namespace constructor `latlng.value`
|
|
50
|
+
// would raise. Keeping the wrapper itself permissive lets storage
|
|
51
|
+
// and constructor paths share the same class without divergence.
|
|
52
|
+
this.lat = lat;
|
|
53
|
+
this.lng = lng;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* NaN — LatLng has no meaningful numeric coercion. The 0.B contract
|
|
57
|
+
* documents this explicitly: any rule that does arithmetic on a
|
|
58
|
+
* LatLng (e.g. `latlng + 1`) is buggy, and NaN propagation makes
|
|
59
|
+
* the failure loud rather than silent. The `binaryOp` override
|
|
60
|
+
* below also returns NO_OP for everything except `==`/`!=` (which
|
|
61
|
+
* route through `equals()` not `binaryOp`), so arithmetic falls
|
|
62
|
+
* through to the generic numeric path → NaN → comparison fails.
|
|
63
|
+
*/
|
|
64
|
+
valueOf() {
|
|
65
|
+
return NaN;
|
|
66
|
+
}
|
|
67
|
+
toString() {
|
|
68
|
+
return `${this.lat},${this.lng}`;
|
|
69
|
+
}
|
|
70
|
+
toJSON() {
|
|
71
|
+
return { __type: 'latlng', lat: this.lat, lng: this.lng };
|
|
72
|
+
}
|
|
73
|
+
equals(other) {
|
|
74
|
+
return (other instanceof LatLng &&
|
|
75
|
+
this.lat === other.lat &&
|
|
76
|
+
this.lng === other.lng);
|
|
77
|
+
}
|
|
78
|
+
callMethod(method, args) {
|
|
79
|
+
switch (method) {
|
|
80
|
+
case 'latitude':
|
|
81
|
+
return this.lat;
|
|
82
|
+
case 'longitude':
|
|
83
|
+
return this.lng;
|
|
84
|
+
case 'distance': {
|
|
85
|
+
const other = args[0];
|
|
86
|
+
if (!(other instanceof LatLng)) {
|
|
87
|
+
// Real type error, not a sim gap — caller throws EvalError, not
|
|
88
|
+
// UnsupportedError. Returning NO_OP would mask the type bug as
|
|
89
|
+
// "method not implemented", which is wrong: we *did* implement
|
|
90
|
+
// distance, the caller passed garbage.
|
|
91
|
+
throw new TypeError(`latlng.distance() requires a LatLng argument, got ${typeof other}`);
|
|
92
|
+
}
|
|
93
|
+
return haversineMeters(this.lat, this.lng, other.lat, other.lng);
|
|
94
|
+
}
|
|
95
|
+
default:
|
|
96
|
+
return NO_OP;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=latlng.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"latlng.js","sourceRoot":"","sources":["../../../../src/rules/simulator/wrappers/latlng.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,UAAU,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1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path wrapper — Item 5.4 of REBUILD_PLAN.md.
|
|
3
|
+
*
|
|
4
|
+
* Reference surface (rules.Path):
|
|
5
|
+
* bind(map: Map) → Path substitutes {placeholder} segments; null vals reject
|
|
6
|
+
* Operators: ==, dot x.f, numeric x[i], named x[name]
|
|
7
|
+
* Constructed via literal `/path/to/resource` or `path("path/to/resource")`
|
|
8
|
+
*
|
|
9
|
+
* Per 0.B per-wrapper table:
|
|
10
|
+
* typeName: 'path'
|
|
11
|
+
* valueOf: NaN (no meaningful numeric coercion)
|
|
12
|
+
* toString: '/seg1/seg2' (round-trips with literal form)
|
|
13
|
+
* equals: segment-by-segment string equality
|
|
14
|
+
* binaryOp: NO_OP (== / != route through equals; no <,> on paths)
|
|
15
|
+
*
|
|
16
|
+
* Path was deferred from Item 1 because its only construction site is the
|
|
17
|
+
* `path()` builtin (Item 5) and the `/foo/$(x)/` literal form. Landing the
|
|
18
|
+
* wrapper now lets `pathLiteral` evaluation flip from "string" to "Path"
|
|
19
|
+
* so `is path` works correctly without breaking get/exists (which already
|
|
20
|
+
* String()-coerce their argument).
|
|
21
|
+
*
|
|
22
|
+
* Segments may include `{name}` placeholders. `bind()` replaces them in
|
|
23
|
+
* one shot, returning a fresh Path. The wrapper does NOT enforce that
|
|
24
|
+
* all placeholders are bound — leaving that to the consumer (get/exists)
|
|
25
|
+
* makes parity behavior obvious: an unbound path renders as "/users/{uid}"
|
|
26
|
+
* and the resolver returns null.
|
|
27
|
+
*/
|
|
28
|
+
import { RulesValue, type NoOp } from './base.js';
|
|
29
|
+
export declare class Path extends RulesValue {
|
|
30
|
+
readonly typeName = "path";
|
|
31
|
+
/** Resolved-or-placeholder segments. A segment like '{uid}' is unbound. */
|
|
32
|
+
readonly segments: readonly string[];
|
|
33
|
+
/**
|
|
34
|
+
* Named-segment bindings — populated either by `bind()` (which records the
|
|
35
|
+
* name → value pair when substituting `{name}` placeholders) or by the
|
|
36
|
+
* handler when constructing `request.path` from a matched rule path
|
|
37
|
+
* (so `request.path.uid` returns the wildcard value from the matched
|
|
38
|
+
* `match /users/{uid}/...` block).
|
|
39
|
+
*
|
|
40
|
+
* Without this, `field('uid')` on a fully-bound Path returned null and
|
|
41
|
+
* any rule reading named segments off `request.path` silently denied.
|
|
42
|
+
*/
|
|
43
|
+
readonly bindings: Readonly<Record<string, string>>;
|
|
44
|
+
constructor(segments: readonly string[], bindings?: Record<string, string>);
|
|
45
|
+
/** Construct from a string like '/users/alice' or 'users/{uid}/posts'. */
|
|
46
|
+
static fromString(s: string): Path;
|
|
47
|
+
/**
|
|
48
|
+
* Replace `{name}` placeholders with values from `bindings`. Returns
|
|
49
|
+
* a fresh Path. If a binding value is null/undefined, throws — matches
|
|
50
|
+
* the rules.Path.bind() contract that "values must not be null".
|
|
51
|
+
*
|
|
52
|
+
* Passing a binding whose placeholder doesn't exist in the path is
|
|
53
|
+
* silently allowed (consistent with how the spec says binding by extra
|
|
54
|
+
* keys has no effect).
|
|
55
|
+
*/
|
|
56
|
+
bind(bindings: Record<string, unknown>): Path;
|
|
57
|
+
valueOf(): number;
|
|
58
|
+
toString(): string;
|
|
59
|
+
toJSON(): unknown;
|
|
60
|
+
equals(other: unknown): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Bracket / dot field dispatch.
|
|
63
|
+
*
|
|
64
|
+
* Numeric string ('0', '1', ...) → returns the segment at that index,
|
|
65
|
+
* null if out of bounds. The evaluator funnels both `p[0]` and `p[i]`
|
|
66
|
+
* here as `String(idx)`.
|
|
67
|
+
*
|
|
68
|
+
* Named ('uid', etc.) → returns the value from `bindings`, populated
|
|
69
|
+
* either by `bind()` or by the handler when constructing `request.path`
|
|
70
|
+
* from a matched-rule path. Returns null if the name was never bound.
|
|
71
|
+
*/
|
|
72
|
+
field(name: string): unknown;
|
|
73
|
+
callMethod(method: string, args: unknown[]): unknown | NoOp;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../../src/rules/simulator/wrappers/path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAE,UAAU,EAAS,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAKzD,qBAAa,IAAK,SAAQ,UAAU;IAClC,QAAQ,CAAC,QAAQ,UAAU;IAE3B,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAErC;;;;;;;;;OASG;IACH,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;gBAExC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;IAM9E,0EAA0E;IAC1E,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAOlC;;;;;;;;OAQG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IA6B7C,OAAO,IAAI,MAAM;IAIjB,QAAQ,IAAI,MAAM;IAIlB,MAAM,IAAI,OAAO;IAIjB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAS/B;;;;;;;;;;OAUG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAgB5B,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,GAAG,IAAI;CAe5D"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path wrapper — Item 5.4 of REBUILD_PLAN.md.
|
|
3
|
+
*
|
|
4
|
+
* Reference surface (rules.Path):
|
|
5
|
+
* bind(map: Map) → Path substitutes {placeholder} segments; null vals reject
|
|
6
|
+
* Operators: ==, dot x.f, numeric x[i], named x[name]
|
|
7
|
+
* Constructed via literal `/path/to/resource` or `path("path/to/resource")`
|
|
8
|
+
*
|
|
9
|
+
* Per 0.B per-wrapper table:
|
|
10
|
+
* typeName: 'path'
|
|
11
|
+
* valueOf: NaN (no meaningful numeric coercion)
|
|
12
|
+
* toString: '/seg1/seg2' (round-trips with literal form)
|
|
13
|
+
* equals: segment-by-segment string equality
|
|
14
|
+
* binaryOp: NO_OP (== / != route through equals; no <,> on paths)
|
|
15
|
+
*
|
|
16
|
+
* Path was deferred from Item 1 because its only construction site is the
|
|
17
|
+
* `path()` builtin (Item 5) and the `/foo/$(x)/` literal form. Landing the
|
|
18
|
+
* wrapper now lets `pathLiteral` evaluation flip from "string" to "Path"
|
|
19
|
+
* so `is path` works correctly without breaking get/exists (which already
|
|
20
|
+
* String()-coerce their argument).
|
|
21
|
+
*
|
|
22
|
+
* Segments may include `{name}` placeholders. `bind()` replaces them in
|
|
23
|
+
* one shot, returning a fresh Path. The wrapper does NOT enforce that
|
|
24
|
+
* all placeholders are bound — leaving that to the consumer (get/exists)
|
|
25
|
+
* makes parity behavior obvious: an unbound path renders as "/users/{uid}"
|
|
26
|
+
* and the resolver returns null.
|
|
27
|
+
*/
|
|
28
|
+
import { RulesValue, NO_OP } from './base.js';
|
|
29
|
+
/** Recognises {name} placeholders. Spec is restrictive: identifier chars only. */
|
|
30
|
+
const PLACEHOLDER = /^\{([A-Za-z_][A-Za-z0-9_]*)\}$/;
|
|
31
|
+
export class Path extends RulesValue {
|
|
32
|
+
typeName = 'path';
|
|
33
|
+
/** Resolved-or-placeholder segments. A segment like '{uid}' is unbound. */
|
|
34
|
+
segments;
|
|
35
|
+
/**
|
|
36
|
+
* Named-segment bindings — populated either by `bind()` (which records the
|
|
37
|
+
* name → value pair when substituting `{name}` placeholders) or by the
|
|
38
|
+
* handler when constructing `request.path` from a matched rule path
|
|
39
|
+
* (so `request.path.uid` returns the wildcard value from the matched
|
|
40
|
+
* `match /users/{uid}/...` block).
|
|
41
|
+
*
|
|
42
|
+
* Without this, `field('uid')` on a fully-bound Path returned null and
|
|
43
|
+
* any rule reading named segments off `request.path` silently denied.
|
|
44
|
+
*/
|
|
45
|
+
bindings;
|
|
46
|
+
constructor(segments, bindings = {}) {
|
|
47
|
+
super();
|
|
48
|
+
this.segments = segments;
|
|
49
|
+
this.bindings = bindings;
|
|
50
|
+
}
|
|
51
|
+
/** Construct from a string like '/users/alice' or 'users/{uid}/posts'. */
|
|
52
|
+
static fromString(s) {
|
|
53
|
+
// Leading slash is conventional but optional; trim either way.
|
|
54
|
+
const trimmed = s.startsWith('/') ? s.slice(1) : s;
|
|
55
|
+
if (trimmed.length === 0)
|
|
56
|
+
return new Path([]);
|
|
57
|
+
return new Path(trimmed.split('/'));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Replace `{name}` placeholders with values from `bindings`. Returns
|
|
61
|
+
* a fresh Path. If a binding value is null/undefined, throws — matches
|
|
62
|
+
* the rules.Path.bind() contract that "values must not be null".
|
|
63
|
+
*
|
|
64
|
+
* Passing a binding whose placeholder doesn't exist in the path is
|
|
65
|
+
* silently allowed (consistent with how the spec says binding by extra
|
|
66
|
+
* keys has no effect).
|
|
67
|
+
*/
|
|
68
|
+
bind(bindings) {
|
|
69
|
+
const next = [];
|
|
70
|
+
const nextBindings = { ...this.bindings };
|
|
71
|
+
for (const seg of this.segments) {
|
|
72
|
+
const m = seg.match(PLACEHOLDER);
|
|
73
|
+
if (!m) {
|
|
74
|
+
next.push(seg);
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
const name = m[1];
|
|
78
|
+
if (name in bindings) {
|
|
79
|
+
const v = bindings[name];
|
|
80
|
+
if (v === null || v === undefined) {
|
|
81
|
+
throw new TypeError(`Path.bind(): binding '${name}' must not be null`);
|
|
82
|
+
}
|
|
83
|
+
const sv = String(v);
|
|
84
|
+
next.push(sv);
|
|
85
|
+
nextBindings[name] = sv;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
// Unbound — preserve the placeholder. get/exists will see the
|
|
89
|
+
// literal `{name}` and the resolver will return null.
|
|
90
|
+
next.push(seg);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return new Path(next, nextBindings);
|
|
94
|
+
}
|
|
95
|
+
// ─── RulesValue contract ─────────────────────────────────────────────
|
|
96
|
+
valueOf() {
|
|
97
|
+
return NaN; // No meaningful numeric coercion (matches LatLng).
|
|
98
|
+
}
|
|
99
|
+
toString() {
|
|
100
|
+
return '/' + this.segments.join('/');
|
|
101
|
+
}
|
|
102
|
+
toJSON() {
|
|
103
|
+
return { __type: 'path', segments: [...this.segments] };
|
|
104
|
+
}
|
|
105
|
+
equals(other) {
|
|
106
|
+
if (!(other instanceof Path))
|
|
107
|
+
return false;
|
|
108
|
+
if (this.segments.length !== other.segments.length)
|
|
109
|
+
return false;
|
|
110
|
+
for (let i = 0; i < this.segments.length; i++) {
|
|
111
|
+
if (this.segments[i] !== other.segments[i])
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Bracket / dot field dispatch.
|
|
118
|
+
*
|
|
119
|
+
* Numeric string ('0', '1', ...) → returns the segment at that index,
|
|
120
|
+
* null if out of bounds. The evaluator funnels both `p[0]` and `p[i]`
|
|
121
|
+
* here as `String(idx)`.
|
|
122
|
+
*
|
|
123
|
+
* Named ('uid', etc.) → returns the value from `bindings`, populated
|
|
124
|
+
* either by `bind()` or by the handler when constructing `request.path`
|
|
125
|
+
* from a matched-rule path. Returns null if the name was never bound.
|
|
126
|
+
*/
|
|
127
|
+
field(name) {
|
|
128
|
+
// Numeric index path (works for strings like '0', '12', ...)
|
|
129
|
+
if (/^\d+$/.test(name)) {
|
|
130
|
+
const i = Number(name);
|
|
131
|
+
if (i < 0 || i >= this.segments.length)
|
|
132
|
+
return null;
|
|
133
|
+
return this.segments[i];
|
|
134
|
+
}
|
|
135
|
+
// Named binding lookup. Bindings are populated either by `bind()` or by
|
|
136
|
+
// the handler when constructing `request.path` from a matched-rule path
|
|
137
|
+
// (so wildcards from `match /users/{uid}/...` are exposed as
|
|
138
|
+
// `request.path.uid`). Returns null if the name was never bound — same
|
|
139
|
+
// shape as missing-map-key reads elsewhere in the evaluator.
|
|
140
|
+
if (name in this.bindings)
|
|
141
|
+
return this.bindings[name];
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
callMethod(method, args) {
|
|
145
|
+
switch (method) {
|
|
146
|
+
case 'bind': {
|
|
147
|
+
const m = args[0];
|
|
148
|
+
if (m === null || m === undefined || typeof m !== 'object' || Array.isArray(m) || m instanceof RulesValue) {
|
|
149
|
+
throw new TypeError(`Path.bind() requires a Map argument, got ${m === null ? 'null' : typeof m}`);
|
|
150
|
+
}
|
|
151
|
+
return this.bind(m);
|
|
152
|
+
}
|
|
153
|
+
default:
|
|
154
|
+
return NO_OP;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.js","sourceRoot":"","sources":["../../../../src/rules/simulator/wrappers/path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAE,UAAU,EAAE,KAAK,EAAa,MAAM,WAAW,CAAC;AAEzD,kFAAkF;AAClF,MAAM,WAAW,GAAG,gCAAgC,CAAC;AAErD,MAAM,OAAO,IAAK,SAAQ,UAAU;IACzB,QAAQ,GAAG,MAAM,CAAC;IAE3B,2EAA2E;IAClE,QAAQ,CAAoB;IAErC;;;;;;;;;OASG;IACM,QAAQ,CAAmC;IAEpD,YAAY,QAA2B,EAAE,WAAmC,EAAE;QAC5E,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GA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AAI,IAAI,CAAC,QAAQ,CAAC,MAAM;gBAAE,OAAO,IAAI,CAAC;YACpD,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC1B,CAAC;QACD,wEAAwE;QACxE,wEAAwE;QACxE,6DAA6D;QAC7D,uEAAuE;QACvE,6DAA6D;QAC7D,IAAI,IAAI,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACtD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,UAAU,CAAC,MAAc,EAAE,IAAe;QACxC,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,MAAM,CAAC,CAAC,CAAC;gBACZ,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;gBAClB,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,UAAU,EAAE,CAAC;oBAC1G,MAAM,IAAI,SAAS,CACjB,4CAA4C,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAC7E,CAAC;gBACJ,CAAC;gBACD,OAAO,IAAI,CAAC,IAAI,CAAC,CAA4B,CAAC,CAAC;YACjD,CAAC;YACD;gBACE,OAAO,KAAK,CAAC;QACjB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reference wrapper — Item 3 of simulator-prod-parity.md.
|
|
3
|
+
*
|
|
4
|
+
* Reference surface (rules.Reference):
|
|
5
|
+
* - `.path` — relative document path string ('users/u1')
|
|
6
|
+
* - `.id` — last segment of the path ('u1')
|
|
7
|
+
* - `.parent` — parent collection path string ('users')
|
|
8
|
+
* - `is reference` — type test
|
|
9
|
+
* - `==` / `!=` against another Reference
|
|
10
|
+
*
|
|
11
|
+
* Per 0.B per-wrapper table:
|
|
12
|
+
* typeName: 'reference'
|
|
13
|
+
* valueOf: NaN (no meaningful numeric coercion — like Path/LatLng)
|
|
14
|
+
* toString: 'users/u1' (relative path; round-trips with the admin SDK
|
|
15
|
+
* DocumentReference.path getter)
|
|
16
|
+
* equals: path-string equality (project/database not significant in
|
|
17
|
+
* the simulator — every Reference lives in the same logical DB)
|
|
18
|
+
* binaryOp: NO_OP (== / != route through equals)
|
|
19
|
+
*
|
|
20
|
+
* Why a relative-path-only wrapper rather than a full project/database/doc
|
|
21
|
+
* model: Firestore rules see references as opaque path values. The
|
|
22
|
+
* `referenceValue` wire encoding *does* need a fully-qualified
|
|
23
|
+
* `projects/<p>/databases/<d>/documents/<path>` string for round-trip
|
|
24
|
+
* with discover/wire.ts, but that's a write-out concern — the wire
|
|
25
|
+
* encoder synthesizes a default qualifier on the way out. Inside the
|
|
26
|
+
* simulator, two references are the same reference iff their relative
|
|
27
|
+
* paths match.
|
|
28
|
+
*
|
|
29
|
+
* The admin SDK DocumentReference exposes more (e.g., `.firestore`,
|
|
30
|
+
* `formattedName`); the rules language does not — we deliberately
|
|
31
|
+
* shrink to the rules-visible surface so accidental `ref.firestore`
|
|
32
|
+
* reads in a rule (which production would silently null out) match
|
|
33
|
+
* the simulator.
|
|
34
|
+
*/
|
|
35
|
+
import { RulesValue, type NoOp } from './base.js';
|
|
36
|
+
export declare class Reference extends RulesValue {
|
|
37
|
+
readonly typeName = "reference";
|
|
38
|
+
/** Relative document path, e.g. 'users/u1' or 'users/u1/posts/p1'. */
|
|
39
|
+
readonly path: string;
|
|
40
|
+
constructor(path: string);
|
|
41
|
+
/**
|
|
42
|
+
* Construct from an admin-SDK-style fully-qualified resource name like
|
|
43
|
+
* `projects/p/databases/(default)/documents/users/u1`. The fully-
|
|
44
|
+
* qualified form is what `referenceValue` emits on the wire; using this
|
|
45
|
+
* helper at the decode boundary keeps the relative-path invariant.
|
|
46
|
+
*/
|
|
47
|
+
static fromResourceName(resourceName: string): Reference;
|
|
48
|
+
/** Last path segment; '' for an empty path. */
|
|
49
|
+
get id(): string;
|
|
50
|
+
/**
|
|
51
|
+
* Parent collection path as a string. For `users/u1` returns `users`;
|
|
52
|
+
* for `users/u1/posts/p1` returns `users/u1/posts`. An empty string
|
|
53
|
+
* if there is no parent (a root-level reference is degenerate, but
|
|
54
|
+
* we don't throw to keep diagnostics-friendly).
|
|
55
|
+
*
|
|
56
|
+
* Returning a string (not a Reference) matches Firestore rules' lack of
|
|
57
|
+
* a CollectionReference type — collections aren't first-class values in
|
|
58
|
+
* rules. Agents that want to compare against a collection path do so by
|
|
59
|
+
* string equality, which this supports.
|
|
60
|
+
*/
|
|
61
|
+
get parent(): string;
|
|
62
|
+
valueOf(): number;
|
|
63
|
+
toString(): string;
|
|
64
|
+
toJSON(): unknown;
|
|
65
|
+
equals(other: unknown): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Property dispatch. Mirrors the admin SDK read surface: `.path`,
|
|
68
|
+
* `.id`, `.parent`. Anything else returns null (Firestore rules
|
|
69
|
+
* "missing map key" shape, consistent with other wrappers).
|
|
70
|
+
*/
|
|
71
|
+
field(name: string): unknown;
|
|
72
|
+
callMethod(_method: string, _args: unknown[]): unknown | NoOp;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Build the fully-qualified resource name used by Firestore's
|
|
76
|
+
* `referenceValue` wire field. The simulator doesn't carry a real
|
|
77
|
+
* project ID, so callers (the wire encoder) supply one — defaulting
|
|
78
|
+
* to `'sim'` and database `'(default)'` keeps the round-trip intact
|
|
79
|
+
* without inventing fake projects in the wrapper itself.
|
|
80
|
+
*/
|
|
81
|
+
export declare function referenceToResourceName(ref: Reference, projectId?: string, databaseId?: string): string;
|
|
82
|
+
//# sourceMappingURL=reference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../../../src/rules/simulator/wrappers/reference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,UAAU,EAAS,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAEzD,qBAAa,SAAU,SAAQ,UAAU;IACvC,QAAQ,CAAC,QAAQ,eAAe;IAEhC,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,MAAM;IAOxB;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS;IAIxD,+CAA+C;IAC/C,IAAI,EAAE,IAAI,MAAM,CAGf;IAED;;;;;;;;;;OAUG;IACH,IAAI,MAAM,IAAI,MAAM,CAGnB;IAID,OAAO,IAAI,MAAM;IAIjB,QAAQ,IAAI,MAAM;IAOlB,MAAM,IAAI,OAAO;IAIjB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAK/B;;;;OAIG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAS5B,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,GAAG,IAAI;CAO9D;AAuBD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,SAAS,EACd,SAAS,GAAE,MAAc,EACzB,UAAU,GAAE,MAAoB,GAC/B,MAAM,CAER"}
|