@opendatalabs/personal-server-ts-core 1.37.0 → 1.38.1
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/contracts/host-contract.json +115 -0
- package/contracts/raw-end.json +2360 -0
- package/contracts/replace-conformance.json +729 -0
- package/contracts/routes.json +349 -0
- package/contracts/run-finish-plan.json +3238 -0
- package/contracts/run-saved.json +1308 -0
- package/contracts/scope-delete-receipt.json +616 -0
- package/dist/api/account-storage-mode.d.ts +77 -0
- package/dist/api/account-storage-mode.d.ts.map +1 -0
- package/dist/api/account-storage-mode.js +72 -0
- package/dist/api/account-storage-mode.js.map +1 -0
- package/dist/api/index.d.ts +139 -3
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +973 -191
- package/dist/api/index.js.map +1 -1
- package/dist/api/legacy-write-gate.d.ts +51 -0
- package/dist/api/legacy-write-gate.d.ts.map +1 -0
- package/dist/api/legacy-write-gate.js +88 -0
- package/dist/api/legacy-write-gate.js.map +1 -0
- package/dist/api/owner-connector-delete.d.ts +103 -0
- package/dist/api/owner-connector-delete.d.ts.map +1 -0
- package/dist/api/owner-connector-delete.js +158 -0
- package/dist/api/owner-connector-delete.js.map +1 -0
- package/dist/api/pdpp-record-query.d.ts +25 -0
- package/dist/api/pdpp-record-query.d.ts.map +1 -0
- package/dist/api/pdpp-record-query.js +72 -0
- package/dist/api/pdpp-record-query.js.map +1 -0
- package/dist/api/pdpp-records-list.d.ts +133 -0
- package/dist/api/pdpp-records-list.d.ts.map +1 -0
- package/dist/api/pdpp-records-list.js +380 -0
- package/dist/api/pdpp-records-list.js.map +1 -0
- package/dist/api/scope-delete-verdict.d.ts +107 -0
- package/dist/api/scope-delete-verdict.d.ts.map +1 -0
- package/dist/api/scope-delete-verdict.js +92 -0
- package/dist/api/scope-delete-verdict.js.map +1 -0
- package/dist/api/switched-delete-refusal.d.ts +16 -0
- package/dist/api/switched-delete-refusal.d.ts.map +1 -0
- package/dist/api/switched-delete-refusal.js +30 -0
- package/dist/api/switched-delete-refusal.js.map +1 -0
- package/dist/client.d.ts +29 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +34 -2
- package/dist/client.js.map +1 -1
- package/dist/contracts/access-logs.d.ts +1 -0
- package/dist/contracts/access-logs.d.ts.map +1 -1
- package/dist/contracts/access-logs.js +7 -1
- package/dist/contracts/access-logs.js.map +1 -1
- package/dist/contracts/data.d.ts +12 -0
- package/dist/contracts/data.d.ts.map +1 -1
- package/dist/contracts/data.js +30 -1
- package/dist/contracts/data.js.map +1 -1
- package/dist/contracts/grants.d.ts.map +1 -1
- package/dist/contracts/grants.js +9 -0
- package/dist/contracts/grants.js.map +1 -1
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js +1 -1
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/sync.d.ts +9 -1
- package/dist/contracts/sync.d.ts.map +1 -1
- package/dist/contracts/sync.js +6 -2
- package/dist/contracts/sync.js.map +1 -1
- package/dist/derivatives/compute.d.ts.map +1 -1
- package/dist/derivatives/compute.js +19 -0
- package/dist/derivatives/compute.js.map +1 -1
- package/dist/encoding/base64url.d.ts +6 -0
- package/dist/encoding/base64url.d.ts.map +1 -0
- package/dist/encoding/base64url.js +29 -0
- package/dist/encoding/base64url.js.map +1 -0
- package/dist/errors/pdpp-catalog.d.ts +1 -1
- package/dist/errors/pdpp-catalog.d.ts.map +1 -1
- package/dist/errors/pdpp-catalog.js +6 -0
- package/dist/errors/pdpp-catalog.js.map +1 -1
- package/dist/keys/index.d.ts +1 -0
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +1 -0
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/owner-master-key.d.ts +37 -0
- package/dist/keys/owner-master-key.d.ts.map +1 -0
- package/dist/keys/owner-master-key.js +45 -0
- package/dist/keys/owner-master-key.js.map +1 -0
- package/dist/legacy-projection/bindings.d.ts.map +1 -1
- package/dist/legacy-projection/bindings.js +10 -4
- package/dist/legacy-projection/bindings.js.map +1 -1
- package/dist/legacy-projection/erase-connector.d.ts +18 -0
- package/dist/legacy-projection/erase-connector.d.ts.map +1 -0
- package/dist/legacy-projection/erase-connector.js +29 -0
- package/dist/legacy-projection/erase-connector.js.map +1 -0
- package/dist/legacy-projection/index.d.ts +17 -0
- package/dist/legacy-projection/index.d.ts.map +1 -1
- package/dist/legacy-projection/index.js +41 -0
- package/dist/legacy-projection/index.js.map +1 -1
- package/dist/legacy-projection/types.d.ts +12 -2
- package/dist/legacy-projection/types.d.ts.map +1 -1
- package/dist/lineage/gateway.d.ts +3 -1
- package/dist/lineage/gateway.d.ts.map +1 -1
- package/dist/lineage/gateway.js +2 -1
- package/dist/lineage/gateway.js.map +1 -1
- package/dist/localdb/admit.d.ts +138 -0
- package/dist/localdb/admit.d.ts.map +1 -0
- package/dist/localdb/admit.js +344 -0
- package/dist/localdb/admit.js.map +1 -0
- package/dist/localdb/apply-meter.d.ts +14 -0
- package/dist/localdb/apply-meter.d.ts.map +1 -0
- package/dist/localdb/apply-meter.js +31 -0
- package/dist/localdb/apply-meter.js.map +1 -0
- package/dist/localdb/apply-progress.d.ts +10 -0
- package/dist/localdb/apply-progress.d.ts.map +1 -0
- package/dist/localdb/apply-progress.js +39 -0
- package/dist/localdb/apply-progress.js.map +1 -0
- package/dist/localdb/apply.d.ts +17 -0
- package/dist/localdb/apply.d.ts.map +1 -0
- package/dist/localdb/apply.js +291 -0
- package/dist/localdb/apply.js.map +1 -0
- package/dist/localdb/batch-commit.d.ts +70 -0
- package/dist/localdb/batch-commit.d.ts.map +1 -0
- package/dist/localdb/batch-commit.js +91 -0
- package/dist/localdb/batch-commit.js.map +1 -0
- package/dist/localdb/batch-contract.d.ts +19 -0
- package/dist/localdb/batch-contract.d.ts.map +1 -0
- package/dist/localdb/batch-contract.js +24 -0
- package/dist/localdb/batch-contract.js.map +1 -0
- package/dist/localdb/blobs.d.ts +71 -0
- package/dist/localdb/blobs.d.ts.map +1 -0
- package/dist/localdb/blobs.js +306 -0
- package/dist/localdb/blobs.js.map +1 -0
- package/dist/localdb/bootstrap-copy.d.ts +6 -0
- package/dist/localdb/bootstrap-copy.d.ts.map +1 -0
- package/dist/localdb/bootstrap-copy.js +79 -0
- package/dist/localdb/bootstrap-copy.js.map +1 -0
- package/dist/localdb/bootstrap-keys.d.ts +33 -0
- package/dist/localdb/bootstrap-keys.d.ts.map +1 -0
- package/dist/localdb/bootstrap-keys.js +89 -0
- package/dist/localdb/bootstrap-keys.js.map +1 -0
- package/dist/localdb/bootstrap-swap.d.ts +17 -0
- package/dist/localdb/bootstrap-swap.d.ts.map +1 -0
- package/dist/localdb/bootstrap-swap.js +78 -0
- package/dist/localdb/bootstrap-swap.js.map +1 -0
- package/dist/localdb/bootstrap.d.ts +55 -0
- package/dist/localdb/bootstrap.d.ts.map +1 -0
- package/dist/localdb/bootstrap.js +195 -0
- package/dist/localdb/bootstrap.js.map +1 -0
- package/dist/localdb/complete-read.d.ts +77 -0
- package/dist/localdb/complete-read.d.ts.map +1 -0
- package/dist/localdb/complete-read.js +136 -0
- package/dist/localdb/complete-read.js.map +1 -0
- package/dist/localdb/connection-link.d.ts +12 -0
- package/dist/localdb/connection-link.d.ts.map +1 -0
- package/dist/localdb/connection-link.js +79 -0
- package/dist/localdb/connection-link.js.map +1 -0
- package/dist/localdb/cursor.d.ts +61 -0
- package/dist/localdb/cursor.d.ts.map +1 -0
- package/dist/localdb/cursor.js +178 -0
- package/dist/localdb/cursor.js.map +1 -0
- package/dist/localdb/cycle.d.ts +69 -0
- package/dist/localdb/cycle.d.ts.map +1 -0
- package/dist/localdb/cycle.js +189 -0
- package/dist/localdb/cycle.js.map +1 -0
- package/dist/localdb/delete-batch.d.ts +29 -0
- package/dist/localdb/delete-batch.d.ts.map +1 -0
- package/dist/localdb/delete-batch.js +84 -0
- package/dist/localdb/delete-batch.js.map +1 -0
- package/dist/localdb/delete-lifetime.d.ts +24 -0
- package/dist/localdb/delete-lifetime.d.ts.map +1 -0
- package/dist/localdb/delete-lifetime.js +83 -0
- package/dist/localdb/delete-lifetime.js.map +1 -0
- package/dist/localdb/delete.d.ts +88 -0
- package/dist/localdb/delete.d.ts.map +1 -0
- package/dist/localdb/delete.js +521 -0
- package/dist/localdb/delete.js.map +1 -0
- package/dist/localdb/delta-apply.d.ts +4 -0
- package/dist/localdb/delta-apply.d.ts.map +1 -0
- package/dist/localdb/delta-apply.js +253 -0
- package/dist/localdb/delta-apply.js.map +1 -0
- package/dist/localdb/deps.d.ts +87 -0
- package/dist/localdb/deps.d.ts.map +1 -0
- package/dist/localdb/deps.js +10 -0
- package/dist/localdb/deps.js.map +1 -0
- package/dist/localdb/driver.d.ts +51 -0
- package/dist/localdb/driver.d.ts.map +1 -0
- package/dist/localdb/driver.js +3 -0
- package/dist/localdb/driver.js.map +1 -0
- package/dist/localdb/fence.d.ts +31 -0
- package/dist/localdb/fence.d.ts.map +1 -0
- package/dist/localdb/fence.js +69 -0
- package/dist/localdb/fence.js.map +1 -0
- package/dist/localdb/history.d.ts +76 -0
- package/dist/localdb/history.d.ts.map +1 -0
- package/dist/localdb/history.js +256 -0
- package/dist/localdb/history.js.map +1 -0
- package/dist/localdb/import-fingerprint.d.ts +8 -0
- package/dist/localdb/import-fingerprint.d.ts.map +1 -0
- package/dist/localdb/import-fingerprint.js +35 -0
- package/dist/localdb/import-fingerprint.js.map +1 -0
- package/dist/localdb/import-ledger.d.ts +27 -0
- package/dist/localdb/import-ledger.d.ts.map +1 -0
- package/dist/localdb/import-ledger.js +197 -0
- package/dist/localdb/import-ledger.js.map +1 -0
- package/dist/localdb/import-readback.d.ts +8 -0
- package/dist/localdb/import-readback.d.ts.map +1 -0
- package/dist/localdb/import-readback.js +69 -0
- package/dist/localdb/import-readback.js.map +1 -0
- package/dist/localdb/import-snapshot.d.ts +21 -0
- package/dist/localdb/import-snapshot.d.ts.map +1 -0
- package/dist/localdb/import-snapshot.js +94 -0
- package/dist/localdb/import-snapshot.js.map +1 -0
- package/dist/localdb/index.d.ts +42 -0
- package/dist/localdb/index.d.ts.map +1 -0
- package/dist/localdb/index.js +40 -0
- package/dist/localdb/index.js.map +1 -0
- package/dist/localdb/legacy-import-types.d.ts +112 -0
- package/dist/localdb/legacy-import-types.d.ts.map +1 -0
- package/dist/localdb/legacy-import-types.js +2 -0
- package/dist/localdb/legacy-import-types.js.map +1 -0
- package/dist/localdb/legacy-import.d.ts +67 -0
- package/dist/localdb/legacy-import.d.ts.map +1 -0
- package/dist/localdb/legacy-import.js +320 -0
- package/dist/localdb/legacy-import.js.map +1 -0
- package/dist/localdb/legacy-retire.d.ts +26 -0
- package/dist/localdb/legacy-retire.d.ts.map +1 -0
- package/dist/localdb/legacy-retire.js +93 -0
- package/dist/localdb/legacy-retire.js.map +1 -0
- package/dist/localdb/lifetime.d.ts +29 -0
- package/dist/localdb/lifetime.d.ts.map +1 -0
- package/dist/localdb/lifetime.js +64 -0
- package/dist/localdb/lifetime.js.map +1 -0
- package/dist/localdb/listing.d.ts +70 -0
- package/dist/localdb/listing.d.ts.map +1 -0
- package/dist/localdb/listing.js +345 -0
- package/dist/localdb/listing.js.map +1 -0
- package/dist/localdb/log-apply.d.ts +46 -0
- package/dist/localdb/log-apply.d.ts.map +1 -0
- package/dist/localdb/log-apply.js +827 -0
- package/dist/localdb/log-apply.js.map +1 -0
- package/dist/localdb/log-batch.d.ts +204 -0
- package/dist/localdb/log-batch.d.ts.map +1 -0
- package/dist/localdb/log-batch.js +418 -0
- package/dist/localdb/log-batch.js.map +1 -0
- package/dist/localdb/log-bodies.d.ts +27 -0
- package/dist/localdb/log-bodies.d.ts.map +1 -0
- package/dist/localdb/log-bodies.js +142 -0
- package/dist/localdb/log-bodies.js.map +1 -0
- package/dist/localdb/log-bootstrap-stage.d.ts +5 -0
- package/dist/localdb/log-bootstrap-stage.d.ts.map +1 -0
- package/dist/localdb/log-bootstrap-stage.js +60 -0
- package/dist/localdb/log-bootstrap-stage.js.map +1 -0
- package/dist/localdb/log-bootstrap.d.ts +23 -0
- package/dist/localdb/log-bootstrap.d.ts.map +1 -0
- package/dist/localdb/log-bootstrap.js +399 -0
- package/dist/localdb/log-bootstrap.js.map +1 -0
- package/dist/localdb/log-compact.d.ts +28 -0
- package/dist/localdb/log-compact.d.ts.map +1 -0
- package/dist/localdb/log-compact.js +83 -0
- package/dist/localdb/log-compact.js.map +1 -0
- package/dist/localdb/log-keyed.d.ts +118 -0
- package/dist/localdb/log-keyed.d.ts.map +1 -0
- package/dist/localdb/log-keyed.js +640 -0
- package/dist/localdb/log-keyed.js.map +1 -0
- package/dist/localdb/log-progressive.d.ts +18 -0
- package/dist/localdb/log-progressive.d.ts.map +1 -0
- package/dist/localdb/log-progressive.js +58 -0
- package/dist/localdb/log-progressive.js.map +1 -0
- package/dist/localdb/log-publish-phases.d.ts +31 -0
- package/dist/localdb/log-publish-phases.d.ts.map +1 -0
- package/dist/localdb/log-publish-phases.js +40 -0
- package/dist/localdb/log-publish-phases.js.map +1 -0
- package/dist/localdb/log-publish.d.ts +16 -0
- package/dist/localdb/log-publish.d.ts.map +1 -0
- package/dist/localdb/log-publish.js +1745 -0
- package/dist/localdb/log-publish.js.map +1 -0
- package/dist/localdb/log-rebase.d.ts +12 -0
- package/dist/localdb/log-rebase.d.ts.map +1 -0
- package/dist/localdb/log-rebase.js +74 -0
- package/dist/localdb/log-rebase.js.map +1 -0
- package/dist/localdb/log-recommit.d.ts +15 -0
- package/dist/localdb/log-recommit.d.ts.map +1 -0
- package/dist/localdb/log-recommit.js +88 -0
- package/dist/localdb/log-recommit.js.map +1 -0
- package/dist/localdb/log-seed.d.ts +25 -0
- package/dist/localdb/log-seed.d.ts.map +1 -0
- package/dist/localdb/log-seed.js +129 -0
- package/dist/localdb/log-seed.js.map +1 -0
- package/dist/localdb/log-state.d.ts +34 -0
- package/dist/localdb/log-state.d.ts.map +1 -0
- package/dist/localdb/log-state.js +79 -0
- package/dist/localdb/log-state.js.map +1 -0
- package/dist/localdb/merge.d.ts +122 -0
- package/dist/localdb/merge.d.ts.map +1 -0
- package/dist/localdb/merge.js +339 -0
- package/dist/localdb/merge.js.map +1 -0
- package/dist/localdb/migrate.d.ts +10 -0
- package/dist/localdb/migrate.d.ts.map +1 -0
- package/dist/localdb/migrate.js +27 -0
- package/dist/localdb/migrate.js.map +1 -0
- package/dist/localdb/name.d.ts +10 -0
- package/dist/localdb/name.d.ts.map +1 -0
- package/dist/localdb/name.js +15 -0
- package/dist/localdb/name.js.map +1 -0
- package/dist/localdb/open.d.ts +33 -0
- package/dist/localdb/open.d.ts.map +1 -0
- package/dist/localdb/open.js +46 -0
- package/dist/localdb/open.js.map +1 -0
- package/dist/localdb/part-layout.d.ts +6 -0
- package/dist/localdb/part-layout.d.ts.map +1 -0
- package/dist/localdb/part-layout.js +6 -0
- package/dist/localdb/part-layout.js.map +1 -0
- package/dist/localdb/part-readahead.d.ts +87 -0
- package/dist/localdb/part-readahead.d.ts.map +1 -0
- package/dist/localdb/part-readahead.js +130 -0
- package/dist/localdb/part-readahead.js.map +1 -0
- package/dist/localdb/partial-load.d.ts +42 -0
- package/dist/localdb/partial-load.d.ts.map +1 -0
- package/dist/localdb/partial-load.js +120 -0
- package/dist/localdb/partial-load.js.map +1 -0
- package/dist/localdb/partial-read.d.ts +64 -0
- package/dist/localdb/partial-read.d.ts.map +1 -0
- package/dist/localdb/partial-read.js +110 -0
- package/dist/localdb/partial-read.js.map +1 -0
- package/dist/localdb/plan-inputs.d.ts +31 -0
- package/dist/localdb/plan-inputs.d.ts.map +1 -0
- package/dist/localdb/plan-inputs.js +26 -0
- package/dist/localdb/plan-inputs.js.map +1 -0
- package/dist/localdb/publication-work.d.ts +20 -0
- package/dist/localdb/publication-work.d.ts.map +1 -0
- package/dist/localdb/publication-work.js +60 -0
- package/dist/localdb/publication-work.js.map +1 -0
- package/dist/localdb/publish-meter.d.ts +32 -0
- package/dist/localdb/publish-meter.d.ts.map +1 -0
- package/dist/localdb/publish-meter.js +36 -0
- package/dist/localdb/publish-meter.js.map +1 -0
- package/dist/localdb/publish.d.ts +153 -0
- package/dist/localdb/publish.d.ts.map +1 -0
- package/dist/localdb/publish.js +329 -0
- package/dist/localdb/publish.js.map +1 -0
- package/dist/localdb/purge.d.ts +40 -0
- package/dist/localdb/purge.d.ts.map +1 -0
- package/dist/localdb/purge.js +159 -0
- package/dist/localdb/purge.js.map +1 -0
- package/dist/localdb/query.d.ts +77 -0
- package/dist/localdb/query.d.ts.map +1 -0
- package/dist/localdb/query.js +330 -0
- package/dist/localdb/query.js.map +1 -0
- package/dist/localdb/queue.d.ts +10 -0
- package/dist/localdb/queue.d.ts.map +1 -0
- package/dist/localdb/queue.js +31 -0
- package/dist/localdb/queue.js.map +1 -0
- package/dist/localdb/raw-end-evidence.d.ts +16 -0
- package/dist/localdb/raw-end-evidence.d.ts.map +1 -0
- package/dist/localdb/raw-end-evidence.js +27 -0
- package/dist/localdb/raw-end-evidence.js.map +1 -0
- package/dist/localdb/read-selection.d.ts +182 -0
- package/dist/localdb/read-selection.d.ts.map +1 -0
- package/dist/localdb/read-selection.js +290 -0
- package/dist/localdb/read-selection.js.map +1 -0
- package/dist/localdb/registered-read.d.ts +15 -0
- package/dist/localdb/registered-read.d.ts.map +1 -0
- package/dist/localdb/registered-read.js +62 -0
- package/dist/localdb/registered-read.js.map +1 -0
- package/dist/localdb/replace.d.ts +33 -0
- package/dist/localdb/replace.d.ts.map +1 -0
- package/dist/localdb/replace.js +22 -0
- package/dist/localdb/replace.js.map +1 -0
- package/dist/localdb/requirements.d.ts +35 -0
- package/dist/localdb/requirements.d.ts.map +1 -0
- package/dist/localdb/requirements.js +66 -0
- package/dist/localdb/requirements.js.map +1 -0
- package/dist/localdb/resolve.d.ts +69 -0
- package/dist/localdb/resolve.d.ts.map +1 -0
- package/dist/localdb/resolve.js +436 -0
- package/dist/localdb/resolve.js.map +1 -0
- package/dist/localdb/run-end.d.ts +35 -0
- package/dist/localdb/run-end.d.ts.map +1 -0
- package/dist/localdb/run-end.js +520 -0
- package/dist/localdb/run-end.js.map +1 -0
- package/dist/localdb/run-intake.d.ts +17 -0
- package/dist/localdb/run-intake.d.ts.map +1 -0
- package/dist/localdb/run-intake.js +662 -0
- package/dist/localdb/run-intake.js.map +1 -0
- package/dist/localdb/run-receipts.d.ts +19 -0
- package/dist/localdb/run-receipts.d.ts.map +1 -0
- package/dist/localdb/run-receipts.js +151 -0
- package/dist/localdb/run-receipts.js.map +1 -0
- package/dist/localdb/schema.d.ts +7 -0
- package/dist/localdb/schema.d.ts.map +1 -0
- package/dist/localdb/schema.js +686 -0
- package/dist/localdb/schema.js.map +1 -0
- package/dist/localdb/seed.d.ts +39 -0
- package/dist/localdb/seed.d.ts.map +1 -0
- package/dist/localdb/seed.js +188 -0
- package/dist/localdb/seed.js.map +1 -0
- package/dist/localdb/slot.d.ts +9 -0
- package/dist/localdb/slot.d.ts.map +1 -0
- package/dist/localdb/slot.js +15 -0
- package/dist/localdb/slot.js.map +1 -0
- package/dist/localdb/stream-digest.d.ts +35 -0
- package/dist/localdb/stream-digest.d.ts.map +1 -0
- package/dist/localdb/stream-digest.js +50 -0
- package/dist/localdb/stream-digest.js.map +1 -0
- package/dist/localdb/sync.d.ts +75 -0
- package/dist/localdb/sync.d.ts.map +1 -0
- package/dist/localdb/sync.js +339 -0
- package/dist/localdb/sync.js.map +1 -0
- package/dist/localdb/system-stream-descriptor.d.ts +22 -0
- package/dist/localdb/system-stream-descriptor.d.ts.map +1 -0
- package/dist/localdb/system-stream-descriptor.js +24 -0
- package/dist/localdb/system-stream-descriptor.js.map +1 -0
- package/dist/localdb/system-stream-page.d.ts +15 -0
- package/dist/localdb/system-stream-page.d.ts.map +1 -0
- package/dist/localdb/system-stream-page.js +98 -0
- package/dist/localdb/system-stream-page.js.map +1 -0
- package/dist/localdb/system-streams.d.ts +35 -0
- package/dist/localdb/system-streams.d.ts.map +1 -0
- package/dist/localdb/system-streams.js +350 -0
- package/dist/localdb/system-streams.js.map +1 -0
- package/dist/localdb/transfer-memory.d.ts +17 -0
- package/dist/localdb/transfer-memory.d.ts.map +1 -0
- package/dist/localdb/transfer-memory.js +17 -0
- package/dist/localdb/transfer-memory.js.map +1 -0
- package/dist/localdb/unwrite.d.ts +28 -0
- package/dist/localdb/unwrite.d.ts.map +1 -0
- package/dist/localdb/unwrite.js +62 -0
- package/dist/localdb/unwrite.js.map +1 -0
- package/dist/localdb/update-required.d.ts +10 -0
- package/dist/localdb/update-required.d.ts.map +1 -0
- package/dist/localdb/update-required.js +27 -0
- package/dist/localdb/update-required.js.map +1 -0
- package/dist/localdb/view-changes.d.ts +58 -0
- package/dist/localdb/view-changes.d.ts.map +1 -0
- package/dist/localdb/view-changes.js +174 -0
- package/dist/localdb/view-changes.js.map +1 -0
- package/dist/logging/access-log.d.ts +2 -2
- package/dist/logging/access-log.d.ts.map +1 -1
- package/dist/logging/access-reader.d.ts +4 -1
- package/dist/logging/access-reader.d.ts.map +1 -1
- package/dist/logging/activity-stream.d.ts +37 -0
- package/dist/logging/activity-stream.d.ts.map +1 -0
- package/dist/logging/activity-stream.js +86 -0
- package/dist/logging/activity-stream.js.map +1 -0
- package/dist/mcp/approval-url.d.ts +32 -0
- package/dist/mcp/approval-url.d.ts.map +1 -1
- package/dist/mcp/approval-url.js +76 -0
- package/dist/mcp/approval-url.js.map +1 -1
- package/dist/mcp/connection-api.d.ts +54 -27
- package/dist/mcp/connection-api.d.ts.map +1 -1
- package/dist/mcp/connection-api.js +267 -77
- package/dist/mcp/connection-api.js.map +1 -1
- package/dist/mcp/grant-registration.d.ts +15 -0
- package/dist/mcp/grant-registration.d.ts.map +1 -0
- package/dist/mcp/grant-registration.js +44 -0
- package/dist/mcp/grant-registration.js.map +1 -0
- package/dist/mcp/index.d.ts +1 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +1 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/read-client.d.ts +32 -10
- package/dist/mcp/read-client.d.ts.map +1 -1
- package/dist/mcp/read-client.js +299 -15
- package/dist/mcp/read-client.js.map +1 -1
- package/dist/mcp/resources.d.ts +3 -1
- package/dist/mcp/resources.d.ts.map +1 -1
- package/dist/mcp/resources.js +11 -2
- package/dist/mcp/resources.js.map +1 -1
- package/dist/mcp/server.d.ts +17 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +54 -7
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/session.d.ts +2 -0
- package/dist/mcp/session.d.ts.map +1 -1
- package/dist/mcp/session.js +41 -8
- package/dist/mcp/session.js.map +1 -1
- package/dist/mcp/store.d.ts +14 -1
- package/dist/mcp/store.d.ts.map +1 -1
- package/dist/mcp/store.js +31 -2
- package/dist/mcp/store.js.map +1 -1
- package/dist/mcp/tools.d.ts +62 -0
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +186 -64
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp/types.d.ts +3 -1
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/oura/index.d.ts +1 -1
- package/dist/oura/index.d.ts.map +1 -1
- package/dist/oura/index.js +15 -0
- package/dist/oura/index.js.map +1 -1
- package/dist/payment/x402.d.ts +6 -3
- package/dist/payment/x402.d.ts.map +1 -1
- package/dist/payment/x402.js +35 -0
- package/dist/payment/x402.js.map +1 -1
- package/dist/pdpp/pkce.d.ts +1 -22
- package/dist/pdpp/pkce.d.ts.map +1 -1
- package/dist/pdpp/pkce.js +3 -2
- package/dist/pdpp/pkce.js.map +1 -1
- package/dist/policy/reserved-scopes.d.ts +3 -0
- package/dist/policy/reserved-scopes.d.ts.map +1 -1
- package/dist/policy/reserved-scopes.js +12 -1
- package/dist/policy/reserved-scopes.js.map +1 -1
- package/dist/ports/index.d.ts +61 -9
- package/dist/ports/index.d.ts.map +1 -1
- package/dist/ports/index.js.map +1 -1
- package/dist/publication/publish.d.ts +31 -1
- package/dist/publication/publish.d.ts.map +1 -1
- package/dist/publication/publish.js +30 -14
- package/dist/publication/publish.js.map +1 -1
- package/dist/replication/copies.d.ts +1 -1
- package/dist/replication/dpv2.d.ts.map +1 -1
- package/dist/replication/dpv2.js +33 -0
- package/dist/replication/dpv2.js.map +1 -1
- package/dist/schemas/server-config.d.ts +16 -0
- package/dist/schemas/server-config.d.ts.map +1 -1
- package/dist/schemas/server-config.js +49 -0
- package/dist/schemas/server-config.js.map +1 -1
- package/dist/storage/adapters/interface.d.ts +12 -2
- package/dist/storage/adapters/interface.d.ts.map +1 -1
- package/dist/storage/adapters/interface.js.map +1 -1
- package/dist/storage/adapters/rate-limit-policy.d.ts +71 -0
- package/dist/storage/adapters/rate-limit-policy.d.ts.map +1 -0
- package/dist/storage/adapters/rate-limit-policy.js +107 -0
- package/dist/storage/adapters/rate-limit-policy.js.map +1 -0
- package/dist/storage/adapters/sdk.d.ts +7 -0
- package/dist/storage/adapters/sdk.d.ts.map +1 -1
- package/dist/storage/adapters/sdk.js +12 -6
- package/dist/storage/adapters/sdk.js.map +1 -1
- package/dist/storage/adapters/throttle.d.ts +30 -0
- package/dist/storage/adapters/throttle.d.ts.map +1 -0
- package/dist/storage/adapters/throttle.js +94 -0
- package/dist/storage/adapters/throttle.js.map +1 -0
- package/dist/storage/adapters/vana-audience.d.ts +4 -1
- package/dist/storage/adapters/vana-audience.d.ts.map +1 -1
- package/dist/storage/adapters/vana-audience.js +23 -11
- package/dist/storage/adapters/vana-audience.js.map +1 -1
- package/dist/storage/adapters/vana.d.ts +5 -0
- package/dist/storage/adapters/vana.d.ts.map +1 -1
- package/dist/storage/adapters/vana.js +82 -18
- package/dist/storage/adapters/vana.js.map +1 -1
- package/dist/storage/blocks/cursor.d.ts.map +1 -1
- package/dist/storage/blocks/cursor.js +3 -13
- package/dist/storage/blocks/cursor.js.map +1 -1
- package/dist/storage/canonical-legacy-projection.d.ts +13 -1
- package/dist/storage/canonical-legacy-projection.d.ts.map +1 -1
- package/dist/storage/canonical-legacy-projection.js +92 -24
- package/dist/storage/canonical-legacy-projection.js.map +1 -1
- package/dist/storage/hierarchy/paths.d.ts.map +1 -1
- package/dist/storage/hierarchy/paths.js +9 -2
- package/dist/storage/hierarchy/paths.js.map +1 -1
- package/dist/storage/index/manager.d.ts +19 -5
- package/dist/storage/index/manager.d.ts.map +1 -1
- package/dist/storage/legacy-scope-view.d.ts +4 -6
- package/dist/storage/legacy-scope-view.d.ts.map +1 -1
- package/dist/storage/legacy-scope-view.js +50 -57
- package/dist/storage/legacy-scope-view.js.map +1 -1
- package/dist/storage/legacy-write-seal.d.ts +73 -0
- package/dist/storage/legacy-write-seal.d.ts.map +1 -0
- package/dist/storage/legacy-write-seal.js +74 -0
- package/dist/storage/legacy-write-seal.js.map +1 -0
- package/dist/storage/pdpp-records/cursor.d.ts.map +1 -1
- package/dist/storage/pdpp-records/cursor.js +3 -29
- package/dist/storage/pdpp-records/cursor.js.map +1 -1
- package/dist/storage/pdpp-records/declaration-witness.d.ts.map +1 -1
- package/dist/storage/pdpp-records/declaration-witness.js +4 -3
- package/dist/storage/pdpp-records/declaration-witness.js.map +1 -1
- package/dist/storage/pdpp-records/types.d.ts +2 -0
- package/dist/storage/pdpp-records/types.d.ts.map +1 -1
- package/dist/storage/pdpp-records/types.js.map +1 -1
- package/dist/stream-sync/artifacts.d.ts +38 -0
- package/dist/stream-sync/artifacts.d.ts.map +1 -0
- package/dist/stream-sync/artifacts.js +179 -0
- package/dist/stream-sync/artifacts.js.map +1 -0
- package/dist/stream-sync/blobs.d.ts +18 -0
- package/dist/stream-sync/blobs.d.ts.map +1 -0
- package/dist/stream-sync/blobs.js +83 -0
- package/dist/stream-sync/blobs.js.map +1 -0
- package/dist/stream-sync/crypto-port.d.ts +30 -0
- package/dist/stream-sync/crypto-port.d.ts.map +1 -0
- package/dist/stream-sync/crypto-port.js +29 -0
- package/dist/stream-sync/crypto-port.js.map +1 -0
- package/dist/stream-sync/crypto.d.ts +27 -0
- package/dist/stream-sync/crypto.d.ts.map +1 -0
- package/dist/stream-sync/crypto.js +67 -0
- package/dist/stream-sync/crypto.js.map +1 -0
- package/dist/stream-sync/delete-metadata.d.ts +23 -0
- package/dist/stream-sync/delete-metadata.d.ts.map +1 -0
- package/dist/stream-sync/delete-metadata.js +40 -0
- package/dist/stream-sync/delete-metadata.js.map +1 -0
- package/dist/stream-sync/design-flags.d.ts +31 -0
- package/dist/stream-sync/design-flags.d.ts.map +1 -0
- package/dist/stream-sync/design-flags.js +44 -0
- package/dist/stream-sync/design-flags.js.map +1 -0
- package/dist/stream-sync/host-contract.d.ts +50 -0
- package/dist/stream-sync/host-contract.d.ts.map +1 -0
- package/dist/stream-sync/host-contract.js +80 -0
- package/dist/stream-sync/host-contract.js.map +1 -0
- package/dist/stream-sync/index.d.ts +19 -0
- package/dist/stream-sync/index.d.ts.map +1 -0
- package/dist/stream-sync/index.js +19 -0
- package/dist/stream-sync/index.js.map +1 -0
- package/dist/stream-sync/intake.d.ts +319 -0
- package/dist/stream-sync/intake.d.ts.map +1 -0
- package/dist/stream-sync/intake.js +62 -0
- package/dist/stream-sync/intake.js.map +1 -0
- package/dist/stream-sync/memory-registry.d.ts +85 -0
- package/dist/stream-sync/memory-registry.d.ts.map +1 -0
- package/dist/stream-sync/memory-registry.js +293 -0
- package/dist/stream-sync/memory-registry.js.map +1 -0
- package/dist/stream-sync/normalize-raw-end.d.ts +25 -0
- package/dist/stream-sync/normalize-raw-end.d.ts.map +1 -0
- package/dist/stream-sync/normalize-raw-end.js +177 -0
- package/dist/stream-sync/normalize-raw-end.js.map +1 -0
- package/dist/stream-sync/ports.d.ts +486 -0
- package/dist/stream-sync/ports.d.ts.map +1 -0
- package/dist/stream-sync/ports.js +91 -0
- package/dist/stream-sync/ports.js.map +1 -0
- package/dist/stream-sync/publish-plan.d.ts +129 -0
- package/dist/stream-sync/publish-plan.d.ts.map +1 -0
- package/dist/stream-sync/publish-plan.js +134 -0
- package/dist/stream-sync/publish-plan.js.map +1 -0
- package/dist/stream-sync/raw-end.d.ts +59 -0
- package/dist/stream-sync/raw-end.d.ts.map +1 -0
- package/dist/stream-sync/raw-end.js +113 -0
- package/dist/stream-sync/raw-end.js.map +1 -0
- package/dist/stream-sync/registry.d.ts +31 -0
- package/dist/stream-sync/registry.d.ts.map +1 -0
- package/dist/stream-sync/registry.js +645 -0
- package/dist/stream-sync/registry.js.map +1 -0
- package/dist/stream-sync/run-finish-plan.d.ts +61 -0
- package/dist/stream-sync/run-finish-plan.d.ts.map +1 -0
- package/dist/stream-sync/run-finish-plan.js +373 -0
- package/dist/stream-sync/run-finish-plan.js.map +1 -0
- package/dist/stream-sync/run-saved.d.ts +51 -0
- package/dist/stream-sync/run-saved.d.ts.map +1 -0
- package/dist/stream-sync/run-saved.js +83 -0
- package/dist/stream-sync/run-saved.js.map +1 -0
- package/dist/stream-sync/scope-routing.d.ts +17 -0
- package/dist/stream-sync/scope-routing.d.ts.map +1 -0
- package/dist/stream-sync/scope-routing.js +24 -0
- package/dist/stream-sync/scope-routing.js.map +1 -0
- package/dist/stream-sync/seed-staging.d.ts +85 -0
- package/dist/stream-sync/seed-staging.d.ts.map +1 -0
- package/dist/stream-sync/seed-staging.js +325 -0
- package/dist/stream-sync/seed-staging.js.map +1 -0
- package/dist/stream-sync/semver.d.ts +3 -0
- package/dist/stream-sync/semver.d.ts.map +1 -0
- package/dist/stream-sync/semver.js +49 -0
- package/dist/stream-sync/semver.js.map +1 -0
- package/dist/stream-sync/send-gate.d.ts +149 -0
- package/dist/stream-sync/send-gate.d.ts.map +1 -0
- package/dist/stream-sync/send-gate.js +382 -0
- package/dist/stream-sync/send-gate.js.map +1 -0
- package/dist/stream-sync/storage-retry.d.ts +216 -0
- package/dist/stream-sync/storage-retry.d.ts.map +1 -0
- package/dist/stream-sync/storage-retry.js +315 -0
- package/dist/stream-sync/storage-retry.js.map +1 -0
- package/dist/stream-sync/stream-aead.d.ts +33 -0
- package/dist/stream-sync/stream-aead.d.ts.map +1 -0
- package/dist/stream-sync/stream-aead.js +183 -0
- package/dist/stream-sync/stream-aead.js.map +1 -0
- package/dist/stream-sync/timer.d.ts +3 -0
- package/dist/stream-sync/timer.d.ts.map +1 -0
- package/dist/stream-sync/timer.js +3 -0
- package/dist/stream-sync/timer.js.map +1 -0
- package/dist/stream-sync-read/index.d.ts +4 -0
- package/dist/stream-sync-read/index.d.ts.map +1 -0
- package/dist/stream-sync-read/index.js +3 -0
- package/dist/stream-sync-read/index.js.map +1 -0
- package/dist/stream-sync-read/routing.d.ts +27 -0
- package/dist/stream-sync-read/routing.d.ts.map +1 -0
- package/dist/stream-sync-read/routing.js +49 -0
- package/dist/stream-sync-read/routing.js.map +1 -0
- package/dist/stream-sync-read/service.d.ts +281 -0
- package/dist/stream-sync-read/service.d.ts.map +1 -0
- package/dist/stream-sync-read/service.js +18 -0
- package/dist/stream-sync-read/service.js.map +1 -0
- package/dist/sync/account-mode/authority.d.ts +121 -0
- package/dist/sync/account-mode/authority.d.ts.map +1 -0
- package/dist/sync/account-mode/authority.js +446 -0
- package/dist/sync/account-mode/authority.js.map +1 -0
- package/dist/sync/account-mode/evidence-wire.d.ts +42 -0
- package/dist/sync/account-mode/evidence-wire.d.ts.map +1 -0
- package/dist/sync/account-mode/evidence-wire.js +76 -0
- package/dist/sync/account-mode/evidence-wire.js.map +1 -0
- package/dist/sync/account-mode/import-waker.d.ts +36 -0
- package/dist/sync/account-mode/import-waker.d.ts.map +1 -0
- package/dist/sync/account-mode/import-waker.js +55 -0
- package/dist/sync/account-mode/import-waker.js.map +1 -0
- package/dist/sync/account-mode/index.d.ts +10 -0
- package/dist/sync/account-mode/index.d.ts.map +1 -0
- package/dist/sync/account-mode/index.js +10 -0
- package/dist/sync/account-mode/index.js.map +1 -0
- package/dist/sync/account-mode/port.d.ts +11 -0
- package/dist/sync/account-mode/port.d.ts.map +1 -0
- package/dist/sync/account-mode/port.js +21 -0
- package/dist/sync/account-mode/port.js.map +1 -0
- package/dist/sync/account-mode/record.d.ts +54 -0
- package/dist/sync/account-mode/record.d.ts.map +1 -0
- package/dist/sync/account-mode/record.js +62 -0
- package/dist/sync/account-mode/record.js.map +1 -0
- package/dist/sync/account-mode/rw-lock.d.ts +14 -0
- package/dist/sync/account-mode/rw-lock.d.ts.map +1 -0
- package/dist/sync/account-mode/rw-lock.js +59 -0
- package/dist/sync/account-mode/rw-lock.js.map +1 -0
- package/dist/sync/cancellable-gateway.d.ts +25 -0
- package/dist/sync/cancellable-gateway.d.ts.map +1 -0
- package/dist/sync/cancellable-gateway.js +64 -0
- package/dist/sync/cancellable-gateway.js.map +1 -0
- package/dist/sync/engine/change-probe.d.ts +49 -0
- package/dist/sync/engine/change-probe.d.ts.map +1 -0
- package/dist/sync/engine/change-probe.js +84 -0
- package/dist/sync/engine/change-probe.js.map +1 -0
- package/dist/sync/engine/change-push.d.ts +56 -0
- package/dist/sync/engine/change-push.d.ts.map +1 -0
- package/dist/sync/engine/change-push.js +176 -0
- package/dist/sync/engine/change-push.js.map +1 -0
- package/dist/sync/engine/sync-manager.d.ts +208 -1
- package/dist/sync/engine/sync-manager.d.ts.map +1 -1
- package/dist/sync/engine/sync-manager.js +1005 -34
- package/dist/sync/engine/sync-manager.js.map +1 -1
- package/dist/sync/index.d.ts +6 -2
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +5 -1
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/pdpp-import.d.ts +12 -2
- package/dist/sync/pdpp-import.d.ts.map +1 -1
- package/dist/sync/pdpp-import.js +32 -7
- package/dist/sync/pdpp-import.js.map +1 -1
- package/dist/sync/tombstone-resubmits.d.ts +7 -4
- package/dist/sync/tombstone-resubmits.d.ts.map +1 -1
- package/dist/sync/tombstone-resubmits.js.map +1 -1
- package/dist/sync/types.d.ts +29 -0
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/sync/upload-attempts.d.ts +244 -0
- package/dist/sync/upload-attempts.d.ts.map +1 -0
- package/dist/sync/upload-attempts.js +548 -0
- package/dist/sync/upload-attempts.js.map +1 -0
- package/dist/sync/upload-state.d.ts +163 -0
- package/dist/sync/upload-state.d.ts.map +1 -0
- package/dist/sync/upload-state.js +239 -0
- package/dist/sync/upload-state.js.map +1 -0
- package/dist/sync/workers/delete.d.ts +33 -1
- package/dist/sync/workers/delete.d.ts.map +1 -1
- package/dist/sync/workers/delete.js +83 -11
- package/dist/sync/workers/delete.js.map +1 -1
- package/dist/sync/workers/download.d.ts +3 -0
- package/dist/sync/workers/download.d.ts.map +1 -1
- package/dist/sync/workers/download.js +67 -12
- package/dist/sync/workers/download.js.map +1 -1
- package/dist/sync/workers/upload.d.ts +70 -2
- package/dist/sync/workers/upload.d.ts.map +1 -1
- package/dist/sync/workers/upload.js +354 -23
- package/dist/sync/workers/upload.js.map +1 -1
- package/dist/test-support/memory-oracle.calibration.d.ts +16 -0
- package/dist/test-support/memory-oracle.calibration.d.ts.map +1 -0
- package/dist/test-support/memory-oracle.calibration.js +43 -0
- package/dist/test-support/memory-oracle.calibration.js.map +1 -0
- package/dist/test-support/memory-oracle.d.ts +82 -0
- package/dist/test-support/memory-oracle.d.ts.map +1 -0
- package/dist/test-support/memory-oracle.js +104 -0
- package/dist/test-support/memory-oracle.js.map +1 -0
- package/dist/test-utils/account-mode.d.ts +36 -0
- package/dist/test-utils/account-mode.d.ts.map +1 -0
- package/dist/test-utils/account-mode.js +78 -0
- package/dist/test-utils/account-mode.js.map +1 -0
- package/dist/test-utils/index.d.ts +3 -0
- package/dist/test-utils/index.d.ts.map +1 -1
- package/dist/test-utils/index.js +3 -0
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/legacy-write-seal.d.ts +16 -0
- package/dist/test-utils/legacy-write-seal.d.ts.map +1 -0
- package/dist/test-utils/legacy-write-seal.js +20 -0
- package/dist/test-utils/legacy-write-seal.js.map +1 -0
- package/dist/test-utils/live-grants.d.ts +24 -0
- package/dist/test-utils/live-grants.d.ts.map +1 -0
- package/dist/test-utils/live-grants.js +6 -0
- package/dist/test-utils/live-grants.js.map +1 -0
- package/dist/test-utils/memory-storage.d.ts +17 -1
- package/dist/test-utils/memory-storage.d.ts.map +1 -1
- package/dist/test-utils/memory-storage.js +94 -46
- package/dist/test-utils/memory-storage.js.map +1 -1
- package/dist/test-utils/run-end.d.ts +27 -0
- package/dist/test-utils/run-end.d.ts.map +1 -0
- package/dist/test-utils/run-end.js +44 -0
- package/dist/test-utils/run-end.js.map +1 -0
- package/dist/test-utils/wallet.d.ts +0 -4
- package/dist/test-utils/wallet.d.ts.map +1 -1
- package/dist/test-utils/wallet.js +3 -12
- package/dist/test-utils/wallet.js.map +1 -1
- package/dist/write/attribution.d.ts.map +1 -1
- package/dist/write/attribution.js +2 -4
- package/dist/write/attribution.js.map +1 -1
- package/dist-test/localdb/conformance.d.ts +13 -0
- package/dist-test/localdb/conformance.d.ts.map +1 -0
- package/dist-test/localdb/conformance.js +372 -0
- package/dist-test/localdb/conformance.js.map +1 -0
- package/dist-test/tsconfig.tsbuildinfo +1 -0
- package/package.json +60 -5
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { controlScope } from "@opendatalabs/personal-server-ts-stream-sync";
|
|
2
|
+
import { createRecordQuery } from "./query.js";
|
|
3
|
+
/** Apply the host's consent identity before querying the owner's current generation. */
|
|
4
|
+
export function createLinkedRecordQuery(db, link) {
|
|
5
|
+
const query = createRecordQuery(db);
|
|
6
|
+
const target = async (instance, stream) => {
|
|
7
|
+
const resolved = link(instance, stream);
|
|
8
|
+
if (!resolved || typeof resolved.namespace !== "string")
|
|
9
|
+
return null;
|
|
10
|
+
const id = controlScope(resolved.connector, resolved.namespace);
|
|
11
|
+
const rows = await db.query(`SELECT generation FROM connections WHERE connection_id=? AND control_state='active'
|
|
12
|
+
AND NOT EXISTS (SELECT 1 FROM delete_intents WHERE connector=connections.connector)`, [id]);
|
|
13
|
+
return rows.length > 0 ? { id, generation: rows[0].generation } : null;
|
|
14
|
+
};
|
|
15
|
+
const valid = async (target, instance, stream) => {
|
|
16
|
+
const [state] = await db.query("SELECT generation,control_state FROM connections WHERE connection_id=?", [target.id]);
|
|
17
|
+
const current = link(instance, stream);
|
|
18
|
+
return (state?.control_state === "active" &&
|
|
19
|
+
state.generation === target.generation &&
|
|
20
|
+
current !== null &&
|
|
21
|
+
controlScope(current.connector, current.namespace) === target.id);
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
async listRecords(input) {
|
|
25
|
+
// A read that fails the link, or loses it while reading, states an empty
|
|
26
|
+
// stream: no rows and, when asked, a total of zero.
|
|
27
|
+
const none = {
|
|
28
|
+
records: [],
|
|
29
|
+
nextCursor: null,
|
|
30
|
+
...(input.withTotal && { total: 0 }),
|
|
31
|
+
};
|
|
32
|
+
const selected = await target(input.connectionId, input.stream);
|
|
33
|
+
if (!selected)
|
|
34
|
+
return none;
|
|
35
|
+
const page = await query.listRecords({
|
|
36
|
+
...input,
|
|
37
|
+
connectionId: selected.id,
|
|
38
|
+
});
|
|
39
|
+
return (await valid(selected, input.connectionId, input.stream))
|
|
40
|
+
? page
|
|
41
|
+
: none;
|
|
42
|
+
},
|
|
43
|
+
async getRecord(input) {
|
|
44
|
+
const selected = await target(input.connectionId, input.stream);
|
|
45
|
+
if (!selected)
|
|
46
|
+
return null;
|
|
47
|
+
const row = await query.getRecord({
|
|
48
|
+
...input,
|
|
49
|
+
connectionId: selected.id,
|
|
50
|
+
});
|
|
51
|
+
return (await valid(selected, input.connectionId, input.stream))
|
|
52
|
+
? row
|
|
53
|
+
: null;
|
|
54
|
+
},
|
|
55
|
+
async changesSince(input) {
|
|
56
|
+
const selected = await target(input.connectionId, input.stream);
|
|
57
|
+
if (!selected)
|
|
58
|
+
return "gone";
|
|
59
|
+
const page = await query.changesSince({
|
|
60
|
+
...input,
|
|
61
|
+
connectionId: selected.id,
|
|
62
|
+
});
|
|
63
|
+
return (await valid(selected, input.connectionId, input.stream))
|
|
64
|
+
? page
|
|
65
|
+
: "gone";
|
|
66
|
+
},
|
|
67
|
+
async *streamRecords(instance, stream) {
|
|
68
|
+
const selected = await target(instance, stream);
|
|
69
|
+
if (!selected)
|
|
70
|
+
return;
|
|
71
|
+
for await (const row of query.streamRecords(selected.id, stream)) {
|
|
72
|
+
if (!(await valid(selected, instance, stream)))
|
|
73
|
+
return;
|
|
74
|
+
yield row;
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=connection-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection-link.js","sourceRoot":"","sources":["../../src/localdb/connection-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAE5E,OAAO,EAAE,iBAAiB,EAAoB,MAAM,YAAY,CAAC;AAajE,wFAAwF;AACxF,MAAM,UAAU,uBAAuB,CACrC,EAAa,EACb,IAAoB;IAEpB,MAAM,KAAK,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAC;IACpC,MAAM,MAAM,GAAG,KAAK,EAAE,QAAgB,EAAE,MAAc,EAAE,EAAE;QACxD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACxC,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,CAAC,SAAS,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;QACrE,MAAM,EAAE,GAAG,YAAY,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;QAChE,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,KAAK,CACzB;2FACqF,EACrF,CAAC,EAAE,CAAC,CACL,CAAC;QACF,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC,CAAE,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1E,CAAC,CAAC;IACF,MAAM,KAAK,GAAG,KAAK,E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,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;oBAAE,OAAO;gBACvD,MAAM,GAAG,CAAC;YACZ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A stream's connector cursor on its way into and out of the log (see the
|
|
3
|
+
* `stream_state.cursor_*` migration in schema.ts). A run end saves it as
|
|
4
|
+
* unpublished; the publisher carries it in the segment that closes the rows
|
|
5
|
+
* it covers; a path that drops the run's rows drops it. A device that applies
|
|
6
|
+
* the segment takes the cursor with its rows.
|
|
7
|
+
*/
|
|
8
|
+
import { type LogCursor } from "@opendatalabs/personal-server-ts-stream-sync";
|
|
9
|
+
import type { SqlDriver, SqlStatement } from "./driver.js";
|
|
10
|
+
/**
|
|
11
|
+
* A checkpoint entry a run end wrote waits to travel in the log. It runs
|
|
12
|
+
* after the merge in the same batch, so `cursor_seq` is the stream's last
|
|
13
|
+
* change seq, which includes this run's rows.
|
|
14
|
+
*/
|
|
15
|
+
export declare function cursorSaved(connectionId: string, stream: string, state: unknown, connectorVersion: string, children: readonly string[]): SqlStatement;
|
|
16
|
+
/**
|
|
17
|
+
* Each stream's state descendants: the streams that name it as a state
|
|
18
|
+
* parent, and theirs, and so on. A parent's cursor claims their rows too
|
|
19
|
+
* (they are read through it), so it travels only once they are published.
|
|
20
|
+
*/
|
|
21
|
+
export declare function stateDescendants(parentsOf: Readonly<Record<string, readonly string[]>>): Record<string, string[]>;
|
|
22
|
+
/**
|
|
23
|
+
* A run whose rows are dropped after its end (refused, fenced) must not
|
|
24
|
+
* publish a cursor: the cursor may cover the dropped rows. The pending cursors
|
|
25
|
+
* of the whole connection go, since a parent's cursor may cover the child's
|
|
26
|
+
* rows. The local checkpoint stays as it was; another device that lacks the
|
|
27
|
+
* cursor reads the stream in full.
|
|
28
|
+
*/
|
|
29
|
+
export declare function dropUnpublishedCursors(connectionId: string): SqlStatement;
|
|
30
|
+
/**
|
|
31
|
+
* A segment that carried `cursor` for `stream` is applied (or was published by
|
|
32
|
+
* this device): written in the batch of the rows the cursor covers. The
|
|
33
|
+
* stream's checkpoint entry takes it at the next fold.
|
|
34
|
+
*/
|
|
35
|
+
export declare function cursorApplied(connectionId: string, stream: string, cursor: LogCursor): SqlStatement;
|
|
36
|
+
/**
|
|
37
|
+
* Move the applied cursors into `connections.checkpoint`, each as its stream's
|
|
38
|
+
* entry: the device holds the rows the log's cursor covers. Run before every
|
|
39
|
+
* read of the checkpoint.
|
|
40
|
+
*
|
|
41
|
+
* The cursor later in log order wins. A stream whose own cursor waits to
|
|
42
|
+
* publish (`cursor_unpublished`) keeps its entry and `cursor_version`: every
|
|
43
|
+
* segment this device applies was published before that cursor, which goes
|
|
44
|
+
* to the log after it. Its applied cursor stays staged. The acknowledgement
|
|
45
|
+
* of the device's own cursor replaces it; a drop of the pending cursor lets
|
|
46
|
+
* the next fold take it.
|
|
47
|
+
*
|
|
48
|
+
* The write is conditional on the checkpoint it read; a fold that loses that
|
|
49
|
+
* race leaves the cursors staged for the next one, and the reader resumes
|
|
50
|
+
* from what the checkpoint held, which reads more, never less.
|
|
51
|
+
*/
|
|
52
|
+
export declare function foldAppliedCursors(db: SqlDriver, connectionId: string): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* After a rebase queues again the rows that only the lost segments held: each
|
|
55
|
+
* stream whose lost segments carried a cursor queues its checkpoint entry
|
|
56
|
+
* again, and every cursor waiting to publish waits for the queued rows. The
|
|
57
|
+
* device does not know which streams a re-queued cursor reads through, so it
|
|
58
|
+
* waits for every other stream of the connection to close.
|
|
59
|
+
*/
|
|
60
|
+
export declare function cursorsRequeued(db: SqlDriver, connectionId: string, carried: readonly string[]): Promise<SqlStatement[]>;
|
|
61
|
+
//# sourceMappingURL=cursor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../src/localdb/cursor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAGL,KAAK,SAAS,EACf,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3D;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,EACd,gBAAgB,EAAE,MAAM,EACxB,QAAQ,EAAE,SAAS,MAAM,EAAE,GAC1B,YAAY,CAmBd;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,GACrD,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAkB1B;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,YAAY,CAKzE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,SAAS,GAChB,YAAY,CAKd;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,kBAAkB,CACtC,EAAE,EAAE,SAAS,EACb,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CA0Cf;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,EAAE,EAAE,SAAS,EACb,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,SAAS,MAAM,EAAE,GACzB,OAAO,CAAC,YAAY,EAAE,CAAC,CA2CzB"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A stream's connector cursor on its way into and out of the log (see the
|
|
3
|
+
* `stream_state.cursor_*` migration in schema.ts). A run end saves it as
|
|
4
|
+
* unpublished; the publisher carries it in the segment that closes the rows
|
|
5
|
+
* it covers; a path that drops the run's rows drops it. A device that applies
|
|
6
|
+
* the segment takes the cursor with its rows.
|
|
7
|
+
*/
|
|
8
|
+
import { isPlainObject, } from "@opendatalabs/personal-server-ts-stream-sync";
|
|
9
|
+
/**
|
|
10
|
+
* A checkpoint entry a run end wrote waits to travel in the log. It runs
|
|
11
|
+
* after the merge in the same batch, so `cursor_seq` is the stream's last
|
|
12
|
+
* change seq, which includes this run's rows.
|
|
13
|
+
*/
|
|
14
|
+
export function cursorSaved(connectionId, stream, state, connectorVersion, children) {
|
|
15
|
+
return {
|
|
16
|
+
sql: `UPDATE stream_state SET
|
|
17
|
+
cursor_unpublished = ?,
|
|
18
|
+
cursor_write = cursor_write + 1,
|
|
19
|
+
cursor_seq = (SELECT COALESCE(MAX(seq), 0) FROM record_changes WHERE connection_id = ? AND stream = ?),
|
|
20
|
+
cursor_children = ?,
|
|
21
|
+
cursor_version = ?
|
|
22
|
+
WHERE connection_id = ? AND stream = ?`,
|
|
23
|
+
params: [
|
|
24
|
+
JSON.stringify({ state, connectorVersion }),
|
|
25
|
+
connectionId,
|
|
26
|
+
stream,
|
|
27
|
+
JSON.stringify(children),
|
|
28
|
+
connectorVersion,
|
|
29
|
+
connectionId,
|
|
30
|
+
stream,
|
|
31
|
+
],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Each stream's state descendants: the streams that name it as a state
|
|
36
|
+
* parent, and theirs, and so on. A parent's cursor claims their rows too
|
|
37
|
+
* (they are read through it), so it travels only once they are published.
|
|
38
|
+
*/
|
|
39
|
+
export function stateDescendants(parentsOf) {
|
|
40
|
+
const children = new Map();
|
|
41
|
+
for (const [child, parents] of Object.entries(parentsOf))
|
|
42
|
+
for (const parent of parents)
|
|
43
|
+
children.set(parent, [...(children.get(parent) ?? []), child]);
|
|
44
|
+
const out = Object.create(null);
|
|
45
|
+
for (const stream of Object.keys(parentsOf)) {
|
|
46
|
+
const seen = new Set();
|
|
47
|
+
const queue = [...(children.get(stream) ?? [])];
|
|
48
|
+
while (queue.length > 0) {
|
|
49
|
+
const next = queue.shift();
|
|
50
|
+
if (next === stream || seen.has(next))
|
|
51
|
+
continue;
|
|
52
|
+
seen.add(next);
|
|
53
|
+
queue.push(...(children.get(next) ?? []));
|
|
54
|
+
}
|
|
55
|
+
out[stream] = [...seen].sort();
|
|
56
|
+
}
|
|
57
|
+
return out;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A run whose rows are dropped after its end (refused, fenced) must not
|
|
61
|
+
* publish a cursor: the cursor may cover the dropped rows. The pending cursors
|
|
62
|
+
* of the whole connection go, since a parent's cursor may cover the child's
|
|
63
|
+
* rows. The local checkpoint stays as it was; another device that lacks the
|
|
64
|
+
* cursor reads the stream in full.
|
|
65
|
+
*/
|
|
66
|
+
export function dropUnpublishedCursors(connectionId) {
|
|
67
|
+
return {
|
|
68
|
+
sql: "UPDATE stream_state SET cursor_unpublished = NULL, cursor_seq = NULL, cursor_children = NULL WHERE connection_id = ?",
|
|
69
|
+
params: [connectionId],
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* A segment that carried `cursor` for `stream` is applied (or was published by
|
|
74
|
+
* this device): written in the batch of the rows the cursor covers. The
|
|
75
|
+
* stream's checkpoint entry takes it at the next fold.
|
|
76
|
+
*/
|
|
77
|
+
export function cursorApplied(connectionId, stream, cursor) {
|
|
78
|
+
return {
|
|
79
|
+
sql: "UPDATE stream_state SET cursor_applied = ? WHERE connection_id = ? AND stream = ?",
|
|
80
|
+
params: [JSON.stringify(cursor), connectionId, stream],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Move the applied cursors into `connections.checkpoint`, each as its stream's
|
|
85
|
+
* entry: the device holds the rows the log's cursor covers. Run before every
|
|
86
|
+
* read of the checkpoint.
|
|
87
|
+
*
|
|
88
|
+
* The cursor later in log order wins. A stream whose own cursor waits to
|
|
89
|
+
* publish (`cursor_unpublished`) keeps its entry and `cursor_version`: every
|
|
90
|
+
* segment this device applies was published before that cursor, which goes
|
|
91
|
+
* to the log after it. Its applied cursor stays staged. The acknowledgement
|
|
92
|
+
* of the device's own cursor replaces it; a drop of the pending cursor lets
|
|
93
|
+
* the next fold take it.
|
|
94
|
+
*
|
|
95
|
+
* The write is conditional on the checkpoint it read; a fold that loses that
|
|
96
|
+
* race leaves the cursors staged for the next one, and the reader resumes
|
|
97
|
+
* from what the checkpoint held, which reads more, never less.
|
|
98
|
+
*/
|
|
99
|
+
export async function foldAppliedCursors(db, connectionId) {
|
|
100
|
+
const applied = await db.query("SELECT stream, cursor_applied FROM stream_state WHERE connection_id = ? AND cursor_applied IS NOT NULL AND cursor_unpublished IS NULL", [connectionId]);
|
|
101
|
+
if (applied.length === 0)
|
|
102
|
+
return;
|
|
103
|
+
const [connection] = await db.query("SELECT checkpoint FROM connections WHERE connection_id = ?", [connectionId]);
|
|
104
|
+
if (!connection)
|
|
105
|
+
return;
|
|
106
|
+
const stored = connection.checkpoint === null ? null : JSON.parse(connection.checkpoint);
|
|
107
|
+
const next = isPlainObject(stored)
|
|
108
|
+
? { ...stored }
|
|
109
|
+
: {};
|
|
110
|
+
const cursors = applied.map((row) => ({
|
|
111
|
+
...row,
|
|
112
|
+
cursor: JSON.parse(row.cursor_applied),
|
|
113
|
+
}));
|
|
114
|
+
for (const { stream, cursor } of cursors)
|
|
115
|
+
next[stream] = cursor.state;
|
|
116
|
+
const checkpoint = JSON.stringify(next);
|
|
117
|
+
await db.batch([
|
|
118
|
+
{
|
|
119
|
+
sql: "UPDATE connections SET checkpoint = ? WHERE connection_id = ? AND checkpoint IS ?",
|
|
120
|
+
params: [checkpoint, connectionId, connection.checkpoint],
|
|
121
|
+
},
|
|
122
|
+
...cursors.map(({ stream, cursor_applied, cursor }) => ({
|
|
123
|
+
sql: `UPDATE stream_state SET cursor_version = ?, cursor_applied = NULL
|
|
124
|
+
WHERE connection_id = ? AND stream = ? AND cursor_applied = ?
|
|
125
|
+
AND cursor_unpublished IS NULL
|
|
126
|
+
AND (SELECT checkpoint FROM connections WHERE connection_id = ?) = ?`,
|
|
127
|
+
params: [
|
|
128
|
+
cursor.connectorVersion,
|
|
129
|
+
connectionId,
|
|
130
|
+
stream,
|
|
131
|
+
cursor_applied,
|
|
132
|
+
connectionId,
|
|
133
|
+
checkpoint,
|
|
134
|
+
],
|
|
135
|
+
})),
|
|
136
|
+
]);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* After a rebase queues again the rows that only the lost segments held: each
|
|
140
|
+
* stream whose lost segments carried a cursor queues its checkpoint entry
|
|
141
|
+
* again, and every cursor waiting to publish waits for the queued rows. The
|
|
142
|
+
* device does not know which streams a re-queued cursor reads through, so it
|
|
143
|
+
* waits for every other stream of the connection to close.
|
|
144
|
+
*/
|
|
145
|
+
export async function cursorsRequeued(db, connectionId, carried) {
|
|
146
|
+
const statements = [];
|
|
147
|
+
const [connection] = await db.query("SELECT checkpoint FROM connections WHERE connection_id = ?", [connectionId]);
|
|
148
|
+
const stored = connection?.checkpoint == null ? null : JSON.parse(connection.checkpoint);
|
|
149
|
+
if (carried.length > 0 && isPlainObject(stored)) {
|
|
150
|
+
const rows = await db.query("SELECT stream, cursor_version FROM stream_state WHERE connection_id = ?", [connectionId]);
|
|
151
|
+
for (const stream of carried) {
|
|
152
|
+
const state = stored[stream];
|
|
153
|
+
const version = rows.find((r) => r.stream === stream)?.cursor_version;
|
|
154
|
+
if (state === undefined || version == null)
|
|
155
|
+
continue;
|
|
156
|
+
statements.push({
|
|
157
|
+
sql: `UPDATE stream_state SET cursor_unpublished = ?, cursor_children = ?,
|
|
158
|
+
cursor_write = cursor_write + 1
|
|
159
|
+
WHERE connection_id = ? AND stream = ? AND cursor_unpublished IS NULL`,
|
|
160
|
+
params: [
|
|
161
|
+
JSON.stringify({ state, connectorVersion: version }),
|
|
162
|
+
JSON.stringify(rows.map((r) => r.stream).filter((other) => other !== stream)),
|
|
163
|
+
connectionId,
|
|
164
|
+
stream,
|
|
165
|
+
],
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
statements.push({
|
|
170
|
+
sql: `UPDATE stream_state SET cursor_seq = (
|
|
171
|
+
SELECT COALESCE(MAX(seq), 0) FROM record_changes c
|
|
172
|
+
WHERE c.connection_id = stream_state.connection_id AND c.stream = stream_state.stream)
|
|
173
|
+
WHERE connection_id = ? AND cursor_unpublished IS NOT NULL`,
|
|
174
|
+
params: [connectionId],
|
|
175
|
+
});
|
|
176
|
+
return statements;
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=cursor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../src/localdb/cursor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,aAAa,GAGd,MAAM,8CAA8C,CAAC;AAGtD;;;;GAIG;AACH,MAAM,UAAU,WAAW,CACzB,YAAoB,EACpB,MAAc,EACd,KAAc,EACd,gBAAwB,EACxB,QAA2B;IAE3B,OAAO;QACL,GAAG,EAAE;;;;;;2CAMkC;QACvC,MAAM,EAAE;YACN,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC;YAC3C,YAAY;YACZ,MAAM;YACN,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;YACxB,gBAAgB;YAChB,YAAY;YACZ,MAAM;SACP;KACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAAsD;IAEtD,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC7C,KAAK,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;QACtD,KAAK,MAAM,MAAM,IAAI,OAAO;YAC1B,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,E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AK,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC;oBACpD,IAAI,CAAC,SAAS,CACZ,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,MAAM,CAAC,CAC9D;oBACD,YAAY;oBACZ,MAAM;iBACP;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,UAAU,CAAC,IAAI,CAAC;QACd,GAAG,EAAE;;;sEAG6D;QAClE,MAAM,EAAE,CAAC,YAAY,CAAC;KACvB,CAAC,CAAC;IACH,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type ApplyOutcome } from "./apply.js";
|
|
2
|
+
import { type OwnerRows } from "./bootstrap.js";
|
|
3
|
+
import type { LocalSyncDeps } from "./deps.js";
|
|
4
|
+
import type { PublishResult } from "./publish.js";
|
|
5
|
+
export interface CycleReport {
|
|
6
|
+
readonly connections: readonly {
|
|
7
|
+
readonly connectionId: string;
|
|
8
|
+
readonly published: readonly PublishResult[];
|
|
9
|
+
/** Set when this connection's pass threw; other connections still ran. */
|
|
10
|
+
readonly error: string | null;
|
|
11
|
+
/**
|
|
12
|
+
* Set when the connection's log is in a format this build cannot read:
|
|
13
|
+
* this pass stopped at that refusal. Any acknowledged early publication
|
|
14
|
+
* remains in `published`; this status does not undo it. Rows applied
|
|
15
|
+
* before the unreadable segment was reached (a snapshot, earlier segments)
|
|
16
|
+
* stay applied (see `UpdateRequiredError`).
|
|
17
|
+
*/
|
|
18
|
+
readonly status?: "update_required";
|
|
19
|
+
}[];
|
|
20
|
+
}
|
|
21
|
+
/** The connections a retry owes while the registry position is unchanged. */
|
|
22
|
+
export interface CycleScope {
|
|
23
|
+
readonly connections: readonly string[];
|
|
24
|
+
}
|
|
25
|
+
/** What a connection's early publish did, before the cycle read the registry. */
|
|
26
|
+
export interface EarlyPublish {
|
|
27
|
+
readonly published: readonly PublishResult[];
|
|
28
|
+
/** What the early publish threw, kept as thrown so its type survives. */
|
|
29
|
+
readonly error: unknown;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* C.4: one sync cycle. First publish what the known connections hold (see
|
|
33
|
+
* `publishEarly`). Then the bootstrap listing (C.0), and per connection: apply
|
|
34
|
+
* the log, then publish. Connections run
|
|
35
|
+
* concurrently, one operation at a time each. Used by the sync-manager timer,
|
|
36
|
+
* `/sync/trigger` and `/sync/file/:id` (trigger = this; file =
|
|
37
|
+
* `syncConnection` for the one connection, then read).
|
|
38
|
+
*/
|
|
39
|
+
export declare function runCycle(deps: LocalSyncDeps, scope?: CycleScope, made?: Map<string, EarlyPublish>, onApply?: (outcome: ApplyOutcome) => void): Promise<CycleReport>;
|
|
40
|
+
/**
|
|
41
|
+
* What a caller that saved something awaits: the publication of what is
|
|
42
|
+
* pending, ending at the registry commit. It is the cycle's early publish
|
|
43
|
+
* alone. The cycle's listing and apply read the registry for what other
|
|
44
|
+
* devices wrote, and nothing the save wrote waits for them: a commit makes it
|
|
45
|
+
* durable. The sync manager's own cycle (the wake a run's rows raise, the
|
|
46
|
+
* timer) runs the rest.
|
|
47
|
+
*
|
|
48
|
+
* A pass the early publish cannot settle takes the whole cycle, with the early
|
|
49
|
+
* publish's results already in hand: a connection that has an error or any
|
|
50
|
+
* result but published or noop (a deferral, a backoff, a refusal), a fresh
|
|
51
|
+
* connection that deferred (another device made its row), and a connection
|
|
52
|
+
* the early publish does not take (deleted, foreign, or a reconnect), which
|
|
53
|
+
* only the cycle's listing and apply can place.
|
|
54
|
+
*/
|
|
55
|
+
export declare function runPublish(deps: LocalSyncDeps): Promise<CycleReport>;
|
|
56
|
+
/**
|
|
57
|
+
* One connection: apply, then publish.
|
|
58
|
+
*
|
|
59
|
+
* Queue boundaries. Apply holds one "publish" slot, with nested queue calls
|
|
60
|
+
* inline: it merges downloaded rows while it downloads, so its slot cannot
|
|
61
|
+
* be shortened until apply is split the way publish is. Publish does not
|
|
62
|
+
* hold a slot here: `publishLog` takes the slot for its snapshot and
|
|
63
|
+
* its commit and releases it while it uploads, so a run's begin waits for at
|
|
64
|
+
* most one of those short turns, never for an upload.
|
|
65
|
+
*/
|
|
66
|
+
export declare function syncConnection(deps: LocalSyncDeps, connectionId: string, early?: EarlyPublish,
|
|
67
|
+
/** The cycle's listing of the owner's rows, taken before this call. */
|
|
68
|
+
listed?: OwnerRows, onApply?: (outcome: ApplyOutcome) => void): Promise<CycleReport["connections"][number]>;
|
|
69
|
+
//# sourceMappingURL=cycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cycle.d.ts","sourceRoot":"","sources":["../../src/localdb/cycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAiB,aAAa,EAAE,MAAM,WAAW,CAAC;AAE9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAIlD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,WAAW,EAAE,SAAS;QAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,SAAS,EAAE,SAAS,aAAa,EAAE,CAAC;QAC7C,0EAA0E;QAC1E,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QAC9B;;;;;;WAMG;QACH,QAAQ,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC;KACrC,EAAE,CAAC;CACL;AAED,6EAA6E;AAC7E,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC;AAED,iFAAiF;AACjF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,SAAS,EAAE,SAAS,aAAa,EAAE,CAAC;IAC7C,yEAAyE;IACzE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,aAAa,EACnB,KAAK,CAAC,EAAE,UAAU,EAClB,IAAI,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EAChC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,GACxC,OAAO,CAAC,WAAW,CAAC,CAmBtB;AA8BD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,CAgC1E;AA+ED;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,aAAa,EACnB,YAAY,EAAE,MAAM,EACpB,KAAK,CAAC,EAAE,YAAY;AACpB,uEAAuE;AACvE,MAAM,CAAC,EAAE,SAAS,EAClB,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,GACxC,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,CAuC7C"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { applyConnection } from "./apply.js";
|
|
2
|
+
import { bootstrapConnections, connectionsWithStreams, knownActiveConnections, newConnectionsWithStreams, } from "./bootstrap.js";
|
|
3
|
+
import { publishLog } from "./log-publish.js";
|
|
4
|
+
import { insideQueue } from "./slot.js";
|
|
5
|
+
import { UpdateRequiredError } from "./update-required.js";
|
|
6
|
+
/**
|
|
7
|
+
* C.4: one sync cycle. First publish what the known connections hold (see
|
|
8
|
+
* `publishEarly`). Then the bootstrap listing (C.0), and per connection: apply
|
|
9
|
+
* the log, then publish. Connections run
|
|
10
|
+
* concurrently, one operation at a time each. Used by the sync-manager timer,
|
|
11
|
+
* `/sync/trigger` and `/sync/file/:id` (trigger = this; file =
|
|
12
|
+
* `syncConnection` for the one connection, then read).
|
|
13
|
+
*/
|
|
14
|
+
export async function runCycle(deps, scope, made, onApply) {
|
|
15
|
+
if (scope)
|
|
16
|
+
return runScoped(deps, scope);
|
|
17
|
+
const early = made ?? (await publishEarly(deps, await earlyCandidates(deps)));
|
|
18
|
+
// One listing after early publish, shared by bootstrap and all applies.
|
|
19
|
+
const listed = await deps.registry.listOwnerRows();
|
|
20
|
+
const connections = await bootstrapConnections(deps, listed);
|
|
21
|
+
return {
|
|
22
|
+
connections: await Promise.all(connections.map(({ connectionId }) => syncConnection(deps, connectionId, early.get(connectionId), listed, onApply))),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/** Retry only the named connections using one shared owner listing. */
|
|
26
|
+
async function runScoped(deps, scope) {
|
|
27
|
+
const held = new Set((await deps.db.query("SELECT connection_id AS id FROM connections")).map((row) => row.id));
|
|
28
|
+
const ids = [...new Set(scope.connections)].filter((id) => held.has(id));
|
|
29
|
+
if (ids.length === 0)
|
|
30
|
+
return { connections: [] };
|
|
31
|
+
const only = new Set(ids);
|
|
32
|
+
const candidates = await earlyCandidates(deps);
|
|
33
|
+
const early = await publishEarly(deps, {
|
|
34
|
+
active: candidates.active.filter((row) => only.has(row.connectionId)),
|
|
35
|
+
fresh: candidates.fresh.filter((row) => only.has(row.connectionId)),
|
|
36
|
+
});
|
|
37
|
+
const listed = await deps.registry.listOwnerRows();
|
|
38
|
+
return {
|
|
39
|
+
connections: await Promise.all(ids.map((id) => syncConnection(deps, id, early.get(id), listed))),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* What a caller that saved something awaits: the publication of what is
|
|
44
|
+
* pending, ending at the registry commit. It is the cycle's early publish
|
|
45
|
+
* alone. The cycle's listing and apply read the registry for what other
|
|
46
|
+
* devices wrote, and nothing the save wrote waits for them: a commit makes it
|
|
47
|
+
* durable. The sync manager's own cycle (the wake a run's rows raise, the
|
|
48
|
+
* timer) runs the rest.
|
|
49
|
+
*
|
|
50
|
+
* A pass the early publish cannot settle takes the whole cycle, with the early
|
|
51
|
+
* publish's results already in hand: a connection that has an error or any
|
|
52
|
+
* result but published or noop (a deferral, a backoff, a refusal), a fresh
|
|
53
|
+
* connection that deferred (another device made its row), and a connection
|
|
54
|
+
* the early publish does not take (deleted, foreign, or a reconnect), which
|
|
55
|
+
* only the cycle's listing and apply can place.
|
|
56
|
+
*/
|
|
57
|
+
export async function runPublish(deps) {
|
|
58
|
+
const candidates = await earlyCandidates(deps);
|
|
59
|
+
const early = await publishEarly(deps, candidates);
|
|
60
|
+
const fresh = new Set(candidates.fresh.map((c) => c.connectionId));
|
|
61
|
+
// Every connection the early publish takes must have a result: a registry
|
|
62
|
+
// without the batch route throws `RegistryBatchRouteMissingError`, which is
|
|
63
|
+
// kept as the connection's error and leaves no result: nothing is published
|
|
64
|
+
// (the cycle reports it). A fresh
|
|
65
|
+
// connection has streams, so no published result means its deferral was
|
|
66
|
+
// dropped (`publishEarly`); a known connection with no streams has none.
|
|
67
|
+
const settled = [...candidates.active, ...candidates.fresh].every(({ connectionId }) => {
|
|
68
|
+
const e = early.get(connectionId);
|
|
69
|
+
return (e !== undefined &&
|
|
70
|
+
e.error === null &&
|
|
71
|
+
(e.published.length > 0 || !fresh.has(connectionId)) &&
|
|
72
|
+
e.published.every((r) => r.outcome === "published" || r.outcome === "noop"));
|
|
73
|
+
});
|
|
74
|
+
if (!settled || (await hasUnplacedConnections(deps, candidates)))
|
|
75
|
+
return runCycle(deps, undefined, early);
|
|
76
|
+
return {
|
|
77
|
+
connections: [...early].map(([connectionId, e]) => ({
|
|
78
|
+
connectionId,
|
|
79
|
+
published: e.published,
|
|
80
|
+
error: null,
|
|
81
|
+
})),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
async function earlyCandidates(deps) {
|
|
85
|
+
return {
|
|
86
|
+
active: await knownActiveConnections(deps),
|
|
87
|
+
fresh: await newConnectionsWithStreams(deps),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A connection with streams that the early publish takes neither as active nor
|
|
92
|
+
* as new: it waits for the cycle's listing.
|
|
93
|
+
*/
|
|
94
|
+
async function hasUnplacedConnections(deps, { active, fresh }) {
|
|
95
|
+
const placed = new Set([...active, ...fresh].map(({ connectionId }) => connectionId));
|
|
96
|
+
return (await connectionsWithStreams(deps)).some(({ connectionId }) => !placed.has(connectionId));
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The log's writer reads nothing from the registry: its commit is a
|
|
100
|
+
* compare-and-set on the log position and on the control row, and a commit
|
|
101
|
+
* that loses applies the winner and starts over (log-publish.ts). So a
|
|
102
|
+
* connection this device already knows to be active publishes its pending
|
|
103
|
+
* changes first, and what the cycle reads from the registry (the listing, the
|
|
104
|
+
* control row, the stream rows) no longer sits between a run's end and its
|
|
105
|
+
* head. Apply then follows as before.
|
|
106
|
+
*
|
|
107
|
+
* Connections run concurrently, as in the rest of the cycle. A registry
|
|
108
|
+
* without the batch route throws `RegistryBatchRouteMissingError` and
|
|
109
|
+
* publishes nothing here; a failure, that one included, is kept for the
|
|
110
|
+
* connection's report and is not tried twice.
|
|
111
|
+
*/
|
|
112
|
+
async function publishEarly(deps, { active, fresh }) {
|
|
113
|
+
const early = new Map();
|
|
114
|
+
await Promise.all([
|
|
115
|
+
...active.map(async ({ connectionId }) => {
|
|
116
|
+
try {
|
|
117
|
+
const published = await publishLog(deps, connectionId);
|
|
118
|
+
early.set(connectionId, { published, error: null });
|
|
119
|
+
}
|
|
120
|
+
catch (cause) {
|
|
121
|
+
early.set(connectionId, { published: [], error: cause });
|
|
122
|
+
}
|
|
123
|
+
}),
|
|
124
|
+
// A new connection's first publish creates its control row, so it does not
|
|
125
|
+
// wait for the cycle's listing and apply, which would find nothing for it.
|
|
126
|
+
// The device's view of it can still be old (another device made the row
|
|
127
|
+
// since): the publish then defers or loses its commit and applies, and the
|
|
128
|
+
// cycle's own pass below publishes it, so a deferral is not reported here.
|
|
129
|
+
...fresh.map(async ({ connectionId }) => {
|
|
130
|
+
try {
|
|
131
|
+
const published = await publishLog(deps, connectionId);
|
|
132
|
+
early.set(connectionId, {
|
|
133
|
+
published: published.filter((r) => r.outcome !== "deferred"),
|
|
134
|
+
error: null,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
catch (cause) {
|
|
138
|
+
early.set(connectionId, { published: [], error: cause });
|
|
139
|
+
}
|
|
140
|
+
}),
|
|
141
|
+
]);
|
|
142
|
+
return early;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* One connection: apply, then publish.
|
|
146
|
+
*
|
|
147
|
+
* Queue boundaries. Apply holds one "publish" slot, with nested queue calls
|
|
148
|
+
* inline: it merges downloaded rows while it downloads, so its slot cannot
|
|
149
|
+
* be shortened until apply is split the way publish is. Publish does not
|
|
150
|
+
* hold a slot here: `publishLog` takes the slot for its snapshot and
|
|
151
|
+
* its commit and releases it while it uploads, so a run's begin waits for at
|
|
152
|
+
* most one of those short turns, never for an upload.
|
|
153
|
+
*/
|
|
154
|
+
export async function syncConnection(deps, connectionId, early,
|
|
155
|
+
/** The cycle's listing of the owner's rows, taken before this call. */
|
|
156
|
+
listed, onApply) {
|
|
157
|
+
let published = early?.published ?? [];
|
|
158
|
+
let error = null;
|
|
159
|
+
let status;
|
|
160
|
+
try {
|
|
161
|
+
// A pass includes publish, so it must not join an apply-only operation.
|
|
162
|
+
const outcome = await deps.queue.run(connectionId, "publish", () => applyConnection(insideQueue(deps, connectionId), connectionId, listed, listed?.find((row) => row.scope === connectionId)?.read));
|
|
163
|
+
onApply?.(outcome);
|
|
164
|
+
if (early && early.error !== null)
|
|
165
|
+
throw early.error;
|
|
166
|
+
// One segment and one commit per batch. A registry without the batch
|
|
167
|
+
// route fails it (`RegistryBatchRouteMissingError`): nothing is published
|
|
168
|
+
// until it has one. What apply left to publish goes after what the early
|
|
169
|
+
// publish already sent.
|
|
170
|
+
const through = await publishLog(deps, connectionId);
|
|
171
|
+
published = [...published, ...through];
|
|
172
|
+
}
|
|
173
|
+
catch (cause) {
|
|
174
|
+
error = cause instanceof Error ? cause.message : String(cause);
|
|
175
|
+
if (cause instanceof UpdateRequiredError)
|
|
176
|
+
status = "update_required";
|
|
177
|
+
// The timer and `/sync/trigger` drop the report. A connection whose
|
|
178
|
+
// publish keeps failing would otherwise stay unpublished with no trace:
|
|
179
|
+
// its run ended as accepted, but nothing it holds becomes readable.
|
|
180
|
+
deps.logger.warn({ connectionId, error }, "Stream sync cycle failed for a connection");
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
connectionId,
|
|
184
|
+
published,
|
|
185
|
+
error,
|
|
186
|
+
...(status ? { status } : {}),
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=cycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cycle.js","sourceRoot":"","sources":["../../src/localdb/cycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAqB,MAAM,YAAY,CAAC;AAChE,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,yBAAyB,GAE1B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AA+B3D;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,IAAmB,EACnB,KAAkB,EAClB,IAAgC,EAChC,OAAyC;IAEzC,IAAI,KAAK;QAAE,OAAO,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACzC,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,MAAM,YAAY,CAAC,IAAI,EAAE,MAAM,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9E,wEAAwE;IACxE,MAA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;YAAE,MAAM,GAAG,iBAAiB,CAAC;QACrE,oEAAoE;QACpE,wEAAwE;QACxE,oEAAoE;QACpE,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,EAAE,YAAY,EAAE,KAAK,EAAE,EACvB,2CAA2C,CAC5C,CAAC;IACJ,CAAC;IACD,OAAO;QACL,YAAY;QACZ,SAAS;QACT,KAAK;QACL,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The fences of a connection delete (one control tombstone per namespace) as
|
|
3
|
+
* batch requests on `POST /v1/data/batch`, within the bounds the gateway
|
|
4
|
+
* advertises. Each request is one all-or-nothing transaction: every row lands,
|
|
5
|
+
* or none does. A gateway that serves no batch contract fails the delete
|
|
6
|
+
* (`RegistryBatchRouteMissingError`): there is no per-row path for it.
|
|
7
|
+
*
|
|
8
|
+
* - A request the gateway refuses writes nothing. A row the gateway already
|
|
9
|
+
* held (a replay: the same tombstone, written by this delete before or by
|
|
10
|
+
* another device's delete) answers `committed`. A row that lost its
|
|
11
|
+
* compare-and-set answers `not_written`, and the other rows go again at once
|
|
12
|
+
* without it: each refusal drops at least one row, since the gateway names
|
|
13
|
+
* the row that lost.
|
|
14
|
+
* - A request with no answer (no reply twice, or a failure that says nothing
|
|
15
|
+
* of the rows) answers `not_written` for its rows: they may have landed.
|
|
16
|
+
* - The caller reads each row that is not `committed` again and writes it
|
|
17
|
+
* alone (delete.ts `landFence`), as a resumed delete does.
|
|
18
|
+
* - A refusal of the request itself (no batch contract, a request the gateway
|
|
19
|
+
* judged malformed) throws: it is not a race to recover from.
|
|
20
|
+
*/
|
|
21
|
+
import { type SignedBatchRow, type StreamSyncRegistry } from "../stream-sync/ports.js";
|
|
22
|
+
export type FenceTurn = "committed" | "not_written";
|
|
23
|
+
/** One turn per row, in the order of `rows`. */
|
|
24
|
+
export declare function commitFences(options: {
|
|
25
|
+
readonly registry: StreamSyncRegistry;
|
|
26
|
+
readonly ownerAddress: string;
|
|
27
|
+
readonly rows: readonly SignedBatchRow[];
|
|
28
|
+
}): Promise<readonly FenceTurn[]>;
|
|
29
|
+
//# sourceMappingURL=delete-batch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-batch.d.ts","sourceRoot":"","sources":["../../src/localdb/delete-batch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AAGjC,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,aAAa,CAAC;AAEpD,gDAAgD;AAChD,wBAAsB,YAAY,CAAC,OAAO,EAAE;IAC1C,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,SAAS,cAAc,EAAE,CAAC;CAC1C,GAAG,OAAO,CAAC,SAAS,SAAS,EAAE,CAAC,CAuDhC"}
|