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,40 @@
|
|
|
1
|
+
// Membership module for role-based and claims-based access control.
|
|
2
|
+
//
|
|
3
|
+
// Two access patterns:
|
|
4
|
+
// 1. Custom claims on auth token (0 get() calls, set server-side)
|
|
5
|
+
// 2. Member maps on documents (0 get() calls on the doc itself)
|
|
6
|
+
//
|
|
7
|
+
// Usage:
|
|
8
|
+
// import { hasClaim, hasClaimRole, isMemberOf, hasRole } from 'membership';
|
|
9
|
+
//
|
|
10
|
+
// // Workspace access via custom claims
|
|
11
|
+
// allow read: if hasClaim('workspace_id');
|
|
12
|
+
// allow write: if hasClaimRole('workspace_role', 'admin');
|
|
13
|
+
//
|
|
14
|
+
// // Project access via member map on document
|
|
15
|
+
// allow read: if isMemberOf(resource.data.members);
|
|
16
|
+
// allow update: if hasRole(resource.data.members, 'admin');
|
|
17
|
+
|
|
18
|
+
// Check if the auth token has a non-null value for a claim key.
|
|
19
|
+
export function hasClaim(claim) {
|
|
20
|
+
return request.auth != null
|
|
21
|
+
&& request.auth.token[claim] != null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Check if the auth token has a specific value for a claim key.
|
|
25
|
+
export function hasClaimRole(claim, role) {
|
|
26
|
+
return request.auth != null
|
|
27
|
+
&& request.auth.token[claim] == role;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Check if the caller's UID exists as a key in a members map.
|
|
31
|
+
export function isMemberOf(membersMap) {
|
|
32
|
+
return request.auth != null
|
|
33
|
+
&& request.auth.uid in membersMap;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Check if the caller has a specific role in a members map.
|
|
37
|
+
export function hasRole(membersMap, role) {
|
|
38
|
+
return request.auth != null
|
|
39
|
+
&& membersMap[request.auth.uid] == role;
|
|
40
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"description": "hasClaim allows when token has the claim",
|
|
4
|
+
"expectation": "ALLOW",
|
|
5
|
+
"method": "get",
|
|
6
|
+
"path": "test/doc1",
|
|
7
|
+
"auth": { "uid": "user1", "token": { "workspace": true } },
|
|
8
|
+
"wrapFunction": "hasClaim",
|
|
9
|
+
"wrapOperation": "read",
|
|
10
|
+
"wrapCallExpr": "hasClaim('workspace')"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"description": "hasClaim denies when token lacks the claim",
|
|
14
|
+
"expectation": "DENY",
|
|
15
|
+
"method": "get",
|
|
16
|
+
"path": "test/doc1",
|
|
17
|
+
"auth": { "uid": "user1", "token": {} },
|
|
18
|
+
"wrapFunction": "hasClaim",
|
|
19
|
+
"wrapOperation": "read",
|
|
20
|
+
"wrapCallExpr": "hasClaim('workspace')"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"description": "hasClaim denies unauthenticated",
|
|
24
|
+
"expectation": "DENY",
|
|
25
|
+
"method": "get",
|
|
26
|
+
"path": "test/doc1",
|
|
27
|
+
"auth": null,
|
|
28
|
+
"wrapFunction": "hasClaim",
|
|
29
|
+
"wrapOperation": "read",
|
|
30
|
+
"wrapCallExpr": "hasClaim('workspace')"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"description": "hasClaimRole allows when claim matches role",
|
|
34
|
+
"expectation": "ALLOW",
|
|
35
|
+
"method": "get",
|
|
36
|
+
"path": "test/doc1",
|
|
37
|
+
"auth": { "uid": "user1", "token": { "role": "admin" } },
|
|
38
|
+
"wrapFunction": "hasClaimRole",
|
|
39
|
+
"wrapOperation": "read",
|
|
40
|
+
"wrapCallExpr": "hasClaimRole('role', 'admin')"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"description": "hasClaimRole denies when claim has wrong role",
|
|
44
|
+
"expectation": "DENY",
|
|
45
|
+
"method": "get",
|
|
46
|
+
"path": "test/doc1",
|
|
47
|
+
"auth": { "uid": "user1", "token": { "role": "member" } },
|
|
48
|
+
"wrapFunction": "hasClaimRole",
|
|
49
|
+
"wrapOperation": "read",
|
|
50
|
+
"wrapCallExpr": "hasClaimRole('role', 'admin')"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"description": "isMemberOf allows when uid is in members map",
|
|
54
|
+
"expectation": "ALLOW",
|
|
55
|
+
"method": "get",
|
|
56
|
+
"path": "test/doc1",
|
|
57
|
+
"auth": { "uid": "alice" },
|
|
58
|
+
"resource": { "members": { "alice": "editor", "bob": "viewer" } },
|
|
59
|
+
"wrapFunction": "isMemberOf",
|
|
60
|
+
"wrapOperation": "read",
|
|
61
|
+
"wrapCallExpr": "isMemberOf(resource.data.members)"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"description": "isMemberOf denies when uid is not in members map",
|
|
65
|
+
"expectation": "DENY",
|
|
66
|
+
"method": "get",
|
|
67
|
+
"path": "test/doc1",
|
|
68
|
+
"auth": { "uid": "carol" },
|
|
69
|
+
"resource": { "members": { "alice": "editor", "bob": "viewer" } },
|
|
70
|
+
"wrapFunction": "isMemberOf",
|
|
71
|
+
"wrapOperation": "read",
|
|
72
|
+
"wrapCallExpr": "isMemberOf(resource.data.members)"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"description": "hasRole allows when uid has matching role",
|
|
76
|
+
"expectation": "ALLOW",
|
|
77
|
+
"method": "get",
|
|
78
|
+
"path": "test/doc1",
|
|
79
|
+
"auth": { "uid": "alice" },
|
|
80
|
+
"resource": { "members": { "alice": "admin", "bob": "viewer" } },
|
|
81
|
+
"wrapFunction": "hasRole",
|
|
82
|
+
"wrapOperation": "read",
|
|
83
|
+
"wrapCallExpr": "hasRole(resource.data.members, 'admin')"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"description": "hasRole denies when uid has different role",
|
|
87
|
+
"expectation": "DENY",
|
|
88
|
+
"method": "get",
|
|
89
|
+
"path": "test/doc1",
|
|
90
|
+
"auth": { "uid": "bob" },
|
|
91
|
+
"resource": { "members": { "alice": "admin", "bob": "viewer" } },
|
|
92
|
+
"wrapFunction": "hasRole",
|
|
93
|
+
"wrapOperation": "read",
|
|
94
|
+
"wrapCallExpr": "hasRole(resource.data.members, 'admin')"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"description": "hasRole denies unauthenticated",
|
|
98
|
+
"expectation": "DENY",
|
|
99
|
+
"method": "get",
|
|
100
|
+
"path": "test/doc1",
|
|
101
|
+
"auth": null,
|
|
102
|
+
"resource": { "members": { "alice": "admin" } },
|
|
103
|
+
"wrapFunction": "hasRole",
|
|
104
|
+
"wrapOperation": "read",
|
|
105
|
+
"wrapCallExpr": "hasRole(resource.data.members, 'admin')"
|
|
106
|
+
}
|
|
107
|
+
]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Spaces module — cross-document membership gating for shared spaces
|
|
2
|
+
// (teams, rooms, groups, projects, parties). The second-most-common
|
|
3
|
+
// app shape after author-owned content: a PARENT document defines who
|
|
4
|
+
// may touch its children.
|
|
5
|
+
//
|
|
6
|
+
// Explicit-param design (like geometry): the caller reads the parent
|
|
7
|
+
// doc ONCE via a helper and passes its data in. Define the helper in
|
|
8
|
+
// your rules — get() is cached per request, so every function below
|
|
9
|
+
// can share one read (of the 10-get budget):
|
|
10
|
+
//
|
|
11
|
+
// import { isSpaceMember, hasSpaceRole, validMemberCreate } from 'spaces';
|
|
12
|
+
//
|
|
13
|
+
// match /spaces/{spaceId}/tasks/{taskId} {
|
|
14
|
+
// function space() {
|
|
15
|
+
// return get(/databases/$(database)/documents/spaces/$(spaceId)).data;
|
|
16
|
+
// }
|
|
17
|
+
// allow read: if isSpaceMember(space());
|
|
18
|
+
// allow create: if validMemberCreate(space(), 'author');
|
|
19
|
+
// allow delete: if hasSpaceRole(space(), 'admin');
|
|
20
|
+
// }
|
|
21
|
+
//
|
|
22
|
+
// Members field shapes verified against the production engine:
|
|
23
|
+
// list: members: ['uidA', 'uidB'] → isSpaceMember only
|
|
24
|
+
// map: members: { uidA: 'admin', ... } → isSpaceMember + hasSpaceRole
|
|
25
|
+
// A missing members field, a non-member uid, or a missing parent doc
|
|
26
|
+
// (get() of a missing doc errors) all fail CLOSED.
|
|
27
|
+
|
|
28
|
+
// The caller is in the space's members field. `in` covers both
|
|
29
|
+
// shapes: list membership and map keys.
|
|
30
|
+
export function isSpaceMember(spaceData) {
|
|
31
|
+
return request.auth != null && request.auth.uid in spaceData.members;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// The caller's role in a MAP-shaped members field equals `role`.
|
|
35
|
+
// List-shaped members carry no roles — this denies on them.
|
|
36
|
+
export function hasSpaceRole(spaceData, role) {
|
|
37
|
+
return request.auth != null && spaceData.members[request.auth.uid] == role;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Member-gated authored create: the caller is a member AND the
|
|
41
|
+
// incoming child doc's author field is the caller. The "post a
|
|
42
|
+
// message / add a task" guard.
|
|
43
|
+
export function validMemberCreate(spaceData, authorField) {
|
|
44
|
+
return isSpaceMember(spaceData)
|
|
45
|
+
&& request.resource.data[authorField] == request.auth.uid;
|
|
46
|
+
}
|
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"description": "isSpaceMember allows a list-shaped member",
|
|
4
|
+
"expectation": "ALLOW",
|
|
5
|
+
"method": "get",
|
|
6
|
+
"path": "spaces/s1/tasks/t1",
|
|
7
|
+
"auth": {
|
|
8
|
+
"uid": "alice"
|
|
9
|
+
},
|
|
10
|
+
"wrapFunction": "isSpaceMember",
|
|
11
|
+
"wrapOperation": "get",
|
|
12
|
+
"wrapCallExpr": "isSpaceMember(get(/databases/$(database)/documents/spaces/s1).data)",
|
|
13
|
+
"wrapMatch": "/spaces/{spaceId}/tasks/{taskId}",
|
|
14
|
+
"functionMocks": [
|
|
15
|
+
{
|
|
16
|
+
"function": "get",
|
|
17
|
+
"path": "spaces/s1",
|
|
18
|
+
"result": {
|
|
19
|
+
"members": [
|
|
20
|
+
"alice",
|
|
21
|
+
"bob"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"resource": {
|
|
27
|
+
"title": "x"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"description": "isSpaceMember denies a non-member (list shape)",
|
|
32
|
+
"expectation": "DENY",
|
|
33
|
+
"method": "get",
|
|
34
|
+
"path": "spaces/s1/tasks/t1",
|
|
35
|
+
"auth": {
|
|
36
|
+
"uid": "mallory"
|
|
37
|
+
},
|
|
38
|
+
"wrapFunction": "isSpaceMember",
|
|
39
|
+
"wrapOperation": "get",
|
|
40
|
+
"wrapCallExpr": "isSpaceMember(get(/databases/$(database)/documents/spaces/s1).data)",
|
|
41
|
+
"wrapMatch": "/spaces/{spaceId}/tasks/{taskId}",
|
|
42
|
+
"functionMocks": [
|
|
43
|
+
{
|
|
44
|
+
"function": "get",
|
|
45
|
+
"path": "spaces/s1",
|
|
46
|
+
"result": {
|
|
47
|
+
"members": [
|
|
48
|
+
"alice",
|
|
49
|
+
"bob"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"resource": {
|
|
55
|
+
"title": "x"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"description": "isSpaceMember allows a map-shaped member",
|
|
60
|
+
"expectation": "ALLOW",
|
|
61
|
+
"method": "get",
|
|
62
|
+
"path": "spaces/s1/tasks/t1",
|
|
63
|
+
"auth": {
|
|
64
|
+
"uid": "alice"
|
|
65
|
+
},
|
|
66
|
+
"wrapFunction": "isSpaceMember",
|
|
67
|
+
"wrapOperation": "get",
|
|
68
|
+
"wrapCallExpr": "isSpaceMember(get(/databases/$(database)/documents/spaces/s1).data)",
|
|
69
|
+
"wrapMatch": "/spaces/{spaceId}/tasks/{taskId}",
|
|
70
|
+
"functionMocks": [
|
|
71
|
+
{
|
|
72
|
+
"function": "get",
|
|
73
|
+
"path": "spaces/s1",
|
|
74
|
+
"result": {
|
|
75
|
+
"members": {
|
|
76
|
+
"alice": "admin",
|
|
77
|
+
"bob": "viewer"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
"resource": {
|
|
83
|
+
"title": "x"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"description": "isSpaceMember denies a non-member (map shape)",
|
|
88
|
+
"expectation": "DENY",
|
|
89
|
+
"method": "get",
|
|
90
|
+
"path": "spaces/s1/tasks/t1",
|
|
91
|
+
"auth": {
|
|
92
|
+
"uid": "mallory"
|
|
93
|
+
},
|
|
94
|
+
"wrapFunction": "isSpaceMember",
|
|
95
|
+
"wrapOperation": "get",
|
|
96
|
+
"wrapCallExpr": "isSpaceMember(get(/databases/$(database)/documents/spaces/s1).data)",
|
|
97
|
+
"wrapMatch": "/spaces/{spaceId}/tasks/{taskId}",
|
|
98
|
+
"functionMocks": [
|
|
99
|
+
{
|
|
100
|
+
"function": "get",
|
|
101
|
+
"path": "spaces/s1",
|
|
102
|
+
"result": {
|
|
103
|
+
"members": {
|
|
104
|
+
"alice": "admin",
|
|
105
|
+
"bob": "viewer"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"resource": {
|
|
111
|
+
"title": "x"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"description": "isSpaceMember denies unauthenticated",
|
|
116
|
+
"expectation": "DENY",
|
|
117
|
+
"method": "get",
|
|
118
|
+
"path": "spaces/s1/tasks/t1",
|
|
119
|
+
"auth": null,
|
|
120
|
+
"wrapFunction": "isSpaceMember",
|
|
121
|
+
"wrapOperation": "get",
|
|
122
|
+
"wrapCallExpr": "isSpaceMember(get(/databases/$(database)/documents/spaces/s1).data)",
|
|
123
|
+
"wrapMatch": "/spaces/{spaceId}/tasks/{taskId}",
|
|
124
|
+
"functionMocks": [
|
|
125
|
+
{
|
|
126
|
+
"function": "get",
|
|
127
|
+
"path": "spaces/s1",
|
|
128
|
+
"result": {
|
|
129
|
+
"members": [
|
|
130
|
+
"alice",
|
|
131
|
+
"bob"
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
"resource": {
|
|
137
|
+
"title": "x"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"description": "isSpaceMember denies when the members field is missing (fail-closed)",
|
|
142
|
+
"expectation": "DENY",
|
|
143
|
+
"method": "get",
|
|
144
|
+
"path": "spaces/s1/tasks/t1",
|
|
145
|
+
"auth": {
|
|
146
|
+
"uid": "alice"
|
|
147
|
+
},
|
|
148
|
+
"wrapFunction": "isSpaceMember",
|
|
149
|
+
"wrapOperation": "get",
|
|
150
|
+
"wrapCallExpr": "isSpaceMember(get(/databases/$(database)/documents/spaces/s1).data)",
|
|
151
|
+
"wrapMatch": "/spaces/{spaceId}/tasks/{taskId}",
|
|
152
|
+
"functionMocks": [
|
|
153
|
+
{
|
|
154
|
+
"function": "get",
|
|
155
|
+
"path": "spaces/s1",
|
|
156
|
+
"result": {
|
|
157
|
+
"name": "no-members"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"resource": {
|
|
162
|
+
"title": "x"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"description": "hasSpaceRole allows the matching role",
|
|
167
|
+
"expectation": "ALLOW",
|
|
168
|
+
"method": "create",
|
|
169
|
+
"path": "spaces/s1/tasks/t1",
|
|
170
|
+
"auth": {
|
|
171
|
+
"uid": "alice"
|
|
172
|
+
},
|
|
173
|
+
"wrapFunction": "hasSpaceRole",
|
|
174
|
+
"wrapOperation": "create",
|
|
175
|
+
"wrapCallExpr": "hasSpaceRole(get(/databases/$(database)/documents/spaces/s1).data, 'admin')",
|
|
176
|
+
"wrapMatch": "/spaces/{spaceId}/tasks/{taskId}",
|
|
177
|
+
"functionMocks": [
|
|
178
|
+
{
|
|
179
|
+
"function": "get",
|
|
180
|
+
"path": "spaces/s1",
|
|
181
|
+
"result": {
|
|
182
|
+
"members": {
|
|
183
|
+
"alice": "admin",
|
|
184
|
+
"bob": "viewer"
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"data": {
|
|
190
|
+
"title": "x"
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"description": "hasSpaceRole denies a different role",
|
|
195
|
+
"expectation": "DENY",
|
|
196
|
+
"method": "create",
|
|
197
|
+
"path": "spaces/s1/tasks/t1",
|
|
198
|
+
"auth": {
|
|
199
|
+
"uid": "bob"
|
|
200
|
+
},
|
|
201
|
+
"wrapFunction": "hasSpaceRole",
|
|
202
|
+
"wrapOperation": "create",
|
|
203
|
+
"wrapCallExpr": "hasSpaceRole(get(/databases/$(database)/documents/spaces/s1).data, 'admin')",
|
|
204
|
+
"wrapMatch": "/spaces/{spaceId}/tasks/{taskId}",
|
|
205
|
+
"functionMocks": [
|
|
206
|
+
{
|
|
207
|
+
"function": "get",
|
|
208
|
+
"path": "spaces/s1",
|
|
209
|
+
"result": {
|
|
210
|
+
"members": {
|
|
211
|
+
"alice": "admin",
|
|
212
|
+
"bob": "viewer"
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
],
|
|
217
|
+
"data": {
|
|
218
|
+
"title": "x"
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"description": "hasSpaceRole denies a non-member",
|
|
223
|
+
"expectation": "DENY",
|
|
224
|
+
"method": "create",
|
|
225
|
+
"path": "spaces/s1/tasks/t1",
|
|
226
|
+
"auth": {
|
|
227
|
+
"uid": "mallory"
|
|
228
|
+
},
|
|
229
|
+
"wrapFunction": "hasSpaceRole",
|
|
230
|
+
"wrapOperation": "create",
|
|
231
|
+
"wrapCallExpr": "hasSpaceRole(get(/databases/$(database)/documents/spaces/s1).data, 'admin')",
|
|
232
|
+
"wrapMatch": "/spaces/{spaceId}/tasks/{taskId}",
|
|
233
|
+
"functionMocks": [
|
|
234
|
+
{
|
|
235
|
+
"function": "get",
|
|
236
|
+
"path": "spaces/s1",
|
|
237
|
+
"result": {
|
|
238
|
+
"members": {
|
|
239
|
+
"alice": "admin",
|
|
240
|
+
"bob": "viewer"
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
],
|
|
245
|
+
"data": {
|
|
246
|
+
"title": "x"
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"description": "hasSpaceRole denies on a list-shaped members field (no roles)",
|
|
251
|
+
"expectation": "DENY",
|
|
252
|
+
"method": "create",
|
|
253
|
+
"path": "spaces/s1/tasks/t1",
|
|
254
|
+
"auth": {
|
|
255
|
+
"uid": "alice"
|
|
256
|
+
},
|
|
257
|
+
"wrapFunction": "hasSpaceRole",
|
|
258
|
+
"wrapOperation": "create",
|
|
259
|
+
"wrapCallExpr": "hasSpaceRole(get(/databases/$(database)/documents/spaces/s1).data, 'admin')",
|
|
260
|
+
"wrapMatch": "/spaces/{spaceId}/tasks/{taskId}",
|
|
261
|
+
"functionMocks": [
|
|
262
|
+
{
|
|
263
|
+
"function": "get",
|
|
264
|
+
"path": "spaces/s1",
|
|
265
|
+
"result": {
|
|
266
|
+
"members": [
|
|
267
|
+
"alice",
|
|
268
|
+
"bob"
|
|
269
|
+
]
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
],
|
|
273
|
+
"data": {
|
|
274
|
+
"title": "x"
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"description": "validMemberCreate allows a member creating an author-stamped doc",
|
|
279
|
+
"expectation": "ALLOW",
|
|
280
|
+
"method": "create",
|
|
281
|
+
"path": "spaces/s1/tasks/t1",
|
|
282
|
+
"auth": {
|
|
283
|
+
"uid": "alice"
|
|
284
|
+
},
|
|
285
|
+
"wrapFunction": "validMemberCreate",
|
|
286
|
+
"wrapOperation": "create",
|
|
287
|
+
"wrapCallExpr": "validMemberCreate(get(/databases/$(database)/documents/spaces/s1).data, 'author')",
|
|
288
|
+
"wrapMatch": "/spaces/{spaceId}/tasks/{taskId}",
|
|
289
|
+
"functionMocks": [
|
|
290
|
+
{
|
|
291
|
+
"function": "get",
|
|
292
|
+
"path": "spaces/s1",
|
|
293
|
+
"result": {
|
|
294
|
+
"members": [
|
|
295
|
+
"alice",
|
|
296
|
+
"bob"
|
|
297
|
+
]
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
],
|
|
301
|
+
"data": {
|
|
302
|
+
"title": "x",
|
|
303
|
+
"author": "alice"
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"description": "validMemberCreate denies a member stamping someone else as author",
|
|
308
|
+
"expectation": "DENY",
|
|
309
|
+
"method": "create",
|
|
310
|
+
"path": "spaces/s1/tasks/t1",
|
|
311
|
+
"auth": {
|
|
312
|
+
"uid": "alice"
|
|
313
|
+
},
|
|
314
|
+
"wrapFunction": "validMemberCreate",
|
|
315
|
+
"wrapOperation": "create",
|
|
316
|
+
"wrapCallExpr": "validMemberCreate(get(/databases/$(database)/documents/spaces/s1).data, 'author')",
|
|
317
|
+
"wrapMatch": "/spaces/{spaceId}/tasks/{taskId}",
|
|
318
|
+
"functionMocks": [
|
|
319
|
+
{
|
|
320
|
+
"function": "get",
|
|
321
|
+
"path": "spaces/s1",
|
|
322
|
+
"result": {
|
|
323
|
+
"members": [
|
|
324
|
+
"alice",
|
|
325
|
+
"bob"
|
|
326
|
+
]
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
],
|
|
330
|
+
"data": {
|
|
331
|
+
"title": "x",
|
|
332
|
+
"author": "bob"
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"description": "validMemberCreate denies a non-member",
|
|
337
|
+
"expectation": "DENY",
|
|
338
|
+
"method": "create",
|
|
339
|
+
"path": "spaces/s1/tasks/t1",
|
|
340
|
+
"auth": {
|
|
341
|
+
"uid": "mallory"
|
|
342
|
+
},
|
|
343
|
+
"wrapFunction": "validMemberCreate",
|
|
344
|
+
"wrapOperation": "create",
|
|
345
|
+
"wrapCallExpr": "validMemberCreate(get(/databases/$(database)/documents/spaces/s1).data, 'author')",
|
|
346
|
+
"wrapMatch": "/spaces/{spaceId}/tasks/{taskId}",
|
|
347
|
+
"functionMocks": [
|
|
348
|
+
{
|
|
349
|
+
"function": "get",
|
|
350
|
+
"path": "spaces/s1",
|
|
351
|
+
"result": {
|
|
352
|
+
"members": [
|
|
353
|
+
"alice",
|
|
354
|
+
"bob"
|
|
355
|
+
]
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
],
|
|
359
|
+
"data": {
|
|
360
|
+
"title": "x",
|
|
361
|
+
"author": "mallory"
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"description": "validMemberCreate denies a missing author field",
|
|
366
|
+
"expectation": "DENY",
|
|
367
|
+
"method": "create",
|
|
368
|
+
"path": "spaces/s1/tasks/t1",
|
|
369
|
+
"auth": {
|
|
370
|
+
"uid": "alice"
|
|
371
|
+
},
|
|
372
|
+
"wrapFunction": "validMemberCreate",
|
|
373
|
+
"wrapOperation": "create",
|
|
374
|
+
"wrapCallExpr": "validMemberCreate(get(/databases/$(database)/documents/spaces/s1).data, 'author')",
|
|
375
|
+
"wrapMatch": "/spaces/{spaceId}/tasks/{taskId}",
|
|
376
|
+
"functionMocks": [
|
|
377
|
+
{
|
|
378
|
+
"function": "get",
|
|
379
|
+
"path": "spaces/s1",
|
|
380
|
+
"result": {
|
|
381
|
+
"members": [
|
|
382
|
+
"alice",
|
|
383
|
+
"bob"
|
|
384
|
+
]
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
],
|
|
388
|
+
"data": {
|
|
389
|
+
"title": "x"
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Game state machine helpers.
|
|
2
|
+
//
|
|
3
|
+
// Convention: documents must have these fields:
|
|
4
|
+
// status: 'waiting' | 'playing' | 'won' | 'draw'
|
|
5
|
+
// moveCount: number
|
|
6
|
+
// host: string (UID)
|
|
7
|
+
// guest: string (UID)
|
|
8
|
+
//
|
|
9
|
+
// Usage:
|
|
10
|
+
// import { isPlaying, moveIncremented, participantsUnchanged } from 'state';
|
|
11
|
+
//
|
|
12
|
+
// allow update: if isPlaying() && moveIncremented() && participantsUnchanged();
|
|
13
|
+
|
|
14
|
+
// Is the game actively in play?
|
|
15
|
+
export function isPlaying() {
|
|
16
|
+
return resource.data.status == 'playing';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Did moveCount increment by exactly 1?
|
|
20
|
+
export function moveIncremented() {
|
|
21
|
+
return request.resource.data.moveCount == resource.data.moveCount + 1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Are host and guest unchanged? (prevents mid-game identity swap)
|
|
25
|
+
export function participantsUnchanged() {
|
|
26
|
+
return request.resource.data.host == resource.data.host
|
|
27
|
+
&& request.resource.data.guest == resource.data.guest;
|
|
28
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"description": "isPlaying allows when status is playing",
|
|
4
|
+
"expectation": "ALLOW",
|
|
5
|
+
"method": "update",
|
|
6
|
+
"path": "test/game1",
|
|
7
|
+
"auth": { "uid": "user1" },
|
|
8
|
+
"resource": { "status": "playing" },
|
|
9
|
+
"wrapFunction": "isPlaying",
|
|
10
|
+
"wrapOperation": "update"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"description": "isPlaying denies when status is waiting",
|
|
14
|
+
"expectation": "DENY",
|
|
15
|
+
"method": "update",
|
|
16
|
+
"path": "test/game1",
|
|
17
|
+
"auth": { "uid": "user1" },
|
|
18
|
+
"resource": { "status": "waiting" },
|
|
19
|
+
"wrapFunction": "isPlaying",
|
|
20
|
+
"wrapOperation": "update"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"description": "moveIncremented allows 0 to 1",
|
|
24
|
+
"expectation": "ALLOW",
|
|
25
|
+
"method": "update",
|
|
26
|
+
"path": "test/game1",
|
|
27
|
+
"auth": { "uid": "user1" },
|
|
28
|
+
"data": { "moveCount": 1 },
|
|
29
|
+
"resource": { "moveCount": 0 },
|
|
30
|
+
"wrapFunction": "moveIncremented",
|
|
31
|
+
"wrapOperation": "update"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"description": "moveIncremented denies skip from 0 to 5",
|
|
35
|
+
"expectation": "DENY",
|
|
36
|
+
"method": "update",
|
|
37
|
+
"path": "test/game1",
|
|
38
|
+
"auth": { "uid": "user1" },
|
|
39
|
+
"data": { "moveCount": 5 },
|
|
40
|
+
"resource": { "moveCount": 0 },
|
|
41
|
+
"wrapFunction": "moveIncremented",
|
|
42
|
+
"wrapOperation": "update"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"description": "participantsUnchanged denies when host changes",
|
|
46
|
+
"expectation": "DENY",
|
|
47
|
+
"method": "update",
|
|
48
|
+
"path": "test/game1",
|
|
49
|
+
"auth": { "uid": "user1" },
|
|
50
|
+
"data": { "host": "hijacked", "guest": "guest1" },
|
|
51
|
+
"resource": { "host": "host1", "guest": "guest1" },
|
|
52
|
+
"wrapFunction": "participantsUnchanged",
|
|
53
|
+
"wrapOperation": "update"
|
|
54
|
+
}
|
|
55
|
+
]
|