pyric 0.0.1 → 0.1.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -1
- package/dist/app/index.d.ts +81 -0
- package/dist/app/index.d.ts.map +1 -0
- package/dist/app/index.js +78 -0
- package/dist/app/index.js.map +1 -0
- package/dist/auth/index.d.ts +346 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +701 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/prod-backend.d.ts +39 -0
- package/dist/auth/prod-backend.d.ts.map +1 -0
- package/dist/auth/prod-backend.js +179 -0
- package/dist/auth/prod-backend.js.map +1 -0
- package/dist/auth/providers.d.ts +107 -0
- package/dist/auth/providers.d.ts.map +1 -0
- package/dist/auth/providers.js +138 -0
- package/dist/auth/providers.js.map +1 -0
- package/dist/auth/sandbox-backend.d.ts +769 -0
- package/dist/auth/sandbox-backend.d.ts.map +1 -0
- package/dist/auth/sandbox-backend.js +1598 -0
- package/dist/auth/sandbox-backend.js.map +1 -0
- package/dist/auth/target.d.ts +40 -0
- package/dist/auth/target.d.ts.map +1 -0
- package/dist/auth/target.js +28 -0
- package/dist/auth/target.js.map +1 -0
- package/dist/auth/types.d.ts +252 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +26 -0
- package/dist/auth/types.js.map +1 -0
- package/dist/database/constraints/atoms.d.ts +29 -0
- package/dist/database/constraints/atoms.d.ts.map +1 -0
- package/dist/database/constraints/atoms.js +43 -0
- package/dist/database/constraints/atoms.js.map +1 -0
- package/dist/database/constraints/compose.d.ts +16 -0
- package/dist/database/constraints/compose.d.ts.map +1 -0
- package/dist/database/constraints/compose.js +15 -0
- package/dist/database/constraints/compose.js.map +1 -0
- package/dist/database/constraints/data.d.ts +30 -0
- package/dist/database/constraints/data.d.ts.map +1 -0
- package/dist/database/constraints/data.js +46 -0
- package/dist/database/constraints/data.js.map +1 -0
- package/dist/database/constraints/document.d.ts +42 -0
- package/dist/database/constraints/document.d.ts.map +1 -0
- package/dist/database/constraints/document.js +86 -0
- package/dist/database/constraints/document.js.map +1 -0
- package/dist/database/constraints/game.d.ts +30 -0
- package/dist/database/constraints/game.d.ts.map +1 -0
- package/dist/database/constraints/game.js +49 -0
- package/dist/database/constraints/game.js.map +1 -0
- package/dist/database/constraints/index.d.ts +12 -0
- package/dist/database/constraints/index.d.ts.map +1 -0
- package/dist/database/constraints/index.js +9 -0
- package/dist/database/constraints/index.js.map +1 -0
- package/dist/database/constraints/policies.d.ts +16 -0
- package/dist/database/constraints/policies.d.ts.map +1 -0
- package/dist/database/constraints/policies.js +17 -0
- package/dist/database/constraints/policies.js.map +1 -0
- package/dist/database/constraints/ruleset.d.ts +5 -0
- package/dist/database/constraints/ruleset.d.ts.map +1 -0
- package/dist/database/constraints/ruleset.js +132 -0
- package/dist/database/constraints/ruleset.js.map +1 -0
- package/dist/database/constraints/schema.d.ts +17 -0
- package/dist/database/constraints/schema.d.ts.map +1 -0
- package/dist/database/constraints/schema.js +74 -0
- package/dist/database/constraints/schema.js.map +1 -0
- package/dist/database/constraints/types.d.ts +22 -0
- package/dist/database/constraints/types.d.ts.map +1 -0
- package/dist/database/constraints/types.js +2 -0
- package/dist/database/constraints/types.js.map +1 -0
- package/dist/database/crawl/handler.d.ts +7 -0
- package/dist/database/crawl/handler.d.ts.map +1 -0
- package/dist/database/crawl/handler.js +91 -0
- package/dist/database/crawl/handler.js.map +1 -0
- package/dist/database/crawl/semaphore.d.ts +9 -0
- package/dist/database/crawl/semaphore.d.ts.map +1 -0
- package/dist/database/crawl/semaphore.js +27 -0
- package/dist/database/crawl/semaphore.js.map +1 -0
- package/dist/database/crawl/spec.d.ts +33 -0
- package/dist/database/crawl/spec.d.ts.map +1 -0
- package/dist/database/crawl/spec.js +12 -0
- package/dist/database/crawl/spec.js.map +1 -0
- package/dist/database/data/handler.d.ts +9 -0
- package/dist/database/data/handler.d.ts.map +1 -0
- package/dist/database/data/handler.js +96 -0
- package/dist/database/data/handler.js.map +1 -0
- package/dist/database/data/spec.d.ts +77 -0
- package/dist/database/data/spec.d.ts.map +1 -0
- package/dist/database/data/spec.js +17 -0
- package/dist/database/data/spec.js.map +1 -0
- package/dist/database/data/validated.d.ts +8 -0
- package/dist/database/data/validated.d.ts.map +1 -0
- package/dist/database/data/validated.js +99 -0
- package/dist/database/data/validated.js.map +1 -0
- package/dist/database/grammar/RtdbExpr.ohm +98 -0
- package/dist/database/grammar/RtdbExpr.ohm.generated.d.ts +2 -0
- package/dist/database/grammar/RtdbExpr.ohm.generated.d.ts.map +1 -0
- package/dist/database/grammar/RtdbExpr.ohm.generated.js +103 -0
- package/dist/database/grammar/RtdbExpr.ohm.generated.js.map +1 -0
- package/dist/database/grammar/RtdbExprParser.d.ts +5 -0
- package/dist/database/grammar/RtdbExprParser.d.ts.map +1 -0
- package/dist/database/grammar/RtdbExprParser.js +53 -0
- package/dist/database/grammar/RtdbExprParser.js.map +1 -0
- package/dist/database/grammar/linter.d.ts +3 -0
- package/dist/database/grammar/linter.d.ts.map +1 -0
- package/dist/database/grammar/linter.js +66 -0
- package/dist/database/grammar/linter.js.map +1 -0
- package/dist/database/grammar/simulator.d.ts +31 -0
- package/dist/database/grammar/simulator.d.ts.map +1 -0
- package/dist/database/grammar/simulator.js +255 -0
- package/dist/database/grammar/simulator.js.map +1 -0
- package/dist/database/grammar/validator.d.ts +3 -0
- package/dist/database/grammar/validator.d.ts.map +1 -0
- package/dist/database/grammar/validator.js +84 -0
- package/dist/database/grammar/validator.js.map +1 -0
- package/dist/database/host.d.ts +50 -0
- package/dist/database/host.d.ts.map +1 -0
- package/dist/database/host.js +41 -0
- package/dist/database/host.js.map +1 -0
- package/dist/database/index.d.ts +40 -0
- package/dist/database/index.d.ts.map +1 -0
- package/dist/database/index.js +47 -0
- package/dist/database/index.js.map +1 -0
- package/dist/database/initialize-from-app.d.ts +28 -0
- package/dist/database/initialize-from-app.d.ts.map +1 -0
- package/dist/database/initialize-from-app.js +23 -0
- package/dist/database/initialize-from-app.js.map +1 -0
- package/dist/database/ir/handler.d.ts +6 -0
- package/dist/database/ir/handler.d.ts.map +1 -0
- package/dist/database/ir/handler.js +52 -0
- package/dist/database/ir/handler.js.map +1 -0
- package/dist/database/ir/spec.d.ts +25 -0
- package/dist/database/ir/spec.d.ts.map +1 -0
- package/dist/database/ir/spec.js +11 -0
- package/dist/database/ir/spec.js.map +1 -0
- package/dist/database/mapper.d.ts +9 -0
- package/dist/database/mapper.d.ts.map +1 -0
- package/dist/database/mapper.js +115 -0
- package/dist/database/mapper.js.map +1 -0
- package/dist/database/modular.d.ts +604 -0
- package/dist/database/modular.d.ts.map +1 -0
- package/dist/database/modular.js +1226 -0
- package/dist/database/modular.js.map +1 -0
- package/dist/database/replay.d.ts +33 -0
- package/dist/database/replay.d.ts.map +1 -0
- package/dist/database/replay.js +124 -0
- package/dist/database/replay.js.map +1 -0
- package/dist/database/resolver.d.ts +4 -0
- package/dist/database/resolver.d.ts.map +1 -0
- package/dist/database/resolver.js +66 -0
- package/dist/database/resolver.js.map +1 -0
- package/dist/database/sandbox/backend.d.ts +403 -0
- package/dist/database/sandbox/backend.d.ts.map +1 -0
- package/dist/database/sandbox/backend.js +1467 -0
- package/dist/database/sandbox/backend.js.map +1 -0
- package/dist/database/sandbox/data-tree.d.ts +123 -0
- package/dist/database/sandbox/data-tree.d.ts.map +1 -0
- package/dist/database/sandbox/data-tree.js +310 -0
- package/dist/database/sandbox/data-tree.js.map +1 -0
- package/dist/database/sandbox/normalize.d.ts +77 -0
- package/dist/database/sandbox/normalize.d.ts.map +1 -0
- package/dist/database/sandbox/normalize.js +165 -0
- package/dist/database/sandbox/normalize.js.map +1 -0
- package/dist/database/sandbox/push-id.d.ts +32 -0
- package/dist/database/sandbox/push-id.d.ts.map +1 -0
- package/dist/database/sandbox/push-id.js +82 -0
- package/dist/database/sandbox/push-id.js.map +1 -0
- package/dist/database/sandbox/query.d.ts +175 -0
- package/dist/database/sandbox/query.d.ts.map +1 -0
- package/dist/database/sandbox/query.js +269 -0
- package/dist/database/sandbox/query.js.map +1 -0
- package/dist/database/sandbox/rules-eval.d.ts +69 -0
- package/dist/database/sandbox/rules-eval.d.ts.map +1 -0
- package/dist/database/sandbox/rules-eval.js +124 -0
- package/dist/database/sandbox/rules-eval.js.map +1 -0
- package/dist/database/sandbox/sentinels.d.ts +71 -0
- package/dist/database/sandbox/sentinels.d.ts.map +1 -0
- package/dist/database/sandbox/sentinels.js +92 -0
- package/dist/database/sandbox/sentinels.js.map +1 -0
- package/dist/database/simulation/handler.d.ts +6 -0
- package/dist/database/simulation/handler.d.ts.map +1 -0
- package/dist/database/simulation/handler.js +236 -0
- package/dist/database/simulation/handler.js.map +1 -0
- package/dist/database/simulation/spec.d.ts +69 -0
- package/dist/database/simulation/spec.d.ts.map +1 -0
- package/dist/database/simulation/spec.js +25 -0
- package/dist/database/simulation/spec.js.map +1 -0
- package/dist/database/tools.d.ts +22 -0
- package/dist/database/tools.d.ts.map +1 -0
- package/dist/database/tools.js +272 -0
- package/dist/database/tools.js.map +1 -0
- package/dist/database/types.d.ts +210 -0
- package/dist/database/types.d.ts.map +1 -0
- package/dist/database/types.js +26 -0
- package/dist/database/types.js.map +1 -0
- package/dist/database/write/handler.d.ts +7 -0
- package/dist/database/write/handler.d.ts.map +1 -0
- package/dist/database/write/handler.js +42 -0
- package/dist/database/write/handler.js.map +1 -0
- package/dist/database/write/spec.d.ts +18 -0
- package/dist/database/write/spec.d.ts.map +1 -0
- package/dist/database/write/spec.js +7 -0
- package/dist/database/write/spec.js.map +1 -0
- package/dist/firestore/index.d.ts +533 -0
- package/dist/firestore/index.d.ts.map +1 -0
- package/dist/firestore/index.js +1536 -0
- package/dist/firestore/index.js.map +1 -0
- package/dist/firestore/tools.d.ts +67 -0
- package/dist/firestore/tools.d.ts.map +1 -0
- package/dist/firestore/tools.js +318 -0
- package/dist/firestore/tools.js.map +1 -0
- package/dist/firestore-values/index.d.ts +63 -0
- package/dist/firestore-values/index.d.ts.map +1 -0
- package/dist/firestore-values/index.js +148 -0
- package/dist/firestore-values/index.js.map +1 -0
- package/dist/project-scope.d.ts +5 -0
- package/dist/project-scope.d.ts.map +1 -0
- package/dist/project-scope.js +2 -0
- package/dist/project-scope.js.map +1 -0
- package/dist/rules/extract.d.ts +28 -0
- package/dist/rules/extract.d.ts.map +1 -0
- package/dist/rules/extract.js +25 -0
- package/dist/rules/extract.js.map +1 -0
- package/dist/rules/generators/assembler.d.ts +19 -0
- package/dist/rules/generators/assembler.d.ts.map +1 -0
- package/dist/rules/generators/assembler.js +292 -0
- package/dist/rules/generators/assembler.js.map +1 -0
- package/dist/rules/generators/expressions.d.ts +52 -0
- package/dist/rules/generators/expressions.d.ts.map +1 -0
- package/dist/rules/generators/expressions.js +117 -0
- package/dist/rules/generators/expressions.js.map +1 -0
- package/dist/rules/generators/grid.d.ts +22 -0
- package/dist/rules/generators/grid.d.ts.map +1 -0
- package/dist/rules/generators/grid.js +52 -0
- package/dist/rules/generators/grid.js.map +1 -0
- package/dist/rules/grammar/FirestoreAST.d.ts +129 -0
- package/dist/rules/grammar/FirestoreAST.d.ts.map +1 -0
- package/dist/rules/grammar/FirestoreAST.js +3 -0
- package/dist/rules/grammar/FirestoreAST.js.map +1 -0
- package/dist/rules/grammar/FirestoreAssembler.d.ts +5 -0
- package/dist/rules/grammar/FirestoreAssembler.d.ts.map +1 -0
- package/dist/rules/grammar/FirestoreAssembler.js +158 -0
- package/dist/rules/grammar/FirestoreAssembler.js.map +1 -0
- package/dist/rules/grammar/FirestoreParser.d.ts +46 -0
- package/dist/rules/grammar/FirestoreParser.d.ts.map +1 -0
- package/dist/rules/grammar/FirestoreParser.js +409 -0
- package/dist/rules/grammar/FirestoreParser.js.map +1 -0
- package/dist/rules/grammar/FirestoreRules.ohm +229 -0
- package/dist/rules/grammar/FirestoreRules.ohm.generated.d.ts +2 -0
- package/dist/rules/grammar/FirestoreRules.ohm.generated.d.ts.map +1 -0
- package/dist/rules/grammar/FirestoreRules.ohm.generated.js +234 -0
- package/dist/rules/grammar/FirestoreRules.ohm.generated.js.map +1 -0
- package/dist/rules/grammar/FirestoreValidator.d.ts +10 -0
- package/dist/rules/grammar/FirestoreValidator.d.ts.map +1 -0
- package/dist/rules/grammar/FirestoreValidator.js +482 -0
- package/dist/rules/grammar/FirestoreValidator.js.map +1 -0
- package/dist/rules/index.d.ts +67 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +80 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/indexes/extract/annotation-collect.d.ts +42 -0
- package/dist/rules/indexes/extract/annotation-collect.d.ts.map +1 -0
- package/dist/rules/indexes/extract/annotation-collect.js +69 -0
- package/dist/rules/indexes/extract/annotation-collect.js.map +1 -0
- package/dist/rules/indexes/extract/annotations.d.ts +50 -0
- package/dist/rules/indexes/extract/annotations.d.ts.map +1 -0
- package/dist/rules/indexes/extract/annotations.js +144 -0
- package/dist/rules/indexes/extract/annotations.js.map +1 -0
- package/dist/rules/indexes/extract/ast.d.ts +54 -0
- package/dist/rules/indexes/extract/ast.d.ts.map +1 -0
- package/dist/rules/indexes/extract/ast.js +119 -0
- package/dist/rules/indexes/extract/ast.js.map +1 -0
- package/dist/rules/indexes/extract/classify.d.ts +41 -0
- package/dist/rules/indexes/extract/classify.d.ts.map +1 -0
- package/dist/rules/indexes/extract/classify.js +138 -0
- package/dist/rules/indexes/extract/classify.js.map +1 -0
- package/dist/rules/indexes/extract/composite.d.ts +38 -0
- package/dist/rules/indexes/extract/composite.d.ts.map +1 -0
- package/dist/rules/indexes/extract/composite.js +85 -0
- package/dist/rules/indexes/extract/composite.js.map +1 -0
- package/dist/rules/indexes/extract/dataflow.d.ts +45 -0
- package/dist/rules/indexes/extract/dataflow.d.ts.map +1 -0
- package/dist/rules/indexes/extract/dataflow.js +200 -0
- package/dist/rules/indexes/extract/dataflow.js.map +1 -0
- package/dist/rules/indexes/extract/enumerate.d.ts +41 -0
- package/dist/rules/indexes/extract/enumerate.d.ts.map +1 -0
- package/dist/rules/indexes/extract/enumerate.js +163 -0
- package/dist/rules/indexes/extract/enumerate.js.map +1 -0
- package/dist/rules/indexes/extract/extractor.d.ts +3 -0
- package/dist/rules/indexes/extract/extractor.d.ts.map +1 -0
- package/dist/rules/indexes/extract/extractor.js +274 -0
- package/dist/rules/indexes/extract/extractor.js.map +1 -0
- package/dist/rules/indexes/extract/types.d.ts +211 -0
- package/dist/rules/indexes/extract/types.d.ts.map +1 -0
- package/dist/rules/indexes/extract/types.js +14 -0
- package/dist/rules/indexes/extract/types.js.map +1 -0
- package/dist/rules/indexes/extractHandler.d.ts +16 -0
- package/dist/rules/indexes/extractHandler.d.ts.map +1 -0
- package/dist/rules/indexes/extractHandler.js +100 -0
- package/dist/rules/indexes/extractHandler.js.map +1 -0
- package/dist/rules/indexes/extractTool.d.ts +15 -0
- package/dist/rules/indexes/extractTool.d.ts.map +1 -0
- package/dist/rules/indexes/extractTool.js +55 -0
- package/dist/rules/indexes/extractTool.js.map +1 -0
- package/dist/rules/indexes/types.d.ts +71 -0
- package/dist/rules/indexes/types.d.ts.map +1 -0
- package/dist/rules/indexes/types.js +15 -0
- package/dist/rules/indexes/types.js.map +1 -0
- package/dist/rules/inspect/handler.d.ts +6 -0
- package/dist/rules/inspect/handler.d.ts.map +1 -0
- package/dist/rules/inspect/handler.js +144 -0
- package/dist/rules/inspect/handler.js.map +1 -0
- package/dist/rules/inspect/spec.d.ts +37 -0
- package/dist/rules/inspect/spec.d.ts.map +1 -0
- package/dist/rules/inspect/spec.js +2 -0
- package/dist/rules/inspect/spec.js.map +1 -0
- package/dist/rules/inspect/tools.d.ts +21 -0
- package/dist/rules/inspect/tools.d.ts.map +1 -0
- package/dist/rules/inspect/tools.js +21 -0
- package/dist/rules/inspect/tools.js.map +1 -0
- package/dist/rules/linter/ast-utils.d.ts +97 -0
- package/dist/rules/linter/ast-utils.d.ts.map +1 -0
- package/dist/rules/linter/ast-utils.js +491 -0
- package/dist/rules/linter/ast-utils.js.map +1 -0
- package/dist/rules/linter/hallucinations.d.ts +34 -0
- package/dist/rules/linter/hallucinations.d.ts.map +1 -0
- package/dist/rules/linter/hallucinations.js +334 -0
- package/dist/rules/linter/hallucinations.js.map +1 -0
- package/dist/rules/linter/linter.d.ts +84 -0
- package/dist/rules/linter/linter.d.ts.map +1 -0
- package/dist/rules/linter/linter.js +784 -0
- package/dist/rules/linter/linter.js.map +1 -0
- package/dist/rules/modules/resolver-browser.d.ts +41 -0
- package/dist/rules/modules/resolver-browser.d.ts.map +1 -0
- package/dist/rules/modules/resolver-browser.js +63 -0
- package/dist/rules/modules/resolver-browser.js.map +1 -0
- package/dist/rules/modules/resolver-core.d.ts +51 -0
- package/dist/rules/modules/resolver-core.d.ts.map +1 -0
- package/dist/rules/modules/resolver-core.js +338 -0
- package/dist/rules/modules/resolver-core.js.map +1 -0
- package/dist/rules/modules/resolver.d.ts +17 -0
- package/dist/rules/modules/resolver.d.ts.map +1 -0
- package/dist/rules/modules/resolver.js +49 -0
- package/dist/rules/modules/resolver.js.map +1 -0
- package/dist/rules/modules/stdlib/atomic.rules +52 -0
- package/dist/rules/modules/stdlib/atomic.test.json +152 -0
- package/dist/rules/modules/stdlib/auth.rules +7 -0
- package/dist/rules/modules/stdlib/auth.test.json +53 -0
- package/dist/rules/modules/stdlib/content.rules +50 -0
- package/dist/rules/modules/stdlib/content.test.json +238 -0
- package/dist/rules/modules/stdlib/counters.rules +41 -0
- package/dist/rules/modules/stdlib/counters.test.json +254 -0
- package/dist/rules/modules/stdlib/geometry.rules +43 -0
- package/dist/rules/modules/stdlib/geometry.test.json +200 -0
- package/dist/rules/modules/stdlib/joining.rules +49 -0
- package/dist/rules/modules/stdlib/joining.test.json +287 -0
- package/dist/rules/modules/stdlib/lifecycle.rules +51 -0
- package/dist/rules/modules/stdlib/lifecycle.test.json +288 -0
- package/dist/rules/modules/stdlib/lobby.rules +44 -0
- package/dist/rules/modules/stdlib/lobby.test.json +32 -0
- package/dist/rules/modules/stdlib/membership.rules +40 -0
- package/dist/rules/modules/stdlib/membership.test.json +107 -0
- package/dist/rules/modules/stdlib/spaces.rules +46 -0
- package/dist/rules/modules/stdlib/spaces.test.json +392 -0
- package/dist/rules/modules/stdlib/state.rules +28 -0
- package/dist/rules/modules/stdlib/state.test.json +55 -0
- package/dist/rules/modules/stdlib/timing.rules +20 -0
- package/dist/rules/modules/stdlib/timing.test.json +106 -0
- package/dist/rules/modules/stdlib/transitions.rules +34 -0
- package/dist/rules/modules/stdlib/transitions.test.json +86 -0
- package/dist/rules/modules/stdlib/turns.rules +27 -0
- package/dist/rules/modules/stdlib/turns.test.json +64 -0
- package/dist/rules/modules/stdlib/validation.rules +31 -0
- package/dist/rules/modules/stdlib/validation.test.json +184 -0
- package/dist/rules/modules/stdlib-content.d.ts +11 -0
- package/dist/rules/modules/stdlib-content.d.ts.map +1 -0
- package/dist/rules/modules/stdlib-content.js +590 -0
- package/dist/rules/modules/stdlib-content.js.map +1 -0
- package/dist/rules/node.d.ts +17 -0
- package/dist/rules/node.d.ts.map +1 -0
- package/dist/rules/node.js +21 -0
- package/dist/rules/node.js.map +1 -0
- package/dist/rules/rtdb.d.ts +28 -0
- package/dist/rules/rtdb.d.ts.map +1 -0
- package/dist/rules/rtdb.js +15 -0
- package/dist/rules/rtdb.js.map +1 -0
- package/dist/rules/simulator/evaluator.d.ts +179 -0
- package/dist/rules/simulator/evaluator.d.ts.map +1 -0
- package/dist/rules/simulator/evaluator.js +1221 -0
- package/dist/rules/simulator/evaluator.js.map +1 -0
- package/dist/rules/simulator/expression/eval-errors.d.ts +86 -0
- package/dist/rules/simulator/expression/eval-errors.d.ts.map +1 -0
- package/dist/rules/simulator/expression/eval-errors.js +68 -0
- package/dist/rules/simulator/expression/eval-errors.js.map +1 -0
- package/dist/rules/simulator/expression/evaluator.d.ts +43 -0
- package/dist/rules/simulator/expression/evaluator.d.ts.map +1 -0
- package/dist/rules/simulator/expression/evaluator.js +298 -0
- package/dist/rules/simulator/expression/evaluator.js.map +1 -0
- package/dist/rules/simulator/expression/lexer.d.ts +36 -0
- package/dist/rules/simulator/expression/lexer.d.ts.map +1 -0
- package/dist/rules/simulator/expression/lexer.js +318 -0
- package/dist/rules/simulator/expression/lexer.js.map +1 -0
- package/dist/rules/simulator/expression/parser.d.ts +39 -0
- package/dist/rules/simulator/expression/parser.d.ts.map +1 -0
- package/dist/rules/simulator/expression/parser.js +329 -0
- package/dist/rules/simulator/expression/parser.js.map +1 -0
- package/dist/rules/simulator/expression/types.d.ts +137 -0
- package/dist/rules/simulator/expression/types.d.ts.map +1 -0
- package/dist/rules/simulator/expression/types.js +90 -0
- package/dist/rules/simulator/expression/types.js.map +1 -0
- package/dist/rules/simulator/expression/walk-data.d.ts +52 -0
- package/dist/rules/simulator/expression/walk-data.d.ts.map +1 -0
- package/dist/rules/simulator/expression/walk-data.js +167 -0
- package/dist/rules/simulator/expression/walk-data.js.map +1 -0
- package/dist/rules/simulator/firestore-set.d.ts +25 -0
- package/dist/rules/simulator/firestore-set.d.ts.map +1 -0
- package/dist/rules/simulator/firestore-set.js +89 -0
- package/dist/rules/simulator/firestore-set.js.map +1 -0
- package/dist/rules/simulator/handler.d.ts +36 -0
- package/dist/rules/simulator/handler.d.ts.map +1 -0
- package/dist/rules/simulator/handler.js +583 -0
- package/dist/rules/simulator/handler.js.map +1 -0
- package/dist/rules/simulator/mapdiff.d.ts +29 -0
- package/dist/rules/simulator/mapdiff.d.ts.map +1 -0
- package/dist/rules/simulator/mapdiff.js +72 -0
- package/dist/rules/simulator/mapdiff.js.map +1 -0
- package/dist/rules/simulator/project-after-state.d.ts +33 -0
- package/dist/rules/simulator/project-after-state.d.ts.map +1 -0
- package/dist/rules/simulator/project-after-state.js +88 -0
- package/dist/rules/simulator/project-after-state.js.map +1 -0
- package/dist/rules/simulator/query-proof.d.ts +80 -0
- package/dist/rules/simulator/query-proof.d.ts.map +1 -0
- package/dist/rules/simulator/query-proof.js +142 -0
- package/dist/rules/simulator/query-proof.js.map +1 -0
- package/dist/rules/simulator/value-equality.d.ts +8 -0
- package/dist/rules/simulator/value-equality.d.ts.map +1 -0
- package/dist/rules/simulator/value-equality.js +40 -0
- package/dist/rules/simulator/value-equality.js.map +1 -0
- package/dist/rules/simulator/wrappers/base.d.ts +129 -0
- package/dist/rules/simulator/wrappers/base.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/base.js +90 -0
- package/dist/rules/simulator/wrappers/base.js.map +1 -0
- package/dist/rules/simulator/wrappers/bytes.d.ts +45 -0
- package/dist/rules/simulator/wrappers/bytes.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/bytes.js +130 -0
- package/dist/rules/simulator/wrappers/bytes.js.map +1 -0
- package/dist/rules/simulator/wrappers/duration.d.ts +76 -0
- package/dist/rules/simulator/wrappers/duration.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/duration.js +176 -0
- package/dist/rules/simulator/wrappers/duration.js.map +1 -0
- package/dist/rules/simulator/wrappers/float.d.ts +52 -0
- package/dist/rules/simulator/wrappers/float.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/float.js +88 -0
- package/dist/rules/simulator/wrappers/float.js.map +1 -0
- package/dist/rules/simulator/wrappers/latlng.d.ts +40 -0
- package/dist/rules/simulator/wrappers/latlng.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/latlng.js +100 -0
- package/dist/rules/simulator/wrappers/latlng.js.map +1 -0
- package/dist/rules/simulator/wrappers/path.d.ts +75 -0
- package/dist/rules/simulator/wrappers/path.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/path.js +158 -0
- package/dist/rules/simulator/wrappers/path.js.map +1 -0
- package/dist/rules/simulator/wrappers/reference.d.ts +82 -0
- package/dist/rules/simulator/wrappers/reference.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/reference.js +145 -0
- package/dist/rules/simulator/wrappers/reference.js.map +1 -0
- package/dist/rules/simulator/wrappers/timestamp.d.ts +86 -0
- package/dist/rules/simulator/wrappers/timestamp.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/timestamp.js +207 -0
- package/dist/rules/simulator/wrappers/timestamp.js.map +1 -0
- package/dist/rules/simulator/wrappers/vector.d.ts +43 -0
- package/dist/rules/simulator/wrappers/vector.d.ts.map +1 -0
- package/dist/rules/simulator/wrappers/vector.js +80 -0
- package/dist/rules/simulator/wrappers/vector.js.map +1 -0
- package/dist/rules/simulator-tools-impl.d.ts +64 -0
- package/dist/rules/simulator-tools-impl.d.ts.map +1 -0
- package/dist/rules/simulator-tools-impl.js +462 -0
- package/dist/rules/simulator-tools-impl.js.map +1 -0
- package/dist/rules/simulator.d.ts +20 -0
- package/dist/rules/simulator.d.ts.map +1 -0
- package/dist/rules/simulator.js +24 -0
- package/dist/rules/simulator.js.map +1 -0
- package/dist/rules/stdlib-modules.d.ts +73 -0
- package/dist/rules/stdlib-modules.d.ts.map +1 -0
- package/dist/rules/stdlib-modules.js +849 -0
- package/dist/rules/stdlib-modules.js.map +1 -0
- package/dist/rules/stdlib-tools.d.ts +19 -0
- package/dist/rules/stdlib-tools.d.ts.map +1 -0
- package/dist/rules/stdlib-tools.js +164 -0
- package/dist/rules/stdlib-tools.js.map +1 -0
- package/dist/rules/test/handler.d.ts +9 -0
- package/dist/rules/test/handler.d.ts.map +1 -0
- package/dist/rules/test/handler.js +124 -0
- package/dist/rules/test/handler.js.map +1 -0
- package/dist/rules/test/spec.d.ts +517 -0
- package/dist/rules/test/spec.d.ts.map +1 -0
- package/dist/rules/test/spec.js +227 -0
- package/dist/rules/test/spec.js.map +1 -0
- package/dist/rules/tools.d.ts +41 -0
- package/dist/rules/tools.d.ts.map +1 -0
- package/dist/rules/tools.js +124 -0
- package/dist/rules/tools.js.map +1 -0
- package/dist/rules/write/handler.d.ts +6 -0
- package/dist/rules/write/handler.d.ts.map +1 -0
- package/dist/rules/write/handler.js +126 -0
- package/dist/rules/write/handler.js.map +1 -0
- package/dist/rules/write/spec.d.ts +28 -0
- package/dist/rules/write/spec.d.ts.map +1 -0
- package/dist/rules/write/spec.js +2 -0
- package/dist/rules/write/spec.js.map +1 -0
- package/dist/sandbox/admin-compat.d.ts +20 -0
- package/dist/sandbox/admin-compat.d.ts.map +1 -0
- package/dist/sandbox/admin-compat.js +19 -0
- package/dist/sandbox/admin-compat.js.map +1 -0
- package/dist/sandbox/admin-firestore/error-translation.d.ts +86 -0
- package/dist/sandbox/admin-firestore/error-translation.d.ts.map +1 -0
- package/dist/sandbox/admin-firestore/error-translation.js +204 -0
- package/dist/sandbox/admin-firestore/error-translation.js.map +1 -0
- package/dist/sandbox/admin-firestore/index.d.ts +169 -0
- package/dist/sandbox/admin-firestore/index.d.ts.map +1 -0
- package/dist/sandbox/admin-firestore/index.js +456 -0
- package/dist/sandbox/admin-firestore/index.js.map +1 -0
- package/dist/sandbox/admin-firestore/remote.d.ts +97 -0
- package/dist/sandbox/admin-firestore/remote.d.ts.map +1 -0
- package/dist/sandbox/admin-firestore/remote.js +735 -0
- package/dist/sandbox/admin-firestore/remote.js.map +1 -0
- package/dist/sandbox/branches/index.d.ts +141 -0
- package/dist/sandbox/branches/index.d.ts.map +1 -0
- package/dist/sandbox/branches/index.js +327 -0
- package/dist/sandbox/branches/index.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/batch.d.ts +34 -0
- package/dist/sandbox/firestore/admin-compat/batch.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/batch.js +73 -0
- package/dist/sandbox/firestore/admin-compat/batch.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/doc-ref.d.ts +38 -0
- package/dist/sandbox/firestore/admin-compat/doc-ref.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/doc-ref.js +154 -0
- package/dist/sandbox/firestore/admin-compat/doc-ref.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/firestore.d.ts +45 -0
- package/dist/sandbox/firestore/admin-compat/firestore.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/firestore.js +114 -0
- package/dist/sandbox/firestore/admin-compat/firestore.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/index.d.ts +45 -0
- package/dist/sandbox/firestore/admin-compat/index.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/index.js +27 -0
- package/dist/sandbox/firestore/admin-compat/index.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/paths.d.ts +37 -0
- package/dist/sandbox/firestore/admin-compat/paths.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/paths.js +49 -0
- package/dist/sandbox/firestore/admin-compat/paths.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/query.d.ts +261 -0
- package/dist/sandbox/firestore/admin-compat/query.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/query.js +704 -0
- package/dist/sandbox/firestore/admin-compat/query.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/read-translation.d.ts +8 -0
- package/dist/sandbox/firestore/admin-compat/read-translation.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/read-translation.js +59 -0
- package/dist/sandbox/firestore/admin-compat/read-translation.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/snapshots.d.ts +39 -0
- package/dist/sandbox/firestore/admin-compat/snapshots.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/snapshots.js +50 -0
- package/dist/sandbox/firestore/admin-compat/snapshots.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/transaction.d.ts +35 -0
- package/dist/sandbox/firestore/admin-compat/transaction.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/transaction.js +88 -0
- package/dist/sandbox/firestore/admin-compat/transaction.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/types.d.ts +297 -0
- package/dist/sandbox/firestore/admin-compat/types.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/types.js +127 -0
- package/dist/sandbox/firestore/admin-compat/types.js.map +1 -0
- package/dist/sandbox/firestore/admin-compat/value-order.d.ts +49 -0
- package/dist/sandbox/firestore/admin-compat/value-order.d.ts.map +1 -0
- package/dist/sandbox/firestore/admin-compat/value-order.js +172 -0
- package/dist/sandbox/firestore/admin-compat/value-order.js.map +1 -0
- package/dist/sandbox/firestore/auto-id.d.ts +26 -0
- package/dist/sandbox/firestore/auto-id.d.ts.map +1 -0
- package/dist/sandbox/firestore/auto-id.js +36 -0
- package/dist/sandbox/firestore/auto-id.js.map +1 -0
- package/dist/sandbox/firestore/converters/bytes-geopoint.d.ts +48 -0
- package/dist/sandbox/firestore/converters/bytes-geopoint.d.ts.map +1 -0
- package/dist/sandbox/firestore/converters/bytes-geopoint.js +85 -0
- package/dist/sandbox/firestore/converters/bytes-geopoint.js.map +1 -0
- package/dist/sandbox/firestore/converters/fieldvalue.d.ts +69 -0
- package/dist/sandbox/firestore/converters/fieldvalue.d.ts.map +1 -0
- package/dist/sandbox/firestore/converters/fieldvalue.js +166 -0
- package/dist/sandbox/firestore/converters/fieldvalue.js.map +1 -0
- package/dist/sandbox/firestore/converters/reference.d.ts +31 -0
- package/dist/sandbox/firestore/converters/reference.d.ts.map +1 -0
- package/dist/sandbox/firestore/converters/reference.js +51 -0
- package/dist/sandbox/firestore/converters/reference.js.map +1 -0
- package/dist/sandbox/firestore/converters/timestamp.d.ts +32 -0
- package/dist/sandbox/firestore/converters/timestamp.d.ts.map +1 -0
- package/dist/sandbox/firestore/converters/timestamp.js +63 -0
- package/dist/sandbox/firestore/converters/timestamp.js.map +1 -0
- package/dist/sandbox/firestore/converters/user-timestamp.d.ts +46 -0
- package/dist/sandbox/firestore/converters/user-timestamp.d.ts.map +1 -0
- package/dist/sandbox/firestore/converters/user-timestamp.js +65 -0
- package/dist/sandbox/firestore/converters/user-timestamp.js.map +1 -0
- package/dist/sandbox/firestore/converters/vector.d.ts +24 -0
- package/dist/sandbox/firestore/converters/vector.d.ts.map +1 -0
- package/dist/sandbox/firestore/converters/vector.js +53 -0
- package/dist/sandbox/firestore/converters/vector.js.map +1 -0
- package/dist/sandbox/firestore/errors.d.ts +82 -0
- package/dist/sandbox/firestore/errors.d.ts.map +1 -0
- package/dist/sandbox/firestore/errors.js +54 -0
- package/dist/sandbox/firestore/errors.js.map +1 -0
- package/dist/sandbox/firestore/event-log.d.ts +99 -0
- package/dist/sandbox/firestore/event-log.d.ts.map +1 -0
- package/dist/sandbox/firestore/event-log.js +67 -0
- package/dist/sandbox/firestore/event-log.js.map +1 -0
- package/dist/sandbox/firestore/field-merge.d.ts +64 -0
- package/dist/sandbox/firestore/field-merge.d.ts.map +1 -0
- package/dist/sandbox/firestore/field-merge.js +221 -0
- package/dist/sandbox/firestore/field-merge.js.map +1 -0
- package/dist/sandbox/firestore/list-query-proof.d.ts +77 -0
- package/dist/sandbox/firestore/list-query-proof.d.ts.map +1 -0
- package/dist/sandbox/firestore/list-query-proof.js +170 -0
- package/dist/sandbox/firestore/list-query-proof.js.map +1 -0
- package/dist/sandbox/firestore/local-environment.d.ts +806 -0
- package/dist/sandbox/firestore/local-environment.d.ts.map +1 -0
- package/dist/sandbox/firestore/local-environment.js +3028 -0
- package/dist/sandbox/firestore/local-environment.js.map +1 -0
- package/dist/sandbox/firestore/local-state.d.ts +196 -0
- package/dist/sandbox/firestore/local-state.d.ts.map +1 -0
- package/dist/sandbox/firestore/local-state.js +413 -0
- package/dist/sandbox/firestore/local-state.js.map +1 -0
- package/dist/sandbox/firestore/overlay-backing.d.ts +44 -0
- package/dist/sandbox/firestore/overlay-backing.d.ts.map +1 -0
- package/dist/sandbox/firestore/overlay-backing.js +82 -0
- package/dist/sandbox/firestore/overlay-backing.js.map +1 -0
- package/dist/sandbox/firestore/sentinel-capture.d.ts +30 -0
- package/dist/sandbox/firestore/sentinel-capture.d.ts.map +1 -0
- package/dist/sandbox/firestore/sentinel-capture.js +61 -0
- package/dist/sandbox/firestore/sentinel-capture.js.map +1 -0
- package/dist/sandbox/firestore/snapshot-listeners.d.ts +284 -0
- package/dist/sandbox/firestore/snapshot-listeners.d.ts.map +1 -0
- package/dist/sandbox/firestore/snapshot-listeners.js +194 -0
- package/dist/sandbox/firestore/snapshot-listeners.js.map +1 -0
- package/dist/sandbox/firestore/topk.d.ts +12 -0
- package/dist/sandbox/firestore/topk.d.ts.map +1 -0
- package/dist/sandbox/firestore/topk.js +42 -0
- package/dist/sandbox/firestore/topk.js.map +1 -0
- package/dist/sandbox/firestore/transaction-merge.d.ts +55 -0
- package/dist/sandbox/firestore/transaction-merge.d.ts.map +1 -0
- package/dist/sandbox/firestore/transaction-merge.js +107 -0
- package/dist/sandbox/firestore/transaction-merge.js.map +1 -0
- package/dist/sandbox/firestore/transaction-types.d.ts +152 -0
- package/dist/sandbox/firestore/transaction-types.d.ts.map +1 -0
- package/dist/sandbox/firestore/transaction-types.js +10 -0
- package/dist/sandbox/firestore/transaction-types.js.map +1 -0
- package/dist/sandbox/firestore/transaction.d.ts +79 -0
- package/dist/sandbox/firestore/transaction.d.ts.map +1 -0
- package/dist/sandbox/firestore/transaction.js +95 -0
- package/dist/sandbox/firestore/transaction.js.map +1 -0
- package/dist/sandbox/firestore/value-equality.d.ts +2 -0
- package/dist/sandbox/firestore/value-equality.d.ts.map +1 -0
- package/dist/sandbox/firestore/value-equality.js +35 -0
- package/dist/sandbox/firestore/value-equality.js.map +1 -0
- package/dist/sandbox/firestore/value-resolver.d.ts +172 -0
- package/dist/sandbox/firestore/value-resolver.d.ts.map +1 -0
- package/dist/sandbox/firestore/value-resolver.js +221 -0
- package/dist/sandbox/firestore/value-resolver.js.map +1 -0
- package/dist/sandbox/firestore/wire-encoder.d.ts +14 -0
- package/dist/sandbox/firestore/wire-encoder.d.ts.map +1 -0
- package/dist/sandbox/firestore/wire-encoder.js +130 -0
- package/dist/sandbox/firestore/wire-encoder.js.map +1 -0
- package/dist/sandbox/index.d.ts +50 -0
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/index.js +63 -0
- package/dist/sandbox/index.js.map +1 -0
- package/dist/sandbox/internal/index.d.ts +36 -0
- package/dist/sandbox/internal/index.d.ts.map +1 -0
- package/dist/sandbox/internal/index.js +72 -0
- package/dist/sandbox/internal/index.js.map +1 -0
- package/dist/sandbox/internal/sandbox-impl.d.ts +343 -0
- package/dist/sandbox/internal/sandbox-impl.d.ts.map +1 -0
- package/dist/sandbox/internal/sandbox-impl.js +718 -0
- package/dist/sandbox/internal/sandbox-impl.js.map +1 -0
- package/dist/sandbox/persistence/backends.d.ts +37 -0
- package/dist/sandbox/persistence/backends.d.ts.map +1 -0
- package/dist/sandbox/persistence/backends.js +202 -0
- package/dist/sandbox/persistence/backends.js.map +1 -0
- package/dist/sandbox/persistence/chunk-format.d.ts +58 -0
- package/dist/sandbox/persistence/chunk-format.d.ts.map +1 -0
- package/dist/sandbox/persistence/chunk-format.js +163 -0
- package/dist/sandbox/persistence/chunk-format.js.map +1 -0
- package/dist/sandbox/persistence/controller.d.ts +39 -0
- package/dist/sandbox/persistence/controller.d.ts.map +1 -0
- package/dist/sandbox/persistence/controller.js +605 -0
- package/dist/sandbox/persistence/controller.js.map +1 -0
- package/dist/sandbox/persistence/index.d.ts +13 -0
- package/dist/sandbox/persistence/index.d.ts.map +1 -0
- package/dist/sandbox/persistence/index.js +5 -0
- package/dist/sandbox/persistence/index.js.map +1 -0
- package/dist/sandbox/persistence/serialize.d.ts +53 -0
- package/dist/sandbox/persistence/serialize.d.ts.map +1 -0
- package/dist/sandbox/persistence/serialize.js +98 -0
- package/dist/sandbox/persistence/serialize.js.map +1 -0
- package/dist/sandbox/persistence/types.d.ts +118 -0
- package/dist/sandbox/persistence/types.d.ts.map +1 -0
- package/dist/sandbox/persistence/types.js +15 -0
- package/dist/sandbox/persistence/types.js.map +1 -0
- package/dist/sandbox/remote.d.ts +118 -0
- package/dist/sandbox/remote.d.ts.map +1 -0
- package/dist/sandbox/remote.js +60 -0
- package/dist/sandbox/remote.js.map +1 -0
- package/dist/sandbox/replay/index.d.ts +106 -0
- package/dist/sandbox/replay/index.d.ts.map +1 -0
- package/dist/sandbox/replay/index.js +246 -0
- package/dist/sandbox/replay/index.js.map +1 -0
- package/dist/sandbox/sandbox-context.d.ts +40 -0
- package/dist/sandbox/sandbox-context.d.ts.map +1 -0
- package/dist/sandbox/sandbox-context.js +72 -0
- package/dist/sandbox/sandbox-context.js.map +1 -0
- package/dist/sandbox/tab-sync/index.d.ts +120 -0
- package/dist/sandbox/tab-sync/index.d.ts.map +1 -0
- package/dist/sandbox/tab-sync/index.js +272 -0
- package/dist/sandbox/tab-sync/index.js.map +1 -0
- package/dist/sandbox/types.d.ts +1235 -0
- package/dist/sandbox/types.d.ts.map +1 -0
- package/dist/sandbox/types.js +46 -0
- package/dist/sandbox/types.js.map +1 -0
- package/dist/storage/admin/api.d.ts +206 -0
- package/dist/storage/admin/api.d.ts.map +1 -0
- package/dist/storage/admin/api.js +349 -0
- package/dist/storage/admin/api.js.map +1 -0
- package/dist/storage/admin/handler.d.ts +29 -0
- package/dist/storage/admin/handler.d.ts.map +1 -0
- package/dist/storage/admin/handler.js +82 -0
- package/dist/storage/admin/handler.js.map +1 -0
- package/dist/storage/admin/spec.d.ts +64 -0
- package/dist/storage/admin/spec.d.ts.map +1 -0
- package/dist/storage/admin/spec.js +8 -0
- package/dist/storage/admin/spec.js.map +1 -0
- package/dist/storage/admin/tools.d.ts +23 -0
- package/dist/storage/admin/tools.d.ts.map +1 -0
- package/dist/storage/admin/tools.js +90 -0
- package/dist/storage/admin/tools.js.map +1 -0
- package/dist/storage/download.d.ts +27 -0
- package/dist/storage/download.d.ts.map +1 -0
- package/dist/storage/download.js +136 -0
- package/dist/storage/download.js.map +1 -0
- package/dist/storage/enforce.d.ts +26 -0
- package/dist/storage/enforce.d.ts.map +1 -0
- package/dist/storage/enforce.js +16 -0
- package/dist/storage/enforce.js.map +1 -0
- package/dist/storage/errors.d.ts +46 -0
- package/dist/storage/errors.d.ts.map +1 -0
- package/dist/storage/errors.js +62 -0
- package/dist/storage/errors.js.map +1 -0
- package/dist/storage/index.d.ts +49 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +60 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/internal.d.ts +18 -0
- package/dist/storage/internal.d.ts.map +1 -0
- package/dist/storage/internal.js +18 -0
- package/dist/storage/internal.js.map +1 -0
- package/dist/storage/list.d.ts +17 -0
- package/dist/storage/list.d.ts.map +1 -0
- package/dist/storage/list.js +91 -0
- package/dist/storage/list.js.map +1 -0
- package/dist/storage/metadata.d.ts +86 -0
- package/dist/storage/metadata.d.ts.map +1 -0
- package/dist/storage/metadata.js +167 -0
- package/dist/storage/metadata.js.map +1 -0
- package/dist/storage/persistence.d.ts +134 -0
- package/dist/storage/persistence.d.ts.map +1 -0
- package/dist/storage/persistence.js +132 -0
- package/dist/storage/persistence.js.map +1 -0
- package/dist/storage/reference.d.ts +63 -0
- package/dist/storage/reference.d.ts.map +1 -0
- package/dist/storage/reference.js +156 -0
- package/dist/storage/reference.js.map +1 -0
- package/dist/storage/rules.d.ts +176 -0
- package/dist/storage/rules.d.ts.map +1 -0
- package/dist/storage/rules.js +621 -0
- package/dist/storage/rules.js.map +1 -0
- package/dist/storage/service.d.ts +139 -0
- package/dist/storage/service.d.ts.map +1 -0
- package/dist/storage/service.js +241 -0
- package/dist/storage/service.js.map +1 -0
- package/dist/storage/upload.d.ts +43 -0
- package/dist/storage/upload.d.ts.map +1 -0
- package/dist/storage/upload.js +235 -0
- package/dist/storage/upload.js.map +1 -0
- package/package.json +109 -3
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Item 2 — FieldValue sentinel converters.
|
|
3
|
+
*
|
|
4
|
+
* Four converters resolve the Firestore FieldValue sentinels at the
|
|
5
|
+
* write boundary, alongside the Date/serverTimestamp converters from
|
|
6
|
+
* Item 1:
|
|
7
|
+
*
|
|
8
|
+
* - `increment` — `{ __type:'increment', value:n }` → prior + n
|
|
9
|
+
* - `arrayUnion` — `{ __type:'arrayUnion', values:[…] }` →
|
|
10
|
+
* prior array with new values appended (deduped)
|
|
11
|
+
* - `arrayRemove` — `{ __type:'arrayRemove', values:[…] }` →
|
|
12
|
+
* prior array with listed values removed
|
|
13
|
+
* - `deleteField` — `{ __type:'deleteField' }` → {@link DELETE_MARKER}
|
|
14
|
+
* sentinel symbol; the resolver hands it to the
|
|
15
|
+
* write layer which partitions it out (see
|
|
16
|
+
* {@link partitionDeletes} in value-resolver.ts)
|
|
17
|
+
*
|
|
18
|
+
* Sentinel shape:
|
|
19
|
+
* Plain `{ __type: '<name>', ... }` objects mirror the existing
|
|
20
|
+
* serverTimestamp convention so producers (admin SDK shim, agent
|
|
21
|
+
* tools, seeded literals) all use one shape. The exported
|
|
22
|
+
* `INCREMENT()`, `ARRAY_UNION()`, `ARRAY_REMOVE()`, `DELETE_FIELD`
|
|
23
|
+
* helpers are the canonical constructors.
|
|
24
|
+
*
|
|
25
|
+
* Prior lookup:
|
|
26
|
+
* `ctx.fieldPath` and `ctx.prior` together identify what value to
|
|
27
|
+
* read from the existing doc. {@link readPrior} walks the dotted
|
|
28
|
+
* path with bracketed array indices ("tags[0]", "user.profile.name"),
|
|
29
|
+
* returning `undefined` for any missing segment.
|
|
30
|
+
*
|
|
31
|
+
* Idempotency:
|
|
32
|
+
* Each converter only claims its own sentinel shape. The output —
|
|
33
|
+
* a number, an array, or {@link DELETE_MARKER} — is not a sentinel,
|
|
34
|
+
* so the second resolver pass is a no-op. The Item 0 contract
|
|
35
|
+
* verifies this.
|
|
36
|
+
*
|
|
37
|
+
* Type mismatch (FS-B11):
|
|
38
|
+
* Firestore OVERWRITES a mismatched prior rather than erroring —
|
|
39
|
+
* `increment(n)` on a non-number uses a base value of 0 (result `n`);
|
|
40
|
+
* `arrayUnion`/`arrayRemove` on a non-array coerce the base to `[]`.
|
|
41
|
+
* Mirrors `clones/.../model/transform_operation.ts`
|
|
42
|
+
* (`computeTransformOperationBaseValue`, `coercedFieldValuesArray`).
|
|
43
|
+
*/
|
|
44
|
+
import { type ValueConverter } from '../value-resolver.js';
|
|
45
|
+
interface IncrementSentinel {
|
|
46
|
+
__type: 'increment';
|
|
47
|
+
value: number;
|
|
48
|
+
}
|
|
49
|
+
interface ArrayUnionSentinel {
|
|
50
|
+
__type: 'arrayUnion';
|
|
51
|
+
values: unknown[];
|
|
52
|
+
}
|
|
53
|
+
interface ArrayRemoveSentinel {
|
|
54
|
+
__type: 'arrayRemove';
|
|
55
|
+
values: unknown[];
|
|
56
|
+
}
|
|
57
|
+
interface DeleteFieldSentinel {
|
|
58
|
+
__type: 'deleteField';
|
|
59
|
+
}
|
|
60
|
+
export declare function INCREMENT(value: number): IncrementSentinel;
|
|
61
|
+
export declare function ARRAY_UNION(...values: unknown[]): ArrayUnionSentinel;
|
|
62
|
+
export declare function ARRAY_REMOVE(...values: unknown[]): ArrayRemoveSentinel;
|
|
63
|
+
export declare const DELETE_FIELD: DeleteFieldSentinel;
|
|
64
|
+
export declare const incrementConverter: ValueConverter;
|
|
65
|
+
export declare const arrayUnionConverter: ValueConverter;
|
|
66
|
+
export declare const arrayRemoveConverter: ValueConverter;
|
|
67
|
+
export declare const deleteFieldConverter: ValueConverter;
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=fieldvalue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldvalue.d.ts","sourceRoot":"","sources":["../../../../src/sandbox/firestore/converters/fieldvalue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,EAAuB,KAAK,cAAc,EAAuB,MAAM,sBAAsB,CAAC;AAKrG,UAAU,iBAAiB;IAAG,MAAM,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE;AAClE,UAAU,kBAAkB;IAAG,MAAM,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,OAAO,EAAE,CAAA;CAAE;AACxE,UAAU,mBAAmB;IAAG,MAAM,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,OAAO,EAAE,CAAA;CAAE;AAC1E,UAAU,mBAAmB;IAAG,MAAM,EAAE,aAAa,CAAA;CAAE;AAwBvD,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAE1D;AACD,wBAAgB,WAAW,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,kBAAkB,CAEpE;AACD,wBAAgB,YAAY,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,mBAAmB,CAEtE;AACD,eAAO,MAAM,YAAY,EAAE,mBAA+C,CAAC;AAsC3E,eAAO,MAAM,kBAAkB,EAAE,cAahC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,cAcjC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,cAUlC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,cAMlC,CAAC"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Item 2 — FieldValue sentinel converters.
|
|
3
|
+
*
|
|
4
|
+
* Four converters resolve the Firestore FieldValue sentinels at the
|
|
5
|
+
* write boundary, alongside the Date/serverTimestamp converters from
|
|
6
|
+
* Item 1:
|
|
7
|
+
*
|
|
8
|
+
* - `increment` — `{ __type:'increment', value:n }` → prior + n
|
|
9
|
+
* - `arrayUnion` — `{ __type:'arrayUnion', values:[…] }` →
|
|
10
|
+
* prior array with new values appended (deduped)
|
|
11
|
+
* - `arrayRemove` — `{ __type:'arrayRemove', values:[…] }` →
|
|
12
|
+
* prior array with listed values removed
|
|
13
|
+
* - `deleteField` — `{ __type:'deleteField' }` → {@link DELETE_MARKER}
|
|
14
|
+
* sentinel symbol; the resolver hands it to the
|
|
15
|
+
* write layer which partitions it out (see
|
|
16
|
+
* {@link partitionDeletes} in value-resolver.ts)
|
|
17
|
+
*
|
|
18
|
+
* Sentinel shape:
|
|
19
|
+
* Plain `{ __type: '<name>', ... }` objects mirror the existing
|
|
20
|
+
* serverTimestamp convention so producers (admin SDK shim, agent
|
|
21
|
+
* tools, seeded literals) all use one shape. The exported
|
|
22
|
+
* `INCREMENT()`, `ARRAY_UNION()`, `ARRAY_REMOVE()`, `DELETE_FIELD`
|
|
23
|
+
* helpers are the canonical constructors.
|
|
24
|
+
*
|
|
25
|
+
* Prior lookup:
|
|
26
|
+
* `ctx.fieldPath` and `ctx.prior` together identify what value to
|
|
27
|
+
* read from the existing doc. {@link readPrior} walks the dotted
|
|
28
|
+
* path with bracketed array indices ("tags[0]", "user.profile.name"),
|
|
29
|
+
* returning `undefined` for any missing segment.
|
|
30
|
+
*
|
|
31
|
+
* Idempotency:
|
|
32
|
+
* Each converter only claims its own sentinel shape. The output —
|
|
33
|
+
* a number, an array, or {@link DELETE_MARKER} — is not a sentinel,
|
|
34
|
+
* so the second resolver pass is a no-op. The Item 0 contract
|
|
35
|
+
* verifies this.
|
|
36
|
+
*
|
|
37
|
+
* Type mismatch (FS-B11):
|
|
38
|
+
* Firestore OVERWRITES a mismatched prior rather than erroring —
|
|
39
|
+
* `increment(n)` on a non-number uses a base value of 0 (result `n`);
|
|
40
|
+
* `arrayUnion`/`arrayRemove` on a non-array coerce the base to `[]`.
|
|
41
|
+
* Mirrors `clones/.../model/transform_operation.ts`
|
|
42
|
+
* (`computeTransformOperationBaseValue`, `coercedFieldValuesArray`).
|
|
43
|
+
*/
|
|
44
|
+
import { KEEP, DELETE_MARKER } from '../value-resolver.js';
|
|
45
|
+
import { firestoreValuesEqual } from '../value-equality.js';
|
|
46
|
+
function isIncrement(v) {
|
|
47
|
+
return typeof v === 'object' && v !== null
|
|
48
|
+
&& v.__type === 'increment'
|
|
49
|
+
&& typeof v.value === 'number';
|
|
50
|
+
}
|
|
51
|
+
function isArrayUnion(v) {
|
|
52
|
+
return typeof v === 'object' && v !== null
|
|
53
|
+
&& v.__type === 'arrayUnion'
|
|
54
|
+
&& Array.isArray(v.values);
|
|
55
|
+
}
|
|
56
|
+
function isArrayRemove(v) {
|
|
57
|
+
return typeof v === 'object' && v !== null
|
|
58
|
+
&& v.__type === 'arrayRemove'
|
|
59
|
+
&& Array.isArray(v.values);
|
|
60
|
+
}
|
|
61
|
+
function isDeleteField(v) {
|
|
62
|
+
return typeof v === 'object' && v !== null
|
|
63
|
+
&& v.__type === 'deleteField';
|
|
64
|
+
}
|
|
65
|
+
// ═══ Sentinel constructors (canonical producers) ═══
|
|
66
|
+
export function INCREMENT(value) {
|
|
67
|
+
return { __type: 'increment', value };
|
|
68
|
+
}
|
|
69
|
+
export function ARRAY_UNION(...values) {
|
|
70
|
+
return { __type: 'arrayUnion', values };
|
|
71
|
+
}
|
|
72
|
+
export function ARRAY_REMOVE(...values) {
|
|
73
|
+
return { __type: 'arrayRemove', values };
|
|
74
|
+
}
|
|
75
|
+
export const DELETE_FIELD = { __type: 'deleteField' };
|
|
76
|
+
// ═══ Prior lookup ═══
|
|
77
|
+
/**
|
|
78
|
+
* Read `ctx.prior.<fieldPath>` where fieldPath uses dot+bracket
|
|
79
|
+
* notation as set by value-resolver.ts (`users.profile.name`,
|
|
80
|
+
* `tags[0]`). Returns `undefined` for any missing segment so callers
|
|
81
|
+
* can apply "missing prior" defaults (e.g., increment treats absent
|
|
82
|
+
* as 0; arrayUnion treats absent as []).
|
|
83
|
+
*/
|
|
84
|
+
function readPrior(ctx) {
|
|
85
|
+
if (ctx.prior === null)
|
|
86
|
+
return undefined;
|
|
87
|
+
if (ctx.fieldPath === '')
|
|
88
|
+
return ctx.prior;
|
|
89
|
+
let cursor = ctx.prior;
|
|
90
|
+
// Split on '.' but keep bracketed indices attached. Then for each
|
|
91
|
+
// segment, peel any [n] suffixes after the dotted name.
|
|
92
|
+
for (const segment of ctx.fieldPath.split('.')) {
|
|
93
|
+
// segment may be like "tags[0][1]" — pull out the name first.
|
|
94
|
+
const nameMatch = /^([^\[]*)/.exec(segment);
|
|
95
|
+
const name = nameMatch ? nameMatch[1] : segment;
|
|
96
|
+
if (name) {
|
|
97
|
+
if (typeof cursor !== 'object' || cursor === null)
|
|
98
|
+
return undefined;
|
|
99
|
+
cursor = cursor[name];
|
|
100
|
+
}
|
|
101
|
+
// Then walk any bracket indices.
|
|
102
|
+
const bracketRE = /\[(\d+)\]/g;
|
|
103
|
+
let m;
|
|
104
|
+
while ((m = bracketRE.exec(segment)) !== null) {
|
|
105
|
+
if (!Array.isArray(cursor))
|
|
106
|
+
return undefined;
|
|
107
|
+
cursor = cursor[Number(m[1])];
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return cursor;
|
|
111
|
+
}
|
|
112
|
+
// ═══ Converters ═══
|
|
113
|
+
export const incrementConverter = {
|
|
114
|
+
name: 'increment-sentinel',
|
|
115
|
+
convert(value, ctx) {
|
|
116
|
+
if (!isIncrement(value))
|
|
117
|
+
return KEEP;
|
|
118
|
+
const prior = readPrior(ctx);
|
|
119
|
+
// FS-B11 — Firestore OVERWRITES a mismatched prior rather than throwing:
|
|
120
|
+
// `increment(n)` on a non-numeric (or absent) prior uses a base value of
|
|
121
|
+
// 0, so the result is just `n`. Mirrors
|
|
122
|
+
// `clones/.../model/transform_operation.ts`
|
|
123
|
+
// `computeTransformOperationBaseValue` (`isNumber(prev) ? prev : 0`).
|
|
124
|
+
const base = typeof prior === 'number' ? prior : 0;
|
|
125
|
+
return base + value.value;
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
export const arrayUnionConverter = {
|
|
129
|
+
name: 'array-union-sentinel',
|
|
130
|
+
convert(value, ctx) {
|
|
131
|
+
if (!isArrayUnion(value))
|
|
132
|
+
return KEEP;
|
|
133
|
+
const prior = readPrior(ctx);
|
|
134
|
+
// FS-B11 — a non-array (or absent) prior is coerced to `[]` rather than
|
|
135
|
+
// throwing (upstream `coercedFieldValuesArray`).
|
|
136
|
+
const base = Array.isArray(prior) ? prior.slice() : [];
|
|
137
|
+
for (const v of value.values) {
|
|
138
|
+
const exists = base.some((b) => firestoreValuesEqual(b, v));
|
|
139
|
+
if (!exists)
|
|
140
|
+
base.push(v);
|
|
141
|
+
}
|
|
142
|
+
return base;
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
export const arrayRemoveConverter = {
|
|
146
|
+
name: 'array-remove-sentinel',
|
|
147
|
+
convert(value, ctx) {
|
|
148
|
+
if (!isArrayRemove(value))
|
|
149
|
+
return KEEP;
|
|
150
|
+
const prior = readPrior(ctx);
|
|
151
|
+
// FS-B11 — a non-array (or absent) prior coerces to `[]` (so the result
|
|
152
|
+
// is `[]`), rather than throwing.
|
|
153
|
+
if (!Array.isArray(prior))
|
|
154
|
+
return [];
|
|
155
|
+
return prior.filter((b) => !value.values.some((v) => firestoreValuesEqual(b, v)));
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
export const deleteFieldConverter = {
|
|
159
|
+
name: 'delete-field-sentinel',
|
|
160
|
+
convert(value) {
|
|
161
|
+
if (!isDeleteField(value))
|
|
162
|
+
return KEEP;
|
|
163
|
+
return DELETE_MARKER;
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
//# sourceMappingURL=fieldvalue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldvalue.js","sourceRoot":"","sources":["../../../../src/sandbox/firestore/converters/fieldvalue.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Item 3 — DocumentReference converter.
|
|
3
|
+
*
|
|
4
|
+
* Wraps `firebase-admin` `DocumentReference` instances into our
|
|
5
|
+
* {@link Reference} wrapper at the write boundary. Without this, a
|
|
6
|
+
* rule like `resource.data.author is reference` returns false because
|
|
7
|
+
* the evaluator detects references via `instanceof Reference`, not
|
|
8
|
+
* via the admin SDK's class.
|
|
9
|
+
*
|
|
10
|
+
* Detection strategy — duck typing on the admin SDK shape:
|
|
11
|
+
* - has a `_path` private member (set in DocumentReference.constructor)
|
|
12
|
+
* - exposes a `path` getter that returns a string
|
|
13
|
+
* - exposes an `id` getter that returns a string
|
|
14
|
+
* - has a `_firestore` reference back to the Firestore client
|
|
15
|
+
*
|
|
16
|
+
* We don't `import { DocumentReference } from 'firebase-admin/firestore'`
|
|
17
|
+
* and use `instanceof` because:
|
|
18
|
+
* 1. The simulator package shouldn't take a hard dependency on
|
|
19
|
+
* firebase-admin (it's not a runtime requirement — only the
|
|
20
|
+
* consumer that seeds the simulator may choose to use admin
|
|
21
|
+
* types); and
|
|
22
|
+
* 2. Multiple admin SDK versions can coexist in a workspace and
|
|
23
|
+
* `instanceof` would miss instances from a different copy.
|
|
24
|
+
*
|
|
25
|
+
* Idempotency: the converter only matches the admin SDK shape, never
|
|
26
|
+
* our own {@link Reference} wrapper (which has no `_path` field), so
|
|
27
|
+
* a second resolver pass is a no-op.
|
|
28
|
+
*/
|
|
29
|
+
import { type ValueConverter } from '../value-resolver.js';
|
|
30
|
+
export declare const documentReferenceConverter: ValueConverter;
|
|
31
|
+
//# sourceMappingURL=reference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../../../src/sandbox/firestore/converters/reference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAwBjE,eAAO,MAAM,0BAA0B,EAAE,cAMxC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Item 3 — DocumentReference converter.
|
|
3
|
+
*
|
|
4
|
+
* Wraps `firebase-admin` `DocumentReference` instances into our
|
|
5
|
+
* {@link Reference} wrapper at the write boundary. Without this, a
|
|
6
|
+
* rule like `resource.data.author is reference` returns false because
|
|
7
|
+
* the evaluator detects references via `instanceof Reference`, not
|
|
8
|
+
* via the admin SDK's class.
|
|
9
|
+
*
|
|
10
|
+
* Detection strategy — duck typing on the admin SDK shape:
|
|
11
|
+
* - has a `_path` private member (set in DocumentReference.constructor)
|
|
12
|
+
* - exposes a `path` getter that returns a string
|
|
13
|
+
* - exposes an `id` getter that returns a string
|
|
14
|
+
* - has a `_firestore` reference back to the Firestore client
|
|
15
|
+
*
|
|
16
|
+
* We don't `import { DocumentReference } from 'firebase-admin/firestore'`
|
|
17
|
+
* and use `instanceof` because:
|
|
18
|
+
* 1. The simulator package shouldn't take a hard dependency on
|
|
19
|
+
* firebase-admin (it's not a runtime requirement — only the
|
|
20
|
+
* consumer that seeds the simulator may choose to use admin
|
|
21
|
+
* types); and
|
|
22
|
+
* 2. Multiple admin SDK versions can coexist in a workspace and
|
|
23
|
+
* `instanceof` would miss instances from a different copy.
|
|
24
|
+
*
|
|
25
|
+
* Idempotency: the converter only matches the admin SDK shape, never
|
|
26
|
+
* our own {@link Reference} wrapper (which has no `_path` field), so
|
|
27
|
+
* a second resolver pass is a no-op.
|
|
28
|
+
*/
|
|
29
|
+
import { KEEP } from '../value-resolver.js';
|
|
30
|
+
import { Reference } from 'pyric/rules';
|
|
31
|
+
function isAdminDocumentReference(v) {
|
|
32
|
+
if (v === null || typeof v !== 'object')
|
|
33
|
+
return false;
|
|
34
|
+
// Must NOT be one of our own wrappers — those are already converted.
|
|
35
|
+
if (v instanceof Reference)
|
|
36
|
+
return false;
|
|
37
|
+
const o = v;
|
|
38
|
+
return (typeof o.path === 'string' &&
|
|
39
|
+
typeof o.id === 'string' &&
|
|
40
|
+
o._path !== undefined &&
|
|
41
|
+
o._firestore !== undefined);
|
|
42
|
+
}
|
|
43
|
+
export const documentReferenceConverter = {
|
|
44
|
+
name: 'document-reference',
|
|
45
|
+
convert(value) {
|
|
46
|
+
if (!isAdminDocumentReference(value))
|
|
47
|
+
return KEEP;
|
|
48
|
+
return new Reference(value.path);
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=reference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference.js","sourceRoot":"","sources":["../../../../src/sandbox/firestore/converters/reference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,IAAI,EAAuB,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAUxC,SAAS,wBAAwB,CAAC,CAAU;IAC1C,IAAI,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACtD,qEAAqE;IACrE,IAAI,CAAC,YAAY,SAAS;QAAE,OAAO,KAAK,CAAC;IACzC,MAAM,CAAC,GAAG,CAA4B,CAAC;IACvC,OAAO,CACL,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ;QAC1B,OAAO,CAAC,CAAC,EAAE,KAAK,QAAQ;QACxB,CAAC,CAAC,KAAK,KAAK,SAAS;QACrB,CAAC,CAAC,UAAU,KAAK,SAAS,CAC3B,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAmB;IACxD,IAAI,EAAE,oBAAoB;IAC1B,OAAO,CAAC,KAAK;QACX,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAClD,OAAO,IAAI,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Item 1 — Timestamp + serverTimestamp converters.
|
|
3
|
+
*
|
|
4
|
+
* Two converters plug into the value-resolver registry:
|
|
5
|
+
*
|
|
6
|
+
* 1. `date-to-timestamp` — JS `Date` instances become {@link Timestamp}
|
|
7
|
+
* wrappers at the write boundary. Without this, a rule like
|
|
8
|
+
* `resource.data.createdAt is timestamp` returns false against seeded
|
|
9
|
+
* Date data because the evaluator detects timestamps via `instanceof
|
|
10
|
+
* Timestamp`, not Date.
|
|
11
|
+
*
|
|
12
|
+
* 2. `server-timestamp-sentinel` — the literal `{ __type:
|
|
13
|
+
* 'serverTimestamp' }` sentinel becomes a {@link Timestamp} reflecting
|
|
14
|
+
* "now". When `ctx.serverTime` is provided, every sentinel in the
|
|
15
|
+
* tree resolves to that SAME Timestamp instance; this matters for
|
|
16
|
+
* rules that compare `data.createdAt == request.time`. Direct
|
|
17
|
+
* `LocalState.write` calls (no LocalEnvironment) get a fresh
|
|
18
|
+
* `Timestamp.fromMillis(Date.now())` per sentinel — small drift, but
|
|
19
|
+
* no rules are evaluated in that path so it doesn't matter.
|
|
20
|
+
*
|
|
21
|
+
* Both converters are idempotent on their own output:
|
|
22
|
+
* - `date-to-timestamp` checks `instanceof Date` only, so the
|
|
23
|
+
* {@link Timestamp} it emits is not re-claimed on a second pass.
|
|
24
|
+
* - `server-timestamp-sentinel` checks the `__type` discriminator;
|
|
25
|
+
* a Timestamp instance does not have it.
|
|
26
|
+
*
|
|
27
|
+
* Both converters preserve unrelated values via {@link KEEP}.
|
|
28
|
+
*/
|
|
29
|
+
import { type ValueConverter } from '../value-resolver.js';
|
|
30
|
+
export declare const dateConverter: ValueConverter;
|
|
31
|
+
export declare const serverTimestampConverter: ValueConverter;
|
|
32
|
+
//# sourceMappingURL=timestamp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timestamp.d.ts","sourceRoot":"","sources":["../../../../src/sandbox/firestore/converters/timestamp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAgBjE,eAAO,MAAM,aAAa,EAAE,cAQ3B,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,cAUtC,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Item 1 — Timestamp + serverTimestamp converters.
|
|
3
|
+
*
|
|
4
|
+
* Two converters plug into the value-resolver registry:
|
|
5
|
+
*
|
|
6
|
+
* 1. `date-to-timestamp` — JS `Date` instances become {@link Timestamp}
|
|
7
|
+
* wrappers at the write boundary. Without this, a rule like
|
|
8
|
+
* `resource.data.createdAt is timestamp` returns false against seeded
|
|
9
|
+
* Date data because the evaluator detects timestamps via `instanceof
|
|
10
|
+
* Timestamp`, not Date.
|
|
11
|
+
*
|
|
12
|
+
* 2. `server-timestamp-sentinel` — the literal `{ __type:
|
|
13
|
+
* 'serverTimestamp' }` sentinel becomes a {@link Timestamp} reflecting
|
|
14
|
+
* "now". When `ctx.serverTime` is provided, every sentinel in the
|
|
15
|
+
* tree resolves to that SAME Timestamp instance; this matters for
|
|
16
|
+
* rules that compare `data.createdAt == request.time`. Direct
|
|
17
|
+
* `LocalState.write` calls (no LocalEnvironment) get a fresh
|
|
18
|
+
* `Timestamp.fromMillis(Date.now())` per sentinel — small drift, but
|
|
19
|
+
* no rules are evaluated in that path so it doesn't matter.
|
|
20
|
+
*
|
|
21
|
+
* Both converters are idempotent on their own output:
|
|
22
|
+
* - `date-to-timestamp` checks `instanceof Date` only, so the
|
|
23
|
+
* {@link Timestamp} it emits is not re-claimed on a second pass.
|
|
24
|
+
* - `server-timestamp-sentinel` checks the `__type` discriminator;
|
|
25
|
+
* a Timestamp instance does not have it.
|
|
26
|
+
*
|
|
27
|
+
* Both converters preserve unrelated values via {@link KEEP}.
|
|
28
|
+
*/
|
|
29
|
+
import { KEEP } from '../value-resolver.js';
|
|
30
|
+
import { Timestamp } from 'pyric/rules';
|
|
31
|
+
/**
|
|
32
|
+
* Detect plain `{ __type: 'serverTimestamp' }` objects. Mirrors
|
|
33
|
+
* `handler.ts:isServerTimestampSentinel` so the two layers agree on
|
|
34
|
+
* sentinel shape — refactor either, refactor both.
|
|
35
|
+
*/
|
|
36
|
+
function isServerTimestampSentinel(value) {
|
|
37
|
+
return (typeof value === 'object' &&
|
|
38
|
+
value !== null &&
|
|
39
|
+
value.__type === 'serverTimestamp');
|
|
40
|
+
}
|
|
41
|
+
export const dateConverter = {
|
|
42
|
+
name: 'date-to-timestamp',
|
|
43
|
+
convert(value) {
|
|
44
|
+
if (value instanceof Date) {
|
|
45
|
+
return Timestamp.fromMillis(value.getTime());
|
|
46
|
+
}
|
|
47
|
+
return KEEP;
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
export const serverTimestampConverter = {
|
|
51
|
+
name: 'server-timestamp-sentinel',
|
|
52
|
+
convert(value, ctx) {
|
|
53
|
+
if (!isServerTimestampSentinel(value))
|
|
54
|
+
return KEEP;
|
|
55
|
+
// Use the caller-supplied serverTime when present so every sentinel
|
|
56
|
+
// in this write resolves to the same instance. Otherwise fall back
|
|
57
|
+
// to a fresh wallclock read.
|
|
58
|
+
if (ctx.serverTime instanceof Timestamp)
|
|
59
|
+
return ctx.serverTime;
|
|
60
|
+
return Timestamp.fromMillis(Date.now());
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=timestamp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timestamp.js","sourceRoot":"","sources":["../../../../src/sandbox/firestore/converters/timestamp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,IAAI,EAAuB,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;GAIG;AACH,SAAS,yBAAyB,CAAC,KAAc;IAC/C,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACb,KAAiC,CAAC,MAAM,KAAK,iBAAiB,CAChE,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAmB;IAC3C,IAAI,EAAE,mBAAmB;IACzB,OAAO,CAAC,KAAK;QACX,IAAI,KAAK,YAAY,IAAI,EAAE,CAAC;YAC1B,OAAO,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC/C,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAmB;IACtD,IAAI,EAAE,2BAA2B;IACjC,OAAO,CAAC,KAAK,EAAE,GAAG;QAChB,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACnD,oEAAoE;QACpE,mEAAmE;QACnE,6BAA6B;QAC7B,IAAI,GAAG,CAAC,UAAU,YAAY,SAAS;YAAE,OAAO,GAAG,CAAC,UAAU,CAAC;QAC/D,OAAO,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC1C,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User-Timestamp write-boundary converter (FS-B4).
|
|
3
|
+
*
|
|
4
|
+
* Unifies Timestamp storage. The simulator stores resolved timestamps as
|
|
5
|
+
* rules-internal {@link Timestamp} (`pyric/rules`, `{seconds, nanos}`,
|
|
6
|
+
* carrying evaluator hooks). The `serverTimestamp()` sentinel and `Date`
|
|
7
|
+
* inputs already resolve to that internal class (see `timestamp.ts`). But
|
|
8
|
+
* a timestamp the user *writes directly* — via the modular SDK's
|
|
9
|
+
* `Timestamp` (the admin-compat `{seconds, nanoseconds}` class re-exported
|
|
10
|
+
* as `Timestamp` from `pyric/firestore`) or a raw `firebase/firestore`
|
|
11
|
+
* `Timestamp` — has no converter, so it lands in storage as the compat
|
|
12
|
+
* class instance. Two problems with that split storage:
|
|
13
|
+
*
|
|
14
|
+
* 1. The rules evaluator detects timestamps via `value instanceof
|
|
15
|
+
* RulesValue && typeName === 'timestamp'`. A compat `Timestamp` is
|
|
16
|
+
* neither, so `data.createdAt is timestamp` returns false — a user
|
|
17
|
+
* `Timestamp` is rejected by the very `is timestamp` rule that a
|
|
18
|
+
* `serverTimestamp()` write passes.
|
|
19
|
+
* 2. Range filters / cursors / `orderBy` compare against stored values.
|
|
20
|
+
* The FS-B3 comparator was taught both timestamp shapes, so ordering
|
|
21
|
+
* mostly works — but the read-path translator only rewrites the
|
|
22
|
+
* internal class to compat shape, so a user-written compat Timestamp
|
|
23
|
+
* never gets the `nanos`→`nanoseconds` normalization round-trip and
|
|
24
|
+
* `serverTimestamp()`-written and user-written timestamps live as two
|
|
25
|
+
* different classes in the same collection. Normalizing both to the
|
|
26
|
+
* internal class at the write boundary collapses the split.
|
|
27
|
+
*
|
|
28
|
+
* Detection strategy — duck typing on the compat / `firebase/firestore`
|
|
29
|
+
* Timestamp shape, exactly like {@link bytesConverter} /
|
|
30
|
+
* {@link geoPointConverter}:
|
|
31
|
+
* - numeric `seconds`
|
|
32
|
+
* - numeric `nanoseconds` (the compat / fb field name — distinct from
|
|
33
|
+
* the internal class's `nanos`, which is how we reject our own output)
|
|
34
|
+
* - method `toMillis`
|
|
35
|
+
*
|
|
36
|
+
* We deliberately don't `instanceof fb.Timestamp` — the simulator package
|
|
37
|
+
* must not take a hard dependency on `firebase/firestore`, and multiple
|
|
38
|
+
* `firebase` copies in a workspace would defeat `instanceof` anyway.
|
|
39
|
+
*
|
|
40
|
+
* Idempotency: the internal {@link Timestamp} has `nanos`, not
|
|
41
|
+
* `nanoseconds`, and `value instanceof RulesTimestamp` short-circuits
|
|
42
|
+
* first — so a second resolver pass over our own output is a no-op.
|
|
43
|
+
*/
|
|
44
|
+
import { type ValueConverter } from '../value-resolver.js';
|
|
45
|
+
export declare const userTimestampConverter: ValueConverter;
|
|
46
|
+
//# sourceMappingURL=user-timestamp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-timestamp.d.ts","sourceRoot":"","sources":["../../../../src/sandbox/firestore/converters/user-timestamp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAsBjE,eAAO,MAAM,sBAAsB,EAAE,cAMpC,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User-Timestamp write-boundary converter (FS-B4).
|
|
3
|
+
*
|
|
4
|
+
* Unifies Timestamp storage. The simulator stores resolved timestamps as
|
|
5
|
+
* rules-internal {@link Timestamp} (`pyric/rules`, `{seconds, nanos}`,
|
|
6
|
+
* carrying evaluator hooks). The `serverTimestamp()` sentinel and `Date`
|
|
7
|
+
* inputs already resolve to that internal class (see `timestamp.ts`). But
|
|
8
|
+
* a timestamp the user *writes directly* — via the modular SDK's
|
|
9
|
+
* `Timestamp` (the admin-compat `{seconds, nanoseconds}` class re-exported
|
|
10
|
+
* as `Timestamp` from `pyric/firestore`) or a raw `firebase/firestore`
|
|
11
|
+
* `Timestamp` — has no converter, so it lands in storage as the compat
|
|
12
|
+
* class instance. Two problems with that split storage:
|
|
13
|
+
*
|
|
14
|
+
* 1. The rules evaluator detects timestamps via `value instanceof
|
|
15
|
+
* RulesValue && typeName === 'timestamp'`. A compat `Timestamp` is
|
|
16
|
+
* neither, so `data.createdAt is timestamp` returns false — a user
|
|
17
|
+
* `Timestamp` is rejected by the very `is timestamp` rule that a
|
|
18
|
+
* `serverTimestamp()` write passes.
|
|
19
|
+
* 2. Range filters / cursors / `orderBy` compare against stored values.
|
|
20
|
+
* The FS-B3 comparator was taught both timestamp shapes, so ordering
|
|
21
|
+
* mostly works — but the read-path translator only rewrites the
|
|
22
|
+
* internal class to compat shape, so a user-written compat Timestamp
|
|
23
|
+
* never gets the `nanos`→`nanoseconds` normalization round-trip and
|
|
24
|
+
* `serverTimestamp()`-written and user-written timestamps live as two
|
|
25
|
+
* different classes in the same collection. Normalizing both to the
|
|
26
|
+
* internal class at the write boundary collapses the split.
|
|
27
|
+
*
|
|
28
|
+
* Detection strategy — duck typing on the compat / `firebase/firestore`
|
|
29
|
+
* Timestamp shape, exactly like {@link bytesConverter} /
|
|
30
|
+
* {@link geoPointConverter}:
|
|
31
|
+
* - numeric `seconds`
|
|
32
|
+
* - numeric `nanoseconds` (the compat / fb field name — distinct from
|
|
33
|
+
* the internal class's `nanos`, which is how we reject our own output)
|
|
34
|
+
* - method `toMillis`
|
|
35
|
+
*
|
|
36
|
+
* We deliberately don't `instanceof fb.Timestamp` — the simulator package
|
|
37
|
+
* must not take a hard dependency on `firebase/firestore`, and multiple
|
|
38
|
+
* `firebase` copies in a workspace would defeat `instanceof` anyway.
|
|
39
|
+
*
|
|
40
|
+
* Idempotency: the internal {@link Timestamp} has `nanos`, not
|
|
41
|
+
* `nanoseconds`, and `value instanceof RulesTimestamp` short-circuits
|
|
42
|
+
* first — so a second resolver pass over our own output is a no-op.
|
|
43
|
+
*/
|
|
44
|
+
import { KEEP } from '../value-resolver.js';
|
|
45
|
+
import { Timestamp as RulesTimestamp } from 'pyric/rules';
|
|
46
|
+
function isUserTimestamp(v) {
|
|
47
|
+
if (v === null || typeof v !== 'object')
|
|
48
|
+
return false;
|
|
49
|
+
// Our own output (the internal wrapper) is already normalized.
|
|
50
|
+
if (v instanceof RulesTimestamp)
|
|
51
|
+
return false;
|
|
52
|
+
const o = v;
|
|
53
|
+
return (typeof o.seconds === 'number' &&
|
|
54
|
+
typeof o.nanoseconds === 'number' &&
|
|
55
|
+
typeof o.toMillis === 'function');
|
|
56
|
+
}
|
|
57
|
+
export const userTimestampConverter = {
|
|
58
|
+
name: 'user-timestamp-to-rules-timestamp',
|
|
59
|
+
convert(value) {
|
|
60
|
+
if (!isUserTimestamp(value))
|
|
61
|
+
return KEEP;
|
|
62
|
+
return new RulesTimestamp(value.seconds, value.nanoseconds);
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=user-timestamp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-timestamp.js","sourceRoot":"","sources":["../../../../src/sandbox/firestore/converters/user-timestamp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,EAAE,IAAI,EAAuB,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,aAAa,CAAC;AAS1D,SAAS,eAAe,CAAC,CAAU;IACjC,IAAI,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACtD,+DAA+D;IAC/D,IAAI,CAAC,YAAY,cAAc;QAAE,OAAO,KAAK,CAAC;IAC9C,MAAM,CAAC,GAAG,CAA4B,CAAC;IACvC,OAAO,CACL,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ;QAC7B,OAAO,CAAC,CAAC,WAAW,KAAK,QAAQ;QACjC,OAAO,CAAC,CAAC,QAAQ,KAAK,UAAU,CACjC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAmB;IACpD,IAAI,EAAE,mCAAmC;IACzC,OAAO,CAAC,KAAK;QACX,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACzC,OAAO,IAAI,cAAc,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAC9D,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Item 5 — VectorValue converter.
|
|
3
|
+
*
|
|
4
|
+
* Wraps `firebase-admin` `VectorValue` instances into our {@link Vector}
|
|
5
|
+
* wrapper at the write boundary. Without this, the wire encoder would
|
|
6
|
+
* walk the admin VectorValue as a plain object and emit garbage that
|
|
7
|
+
* `discover/wire.ts` cannot recognize as a vector sentinel.
|
|
8
|
+
*
|
|
9
|
+
* Detection strategy — duck typing on the admin SDK shape:
|
|
10
|
+
* - has a `_values` private member that's an Array of numbers
|
|
11
|
+
* - exposes a `toArray` function
|
|
12
|
+
*
|
|
13
|
+
* We deliberately don't `instanceof VectorValue` because:
|
|
14
|
+
* 1. The simulator package shouldn't take a hard dependency on
|
|
15
|
+
* firebase-admin (it's a consumer concern), and
|
|
16
|
+
* 2. Multiple admin SDK copies in a workspace would defeat instanceof.
|
|
17
|
+
*
|
|
18
|
+
* Idempotency: the converter only matches the admin SDK shape, never
|
|
19
|
+
* our own {@link Vector} wrapper (which has no `_values` field and uses
|
|
20
|
+
* a frozen `value` array instead). A second resolver pass is a no-op.
|
|
21
|
+
*/
|
|
22
|
+
import { type ValueConverter } from '../value-resolver.js';
|
|
23
|
+
export declare const vectorValueConverter: ValueConverter;
|
|
24
|
+
//# sourceMappingURL=vector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vector.d.ts","sourceRoot":"","sources":["../../../../src/sandbox/firestore/converters/vector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAsBjE,eAAO,MAAM,oBAAoB,EAAE,cAOlC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Item 5 — VectorValue converter.
|
|
3
|
+
*
|
|
4
|
+
* Wraps `firebase-admin` `VectorValue` instances into our {@link Vector}
|
|
5
|
+
* wrapper at the write boundary. Without this, the wire encoder would
|
|
6
|
+
* walk the admin VectorValue as a plain object and emit garbage that
|
|
7
|
+
* `discover/wire.ts` cannot recognize as a vector sentinel.
|
|
8
|
+
*
|
|
9
|
+
* Detection strategy — duck typing on the admin SDK shape:
|
|
10
|
+
* - has a `_values` private member that's an Array of numbers
|
|
11
|
+
* - exposes a `toArray` function
|
|
12
|
+
*
|
|
13
|
+
* We deliberately don't `instanceof VectorValue` because:
|
|
14
|
+
* 1. The simulator package shouldn't take a hard dependency on
|
|
15
|
+
* firebase-admin (it's a consumer concern), and
|
|
16
|
+
* 2. Multiple admin SDK copies in a workspace would defeat instanceof.
|
|
17
|
+
*
|
|
18
|
+
* Idempotency: the converter only matches the admin SDK shape, never
|
|
19
|
+
* our own {@link Vector} wrapper (which has no `_values` field and uses
|
|
20
|
+
* a frozen `value` array instead). A second resolver pass is a no-op.
|
|
21
|
+
*/
|
|
22
|
+
import { KEEP } from '../value-resolver.js';
|
|
23
|
+
import { Vector } from 'pyric/rules';
|
|
24
|
+
function isNumberArray(a) {
|
|
25
|
+
return Array.isArray(a) && a.every((n) => typeof n === 'number');
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Extract a VectorValue's components, or null if `v` isn't one. The brand is a
|
|
29
|
+
* numeric `_values` AND a `toArray` method: both the firebase web SDK and the
|
|
30
|
+
* admin SDK `VectorValue` expose both, so requiring both is what distinguishes a
|
|
31
|
+
* real vector from a plain object that merely has one of them.
|
|
32
|
+
*/
|
|
33
|
+
function extractVectorValues(v) {
|
|
34
|
+
if (v === null || typeof v !== 'object')
|
|
35
|
+
return null;
|
|
36
|
+
// Must NOT be one of our own wrappers; those are already converted.
|
|
37
|
+
if (v instanceof Vector)
|
|
38
|
+
return null;
|
|
39
|
+
const o = v;
|
|
40
|
+
if (isNumberArray(o._values) && typeof o.toArray === 'function')
|
|
41
|
+
return o._values;
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
export const vectorValueConverter = {
|
|
45
|
+
name: 'vector-value',
|
|
46
|
+
convert(value) {
|
|
47
|
+
const values = extractVectorValues(value);
|
|
48
|
+
if (values === null)
|
|
49
|
+
return KEEP;
|
|
50
|
+
return new Vector(values);
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=vector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vector.js","sourceRoot":"","sources":["../../../../src/sandbox/firestore/converters/vector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,IAAI,EAAuB,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,SAAS,aAAa,CAAC,CAAU;IAC/B,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC;AACnE,CAAC;AAED;;;;;GAKG;AACH,SAAS,mBAAmB,CAAC,CAAU;IACrC,IAAI,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACrD,oEAAoE;IACpE,IAAI,CAAC,YAAY,MAAM;QAAE,OAAO,IAAI,CAAC;IACrC,MAAM,CAAC,GAAG,CAA4B,CAAC;IACvC,IAAI,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,UAAU;QAAE,OAAO,CAAC,CAAC,OAAO,CAAC;IAClF,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAmB;IAClD,IAAI,EAAE,cAAc;IACpB,OAAO,CAAC,KAAK;QACX,MAAM,MAAM,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;QAC1C,IAAI,MAAM,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;QACjC,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;CACF,CAAC"}
|