pyric 0.0.1 → 0.1.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +138 -2
- package/README.md.orig +54 -0
- package/dist/app/index.d.ts +81 -0
- package/dist/app/index.d.ts.map +1 -0
- package/dist/app/index.js +78 -0
- package/dist/app/index.js.map +1 -0
- package/dist/auth/index.d.ts +346 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +701 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/prod-backend.d.ts +39 -0
- package/dist/auth/prod-backend.d.ts.map +1 -0
- package/dist/auth/prod-backend.js +179 -0
- package/dist/auth/prod-backend.js.map +1 -0
- package/dist/auth/providers.d.ts +107 -0
- package/dist/auth/providers.d.ts.map +1 -0
- package/dist/auth/providers.js +138 -0
- package/dist/auth/providers.js.map +1 -0
- package/dist/auth/sandbox-backend.d.ts +769 -0
- package/dist/auth/sandbox-backend.d.ts.map +1 -0
- package/dist/auth/sandbox-backend.js +1598 -0
- package/dist/auth/sandbox-backend.js.map +1 -0
- package/dist/auth/target.d.ts +40 -0
- package/dist/auth/target.d.ts.map +1 -0
- package/dist/auth/target.js +28 -0
- package/dist/auth/target.js.map +1 -0
- package/dist/auth/types.d.ts +252 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +26 -0
- package/dist/auth/types.js.map +1 -0
- package/dist/database/constraints/atoms.d.ts +29 -0
- package/dist/database/constraints/atoms.d.ts.map +1 -0
- package/dist/database/constraints/atoms.js +43 -0
- package/dist/database/constraints/atoms.js.map +1 -0
- package/dist/database/constraints/compose.d.ts +16 -0
- package/dist/database/constraints/compose.d.ts.map +1 -0
- package/dist/database/constraints/compose.js +15 -0
- package/dist/database/constraints/compose.js.map +1 -0
- package/dist/database/constraints/data.d.ts +30 -0
- package/dist/database/constraints/data.d.ts.map +1 -0
- package/dist/database/constraints/data.js +46 -0
- package/dist/database/constraints/data.js.map +1 -0
- package/dist/database/constraints/document.d.ts +42 -0
- package/dist/database/constraints/document.d.ts.map +1 -0
- package/dist/database/constraints/document.js +86 -0
- package/dist/database/constraints/document.js.map +1 -0
- package/dist/database/constraints/game.d.ts +30 -0
- package/dist/database/constraints/game.d.ts.map +1 -0
- package/dist/database/constraints/game.js +49 -0
- package/dist/database/constraints/game.js.map +1 -0
- package/dist/database/constraints/index.d.ts +12 -0
- package/dist/database/constraints/index.d.ts.map +1 -0
- package/dist/database/constraints/index.js +9 -0
- package/dist/database/constraints/index.js.map +1 -0
- package/dist/database/constraints/policies.d.ts +16 -0
- package/dist/database/constraints/policies.d.ts.map +1 -0
- package/dist/database/constraints/policies.js +17 -0
- package/dist/database/constraints/policies.js.map +1 -0
- package/dist/database/constraints/ruleset.d.ts +5 -0
- package/dist/database/constraints/ruleset.d.ts.map +1 -0
- package/dist/database/constraints/ruleset.js +132 -0
- package/dist/database/constraints/ruleset.js.map +1 -0
- package/dist/database/constraints/schema.d.ts +17 -0
- package/dist/database/constraints/schema.d.ts.map +1 -0
- package/dist/database/constraints/schema.js +74 -0
- package/dist/database/constraints/schema.js.map +1 -0
- package/dist/database/constraints/types.d.ts +22 -0
- package/dist/database/constraints/types.d.ts.map +1 -0
- package/dist/database/constraints/types.js +2 -0
- package/dist/database/constraints/types.js.map +1 -0
- package/dist/database/crawl/handler.d.ts +7 -0
- package/dist/database/crawl/handler.d.ts.map +1 -0
- package/dist/database/crawl/handler.js +91 -0
- package/dist/database/crawl/handler.js.map +1 -0
- package/dist/database/crawl/semaphore.d.ts +9 -0
- package/dist/database/crawl/semaphore.d.ts.map +1 -0
- package/dist/database/crawl/semaphore.js +27 -0
- package/dist/database/crawl/semaphore.js.map +1 -0
- package/dist/database/crawl/spec.d.ts +33 -0
- package/dist/database/crawl/spec.d.ts.map +1 -0
- package/dist/database/crawl/spec.js +12 -0
- package/dist/database/crawl/spec.js.map +1 -0
- package/dist/database/data/handler.d.ts +9 -0
- package/dist/database/data/handler.d.ts.map +1 -0
- package/dist/database/data/handler.js +96 -0
- package/dist/database/data/handler.js.map +1 -0
- package/dist/database/data/spec.d.ts +77 -0
- package/dist/database/data/spec.d.ts.map +1 -0
- package/dist/database/data/spec.js +17 -0
- package/dist/database/data/spec.js.map +1 -0
- package/dist/database/data/validated.d.ts +8 -0
- package/dist/database/data/validated.d.ts.map +1 -0
- package/dist/database/data/validated.js +99 -0
- package/dist/database/data/validated.js.map +1 -0
- package/dist/database/grammar/RtdbExpr.ohm +98 -0
- package/dist/database/grammar/RtdbExpr.ohm.generated.d.ts +2 -0
- package/dist/database/grammar/RtdbExpr.ohm.generated.d.ts.map +1 -0
- package/dist/database/grammar/RtdbExpr.ohm.generated.js +103 -0
- package/dist/database/grammar/RtdbExpr.ohm.generated.js.map +1 -0
- package/dist/database/grammar/RtdbExprParser.d.ts +5 -0
- package/dist/database/grammar/RtdbExprParser.d.ts.map +1 -0
- package/dist/database/grammar/RtdbExprParser.js +53 -0
- package/dist/database/grammar/RtdbExprParser.js.map +1 -0
- package/dist/database/grammar/linter.d.ts +3 -0
- package/dist/database/grammar/linter.d.ts.map +1 -0
- package/dist/database/grammar/linter.js +66 -0
- package/dist/database/grammar/linter.js.map +1 -0
- package/dist/database/grammar/simulator.d.ts +31 -0
- package/dist/database/grammar/simulator.d.ts.map +1 -0
- package/dist/database/grammar/simulator.js +255 -0
- package/dist/database/grammar/simulator.js.map +1 -0
- package/dist/database/grammar/validator.d.ts +3 -0
- package/dist/database/grammar/validator.d.ts.map +1 -0
- package/dist/database/grammar/validator.js +84 -0
- package/dist/database/grammar/validator.js.map +1 -0
- package/dist/database/host.d.ts +50 -0
- package/dist/database/host.d.ts.map +1 -0
- package/dist/database/host.js +41 -0
- package/dist/database/host.js.map +1 -0
- package/dist/database/index.d.ts +40 -0
- package/dist/database/index.d.ts.map +1 -0
- package/dist/database/index.js +47 -0
- package/dist/database/index.js.map +1 -0
- package/dist/database/initialize-from-app.d.ts +28 -0
- package/dist/database/initialize-from-app.d.ts.map +1 -0
- package/dist/database/initialize-from-app.js +23 -0
- package/dist/database/initialize-from-app.js.map +1 -0
- package/dist/database/ir/handler.d.ts +6 -0
- package/dist/database/ir/handler.d.ts.map +1 -0
- package/dist/database/ir/handler.js +52 -0
- package/dist/database/ir/handler.js.map +1 -0
- package/dist/database/ir/spec.d.ts +25 -0
- package/dist/database/ir/spec.d.ts.map +1 -0
- package/dist/database/ir/spec.js +11 -0
- package/dist/database/ir/spec.js.map +1 -0
- package/dist/database/mapper.d.ts +9 -0
- package/dist/database/mapper.d.ts.map +1 -0
- package/dist/database/mapper.js +115 -0
- package/dist/database/mapper.js.map +1 -0
- package/dist/database/modular.d.ts +604 -0
- package/dist/database/modular.d.ts.map +1 -0
- package/dist/database/modular.js +1226 -0
- package/dist/database/modular.js.map +1 -0
- package/dist/database/replay.d.ts +33 -0
- package/dist/database/replay.d.ts.map +1 -0
- package/dist/database/replay.js +124 -0
- package/dist/database/replay.js.map +1 -0
- package/dist/database/resolver.d.ts +4 -0
- package/dist/database/resolver.d.ts.map +1 -0
- package/dist/database/resolver.js +66 -0
- package/dist/database/resolver.js.map +1 -0
- package/dist/database/sandbox/backend.d.ts +403 -0
- package/dist/database/sandbox/backend.d.ts.map +1 -0
- package/dist/database/sandbox/backend.js +1467 -0
- package/dist/database/sandbox/backend.js.map +1 -0
- package/dist/database/sandbox/data-tree.d.ts +123 -0
- package/dist/database/sandbox/data-tree.d.ts.map +1 -0
- package/dist/database/sandbox/data-tree.js +310 -0
- package/dist/database/sandbox/data-tree.js.map +1 -0
- package/dist/database/sandbox/normalize.d.ts +77 -0
- package/dist/database/sandbox/normalize.d.ts.map +1 -0
- package/dist/database/sandbox/normalize.js +165 -0
- package/dist/database/sandbox/normalize.js.map +1 -0
- package/dist/database/sandbox/push-id.d.ts +32 -0
- package/dist/database/sandbox/push-id.d.ts.map +1 -0
- package/dist/database/sandbox/push-id.js +82 -0
- package/dist/database/sandbox/push-id.js.map +1 -0
- package/dist/database/sandbox/query.d.ts +175 -0
- package/dist/database/sandbox/query.d.ts.map +1 -0
- package/dist/database/sandbox/query.js +269 -0
- package/dist/database/sandbox/query.js.map +1 -0
- package/dist/database/sandbox/rules-eval.d.ts +69 -0
- package/dist/database/sandbox/rules-eval.d.ts.map +1 -0
- package/dist/database/sandbox/rules-eval.js +124 -0
- package/dist/database/sandbox/rules-eval.js.map +1 -0
- package/dist/database/sandbox/sentinels.d.ts +71 -0
- package/dist/database/sandbox/sentinels.d.ts.map +1 -0
- package/dist/database/sandbox/sentinels.js +92 -0
- package/dist/database/sandbox/sentinels.js.map +1 -0
- package/dist/database/simulation/handler.d.ts +6 -0
- package/dist/database/simulation/handler.d.ts.map +1 -0
- package/dist/database/simulation/handler.js +236 -0
- package/dist/database/simulation/handler.js.map +1 -0
- package/dist/database/simulation/spec.d.ts +69 -0
- package/dist/database/simulation/spec.d.ts.map +1 -0
- package/dist/database/simulation/spec.js +25 -0
- package/dist/database/simulation/spec.js.map +1 -0
- package/dist/database/tools.d.ts +22 -0
- package/dist/database/tools.d.ts.map +1 -0
- package/dist/database/tools.js +272 -0
- package/dist/database/tools.js.map +1 -0
- package/dist/database/types.d.ts +210 -0
- package/dist/database/types.d.ts.map +1 -0
- package/dist/database/types.js +26 -0
- package/dist/database/types.js.map +1 -0
- package/dist/database/write/handler.d.ts +7 -0
- package/dist/database/write/handler.d.ts.map +1 -0
- package/dist/database/write/handler.js +42 -0
- package/dist/database/write/handler.js.map +1 -0
- package/dist/database/write/spec.d.ts +18 -0
- package/dist/database/write/spec.d.ts.map +1 -0
- package/dist/database/write/spec.js +7 -0
- package/dist/database/write/spec.js.map +1 -0
- package/dist/firestore/index.d.ts +533 -0
- package/dist/firestore/index.d.ts.map +1 -0
- package/dist/firestore/index.js +1536 -0
- package/dist/firestore/index.js.map +1 -0
- package/dist/firestore/tools.d.ts +67 -0
- package/dist/firestore/tools.d.ts.map +1 -0
- package/dist/firestore/tools.js +318 -0
- package/dist/firestore/tools.js.map +1 -0
- package/dist/firestore-values/index.d.ts +63 -0
- package/dist/firestore-values/index.d.ts.map +1 -0
- package/dist/firestore-values/index.js +148 -0
- package/dist/firestore-values/index.js.map +1 -0
- package/dist/project-scope.d.ts +5 -0
- package/dist/project-scope.d.ts.map +1 -0
- package/dist/project-scope.js +2 -0
- package/dist/project-scope.js.map +1 -0
- package/dist/rules/extract.d.ts +28 -0
- package/dist/rules/extract.d.ts.map +1 -0
- package/dist/rules/extract.js +25 -0
- package/dist/rules/extract.js.map +1 -0
- package/dist/rules/generators/assembler.d.ts +19 -0
- package/dist/rules/generators/assembler.d.ts.map +1 -0
- package/dist/rules/generators/assembler.js +292 -0
- package/dist/rules/generators/assembler.js.map +1 -0
- package/dist/rules/generators/expressions.d.ts +52 -0
- package/dist/rules/generators/expressions.d.ts.map +1 -0
- package/dist/rules/generators/expressions.js +117 -0
- package/dist/rules/generators/expressions.js.map +1 -0
- package/dist/rules/generators/grid.d.ts +22 -0
- package/dist/rules/generators/grid.d.ts.map +1 -0
- package/dist/rules/generators/grid.js +52 -0
- package/dist/rules/generators/grid.js.map +1 -0
- package/dist/rules/grammar/FirestoreAST.d.ts +129 -0
- package/dist/rules/grammar/FirestoreAST.d.ts.map +1 -0
- package/dist/rules/grammar/FirestoreAST.js +3 -0
- package/dist/rules/grammar/FirestoreAST.js.map +1 -0
- package/dist/rules/grammar/FirestoreAssembler.d.ts +5 -0
- package/dist/rules/grammar/FirestoreAssembler.d.ts.map +1 -0
- package/dist/rules/grammar/FirestoreAssembler.js +158 -0
- package/dist/rules/grammar/FirestoreAssembler.js.map +1 -0
- package/dist/rules/grammar/FirestoreParser.d.ts +46 -0
- package/dist/rules/grammar/FirestoreParser.d.ts.map +1 -0
- package/dist/rules/grammar/FirestoreParser.js +409 -0
- package/dist/rules/grammar/FirestoreParser.js.map +1 -0
- package/dist/rules/grammar/FirestoreRules.ohm +229 -0
- package/dist/rules/grammar/FirestoreRules.ohm.generated.d.ts +2 -0
- package/dist/rules/grammar/FirestoreRules.ohm.generated.d.ts.map +1 -0
- package/dist/rules/grammar/FirestoreRules.ohm.generated.js +234 -0
- package/dist/rules/grammar/FirestoreRules.ohm.generated.js.map +1 -0
- package/dist/rules/grammar/FirestoreValidator.d.ts +10 -0
- package/dist/rules/grammar/FirestoreValidator.d.ts.map +1 -0
- package/dist/rules/grammar/FirestoreValidator.js +482 -0
- package/dist/rules/grammar/FirestoreValidator.js.map +1 -0
- package/dist/rules/index.d.ts +67 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +80 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/indexes/extract/annotation-collect.d.ts +42 -0
- package/dist/rules/indexes/extract/annotation-collect.d.ts.map +1 -0
- package/dist/rules/indexes/extract/annotation-collect.js +69 -0
- package/dist/rules/indexes/extract/annotation-collect.js.map +1 -0
- package/dist/rules/indexes/extract/annotations.d.ts +50 -0
- package/dist/rules/indexes/extract/annotations.d.ts.map +1 -0
- package/dist/rules/indexes/extract/annotations.js +144 -0
- package/dist/rules/indexes/extract/annotations.js.map +1 -0
- package/dist/rules/indexes/extract/ast.d.ts +54 -0
- package/dist/rules/indexes/extract/ast.d.ts.map +1 -0
- package/dist/rules/indexes/extract/ast.js +119 -0
- package/dist/rules/indexes/extract/ast.js.map +1 -0
- package/dist/rules/indexes/extract/classify.d.ts +41 -0
- package/dist/rules/indexes/extract/classify.d.ts.map +1 -0
- package/dist/rules/indexes/extract/classify.js +138 -0
- package/dist/rules/indexes/extract/classify.js.map +1 -0
- package/dist/rules/indexes/extract/composite.d.ts +38 -0
- package/dist/rules/indexes/extract/composite.d.ts.map +1 -0
- package/dist/rules/indexes/extract/composite.js +85 -0
- package/dist/rules/indexes/extract/composite.js.map +1 -0
- package/dist/rules/indexes/extract/dataflow.d.ts +45 -0
- package/dist/rules/indexes/extract/dataflow.d.ts.map +1 -0
- package/dist/rules/indexes/extract/dataflow.js +200 -0
- package/dist/rules/indexes/extract/dataflow.js.map +1 -0
- package/dist/rules/indexes/extract/enumerate.d.ts +41 -0
- package/dist/rules/indexes/extract/enumerate.d.ts.map +1 -0
- package/dist/rules/indexes/extract/enumerate.js +163 -0
- package/dist/rules/indexes/extract/enumerate.js.map +1 -0
- package/dist/rules/indexes/extract/extractor.d.ts +3 -0
- package/dist/rules/indexes/extract/extractor.d.ts.map +1 -0
- package/dist/rules/indexes/extract/extractor.js +274 -0
- package/dist/rules/indexes/extract/extractor.js.map +1 -0
- package/dist/rules/indexes/extract/types.d.ts +211 -0
- package/dist/rules/indexes/extract/types.d.ts.map +1 -0
- package/dist/rules/indexes/extract/types.js +14 -0
- package/dist/rules/indexes/extract/types.js.map +1 -0
- package/dist/rules/indexes/extractHandler.d.ts +16 -0
- package/dist/rules/indexes/extractHandler.d.ts.map +1 -0
- package/dist/rules/indexes/extractHandler.js +100 -0
- package/dist/rules/indexes/extractHandler.js.map +1 -0
- package/dist/rules/indexes/extractTool.d.ts +15 -0
- package/dist/rules/indexes/extractTool.d.ts.map +1 -0
- package/dist/rules/indexes/extractTool.js +55 -0
- package/dist/rules/indexes/extractTool.js.map +1 -0
- package/dist/rules/indexes/types.d.ts +71 -0
- package/dist/rules/indexes/types.d.ts.map +1 -0
- package/dist/rules/indexes/types.js +15 -0
- package/dist/rules/indexes/types.js.map +1 -0
- package/dist/rules/inspect/handler.d.ts +6 -0
- package/dist/rules/inspect/handler.d.ts.map +1 -0
- package/dist/rules/inspect/handler.js +144 -0
- package/dist/rules/inspect/handler.js.map +1 -0
- package/dist/rules/inspect/spec.d.ts +37 -0
- package/dist/rules/inspect/spec.d.ts.map +1 -0
- package/dist/rules/inspect/spec.js +2 -0
- package/dist/rules/inspect/spec.js.map +1 -0
- package/dist/rules/inspect/tools.d.ts +21 -0
- package/dist/rules/inspect/tools.d.ts.map +1 -0
- package/dist/rules/inspect/tools.js +21 -0
- package/dist/rules/inspect/tools.js.map +1 -0
- package/dist/rules/linter/ast-utils.d.ts +97 -0
- package/dist/rules/linter/ast-utils.d.ts.map +1 -0
- package/dist/rules/linter/ast-utils.js +491 -0
- package/dist/rules/linter/ast-utils.js.map +1 -0
- package/dist/rules/linter/hallucinations.d.ts +34 -0
- package/dist/rules/linter/hallucinations.d.ts.map +1 -0
- package/dist/rules/linter/hallucinations.js +334 -0
- package/dist/rules/linter/hallucinations.js.map +1 -0
- package/dist/rules/linter/linter.d.ts +84 -0
- package/dist/rules/linter/linter.d.ts.map +1 -0
- package/dist/rules/linter/linter.js +784 -0
- package/dist/rules/linter/linter.js.map +1 -0
- package/dist/rules/modules/resolver-browser.d.ts +41 -0
- package/dist/rules/modules/resolver-browser.d.ts.map +1 -0
- package/dist/rules/modules/resolver-browser.js +63 -0
- package/dist/rules/modules/resolver-browser.js.map +1 -0
- package/dist/rules/modules/resolver-core.d.ts +51 -0
- package/dist/rules/modules/resolver-core.d.ts.map +1 -0
- package/dist/rules/modules/resolver-core.js +338 -0
- package/dist/rules/modules/resolver-core.js.map +1 -0
- package/dist/rules/modules/resolver.d.ts +17 -0
- package/dist/rules/modules/resolver.d.ts.map +1 -0
- package/dist/rules/modules/resolver.js +49 -0
- package/dist/rules/modules/resolver.js.map +1 -0
- package/dist/rules/modules/stdlib/atomic.rules +52 -0
- package/dist/rules/modules/stdlib/atomic.test.json +152 -0
- package/dist/rules/modules/stdlib/auth.rules +7 -0
- package/dist/rules/modules/stdlib/auth.test.json +53 -0
- package/dist/rules/modules/stdlib/content.rules +50 -0
- package/dist/rules/modules/stdlib/content.test.json +238 -0
- package/dist/rules/modules/stdlib/counters.rules +41 -0
- package/dist/rules/modules/stdlib/counters.test.json +254 -0
- package/dist/rules/modules/stdlib/geometry.rules +43 -0
- package/dist/rules/modules/stdlib/geometry.test.json +200 -0
- package/dist/rules/modules/stdlib/joining.rules +49 -0
- package/dist/rules/modules/stdlib/joining.test.json +287 -0
- package/dist/rules/modules/stdlib/lifecycle.rules +51 -0
- package/dist/rules/modules/stdlib/lifecycle.test.json +288 -0
- package/dist/rules/modules/stdlib/lobby.rules +44 -0
- package/dist/rules/modules/stdlib/lobby.test.json +32 -0
- package/dist/rules/modules/stdlib/membership.rules +40 -0
- package/dist/rules/modules/stdlib/membership.test.json +107 -0
- package/dist/rules/modules/stdlib/spaces.rules +46 -0
- package/dist/rules/modules/stdlib/spaces.test.json +392 -0
- package/dist/rules/modules/stdlib/state.rules +28 -0
- package/dist/rules/modules/stdlib/state.test.json +55 -0
- package/dist/rules/modules/stdlib/timing.rules +20 -0
- package/dist/rules/modules/stdlib/timing.test.json +106 -0
- package/dist/rules/modules/stdlib/transitions.rules +34 -0
- package/dist/rules/modules/stdlib/transitions.test.json +86 -0
- package/dist/rules/modules/stdlib/turns.rules +27 -0
- package/dist/rules/modules/stdlib/turns.test.json +64 -0
- package/dist/rules/modules/stdlib/validation.rules +31 -0
- package/dist/rules/modules/stdlib/validation.test.json +184 -0
- package/dist/rules/modules/stdlib-content.d.ts +11 -0
- package/dist/rules/modules/stdlib-content.d.ts.map +1 -0
- package/dist/rules/modules/stdlib-content.js +590 -0
- package/dist/rules/modules/stdlib-content.js.map +1 -0
- package/dist/rules/node.d.ts +17 -0
- package/dist/rules/node.d.ts.map +1 -0
- package/dist/rules/node.js +21 -0
- package/dist/rules/node.js.map +1 -0
- package/dist/rules/rtdb.d.ts +28 -0
- package/dist/rules/rtdb.d.ts.map +1 -0
- package/dist/rules/rtdb.js +15 -0
- package/dist/rules/rtdb.js.map +1 -0
- package/dist/rules/simulator/evaluator.d.ts +179 -0
- package/dist/rules/simulator/evaluator.d.ts.map +1 -0
- package/dist/rules/simulator/evaluator.js +1221 -0
- package/dist/rules/simulator/evaluator.js.map +1 -0
- package/dist/rules/simulator/expression/eval-errors.d.ts +86 -0
- package/dist/rules/simulator/expression/eval-errors.d.ts.map +1 -0
- package/dist/rules/simulator/expression/eval-errors.js +68 -0
- package/dist/rules/simulator/expression/eval-errors.js.map +1 -0
- package/dist/rules/simulator/expression/evaluator.d.ts +43 -0
- package/dist/rules/simulator/expression/evaluator.d.ts.map +1 -0
- package/dist/rules/simulator/expression/evaluator.js +298 -0
- package/dist/rules/simulator/expression/evaluator.js.map +1 -0
- package/dist/rules/simulator/expression/lexer.d.ts +36 -0
- package/dist/rules/simulator/expression/lexer.d.ts.map +1 -0
- package/dist/rules/simulator/expression/lexer.js +318 -0
- package/dist/rules/simulator/expression/lexer.js.map +1 -0
- package/dist/rules/simulator/expression/parser.d.ts +39 -0
- package/dist/rules/simulator/expression/parser.d.ts.map +1 -0
- package/dist/rules/simulator/expression/parser.js +329 -0
- package/dist/rules/simulator/expression/parser.js.map +1 -0
- package/dist/rules/simulator/expression/types.d.ts +137 -0
- package/dist/rules/simulator/expression/types.d.ts.map +1 -0
- package/dist/rules/simulator/expression/types.js +90 -0
- package/dist/rules/simulator/expression/types.js.map +1 -0
- package/dist/rules/simulator/expression/walk-data.d.ts +52 -0
- package/dist/rules/simulator/expression/walk-data.d.ts.map +1 -0
- package/dist/rules/simulator/expression/walk-data.js +167 -0
- package/dist/rules/simulator/expression/walk-data.js.map +1 -0
- package/dist/rules/simulator/firestore-set.d.ts +25 -0
- package/dist/rules/simulator/firestore-set.d.ts.map +1 -0
- package/dist/rules/simulator/firestore-set.js +89 -0
- package/dist/rules/simulator/firestore-set.js.map +1 -0
- package/dist/rules/simulator/handler.d.ts +36 -0
- package/dist/rules/simulator/handler.d.ts.map +1 -0
- package/dist/rules/simulator/handler.js +583 -0
- package/dist/rules/simulator/handler.js.map +1 -0
- package/dist/rules/simulator/mapdiff.d.ts +29 -0
- package/dist/rules/simulator/mapdiff.d.ts.map +1 -0
- package/dist/rules/simulator/mapdiff.js +72 -0
- package/dist/rules/simulator/mapdiff.js.map +1 -0
- package/dist/rules/simulator/project-after-state.d.ts +33 -0
- package/dist/rules/simulator/project-after-state.d.ts.map +1 -0
- package/dist/rules/simulator/project-after-state.js +88 -0
- package/dist/rules/simulator/project-after-state.js.map +1 -0
- package/dist/rules/simulator/query-proof.d.ts +80 -0
- package/dist/rules/simulator/query-proof.d.ts.map +1 -0
- package/dist/rules/simulator/query-proof.js +142 -0
- package/dist/rules/simulator/query-proof.js.map +1 -0
- package/dist/rules/simulator/value-equality.d.ts +8 -0
- package/dist/rules/simulator/value-equality.d.ts.map +1 -0
- package/dist/rules/simulator/value-equality.js +40 -0
- package/dist/rules/simulator/value-equality.js.map +1 -0
- package/dist/rules/simulator/wrappers/base.d.ts +129 -0
- package/dist/rules/simulator/wrappers/base.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/base.js +90 -0
- package/dist/rules/simulator/wrappers/base.js.map +1 -0
- package/dist/rules/simulator/wrappers/bytes.d.ts +45 -0
- package/dist/rules/simulator/wrappers/bytes.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/bytes.js +130 -0
- package/dist/rules/simulator/wrappers/bytes.js.map +1 -0
- package/dist/rules/simulator/wrappers/duration.d.ts +76 -0
- package/dist/rules/simulator/wrappers/duration.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/duration.js +176 -0
- package/dist/rules/simulator/wrappers/duration.js.map +1 -0
- package/dist/rules/simulator/wrappers/float.d.ts +52 -0
- package/dist/rules/simulator/wrappers/float.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/float.js +88 -0
- package/dist/rules/simulator/wrappers/float.js.map +1 -0
- package/dist/rules/simulator/wrappers/latlng.d.ts +40 -0
- package/dist/rules/simulator/wrappers/latlng.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/latlng.js +100 -0
- package/dist/rules/simulator/wrappers/latlng.js.map +1 -0
- package/dist/rules/simulator/wrappers/path.d.ts +75 -0
- package/dist/rules/simulator/wrappers/path.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/path.js +158 -0
- package/dist/rules/simulator/wrappers/path.js.map +1 -0
- package/dist/rules/simulator/wrappers/reference.d.ts +82 -0
- package/dist/rules/simulator/wrappers/reference.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/reference.js +145 -0
- package/dist/rules/simulator/wrappers/reference.js.map +1 -0
- package/dist/rules/simulator/wrappers/timestamp.d.ts +86 -0
- package/dist/rules/simulator/wrappers/timestamp.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/timestamp.js +207 -0
- package/dist/rules/simulator/wrappers/timestamp.js.map +1 -0
- package/dist/rules/simulator/wrappers/vector.d.ts +43 -0
- package/dist/rules/simulator/wrappers/vector.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/vector.js +80 -0
- package/dist/rules/simulator/wrappers/vector.js.map +1 -0
- package/dist/rules/simulator-tools-impl.d.ts +64 -0
- package/dist/rules/simulator-tools-impl.d.ts.map +1 -0
- package/dist/rules/simulator-tools-impl.js +462 -0
- package/dist/rules/simulator-tools-impl.js.map +1 -0
- package/dist/rules/simulator.d.ts +20 -0
- package/dist/rules/simulator.d.ts.map +1 -0
- package/dist/rules/simulator.js +24 -0
- package/dist/rules/simulator.js.map +1 -0
- package/dist/rules/stdlib-modules.d.ts +73 -0
- package/dist/rules/stdlib-modules.d.ts.map +1 -0
- package/dist/rules/stdlib-modules.js +849 -0
- package/dist/rules/stdlib-modules.js.map +1 -0
- package/dist/rules/stdlib-tools.d.ts +19 -0
- package/dist/rules/stdlib-tools.d.ts.map +1 -0
- package/dist/rules/stdlib-tools.js +164 -0
- package/dist/rules/stdlib-tools.js.map +1 -0
- package/dist/rules/test/handler.d.ts +9 -0
- package/dist/rules/test/handler.d.ts.map +1 -0
- package/dist/rules/test/handler.js +124 -0
- package/dist/rules/test/handler.js.map +1 -0
- package/dist/rules/test/spec.d.ts +517 -0
- package/dist/rules/test/spec.d.ts.map +1 -0
- package/dist/rules/test/spec.js +227 -0
- package/dist/rules/test/spec.js.map +1 -0
- package/dist/rules/tools.d.ts +41 -0
- package/dist/rules/tools.d.ts.map +1 -0
- package/dist/rules/tools.js +124 -0
- package/dist/rules/tools.js.map +1 -0
- package/dist/rules/write/handler.d.ts +6 -0
- package/dist/rules/write/handler.d.ts.map +1 -0
- package/dist/rules/write/handler.js +126 -0
- package/dist/rules/write/handler.js.map +1 -0
- package/dist/rules/write/spec.d.ts +28 -0
- package/dist/rules/write/spec.d.ts.map +1 -0
- package/dist/rules/write/spec.js +2 -0
- package/dist/rules/write/spec.js.map +1 -0
- package/dist/sandbox/admin-compat.d.ts +20 -0
- package/dist/sandbox/admin-compat.d.ts.map +1 -0
- package/dist/sandbox/admin-compat.js +19 -0
- package/dist/sandbox/admin-compat.js.map +1 -0
- package/dist/sandbox/admin-firestore/error-translation.d.ts +86 -0
- package/dist/sandbox/admin-firestore/error-translation.d.ts.map +1 -0
- package/dist/sandbox/admin-firestore/error-translation.js +204 -0
- package/dist/sandbox/admin-firestore/error-translation.js.map +1 -0
- package/dist/sandbox/admin-firestore/index.d.ts +169 -0
- package/dist/sandbox/admin-firestore/index.d.ts.map +1 -0
- package/dist/sandbox/admin-firestore/index.js +456 -0
- package/dist/sandbox/admin-firestore/index.js.map +1 -0
- package/dist/sandbox/admin-firestore/remote.d.ts +97 -0
- package/dist/sandbox/admin-firestore/remote.d.ts.map +1 -0
- package/dist/sandbox/admin-firestore/remote.js +735 -0
- package/dist/sandbox/admin-firestore/remote.js.map +1 -0
- package/dist/sandbox/branches/index.d.ts +141 -0
- package/dist/sandbox/branches/index.d.ts.map +1 -0
- package/dist/sandbox/branches/index.js +327 -0
- package/dist/sandbox/branches/index.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/batch.d.ts +34 -0
- package/dist/sandbox/firestore/admin-compat/batch.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/batch.js +73 -0
- package/dist/sandbox/firestore/admin-compat/batch.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/doc-ref.d.ts +38 -0
- package/dist/sandbox/firestore/admin-compat/doc-ref.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/doc-ref.js +154 -0
- package/dist/sandbox/firestore/admin-compat/doc-ref.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/firestore.d.ts +45 -0
- package/dist/sandbox/firestore/admin-compat/firestore.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/firestore.js +114 -0
- package/dist/sandbox/firestore/admin-compat/firestore.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/index.d.ts +45 -0
- package/dist/sandbox/firestore/admin-compat/index.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/index.js +27 -0
- package/dist/sandbox/firestore/admin-compat/index.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/paths.d.ts +37 -0
- package/dist/sandbox/firestore/admin-compat/paths.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/paths.js +49 -0
- package/dist/sandbox/firestore/admin-compat/paths.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/query.d.ts +261 -0
- package/dist/sandbox/firestore/admin-compat/query.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/query.js +704 -0
- package/dist/sandbox/firestore/admin-compat/query.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/read-translation.d.ts +8 -0
- package/dist/sandbox/firestore/admin-compat/read-translation.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/read-translation.js +59 -0
- package/dist/sandbox/firestore/admin-compat/read-translation.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/snapshots.d.ts +39 -0
- package/dist/sandbox/firestore/admin-compat/snapshots.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/snapshots.js +50 -0
- package/dist/sandbox/firestore/admin-compat/snapshots.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/transaction.d.ts +35 -0
- package/dist/sandbox/firestore/admin-compat/transaction.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/transaction.js +88 -0
- package/dist/sandbox/firestore/admin-compat/transaction.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/types.d.ts +297 -0
- package/dist/sandbox/firestore/admin-compat/types.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/types.js +127 -0
- package/dist/sandbox/firestore/admin-compat/types.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/value-order.d.ts +49 -0
- package/dist/sandbox/firestore/admin-compat/value-order.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/value-order.js +172 -0
- package/dist/sandbox/firestore/admin-compat/value-order.js.map +1 -0
- package/dist/sandbox/firestore/auto-id.d.ts +26 -0
- package/dist/sandbox/firestore/auto-id.d.ts.map +1 -0
- package/dist/sandbox/firestore/auto-id.js +36 -0
- package/dist/sandbox/firestore/auto-id.js.map +1 -0
- package/dist/sandbox/firestore/converters/bytes-geopoint.d.ts +48 -0
- package/dist/sandbox/firestore/converters/bytes-geopoint.d.ts.map +1 -0
- package/dist/sandbox/firestore/converters/bytes-geopoint.js +85 -0
- package/dist/sandbox/firestore/converters/bytes-geopoint.js.map +1 -0
- package/dist/sandbox/firestore/converters/fieldvalue.d.ts +69 -0
- package/dist/sandbox/firestore/converters/fieldvalue.d.ts.map +1 -0
- package/dist/sandbox/firestore/converters/fieldvalue.js +166 -0
- package/dist/sandbox/firestore/converters/fieldvalue.js.map +1 -0
- package/dist/sandbox/firestore/converters/reference.d.ts +31 -0
- package/dist/sandbox/firestore/converters/reference.d.ts.map +1 -0
- package/dist/sandbox/firestore/converters/reference.js +51 -0
- package/dist/sandbox/firestore/converters/reference.js.map +1 -0
- package/dist/sandbox/firestore/converters/timestamp.d.ts +32 -0
- package/dist/sandbox/firestore/converters/timestamp.d.ts.map +1 -0
- package/dist/sandbox/firestore/converters/timestamp.js +63 -0
- package/dist/sandbox/firestore/converters/timestamp.js.map +1 -0
- package/dist/sandbox/firestore/converters/user-timestamp.d.ts +46 -0
- package/dist/sandbox/firestore/converters/user-timestamp.d.ts.map +1 -0
- package/dist/sandbox/firestore/converters/user-timestamp.js +65 -0
- package/dist/sandbox/firestore/converters/user-timestamp.js.map +1 -0
- package/dist/sandbox/firestore/converters/vector.d.ts +24 -0
- package/dist/sandbox/firestore/converters/vector.d.ts.map +1 -0
- package/dist/sandbox/firestore/converters/vector.js +53 -0
- package/dist/sandbox/firestore/converters/vector.js.map +1 -0
- package/dist/sandbox/firestore/errors.d.ts +82 -0
- package/dist/sandbox/firestore/errors.d.ts.map +1 -0
- package/dist/sandbox/firestore/errors.js +54 -0
- package/dist/sandbox/firestore/errors.js.map +1 -0
- package/dist/sandbox/firestore/event-log.d.ts +99 -0
- package/dist/sandbox/firestore/event-log.d.ts.map +1 -0
- package/dist/sandbox/firestore/event-log.js +67 -0
- package/dist/sandbox/firestore/event-log.js.map +1 -0
- package/dist/sandbox/firestore/field-merge.d.ts +64 -0
- package/dist/sandbox/firestore/field-merge.d.ts.map +1 -0
- package/dist/sandbox/firestore/field-merge.js +221 -0
- package/dist/sandbox/firestore/field-merge.js.map +1 -0
- package/dist/sandbox/firestore/list-query-proof.d.ts +77 -0
- package/dist/sandbox/firestore/list-query-proof.d.ts.map +1 -0
- package/dist/sandbox/firestore/list-query-proof.js +170 -0
- package/dist/sandbox/firestore/list-query-proof.js.map +1 -0
- package/dist/sandbox/firestore/local-environment.d.ts +806 -0
- package/dist/sandbox/firestore/local-environment.d.ts.map +1 -0
- package/dist/sandbox/firestore/local-environment.js +3028 -0
- package/dist/sandbox/firestore/local-environment.js.map +1 -0
- package/dist/sandbox/firestore/local-state.d.ts +196 -0
- package/dist/sandbox/firestore/local-state.d.ts.map +1 -0
- package/dist/sandbox/firestore/local-state.js +413 -0
- package/dist/sandbox/firestore/local-state.js.map +1 -0
- package/dist/sandbox/firestore/overlay-backing.d.ts +44 -0
- package/dist/sandbox/firestore/overlay-backing.d.ts.map +1 -0
- package/dist/sandbox/firestore/overlay-backing.js +82 -0
- package/dist/sandbox/firestore/overlay-backing.js.map +1 -0
- package/dist/sandbox/firestore/sentinel-capture.d.ts +30 -0
- package/dist/sandbox/firestore/sentinel-capture.d.ts.map +1 -0
- package/dist/sandbox/firestore/sentinel-capture.js +61 -0
- package/dist/sandbox/firestore/sentinel-capture.js.map +1 -0
- package/dist/sandbox/firestore/snapshot-listeners.d.ts +284 -0
- package/dist/sandbox/firestore/snapshot-listeners.d.ts.map +1 -0
- package/dist/sandbox/firestore/snapshot-listeners.js +194 -0
- package/dist/sandbox/firestore/snapshot-listeners.js.map +1 -0
- package/dist/sandbox/firestore/topk.d.ts +12 -0
- package/dist/sandbox/firestore/topk.d.ts.map +1 -0
- package/dist/sandbox/firestore/topk.js +42 -0
- package/dist/sandbox/firestore/topk.js.map +1 -0
- package/dist/sandbox/firestore/transaction-merge.d.ts +55 -0
- package/dist/sandbox/firestore/transaction-merge.d.ts.map +1 -0
- package/dist/sandbox/firestore/transaction-merge.js +107 -0
- package/dist/sandbox/firestore/transaction-merge.js.map +1 -0
- package/dist/sandbox/firestore/transaction-types.d.ts +152 -0
- package/dist/sandbox/firestore/transaction-types.d.ts.map +1 -0
- package/dist/sandbox/firestore/transaction-types.js +10 -0
- package/dist/sandbox/firestore/transaction-types.js.map +1 -0
- package/dist/sandbox/firestore/transaction.d.ts +79 -0
- package/dist/sandbox/firestore/transaction.d.ts.map +1 -0
- package/dist/sandbox/firestore/transaction.js +95 -0
- package/dist/sandbox/firestore/transaction.js.map +1 -0
- package/dist/sandbox/firestore/value-equality.d.ts +2 -0
- package/dist/sandbox/firestore/value-equality.d.ts.map +1 -0
- package/dist/sandbox/firestore/value-equality.js +35 -0
- package/dist/sandbox/firestore/value-equality.js.map +1 -0
- package/dist/sandbox/firestore/value-resolver.d.ts +172 -0
- package/dist/sandbox/firestore/value-resolver.d.ts.map +1 -0
- package/dist/sandbox/firestore/value-resolver.js +221 -0
- package/dist/sandbox/firestore/value-resolver.js.map +1 -0
- package/dist/sandbox/firestore/wire-encoder.d.ts +14 -0
- package/dist/sandbox/firestore/wire-encoder.d.ts.map +1 -0
- package/dist/sandbox/firestore/wire-encoder.js +130 -0
- package/dist/sandbox/firestore/wire-encoder.js.map +1 -0
- package/dist/sandbox/index.d.ts +50 -0
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/index.js +63 -0
- package/dist/sandbox/index.js.map +1 -0
- package/dist/sandbox/internal/index.d.ts +36 -0
- package/dist/sandbox/internal/index.d.ts.map +1 -0
- package/dist/sandbox/internal/index.js +72 -0
- package/dist/sandbox/internal/index.js.map +1 -0
- package/dist/sandbox/internal/sandbox-impl.d.ts +343 -0
- package/dist/sandbox/internal/sandbox-impl.d.ts.map +1 -0
- package/dist/sandbox/internal/sandbox-impl.js +718 -0
- package/dist/sandbox/internal/sandbox-impl.js.map +1 -0
- package/dist/sandbox/persistence/backends.d.ts +37 -0
- package/dist/sandbox/persistence/backends.d.ts.map +1 -0
- package/dist/sandbox/persistence/backends.js +202 -0
- package/dist/sandbox/persistence/backends.js.map +1 -0
- package/dist/sandbox/persistence/chunk-format.d.ts +58 -0
- package/dist/sandbox/persistence/chunk-format.d.ts.map +1 -0
- package/dist/sandbox/persistence/chunk-format.js +163 -0
- package/dist/sandbox/persistence/chunk-format.js.map +1 -0
- package/dist/sandbox/persistence/controller.d.ts +39 -0
- package/dist/sandbox/persistence/controller.d.ts.map +1 -0
- package/dist/sandbox/persistence/controller.js +605 -0
- package/dist/sandbox/persistence/controller.js.map +1 -0
- package/dist/sandbox/persistence/index.d.ts +13 -0
- package/dist/sandbox/persistence/index.d.ts.map +1 -0
- package/dist/sandbox/persistence/index.js +5 -0
- package/dist/sandbox/persistence/index.js.map +1 -0
- package/dist/sandbox/persistence/serialize.d.ts +53 -0
- package/dist/sandbox/persistence/serialize.d.ts.map +1 -0
- package/dist/sandbox/persistence/serialize.js +98 -0
- package/dist/sandbox/persistence/serialize.js.map +1 -0
- package/dist/sandbox/persistence/types.d.ts +118 -0
- package/dist/sandbox/persistence/types.d.ts.map +1 -0
- package/dist/sandbox/persistence/types.js +15 -0
- package/dist/sandbox/persistence/types.js.map +1 -0
- package/dist/sandbox/remote.d.ts +118 -0
- package/dist/sandbox/remote.d.ts.map +1 -0
- package/dist/sandbox/remote.js +60 -0
- package/dist/sandbox/remote.js.map +1 -0
- package/dist/sandbox/replay/index.d.ts +106 -0
- package/dist/sandbox/replay/index.d.ts.map +1 -0
- package/dist/sandbox/replay/index.js +246 -0
- package/dist/sandbox/replay/index.js.map +1 -0
- package/dist/sandbox/sandbox-context.d.ts +40 -0
- package/dist/sandbox/sandbox-context.d.ts.map +1 -0
- package/dist/sandbox/sandbox-context.js +72 -0
- package/dist/sandbox/sandbox-context.js.map +1 -0
- package/dist/sandbox/tab-sync/index.d.ts +120 -0
- package/dist/sandbox/tab-sync/index.d.ts.map +1 -0
- package/dist/sandbox/tab-sync/index.js +272 -0
- package/dist/sandbox/tab-sync/index.js.map +1 -0
- package/dist/sandbox/types.d.ts +1235 -0
- package/dist/sandbox/types.d.ts.map +1 -0
- package/dist/sandbox/types.js +46 -0
- package/dist/sandbox/types.js.map +1 -0
- package/dist/storage/admin/api.d.ts +206 -0
- package/dist/storage/admin/api.d.ts.map +1 -0
- package/dist/storage/admin/api.js +349 -0
- package/dist/storage/admin/api.js.map +1 -0
- package/dist/storage/admin/handler.d.ts +29 -0
- package/dist/storage/admin/handler.d.ts.map +1 -0
- package/dist/storage/admin/handler.js +82 -0
- package/dist/storage/admin/handler.js.map +1 -0
- package/dist/storage/admin/spec.d.ts +64 -0
- package/dist/storage/admin/spec.d.ts.map +1 -0
- package/dist/storage/admin/spec.js +8 -0
- package/dist/storage/admin/spec.js.map +1 -0
- package/dist/storage/admin/tools.d.ts +23 -0
- package/dist/storage/admin/tools.d.ts.map +1 -0
- package/dist/storage/admin/tools.js +90 -0
- package/dist/storage/admin/tools.js.map +1 -0
- package/dist/storage/download.d.ts +27 -0
- package/dist/storage/download.d.ts.map +1 -0
- package/dist/storage/download.js +136 -0
- package/dist/storage/download.js.map +1 -0
- package/dist/storage/enforce.d.ts +26 -0
- package/dist/storage/enforce.d.ts.map +1 -0
- package/dist/storage/enforce.js +16 -0
- package/dist/storage/enforce.js.map +1 -0
- package/dist/storage/errors.d.ts +46 -0
- package/dist/storage/errors.d.ts.map +1 -0
- package/dist/storage/errors.js +62 -0
- package/dist/storage/errors.js.map +1 -0
- package/dist/storage/index.d.ts +49 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +60 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/internal.d.ts +18 -0
- package/dist/storage/internal.d.ts.map +1 -0
- package/dist/storage/internal.js +18 -0
- package/dist/storage/internal.js.map +1 -0
- package/dist/storage/list.d.ts +17 -0
- package/dist/storage/list.d.ts.map +1 -0
- package/dist/storage/list.js +91 -0
- package/dist/storage/list.js.map +1 -0
- package/dist/storage/metadata.d.ts +86 -0
- package/dist/storage/metadata.d.ts.map +1 -0
- package/dist/storage/metadata.js +167 -0
- package/dist/storage/metadata.js.map +1 -0
- package/dist/storage/persistence.d.ts +134 -0
- package/dist/storage/persistence.d.ts.map +1 -0
- package/dist/storage/persistence.js +132 -0
- package/dist/storage/persistence.js.map +1 -0
- package/dist/storage/reference.d.ts +63 -0
- package/dist/storage/reference.d.ts.map +1 -0
- package/dist/storage/reference.js +156 -0
- package/dist/storage/reference.js.map +1 -0
- package/dist/storage/rules.d.ts +176 -0
- package/dist/storage/rules.d.ts.map +1 -0
- package/dist/storage/rules.js +621 -0
- package/dist/storage/rules.js.map +1 -0
- package/dist/storage/service.d.ts +139 -0
- package/dist/storage/service.d.ts.map +1 -0
- package/dist/storage/service.js +241 -0
- package/dist/storage/service.js.map +1 -0
- package/dist/storage/upload.d.ts +43 -0
- package/dist/storage/upload.d.ts.map +1 -0
- package/dist/storage/upload.js +235 -0
- package/dist/storage/upload.js.map +1 -0
- package/package.json +110 -3
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED FILE — do not edit by hand.
|
|
3
|
+
* Regenerate via `bun run inline-stdlib` (or `bun run build`, which
|
|
4
|
+
* runs the generator as part of `prebuild`).
|
|
5
|
+
*
|
|
6
|
+
* Mirror of every `.rules` file under `src/modules/stdlib/`,
|
|
7
|
+
* inlined as TypeScript string literals so the resolver can run
|
|
8
|
+
* in the browser. See `scripts/inline-stdlib.ts`.
|
|
9
|
+
*/
|
|
10
|
+
export const STDLIB_INLINE = {
|
|
11
|
+
atomic: `// Atomic module — cross-document integrity for BATCH writes, via the
|
|
12
|
+
// get()/getAfter() pair. Firestore evaluates every write in a batch
|
|
13
|
+
// against rules, and getAfter() returns another document's POST-BATCH
|
|
14
|
+
// state — so a rule can require "this write is only valid if a
|
|
15
|
+
// companion write happened in the same atomic batch".
|
|
16
|
+
//
|
|
17
|
+
// All semantics live-verified against a production database: companion
|
|
18
|
+
// visibility, solo-write denial, wrong-delta denial, single-use consumption
|
|
19
|
+
// incl. replay denial, and out-of-batch getAfter() falling back to current
|
|
20
|
+
// state.
|
|
21
|
+
//
|
|
22
|
+
// Explicit-param design: pass BOTH states of the companion doc —
|
|
23
|
+
// \`get(path).data\` (pre-batch) and \`getAfter(path).data\` (post-batch).
|
|
24
|
+
//
|
|
25
|
+
// import { companionChangedBy, consumedFlag } from 'atomic';
|
|
26
|
+
//
|
|
27
|
+
// // Denormalized counter: creating a task REQUIRES the team's
|
|
28
|
+
// // taskCount to have been incremented in the same batch:
|
|
29
|
+
// match /teams/{teamId}/tasks/{taskId} {
|
|
30
|
+
// function teamBefore() {
|
|
31
|
+
// return get(/databases/$(database)/documents/teams/$(teamId)).data;
|
|
32
|
+
// }
|
|
33
|
+
// function teamAfter() {
|
|
34
|
+
// return getAfter(/databases/$(database)/documents/teams/$(teamId)).data;
|
|
35
|
+
// }
|
|
36
|
+
// allow create: if companionChangedBy(teamBefore(), teamAfter(), 'taskCount', 1);
|
|
37
|
+
// }
|
|
38
|
+
//
|
|
39
|
+
// // Single-use invite: the join is valid only when the invite was
|
|
40
|
+
// // consumed (false -> true) IN THIS BATCH — replays deny because
|
|
41
|
+
// // the pre-batch state is already true:
|
|
42
|
+
// allow update: if consumedFlag(inviteBefore(), inviteAfter(), 'used');
|
|
43
|
+
//
|
|
44
|
+
// NOTE (simulator): in-batch companion semantics cannot be expressed
|
|
45
|
+
// in the simulator or the Rules Test API mock surface — the simulator
|
|
46
|
+
// treats cross-doc getAfter() as get(). These function BODIES are
|
|
47
|
+
// simulator-tested with explicit values; the getAfter() WIRING is the
|
|
48
|
+
// live v1 scope's job. Companion writes need their own allow rules too —
|
|
49
|
+
// every write in a batch is evaluated.
|
|
50
|
+
|
|
51
|
+
// The companion doc's field changed by EXACTLY n in this batch.
|
|
52
|
+
// before/after are the SAME doc's get()/getAfter() data.
|
|
53
|
+
export function companionChangedBy(before, after, field, n) {
|
|
54
|
+
return after[field] == before[field] + n;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// A single-use flag was consumed IN THIS BATCH: pre-batch false,
|
|
58
|
+
// post-batch true. Replays deny (pre-batch is already true), and a
|
|
59
|
+
// solo write denies (getAfter == get, so false != true).
|
|
60
|
+
export function consumedFlag(before, after, flagField) {
|
|
61
|
+
return before[flagField] == false && after[flagField] == true;
|
|
62
|
+
}
|
|
63
|
+
`,
|
|
64
|
+
auth: `export function isAuthenticated() {
|
|
65
|
+
return request.auth != null;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function isOwner(userId) {
|
|
69
|
+
return isAuthenticated() && request.auth.uid == userId;
|
|
70
|
+
}
|
|
71
|
+
`,
|
|
72
|
+
content: `// Content module for author-owned documents — the most common
|
|
73
|
+
// Firebase app shape (posts, notes, docs, comments, tasks).
|
|
74
|
+
//
|
|
75
|
+
// Convention: documents carry an author field (a UID string) and
|
|
76
|
+
// usually a status field ('draft' | 'published' | ...). Field names
|
|
77
|
+
// are parameters, not conventions — pass yours.
|
|
78
|
+
//
|
|
79
|
+
// Usage:
|
|
80
|
+
// import { validAuthorCreate, isAuthor, canReadContent, notDeleted } from 'content';
|
|
81
|
+
// import { onlyFieldsChanged } from 'lifecycle';
|
|
82
|
+
//
|
|
83
|
+
// match /posts/{postId} {
|
|
84
|
+
// // Create: author is the signed-in user.
|
|
85
|
+
// allow create: if validAuthorCreate('author');
|
|
86
|
+
// // Read: published to everyone, drafts to the author only.
|
|
87
|
+
// allow read: if canReadContent('status', 'author') && notDeleted();
|
|
88
|
+
// // Update: author edits content fields; authorship immutable.
|
|
89
|
+
// allow update: if isAuthor('author') && onlyFieldsChanged(['title', 'body', 'status']);
|
|
90
|
+
// allow delete: if isAuthor('author');
|
|
91
|
+
// }
|
|
92
|
+
|
|
93
|
+
// Create guard: signed in, and the incoming doc's author field is the
|
|
94
|
+
// caller. Use on \`create\` (reads request.resource).
|
|
95
|
+
export function validAuthorCreate(authorField) {
|
|
96
|
+
return request.auth != null
|
|
97
|
+
&& request.resource.data[authorField] == request.auth.uid;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// The caller is the EXISTING document's author. Use on update/delete
|
|
101
|
+
// (reads resource).
|
|
102
|
+
export function isAuthor(authorField) {
|
|
103
|
+
return request.auth != null
|
|
104
|
+
&& resource.data[authorField] == request.auth.uid;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Read visibility: published content is public; anything else is
|
|
108
|
+
// visible to its author only. Works for get; for list queries the
|
|
109
|
+
// client must filter (rules are not filters — a bare collection query
|
|
110
|
+
// will be denied unless it proves status == 'published').
|
|
111
|
+
export function canReadContent(statusField, authorField) {
|
|
112
|
+
return resource.data[statusField] == 'published'
|
|
113
|
+
|| (request.auth != null && resource.data[authorField] == request.auth.uid);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Soft-delete guard: the document is not marked deleted. Reads the
|
|
117
|
+
// EXISTING doc; a doc without the field passes — bracket access is
|
|
118
|
+
// the null-on-miss idiom (dotted access of a missing key ERRORS).
|
|
119
|
+
export function notDeleted() {
|
|
120
|
+
return resource.data['deleted'] != true;
|
|
121
|
+
}
|
|
122
|
+
`,
|
|
123
|
+
counters: `// Counters module for denormalized numeric integrity.
|
|
124
|
+
//
|
|
125
|
+
// The recurring shape: a client-maintained count (likes, votes, moves,
|
|
126
|
+
// quantities) that rules must keep honest — it may only change by a
|
|
127
|
+
// known step, or stay within known bounds. Generalizes the
|
|
128
|
+
// state-module's moveIncremented() (hardcoded to moveCount) to any
|
|
129
|
+
// field.
|
|
130
|
+
//
|
|
131
|
+
// Usage:
|
|
132
|
+
// import { incrementedBy, changedBy, boundedNumber } from 'counters';
|
|
133
|
+
//
|
|
134
|
+
// // A like toggle: likeCount moves by exactly ±1:
|
|
135
|
+
// allow update: if changedBy('likeCount', -1, 1);
|
|
136
|
+
//
|
|
137
|
+
// // A move counter: strictly +1 per move:
|
|
138
|
+
// allow update: if incrementedBy('moveCount', 1);
|
|
139
|
+
//
|
|
140
|
+
// // A rating: any write keeps it in [1, 5]:
|
|
141
|
+
// allow write: if boundedNumber('rating', 1, 5);
|
|
142
|
+
|
|
143
|
+
// The field changed by EXACTLY n relative to the existing document.
|
|
144
|
+
// n may be negative (decrement). Update rules only (needs resource).
|
|
145
|
+
export function incrementedBy(field, n) {
|
|
146
|
+
return request.resource.data[field] == resource.data[field] + n;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// The field's delta is within [min, max] (inclusive) — and it is NOT
|
|
150
|
+
// required to change (delta 0 passes when min <= 0 <= max).
|
|
151
|
+
export function changedBy(field, min, max) {
|
|
152
|
+
return request.resource.data[field] - resource.data[field] >= min
|
|
153
|
+
&& request.resource.data[field] - resource.data[field] <= max;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// The incoming value is a number within [min, max] (inclusive).
|
|
157
|
+
// Works on create and update. Missing field reads null (dynamic
|
|
158
|
+
// access) and fails the type check rather than erroring.
|
|
159
|
+
export function boundedNumber(field, min, max) {
|
|
160
|
+
return (request.resource.data[field] is int || request.resource.data[field] is float)
|
|
161
|
+
&& request.resource.data[field] >= min
|
|
162
|
+
&& request.resource.data[field] <= max;
|
|
163
|
+
}
|
|
164
|
+
`,
|
|
165
|
+
geometry: `// Geometry module for movement game validation via config document lookup.
|
|
166
|
+
//
|
|
167
|
+
// Caller must pass the config document data as an explicit parameter.
|
|
168
|
+
// The config doc is read via get() and cached per request — define a
|
|
169
|
+
// config() function in your rules and pass its result to these functions.
|
|
170
|
+
//
|
|
171
|
+
// Config doc schema:
|
|
172
|
+
// moves[pieceType][fromCell][toCell] = true
|
|
173
|
+
// jumps[pieceType][fromCell][toCell] = capturedCellName
|
|
174
|
+
//
|
|
175
|
+
// Usage:
|
|
176
|
+
// import { validSimpleMove, validJumpMove } from 'geometry';
|
|
177
|
+
//
|
|
178
|
+
// function config() {
|
|
179
|
+
// return get(/databases/$(database)/documents/gameConfig/checkers).data;
|
|
180
|
+
// }
|
|
181
|
+
//
|
|
182
|
+
// allow update: if validSimpleMove(config())
|
|
183
|
+
// && piecePlaced() && moveIntegrity();
|
|
184
|
+
//
|
|
185
|
+
// allow update: if validJumpMove(config())
|
|
186
|
+
// && captureValid() && captureDecrement() && moveIntegrity();
|
|
187
|
+
|
|
188
|
+
// Validate a simple (non-capture) move via config document lookup.
|
|
189
|
+
// Uses 3-level dynamic nesting: cfg.moves[piece][from][to].
|
|
190
|
+
// piece comes from resource.data (pre-write board) so client can't fake it.
|
|
191
|
+
export function validSimpleMove(cfg) {
|
|
192
|
+
let mf = request.resource.data.moveFrom;
|
|
193
|
+
let mt = request.resource.data.moveTo;
|
|
194
|
+
let piece = resource.data[mf];
|
|
195
|
+
return cfg.moves[piece][mf][mt] == true;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Validate a jump (capture) move via config document lookup.
|
|
199
|
+
// cfg.jumps[piece][from][to] returns the expected captured cell name.
|
|
200
|
+
// Caller must separately verify the captured piece is an opponent piece.
|
|
201
|
+
export function validJumpMove(cfg) {
|
|
202
|
+
let mf = request.resource.data.moveFrom;
|
|
203
|
+
let mt = request.resource.data.moveTo;
|
|
204
|
+
let cap = request.resource.data.captured;
|
|
205
|
+
let piece = resource.data[mf];
|
|
206
|
+
return cfg.jumps[piece][mf][mt] == cap;
|
|
207
|
+
}
|
|
208
|
+
`,
|
|
209
|
+
joining: `// Joining module — how membership CHANGES, safely. The connective
|
|
210
|
+
// tissue between content/spaces: spaces gates children behind a
|
|
211
|
+
// members field; joining lets users enter and leave that field
|
|
212
|
+
// WITHOUT an admin backend, with no privilege escalation.
|
|
213
|
+
//
|
|
214
|
+
// Convention: a MAP-shaped members field (uid -> role) on the parent
|
|
215
|
+
// doc. Compose with lifecycle's onlyFieldsChanged so a join/leave
|
|
216
|
+
// write can't touch anything else:
|
|
217
|
+
//
|
|
218
|
+
// import { onlyAddedSelf, onlyRemovedSelf } from 'joining';
|
|
219
|
+
// import { onlyFieldsChanged } from 'lifecycle';
|
|
220
|
+
// import { isSpaceMember, hasSpaceRole } from 'spaces';
|
|
221
|
+
//
|
|
222
|
+
// match /teams/{teamId} {
|
|
223
|
+
// allow read: if isSpaceMember(resource.data);
|
|
224
|
+
//
|
|
225
|
+
// // Open self-service join (public team) at a fixed role, and
|
|
226
|
+
// // self-service leave — nothing else about the doc may change:
|
|
227
|
+
// allow update: if onlyFieldsChanged(['members'])
|
|
228
|
+
// && (onlyAddedSelf('members', 'editor') || onlyRemovedSelf('members'));
|
|
229
|
+
// // Admins manage the doc freely:
|
|
230
|
+
// allow update: if hasSpaceRole(resource.data, 'admin');
|
|
231
|
+
// }
|
|
232
|
+
//
|
|
233
|
+
// Every guarantee here is production-verified against the live Rules Test API:
|
|
234
|
+
// the field-level map diff is reliable; the empty no-op diff DENIES (set
|
|
235
|
+
// equality, not hasOnly — hasOnly on an empty set passes); role escalation via
|
|
236
|
+
// CHANGING an existing entry denies; adding or removing anyone else denies.
|
|
237
|
+
|
|
238
|
+
// The write adds EXACTLY the caller to the members map, at EXACTLY
|
|
239
|
+
// \`role\`, changing and removing nobody. Update rules only.
|
|
240
|
+
export function onlyAddedSelf(membersField, role) {
|
|
241
|
+
let diff = request.resource.data[membersField].diff(resource.data[membersField]);
|
|
242
|
+
return request.auth != null
|
|
243
|
+
&& diff.addedKeys() == [request.auth.uid].toSet()
|
|
244
|
+
&& diff.changedKeys().size() == 0
|
|
245
|
+
&& diff.removedKeys().size() == 0
|
|
246
|
+
&& request.resource.data[membersField][request.auth.uid] == role;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// The write removes EXACTLY the caller from the members map, adding
|
|
250
|
+
// and changing nobody. Self-service leave. Update rules only.
|
|
251
|
+
export function onlyRemovedSelf(membersField) {
|
|
252
|
+
let diff = request.resource.data[membersField].diff(resource.data[membersField]);
|
|
253
|
+
return request.auth != null
|
|
254
|
+
&& diff.removedKeys() == [request.auth.uid].toSet()
|
|
255
|
+
&& diff.addedKeys().size() == 0
|
|
256
|
+
&& diff.changedKeys().size() == 0;
|
|
257
|
+
}
|
|
258
|
+
`,
|
|
259
|
+
lifecycle: `// Lifecycle module for field immutability and timestamp enforcement.
|
|
260
|
+
//
|
|
261
|
+
// Common pattern: certain fields must never change after document creation
|
|
262
|
+
// (createdBy, createdAt, authorId).
|
|
263
|
+
//
|
|
264
|
+
// Usage:
|
|
265
|
+
// import { fieldUnchanged, immutableFields, isServerTimestamp } from 'lifecycle';
|
|
266
|
+
//
|
|
267
|
+
// // Single field:
|
|
268
|
+
// allow update: if fieldUnchanged('createdBy');
|
|
269
|
+
//
|
|
270
|
+
// // Multiple fields (replaces chained fieldUnchanged calls):
|
|
271
|
+
// allow update: if immutableFields(['createdBy', 'createdAt', 'authorId']);
|
|
272
|
+
//
|
|
273
|
+
// // The dual: users may edit title/body but NOTHING else:
|
|
274
|
+
// allow update: if onlyFieldsChanged(['title', 'body']);
|
|
275
|
+
//
|
|
276
|
+
// allow create: if isServerTimestamp('createdAt');
|
|
277
|
+
|
|
278
|
+
// Ensure a field's value is identical between existing and incoming document.
|
|
279
|
+
// Use on update rules to enforce immutability.
|
|
280
|
+
export function fieldUnchanged(field) {
|
|
281
|
+
return resource.data[field] == request.resource.data[field];
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// Ensure multiple fields are unchanged between existing and incoming document.
|
|
285
|
+
// Uses MapDiff — one expression instead of N chained fieldUnchanged() calls.
|
|
286
|
+
export function immutableFields(fields) {
|
|
287
|
+
return request.resource.data.diff(resource.data).unchangedKeys().hasAll(fields);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// Ensure a field is set to the server timestamp.
|
|
291
|
+
// Use on create or update rules to enforce server-side time.
|
|
292
|
+
export function isServerTimestamp(field) {
|
|
293
|
+
return request.resource.data[field] == request.time;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// The dual of immutableFields: every changed field is in the allowed
|
|
297
|
+
// list (fields NOT listed are implicitly immutable). Top-level keys
|
|
298
|
+
// only — nested-map diffs are unreliable in production; flatten the
|
|
299
|
+
// schema instead of reaching for a nested diff.
|
|
300
|
+
export function onlyFieldsChanged(fields) {
|
|
301
|
+
return request.resource.data.diff(resource.data).affectedKeys().hasOnly(fields);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// Exactly n top-level fields changed in this write. n == 1 is the
|
|
305
|
+
// board-integrity / edit-one-field-per-write guard (Pattern 5,
|
|
306
|
+
// generalized beyond games).
|
|
307
|
+
export function nFieldsChanged(n) {
|
|
308
|
+
return request.resource.data.diff(resource.data).affectedKeys().size() == n;
|
|
309
|
+
}
|
|
310
|
+
`,
|
|
311
|
+
lobby: `// Lobby module for 2-participant coordination.
|
|
312
|
+
//
|
|
313
|
+
// Convention: documents must have these fields:
|
|
314
|
+
// host: string (creator's UID)
|
|
315
|
+
// guest: string ('' when waiting, joiner's UID when joined)
|
|
316
|
+
// status: 'waiting' | 'playing' | 'ready' (or any active state)
|
|
317
|
+
//
|
|
318
|
+
// Usage:
|
|
319
|
+
// import { validCreate, validJoin, canCancel } from 'lobby';
|
|
320
|
+
//
|
|
321
|
+
// allow create: if validCreate();
|
|
322
|
+
// allow update: if validJoin();
|
|
323
|
+
// allow delete: if canCancel();
|
|
324
|
+
|
|
325
|
+
// Is this a waiting lobby with an open seat?
|
|
326
|
+
function isWaiting() {
|
|
327
|
+
return resource.data.status == 'waiting'
|
|
328
|
+
&& resource.data.guest == '';
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// Create: caller is host, seat empty, status waiting
|
|
332
|
+
export function validCreate() {
|
|
333
|
+
return request.auth != null
|
|
334
|
+
&& request.resource.data.host == request.auth.uid
|
|
335
|
+
&& request.resource.data.guest == ''
|
|
336
|
+
&& request.resource.data.status == 'waiting';
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// Join: fill empty seat, transition to next status, no self-join
|
|
340
|
+
export function validJoin() {
|
|
341
|
+
return request.auth != null
|
|
342
|
+
&& isWaiting()
|
|
343
|
+
&& request.resource.data.guest == request.auth.uid
|
|
344
|
+
&& request.auth.uid != resource.data.host
|
|
345
|
+
&& request.resource.data.status == 'playing'
|
|
346
|
+
&& request.resource.data.host == resource.data.host;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// Cancel: only host, only while waiting
|
|
350
|
+
export function canCancel() {
|
|
351
|
+
return request.auth != null
|
|
352
|
+
&& resource.data.status == 'waiting'
|
|
353
|
+
&& request.auth.uid == resource.data.host;
|
|
354
|
+
}
|
|
355
|
+
`,
|
|
356
|
+
membership: `// Membership module for role-based and claims-based access control.
|
|
357
|
+
//
|
|
358
|
+
// Two access patterns:
|
|
359
|
+
// 1. Custom claims on auth token (0 get() calls, set server-side)
|
|
360
|
+
// 2. Member maps on documents (0 get() calls on the doc itself)
|
|
361
|
+
//
|
|
362
|
+
// Usage:
|
|
363
|
+
// import { hasClaim, hasClaimRole, isMemberOf, hasRole } from 'membership';
|
|
364
|
+
//
|
|
365
|
+
// // Workspace access via custom claims
|
|
366
|
+
// allow read: if hasClaim('workspace_id');
|
|
367
|
+
// allow write: if hasClaimRole('workspace_role', 'admin');
|
|
368
|
+
//
|
|
369
|
+
// // Project access via member map on document
|
|
370
|
+
// allow read: if isMemberOf(resource.data.members);
|
|
371
|
+
// allow update: if hasRole(resource.data.members, 'admin');
|
|
372
|
+
|
|
373
|
+
// Check if the auth token has a non-null value for a claim key.
|
|
374
|
+
export function hasClaim(claim) {
|
|
375
|
+
return request.auth != null
|
|
376
|
+
&& request.auth.token[claim] != null;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// Check if the auth token has a specific value for a claim key.
|
|
380
|
+
export function hasClaimRole(claim, role) {
|
|
381
|
+
return request.auth != null
|
|
382
|
+
&& request.auth.token[claim] == role;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
// Check if the caller's UID exists as a key in a members map.
|
|
386
|
+
export function isMemberOf(membersMap) {
|
|
387
|
+
return request.auth != null
|
|
388
|
+
&& request.auth.uid in membersMap;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
// Check if the caller has a specific role in a members map.
|
|
392
|
+
export function hasRole(membersMap, role) {
|
|
393
|
+
return request.auth != null
|
|
394
|
+
&& membersMap[request.auth.uid] == role;
|
|
395
|
+
}
|
|
396
|
+
`,
|
|
397
|
+
spaces: `// Spaces module — cross-document membership gating for shared spaces
|
|
398
|
+
// (teams, rooms, groups, projects, parties). The second-most-common
|
|
399
|
+
// app shape after author-owned content: a PARENT document defines who
|
|
400
|
+
// may touch its children.
|
|
401
|
+
//
|
|
402
|
+
// Explicit-param design (like geometry): the caller reads the parent
|
|
403
|
+
// doc ONCE via a helper and passes its data in. Define the helper in
|
|
404
|
+
// your rules — get() is cached per request, so every function below
|
|
405
|
+
// can share one read (of the 10-get budget):
|
|
406
|
+
//
|
|
407
|
+
// import { isSpaceMember, hasSpaceRole, validMemberCreate } from 'spaces';
|
|
408
|
+
//
|
|
409
|
+
// match /spaces/{spaceId}/tasks/{taskId} {
|
|
410
|
+
// function space() {
|
|
411
|
+
// return get(/databases/$(database)/documents/spaces/$(spaceId)).data;
|
|
412
|
+
// }
|
|
413
|
+
// allow read: if isSpaceMember(space());
|
|
414
|
+
// allow create: if validMemberCreate(space(), 'author');
|
|
415
|
+
// allow delete: if hasSpaceRole(space(), 'admin');
|
|
416
|
+
// }
|
|
417
|
+
//
|
|
418
|
+
// Members field shapes verified against the production engine:
|
|
419
|
+
// list: members: ['uidA', 'uidB'] → isSpaceMember only
|
|
420
|
+
// map: members: { uidA: 'admin', ... } → isSpaceMember + hasSpaceRole
|
|
421
|
+
// A missing members field, a non-member uid, or a missing parent doc
|
|
422
|
+
// (get() of a missing doc errors) all fail CLOSED.
|
|
423
|
+
|
|
424
|
+
// The caller is in the space's members field. \`in\` covers both
|
|
425
|
+
// shapes: list membership and map keys.
|
|
426
|
+
export function isSpaceMember(spaceData) {
|
|
427
|
+
return request.auth != null && request.auth.uid in spaceData.members;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// The caller's role in a MAP-shaped members field equals \`role\`.
|
|
431
|
+
// List-shaped members carry no roles — this denies on them.
|
|
432
|
+
export function hasSpaceRole(spaceData, role) {
|
|
433
|
+
return request.auth != null && spaceData.members[request.auth.uid] == role;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
// Member-gated authored create: the caller is a member AND the
|
|
437
|
+
// incoming child doc's author field is the caller. The "post a
|
|
438
|
+
// message / add a task" guard.
|
|
439
|
+
export function validMemberCreate(spaceData, authorField) {
|
|
440
|
+
return isSpaceMember(spaceData)
|
|
441
|
+
&& request.resource.data[authorField] == request.auth.uid;
|
|
442
|
+
}
|
|
443
|
+
`,
|
|
444
|
+
state: `// Game state machine helpers.
|
|
445
|
+
//
|
|
446
|
+
// Convention: documents must have these fields:
|
|
447
|
+
// status: 'waiting' | 'playing' | 'won' | 'draw'
|
|
448
|
+
// moveCount: number
|
|
449
|
+
// host: string (UID)
|
|
450
|
+
// guest: string (UID)
|
|
451
|
+
//
|
|
452
|
+
// Usage:
|
|
453
|
+
// import { isPlaying, moveIncremented, participantsUnchanged } from 'state';
|
|
454
|
+
//
|
|
455
|
+
// allow update: if isPlaying() && moveIncremented() && participantsUnchanged();
|
|
456
|
+
|
|
457
|
+
// Is the game actively in play?
|
|
458
|
+
export function isPlaying() {
|
|
459
|
+
return resource.data.status == 'playing';
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
// Did moveCount increment by exactly 1?
|
|
463
|
+
export function moveIncremented() {
|
|
464
|
+
return request.resource.data.moveCount == resource.data.moveCount + 1;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
// Are host and guest unchanged? (prevents mid-game identity swap)
|
|
468
|
+
export function participantsUnchanged() {
|
|
469
|
+
return request.resource.data.host == resource.data.host
|
|
470
|
+
&& request.resource.data.guest == resource.data.guest;
|
|
471
|
+
}
|
|
472
|
+
`,
|
|
473
|
+
timing: `// Timing module for cooldown / rate-limit enforcement.
|
|
474
|
+
//
|
|
475
|
+
// Rules CAN rate-limit (contrary to a common assumption — jrpg
|
|
476
|
+
// FINDINGS F-004): compare request.time against a stored server
|
|
477
|
+
// timestamp. Pair with lifecycle's isServerTimestamp on the SAME
|
|
478
|
+
// write so the stored timestamp cannot be forged by the client:
|
|
479
|
+
//
|
|
480
|
+
// import { cooldownElapsed } from 'timing';
|
|
481
|
+
// import { isServerTimestamp } from 'lifecycle';
|
|
482
|
+
//
|
|
483
|
+
// // At most one move every 2 seconds:
|
|
484
|
+
// allow update: if cooldownElapsed('lastMoveAt', 2)
|
|
485
|
+
// && isServerTimestamp('lastMoveAt');
|
|
486
|
+
|
|
487
|
+
// The stored timestamp is more than \`seconds\` old (strict). Update
|
|
488
|
+
// rules only — needs \`resource\`. The field must be a Timestamp; a
|
|
489
|
+
// missing field errors, which denies (fail-closed).
|
|
490
|
+
export function cooldownElapsed(field, seconds) {
|
|
491
|
+
return request.time > resource.data[field] + duration.value(seconds, 's');
|
|
492
|
+
}
|
|
493
|
+
`,
|
|
494
|
+
transitions: `// Transitions module for state machine enforcement.
|
|
495
|
+
//
|
|
496
|
+
// Validates that a field transitions from one known value to another.
|
|
497
|
+
// Use to enforce valid status flows (e.g., open -> in_progress -> completed).
|
|
498
|
+
//
|
|
499
|
+
// Usage:
|
|
500
|
+
// import { validTransition, statusIs, newStatusIs } from 'transitions';
|
|
501
|
+
//
|
|
502
|
+
// // Only allow open -> in_progress
|
|
503
|
+
// allow update: if validTransition('status', 'open', 'in_progress');
|
|
504
|
+
//
|
|
505
|
+
// // Allow update only when currently active
|
|
506
|
+
// allow update: if statusIs('status', 'active');
|
|
507
|
+
//
|
|
508
|
+
// // Compound: multiple valid transitions via OR
|
|
509
|
+
// allow update: if validTransition('status', 'open', 'in_progress')
|
|
510
|
+
// || validTransition('status', 'in_progress', 'completed')
|
|
511
|
+
// || validTransition('status', 'completed', 'archived');
|
|
512
|
+
|
|
513
|
+
// Check that a field transitions from one value to another.
|
|
514
|
+
export function validTransition(field, from, to) {
|
|
515
|
+
return resource.data[field] == from
|
|
516
|
+
&& request.resource.data[field] == to;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
// Check the current (existing) value of a field.
|
|
520
|
+
export function statusIs(field, value) {
|
|
521
|
+
return resource.data[field] == value;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
// Check the incoming (new) value of a field.
|
|
525
|
+
export function newStatusIs(field, value) {
|
|
526
|
+
return request.resource.data[field] == value;
|
|
527
|
+
}
|
|
528
|
+
`,
|
|
529
|
+
turns: `// Turn enforcement for 2-participant games/sessions.
|
|
530
|
+
//
|
|
531
|
+
// Convention: documents must have these fields:
|
|
532
|
+
// host: string (UID)
|
|
533
|
+
// guest: string (UID)
|
|
534
|
+
// currentTurn: 'host' | 'guest'
|
|
535
|
+
//
|
|
536
|
+
// Usage:
|
|
537
|
+
// import { isMyTurn, turnFlipped } from 'turns';
|
|
538
|
+
//
|
|
539
|
+
// allow update: if isMyTurn() && turnFlipped();
|
|
540
|
+
|
|
541
|
+
// Is the caller the participant whose turn it is?
|
|
542
|
+
export function isMyTurn() {
|
|
543
|
+
return (resource.data.currentTurn == 'host'
|
|
544
|
+
&& request.auth.uid == resource.data.host)
|
|
545
|
+
|| (resource.data.currentTurn == 'guest'
|
|
546
|
+
&& request.auth.uid == resource.data.guest);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
// Did the turn alternate?
|
|
550
|
+
export function turnFlipped() {
|
|
551
|
+
return (resource.data.currentTurn == 'host'
|
|
552
|
+
&& request.resource.data.currentTurn == 'guest')
|
|
553
|
+
|| (resource.data.currentTurn == 'guest'
|
|
554
|
+
&& request.resource.data.currentTurn == 'host');
|
|
555
|
+
}
|
|
556
|
+
`,
|
|
557
|
+
validation: `// Validation module for document field shape and value checks.
|
|
558
|
+
//
|
|
559
|
+
// Usage:
|
|
560
|
+
// import { hasRequired, hasOnly, validString, isOneOf } from 'validation';
|
|
561
|
+
//
|
|
562
|
+
// allow create: if hasRequired(['title', 'status'])
|
|
563
|
+
// && validString('title', 1, 100)
|
|
564
|
+
// && isOneOf('status', ['draft', 'published']);
|
|
565
|
+
|
|
566
|
+
export function hasRequired(fields) {
|
|
567
|
+
return request.resource.data.keys().hasAll(fields);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
export function hasOnly(fields) {
|
|
571
|
+
return request.resource.data.keys().hasOnly(fields);
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
// Incoming field is a string with size in [min, max] (inclusive).
|
|
575
|
+
// Uses dynamic access, so a MISSING field reads as null (not an
|
|
576
|
+
// error) and fails the \`is string\` check — safe on optional fields.
|
|
577
|
+
export function validString(field, min, max) {
|
|
578
|
+
return request.resource.data[field] is string
|
|
579
|
+
&& request.resource.data[field].size() >= min
|
|
580
|
+
&& request.resource.data[field].size() <= max;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
// Enum check: the incoming field value is one of the allowed values.
|
|
584
|
+
// (\`in\` on a list — NOT \`.includes()\`, which does not exist in rules.)
|
|
585
|
+
export function isOneOf(field, values) {
|
|
586
|
+
return request.resource.data[field] in values;
|
|
587
|
+
}
|
|
588
|
+
`,
|
|
589
|
+
};
|
|
590
|
+
//# sourceMappingURL=stdlib-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdlib-content.js","sourceRoot":"","sources":["../../../src/rules/modules/stdlib-content.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDT;IACC,IAAI,EAAE;;;;;;;CAOP;IACC,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDV;IACC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCX;IACC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CX;IACC,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDV;IACC,SAAS,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDZ;IACC,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4CR;IACC,UAAU,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCb;IACC,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CT;IACC,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BR;IACC,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;CAoBT;IACC,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCd;IACC,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BR;IACC,UAAU,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Bb;CACA,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node-only entry point.
|
|
3
|
+
*
|
|
4
|
+
* Anything that imports `node:fs` / `node:path` / `node:url` at
|
|
5
|
+
* module-init lives here, so the browser-facing root entry stays
|
|
6
|
+
* free of Node builtins. Consumers running in Node (admin tools,
|
|
7
|
+
* SDK agent definitions, tests) import from `pyric/rules/node`.
|
|
8
|
+
*
|
|
9
|
+
* Today the only Node-only surface is the modules resolver — it
|
|
10
|
+
* reads stdlib files off disk via `readFileSync`.
|
|
11
|
+
*/
|
|
12
|
+
export { resolveModules, sanitizeModuleName, loadModule, prefixPrivateFunctions, rewriteCalls, } from './modules/resolver.js';
|
|
13
|
+
export type { ResolveResult, ResolveOptions } from './modules/resolver.js';
|
|
14
|
+
export { createFirestoreRulesTools, createFirestoreSimulatorTools, } from './tools.js';
|
|
15
|
+
export type { FirestoreRulesToolDeps, FirestoreSimulatorToolDeps, } from './tools.js';
|
|
16
|
+
export { createFirestoreRulesStdlibTools } from './stdlib-tools.js';
|
|
17
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/rules/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,sBAAsB,EACtB,YAAY,GACb,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAK3E,OAAO,EACL,yBAAyB,EACzB,6BAA6B,GAC9B,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AAKpB,OAAO,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node-only entry point.
|
|
3
|
+
*
|
|
4
|
+
* Anything that imports `node:fs` / `node:path` / `node:url` at
|
|
5
|
+
* module-init lives here, so the browser-facing root entry stays
|
|
6
|
+
* free of Node builtins. Consumers running in Node (admin tools,
|
|
7
|
+
* SDK agent definitions, tests) import from `pyric/rules/node`.
|
|
8
|
+
*
|
|
9
|
+
* Today the only Node-only surface is the modules resolver — it
|
|
10
|
+
* reads stdlib files off disk via `readFileSync`.
|
|
11
|
+
*/
|
|
12
|
+
export { resolveModules, sanitizeModuleName, loadModule, prefixPrivateFunctions, rewriteCalls, } from './modules/resolver.js';
|
|
13
|
+
// Tool factories — `createFirestoreRulesTools` wraps resolver +
|
|
14
|
+
// linter + simulator + test handlers into agent-runtime tools.
|
|
15
|
+
// Lives on /node because the resolver dep is Node-only.
|
|
16
|
+
export { createFirestoreRulesTools, createFirestoreSimulatorTools, } from './tools.js';
|
|
17
|
+
// Stdlib discovery tools — `firestore_rules_stdlib_list` +
|
|
18
|
+
// `firestore_rules_stdlib_get`. Live on /node because the stdlib
|
|
19
|
+
// modules ship as files the resolver loads from disk.
|
|
20
|
+
export { createFirestoreRulesStdlibTools } from './stdlib-tools.js';
|
|
21
|
+
//# sourceMappingURL=node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/rules/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,sBAAsB,EACtB,YAAY,GACb,MAAM,uBAAuB,CAAC;AAG/B,gEAAgE;AAChE,+DAA+D;AAC/D,wDAAwD;AACxD,OAAO,EACL,yBAAyB,EACzB,6BAA6B,GAC9B,MAAM,YAAY,CAAC;AAMpB,2DAA2D;AAC3D,iEAAiE;AACjE,sDAAsD;AACtD,OAAO,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RTDB rules tooling facade.
|
|
3
|
+
*
|
|
4
|
+
* Firestore rules live under `pyric/rules`; this subpath gives
|
|
5
|
+
* Realtime Database rules the same first-class packaging without
|
|
6
|
+
* moving the existing implementation out of `pyric/database`.
|
|
7
|
+
*/
|
|
8
|
+
export type { RtdbHost } from '../database/host.js';
|
|
9
|
+
export { fetchDatabase } from '../database/host.js';
|
|
10
|
+
export { createRtdbRulesTools, type RtdbRulesToolDeps, } from '../database/tools.js';
|
|
11
|
+
export { getRtdbTools } from '../database/resolver.js';
|
|
12
|
+
export { buildRuleExpression, RtdbMapper, } from '../database/mapper.js';
|
|
13
|
+
export { parseExpression } from '../database/grammar/RtdbExprParser.js';
|
|
14
|
+
export { validateExpression } from '../database/grammar/validator.js';
|
|
15
|
+
export { lintExpression } from '../database/grammar/linter.js';
|
|
16
|
+
export { GenerateIRInputSchema, RtdbIRErrorCode, } from '../database/ir/spec.js';
|
|
17
|
+
export type { GenerateIRInput, GenerateIRResult, GenerateIRSpec, } from '../database/ir/spec.js';
|
|
18
|
+
export { GenerateIRHandler } from '../database/ir/handler.js';
|
|
19
|
+
export { SimulationInputSchema, SimulateErrorCode, SimulationResultSchema, } from '../database/simulation/spec.js';
|
|
20
|
+
export type { SimulationInput, SimulationResult, SimulateResult, } from '../database/simulation/spec.js';
|
|
21
|
+
export { SimulateHandler } from '../database/simulation/handler.js';
|
|
22
|
+
export { WriteRulesErrorCode } from '../database/write/spec.js';
|
|
23
|
+
export type { WriteRulesResult, WriteRulesSpec, } from '../database/write/spec.js';
|
|
24
|
+
export { WriteRulesHandler } from '../database/write/handler.js';
|
|
25
|
+
export type { ParsedExpression, ParsedExpression as RtdbExpressionParseResult, RtdbIR, RtdbNode, RtdbRuleExpression, RtdbTools, RuleError, RuleLint, UserAuth, } from '../database/types.js';
|
|
26
|
+
export { expr, all, any, not, deny, always, allow, authenticated, ownPath, ownField, isNew, hasChildren, hasChild, fieldIsString, fieldIsNumber, fieldIsBoolean, fieldEnum, immutable, immutableSelf, rootExists, rootEquals, pathOwnerOnly, fieldOwnerOnly, ownerOrNew, hasRole, isMember, required, transition, dataVal, newDataVal, dataExists, newDataExists, newDataIs, dataParentVal, newDataParentVal, newDataParentExists, eq, neq, gt, lte, AUTH_UID, turnGuard, flip, winCheckHelper, schemaRules, ruleset, defineRtdbRules, } from '../database/constraints/index.js';
|
|
27
|
+
export type { Expr, PathDef, RtdbRulesCheckResult, RtdbRulesDefinition, RtdbRulesDocument, RtdbRulesFinding, RtdbRulesFindingRule, RtdbRulesJson, RtdbRulesSimulationAuth, RtdbRulesSimulationInput, RulesetContext, SchemaRulesResult, Segment, } from '../database/constraints/index.js';
|
|
28
|
+
//# sourceMappingURL=rtdb.d.ts.map
|