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,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Firestore value codec — the marker-based serialize/rehydrate of
|
|
3
|
+
* Firestore special scalar types (Timestamp, Bytes, LatLng/GeoPoint,
|
|
4
|
+
* Duration, Reference, Path, Vector).
|
|
5
|
+
*
|
|
6
|
+
* WHY THIS MODULE EXISTS (and why it is a LEAF)
|
|
7
|
+
* ---------------------------------------------
|
|
8
|
+
* Two very different consumers need this codec:
|
|
9
|
+
*
|
|
10
|
+
* 1. The sandbox persistence serializer (`sandbox/persistence/serialize.ts`)
|
|
11
|
+
* — server-side, already pulls the whole engine, doesn't care about size.
|
|
12
|
+
* 2. The SharedWorker CLIENT (`pyric-tools/.../worker/client.ts` via
|
|
13
|
+
* `protocol.ts`) — runs in EVERY page that opens a serve session. It only
|
|
14
|
+
* needs to reconstruct Timestamp/Bytes/LatLng instances from the JSON
|
|
15
|
+
* markers the worker host wrote; it must NOT drag the rules engine,
|
|
16
|
+
* simulator, parser, or sandbox into the per-page bundle.
|
|
17
|
+
*
|
|
18
|
+
* Importing the wrapper CLASSES from the `pyric/rules` BARREL would execute the
|
|
19
|
+
* entire rules index (parser + linter + simulator + evaluator → ~10 MB). The
|
|
20
|
+
* wrapper modules themselves are leaf — each depends only on `wrappers/base.js`
|
|
21
|
+
* which has zero imports — so this codec imports them by their DIRECT leaf
|
|
22
|
+
* paths. The result: importing this module pulls ONLY the seven small wrapper
|
|
23
|
+
* classes + their `base.js`, nothing heavy.
|
|
24
|
+
*
|
|
25
|
+
* Real types, not structural stand-ins: because the wrapper constructors are
|
|
26
|
+
* already leaf-cheap, the codec reconstructs the SAME real `Timestamp`/`Bytes`/
|
|
27
|
+
* `LatLng`/etc. classes the in-page (`pyric/firestore`) path yields. This keeps
|
|
28
|
+
* `instanceof` checks and method calls (`.toDate()`, `.toMillis()`, byte
|
|
29
|
+
* access, `.lat`/`.lng`) identical on both sides of the MessagePort and in IDB
|
|
30
|
+
* persistence — there is ONE codec, not two that can drift.
|
|
31
|
+
*
|
|
32
|
+
* Marker formats handled (must stay in sync with each wrapper's `toJSON()`):
|
|
33
|
+
*
|
|
34
|
+
* 1. `pyric/rules` wrapper markers (from `Timestamp.toJSON()` etc.):
|
|
35
|
+
* { __type: 'timestamp', seconds, nanos } → Timestamp
|
|
36
|
+
* { __type: 'bytes', base64 } → Bytes (base64url)
|
|
37
|
+
* { __type: 'latlng', lat, lng } → LatLng
|
|
38
|
+
* { __type: 'duration', seconds, nanos } → Duration
|
|
39
|
+
* { __type: 'reference', path } → Reference
|
|
40
|
+
* { __type: 'path', segments } → Path
|
|
41
|
+
* { __type__: '__vector__', value } → Vector
|
|
42
|
+
*
|
|
43
|
+
* 2. `firebase/firestore` SDK markers (from fb.Timestamp.toJSON() etc.),
|
|
44
|
+
* produced when `pyric/firestore`'s `getDoc` returns `firebase/firestore`
|
|
45
|
+
* class instances that are then serialized via JSON.stringify:
|
|
46
|
+
* { type: 'firestore/timestamp/1.0', seconds, nanoseconds } → Timestamp
|
|
47
|
+
* { type: 'firestore/bytes/1.0', bytes } → Bytes (std b64)
|
|
48
|
+
* { type: 'firestore/geoPoint/1.0', latitude, longitude } → LatLng
|
|
49
|
+
*
|
|
50
|
+
* Unknown `__type`/`type` values pass through as plain objects rather than
|
|
51
|
+
* throwing — the rest of the doc still restores cleanly.
|
|
52
|
+
*/
|
|
53
|
+
// Direct leaf imports — NOT the `pyric/rules` barrel. Each of these modules
|
|
54
|
+
// depends only on `./base.js` (no imports), so this stays engine-free.
|
|
55
|
+
import { Bytes } from '../rules/simulator/wrappers/bytes.js';
|
|
56
|
+
import { Duration } from '../rules/simulator/wrappers/duration.js';
|
|
57
|
+
import { LatLng } from '../rules/simulator/wrappers/latlng.js';
|
|
58
|
+
import { Path } from '../rules/simulator/wrappers/path.js';
|
|
59
|
+
import { Reference } from '../rules/simulator/wrappers/reference.js';
|
|
60
|
+
import { Timestamp } from '../rules/simulator/wrappers/timestamp.js';
|
|
61
|
+
import { Vector } from '../rules/simulator/wrappers/vector.js';
|
|
62
|
+
/**
|
|
63
|
+
* Decode a base64url string (`-`/`_` alphabet, no padding) back into a
|
|
64
|
+
* Uint8Array. Mirrors the encode path in `Bytes.toBase64` (RFC 4648 section 5).
|
|
65
|
+
*/
|
|
66
|
+
function base64UrlDecode(s) {
|
|
67
|
+
const std = s.replace(/-/g, '+').replace(/_/g, '/');
|
|
68
|
+
const pad = std.length % 4 === 0 ? '' : '='.repeat(4 - (std.length % 4));
|
|
69
|
+
const bin = atob(std + pad);
|
|
70
|
+
const out = new Uint8Array(bin.length);
|
|
71
|
+
for (let i = 0; i < bin.length; i++)
|
|
72
|
+
out[i] = bin.charCodeAt(i);
|
|
73
|
+
return out;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Decode a standard base64 string (`+`/`/` alphabet, possibly `=`-padded)
|
|
77
|
+
* back to a Uint8Array. Used for `firebase/firestore` Bytes which encode in
|
|
78
|
+
* standard base64 (unlike pyric/rules Bytes which use base64url).
|
|
79
|
+
*/
|
|
80
|
+
function base64StdDecode(s) {
|
|
81
|
+
const bin = atob(s);
|
|
82
|
+
const out = new Uint8Array(bin.length);
|
|
83
|
+
for (let i = 0; i < bin.length; i++)
|
|
84
|
+
out[i] = bin.charCodeAt(i);
|
|
85
|
+
return out;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Walk a parsed JSON tree and re-wrap any marker shape back into its real
|
|
89
|
+
* wrapper-class instance. Visits arrays and plain objects recursively. Plain
|
|
90
|
+
* values (and plain objects without a recognized discriminator) pass through.
|
|
91
|
+
*
|
|
92
|
+
* This is the canonical rehydrate used by BOTH the sandbox persistence
|
|
93
|
+
* serializer and the SharedWorker wire protocol, so the IDB format and the
|
|
94
|
+
* MessagePort wire format are guaranteed identical.
|
|
95
|
+
*/
|
|
96
|
+
export function rehydrateDocValue(value) {
|
|
97
|
+
if (value === null || typeof value !== 'object')
|
|
98
|
+
return value;
|
|
99
|
+
if (Array.isArray(value))
|
|
100
|
+
return value.map(rehydrateDocValue);
|
|
101
|
+
const obj = value;
|
|
102
|
+
if (obj.__type__ === '__vector__' && Array.isArray(obj.value)) {
|
|
103
|
+
return new Vector(obj.value);
|
|
104
|
+
}
|
|
105
|
+
// pyric/rules wrapper marker form (used for IDB persistence + wire).
|
|
106
|
+
if (typeof obj.__type === 'string') {
|
|
107
|
+
switch (obj.__type) {
|
|
108
|
+
case 'timestamp':
|
|
109
|
+
return new Timestamp(obj.seconds, obj.nanos);
|
|
110
|
+
case 'bytes':
|
|
111
|
+
return new Bytes(base64UrlDecode(obj.base64));
|
|
112
|
+
case 'latlng':
|
|
113
|
+
return new LatLng(obj.lat, obj.lng);
|
|
114
|
+
case 'duration':
|
|
115
|
+
return new Duration(obj.seconds, obj.nanos);
|
|
116
|
+
case 'reference':
|
|
117
|
+
return new Reference(obj.path);
|
|
118
|
+
case 'path':
|
|
119
|
+
return new Path(obj.segments);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// firebase/firestore SDK marker form (produced when pyric/firestore's
|
|
123
|
+
// getDoc returns fb-SDK class instances and JSON.stringify is called).
|
|
124
|
+
if (typeof obj.type === 'string') {
|
|
125
|
+
switch (obj.type) {
|
|
126
|
+
case 'firestore/timestamp/1.0': {
|
|
127
|
+
// fb.Timestamp.toJSON() emits { type, seconds, nanoseconds }.
|
|
128
|
+
// The rules Timestamp uses nanos (not nanoseconds) — same value.
|
|
129
|
+
const seconds = obj.seconds;
|
|
130
|
+
const nanoseconds = obj.nanoseconds;
|
|
131
|
+
return new Timestamp(seconds, nanoseconds);
|
|
132
|
+
}
|
|
133
|
+
case 'firestore/bytes/1.0': {
|
|
134
|
+
// fb.Bytes.toJSON() emits { type, bytes } where bytes is standard base64.
|
|
135
|
+
return new Bytes(base64StdDecode(obj.bytes));
|
|
136
|
+
}
|
|
137
|
+
case 'firestore/geoPoint/1.0': {
|
|
138
|
+
// fb.GeoPoint.toJSON() emits { latitude, longitude, type }.
|
|
139
|
+
return new LatLng(obj.latitude, obj.longitude);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
const out = {};
|
|
144
|
+
for (const [k, v] of Object.entries(obj))
|
|
145
|
+
out[k] = rehydrateDocValue(v);
|
|
146
|
+
return out;
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/firestore-values/index.ts"],"names":[],"mappings":"AAAA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{"version":3,"file":"project-scope.d.ts","sourceRoot":"","sources":["../src/project-scope.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-scope.js","sourceRoot":"","sources":["../src/project-scope.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pyric/rules/extract`: composite-index extractor entry.
|
|
3
|
+
*
|
|
4
|
+
* The extractor statically analyzes JS/TS source (via the TypeScript compiler)
|
|
5
|
+
* for the modular Firestore client's `query(collection(...), where(...),
|
|
6
|
+
* orderBy(...))` pattern. The TS compiler is large (~10MB) and optimizer-
|
|
7
|
+
* hostile, so it lives on its OWN subpath rather than the `pyric/rules` root
|
|
8
|
+
* barrel.
|
|
9
|
+
*
|
|
10
|
+
* Why a subpath and not the root: every app that imports `firebase/firestore`
|
|
11
|
+
* reaches `pyric/rules` (via `pyric/firestore`), and Vite's dep optimizer
|
|
12
|
+
* bundles a bare-specifier dep WHOLESALE, so it cannot tree-shake an entry's
|
|
13
|
+
* exports, and it follows dynamic imports; a root re-export (static OR
|
|
14
|
+
* lazy) drags the whole TS compiler into every browser bundle and trips the
|
|
15
|
+
* optimizer. Keeping the extractor here means `pyric/rules` stays compiler-free
|
|
16
|
+
* for apps that never extract; browser callers that DO extract (the playground)
|
|
17
|
+
* and Node callers (the MCP) opt in by importing `pyric/rules/extract`.
|
|
18
|
+
*
|
|
19
|
+
* (The erasable extractor TYPES stay re-exported from the root barrel too, since
|
|
20
|
+
* type-only exports compile away and never reach a bundle.)
|
|
21
|
+
*/
|
|
22
|
+
export { extractIndexes } from './indexes/extract/extractor.js';
|
|
23
|
+
export { ExtractFirestoreIndexesHandler } from './indexes/extractHandler.js';
|
|
24
|
+
export { createFirestoreExtractTool } from './indexes/extractTool.js';
|
|
25
|
+
export type { ExtractIndexesOptions } from './indexes/extractHandler.js';
|
|
26
|
+
export type { ExtractResult, ExtractionWarning, ExtractionSignal, ExtractOptions, QueryShape, Filter as IndexFilter, Order as IndexOrder, Fragment as IndexFragment, QueryBaseDecl, AnnotationApplied, } from './indexes/extract/types.js';
|
|
27
|
+
export type { ApiScope, ArrayConfig, Density, Index, IndexField, IndexFieldOrder, IndexOperation, IndexState, IndexesConfig, IndexesConfigEntry, QueryScope, VectorConfig, } from './indexes/types.js';
|
|
28
|
+
//# sourceMappingURL=extract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/rules/extract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,YAAY,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,MAAM,IAAI,WAAW,EACrB,KAAK,IAAI,UAAU,EACnB,QAAQ,IAAI,aAAa,EACzB,aAAa,EACb,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,QAAQ,EACR,WAAW,EACX,OAAO,EACP,KAAK,EACL,UAAU,EACV,eAAe,EACf,cAAc,EACd,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,YAAY,GACb,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pyric/rules/extract`: composite-index extractor entry.
|
|
3
|
+
*
|
|
4
|
+
* The extractor statically analyzes JS/TS source (via the TypeScript compiler)
|
|
5
|
+
* for the modular Firestore client's `query(collection(...), where(...),
|
|
6
|
+
* orderBy(...))` pattern. The TS compiler is large (~10MB) and optimizer-
|
|
7
|
+
* hostile, so it lives on its OWN subpath rather than the `pyric/rules` root
|
|
8
|
+
* barrel.
|
|
9
|
+
*
|
|
10
|
+
* Why a subpath and not the root: every app that imports `firebase/firestore`
|
|
11
|
+
* reaches `pyric/rules` (via `pyric/firestore`), and Vite's dep optimizer
|
|
12
|
+
* bundles a bare-specifier dep WHOLESALE, so it cannot tree-shake an entry's
|
|
13
|
+
* exports, and it follows dynamic imports; a root re-export (static OR
|
|
14
|
+
* lazy) drags the whole TS compiler into every browser bundle and trips the
|
|
15
|
+
* optimizer. Keeping the extractor here means `pyric/rules` stays compiler-free
|
|
16
|
+
* for apps that never extract; browser callers that DO extract (the playground)
|
|
17
|
+
* and Node callers (the MCP) opt in by importing `pyric/rules/extract`.
|
|
18
|
+
*
|
|
19
|
+
* (The erasable extractor TYPES stay re-exported from the root barrel too, since
|
|
20
|
+
* type-only exports compile away and never reach a bundle.)
|
|
21
|
+
*/
|
|
22
|
+
export { extractIndexes } from './indexes/extract/extractor.js';
|
|
23
|
+
export { ExtractFirestoreIndexesHandler } from './indexes/extractHandler.js';
|
|
24
|
+
export { createFirestoreExtractTool } from './indexes/extractTool.js';
|
|
25
|
+
//# sourceMappingURL=extract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../src/rules/extract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assembles a complete Firestore security rules file for a grid-based game.
|
|
3
|
+
*
|
|
4
|
+
* Optimization levels (applied automatically based on board size):
|
|
5
|
+
* - Small boards (≤42 cells): nested board map, static enumeration, single win function
|
|
6
|
+
* - Medium boards (43-121 cells): flat layout, dynamic access, MapDiff, directional win split
|
|
7
|
+
*
|
|
8
|
+
* Uses the stdlib convention: host/guest/currentTurn/status.
|
|
9
|
+
*/
|
|
10
|
+
import type { GridConfig } from './grid.js';
|
|
11
|
+
export interface GameConfig {
|
|
12
|
+
collection: string;
|
|
13
|
+
grid: GridConfig;
|
|
14
|
+
winLineCount: number;
|
|
15
|
+
hasGravity: boolean;
|
|
16
|
+
hasLobby: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function assembleGameRules(config: GameConfig): string;
|
|
19
|
+
//# sourceMappingURL=assembler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assembler.d.ts","sourceRoot":"","sources":["../../../src/rules/generators/assembler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAW5C,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACnB;AA0BD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAW5D"}
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assembles a complete Firestore security rules file for a grid-based game.
|
|
3
|
+
*
|
|
4
|
+
* Optimization levels (applied automatically based on board size):
|
|
5
|
+
* - Small boards (≤42 cells): nested board map, static enumeration, single win function
|
|
6
|
+
* - Medium boards (43-121 cells): flat layout, dynamic access, MapDiff, directional win split
|
|
7
|
+
*
|
|
8
|
+
* Uses the stdlib convention: host/guest/currentTurn/status.
|
|
9
|
+
*/
|
|
10
|
+
import { generateWinLines } from './grid.js';
|
|
11
|
+
import { winCheckExpr, splitWinLinesByDirection, gravityExpr, cellEmptyExpr, boardIntegrityExpr, placementExpr, } from './expressions.js';
|
|
12
|
+
const SMALL_BOARD_THRESHOLD = 42;
|
|
13
|
+
/** A single Firestore path segment we are willing to interpolate into a
|
|
14
|
+
* `match /<collection>/{gameId}` block. Deliberately stricter than
|
|
15
|
+
* Firestore's own collection-id rules: alphanumerics, dash, underscore,
|
|
16
|
+
* 1–64 chars. Anything else (slashes, braces, whitespace, newlines) could
|
|
17
|
+
* break out of the match block and inject arbitrary rules, so we reject it
|
|
18
|
+
* rather than escape it. */
|
|
19
|
+
const COLLECTION_SEGMENT = /^[A-Za-z0-9_-]{1,64}$/;
|
|
20
|
+
/** Validate a caller-supplied collection name before it is interpolated into
|
|
21
|
+
* generated rules source. Throws on anything that isn't a plain path
|
|
22
|
+
* segment — every caller of the public `pyric/rules` generator is safe by
|
|
23
|
+
* default, no escaping required at the call site. */
|
|
24
|
+
function assertSafeCollection(collection) {
|
|
25
|
+
if (typeof collection !== 'string' || !COLLECTION_SEGMENT.test(collection)) {
|
|
26
|
+
throw new Error(`assembleGameRules: invalid collection ${JSON.stringify(collection)} — ` +
|
|
27
|
+
`must match ${COLLECTION_SEGMENT} (a single Firestore path segment: ` +
|
|
28
|
+
`letters, digits, "-" or "_", 1–64 chars). Rejected to prevent rules injection.`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export function assembleGameRules(config) {
|
|
32
|
+
const { grid, winLineCount, hasGravity, hasLobby, collection } = config;
|
|
33
|
+
assertSafeCollection(collection);
|
|
34
|
+
const totalCells = grid.cols * grid.rows;
|
|
35
|
+
const lines = generateWinLines(grid.cols, grid.rows, winLineCount);
|
|
36
|
+
const useOptimized = totalCells > SMALL_BOARD_THRESHOLD;
|
|
37
|
+
if (useOptimized) {
|
|
38
|
+
return assembleOptimized(config, lines);
|
|
39
|
+
}
|
|
40
|
+
return assembleClassic(config, lines);
|
|
41
|
+
}
|
|
42
|
+
// ---- Classic: nested board map, static enumeration ----
|
|
43
|
+
function assembleClassic(config, lines) {
|
|
44
|
+
const { grid, hasGravity, hasLobby, collection } = config;
|
|
45
|
+
const totalCells = grid.cols * grid.rows;
|
|
46
|
+
const placementChecks = [`(${placementExpr(grid)})`];
|
|
47
|
+
if (hasGravity) {
|
|
48
|
+
placementChecks.unshift(`(${gravityExpr(grid)})`);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
placementChecks.unshift(`(${cellEmptyExpr(grid)})`);
|
|
52
|
+
}
|
|
53
|
+
const validMoveBody = placementChecks.join('\n && ');
|
|
54
|
+
const integrityBody = boardIntegrityExpr(grid);
|
|
55
|
+
const commonMove = `request.auth != null
|
|
56
|
+
&& resource.data.status == 'playing'
|
|
57
|
+
&& (
|
|
58
|
+
(resource.data.currentTurn == 'host' && request.auth.uid == resource.data.host)
|
|
59
|
+
|| (resource.data.currentTurn == 'guest' && request.auth.uid == resource.data.guest)
|
|
60
|
+
)
|
|
61
|
+
&& (
|
|
62
|
+
(resource.data.currentTurn == 'host' && request.resource.data.currentTurn == 'guest')
|
|
63
|
+
|| (resource.data.currentTurn == 'guest' && request.resource.data.currentTurn == 'host')
|
|
64
|
+
)
|
|
65
|
+
&& request.resource.data.moveCount == resource.data.moveCount + 1
|
|
66
|
+
&& request.resource.data.host == resource.data.host
|
|
67
|
+
&& request.resource.data.guest == resource.data.guest`;
|
|
68
|
+
const locChecks = `&& request.resource.data.lastCol >= 0 && request.resource.data.lastCol <= ${grid.cols - 1}
|
|
69
|
+
&& request.resource.data.lastRow >= 0 && request.resource.data.lastRow <= ${grid.rows - 1}`;
|
|
70
|
+
return `rules_version = '2';
|
|
71
|
+
service cloud.firestore {
|
|
72
|
+
match /databases/{database}/documents {
|
|
73
|
+
|
|
74
|
+
function hasWonHost(b) {
|
|
75
|
+
return ${winCheckExpr('host', lines, grid)};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function hasWonGuest(b) {
|
|
79
|
+
return ${winCheckExpr('guest', lines, grid)};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function validMove(nc, nr, mark, b, ob) {
|
|
83
|
+
return ${validMoveBody};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function boardOk(nc, nr, b, ob) {
|
|
87
|
+
return ${integrityBody};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
match /${collection}/{gameId} {
|
|
91
|
+
allow read: if request.auth != null;
|
|
92
|
+
${lobbyRules(hasLobby)}
|
|
93
|
+
// --- Normal move (game continues) ---
|
|
94
|
+
allow update: if ${commonMove}
|
|
95
|
+
${locChecks}
|
|
96
|
+
&& request.resource.data.status == 'playing'
|
|
97
|
+
&& request.resource.data.winner == ''
|
|
98
|
+
&& validMove(
|
|
99
|
+
request.resource.data.lastCol,
|
|
100
|
+
request.resource.data.lastRow,
|
|
101
|
+
resource.data.currentTurn,
|
|
102
|
+
request.resource.data.board,
|
|
103
|
+
resource.data.board
|
|
104
|
+
)${totalCells <= SMALL_BOARD_THRESHOLD ? `
|
|
105
|
+
&& boardOk(
|
|
106
|
+
request.resource.data.lastCol,
|
|
107
|
+
request.resource.data.lastRow,
|
|
108
|
+
request.resource.data.board,
|
|
109
|
+
resource.data.board
|
|
110
|
+
)` : ''};
|
|
111
|
+
|
|
112
|
+
// --- Winning move (host) ---
|
|
113
|
+
allow update: if ${commonMove}
|
|
114
|
+
${locChecks}
|
|
115
|
+
&& request.resource.data.status == 'won'
|
|
116
|
+
&& request.resource.data.winner == 'host'
|
|
117
|
+
&& hasWonHost(request.resource.data.board);
|
|
118
|
+
|
|
119
|
+
// --- Winning move (guest) ---
|
|
120
|
+
allow update: if ${commonMove}
|
|
121
|
+
${locChecks}
|
|
122
|
+
&& request.resource.data.status == 'won'
|
|
123
|
+
&& request.resource.data.winner == 'guest'
|
|
124
|
+
&& hasWonGuest(request.resource.data.board);
|
|
125
|
+
|
|
126
|
+
// --- Draw ---
|
|
127
|
+
allow update: if ${commonMove}
|
|
128
|
+
&& request.resource.data.moveCount == ${totalCells}
|
|
129
|
+
&& request.resource.data.status == 'draw'
|
|
130
|
+
&& request.resource.data.winner == '';
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
`;
|
|
135
|
+
}
|
|
136
|
+
// ---- Optimized: flat layout, dynamic access, MapDiff, directional win split ----
|
|
137
|
+
function assembleOptimized(config, lines) {
|
|
138
|
+
const { grid, hasGravity, hasLobby, collection } = config;
|
|
139
|
+
const totalCells = grid.cols * grid.rows;
|
|
140
|
+
const dirs = splitWinLinesByDirection(lines, grid.cols);
|
|
141
|
+
function dirWinFn(name, mark, dirLines) {
|
|
142
|
+
if (dirLines.length === 0)
|
|
143
|
+
return ` function ${name}(b) { return false; }`;
|
|
144
|
+
return ` function ${name}(b) {
|
|
145
|
+
return ${winCheckExpr(mark, dirLines, grid)};
|
|
146
|
+
}`;
|
|
147
|
+
}
|
|
148
|
+
const winFunctions = [
|
|
149
|
+
dirWinFn('wonHH', 'host', dirs.horizontal),
|
|
150
|
+
dirWinFn('wonHV', 'host', dirs.vertical),
|
|
151
|
+
dirWinFn('wonHD1', 'host', dirs.diagUp),
|
|
152
|
+
dirWinFn('wonHD2', 'host', dirs.diagDown),
|
|
153
|
+
dirWinFn('wonGH', 'guest', dirs.horizontal),
|
|
154
|
+
dirWinFn('wonGV', 'guest', dirs.vertical),
|
|
155
|
+
dirWinFn('wonGD1', 'guest', dirs.diagUp),
|
|
156
|
+
dirWinFn('wonGD2', 'guest', dirs.diagDown),
|
|
157
|
+
].join('\n\n');
|
|
158
|
+
const commonMove = `request.auth != null
|
|
159
|
+
&& resource.data.status == 'playing'
|
|
160
|
+
&& (
|
|
161
|
+
(resource.data.currentTurn == 'host' && request.auth.uid == resource.data.host)
|
|
162
|
+
|| (resource.data.currentTurn == 'guest' && request.auth.uid == resource.data.guest)
|
|
163
|
+
)
|
|
164
|
+
&& (
|
|
165
|
+
(resource.data.currentTurn == 'host' && request.resource.data.currentTurn == 'guest')
|
|
166
|
+
|| (resource.data.currentTurn == 'guest' && request.resource.data.currentTurn == 'host')
|
|
167
|
+
)
|
|
168
|
+
&& request.resource.data.moveCount == resource.data.moveCount + 1
|
|
169
|
+
&& request.resource.data.host == resource.data.host
|
|
170
|
+
&& request.resource.data.guest == resource.data.guest`;
|
|
171
|
+
// Dynamic cell validation + MapDiff integrity
|
|
172
|
+
const dynamicPlacement = `&& resource.data[request.resource.data.lastMove] == ''
|
|
173
|
+
&& request.resource.data[request.resource.data.lastMove] == resource.data.currentTurn
|
|
174
|
+
&& request.resource.data.diff(resource.data).affectedKeys().hasOnly(
|
|
175
|
+
['lastMove', 'currentTurn', 'moveCount', request.resource.data.lastMove]
|
|
176
|
+
)`;
|
|
177
|
+
const dynamicWinPlacement = `&& resource.data[request.resource.data.lastMove] == ''
|
|
178
|
+
&& request.resource.data[request.resource.data.lastMove] == resource.data.currentTurn`;
|
|
179
|
+
return `rules_version = '2';
|
|
180
|
+
service cloud.firestore {
|
|
181
|
+
match /databases/{database}/documents {
|
|
182
|
+
|
|
183
|
+
${winFunctions}
|
|
184
|
+
|
|
185
|
+
match /${collection}/{gameId} {
|
|
186
|
+
allow read: if request.auth != null;
|
|
187
|
+
${lobbyRulesOptimized(hasLobby)}
|
|
188
|
+
// --- Normal move (flat layout + MapDiff integrity) ---
|
|
189
|
+
allow update: if ${commonMove}
|
|
190
|
+
${dynamicPlacement}
|
|
191
|
+
&& request.resource.data.status == 'playing'
|
|
192
|
+
&& request.resource.data.winner == '';
|
|
193
|
+
|
|
194
|
+
// --- Winning move (host) ---
|
|
195
|
+
allow update: if ${commonMove}
|
|
196
|
+
${dynamicWinPlacement}
|
|
197
|
+
&& request.resource.data.status == 'won'
|
|
198
|
+
&& request.resource.data.winner == 'host'
|
|
199
|
+
&& (wonHH(request.resource.data) || wonHV(request.resource.data) || wonHD1(request.resource.data) || wonHD2(request.resource.data));
|
|
200
|
+
|
|
201
|
+
// --- Winning move (guest) ---
|
|
202
|
+
allow update: if ${commonMove}
|
|
203
|
+
${dynamicWinPlacement}
|
|
204
|
+
&& request.resource.data.status == 'won'
|
|
205
|
+
&& request.resource.data.winner == 'guest'
|
|
206
|
+
&& (wonGH(request.resource.data) || wonGV(request.resource.data) || wonGD1(request.resource.data) || wonGD2(request.resource.data));
|
|
207
|
+
|
|
208
|
+
// --- Draw ---
|
|
209
|
+
allow update: if ${commonMove}
|
|
210
|
+
&& request.resource.data.moveCount == ${totalCells}
|
|
211
|
+
&& request.resource.data.status == 'draw'
|
|
212
|
+
&& request.resource.data.winner == '';
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
`;
|
|
217
|
+
}
|
|
218
|
+
// ---- Lobby rules ----
|
|
219
|
+
function lobbyRules(hasLobby) {
|
|
220
|
+
if (!hasLobby)
|
|
221
|
+
return `
|
|
222
|
+
allow create: if request.auth != null
|
|
223
|
+
&& request.resource.data.host == request.auth.uid
|
|
224
|
+
&& request.resource.data.currentTurn == 'host'
|
|
225
|
+
&& request.resource.data.status == 'playing'
|
|
226
|
+
&& request.resource.data.winner == ''
|
|
227
|
+
&& request.resource.data.moveCount == 0;
|
|
228
|
+
`;
|
|
229
|
+
return `
|
|
230
|
+
allow create: if request.auth != null
|
|
231
|
+
&& request.resource.data.host == request.auth.uid
|
|
232
|
+
&& request.resource.data.guest == ''
|
|
233
|
+
&& request.resource.data.currentTurn == 'host'
|
|
234
|
+
&& request.resource.data.status == 'waiting'
|
|
235
|
+
&& request.resource.data.winner == ''
|
|
236
|
+
&& request.resource.data.moveCount == 0
|
|
237
|
+
&& request.resource.data.lastCol == -1
|
|
238
|
+
&& request.resource.data.lastRow == -1;
|
|
239
|
+
|
|
240
|
+
allow update: if request.auth != null
|
|
241
|
+
&& resource.data.status == 'waiting'
|
|
242
|
+
&& request.resource.data.status == 'playing'
|
|
243
|
+
&& resource.data.guest == ''
|
|
244
|
+
&& request.resource.data.guest == request.auth.uid
|
|
245
|
+
&& request.auth.uid != resource.data.host
|
|
246
|
+
&& request.resource.data.host == resource.data.host
|
|
247
|
+
&& request.resource.data.currentTurn == resource.data.currentTurn
|
|
248
|
+
&& request.resource.data.winner == resource.data.winner
|
|
249
|
+
&& request.resource.data.moveCount == resource.data.moveCount
|
|
250
|
+
&& request.resource.data.lastCol == resource.data.lastCol
|
|
251
|
+
&& request.resource.data.lastRow == resource.data.lastRow
|
|
252
|
+
&& request.resource.data.board == resource.data.board;
|
|
253
|
+
|
|
254
|
+
allow delete: if request.auth != null
|
|
255
|
+
&& resource.data.status == 'waiting'
|
|
256
|
+
&& request.auth.uid == resource.data.host;
|
|
257
|
+
`;
|
|
258
|
+
}
|
|
259
|
+
function lobbyRulesOptimized(hasLobby) {
|
|
260
|
+
if (!hasLobby)
|
|
261
|
+
return `
|
|
262
|
+
allow create: if request.auth != null
|
|
263
|
+
&& request.resource.data.host == request.auth.uid
|
|
264
|
+
&& request.resource.data.currentTurn == 'host'
|
|
265
|
+
&& request.resource.data.status == 'playing'
|
|
266
|
+
&& request.resource.data.winner == ''
|
|
267
|
+
&& request.resource.data.moveCount == 0;
|
|
268
|
+
`;
|
|
269
|
+
return `
|
|
270
|
+
allow create: if request.auth != null
|
|
271
|
+
&& request.resource.data.host == request.auth.uid
|
|
272
|
+
&& request.resource.data.guest == ''
|
|
273
|
+
&& request.resource.data.currentTurn == 'host'
|
|
274
|
+
&& request.resource.data.status == 'waiting'
|
|
275
|
+
&& request.resource.data.winner == ''
|
|
276
|
+
&& request.resource.data.moveCount == 0
|
|
277
|
+
&& request.resource.data.lastMove == '';
|
|
278
|
+
|
|
279
|
+
allow update: if request.auth != null
|
|
280
|
+
&& resource.data.status == 'waiting'
|
|
281
|
+
&& request.resource.data.status == 'playing'
|
|
282
|
+
&& resource.data.guest == ''
|
|
283
|
+
&& request.resource.data.guest == request.auth.uid
|
|
284
|
+
&& request.auth.uid != resource.data.host
|
|
285
|
+
&& request.resource.data.diff(resource.data).affectedKeys().hasOnly(['guest', 'status']);
|
|
286
|
+
|
|
287
|
+
allow delete: if request.auth != null
|
|
288
|
+
&& resource.data.status == 'waiting'
|
|
289
|
+
&& request.auth.uid == resource.data.host;
|
|
290
|
+
`;
|
|
291
|
+
}
|
|
292
|
+
//# sourceMappingURL=assembler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assembler.js","sourceRoot":"","sources":["../../../src/rules/generators/assembler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,aAAa,GACd,MAAM,kBAAkB,CAAC;AAU1B,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC;;;;;6BAK6B;AAC7B,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;AAEnD;;;sDAGsD;AACtD,SAAS,oBAAoB,CAAC,UAAkB;IAC9C,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3E,MAAM,IAAI,KAAK,CACb,yCAAyC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK;YACtE,cAAc,kBAAkB,qCAAqC;YACrE,gFAAgF,CACnF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAAkB;IAClD,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IACxE,oBAAoB,CAAC,UAAU,CAAC,CAAC;IACjC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IACzC,MAAM,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,I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AO,EAAE,IAAI,CAAC,QAAQ,CAAC;QACzC,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC;QACxC,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC;KAC3C,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEf,MAAM,UAAU,GAAG;;;;;;;;;;;;8DAYyC,CAAC;IAE7D,8CAA8C;IAC9C,MAAM,gBAAgB,GAAG;;;;YAIf,CAAC;IAEX,MAAM,mBAAmB,GAAG;8FACgE,CAAC;IAE7F,OAAO;;;;EAIP,YAAY;;aAED,UAAU;;EAErB,mBAAmB,CAAC,QAAQ,CAAC;;yBAEN,UAAU;UACzB,gBAAgB;;;;;yBAKD,UAAU;UACzB,mBAAmB;;;;;;yBAMJ,UAAU;UACzB,mBAAmB;;;;;;yBAMJ,UAAU;gDACa,UAAU;;;;;;CAMzD,CAAC;AACF,CAAC;AAED,wBAAwB;AACxB,SAAS,UAAU,CAAC,QAAiB;IACnC,IAAI,CAAC,QAAQ;QAAE,OAAO;;;;;;;CAOvB,CAAC;IACA,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BR,CAAC;AACF,CAAC;AAED,SAAS,mBAAmB,CAAC,QAAiB;IAC5C,IAAI,CAAC,QAAQ;QAAE,OAAO;;;;;;;CAOvB,CAAC;IACA,OAAO;;;;;;;;;;;;;;;;;;;;;CAqBR,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Firestore rules expression generators for grid-based games.
|
|
3
|
+
*
|
|
4
|
+
* Each function returns a string that is a valid Firestore rules boolean expression.
|
|
5
|
+
* The expressions use parameter names (b, ob, nc, nr, mark) that must match
|
|
6
|
+
* the function signatures in the generated rules.
|
|
7
|
+
*/
|
|
8
|
+
import type { GridConfig } from './grid.js';
|
|
9
|
+
/**
|
|
10
|
+
* Win detection: OR of all winning lines for a specific mark.
|
|
11
|
+
* Uses `b` as the board parameter name.
|
|
12
|
+
*
|
|
13
|
+
* Example output: (b.c0r0 == 'R' && b.c1r0 == 'R' && b.c2r0 == 'R' && b.c3r0 == 'R') || ...
|
|
14
|
+
*/
|
|
15
|
+
export declare function winCheckExpr(mark: string, lines: number[][], grid: GridConfig): string;
|
|
16
|
+
/**
|
|
17
|
+
* Split win lines by direction for per-direction functions.
|
|
18
|
+
* Returns { horizontal, vertical, diagUp, diagDown }.
|
|
19
|
+
*/
|
|
20
|
+
export declare function splitWinLinesByDirection(lines: number[][], cols: number): {
|
|
21
|
+
horizontal: number[][];
|
|
22
|
+
vertical: number[][];
|
|
23
|
+
diagUp: number[][];
|
|
24
|
+
diagDown: number[][];
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Gravity: per-column lowest-empty-row check.
|
|
28
|
+
* Uses `nc` (new col), `nr` (new row), `ob` (old board) as parameter names.
|
|
29
|
+
*
|
|
30
|
+
* For each column: if nc == col, verify nr is the lowest empty row.
|
|
31
|
+
*/
|
|
32
|
+
export declare function gravityExpr(grid: GridConfig): string;
|
|
33
|
+
/**
|
|
34
|
+
* Board integrity: verify all non-move cells are unchanged.
|
|
35
|
+
* Uses `nc`, `nr`, `b` (new board), `ob` (old board) as parameter names.
|
|
36
|
+
*
|
|
37
|
+
* For each cell: either it's the move cell OR old == new.
|
|
38
|
+
*/
|
|
39
|
+
export declare function boardIntegrityExpr(grid: GridConfig): string;
|
|
40
|
+
/**
|
|
41
|
+
* Cell-was-empty check: verify the cell at (nc, nr) was empty before the move.
|
|
42
|
+
* Uses `nc`, `nr`, `ob` (old board) as parameter names.
|
|
43
|
+
* For gravity games this is redundant (gravity already checks ob.cell == ''),
|
|
44
|
+
* but for non-gravity games it prevents overwriting occupied cells.
|
|
45
|
+
*/
|
|
46
|
+
export declare function cellEmptyExpr(grid: GridConfig): string;
|
|
47
|
+
/**
|
|
48
|
+
* Placement: verify the cell at (nc, nr) has the correct mark.
|
|
49
|
+
* Uses `nc`, `nr`, `mark`, `b` (new board) as parameter names.
|
|
50
|
+
*/
|
|
51
|
+
export declare function placementExpr(grid: GridConfig): string;
|
|
52
|
+
//# sourceMappingURL=expressions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expressions.d.ts","sourceRoot":"","sources":["../../../src/rules/generators/expressions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAG5C;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,CAQtF;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EAAE,EAAE,EACjB,IAAI,EAAE,MAAM,GACX;IAAE,UAAU,EAAE,MAAM,EAAE,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAA;CAAE,CAkB5F;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAepD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAW3D;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAQtD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAQtD"}
|