ramosedb 0.0.1 → 0.4.0
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/LICENSE +202 -0
- package/NOTICE +17 -0
- package/README.md +57 -2
- package/dist/Auth.d.ts +55 -0
- package/dist/Auth.d.ts.map +1 -0
- package/dist/Auth.js +50 -0
- package/dist/Auth.js.map +1 -0
- package/dist/Database.d.ts +40 -0
- package/dist/Database.d.ts.map +1 -0
- package/dist/Database.js +62 -0
- package/dist/Database.js.map +1 -0
- package/dist/Providers.d.ts +8 -0
- package/dist/Providers.d.ts.map +1 -0
- package/dist/Providers.js +9 -0
- package/dist/Providers.js.map +1 -0
- package/dist/RamoseEnv.d.ts +37 -0
- package/dist/RamoseEnv.d.ts.map +1 -0
- package/dist/RamoseEnv.js +2 -0
- package/dist/RamoseEnv.js.map +1 -0
- package/dist/Server.d.ts +100 -0
- package/dist/Server.d.ts.map +1 -0
- package/dist/Server.js +263 -0
- package/dist/Server.js.map +1 -0
- package/dist/ServerRuntime.d.ts +10 -0
- package/dist/ServerRuntime.d.ts.map +1 -0
- package/dist/ServerRuntime.js +11 -0
- package/dist/ServerRuntime.js.map +1 -0
- package/dist/better-auth/client.d.ts +19 -0
- package/dist/better-auth/client.d.ts.map +1 -0
- package/dist/better-auth/client.js +110 -0
- package/dist/better-auth/client.js.map +1 -0
- package/dist/better-auth/index.d.ts +140 -0
- package/dist/better-auth/index.d.ts.map +1 -0
- package/dist/better-auth/index.js +168 -0
- package/dist/better-auth/index.js.map +1 -0
- package/dist/client/activation.d.ts +2 -0
- package/dist/client/activation.d.ts.map +1 -0
- package/dist/client/activation.js +33 -0
- package/dist/client/activation.js.map +1 -0
- package/dist/client/catalog.d.ts +15 -0
- package/dist/client/catalog.d.ts.map +1 -0
- package/dist/client/catalog.js +48 -0
- package/dist/client/catalog.js.map +1 -0
- package/dist/client/changesets.d.ts +85 -0
- package/dist/client/changesets.d.ts.map +1 -0
- package/dist/client/changesets.js +160 -0
- package/dist/client/changesets.js.map +1 -0
- package/dist/client/client.d.ts +45 -0
- package/dist/client/client.d.ts.map +1 -0
- package/dist/client/client.js +425 -0
- package/dist/client/client.js.map +1 -0
- package/dist/client/database.d.ts +163 -0
- package/dist/client/database.d.ts.map +1 -0
- package/dist/client/database.js +795 -0
- package/dist/client/database.js.map +1 -0
- package/dist/client/entity.d.ts +63 -0
- package/dist/client/entity.d.ts.map +1 -0
- package/dist/client/entity.js +141 -0
- package/dist/client/entity.js.map +1 -0
- package/dist/client/errors.d.ts +67 -0
- package/dist/client/errors.d.ts.map +1 -0
- package/dist/client/errors.js +39 -0
- package/dist/client/errors.js.map +1 -0
- package/dist/client/index.d.ts +13 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +6 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/mutation-schema.d.ts +92 -0
- package/dist/client/mutation-schema.d.ts.map +1 -0
- package/dist/client/mutation-schema.js +2 -0
- package/dist/client/mutation-schema.js.map +1 -0
- package/dist/client/mutation.d.ts +25 -0
- package/dist/client/mutation.d.ts.map +1 -0
- package/dist/client/mutation.js +75 -0
- package/dist/client/mutation.js.map +1 -0
- package/dist/client/operations.d.ts +39 -0
- package/dist/client/operations.d.ts.map +1 -0
- package/dist/client/operations.js +183 -0
- package/dist/client/operations.js.map +1 -0
- package/dist/client/query.d.ts +53 -0
- package/dist/client/query.d.ts.map +1 -0
- package/dist/client/query.js +85 -0
- package/dist/client/query.js.map +1 -0
- package/dist/client/receipt.d.ts +53 -0
- package/dist/client/receipt.d.ts.map +1 -0
- package/dist/client/receipt.js +79 -0
- package/dist/client/receipt.js.map +1 -0
- package/dist/client/submission.d.ts +44 -0
- package/dist/client/submission.d.ts.map +1 -0
- package/dist/client/submission.js +165 -0
- package/dist/client/submission.js.map +1 -0
- package/dist/client/subscription.d.ts +18 -0
- package/dist/client/subscription.d.ts.map +1 -0
- package/dist/client/subscription.js +75 -0
- package/dist/client/subscription.js.map +1 -0
- package/dist/client/sync.d.ts +32 -0
- package/dist/client/sync.d.ts.map +1 -0
- package/dist/client/sync.js +34 -0
- package/dist/client/sync.js.map +1 -0
- package/dist/client/view.d.ts +37 -0
- package/dist/client/view.d.ts.map +1 -0
- package/dist/client/view.js +112 -0
- package/dist/client/view.js.map +1 -0
- package/dist/db/Binding.d.ts +79 -0
- package/dist/db/Binding.d.ts.map +1 -0
- package/dist/db/Binding.js +138 -0
- package/dist/db/Binding.js.map +1 -0
- package/dist/db/Composer.d.ts +7 -0
- package/dist/db/Composer.d.ts.map +1 -0
- package/dist/db/Composer.js +6 -0
- package/dist/db/Composer.js.map +1 -0
- package/dist/db/DatabaseName.d.ts +7 -0
- package/dist/db/DatabaseName.d.ts.map +1 -0
- package/dist/db/DatabaseName.js +9 -0
- package/dist/db/DatabaseName.js.map +1 -0
- package/dist/db/Eid.d.ts +19 -0
- package/dist/db/Eid.d.ts.map +1 -0
- package/dist/db/Eid.js +2 -0
- package/dist/db/Eid.js.map +1 -0
- package/dist/db/Entity.d.ts +133 -0
- package/dist/db/Entity.d.ts.map +1 -0
- package/dist/db/Entity.js +104 -0
- package/dist/db/Entity.js.map +1 -0
- package/dist/db/Errors.d.ts +138 -0
- package/dist/db/Errors.d.ts.map +1 -0
- package/dist/db/Errors.js +171 -0
- package/dist/db/Errors.js.map +1 -0
- package/dist/db/Field.d.ts +170 -0
- package/dist/db/Field.d.ts.map +1 -0
- package/dist/db/Field.js +187 -0
- package/dist/db/Field.js.map +1 -0
- package/dist/db/IdentName.d.ts +94 -0
- package/dist/db/IdentName.d.ts.map +1 -0
- package/dist/db/IdentName.js +34 -0
- package/dist/db/IdentName.js.map +1 -0
- package/dist/db/Operation.d.ts +441 -0
- package/dist/db/Operation.d.ts.map +1 -0
- package/dist/db/Operation.js +237 -0
- package/dist/db/Operation.js.map +1 -0
- package/dist/db/Projection.d.ts +97 -0
- package/dist/db/Projection.d.ts.map +1 -0
- package/dist/db/Projection.js +183 -0
- package/dist/db/Projection.js.map +1 -0
- package/dist/db/Pull.d.ts +361 -0
- package/dist/db/Pull.d.ts.map +1 -0
- package/dist/db/Pull.js +547 -0
- package/dist/db/Pull.js.map +1 -0
- package/dist/db/Schema.d.ts +37 -0
- package/dist/db/Schema.d.ts.map +1 -0
- package/dist/db/Schema.js +94 -0
- package/dist/db/Schema.js.map +1 -0
- package/dist/db/Trait.d.ts +129 -0
- package/dist/db/Trait.d.ts.map +1 -0
- package/dist/db/Trait.js +65 -0
- package/dist/db/Trait.js.map +1 -0
- package/dist/db/Tx.d.ts +128 -0
- package/dist/db/Tx.d.ts.map +1 -0
- package/dist/db/Tx.js +248 -0
- package/dist/db/Tx.js.map +1 -0
- package/dist/db/allocations.d.ts +44 -0
- package/dist/db/allocations.d.ts.map +1 -0
- package/dist/db/allocations.js +70 -0
- package/dist/db/allocations.js.map +1 -0
- package/dist/db/attrRef.d.ts +5 -0
- package/dist/db/attrRef.d.ts.map +1 -0
- package/dist/db/attrRef.js +6 -0
- package/dist/db/attrRef.js.map +1 -0
- package/dist/db/compose.d.ts +26 -0
- package/dist/db/compose.d.ts.map +1 -0
- package/dist/db/compose.js +105 -0
- package/dist/db/compose.js.map +1 -0
- package/dist/db/composition.d.ts +4 -0
- package/dist/db/composition.d.ts.map +1 -0
- package/dist/db/composition.js +24 -0
- package/dist/db/composition.js.map +1 -0
- package/dist/db/creation.d.ts +102 -0
- package/dist/db/creation.d.ts.map +1 -0
- package/dist/db/creation.js +448 -0
- package/dist/db/creation.js.map +1 -0
- package/dist/db/deployedSchema.d.ts +12 -0
- package/dist/db/deployedSchema.d.ts.map +1 -0
- package/dist/db/deployedSchema.js +80 -0
- package/dist/db/deployedSchema.js.map +1 -0
- package/dist/db/documentation.d.ts +4 -0
- package/dist/db/documentation.d.ts.map +1 -0
- package/dist/db/documentation.js +4 -0
- package/dist/db/documentation.js.map +1 -0
- package/dist/db/ensure.d.ts +16 -0
- package/dist/db/ensure.d.ts.map +1 -0
- package/dist/db/ensure.js +48 -0
- package/dist/db/ensure.js.map +1 -0
- package/dist/db/entityArg.d.ts +15 -0
- package/dist/db/entityArg.d.ts.map +1 -0
- package/dist/db/entityArg.js +71 -0
- package/dist/db/entityArg.js.map +1 -0
- package/dist/db/equal.d.ts +4 -0
- package/dist/db/equal.d.ts.map +1 -0
- package/dist/db/equal.js +2 -0
- package/dist/db/equal.js.map +1 -0
- package/dist/db/idents.d.ts +90 -0
- package/dist/db/idents.d.ts.map +1 -0
- package/dist/db/idents.js +2 -0
- package/dist/db/idents.js.map +1 -0
- package/dist/db/index.d.ts +27 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +20 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/internal.d.ts +27 -0
- package/dist/db/internal.d.ts.map +1 -0
- package/dist/db/internal.js +27 -0
- package/dist/db/internal.js.map +1 -0
- package/dist/db/query/cursor.d.ts +13 -0
- package/dist/db/query/cursor.d.ts.map +1 -0
- package/dist/db/query/cursor.js +150 -0
- package/dist/db/query/cursor.js.map +1 -0
- package/dist/db/query/elemFilter.d.ts +7 -0
- package/dist/db/query/elemFilter.d.ts.map +1 -0
- package/dist/db/query/elemFilter.js +280 -0
- package/dist/db/query/elemFilter.js.map +1 -0
- package/dist/db/query/fluent.d.ts +92 -0
- package/dist/db/query/fluent.d.ts.map +1 -0
- package/dist/db/query/fluent.js +125 -0
- package/dist/db/query/fluent.js.map +1 -0
- package/dist/db/query/focus.d.ts +42 -0
- package/dist/db/query/focus.d.ts.map +1 -0
- package/dist/db/query/focus.js +2 -0
- package/dist/db/query/focus.js.map +1 -0
- package/dist/db/query/index.d.ts +7 -0
- package/dist/db/query/index.d.ts.map +1 -0
- package/dist/db/query/index.js +6 -0
- package/dist/db/query/index.js.map +1 -0
- package/dist/db/query/kernel.d.ts +215 -0
- package/dist/db/query/kernel.d.ts.map +1 -0
- package/dist/db/query/kernel.js +284 -0
- package/dist/db/query/kernel.js.map +1 -0
- package/dist/db/query/lib.d.ts +168 -0
- package/dist/db/query/lib.d.ts.map +1 -0
- package/dist/db/query/lib.js +175 -0
- package/dist/db/query/lib.js.map +1 -0
- package/dist/db/query/query.d.ts +209 -0
- package/dist/db/query/query.d.ts.map +1 -0
- package/dist/db/query/query.js +1536 -0
- package/dist/db/query/query.js.map +1 -0
- package/dist/db/query/stdlib/failures.d.ts +91 -0
- package/dist/db/query/stdlib/failures.d.ts.map +1 -0
- package/dist/db/query/stdlib/failures.js +57 -0
- package/dist/db/query/stdlib/failures.js.map +1 -0
- package/dist/db/query/stdlib/implementations.d.ts +5 -0
- package/dist/db/query/stdlib/implementations.d.ts.map +1 -0
- package/dist/db/query/stdlib/implementations.js +208 -0
- package/dist/db/query/stdlib/implementations.js.map +1 -0
- package/dist/db/query/stdlib/index.d.ts +6 -0
- package/dist/db/query/stdlib/index.d.ts.map +1 -0
- package/dist/db/query/stdlib/index.js +6 -0
- package/dist/db/query/stdlib/index.js.map +1 -0
- package/dist/db/query/stdlib/manifest.d.ts +3 -0
- package/dist/db/query/stdlib/manifest.d.ts.map +1 -0
- package/dist/db/query/stdlib/manifest.js +1067 -0
- package/dist/db/query/stdlib/manifest.js.map +1 -0
- package/dist/db/query/stdlib/registry.d.ts +22 -0
- package/dist/db/query/stdlib/registry.d.ts.map +1 -0
- package/dist/db/query/stdlib/registry.js +144 -0
- package/dist/db/query/stdlib/registry.js.map +1 -0
- package/dist/db/query/stdlib/types.d.ts +50 -0
- package/dist/db/query/stdlib/types.d.ts.map +1 -0
- package/dist/db/query/stdlib/types.js +17 -0
- package/dist/db/query/stdlib/types.js.map +1 -0
- package/dist/db/query/stdlib/values.d.ts +17 -0
- package/dist/db/query/stdlib/values.d.ts.map +1 -0
- package/dist/db/query/stdlib/values.js +200 -0
- package/dist/db/query/stdlib/values.js.map +1 -0
- package/dist/db/query/surface.d.ts +15 -0
- package/dist/db/query/surface.d.ts.map +1 -0
- package/dist/db/query/surface.js +14 -0
- package/dist/db/query/surface.js.map +1 -0
- package/dist/db/reachability.d.ts +40 -0
- package/dist/db/reachability.d.ts.map +1 -0
- package/dist/db/reachability.js +118 -0
- package/dist/db/reachability.js.map +1 -0
- package/dist/db/refs.d.ts +46 -0
- package/dist/db/refs.d.ts.map +1 -0
- package/dist/db/refs.js +69 -0
- package/dist/db/refs.js.map +1 -0
- package/dist/db/shapes.d.ts +227 -0
- package/dist/db/shapes.d.ts.map +1 -0
- package/dist/db/shapes.js +246 -0
- package/dist/db/shapes.js.map +1 -0
- package/dist/db/valueTypes.d.ts +92 -0
- package/dist/db/valueTypes.d.ts.map +1 -0
- package/dist/db/valueTypes.js +105 -0
- package/dist/db/valueTypes.js.map +1 -0
- package/dist/errorHttp.d.ts +27 -0
- package/dist/errorHttp.d.ts.map +1 -0
- package/dist/errorHttp.js +95 -0
- package/dist/errorHttp.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/authorization/authoring/compile.d.ts +132 -0
- package/dist/internal/authorization/authoring/compile.d.ts.map +1 -0
- package/dist/internal/authorization/authoring/compile.js +634 -0
- package/dist/internal/authorization/authoring/compile.js.map +1 -0
- package/dist/internal/authorization/authoring/expr.d.ts +25 -0
- package/dist/internal/authorization/authoring/expr.d.ts.map +1 -0
- package/dist/internal/authorization/authoring/expr.js +56 -0
- package/dist/internal/authorization/authoring/expr.js.map +1 -0
- package/dist/internal/authorization/authoring/index.d.ts +10 -0
- package/dist/internal/authorization/authoring/index.d.ts.map +1 -0
- package/dist/internal/authorization/authoring/index.js +8 -0
- package/dist/internal/authorization/authoring/index.js.map +1 -0
- package/dist/internal/authorization/authoring/invoke.d.ts +8 -0
- package/dist/internal/authorization/authoring/invoke.d.ts.map +1 -0
- package/dist/internal/authorization/authoring/invoke.js +7 -0
- package/dist/internal/authorization/authoring/invoke.js.map +1 -0
- package/dist/internal/authorization/authoring/operations.d.ts +81 -0
- package/dist/internal/authorization/authoring/operations.d.ts.map +1 -0
- package/dist/internal/authorization/authoring/operations.js +591 -0
- package/dist/internal/authorization/authoring/operations.js.map +1 -0
- package/dist/internal/authorization/authoring/path.d.ts +20 -0
- package/dist/internal/authorization/authoring/path.d.ts.map +1 -0
- package/dist/internal/authorization/authoring/path.js +109 -0
- package/dist/internal/authorization/authoring/path.js.map +1 -0
- package/dist/internal/authorization/authoring/policy.d.ts +120 -0
- package/dist/internal/authorization/authoring/policy.d.ts.map +1 -0
- package/dist/internal/authorization/authoring/policy.js +218 -0
- package/dist/internal/authorization/authoring/policy.js.map +1 -0
- package/dist/internal/authorization/authoring/read.d.ts +13 -0
- package/dist/internal/authorization/authoring/read.d.ts.map +1 -0
- package/dist/internal/authorization/authoring/read.js +27 -0
- package/dist/internal/authorization/authoring/read.js.map +1 -0
- package/dist/internal/authorization/authoring/types.d.ts +127 -0
- package/dist/internal/authorization/authoring/types.d.ts.map +1 -0
- package/dist/internal/authorization/authoring/types.js +43 -0
- package/dist/internal/authorization/authoring/types.js.map +1 -0
- package/dist/internal/authorization/bind.d.ts +687 -0
- package/dist/internal/authorization/bind.d.ts.map +1 -0
- package/dist/internal/authorization/bind.js +485 -0
- package/dist/internal/authorization/bind.js.map +1 -0
- package/dist/internal/authorization/bounds.d.ts +13 -0
- package/dist/internal/authorization/bounds.d.ts.map +1 -0
- package/dist/internal/authorization/bounds.js +9 -0
- package/dist/internal/authorization/bounds.js.map +1 -0
- package/dist/internal/authorization/canonical-json.d.ts +6 -0
- package/dist/internal/authorization/canonical-json.d.ts.map +1 -0
- package/dist/internal/authorization/canonical-json.js +65 -0
- package/dist/internal/authorization/canonical-json.js.map +1 -0
- package/dist/internal/authorization/catalog-unit.d.ts +1033 -0
- package/dist/internal/authorization/catalog-unit.d.ts.map +1 -0
- package/dist/internal/authorization/catalog-unit.js +303 -0
- package/dist/internal/authorization/catalog-unit.js.map +1 -0
- package/dist/internal/authorization/catalog.d.ts +472 -0
- package/dist/internal/authorization/catalog.d.ts.map +1 -0
- package/dist/internal/authorization/catalog.js +134 -0
- package/dist/internal/authorization/catalog.js.map +1 -0
- package/dist/internal/authorization/changesets.d.ts +54 -0
- package/dist/internal/authorization/changesets.d.ts.map +1 -0
- package/dist/internal/authorization/changesets.js +156 -0
- package/dist/internal/authorization/changesets.js.map +1 -0
- package/dist/internal/authorization/composition.d.ts +10 -0
- package/dist/internal/authorization/composition.d.ts.map +1 -0
- package/dist/internal/authorization/composition.js +28 -0
- package/dist/internal/authorization/composition.js.map +1 -0
- package/dist/internal/authorization/database-bindings.d.ts +48 -0
- package/dist/internal/authorization/database-bindings.d.ts.map +1 -0
- package/dist/internal/authorization/database-bindings.js +101 -0
- package/dist/internal/authorization/database-bindings.js.map +1 -0
- package/dist/internal/authorization/database-target.d.ts +75 -0
- package/dist/internal/authorization/database-target.d.ts.map +1 -0
- package/dist/internal/authorization/database-target.js +65 -0
- package/dist/internal/authorization/database-target.js.map +1 -0
- package/dist/internal/authorization/decode.d.ts +1704 -0
- package/dist/internal/authorization/decode.d.ts.map +1 -0
- package/dist/internal/authorization/decode.js +294 -0
- package/dist/internal/authorization/decode.js.map +1 -0
- package/dist/internal/authorization/definitions.d.ts +66 -0
- package/dist/internal/authorization/definitions.d.ts.map +1 -0
- package/dist/internal/authorization/definitions.js +335 -0
- package/dist/internal/authorization/definitions.js.map +1 -0
- package/dist/internal/authorization/deployed.d.ts +43 -0
- package/dist/internal/authorization/deployed.d.ts.map +1 -0
- package/dist/internal/authorization/deployed.js +184 -0
- package/dist/internal/authorization/deployed.js.map +1 -0
- package/dist/internal/authorization/entity-targets.d.ts +68 -0
- package/dist/internal/authorization/entity-targets.d.ts.map +1 -0
- package/dist/internal/authorization/entity-targets.js +244 -0
- package/dist/internal/authorization/entity-targets.js.map +1 -0
- package/dist/internal/authorization/expr.d.ts +259 -0
- package/dist/internal/authorization/expr.d.ts.map +1 -0
- package/dist/internal/authorization/expr.js +55 -0
- package/dist/internal/authorization/expr.js.map +1 -0
- package/dist/internal/authorization/failures.d.ts +78 -0
- package/dist/internal/authorization/failures.d.ts.map +1 -0
- package/dist/internal/authorization/failures.js +22 -0
- package/dist/internal/authorization/failures.js.map +1 -0
- package/dist/internal/authorization/identities.d.ts +207 -0
- package/dist/internal/authorization/identities.d.ts.map +1 -0
- package/dist/internal/authorization/identities.js +71 -0
- package/dist/internal/authorization/identities.js.map +1 -0
- package/dist/internal/authorization/index.d.ts +33 -0
- package/dist/internal/authorization/index.d.ts.map +1 -0
- package/dist/internal/authorization/index.js +33 -0
- package/dist/internal/authorization/index.js.map +1 -0
- package/dist/internal/authorization/install/normalize.d.ts +196 -0
- package/dist/internal/authorization/install/normalize.d.ts.map +1 -0
- package/dist/internal/authorization/install/normalize.js +168 -0
- package/dist/internal/authorization/install/normalize.js.map +1 -0
- package/dist/internal/authorization/install/plan.d.ts +8 -0
- package/dist/internal/authorization/install/plan.d.ts.map +1 -0
- package/dist/internal/authorization/install/plan.js +177 -0
- package/dist/internal/authorization/install/plan.js.map +1 -0
- package/dist/internal/authorization/install.d.ts +404 -0
- package/dist/internal/authorization/install.d.ts.map +1 -0
- package/dist/internal/authorization/install.js +103 -0
- package/dist/internal/authorization/install.js.map +1 -0
- package/dist/internal/authorization/invocation-codec.d.ts +10 -0
- package/dist/internal/authorization/invocation-codec.d.ts.map +1 -0
- package/dist/internal/authorization/invocation-codec.js +36 -0
- package/dist/internal/authorization/invocation-codec.js.map +1 -0
- package/dist/internal/authorization/invocation-receipts.d.ts +192 -0
- package/dist/internal/authorization/invocation-receipts.d.ts.map +1 -0
- package/dist/internal/authorization/invocation-receipts.js +546 -0
- package/dist/internal/authorization/invocation-receipts.js.map +1 -0
- package/dist/internal/authorization/ir.d.ts +1465 -0
- package/dist/internal/authorization/ir.d.ts.map +1 -0
- package/dist/internal/authorization/ir.js +131 -0
- package/dist/internal/authorization/ir.js.map +1 -0
- package/dist/internal/authorization/json.d.ts +8 -0
- package/dist/internal/authorization/json.d.ts.map +1 -0
- package/dist/internal/authorization/json.js +13 -0
- package/dist/internal/authorization/json.js.map +1 -0
- package/dist/internal/authorization/live.d.ts +38 -0
- package/dist/internal/authorization/live.d.ts.map +1 -0
- package/dist/internal/authorization/live.js +227 -0
- package/dist/internal/authorization/live.js.map +1 -0
- package/dist/internal/authorization/operation-grant.d.ts +16 -0
- package/dist/internal/authorization/operation-grant.d.ts.map +1 -0
- package/dist/internal/authorization/operation-grant.js +79 -0
- package/dist/internal/authorization/operation-grant.js.map +1 -0
- package/dist/internal/authorization/operation-version.d.ts +28 -0
- package/dist/internal/authorization/operation-version.d.ts.map +1 -0
- package/dist/internal/authorization/operation-version.js +206 -0
- package/dist/internal/authorization/operation-version.js.map +1 -0
- package/dist/internal/authorization/operations-runtime.d.ts +78 -0
- package/dist/internal/authorization/operations-runtime.d.ts.map +1 -0
- package/dist/internal/authorization/operations-runtime.js +1130 -0
- package/dist/internal/authorization/operations-runtime.js.map +1 -0
- package/dist/internal/authorization/principal.d.ts +95 -0
- package/dist/internal/authorization/principal.d.ts.map +1 -0
- package/dist/internal/authorization/principal.js +53 -0
- package/dist/internal/authorization/principal.js.map +1 -0
- package/dist/internal/authorization/query-view.d.ts +7 -0
- package/dist/internal/authorization/query-view.d.ts.map +1 -0
- package/dist/internal/authorization/query-view.js +17 -0
- package/dist/internal/authorization/query-view.js.map +1 -0
- package/dist/internal/authorization/read-compatibility.d.ts +185 -0
- package/dist/internal/authorization/read-compatibility.d.ts.map +1 -0
- package/dist/internal/authorization/read-compatibility.js +176 -0
- package/dist/internal/authorization/read-compatibility.js.map +1 -0
- package/dist/internal/authorization/read-filter.d.ts +48 -0
- package/dist/internal/authorization/read-filter.d.ts.map +1 -0
- package/dist/internal/authorization/read-filter.js +496 -0
- package/dist/internal/authorization/read-filter.js.map +1 -0
- package/dist/internal/authorization/read-tables.d.ts +9 -0
- package/dist/internal/authorization/read-tables.d.ts.map +1 -0
- package/dist/internal/authorization/read-tables.js +120 -0
- package/dist/internal/authorization/read-tables.js.map +1 -0
- package/dist/internal/authorization/reads.d.ts +36 -0
- package/dist/internal/authorization/reads.d.ts.map +1 -0
- package/dist/internal/authorization/reads.js +35 -0
- package/dist/internal/authorization/reads.js.map +1 -0
- package/dist/internal/authorization/request.d.ts +64 -0
- package/dist/internal/authorization/request.d.ts.map +1 -0
- package/dist/internal/authorization/request.js +210 -0
- package/dist/internal/authorization/request.js.map +1 -0
- package/dist/internal/authorization/truth.d.ts +51 -0
- package/dist/internal/authorization/truth.d.ts.map +1 -0
- package/dist/internal/authorization/truth.js +23 -0
- package/dist/internal/authorization/truth.js.map +1 -0
- package/dist/internal/authorization/validate.d.ts +3 -0
- package/dist/internal/authorization/validate.d.ts.map +1 -0
- package/dist/internal/authorization/validate.js +3 -0
- package/dist/internal/authorization/validate.js.map +1 -0
- package/dist/internal/authorization/validation/catalog.d.ts +32 -0
- package/dist/internal/authorization/validation/catalog.d.ts.map +1 -0
- package/dist/internal/authorization/validation/catalog.js +417 -0
- package/dist/internal/authorization/validation/catalog.js.map +1 -0
- package/dist/internal/authorization/validation/common.d.ts +20 -0
- package/dist/internal/authorization/validation/common.d.ts.map +1 -0
- package/dist/internal/authorization/validation/common.js +36 -0
- package/dist/internal/authorization/validation/common.js.map +1 -0
- package/dist/internal/authorization/validation/decisions.d.ts +7 -0
- package/dist/internal/authorization/validation/decisions.d.ts.map +1 -0
- package/dist/internal/authorization/validation/decisions.js +107 -0
- package/dist/internal/authorization/validation/decisions.js.map +1 -0
- package/dist/internal/authorization/validation/descriptors.d.ts +8 -0
- package/dist/internal/authorization/validation/descriptors.d.ts.map +1 -0
- package/dist/internal/authorization/validation/descriptors.js +24 -0
- package/dist/internal/authorization/validation/descriptors.js.map +1 -0
- package/dist/internal/authorization/validation/expression.d.ts +11 -0
- package/dist/internal/authorization/validation/expression.d.ts.map +1 -0
- package/dist/internal/authorization/validation/expression.js +114 -0
- package/dist/internal/authorization/validation/expression.js.map +1 -0
- package/dist/internal/authorization/validation/traversal.d.ts +19 -0
- package/dist/internal/authorization/validation/traversal.d.ts.map +1 -0
- package/dist/internal/authorization/validation/traversal.js +141 -0
- package/dist/internal/authorization/validation/traversal.js.map +1 -0
- package/dist/internal/authorization/validation/types.d.ts +55 -0
- package/dist/internal/authorization/validation/types.d.ts.map +1 -0
- package/dist/internal/authorization/validation/types.js +184 -0
- package/dist/internal/authorization/validation/types.js.map +1 -0
- package/dist/internal/authorization/validation/validate.d.ts +421 -0
- package/dist/internal/authorization/validation/validate.d.ts.map +1 -0
- package/dist/internal/authorization/validation/validate.js +95 -0
- package/dist/internal/authorization/validation/validate.js.map +1 -0
- package/dist/internal/authorization/version.d.ts +11 -0
- package/dist/internal/authorization/version.d.ts.map +1 -0
- package/dist/internal/authorization/version.js +10 -0
- package/dist/internal/authorization/version.js.map +1 -0
- package/dist/internal/changesets/protocol.d.ts +185 -0
- package/dist/internal/changesets/protocol.d.ts.map +1 -0
- package/dist/internal/changesets/protocol.js +39 -0
- package/dist/internal/changesets/protocol.js.map +1 -0
- package/dist/internal/changesets/service.d.ts +69 -0
- package/dist/internal/changesets/service.d.ts.map +1 -0
- package/dist/internal/changesets/service.js +298 -0
- package/dist/internal/changesets/service.js.map +1 -0
- package/dist/internal/core/bytes.d.ts +41 -0
- package/dist/internal/core/bytes.d.ts.map +1 -0
- package/dist/internal/core/bytes.js +215 -0
- package/dist/internal/core/bytes.js.map +1 -0
- package/dist/internal/core/composition.d.ts +20 -0
- package/dist/internal/core/composition.d.ts.map +1 -0
- package/dist/internal/core/composition.js +52 -0
- package/dist/internal/core/composition.js.map +1 -0
- package/dist/internal/core/conn.d.ts +64 -0
- package/dist/internal/core/conn.d.ts.map +1 -0
- package/dist/internal/core/conn.js +240 -0
- package/dist/internal/core/conn.js.map +1 -0
- package/dist/internal/core/datom.d.ts +73 -0
- package/dist/internal/core/datom.d.ts.map +1 -0
- package/dist/internal/core/datom.js +477 -0
- package/dist/internal/core/datom.js.map +1 -0
- package/dist/internal/core/db.d.ts +65 -0
- package/dist/internal/core/db.d.ts.map +1 -0
- package/dist/internal/core/db.js +261 -0
- package/dist/internal/core/db.js.map +1 -0
- package/dist/internal/core/index.d.ts +21 -0
- package/dist/internal/core/index.d.ts.map +1 -0
- package/dist/internal/core/index.js +21 -0
- package/dist/internal/core/index.js.map +1 -0
- package/dist/internal/core/json.d.ts +5 -0
- package/dist/internal/core/json.d.ts.map +1 -0
- package/dist/internal/core/json.js +56 -0
- package/dist/internal/core/json.js.map +1 -0
- package/dist/internal/core/log.d.ts +68 -0
- package/dist/internal/core/log.d.ts.map +1 -0
- package/dist/internal/core/log.js +76 -0
- package/dist/internal/core/log.js.map +1 -0
- package/dist/internal/core/novelty.d.ts +38 -0
- package/dist/internal/core/novelty.d.ts.map +1 -0
- package/dist/internal/core/novelty.js +300 -0
- package/dist/internal/core/novelty.js.map +1 -0
- package/dist/internal/core/query/ast.d.ts +174 -0
- package/dist/internal/core/query/ast.d.ts.map +1 -0
- package/dist/internal/core/query/ast.js +37 -0
- package/dist/internal/core/query/ast.js.map +1 -0
- package/dist/internal/core/query/builtins.d.ts +19 -0
- package/dist/internal/core/query/builtins.d.ts.map +1 -0
- package/dist/internal/core/query/builtins.js +242 -0
- package/dist/internal/core/query/builtins.js.map +1 -0
- package/dist/internal/core/query/edn.d.ts +19 -0
- package/dist/internal/core/query/edn.d.ts.map +1 -0
- package/dist/internal/core/query/edn.js +248 -0
- package/dist/internal/core/query/edn.js.map +1 -0
- package/dist/internal/core/query/engine.d.ts +56 -0
- package/dist/internal/core/query/engine.d.ts.map +1 -0
- package/dist/internal/core/query/engine.js +0 -0
- package/dist/internal/core/query/engine.js.map +1 -0
- package/dist/internal/core/query/parse.d.ts +8 -0
- package/dist/internal/core/query/parse.d.ts.map +1 -0
- package/dist/internal/core/query/parse.js +606 -0
- package/dist/internal/core/query/parse.js.map +1 -0
- package/dist/internal/core/query/pull.d.ts +7 -0
- package/dist/internal/core/query/pull.d.ts.map +1 -0
- package/dist/internal/core/query/pull.js +304 -0
- package/dist/internal/core/query/pull.js.map +1 -0
- package/dist/internal/core/query/value.d.ts +10 -0
- package/dist/internal/core/query/value.d.ts.map +1 -0
- package/dist/internal/core/query/value.js +21 -0
- package/dist/internal/core/query/value.js.map +1 -0
- package/dist/internal/core/revision.d.ts +19 -0
- package/dist/internal/core/revision.d.ts.map +1 -0
- package/dist/internal/core/revision.js +13 -0
- package/dist/internal/core/revision.js.map +1 -0
- package/dist/internal/core/schema.d.ts +63 -0
- package/dist/internal/core/schema.d.ts.map +1 -0
- package/dist/internal/core/schema.js +228 -0
- package/dist/internal/core/schema.js.map +1 -0
- package/dist/internal/core/segment.d.ts +16 -0
- package/dist/internal/core/segment.d.ts.map +1 -0
- package/dist/internal/core/segment.js +149 -0
- package/dist/internal/core/segment.js.map +1 -0
- package/dist/internal/core/store.d.ts +35 -0
- package/dist/internal/core/store.d.ts.map +1 -0
- package/dist/internal/core/store.js +88 -0
- package/dist/internal/core/store.js.map +1 -0
- package/dist/internal/core/telemetry.d.ts +53 -0
- package/dist/internal/core/telemetry.d.ts.map +1 -0
- package/dist/internal/core/telemetry.js +103 -0
- package/dist/internal/core/telemetry.js.map +1 -0
- package/dist/internal/core/tree.d.ts +60 -0
- package/dist/internal/core/tree.d.ts.map +1 -0
- package/dist/internal/core/tree.js +625 -0
- package/dist/internal/core/tree.js.map +1 -0
- package/dist/internal/core/tx-provenance.d.ts +7 -0
- package/dist/internal/core/tx-provenance.d.ts.map +1 -0
- package/dist/internal/core/tx-provenance.js +16 -0
- package/dist/internal/core/tx-provenance.js.map +1 -0
- package/dist/internal/core/tx.d.ts +51 -0
- package/dist/internal/core/tx.d.ts.map +1 -0
- package/dist/internal/core/tx.js +1029 -0
- package/dist/internal/core/tx.js.map +1 -0
- package/dist/internal/replica/basis.d.ts +15 -0
- package/dist/internal/replica/basis.d.ts.map +1 -0
- package/dist/internal/replica/basis.js +32 -0
- package/dist/internal/replica/basis.js.map +1 -0
- package/dist/internal/replica/errors.d.ts +32 -0
- package/dist/internal/replica/errors.d.ts.map +1 -0
- package/dist/internal/replica/errors.js +30 -0
- package/dist/internal/replica/errors.js.map +1 -0
- package/dist/internal/replica/index.d.ts +4 -0
- package/dist/internal/replica/index.d.ts.map +1 -0
- package/dist/internal/replica/index.js +4 -0
- package/dist/internal/replica/index.js.map +1 -0
- package/dist/internal/replica/replica-do-testing.d.ts +11 -0
- package/dist/internal/replica/replica-do-testing.d.ts.map +1 -0
- package/dist/internal/replica/replica-do-testing.js +340 -0
- package/dist/internal/replica/replica-do-testing.js.map +1 -0
- package/dist/internal/replica/replica-do.d.ts +87 -0
- package/dist/internal/replica/replica-do.d.ts.map +1 -0
- package/dist/internal/replica/replica-do.js +735 -0
- package/dist/internal/replica/replica-do.js.map +1 -0
- package/dist/internal/replica/revision-retention.d.ts +29 -0
- package/dist/internal/replica/revision-retention.d.ts.map +1 -0
- package/dist/internal/replica/revision-retention.js +39 -0
- package/dist/internal/replica/revision-retention.js.map +1 -0
- package/dist/internal/replication/activation-fence.d.ts +40 -0
- package/dist/internal/replication/activation-fence.d.ts.map +1 -0
- package/dist/internal/replication/activation-fence.js +85 -0
- package/dist/internal/replication/activation-fence.js.map +1 -0
- package/dist/internal/replication/digest.d.ts +2 -0
- package/dist/internal/replication/digest.d.ts.map +1 -0
- package/dist/internal/replication/digest.js +12 -0
- package/dist/internal/replication/digest.js.map +1 -0
- package/dist/internal/replication/entity-id.d.ts +23 -0
- package/dist/internal/replication/entity-id.d.ts.map +1 -0
- package/dist/internal/replication/entity-id.js +161 -0
- package/dist/internal/replication/entity-id.js.map +1 -0
- package/dist/internal/replication/idb.d.ts +9 -0
- package/dist/internal/replication/idb.d.ts.map +1 -0
- package/dist/internal/replication/idb.js +46 -0
- package/dist/internal/replication/idb.js.map +1 -0
- package/dist/internal/replication/identity-root.d.ts +11 -0
- package/dist/internal/replication/identity-root.d.ts.map +1 -0
- package/dist/internal/replication/identity-root.js +48 -0
- package/dist/internal/replication/identity-root.js.map +1 -0
- package/dist/internal/replication/identity.d.ts +40 -0
- package/dist/internal/replication/identity.d.ts.map +1 -0
- package/dist/internal/replication/identity.js +95 -0
- package/dist/internal/replication/identity.js.map +1 -0
- package/dist/internal/replication/index.d.ts +13 -0
- package/dist/internal/replication/index.d.ts.map +1 -0
- package/dist/internal/replication/index.js +13 -0
- package/dist/internal/replication/index.js.map +1 -0
- package/dist/internal/replication/indexeddb.d.ts +171 -0
- package/dist/internal/replication/indexeddb.d.ts.map +1 -0
- package/dist/internal/replication/indexeddb.js +1809 -0
- package/dist/internal/replication/indexeddb.js.map +1 -0
- package/dist/internal/replication/leadership.d.ts +36 -0
- package/dist/internal/replication/leadership.d.ts.map +1 -0
- package/dist/internal/replication/leadership.js +108 -0
- package/dist/internal/replication/leadership.js.map +1 -0
- package/dist/internal/replication/logical.d.ts +40 -0
- package/dist/internal/replication/logical.d.ts.map +1 -0
- package/dist/internal/replication/logical.js +375 -0
- package/dist/internal/replication/logical.js.map +1 -0
- package/dist/internal/replication/notices.d.ts +32 -0
- package/dist/internal/replication/notices.d.ts.map +1 -0
- package/dist/internal/replication/notices.js +92 -0
- package/dist/internal/replication/notices.js.map +1 -0
- package/dist/internal/replication/outbox-storage.d.ts +98 -0
- package/dist/internal/replication/outbox-storage.d.ts.map +1 -0
- package/dist/internal/replication/outbox-storage.js +826 -0
- package/dist/internal/replication/outbox-storage.js.map +1 -0
- package/dist/internal/replication/outbox.d.ts +200 -0
- package/dist/internal/replication/outbox.d.ts.map +1 -0
- package/dist/internal/replication/outbox.js +744 -0
- package/dist/internal/replication/outbox.js.map +1 -0
- package/dist/internal/replication/overlay-layers.d.ts +14 -0
- package/dist/internal/replication/overlay-layers.d.ts.map +1 -0
- package/dist/internal/replication/overlay-layers.js +2 -0
- package/dist/internal/replication/overlay-layers.js.map +1 -0
- package/dist/internal/replication/overlay-records.d.ts +61 -0
- package/dist/internal/replication/overlay-records.d.ts.map +1 -0
- package/dist/internal/replication/overlay-records.js +328 -0
- package/dist/internal/replication/overlay-records.js.map +1 -0
- package/dist/internal/replication/overlay.d.ts +20 -0
- package/dist/internal/replication/overlay.d.ts.map +1 -0
- package/dist/internal/replication/overlay.js +159 -0
- package/dist/internal/replication/overlay.js.map +1 -0
- package/dist/internal/replication/projection-binding.d.ts +39 -0
- package/dist/internal/replication/projection-binding.d.ts.map +1 -0
- package/dist/internal/replication/projection-binding.js +76 -0
- package/dist/internal/replication/projection-binding.js.map +1 -0
- package/dist/internal/replication/protocol.d.ts +633 -0
- package/dist/internal/replication/protocol.d.ts.map +1 -0
- package/dist/internal/replication/protocol.js +263 -0
- package/dist/internal/replication/protocol.js.map +1 -0
- package/dist/internal/replication/reconciliation.d.ts +64 -0
- package/dist/internal/replication/reconciliation.d.ts.map +1 -0
- package/dist/internal/replication/reconciliation.js +184 -0
- package/dist/internal/replication/reconciliation.js.map +1 -0
- package/dist/internal/replication/replica-gc.d.ts +42 -0
- package/dist/internal/replication/replica-gc.d.ts.map +1 -0
- package/dist/internal/replication/replica-gc.js +91 -0
- package/dist/internal/replication/replica-gc.js.map +1 -0
- package/dist/internal/replication/replica-integrity.d.ts +107 -0
- package/dist/internal/replication/replica-integrity.d.ts.map +1 -0
- package/dist/internal/replication/replica-integrity.js +418 -0
- package/dist/internal/replication/replica-integrity.js.map +1 -0
- package/dist/internal/replication/replica-lifecycle.d.ts +72 -0
- package/dist/internal/replication/replica-lifecycle.d.ts.map +1 -0
- package/dist/internal/replication/replica-lifecycle.js +126 -0
- package/dist/internal/replication/replica-lifecycle.js.map +1 -0
- package/dist/internal/replication/replica-schema.d.ts +27 -0
- package/dist/internal/replication/replica-schema.d.ts.map +1 -0
- package/dist/internal/replication/replica-schema.js +130 -0
- package/dist/internal/replication/replica-schema.js.map +1 -0
- package/dist/internal/replication/route-slot.d.ts +9 -0
- package/dist/internal/replication/route-slot.d.ts.map +1 -0
- package/dist/internal/replication/route-slot.js +8 -0
- package/dist/internal/replication/route-slot.js.map +1 -0
- package/dist/internal/replication/server-identity.d.ts +54 -0
- package/dist/internal/replication/server-identity.d.ts.map +1 -0
- package/dist/internal/replication/server-identity.js +68 -0
- package/dist/internal/replication/server-identity.js.map +1 -0
- package/dist/internal/replication/session.d.ts +91 -0
- package/dist/internal/replication/session.d.ts.map +1 -0
- package/dist/internal/replication/session.js +673 -0
- package/dist/internal/replication/session.js.map +1 -0
- package/dist/internal/replication/state.d.ts +34 -0
- package/dist/internal/replication/state.d.ts.map +1 -0
- package/dist/internal/replication/state.js +344 -0
- package/dist/internal/replication/state.js.map +1 -0
- package/dist/internal/replication/submission.d.ts +115 -0
- package/dist/internal/replication/submission.d.ts.map +1 -0
- package/dist/internal/replication/submission.js +266 -0
- package/dist/internal/replication/submission.js.map +1 -0
- package/dist/internal/replication/transport.d.ts +34 -0
- package/dist/internal/replication/transport.d.ts.map +1 -0
- package/dist/internal/replication/transport.js +215 -0
- package/dist/internal/replication/transport.js.map +1 -0
- package/dist/internal/runtime-boundaries.d.ts +8 -0
- package/dist/internal/runtime-boundaries.d.ts.map +1 -0
- package/dist/internal/runtime-boundaries.js +7 -0
- package/dist/internal/runtime-boundaries.js.map +1 -0
- package/dist/internal/storage/index.d.ts +111 -0
- package/dist/internal/storage/index.d.ts.map +1 -0
- package/dist/internal/storage/index.js +288 -0
- package/dist/internal/storage/index.js.map +1 -0
- package/dist/internal/storage/memory.d.ts +31 -0
- package/dist/internal/storage/memory.d.ts.map +1 -0
- package/dist/internal/storage/memory.js +46 -0
- package/dist/internal/storage/memory.js.map +1 -0
- package/dist/internal/storage/revisions.d.ts +24 -0
- package/dist/internal/storage/revisions.d.ts.map +1 -0
- package/dist/internal/storage/revisions.js +74 -0
- package/dist/internal/storage/revisions.js.map +1 -0
- package/dist/internal/test-hooks.d.ts +47 -0
- package/dist/internal/test-hooks.d.ts.map +1 -0
- package/dist/internal/test-hooks.js +256 -0
- package/dist/internal/test-hooks.js.map +1 -0
- package/dist/internal/transactor/env.d.ts +3 -0
- package/dist/internal/transactor/env.d.ts.map +1 -0
- package/dist/internal/transactor/env.js +5 -0
- package/dist/internal/transactor/env.js.map +1 -0
- package/dist/internal/transactor/errors.d.ts +47 -0
- package/dist/internal/transactor/errors.d.ts.map +1 -0
- package/dist/internal/transactor/errors.js +66 -0
- package/dist/internal/transactor/errors.js.map +1 -0
- package/dist/internal/transactor/host.d.ts +37 -0
- package/dist/internal/transactor/host.d.ts.map +1 -0
- package/dist/internal/transactor/host.js +11 -0
- package/dist/internal/transactor/host.js.map +1 -0
- package/dist/internal/transactor/index.d.ts +8 -0
- package/dist/internal/transactor/index.d.ts.map +1 -0
- package/dist/internal/transactor/index.js +8 -0
- package/dist/internal/transactor/index.js.map +1 -0
- package/dist/internal/transactor/indexer.d.ts +53 -0
- package/dist/internal/transactor/indexer.d.ts.map +1 -0
- package/dist/internal/transactor/indexer.js +125 -0
- package/dist/internal/transactor/indexer.js.map +1 -0
- package/dist/internal/transactor/internal.d.ts +8 -0
- package/dist/internal/transactor/internal.d.ts.map +1 -0
- package/dist/internal/transactor/internal.js +28 -0
- package/dist/internal/transactor/internal.js.map +1 -0
- package/dist/internal/transactor/observability.d.ts +44 -0
- package/dist/internal/transactor/observability.d.ts.map +1 -0
- package/dist/internal/transactor/observability.js +39 -0
- package/dist/internal/transactor/observability.js.map +1 -0
- package/dist/internal/transactor/transactor-do.d.ts +35 -0
- package/dist/internal/transactor/transactor-do.d.ts.map +1 -0
- package/dist/internal/transactor/transactor-do.js +198 -0
- package/dist/internal/transactor/transactor-do.js.map +1 -0
- package/dist/internal/transactor/transactor.d.ts +209 -0
- package/dist/internal/transactor/transactor.d.ts.map +1 -0
- package/dist/internal/transactor/transactor.js +1166 -0
- package/dist/internal/transactor/transactor.js.map +1 -0
- package/dist/mcp/contract.d.ts +49 -0
- package/dist/mcp/contract.d.ts.map +1 -0
- package/dist/mcp/contract.js +199 -0
- package/dist/mcp/contract.js.map +1 -0
- package/dist/mcp/kernel.d.ts +56 -0
- package/dist/mcp/kernel.d.ts.map +1 -0
- package/dist/mcp/kernel.js +344 -0
- package/dist/mcp/kernel.js.map +1 -0
- package/dist/mcp/server.d.ts +8 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +182 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/peer.d.ts +175 -0
- package/dist/peer.d.ts.map +1 -0
- package/dist/peer.js +200 -0
- package/dist/peer.js.map +1 -0
- package/dist/react/hooks.d.ts +157 -0
- package/dist/react/hooks.d.ts.map +1 -0
- package/dist/react/hooks.js +130 -0
- package/dist/react/hooks.js.map +1 -0
- package/dist/react/index.d.ts +4 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +2 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/query-state.d.ts +60 -0
- package/dist/react/query-state.d.ts.map +1 -0
- package/dist/react/query-state.js +48 -0
- package/dist/react/query-state.js.map +1 -0
- package/dist/react/receipt-state.d.ts +27 -0
- package/dist/react/receipt-state.d.ts.map +1 -0
- package/dist/react/receipt-state.js +2 -0
- package/dist/react/receipt-state.js.map +1 -0
- package/dist/react/store.d.ts +30 -0
- package/dist/react/store.d.ts.map +1 -0
- package/dist/react/store.js +118 -0
- package/dist/react/store.js.map +1 -0
- package/dist/react/suspense.d.ts +6 -0
- package/dist/react/suspense.d.ts.map +1 -0
- package/dist/react/suspense.js +111 -0
- package/dist/react/suspense.js.map +1 -0
- package/dist/worker/admit.d.ts +9 -0
- package/dist/worker/admit.d.ts.map +1 -0
- package/dist/worker/admit.js +43 -0
- package/dist/worker/admit.js.map +1 -0
- package/dist/worker/analytics.d.ts +39 -0
- package/dist/worker/analytics.d.ts.map +1 -0
- package/dist/worker/analytics.js +54 -0
- package/dist/worker/analytics.js.map +1 -0
- package/dist/worker/auth.d.ts +26 -0
- package/dist/worker/auth.d.ts.map +1 -0
- package/dist/worker/auth.js +2 -0
- package/dist/worker/auth.js.map +1 -0
- package/dist/worker/authorized-live.d.ts +15 -0
- package/dist/worker/authorized-live.d.ts.map +1 -0
- package/dist/worker/authorized-live.js +30 -0
- package/dist/worker/authorized-live.js.map +1 -0
- package/dist/worker/authorized-operation.d.ts +30 -0
- package/dist/worker/authorized-operation.d.ts.map +1 -0
- package/dist/worker/authorized-operation.js +304 -0
- package/dist/worker/authorized-operation.js.map +1 -0
- package/dist/worker/authorized-read.d.ts +32 -0
- package/dist/worker/authorized-read.d.ts.map +1 -0
- package/dist/worker/authorized-read.js +194 -0
- package/dist/worker/authorized-read.js.map +1 -0
- package/dist/worker/authorized-replication.d.ts +21 -0
- package/dist/worker/authorized-replication.d.ts.map +1 -0
- package/dist/worker/authorized-replication.js +593 -0
- package/dist/worker/authorized-replication.js.map +1 -0
- package/dist/worker/changesets.d.ts +9 -0
- package/dist/worker/changesets.d.ts.map +1 -0
- package/dist/worker/changesets.js +105 -0
- package/dist/worker/changesets.js.map +1 -0
- package/dist/worker/demo.d.ts +2 -0
- package/dist/worker/demo.d.ts.map +1 -0
- package/dist/worker/demo.js +85 -0
- package/dist/worker/demo.js.map +1 -0
- package/dist/worker/errors.d.ts +53 -0
- package/dist/worker/errors.d.ts.map +1 -0
- package/dist/worker/errors.js +107 -0
- package/dist/worker/errors.js.map +1 -0
- package/dist/worker/handle.d.ts +21 -0
- package/dist/worker/handle.d.ts.map +1 -0
- package/dist/worker/handle.js +386 -0
- package/dist/worker/handle.js.map +1 -0
- package/dist/worker/index.d.ts +27 -0
- package/dist/worker/index.d.ts.map +1 -0
- package/dist/worker/index.js +24 -0
- package/dist/worker/index.js.map +1 -0
- package/dist/worker/jwt.d.ts +23 -0
- package/dist/worker/jwt.d.ts.map +1 -0
- package/dist/worker/jwt.js +288 -0
- package/dist/worker/jwt.js.map +1 -0
- package/dist/worker/mcp.d.ts +17 -0
- package/dist/worker/mcp.d.ts.map +1 -0
- package/dist/worker/mcp.js +151 -0
- package/dist/worker/mcp.js.map +1 -0
- package/dist/worker/operation-catalogs.d.ts +38 -0
- package/dist/worker/operation-catalogs.d.ts.map +1 -0
- package/dist/worker/operation-catalogs.js +114 -0
- package/dist/worker/operation-catalogs.js.map +1 -0
- package/dist/worker/peer.d.ts +70 -0
- package/dist/worker/peer.d.ts.map +1 -0
- package/dist/worker/peer.js +330 -0
- package/dist/worker/peer.js.map +1 -0
- package/dist/worker/public-observation.d.ts +15 -0
- package/dist/worker/public-observation.d.ts.map +1 -0
- package/dist/worker/public-observation.js +111 -0
- package/dist/worker/public-observation.js.map +1 -0
- package/dist/worker/server-identity.d.ts +2 -0
- package/dist/worker/server-identity.d.ts.map +1 -0
- package/dist/worker/server-identity.js +2 -0
- package/dist/worker/server-identity.js.map +1 -0
- package/dist/worker/session-sync.d.ts +27 -0
- package/dist/worker/session-sync.d.ts.map +1 -0
- package/dist/worker/session-sync.js +4 -0
- package/dist/worker/session-sync.js.map +1 -0
- package/dist/worker/session.d.ts +144 -0
- package/dist/worker/session.d.ts.map +1 -0
- package/dist/worker/session.js +408 -0
- package/dist/worker/session.js.map +1 -0
- package/dist/worker/storage-test-admin.d.ts +3 -0
- package/dist/worker/storage-test-admin.d.ts.map +1 -0
- package/dist/worker/storage-test-admin.js +277 -0
- package/dist/worker/storage-test-admin.js.map +1 -0
- package/dist/worker/test-admin.d.ts +11 -0
- package/dist/worker/test-admin.d.ts.map +1 -0
- package/dist/worker/test-admin.js +432 -0
- package/dist/worker/test-admin.js.map +1 -0
- package/dist/worker/testing.d.ts +14 -0
- package/dist/worker/testing.d.ts.map +1 -0
- package/dist/worker/testing.js +71 -0
- package/dist/worker/testing.js.map +1 -0
- package/dist/workerEntry.d.ts +2 -0
- package/dist/workerEntry.d.ts.map +1 -0
- package/dist/workerEntry.js +10 -0
- package/dist/workerEntry.js.map +1 -0
- package/dist/writes.d.ts +8 -0
- package/dist/writes.d.ts.map +1 -0
- package/dist/writes.js +11 -0
- package/dist/writes.js.map +1 -0
- package/package.json +102 -4
|
@@ -0,0 +1,795 @@
|
|
|
1
|
+
import { NotOne } from "../db/Errors.js";
|
|
2
|
+
import { lowerQueryObject, symbolicIdentityLowering, } from "../db/query/index.js";
|
|
3
|
+
import { query as runQuery } from "../internal/core/query/engine.js";
|
|
4
|
+
import { emptyOverlayLayers } from "../internal/replication/overlay-layers.js";
|
|
5
|
+
import { OptimisticReconciler, } from "../internal/replication/reconciliation.js";
|
|
6
|
+
import { isReplicaFenceError, replicaDatabaseKey, replicaDatabaseScopeOf, } from "../internal/replication/replica-lifecycle.js";
|
|
7
|
+
import { ReplicationSession, } from "../internal/replication/session.js";
|
|
8
|
+
import { sameReplicationIdentity } from "../internal/replication/state.js";
|
|
9
|
+
import { clientQueryFrom, entityFocusOf, } from "./query.js";
|
|
10
|
+
import { mutationNamespace } from "./mutation.js";
|
|
11
|
+
import { EntityRegistry, rowIdentity, } from "./entity.js";
|
|
12
|
+
import { queueUnreplayable } from "./submission.js";
|
|
13
|
+
import { Store, sameResult } from "./subscription.js";
|
|
14
|
+
import { syncState } from "./sync.js";
|
|
15
|
+
export const queryObservationKey = (query) => {
|
|
16
|
+
const { lowering, identities } = symbolicIdentityLowering();
|
|
17
|
+
const lowered = lowerQueryObject(query, lowering);
|
|
18
|
+
const focus = entityFocusOf(query);
|
|
19
|
+
return JSON.stringify([
|
|
20
|
+
lowered.query,
|
|
21
|
+
lowered.shape,
|
|
22
|
+
identities,
|
|
23
|
+
focus === undefined ? null : `${focus._tag}:${focus.ns}`,
|
|
24
|
+
]);
|
|
25
|
+
};
|
|
26
|
+
const PENDING = Object.freeze({
|
|
27
|
+
status: "pending",
|
|
28
|
+
data: undefined,
|
|
29
|
+
stale: true,
|
|
30
|
+
error: undefined,
|
|
31
|
+
});
|
|
32
|
+
export const readSessionSnapshot = (snapshot) => {
|
|
33
|
+
switch (snapshot.status) {
|
|
34
|
+
case "open":
|
|
35
|
+
return {
|
|
36
|
+
status: snapshot.value?.stale === true ? "stale" : "live",
|
|
37
|
+
publishes: true,
|
|
38
|
+
};
|
|
39
|
+
case "connecting":
|
|
40
|
+
return {
|
|
41
|
+
status: snapshot.value === undefined ? "connecting" : "stale",
|
|
42
|
+
publishes: true,
|
|
43
|
+
};
|
|
44
|
+
case "terminal":
|
|
45
|
+
return snapshot.terminalCode === "update-required" ||
|
|
46
|
+
snapshot.terminalCode === "incompatible-version"
|
|
47
|
+
? { status: "update-required", publishes: false }
|
|
48
|
+
: { status: "offline", publishes: true };
|
|
49
|
+
case "failed":
|
|
50
|
+
switch (snapshot.failure) {
|
|
51
|
+
case "unauthorized":
|
|
52
|
+
return { status: "authentication-required", publishes: false };
|
|
53
|
+
case "fenced":
|
|
54
|
+
return { status: "connecting", publishes: false };
|
|
55
|
+
default:
|
|
56
|
+
return { status: "offline", publishes: true };
|
|
57
|
+
}
|
|
58
|
+
case "closed":
|
|
59
|
+
return { status: "closed", publishes: false };
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const resumed = (prior) => {
|
|
63
|
+
if (prior === undefined || prior.status === "pending")
|
|
64
|
+
return PENDING;
|
|
65
|
+
return prior.stale ? prior : Object.freeze({ ...prior, stale: true });
|
|
66
|
+
};
|
|
67
|
+
class QueryObserver {
|
|
68
|
+
lowered;
|
|
69
|
+
lower;
|
|
70
|
+
release;
|
|
71
|
+
shape;
|
|
72
|
+
store;
|
|
73
|
+
scheduled = -1;
|
|
74
|
+
plain;
|
|
75
|
+
constructor(lowered, lower, release, shape, retired) {
|
|
76
|
+
this.lowered = lowered;
|
|
77
|
+
this.lower = lower;
|
|
78
|
+
this.release = release;
|
|
79
|
+
this.shape = shape;
|
|
80
|
+
this.store = new Store(resumed(retired?.snapshot));
|
|
81
|
+
this.plain = retired?.plain;
|
|
82
|
+
}
|
|
83
|
+
rows() {
|
|
84
|
+
return this.plain;
|
|
85
|
+
}
|
|
86
|
+
republish(changed) {
|
|
87
|
+
const prior = this.store.getSnapshot();
|
|
88
|
+
if (prior.status !== "ready")
|
|
89
|
+
return;
|
|
90
|
+
if (!this.publishes(prior.data, changed))
|
|
91
|
+
return;
|
|
92
|
+
this.store.publish(Object.freeze({ ...prior }));
|
|
93
|
+
}
|
|
94
|
+
publishes(data, changed) {
|
|
95
|
+
if (changed.size === 0)
|
|
96
|
+
return false;
|
|
97
|
+
const rows = Array.isArray(data)
|
|
98
|
+
? data
|
|
99
|
+
: typeof data === "object" && data !== null &&
|
|
100
|
+
Array.isArray(data.rows)
|
|
101
|
+
? data.rows
|
|
102
|
+
: [data];
|
|
103
|
+
return rows.some((row) => changed.has(row));
|
|
104
|
+
}
|
|
105
|
+
subscribe(onChange) {
|
|
106
|
+
const stop = this.store.subscribe(onChange);
|
|
107
|
+
let released = false;
|
|
108
|
+
return () => {
|
|
109
|
+
if (released)
|
|
110
|
+
return;
|
|
111
|
+
released = true;
|
|
112
|
+
stop();
|
|
113
|
+
if (this.store.size === 0)
|
|
114
|
+
this.release(this);
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
async run(generation, view, stale) {
|
|
118
|
+
if (generation < this.scheduled)
|
|
119
|
+
return;
|
|
120
|
+
this.scheduled = generation;
|
|
121
|
+
if (view === undefined) {
|
|
122
|
+
this.publish(generation, "pending", undefined, true, undefined);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
try {
|
|
126
|
+
const lowered = this.lowered.bindsEntities ? this.lower() : this.lowered;
|
|
127
|
+
const rows = lowered.finalize(await runQuery(view, lowered.query));
|
|
128
|
+
if (rows instanceof NotOne) {
|
|
129
|
+
this.publish(generation, "error", undefined, stale, rows);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
this.publish(generation, "ready", rows, stale, undefined);
|
|
133
|
+
}
|
|
134
|
+
catch (cause) {
|
|
135
|
+
this.publish(generation, "error", undefined, stale, cause instanceof Error ? cause : new Error(String(cause)));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
publish(generation, status, rows, stale, error) {
|
|
139
|
+
if (generation < this.scheduled)
|
|
140
|
+
return;
|
|
141
|
+
const prior = this.store.getSnapshot();
|
|
142
|
+
const unchangedData = sameResult(this.plain, rows);
|
|
143
|
+
if (prior.status === status && prior.stale === stale &&
|
|
144
|
+
prior.error === error && unchangedData)
|
|
145
|
+
return;
|
|
146
|
+
const data = status !== "ready"
|
|
147
|
+
? undefined
|
|
148
|
+
: unchangedData
|
|
149
|
+
? prior.data
|
|
150
|
+
: this.shape(rows);
|
|
151
|
+
this.plain = rows;
|
|
152
|
+
this.store.publish(Object.freeze({ status, data, stale, error }));
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
class ActivationFailed extends Error {
|
|
156
|
+
status;
|
|
157
|
+
constructor(status, cause) {
|
|
158
|
+
super("ramose/client: activation failed", { cause });
|
|
159
|
+
this.status = status;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
let confirmations = 0;
|
|
163
|
+
const activationStep = async (status, run) => {
|
|
164
|
+
try {
|
|
165
|
+
return await run();
|
|
166
|
+
}
|
|
167
|
+
catch (cause) {
|
|
168
|
+
throw new ActivationFailed(status, cause);
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
export class ClientDatabaseHandle {
|
|
172
|
+
context;
|
|
173
|
+
revisionStore = new Store(undefined);
|
|
174
|
+
viewChanges = this.revisionStore.subscription;
|
|
175
|
+
query = { from: clientQueryFrom };
|
|
176
|
+
mutations;
|
|
177
|
+
get mutate() {
|
|
178
|
+
this.mutations ??= mutationNamespace(this.context.mutations, this, this.context.mutations.databaseOperations());
|
|
179
|
+
return this.mutations;
|
|
180
|
+
}
|
|
181
|
+
syncStore = new Store(syncState("idle"));
|
|
182
|
+
sync = this.syncStore.subscription;
|
|
183
|
+
observers = new Map();
|
|
184
|
+
retired = new Map();
|
|
185
|
+
activation;
|
|
186
|
+
opening;
|
|
187
|
+
settling = new Set();
|
|
188
|
+
catalog;
|
|
189
|
+
session;
|
|
190
|
+
releaseSession;
|
|
191
|
+
reconciler;
|
|
192
|
+
reconcilerKey;
|
|
193
|
+
reconcilerPending;
|
|
194
|
+
releaseOverlay;
|
|
195
|
+
identity;
|
|
196
|
+
committed;
|
|
197
|
+
account;
|
|
198
|
+
handles = new Map();
|
|
199
|
+
reverse;
|
|
200
|
+
speculative = new Map();
|
|
201
|
+
registry;
|
|
202
|
+
viewValue;
|
|
203
|
+
viewGeneration = 0;
|
|
204
|
+
lastSession;
|
|
205
|
+
stale = true;
|
|
206
|
+
updateRequired = false;
|
|
207
|
+
queueUpdateRequired = false;
|
|
208
|
+
closed = false;
|
|
209
|
+
refused = false;
|
|
210
|
+
wakePending = false;
|
|
211
|
+
generation = 0;
|
|
212
|
+
confirmation = 0;
|
|
213
|
+
constructor(context) {
|
|
214
|
+
this.context = context;
|
|
215
|
+
}
|
|
216
|
+
spawn(work) {
|
|
217
|
+
const settled = work.then(() => undefined, () => undefined);
|
|
218
|
+
this.settling.add(settled);
|
|
219
|
+
void settled.then(() => this.settling.delete(settled));
|
|
220
|
+
}
|
|
221
|
+
async drain() {
|
|
222
|
+
while (this.settling.size > 0) {
|
|
223
|
+
await Promise.all([...this.settling]);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
observe(query) {
|
|
227
|
+
this.context.assertLive("observe");
|
|
228
|
+
const value = query;
|
|
229
|
+
const lower = () => lowerQueryObject(value, {
|
|
230
|
+
entity: (eid) => this.entityId(eid),
|
|
231
|
+
resolveEntity: (id) => typeof id === "string" ? this.localIdOf(id) : undefined,
|
|
232
|
+
});
|
|
233
|
+
const lowered = lower();
|
|
234
|
+
const key = queryObservationKey(value);
|
|
235
|
+
const shape = this.shapeRows(entityFocusOf(query), lowered);
|
|
236
|
+
void this.activate();
|
|
237
|
+
let last = this.observers.get(key);
|
|
238
|
+
return Object.freeze({
|
|
239
|
+
subscribe: (onChange) => {
|
|
240
|
+
const observer = this.acquire(key, lowered, lower, shape);
|
|
241
|
+
last = observer;
|
|
242
|
+
return observer.subscribe(onChange);
|
|
243
|
+
},
|
|
244
|
+
getSnapshot: () => {
|
|
245
|
+
if (this.closed)
|
|
246
|
+
return PENDING;
|
|
247
|
+
const observer = this.observers.get(key);
|
|
248
|
+
if (observer !== undefined)
|
|
249
|
+
last = observer;
|
|
250
|
+
return (last?.store.getSnapshot() ?? this.retired.get(key)?.snapshot ??
|
|
251
|
+
PENDING);
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
shapeRows(focus, lowered) {
|
|
256
|
+
if (focus === undefined)
|
|
257
|
+
return (rows) => rows;
|
|
258
|
+
const wrap = (row) => {
|
|
259
|
+
const id = rowIdentity(row);
|
|
260
|
+
return id === undefined
|
|
261
|
+
? row
|
|
262
|
+
: this.entities().handle(id, focus, lowered.rowShape, row);
|
|
263
|
+
};
|
|
264
|
+
switch (lowered.result) {
|
|
265
|
+
case "page":
|
|
266
|
+
return (value) => {
|
|
267
|
+
const page = value;
|
|
268
|
+
return { ...page, rows: page.rows.map(wrap) };
|
|
269
|
+
};
|
|
270
|
+
case "row":
|
|
271
|
+
return (value) => (value === null ? null : wrap(value));
|
|
272
|
+
case "rows":
|
|
273
|
+
return (value) => (Array.isArray(value) ? value.map(wrap) : value);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
entities() {
|
|
277
|
+
if (this.registry !== undefined)
|
|
278
|
+
return this.registry;
|
|
279
|
+
this.registry = new EntityRegistry(this.context.mutations, this, (focus) => this.context.mutations.selfOperations({
|
|
280
|
+
kind: focus._tag === "Trait" ? "trait" : "entity",
|
|
281
|
+
name: focus.ns,
|
|
282
|
+
}));
|
|
283
|
+
const mappings = this.reconciler?.mappings();
|
|
284
|
+
if (mappings !== undefined) {
|
|
285
|
+
for (const [ref, id] of mappings)
|
|
286
|
+
this.registry.alias(ref, id);
|
|
287
|
+
}
|
|
288
|
+
const pending = this.reconciler?.snapshot().pending;
|
|
289
|
+
if (pending !== undefined)
|
|
290
|
+
this.registry.observe(pending);
|
|
291
|
+
return this.registry;
|
|
292
|
+
}
|
|
293
|
+
republishLocal(changed) {
|
|
294
|
+
for (const observer of this.observers.values())
|
|
295
|
+
observer.republish(changed);
|
|
296
|
+
}
|
|
297
|
+
acquire(key, lowered, lower, shape) {
|
|
298
|
+
const existing = this.observers.get(key);
|
|
299
|
+
if (existing !== undefined)
|
|
300
|
+
return existing;
|
|
301
|
+
const retired = this.retired.get(key);
|
|
302
|
+
this.retired.delete(key);
|
|
303
|
+
const observer = new QueryObserver(lowered, lower, (self) => {
|
|
304
|
+
if (this.observers.get(key) !== self)
|
|
305
|
+
return;
|
|
306
|
+
this.observers.delete(key);
|
|
307
|
+
this.retired.set(key, {
|
|
308
|
+
snapshot: resumed(self.store.getSnapshot()),
|
|
309
|
+
plain: self.rows(),
|
|
310
|
+
});
|
|
311
|
+
}, shape, retired);
|
|
312
|
+
if (this.closed)
|
|
313
|
+
return observer;
|
|
314
|
+
this.observers.set(key, observer);
|
|
315
|
+
this.spawn(observer.run(this.viewGeneration, this.viewValue, this.stale));
|
|
316
|
+
return observer;
|
|
317
|
+
}
|
|
318
|
+
boundReconciler() {
|
|
319
|
+
return this.reconciler;
|
|
320
|
+
}
|
|
321
|
+
authenticatedBy(credential) {
|
|
322
|
+
return this.account !== undefined && this.account === credential.cacheKey;
|
|
323
|
+
}
|
|
324
|
+
activate() {
|
|
325
|
+
if (this.activation !== undefined)
|
|
326
|
+
return this.activation;
|
|
327
|
+
const opening = this.open().catch((cause) => {
|
|
328
|
+
if (isReplicaFenceError(cause)) {
|
|
329
|
+
this.activation = undefined;
|
|
330
|
+
this.refused = true;
|
|
331
|
+
this.publishStatus("offline");
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
const terminal = cause instanceof ActivationFailed ? cause.status : undefined;
|
|
335
|
+
if (terminal === undefined) {
|
|
336
|
+
this.publishStatus("offline");
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
this.activation = undefined;
|
|
340
|
+
this.refused = true;
|
|
341
|
+
this.publishStatus(terminal);
|
|
342
|
+
});
|
|
343
|
+
this.activation = opening;
|
|
344
|
+
this.opening = opening;
|
|
345
|
+
void opening.then(() => {
|
|
346
|
+
if (this.opening !== opening)
|
|
347
|
+
return;
|
|
348
|
+
this.opening = undefined;
|
|
349
|
+
this.answerWake();
|
|
350
|
+
});
|
|
351
|
+
return this.activation;
|
|
352
|
+
}
|
|
353
|
+
restart() {
|
|
354
|
+
if (this.opening !== undefined)
|
|
355
|
+
return this.opening;
|
|
356
|
+
this.activation = undefined;
|
|
357
|
+
return this.activate();
|
|
358
|
+
}
|
|
359
|
+
reactivateRefused() {
|
|
360
|
+
if (!this.live() || !this.refused)
|
|
361
|
+
return;
|
|
362
|
+
if (this.session === undefined && this.activation !== undefined)
|
|
363
|
+
return;
|
|
364
|
+
this.refused = false;
|
|
365
|
+
this.releaseSession?.();
|
|
366
|
+
this.releaseSession = undefined;
|
|
367
|
+
const session = this.session;
|
|
368
|
+
this.session = undefined;
|
|
369
|
+
this.activation = undefined;
|
|
370
|
+
if (session !== undefined)
|
|
371
|
+
this.spawn(session.close());
|
|
372
|
+
void this.activate();
|
|
373
|
+
}
|
|
374
|
+
disposition() {
|
|
375
|
+
const snapshot = this.session?.snapshot();
|
|
376
|
+
return snapshot === undefined
|
|
377
|
+
? this.syncStatus()
|
|
378
|
+
: readSessionSnapshot(snapshot).status;
|
|
379
|
+
}
|
|
380
|
+
reactivateOffline() {
|
|
381
|
+
if (!this.live() || this.refused)
|
|
382
|
+
return;
|
|
383
|
+
if (this.opening !== undefined || this.disposition() !== "offline") {
|
|
384
|
+
this.wakePending = true;
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
this.wakePending = false;
|
|
388
|
+
const session = this.session;
|
|
389
|
+
this.releaseSession?.();
|
|
390
|
+
this.releaseSession = undefined;
|
|
391
|
+
this.session = undefined;
|
|
392
|
+
if (session !== undefined)
|
|
393
|
+
this.spawn(session.close());
|
|
394
|
+
void this.restart();
|
|
395
|
+
}
|
|
396
|
+
answerWake() {
|
|
397
|
+
if (!this.wakePending)
|
|
398
|
+
return;
|
|
399
|
+
if (!this.live()) {
|
|
400
|
+
this.wakePending = false;
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
if (this.opening !== undefined)
|
|
404
|
+
return;
|
|
405
|
+
const disposition = this.disposition();
|
|
406
|
+
if (disposition === "offline" && !this.refused) {
|
|
407
|
+
this.reactivateOffline();
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
if (this.refused || disposition === "authentication-required" ||
|
|
411
|
+
disposition === "update-required" || disposition === "closed")
|
|
412
|
+
this.wakePending = false;
|
|
413
|
+
}
|
|
414
|
+
async open() {
|
|
415
|
+
this.publishStatus(this.updateRequired || this.queueUpdateRequired
|
|
416
|
+
? "update-required"
|
|
417
|
+
: this.committed === undefined
|
|
418
|
+
? "connecting"
|
|
419
|
+
: "stale");
|
|
420
|
+
if (this.committed !== undefined && !this.stale) {
|
|
421
|
+
this.stale = true;
|
|
422
|
+
this.spawn(this.recompute());
|
|
423
|
+
}
|
|
424
|
+
const [catalog, storage] = await activationStep("closed", () => Promise.all([this.context.catalog(), this.context.storage()]));
|
|
425
|
+
if (!this.live())
|
|
426
|
+
return;
|
|
427
|
+
this.catalog = catalog;
|
|
428
|
+
const credential = await activationStep("authentication-required", () => this.context.credential());
|
|
429
|
+
if (!this.live())
|
|
430
|
+
return;
|
|
431
|
+
this.account = credential.cacheKey;
|
|
432
|
+
const session = await ReplicationSession.open({
|
|
433
|
+
activation: {
|
|
434
|
+
server: this.context.server,
|
|
435
|
+
root: this.context.root,
|
|
436
|
+
},
|
|
437
|
+
credential: credential.token,
|
|
438
|
+
cacheKey: credential.cacheKey,
|
|
439
|
+
attributes: catalog.attributes,
|
|
440
|
+
readCompatibilityHash: catalog.readCompatibilityHash,
|
|
441
|
+
storage,
|
|
442
|
+
onActivationOutcome: () => this.settleActivation(),
|
|
443
|
+
});
|
|
444
|
+
if (!this.live()) {
|
|
445
|
+
await session.close();
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
448
|
+
this.session = session;
|
|
449
|
+
this.releaseSession = session.observe((snapshot) => this.accept(snapshot));
|
|
450
|
+
}
|
|
451
|
+
async refreshCommitted() {
|
|
452
|
+
if (!this.live())
|
|
453
|
+
return;
|
|
454
|
+
await this.session?.refreshFromDurable().catch(() => false);
|
|
455
|
+
}
|
|
456
|
+
async refreshOptimistic() {
|
|
457
|
+
if (!this.live())
|
|
458
|
+
return;
|
|
459
|
+
await this.reconciler?.refresh().catch(() => undefined);
|
|
460
|
+
}
|
|
461
|
+
async reconcileSubmissions(progress) {
|
|
462
|
+
const scope = this.confirmedScope();
|
|
463
|
+
const mine = scope === undefined ? undefined : replicaDatabaseKey(scope);
|
|
464
|
+
if (!this.queueUpdateRequired && mine !== undefined &&
|
|
465
|
+
queueUnreplayable(progress, mine)) {
|
|
466
|
+
this.queueUpdateRequired = true;
|
|
467
|
+
this.publishStatus("update-required");
|
|
468
|
+
}
|
|
469
|
+
const reconciler = this.reconciler;
|
|
470
|
+
if (reconciler === undefined || !this.live())
|
|
471
|
+
return;
|
|
472
|
+
const session = this.session;
|
|
473
|
+
await reconciler.reconcile(progress, session === undefined ? undefined : {
|
|
474
|
+
close: async () => {
|
|
475
|
+
this.releaseSession?.();
|
|
476
|
+
this.releaseSession = undefined;
|
|
477
|
+
this.session = undefined;
|
|
478
|
+
await session.close();
|
|
479
|
+
},
|
|
480
|
+
});
|
|
481
|
+
if (this.session === undefined && this.live())
|
|
482
|
+
await this.restart();
|
|
483
|
+
}
|
|
484
|
+
live() {
|
|
485
|
+
return !this.closed && this.context.live();
|
|
486
|
+
}
|
|
487
|
+
accept(snapshot) {
|
|
488
|
+
if (this.closed)
|
|
489
|
+
return;
|
|
490
|
+
if (snapshot.status === "closed") {
|
|
491
|
+
this.fence();
|
|
492
|
+
this.context.onFenced();
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
if (snapshot.status === "failed" && snapshot.failure === "fenced") {
|
|
496
|
+
this.refence();
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
const value = snapshot.value;
|
|
500
|
+
const identity = value?.identity;
|
|
501
|
+
if (identity !== undefined) {
|
|
502
|
+
const adopted = this.identity === undefined ||
|
|
503
|
+
!sameReplicationIdentity(this.identity, identity);
|
|
504
|
+
if (this.identity !== undefined && adopted)
|
|
505
|
+
this.transition();
|
|
506
|
+
this.identity = identity;
|
|
507
|
+
if (adopted)
|
|
508
|
+
this.confirmation = ++confirmations;
|
|
509
|
+
this.context.onConfirmed(identity);
|
|
510
|
+
this.context.mutations.submit(replicaDatabaseScopeOf(identity));
|
|
511
|
+
this.spawn(this.bindReconciler(identity));
|
|
512
|
+
}
|
|
513
|
+
this.lastSession = snapshot;
|
|
514
|
+
const disposition = readSessionSnapshot(snapshot);
|
|
515
|
+
if (disposition.status === "authentication-required")
|
|
516
|
+
this.refused = true;
|
|
517
|
+
this.stale = value === undefined ? true : value.stale;
|
|
518
|
+
const catalog = this.catalog;
|
|
519
|
+
if (!disposition.publishes || value === undefined || catalog === undefined) {
|
|
520
|
+
this.committed = undefined;
|
|
521
|
+
this.forgetHandles();
|
|
522
|
+
}
|
|
523
|
+
else {
|
|
524
|
+
this.committed = value.db.withComposition(catalog.composition);
|
|
525
|
+
this.handles = value.handles;
|
|
526
|
+
this.reverse = undefined;
|
|
527
|
+
}
|
|
528
|
+
this.revisionStore.publish(this.committed === undefined ? undefined : value?.revision);
|
|
529
|
+
this.publishStatus(this.statusOf(snapshot));
|
|
530
|
+
this.spawn(this.recompute());
|
|
531
|
+
this.answerWake();
|
|
532
|
+
}
|
|
533
|
+
fence() {
|
|
534
|
+
this.closed = true;
|
|
535
|
+
this.generation++;
|
|
536
|
+
this.committed = undefined;
|
|
537
|
+
this.forgetHandles();
|
|
538
|
+
this.withdrawEntities();
|
|
539
|
+
this.forgetCredential();
|
|
540
|
+
this.viewValue = undefined;
|
|
541
|
+
this.viewGeneration = this.generation;
|
|
542
|
+
this.releaseOverlay?.();
|
|
543
|
+
this.releaseOverlay = undefined;
|
|
544
|
+
this.reconciler = undefined;
|
|
545
|
+
this.reconcilerPending = undefined;
|
|
546
|
+
this.reconcilerKey = undefined;
|
|
547
|
+
for (const observer of this.observers.values()) {
|
|
548
|
+
this.spawn(observer.run(this.generation, undefined, true));
|
|
549
|
+
}
|
|
550
|
+
this.observers.clear();
|
|
551
|
+
this.retired.clear();
|
|
552
|
+
this.revisionStore.publish(undefined);
|
|
553
|
+
this.syncStore.publish(syncState("closed"));
|
|
554
|
+
}
|
|
555
|
+
transition(status = "authentication-required") {
|
|
556
|
+
this.generation++;
|
|
557
|
+
this.committed = undefined;
|
|
558
|
+
this.forgetHandles();
|
|
559
|
+
this.withdrawEntities();
|
|
560
|
+
this.forgetCredential();
|
|
561
|
+
this.viewValue = undefined;
|
|
562
|
+
this.viewGeneration = this.generation;
|
|
563
|
+
this.reconciler = undefined;
|
|
564
|
+
this.reconcilerKey = undefined;
|
|
565
|
+
this.reconcilerPending = undefined;
|
|
566
|
+
this.releaseOverlay?.();
|
|
567
|
+
this.releaseOverlay = undefined;
|
|
568
|
+
this.updateRequired = false;
|
|
569
|
+
this.retired.clear();
|
|
570
|
+
this.publishStatus(status);
|
|
571
|
+
for (const observer of this.observers.values()) {
|
|
572
|
+
this.spawn(observer.run(this.generation, undefined, true));
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
refence() {
|
|
576
|
+
this.releaseSession?.();
|
|
577
|
+
this.releaseSession = undefined;
|
|
578
|
+
const session = this.session;
|
|
579
|
+
this.session = undefined;
|
|
580
|
+
this.identity = undefined;
|
|
581
|
+
this.lastSession = undefined;
|
|
582
|
+
this.activation = undefined;
|
|
583
|
+
this.transition("connecting");
|
|
584
|
+
if (session !== undefined)
|
|
585
|
+
this.spawn(session.close());
|
|
586
|
+
if (this.live())
|
|
587
|
+
void this.activate();
|
|
588
|
+
}
|
|
589
|
+
async revalidate() {
|
|
590
|
+
if (!this.live())
|
|
591
|
+
return;
|
|
592
|
+
await this.session?.revalidate().catch(() => false);
|
|
593
|
+
}
|
|
594
|
+
statusOf(snapshot) {
|
|
595
|
+
const status = readSessionSnapshot(snapshot).status;
|
|
596
|
+
if (status === "authentication-required" || status === "closed")
|
|
597
|
+
return status;
|
|
598
|
+
return this.updateRequired || this.queueUpdateRequired
|
|
599
|
+
? "update-required"
|
|
600
|
+
: status;
|
|
601
|
+
}
|
|
602
|
+
publishStatus(status) {
|
|
603
|
+
if (this.closed && status !== "closed")
|
|
604
|
+
return;
|
|
605
|
+
if (this.syncStore.publish(syncState(status)))
|
|
606
|
+
this.context.onSyncChange();
|
|
607
|
+
}
|
|
608
|
+
syncStatus() {
|
|
609
|
+
return this.syncStore.getSnapshot().status;
|
|
610
|
+
}
|
|
611
|
+
activated() {
|
|
612
|
+
return this.activation !== undefined;
|
|
613
|
+
}
|
|
614
|
+
confirmedIdentity() {
|
|
615
|
+
return this.identity;
|
|
616
|
+
}
|
|
617
|
+
confirmedAt() {
|
|
618
|
+
return this.confirmation;
|
|
619
|
+
}
|
|
620
|
+
viewWithdrawn() {
|
|
621
|
+
if (this.closed)
|
|
622
|
+
return true;
|
|
623
|
+
return this.lastSession !== undefined &&
|
|
624
|
+
!readSessionSnapshot(this.lastSession).publishes;
|
|
625
|
+
}
|
|
626
|
+
async recompute() {
|
|
627
|
+
const generation = ++this.generation;
|
|
628
|
+
const committed = this.committed;
|
|
629
|
+
const reconciler = this.reconciler;
|
|
630
|
+
const layers = reconciler?.snapshot().layers ?? emptyOverlayLayers;
|
|
631
|
+
let view = committed;
|
|
632
|
+
let speculative = new Map();
|
|
633
|
+
if (committed !== undefined && reconciler !== undefined && layers.length > 0) {
|
|
634
|
+
try {
|
|
635
|
+
const overlay = await reconciler.view(committed);
|
|
636
|
+
view = overlay.db;
|
|
637
|
+
for (const [handle, local] of overlay.speculative) {
|
|
638
|
+
speculative.set(local, handle);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
catch {
|
|
642
|
+
view = committed;
|
|
643
|
+
speculative = new Map();
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
if (generation !== this.generation || this.closed)
|
|
647
|
+
return;
|
|
648
|
+
this.viewValue = view;
|
|
649
|
+
this.speculative = speculative;
|
|
650
|
+
this.viewGeneration = generation;
|
|
651
|
+
const stale = this.stale;
|
|
652
|
+
for (const observer of this.observers.values()) {
|
|
653
|
+
this.spawn(observer.run(generation, view, stale));
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
bindReconciler(identity) {
|
|
657
|
+
const receiver = replicaDatabaseScopeOf(identity);
|
|
658
|
+
const key = replicaDatabaseKey(receiver);
|
|
659
|
+
if (this.reconcilerKey === key && this.reconcilerPending !== undefined) {
|
|
660
|
+
return this.reconcilerPending;
|
|
661
|
+
}
|
|
662
|
+
this.reconcilerKey = key;
|
|
663
|
+
const pending = (async () => {
|
|
664
|
+
const storage = await this.context.storage();
|
|
665
|
+
const catalog = await this.context.catalog();
|
|
666
|
+
const reconciler = new OptimisticReconciler(storage.outbox(), receiver, catalog.projections, this.reconciliationOptions());
|
|
667
|
+
await reconciler.refresh();
|
|
668
|
+
if (this.reconcilerKey !== key || this.closed)
|
|
669
|
+
return reconciler;
|
|
670
|
+
this.releaseOverlay?.();
|
|
671
|
+
this.reconciler = reconciler;
|
|
672
|
+
this.releaseOverlay = reconciler.observe((state) => this.overlay(state));
|
|
673
|
+
return reconciler;
|
|
674
|
+
})().catch((cause) => {
|
|
675
|
+
if (this.reconcilerPending === pending) {
|
|
676
|
+
this.reconcilerKey = undefined;
|
|
677
|
+
this.reconcilerPending = undefined;
|
|
678
|
+
}
|
|
679
|
+
throw cause;
|
|
680
|
+
});
|
|
681
|
+
this.reconcilerPending = pending;
|
|
682
|
+
return pending;
|
|
683
|
+
}
|
|
684
|
+
reconciliationOptions() {
|
|
685
|
+
return { entity: (id) => this.handles.get(id) };
|
|
686
|
+
}
|
|
687
|
+
forgetCredential() {
|
|
688
|
+
this.account = undefined;
|
|
689
|
+
}
|
|
690
|
+
forgetHandles() {
|
|
691
|
+
this.handles = new Map();
|
|
692
|
+
this.reverse = undefined;
|
|
693
|
+
this.speculative = new Map();
|
|
694
|
+
}
|
|
695
|
+
withdrawEntities() {
|
|
696
|
+
this.registry?.clear();
|
|
697
|
+
this.registry = undefined;
|
|
698
|
+
}
|
|
699
|
+
entityId(eid) {
|
|
700
|
+
const handle = this.sealedHandleOf(eid);
|
|
701
|
+
if (handle !== undefined)
|
|
702
|
+
return handle;
|
|
703
|
+
const speculative = this.speculative.get(eid);
|
|
704
|
+
if (speculative !== undefined)
|
|
705
|
+
return speculative;
|
|
706
|
+
throw new Error("ramose/client: this row has no opaque identity in the current local value");
|
|
707
|
+
}
|
|
708
|
+
localIdOf(id) {
|
|
709
|
+
const mapped = this.reconciler?.mappings().get(id);
|
|
710
|
+
const committed = this.handles.get(mapped ?? id);
|
|
711
|
+
if (committed !== undefined)
|
|
712
|
+
return committed;
|
|
713
|
+
for (const [local, handle] of this.speculative) {
|
|
714
|
+
if (handle === id || (mapped !== undefined && handle === mapped)) {
|
|
715
|
+
return local;
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
return undefined;
|
|
719
|
+
}
|
|
720
|
+
sealedHandleOf(eid) {
|
|
721
|
+
if (this.reverse === undefined) {
|
|
722
|
+
const reverse = new Map();
|
|
723
|
+
for (const [handle, local] of this.handles)
|
|
724
|
+
reverse.set(local, handle);
|
|
725
|
+
this.reverse = reverse;
|
|
726
|
+
}
|
|
727
|
+
return this.reverse.get(eid);
|
|
728
|
+
}
|
|
729
|
+
confirmedScope() {
|
|
730
|
+
return this.identity === undefined
|
|
731
|
+
? undefined
|
|
732
|
+
: replicaDatabaseScopeOf(this.identity);
|
|
733
|
+
}
|
|
734
|
+
overlay(state) {
|
|
735
|
+
if (this.closed)
|
|
736
|
+
return;
|
|
737
|
+
const moved = this.registry?.observe(state.pending);
|
|
738
|
+
if (moved !== undefined && moved.size > 0)
|
|
739
|
+
this.republishLocal(moved);
|
|
740
|
+
const mappings = this.reconciler?.mappings();
|
|
741
|
+
if (mappings !== undefined) {
|
|
742
|
+
for (const [ref, id] of mappings) {
|
|
743
|
+
this.registry?.alias(ref, id);
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
const required = state.updateRequired.length > 0;
|
|
747
|
+
if (required !== this.updateRequired) {
|
|
748
|
+
this.updateRequired = required;
|
|
749
|
+
this.publishStatus(required
|
|
750
|
+
? "update-required"
|
|
751
|
+
: this.statusOf(this.lastSession ?? { status: "connecting" }));
|
|
752
|
+
}
|
|
753
|
+
this.spawn(this.recompute());
|
|
754
|
+
}
|
|
755
|
+
async settleActivation() {
|
|
756
|
+
const identity = this.session?.snapshot().value?.identity ?? this.identity;
|
|
757
|
+
if (identity === undefined || this.closed)
|
|
758
|
+
return;
|
|
759
|
+
const reconciler = await this.bindReconciler(identity);
|
|
760
|
+
await reconciler.outcome(reconciler.activation())();
|
|
761
|
+
}
|
|
762
|
+
async close() {
|
|
763
|
+
if (this.closed) {
|
|
764
|
+
await this.drain();
|
|
765
|
+
return;
|
|
766
|
+
}
|
|
767
|
+
this.closed = true;
|
|
768
|
+
this.generation++;
|
|
769
|
+
this.releaseOverlay?.();
|
|
770
|
+
this.releaseOverlay = undefined;
|
|
771
|
+
this.releaseSession?.();
|
|
772
|
+
this.releaseSession = undefined;
|
|
773
|
+
this.reconciler = undefined;
|
|
774
|
+
this.reconcilerPending = undefined;
|
|
775
|
+
this.committed = undefined;
|
|
776
|
+
this.forgetHandles();
|
|
777
|
+
this.withdrawEntities();
|
|
778
|
+
this.forgetCredential();
|
|
779
|
+
this.viewValue = undefined;
|
|
780
|
+
for (const observer of this.observers.values()) {
|
|
781
|
+
this.spawn(observer.run(this.generation, undefined, true));
|
|
782
|
+
}
|
|
783
|
+
this.observers.clear();
|
|
784
|
+
this.retired.clear();
|
|
785
|
+
this.revisionStore.publish(undefined);
|
|
786
|
+
this.syncStore.publish(syncState("closed"));
|
|
787
|
+
const session = this.session;
|
|
788
|
+
this.session = undefined;
|
|
789
|
+
if (session !== undefined)
|
|
790
|
+
await session.close();
|
|
791
|
+
await this.activation?.catch(() => undefined);
|
|
792
|
+
await this.drain();
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
//# sourceMappingURL=database.js.map
|