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,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Snapshot serialization for sandbox persistence.
|
|
3
|
+
*
|
|
4
|
+
* Goes in two directions:
|
|
5
|
+
*
|
|
6
|
+
* serialize: SandboxSnapshot → string
|
|
7
|
+
* `JSON.stringify` already does most of the work. Each wrapper
|
|
8
|
+
* type (Timestamp, Bytes, LatLng, Duration, Reference, Path,
|
|
9
|
+
* Vector) ships a `toJSON()` that emits a marker shape — those
|
|
10
|
+
* come for free.
|
|
11
|
+
*
|
|
12
|
+
* deserialize: string → SandboxSnapshot
|
|
13
|
+
* Parse, then walk the tree and re-wrap any marker shape back into
|
|
14
|
+
* its wrapper class instance. Rule evaluation depends on `instanceof
|
|
15
|
+
* Timestamp` checks etc., so restored docs must carry the class
|
|
16
|
+
* instances, not the marker objects.
|
|
17
|
+
*
|
|
18
|
+
* Schema version is captured in the blob so future format changes can
|
|
19
|
+
* be detected and reported (rather than corrupting silently).
|
|
20
|
+
*/
|
|
21
|
+
import { rehydrateDocValue } from '../../firestore-values/index.js';
|
|
22
|
+
export { rehydrateDocValue };
|
|
23
|
+
export declare class PersistenceSchemaError extends Error {
|
|
24
|
+
constructor(message: string);
|
|
25
|
+
}
|
|
26
|
+
/** Serialize a sandbox snapshot to a string blob ready for storage. */
|
|
27
|
+
export declare function serializeSnapshot(firestore: Record<string, Record<string, unknown>>, services?: Record<string, unknown>): string;
|
|
28
|
+
/**
|
|
29
|
+
* Parsed result of a persisted blob.
|
|
30
|
+
*
|
|
31
|
+
* `firestore` is the rehydrated Firestore document map — class
|
|
32
|
+
* instances (Timestamp, Bytes, etc.) are restored from their marker
|
|
33
|
+
* shapes. `services` is the raw (no rehydration needed) per-service
|
|
34
|
+
* state map; each entry is whatever the service's
|
|
35
|
+
* `PersistableService.snapshot()` emitted.
|
|
36
|
+
*/
|
|
37
|
+
export interface DeserializedSnapshot {
|
|
38
|
+
firestore: Record<string, Record<string, unknown>>;
|
|
39
|
+
services: Record<string, unknown>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Parse a stored blob back into a snapshot. Throws
|
|
43
|
+
* {@link PersistenceSchemaError} on an unrecognized version or
|
|
44
|
+
* malformed input.
|
|
45
|
+
*
|
|
46
|
+
* **v1 compatibility:** v1 blobs (no `services` field) are accepted
|
|
47
|
+
* and treated as having an empty services map. This is the clean
|
|
48
|
+
* forward-compatible choice for a pre-release library: old dev blobs
|
|
49
|
+
* just don't have auth users, which is correct — the user hadn't opted
|
|
50
|
+
* into auth persistence yet. New writes always emit v2.
|
|
51
|
+
*/
|
|
52
|
+
export declare function deserializeSnapshot(raw: string): DeserializedSnapshot;
|
|
53
|
+
//# sourceMappingURL=serialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../../src/sandbox/persistence/serialize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAOH,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAKpE,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAqB7B,qBAAa,sBAAuB,SAAQ,KAAK;gBACnC,OAAO,EAAE,MAAM;CAI5B;AAED,uEAAuE;AACvE,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAClD,QAAQ,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACrC,MAAM,CAQR;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACnD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB,CAgCrE"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Snapshot serialization for sandbox persistence.
|
|
3
|
+
*
|
|
4
|
+
* Goes in two directions:
|
|
5
|
+
*
|
|
6
|
+
* serialize: SandboxSnapshot → string
|
|
7
|
+
* `JSON.stringify` already does most of the work. Each wrapper
|
|
8
|
+
* type (Timestamp, Bytes, LatLng, Duration, Reference, Path,
|
|
9
|
+
* Vector) ships a `toJSON()` that emits a marker shape — those
|
|
10
|
+
* come for free.
|
|
11
|
+
*
|
|
12
|
+
* deserialize: string → SandboxSnapshot
|
|
13
|
+
* Parse, then walk the tree and re-wrap any marker shape back into
|
|
14
|
+
* its wrapper class instance. Rule evaluation depends on `instanceof
|
|
15
|
+
* Timestamp` checks etc., so restored docs must carry the class
|
|
16
|
+
* instances, not the marker objects.
|
|
17
|
+
*
|
|
18
|
+
* Schema version is captured in the blob so future format changes can
|
|
19
|
+
* be detected and reported (rather than corrupting silently).
|
|
20
|
+
*/
|
|
21
|
+
// The marker-based value codec lives in a STANDALONE leaf module
|
|
22
|
+
// (`firestore-values`) so the SharedWorker client can rehydrate doc values
|
|
23
|
+
// WITHOUT pulling the rules engine. `serialize.ts` re-uses that same codec so
|
|
24
|
+
// there is exactly one rehydrate implementation — the IDB persistence format
|
|
25
|
+
// and the MessagePort wire format can't drift.
|
|
26
|
+
import { rehydrateDocValue } from '../../firestore-values/index.js';
|
|
27
|
+
// Re-exported so existing consumers (`sandbox/persistence/index.ts` →
|
|
28
|
+
// `pyric/sandbox`) keep their import path; the implementation now lives in the
|
|
29
|
+
// leaf codec.
|
|
30
|
+
export { rehydrateDocValue };
|
|
31
|
+
/**
|
|
32
|
+
* Current on-disk format version.
|
|
33
|
+
*
|
|
34
|
+
* v1 → v2 (this release): added `services: Record<string, unknown>` to
|
|
35
|
+
* persist plugged-in service state (auth users, etc.). v1 blobs are
|
|
36
|
+
* accepted on read with `services` defaulted to `{}` — the forward-
|
|
37
|
+
* compatible choice for a pre-release library where old blobs are
|
|
38
|
+
* dev-only and disposable. New writes always emit v2.
|
|
39
|
+
*/
|
|
40
|
+
const SCHEMA_VERSION = 2;
|
|
41
|
+
export class PersistenceSchemaError extends Error {
|
|
42
|
+
constructor(message) {
|
|
43
|
+
super(message);
|
|
44
|
+
this.name = 'PersistenceSchemaError';
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/** Serialize a sandbox snapshot to a string blob ready for storage. */
|
|
48
|
+
export function serializeSnapshot(firestore, services = {}) {
|
|
49
|
+
const payload = {
|
|
50
|
+
version: SCHEMA_VERSION,
|
|
51
|
+
savedAt: Date.now(),
|
|
52
|
+
firestore,
|
|
53
|
+
services,
|
|
54
|
+
};
|
|
55
|
+
return JSON.stringify(payload);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Parse a stored blob back into a snapshot. Throws
|
|
59
|
+
* {@link PersistenceSchemaError} on an unrecognized version or
|
|
60
|
+
* malformed input.
|
|
61
|
+
*
|
|
62
|
+
* **v1 compatibility:** v1 blobs (no `services` field) are accepted
|
|
63
|
+
* and treated as having an empty services map. This is the clean
|
|
64
|
+
* forward-compatible choice for a pre-release library: old dev blobs
|
|
65
|
+
* just don't have auth users, which is correct — the user hadn't opted
|
|
66
|
+
* into auth persistence yet. New writes always emit v2.
|
|
67
|
+
*/
|
|
68
|
+
export function deserializeSnapshot(raw) {
|
|
69
|
+
let parsed;
|
|
70
|
+
try {
|
|
71
|
+
parsed = JSON.parse(raw);
|
|
72
|
+
}
|
|
73
|
+
catch (e) {
|
|
74
|
+
throw new PersistenceSchemaError(`Persisted blob is not valid JSON: ${e.message}`);
|
|
75
|
+
}
|
|
76
|
+
if (typeof parsed !== 'object' || parsed === null) {
|
|
77
|
+
throw new PersistenceSchemaError('Persisted blob is not an object');
|
|
78
|
+
}
|
|
79
|
+
// Accept v1 (no services) and v2 (with services). Any other version
|
|
80
|
+
// is unrecognized — quarantine it so we don't silently corrupt state.
|
|
81
|
+
if (parsed.version !== 1 && parsed.version !== 2) {
|
|
82
|
+
throw new PersistenceSchemaError(`Persisted blob has version ${String(parsed.version)}, expected 1 or 2`);
|
|
83
|
+
}
|
|
84
|
+
if (typeof parsed.firestore !== 'object' || parsed.firestore === null) {
|
|
85
|
+
throw new PersistenceSchemaError('Persisted blob has no firestore field');
|
|
86
|
+
}
|
|
87
|
+
const firestore = {};
|
|
88
|
+
for (const [path, data] of Object.entries(parsed.firestore)) {
|
|
89
|
+
firestore[path] = rehydrateDocValue(data);
|
|
90
|
+
}
|
|
91
|
+
// v1 blobs lack `services` — default to {} so the restore path
|
|
92
|
+
// proceeds without error. No auth users in the blob = no auth restore.
|
|
93
|
+
const services = (parsed.services !== undefined && typeof parsed.services === 'object' && parsed.services !== null)
|
|
94
|
+
? parsed.services
|
|
95
|
+
: {};
|
|
96
|
+
return { firestore, services };
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=serialize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../../src/sandbox/persistence/serialize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,iEAAiE;AACjE,2EAA2E;AAC3E,8EAA8E;AAC9E,6EAA6E;AAC7E,+CAA+C;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,sEAAsE;AACtE,+EAA+E;AAC/E,cAAc;AACd,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B;;;;;;;;GAQG;AACH,MAAM,cAAc,GAAG,CAAU,CAAC;AAUlC,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC/C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACvC,CAAC;CACF;AAED,uEAAuE;AACvE,MAAM,UAAU,iBAAiB,CAC/B,SAAkD,EAClD,WAAoC,EAAE;IAEtC,MAAM,OAAO,GAAmB;QAC9B,OAAO,EAAE,cAAc;QACvB,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE;QACnB,SAAS;QACT,QAAQ;KACT,CAAC;IACF,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAgBD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAW;IAC7C,IAAI,MAAsB,CAAC;IAC3B,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAmB,CAAC;IAC7C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,sBAAsB,CAC9B,qCAAsC,CAAW,CAAC,OAAO,EAAE,CAC5D,CAAC;IACJ,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QAClD,MAAM,IAAI,sBAAsB,CAAC,iCAAiC,CAAC,CAAC;IACtE,CAAC;IACD,oEAAoE;IACpE,sEAAsE;IACtE,IAAI,MAAM,CAAC,OAAO,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,KAAK,CAAC,EAAE,CAAC;QACjD,MAAM,IAAI,sBAAsB,CAC9B,8BAA8B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,mBAAmB,CACxE,CAAC;IACJ,CAAC;IACD,IAAI,OAAO,MAAM,CAAC,SAAS,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;QACtE,MAAM,IAAI,sBAAsB,CAAC,uCAAuC,CAAC,CAAC;IAC5E,CAAC;IACD,MAAM,SAAS,GAA4C,EAAE,CAAC;IAC9D,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;QAC5D,SAAS,CAAC,IAAI,CAAC,GAAG,iBAAiB,CAAC,IAAI,CAA4B,CAAC;IACvE,CAAC;IACD,+DAA+D;IAC/D,uEAAuE;IACvE,MAAM,QAAQ,GAAG,CAAC,MAAM,CAAC,QAAQ,KAAK,SAAS,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI,CAAC;QACjH,CAAC,CAAE,MAAM,CAAC,QAAoC;QAC9C,CAAC,CAAC,EAAE,CAAC;IACP,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public types for `pyric/sandbox` persistence. The sandbox itself is
|
|
3
|
+
* an in-memory dev Firestore; persistence lets a host (browser
|
|
4
|
+
* playground, agent harness) snapshot the sandbox's data to a backend
|
|
5
|
+
* and restore it on next init — turning the sandbox into the local
|
|
6
|
+
* Firestore for a long-running app session.
|
|
7
|
+
*
|
|
8
|
+
* The IndexedDB backend is the default in browsers; `memory` is the
|
|
9
|
+
* opt-out (same as not enabling persistence at all, but useful for
|
|
10
|
+
* tests that exercise the controller). Future backends (filesystem,
|
|
11
|
+
* remote KV) plug in via the `PersistenceBackend` contract — `key` is
|
|
12
|
+
* always the bucket name.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Minimal web-storage-like contract the session persistence controller
|
|
16
|
+
* reads/writes. Matches the `localStorage` / `sessionStorage` browser
|
|
17
|
+
* API subset that `pyric dev`'s `SessionStore` already uses, so
|
|
18
|
+
* browsers pass real storages and tests pass in-memory Map-backed fakes.
|
|
19
|
+
*
|
|
20
|
+
* Why the minimal subset (get/set/remove) instead of the full
|
|
21
|
+
* `Storage` interface: this library targets multiple environments
|
|
22
|
+
* (browser, Bun, Node) and the full `Storage` interface carries
|
|
23
|
+
* length + key() + clear() that aren't needed here — narrowing the
|
|
24
|
+
* contract keeps tests simple and Node/Bun hosts from having to
|
|
25
|
+
* implement a complete polyfill.
|
|
26
|
+
*/
|
|
27
|
+
export interface WebStorageLike {
|
|
28
|
+
getItem(key: string): string | null;
|
|
29
|
+
setItem(key: string, value: string): void;
|
|
30
|
+
removeItem(key: string): void;
|
|
31
|
+
}
|
|
32
|
+
/** Controller options. See {@link Sandbox.enablePersistence}. */
|
|
33
|
+
export interface SandboxPersistenceOptions {
|
|
34
|
+
/**
|
|
35
|
+
* IndexedDB database name (or generic bucket key for other backends).
|
|
36
|
+
* Different keys persist to different storage locations — use one
|
|
37
|
+
* key per logical sandbox if you run several in parallel.
|
|
38
|
+
*/
|
|
39
|
+
key: string;
|
|
40
|
+
/**
|
|
41
|
+
* Storage backend. `indexedDB` requires a browser environment; in
|
|
42
|
+
* non-browser hosts (Bun, Node, tests) the controller falls back to
|
|
43
|
+
* `memory` automatically unless an `injectedBackend` is supplied.
|
|
44
|
+
* Default: `indexedDB`.
|
|
45
|
+
*/
|
|
46
|
+
backend?: 'indexedDB' | 'memory';
|
|
47
|
+
/**
|
|
48
|
+
* Debounce window before write events are flushed to the backend.
|
|
49
|
+
* Buffers rapid bursts (e.g., a batch of seed writes) into one flush.
|
|
50
|
+
* Default: 250ms.
|
|
51
|
+
*/
|
|
52
|
+
flushIntervalMs?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Override the backend with an injected implementation. Used by tests
|
|
55
|
+
* and hosts that have their own storage adapter. When set, `backend`
|
|
56
|
+
* is ignored.
|
|
57
|
+
*/
|
|
58
|
+
injectedBackend?: PersistenceBackend;
|
|
59
|
+
/**
|
|
60
|
+
* Optional web-storage pair for current-session persistence.
|
|
61
|
+
*
|
|
62
|
+
* When provided, the controller reads and writes the signed-in uid
|
|
63
|
+
* here (honoring the auth `setPersistence` mode) so page reloads
|
|
64
|
+
* restore the signed-in user — exactly like `browserLocalPersistence`
|
|
65
|
+
* in prod Firebase.
|
|
66
|
+
*
|
|
67
|
+
* When omitted, the user DATABASE still persists (Phase 1), but the
|
|
68
|
+
* CURRENT SESSION is not restored on reload. This is the honest
|
|
69
|
+
* no-fake-durability choice for environments where web storage isn't
|
|
70
|
+
* available (Bun tests, Node servers, etc.).
|
|
71
|
+
*
|
|
72
|
+
* `local` maps to `localStorage` semantics (survives reload + restart);
|
|
73
|
+
* `session` maps to `sessionStorage` semantics (survives reload, cleared
|
|
74
|
+
* on tab close). The controller picks which store to write based on the
|
|
75
|
+
* auth `setPersistence` mode recorded on the backend:
|
|
76
|
+
* LOCAL → local (default; matches Firebase's default)
|
|
77
|
+
* SESSION → session
|
|
78
|
+
* NONE → neither (uid is not stored)
|
|
79
|
+
*
|
|
80
|
+
* Both storages are read on restore (mode-agnostic — a prior session
|
|
81
|
+
* may have used a different mode). Exactly one store holds the uid at
|
|
82
|
+
* any time; a mode change migrates the uid to the new store.
|
|
83
|
+
*/
|
|
84
|
+
sessionStorage?: {
|
|
85
|
+
local: WebStorageLike;
|
|
86
|
+
session: WebStorageLike;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Backend contract: read/write/list/delete RECORDS under a key. The controller
|
|
91
|
+
* partitions a snapshot into structured-clone bucket records (chunk-format.ts) so
|
|
92
|
+
* the backend stores many small records natively, never one keyspace-sized blob.
|
|
93
|
+
* Record values are structured-clone-safe objects; the backend never interprets
|
|
94
|
+
* them. (v2 and earlier used a single string blob; v3 is record-shaped.)
|
|
95
|
+
*/
|
|
96
|
+
export interface PersistenceBackend {
|
|
97
|
+
/** Read one record by id under `key`. Resolves `null` when absent. */
|
|
98
|
+
getRecord(key: string, recordId: string): Promise<unknown | null>;
|
|
99
|
+
/** List all record ids under `key`, any order. */
|
|
100
|
+
listRecords(key: string): Promise<string[]>;
|
|
101
|
+
/** Write each `[recordId, value]` under `key`, replacing any prior value. */
|
|
102
|
+
putRecords(key: string, records: ReadonlyMap<string, unknown>): Promise<void>;
|
|
103
|
+
/** Delete the given record ids under `key`. No-op for ids that don't exist. */
|
|
104
|
+
deleteRecords(key: string, recordIds: readonly string[]): Promise<void>;
|
|
105
|
+
/** Remove ALL records under `key`. No-op if none exist. */
|
|
106
|
+
clear(key: string): Promise<void>;
|
|
107
|
+
/**
|
|
108
|
+
* Best-effort storage usage estimate (bytes used + the quota ceiling), or
|
|
109
|
+
* `null` when the backend can't report it. Surfaced by the metadata API so a
|
|
110
|
+
* host can show how close the sandbox is to its storage limit. Optional: a
|
|
111
|
+
* backend that can't estimate simply omits it.
|
|
112
|
+
*/
|
|
113
|
+
estimate?(): Promise<{
|
|
114
|
+
usage: number;
|
|
115
|
+
quota: number;
|
|
116
|
+
} | null>;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/sandbox/persistence/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACpC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,iEAAiE;AACjE,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;OAKG;IACH,OAAO,CAAC,EAAE,WAAW,GAAG,QAAQ,CAAC;IACjC;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,eAAe,CAAC,EAAE,kBAAkB,CAAC;IAErC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,cAAc,CAAC,EAAE;QACf,KAAK,EAAE,cAAc,CAAC;QACtB,OAAO,EAAE,cAAc,CAAC;KACzB,CAAC;CACH;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,sEAAsE;IACtE,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IAClE,kDAAkD;IAClD,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5C,6EAA6E;IAC7E,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9E,+EAA+E;IAC/E,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxE,2DAA2D;IAC3D,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;CAC/D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public types for `pyric/sandbox` persistence. The sandbox itself is
|
|
3
|
+
* an in-memory dev Firestore; persistence lets a host (browser
|
|
4
|
+
* playground, agent harness) snapshot the sandbox's data to a backend
|
|
5
|
+
* and restore it on next init — turning the sandbox into the local
|
|
6
|
+
* Firestore for a long-running app session.
|
|
7
|
+
*
|
|
8
|
+
* The IndexedDB backend is the default in browsers; `memory` is the
|
|
9
|
+
* opt-out (same as not enabling persistence at all, but useful for
|
|
10
|
+
* tests that exercise the controller). Future backends (filesystem,
|
|
11
|
+
* remote KV) plug in via the `PersistenceBackend` contract — `key` is
|
|
12
|
+
* always the bucket name.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/sandbox/persistence/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remote-sandbox brand + channel contract (remote sandbox, slice 1).
|
|
3
|
+
*
|
|
4
|
+
* A REMOTE sandbox is a Node-side handle onto the browser-hosted
|
|
5
|
+
* SharedWorker sandbox, constructed by `pyric-tools`'s
|
|
6
|
+
* `connectRemoteSandbox()`. It satisfies {@link Sandbox} structurally, but
|
|
7
|
+
* its data plane lives in the browser worker — so consumers that keep
|
|
8
|
+
* process-local state keyed off the `Sandbox` object (`pyric-admin`'s RTDB
|
|
9
|
+
* and Auth sandbox backends) must NOT treat it like an in-process sandbox:
|
|
10
|
+
* doing so would create a private server-side data store that never reaches
|
|
11
|
+
* the browser.
|
|
12
|
+
*
|
|
13
|
+
* This module is the dependency seam that lets `pyric-admin` (which depends
|
|
14
|
+
* only on `pyric` + `firebase-admin`) recognize a handle constructed by
|
|
15
|
+
* `pyric-tools` (which depends on `pyric`):
|
|
16
|
+
*
|
|
17
|
+
* - {@link REMOTE_SANDBOX} — a `Symbol.for` brand, so the stamp and the
|
|
18
|
+
* check agree across package boundaries and duplicated module graphs.
|
|
19
|
+
* - {@link RemoteSandboxChannel} — a STRUCTURALLY-typed minimal op/sub
|
|
20
|
+
* relay interface matching `pyric-tools/remote`'s channel shape. The
|
|
21
|
+
* concrete op/sub payload types live in `pyric-tools`' worker protocol;
|
|
22
|
+
* this contract deliberately types them loosely (`method` + open
|
|
23
|
+
* fields) so `pyric` carries no dependency on `pyric-tools`.
|
|
24
|
+
*
|
|
25
|
+
* No runtime imports beyond this package's own types — the only runtime
|
|
26
|
+
* export is the brand symbol and its guard.
|
|
27
|
+
*/
|
|
28
|
+
import type { Sandbox } from './types.js';
|
|
29
|
+
/**
|
|
30
|
+
* Brand stamped (value `true`) on every remote sandbox handle.
|
|
31
|
+
* `Symbol.for` — registered globally so `pyric-admin`'s check matches the
|
|
32
|
+
* stamp even if two copies of `pyric` end up in one process.
|
|
33
|
+
*/
|
|
34
|
+
export declare const REMOTE_SANDBOX: unique symbol;
|
|
35
|
+
/**
|
|
36
|
+
* The minimal worker-relay channel a remote sandbox handle carries.
|
|
37
|
+
*
|
|
38
|
+
* Structural mirror of `pyric-tools/remote`'s `RemoteSandboxChannel`: one
|
|
39
|
+
* method to dispatch any SharedWorker-protocol op, one to register a
|
|
40
|
+
* snap-delivering subscription. Payloads are typed openly here (the real
|
|
41
|
+
* discriminated unions live in `pyric-tools`' worker protocol); callers in
|
|
42
|
+
* `pyric-admin` spell the concrete op objects (`rtdb.set`, `auth.listUsers`,
|
|
43
|
+
* …) and pin their own `actAs` lens — nothing is pinned by the channel.
|
|
44
|
+
*/
|
|
45
|
+
export interface RemoteSandboxChannel {
|
|
46
|
+
/**
|
|
47
|
+
* Dispatch one worker op. Resolves with the worker's result value;
|
|
48
|
+
* rejects with an `Error` carrying a `.code` (including the fail-fast
|
|
49
|
+
* "no browser tab is connected — open <serve url>" guidance when no
|
|
50
|
+
* peer is registered).
|
|
51
|
+
*/
|
|
52
|
+
op(op: {
|
|
53
|
+
method: string;
|
|
54
|
+
} & Record<string, unknown>): Promise<unknown>;
|
|
55
|
+
/**
|
|
56
|
+
* Register a worker subscription (e.g. an RTDB value listener:
|
|
57
|
+
* `{ target: { service: 'rtdb', path } }`). `onSnap` receives every snap
|
|
58
|
+
* value (initial + updates — and re-delivered fresh after peer
|
|
59
|
+
* replacement); an establishment failure routes to `onError` instead.
|
|
60
|
+
* Returns the unsubscribe function.
|
|
61
|
+
*/
|
|
62
|
+
subscribe(sub: {
|
|
63
|
+
target: unknown;
|
|
64
|
+
} & Record<string, unknown>, onSnap: (value: unknown) => void, onError?: (err: Error & {
|
|
65
|
+
code: string;
|
|
66
|
+
}) => void): () => void;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A branded remote sandbox handle. Structurally a {@link Sandbox} — it can
|
|
70
|
+
* be passed anywhere a `Sandbox` is accepted (notably
|
|
71
|
+
* `pyric-admin/app`'s `initializeApp({ sandbox })`) — but sync-only members
|
|
72
|
+
* that cannot be mirrored over the wire (`admin`, `snapshot()`,
|
|
73
|
+
* `history()`, …) throw a remediating error. Consumers with a remote arm
|
|
74
|
+
* dispatch on {@link isRemoteSandbox} and use {@link channel} instead.
|
|
75
|
+
*/
|
|
76
|
+
export interface RemoteSandbox extends Sandbox {
|
|
77
|
+
readonly [REMOTE_SANDBOX]: true;
|
|
78
|
+
/** Base URL of the `pyric dev` this handle is attached to (used in
|
|
79
|
+
* error guidance: "open <serveUrl> in a browser and retry"). */
|
|
80
|
+
readonly serveUrl: string;
|
|
81
|
+
/** The raw worker op/sub relay channel. */
|
|
82
|
+
readonly channel: RemoteSandboxChannel;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Well-known global key under which `pyric-tools/register` installs the
|
|
86
|
+
* remote-sandbox factory: `globalThis[REMOTE_SANDBOX_FACTORY]`.
|
|
87
|
+
*
|
|
88
|
+
* This is the AMBIENT-INIT seam (adoption experience, layer 3): when
|
|
89
|
+
* `pyric-admin/app`'s bare `initializeApp()` sees `PYRIC_SANDBOX=remote[:url]`
|
|
90
|
+
* it reads this global and calls the installed {@link RemoteSandboxFactory}
|
|
91
|
+
* to obtain the branded handle — without importing `pyric-tools` (which is
|
|
92
|
+
* a devDependency of the app, not of `pyric-admin`). `Symbol.for` so the
|
|
93
|
+
* installer and the reader agree even across duplicated copies of `pyric`.
|
|
94
|
+
*/
|
|
95
|
+
export declare const REMOTE_SANDBOX_FACTORY: unique symbol;
|
|
96
|
+
/** Options accepted by the ambient remote-sandbox factory. */
|
|
97
|
+
export interface RemoteSandboxFactoryOptions {
|
|
98
|
+
/** Explicit `pyric dev` base URL (from `PYRIC_SANDBOX=remote:<url>`).
|
|
99
|
+
* When omitted the factory discovers the running host itself (the
|
|
100
|
+
* `.pyric/serve.json` locator protocol). */
|
|
101
|
+
url?: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The factory `pyric-tools/register` installs at
|
|
105
|
+
* `globalThis[`{@link REMOTE_SANDBOX_FACTORY}`]`. SYNCHRONOUS by contract:
|
|
106
|
+
* `initializeApp()` is sync in firebase-admin, so the factory must return
|
|
107
|
+
* the branded handle without awaiting (connection establishment may be
|
|
108
|
+
* lazy inside the handle's channel).
|
|
109
|
+
*/
|
|
110
|
+
export type RemoteSandboxFactory = (opts?: RemoteSandboxFactoryOptions) => RemoteSandbox;
|
|
111
|
+
/**
|
|
112
|
+
* Is this sandbox a remote handle? Backend dispatch guard for consumers
|
|
113
|
+
* (e.g. `pyric-admin`'s RTDB/Auth sandbox backends) that must route a
|
|
114
|
+
* remote sandbox's operations through {@link RemoteSandbox.channel} rather
|
|
115
|
+
* than into process-local state.
|
|
116
|
+
*/
|
|
117
|
+
export declare function isRemoteSandbox(sandbox: Sandbox): sandbox is RemoteSandbox;
|
|
118
|
+
//# sourceMappingURL=remote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/sandbox/remote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C;;;;GAIG;AACH,eAAO,MAAM,cAAc,eAAqC,CAAC;AAEjE;;;;;;;;;GASG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,EAAE,CAAC,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEvE;;;;;;OAMG;IACH,SAAS,CACP,GAAG,EAAE;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClD,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,EAChC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,GAChD,MAAM,IAAI,CAAC;CACf;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,aAAc,SAAQ,OAAO;IAC5C,QAAQ,CAAC,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC;IAChC;qEACiE;IACjE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,2CAA2C;IAC3C,QAAQ,CAAC,OAAO,EAAE,oBAAoB,CAAC;CACxC;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,eAA4C,CAAC;AAEhF,8DAA8D;AAC9D,MAAM,WAAW,2BAA2B;IAC1C;;iDAE6C;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG,CACjC,IAAI,CAAC,EAAE,2BAA2B,KAC/B,aAAa,CAAC;AAEnB;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,aAAa,CAW1E"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remote-sandbox brand + channel contract (remote sandbox, slice 1).
|
|
3
|
+
*
|
|
4
|
+
* A REMOTE sandbox is a Node-side handle onto the browser-hosted
|
|
5
|
+
* SharedWorker sandbox, constructed by `pyric-tools`'s
|
|
6
|
+
* `connectRemoteSandbox()`. It satisfies {@link Sandbox} structurally, but
|
|
7
|
+
* its data plane lives in the browser worker — so consumers that keep
|
|
8
|
+
* process-local state keyed off the `Sandbox` object (`pyric-admin`'s RTDB
|
|
9
|
+
* and Auth sandbox backends) must NOT treat it like an in-process sandbox:
|
|
10
|
+
* doing so would create a private server-side data store that never reaches
|
|
11
|
+
* the browser.
|
|
12
|
+
*
|
|
13
|
+
* This module is the dependency seam that lets `pyric-admin` (which depends
|
|
14
|
+
* only on `pyric` + `firebase-admin`) recognize a handle constructed by
|
|
15
|
+
* `pyric-tools` (which depends on `pyric`):
|
|
16
|
+
*
|
|
17
|
+
* - {@link REMOTE_SANDBOX} — a `Symbol.for` brand, so the stamp and the
|
|
18
|
+
* check agree across package boundaries and duplicated module graphs.
|
|
19
|
+
* - {@link RemoteSandboxChannel} — a STRUCTURALLY-typed minimal op/sub
|
|
20
|
+
* relay interface matching `pyric-tools/remote`'s channel shape. The
|
|
21
|
+
* concrete op/sub payload types live in `pyric-tools`' worker protocol;
|
|
22
|
+
* this contract deliberately types them loosely (`method` + open
|
|
23
|
+
* fields) so `pyric` carries no dependency on `pyric-tools`.
|
|
24
|
+
*
|
|
25
|
+
* No runtime imports beyond this package's own types — the only runtime
|
|
26
|
+
* export is the brand symbol and its guard.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Brand stamped (value `true`) on every remote sandbox handle.
|
|
30
|
+
* `Symbol.for` — registered globally so `pyric-admin`'s check matches the
|
|
31
|
+
* stamp even if two copies of `pyric` end up in one process.
|
|
32
|
+
*/
|
|
33
|
+
export const REMOTE_SANDBOX = Symbol.for('pyric.remote.sandbox');
|
|
34
|
+
/**
|
|
35
|
+
* Well-known global key under which `pyric-tools/register` installs the
|
|
36
|
+
* remote-sandbox factory: `globalThis[REMOTE_SANDBOX_FACTORY]`.
|
|
37
|
+
*
|
|
38
|
+
* This is the AMBIENT-INIT seam (adoption experience, layer 3): when
|
|
39
|
+
* `pyric-admin/app`'s bare `initializeApp()` sees `PYRIC_SANDBOX=remote[:url]`
|
|
40
|
+
* it reads this global and calls the installed {@link RemoteSandboxFactory}
|
|
41
|
+
* to obtain the branded handle — without importing `pyric-tools` (which is
|
|
42
|
+
* a devDependency of the app, not of `pyric-admin`). `Symbol.for` so the
|
|
43
|
+
* installer and the reader agree even across duplicated copies of `pyric`.
|
|
44
|
+
*/
|
|
45
|
+
export const REMOTE_SANDBOX_FACTORY = Symbol.for('pyric.remote.sandboxFactory');
|
|
46
|
+
/**
|
|
47
|
+
* Is this sandbox a remote handle? Backend dispatch guard for consumers
|
|
48
|
+
* (e.g. `pyric-admin`'s RTDB/Auth sandbox backends) that must route a
|
|
49
|
+
* remote sandbox's operations through {@link RemoteSandbox.channel} rather
|
|
50
|
+
* than into process-local state.
|
|
51
|
+
*/
|
|
52
|
+
export function isRemoteSandbox(sandbox) {
|
|
53
|
+
// Null-safe by contract: guard call sites probe values that may not be a
|
|
54
|
+
// Sandbox at all (e.g. legacy callers passing a raw Sandbox where a
|
|
55
|
+
// SandboxContext is expected leave `.sandbox` undefined). A brand check
|
|
56
|
+
// must classify, never throw.
|
|
57
|
+
return (sandbox != null &&
|
|
58
|
+
sandbox[REMOTE_SANDBOX] === true);
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=remote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../../src/sandbox/remote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;AAoDjE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;AAqBhF;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,OAAgB;IAC9C,yEAAyE;IACzE,oEAAoE;IACpE,wEAAwE;IACxE,8BAA8B;IAC9B,OAAO,CACL,OAAO,IAAI,IAAI;QACd,OAA2D,CAC1D,cAAc,CACf,KAAK,IAAI,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replay — capture a session via `sandbox.history()` and re-issue
|
|
3
|
+
* every write against a fresh sandbox; the engine classifies any
|
|
4
|
+
* divergences.
|
|
5
|
+
*
|
|
6
|
+
* Exported from the main `pyric/sandbox` entry. The file lives at
|
|
7
|
+
* `src/replay/index.ts` as an organizational unit; importers use
|
|
8
|
+
* the public bare-package import path.
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { initializeSandbox, replay, type SandboxEvent } from 'pyric/sandbox';
|
|
13
|
+
*
|
|
14
|
+
* const original = initializeSandbox();
|
|
15
|
+
* // ... do work, capture events via original.history() ...
|
|
16
|
+
* const events = original.history();
|
|
17
|
+
*
|
|
18
|
+
* const { sandbox: replayed, divergences } = replay(events, rulesSource);
|
|
19
|
+
* // `replayed` is a fresh sandbox with every captured write re-applied.
|
|
20
|
+
* // `divergences` classifies any field-level differences.
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* Each captured `WriteSandboxEvent` is re-issued on the fresh sandbox.
|
|
24
|
+
* The engine consults the captured `sentinels`, `autoId`, and
|
|
25
|
+
* `requestTime` fields so:
|
|
26
|
+
* - `serverTimestamp()` sentinels re-resolve to the captured time
|
|
27
|
+
* (when `pinRequestTime: true`, the default).
|
|
28
|
+
* - `collection.add()` minted IDs alias to fresh mints on replay;
|
|
29
|
+
* `pathAliases` maps the original path → the replayed path.
|
|
30
|
+
* - rules that branch on `request.time` re-evaluate identically
|
|
31
|
+
* (pinned time).
|
|
32
|
+
*
|
|
33
|
+
* Divergence classification (deterministic — no shape inference):
|
|
34
|
+
* - `autoid-alias` — path differs because of fresh ID minting,
|
|
35
|
+
* otherwise content matches.
|
|
36
|
+
* - `sentinel-drift` — a captured sentinel sits at this exact field
|
|
37
|
+
* path (e.g. an `increment` at `tags`) and the
|
|
38
|
+
* subtree differs.
|
|
39
|
+
* - `time-drift` — like `sentinel-drift` but specifically a
|
|
40
|
+
* captured `serverTimestamp`. Surfaces when
|
|
41
|
+
* `pinRequestTime: false` and the wall clock
|
|
42
|
+
* advanced between capture and replay.
|
|
43
|
+
* - `real-divergence` — anything else. If the captured metadata
|
|
44
|
+
* doesn't license drift at this exact leaf,
|
|
45
|
+
* the engine flags it.
|
|
46
|
+
*
|
|
47
|
+
* Field-level diffs use a recursive walk producing dotted/bracket
|
|
48
|
+
* leaf paths (`profile.lastSeen`, `tags[0]`, `arr[2].nested`). A
|
|
49
|
+
* sentinel match is *exact-path*, not prefix — a sibling field
|
|
50
|
+
* changing inside a sentinel-bearing parent surfaces independently as
|
|
51
|
+
* `real-divergence`.
|
|
52
|
+
*/
|
|
53
|
+
import { type Sandbox, type SandboxEvent } from '../index.js';
|
|
54
|
+
type DocData = Record<string, unknown>;
|
|
55
|
+
export type Divergence = {
|
|
56
|
+
kind: 'sentinel-drift';
|
|
57
|
+
path: string;
|
|
58
|
+
field: string;
|
|
59
|
+
sentinelKind: 'serverTimestamp' | 'increment' | 'arrayUnion' | 'arrayRemove' | 'delete';
|
|
60
|
+
before: unknown;
|
|
61
|
+
after: unknown;
|
|
62
|
+
} | {
|
|
63
|
+
kind: 'autoid-alias';
|
|
64
|
+
originalPath: string;
|
|
65
|
+
replayedPath: string;
|
|
66
|
+
} | {
|
|
67
|
+
kind: 'time-drift';
|
|
68
|
+
path: string;
|
|
69
|
+
field: string;
|
|
70
|
+
before: unknown;
|
|
71
|
+
after: unknown;
|
|
72
|
+
} | {
|
|
73
|
+
kind: 'real-divergence';
|
|
74
|
+
path: string;
|
|
75
|
+
field?: string;
|
|
76
|
+
before: unknown;
|
|
77
|
+
after: unknown;
|
|
78
|
+
};
|
|
79
|
+
export interface ReplayOptions {
|
|
80
|
+
/** When true (default), re-issue the captured `requestTime` so
|
|
81
|
+
* `serverTimestamp()` sentinels resolve to the same value as
|
|
82
|
+
* capture and `request.time`-gated rules evaluate identically. */
|
|
83
|
+
pinRequestTime?: boolean;
|
|
84
|
+
}
|
|
85
|
+
export interface ReplayResult {
|
|
86
|
+
/** Fresh sandbox with the captured writes re-applied. */
|
|
87
|
+
sandbox: Sandbox;
|
|
88
|
+
/** Field- and path-level differences between original and replayed
|
|
89
|
+
* state, classified. */
|
|
90
|
+
divergences: Divergence[];
|
|
91
|
+
/** Maps captured auto-id paths → freshly-minted replay paths. The
|
|
92
|
+
* diff classifier uses this to skip `autoid-alias` paths when
|
|
93
|
+
* computing field-level differences. */
|
|
94
|
+
pathAliases: Map<string, string>;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Replay a captured SandboxEvent stream on a fresh sandbox.
|
|
98
|
+
*
|
|
99
|
+
* The `originalState` snapshot is optional — when provided, the engine
|
|
100
|
+
* diffs the replayed sandbox's final state against it and returns
|
|
101
|
+
* classified divergences. When omitted, divergences is `[]` (you still
|
|
102
|
+
* get the replayed sandbox; you can inspect its state manually).
|
|
103
|
+
*/
|
|
104
|
+
export declare function replay(events: readonly SandboxEvent[], rules: string, options?: ReplayOptions, originalState?: Record<string, DocData>): ReplayResult;
|
|
105
|
+
export {};
|
|
106
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sandbox/replay/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,YAAY,EAElB,MAAM,aAAa,CAAC;AAIrB,KAAK,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEvC,MAAM,MAAM,UAAU,GAClB;IACE,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EACR,iBAAiB,GACjB,WAAW,GACX,YAAY,GACZ,aAAa,GACb,QAAQ,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAChB,GACD;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACpE;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACpF;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC;AAE/F,MAAM,WAAW,aAAa;IAC5B;;uEAEmE;IACnE,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B,yDAAyD;IACzD,OAAO,EAAE,OAAO,CAAC;IACjB;6BACyB;IACzB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B;;6CAEyC;IACzC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CACpB,MAAM,EAAE,SAAS,YAAY,EAAE,EAC/B,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,aAAkB,EAC3B,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACtC,YAAY,CAuDd"}
|