@opendatalabs/personal-server-ts-core 0.0.1-canary.052d47e → 0.0.1-canary.0620a9a
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/dist/additions/budget.d.ts +34 -0
- package/dist/additions/budget.d.ts.map +1 -0
- package/dist/additions/budget.js +144 -0
- package/dist/additions/budget.js.map +1 -0
- package/dist/additions/durable.d.ts +94 -0
- package/dist/additions/durable.d.ts.map +1 -0
- package/dist/additions/durable.js +823 -0
- package/dist/additions/durable.js.map +1 -0
- package/dist/additions/first-added.d.ts +204 -0
- package/dist/additions/first-added.d.ts.map +1 -0
- package/dist/additions/first-added.js +598 -0
- package/dist/additions/first-added.js.map +1 -0
- package/dist/additions/index.d.ts +9 -0
- package/dist/additions/index.d.ts.map +1 -0
- package/dist/additions/index.js +9 -0
- package/dist/additions/index.js.map +1 -0
- package/dist/additions/ledger-store.d.ts +69 -0
- package/dist/additions/ledger-store.d.ts.map +1 -0
- package/dist/additions/ledger-store.js +407 -0
- package/dist/additions/ledger-store.js.map +1 -0
- package/dist/additions/record-rules.d.ts +54 -0
- package/dist/additions/record-rules.d.ts.map +1 -0
- package/dist/additions/record-rules.js +198 -0
- package/dist/additions/record-rules.js.map +1 -0
- package/dist/additions/scope-lock.d.ts +14 -0
- package/dist/additions/scope-lock.d.ts.map +1 -0
- package/dist/additions/scope-lock.js +32 -0
- package/dist/additions/scope-lock.js.map +1 -0
- package/dist/additions/summary.d.ts +143 -0
- package/dist/additions/summary.d.ts.map +1 -0
- package/dist/additions/summary.js +279 -0
- package/dist/additions/summary.js.map +1 -0
- package/dist/additions/version-inventory.d.ts +86 -0
- package/dist/additions/version-inventory.d.ts.map +1 -0
- package/dist/additions/version-inventory.js +244 -0
- package/dist/additions/version-inventory.js.map +1 -0
- package/dist/api/index.d.ts +192 -8
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1227 -153
- package/dist/api/index.js.map +1 -1
- package/dist/api/oura-collection-requirements.d.ts +16 -0
- package/dist/api/oura-collection-requirements.d.ts.map +1 -0
- package/dist/api/oura-collection-requirements.js +70 -0
- package/dist/api/oura-collection-requirements.js.map +1 -0
- package/dist/api/raw-envelope.d.ts +3 -0
- package/dist/api/raw-envelope.d.ts.map +1 -0
- package/dist/api/raw-envelope.js +215 -0
- package/dist/api/raw-envelope.js.map +1 -0
- package/dist/api/scope-upload-batches.d.ts +18 -0
- package/dist/api/scope-upload-batches.d.ts.map +1 -0
- package/dist/api/scope-upload-batches.js +71 -0
- package/dist/api/scope-upload-batches.js.map +1 -0
- package/dist/api/scope-uploads.d.ts +112 -0
- package/dist/api/scope-uploads.d.ts.map +1 -0
- package/dist/api/scope-uploads.js +369 -0
- package/dist/api/scope-uploads.js.map +1 -0
- package/dist/auth/index.d.ts +3 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +3 -1
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/proof-id.d.ts +8 -0
- package/dist/auth/proof-id.d.ts.map +1 -0
- package/dist/auth/proof-id.js +29 -0
- package/dist/auth/proof-id.js.map +1 -0
- package/dist/auth/request.d.ts +24 -0
- package/dist/auth/request.d.ts.map +1 -1
- package/dist/auth/request.js +99 -4
- package/dist/auth/request.js.map +1 -1
- package/dist/client.d.ts +70 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -0
- package/dist/client.js.map +1 -1
- package/dist/contracts/auth-device.d.ts +10 -0
- package/dist/contracts/auth-device.d.ts.map +1 -1
- package/dist/contracts/auth-device.js +2 -0
- package/dist/contracts/auth-device.js.map +1 -1
- package/dist/contracts/data.d.ts +102 -8
- package/dist/contracts/data.d.ts.map +1 -1
- package/dist/contracts/data.js +320 -47
- package/dist/contracts/data.js.map +1 -1
- package/dist/contracts/grants.d.ts.map +1 -1
- package/dist/contracts/grants.js +7 -0
- package/dist/contracts/grants.js.map +1 -1
- package/dist/contracts/index.d.ts +4 -2
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js +3 -1
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/oura-collection-requirements.d.ts +17 -0
- package/dist/contracts/oura-collection-requirements.d.ts.map +1 -0
- package/dist/contracts/oura-collection-requirements.js +49 -0
- package/dist/contracts/oura-collection-requirements.js.map +1 -0
- package/dist/contracts/sync.d.ts.map +1 -1
- package/dist/contracts/sync.js +1 -0
- package/dist/contracts/sync.js.map +1 -1
- package/dist/derivatives/answer-shape.d.ts +83 -0
- package/dist/derivatives/answer-shape.d.ts.map +1 -0
- package/dist/derivatives/answer-shape.js +320 -0
- package/dist/derivatives/answer-shape.js.map +1 -0
- package/dist/derivatives/api.d.ts +1 -1
- package/dist/derivatives/api.d.ts.map +1 -1
- package/dist/derivatives/api.js +8 -0
- package/dist/derivatives/api.js.map +1 -1
- package/dist/derivatives/compute.d.ts +9 -3
- package/dist/derivatives/compute.d.ts.map +1 -1
- package/dist/derivatives/compute.js +68 -6
- package/dist/derivatives/compute.js.map +1 -1
- package/dist/derivatives/index.d.ts +2 -1
- package/dist/derivatives/index.d.ts.map +1 -1
- package/dist/derivatives/index.js +2 -1
- package/dist/derivatives/index.js.map +1 -1
- package/dist/derivatives/prompt.d.ts +35 -0
- package/dist/derivatives/prompt.d.ts.map +1 -1
- package/dist/derivatives/prompt.js +96 -8
- package/dist/derivatives/prompt.js.map +1 -1
- package/dist/derivatives/registration.d.ts +6 -9
- package/dist/derivatives/registration.d.ts.map +1 -1
- package/dist/derivatives/registration.js +14 -6
- package/dist/derivatives/registration.js.map +1 -1
- package/dist/derivatives/scheduler.d.ts +39 -9
- package/dist/derivatives/scheduler.d.ts.map +1 -1
- package/dist/derivatives/scheduler.js +99 -8
- package/dist/derivatives/scheduler.js.map +1 -1
- package/dist/derivatives/store.d.ts.map +1 -1
- package/dist/derivatives/store.js +2 -0
- package/dist/derivatives/store.js.map +1 -1
- package/dist/derivatives/types.d.ts +13 -3
- package/dist/derivatives/types.d.ts.map +1 -1
- package/dist/derivatives/types.js +2 -0
- package/dist/derivatives/types.js.map +1 -1
- package/dist/errors/pdpp-catalog.d.ts +36 -0
- package/dist/errors/pdpp-catalog.d.ts.map +1 -0
- package/dist/errors/pdpp-catalog.js +86 -0
- package/dist/errors/pdpp-catalog.js.map +1 -0
- package/dist/grants/index.d.ts +2 -0
- package/dist/grants/index.d.ts.map +1 -1
- package/dist/grants/index.js +4 -0
- package/dist/grants/index.js.map +1 -1
- package/dist/grants/pdpp-binding-store.d.ts +89 -0
- package/dist/grants/pdpp-binding-store.d.ts.map +1 -0
- package/dist/grants/pdpp-binding-store.js +112 -0
- package/dist/grants/pdpp-binding-store.js.map +1 -0
- package/dist/grants/pdpp-binding.d.ts +169 -0
- package/dist/grants/pdpp-binding.d.ts.map +1 -0
- package/dist/grants/pdpp-binding.js +236 -0
- package/dist/grants/pdpp-binding.js.map +1 -0
- package/dist/legacy-projection/bindings.d.ts +31 -0
- package/dist/legacy-projection/bindings.d.ts.map +1 -0
- package/dist/legacy-projection/bindings.js +4512 -0
- package/dist/legacy-projection/bindings.js.map +1 -0
- package/dist/legacy-projection/claude-source-record.d.ts +22 -0
- package/dist/legacy-projection/claude-source-record.d.ts.map +1 -0
- package/dist/legacy-projection/claude-source-record.js +360 -0
- package/dist/legacy-projection/claude-source-record.js.map +1 -0
- package/dist/legacy-projection/declared-text.d.ts +41 -0
- package/dist/legacy-projection/declared-text.d.ts.map +1 -0
- package/dist/legacy-projection/declared-text.js +199 -0
- package/dist/legacy-projection/declared-text.js.map +1 -0
- package/dist/legacy-projection/github-browser-bindings.d.ts +3 -0
- package/dist/legacy-projection/github-browser-bindings.d.ts.map +1 -0
- package/dist/legacy-projection/github-browser-bindings.js +212 -0
- package/dist/legacy-projection/github-browser-bindings.js.map +1 -0
- package/dist/legacy-projection/github-legacy-fields.d.ts +6 -0
- package/dist/legacy-projection/github-legacy-fields.d.ts.map +1 -0
- package/dist/legacy-projection/github-legacy-fields.js +202 -0
- package/dist/legacy-projection/github-legacy-fields.js.map +1 -0
- package/dist/legacy-projection/index.d.ts +38 -0
- package/dist/legacy-projection/index.d.ts.map +1 -0
- package/dist/legacy-projection/index.js +231 -0
- package/dist/legacy-projection/index.js.map +1 -0
- package/dist/legacy-projection/meta-040-bindings.d.ts +3 -0
- package/dist/legacy-projection/meta-040-bindings.d.ts.map +1 -0
- package/dist/legacy-projection/meta-040-bindings.js +112 -0
- package/dist/legacy-projection/meta-040-bindings.js.map +1 -0
- package/dist/legacy-projection/oura-browser-bindings.d.ts +5 -0
- package/dist/legacy-projection/oura-browser-bindings.d.ts.map +1 -0
- package/dist/legacy-projection/oura-browser-bindings.js +141 -0
- package/dist/legacy-projection/oura-browser-bindings.js.map +1 -0
- package/dist/legacy-projection/provenance.d.ts +57 -0
- package/dist/legacy-projection/provenance.d.ts.map +1 -0
- package/dist/legacy-projection/provenance.js +2 -0
- package/dist/legacy-projection/provenance.js.map +1 -0
- package/dist/legacy-projection/strava-browser-bindings.d.ts +3 -0
- package/dist/legacy-projection/strava-browser-bindings.d.ts.map +1 -0
- package/dist/legacy-projection/strava-browser-bindings.js +32 -0
- package/dist/legacy-projection/strava-browser-bindings.js.map +1 -0
- package/dist/legacy-projection/test-debris.d.ts +2 -0
- package/dist/legacy-projection/test-debris.d.ts.map +1 -0
- package/dist/legacy-projection/test-debris.js +49 -0
- package/dist/legacy-projection/test-debris.js.map +1 -0
- package/dist/legacy-projection/types.d.ts +235 -0
- package/dist/legacy-projection/types.d.ts.map +1 -0
- package/dist/legacy-projection/types.js +2 -0
- package/dist/legacy-projection/types.js.map +1 -0
- package/dist/mcp/approval-url.d.ts +68 -0
- package/dist/mcp/approval-url.d.ts.map +1 -0
- package/dist/mcp/approval-url.js +95 -0
- package/dist/mcp/approval-url.js.map +1 -0
- package/dist/mcp/connection-api.d.ts +187 -3
- package/dist/mcp/connection-api.d.ts.map +1 -1
- package/dist/mcp/connection-api.js +600 -26
- package/dist/mcp/connection-api.js.map +1 -1
- package/dist/mcp/grantee.d.ts +1 -1
- package/dist/mcp/grantee.d.ts.map +1 -1
- package/dist/mcp/index.d.ts +4 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +4 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/oauth-redirect.d.ts +14 -0
- package/dist/mcp/oauth-redirect.d.ts.map +1 -0
- package/dist/mcp/oauth-redirect.js +51 -0
- package/dist/mcp/oauth-redirect.js.map +1 -0
- package/dist/mcp/read-client.d.ts +5 -1
- package/dist/mcp/read-client.d.ts.map +1 -1
- package/dist/mcp/read-client.js +18 -4
- package/dist/mcp/read-client.js.map +1 -1
- package/dist/mcp/resources.d.ts.map +1 -1
- package/dist/mcp/resources.js +3 -0
- package/dist/mcp/resources.js.map +1 -1
- package/dist/mcp/server.d.ts +30 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +172 -17
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/session.d.ts +1 -1
- package/dist/mcp/session.d.ts.map +1 -1
- package/dist/mcp/session.js +17 -3
- package/dist/mcp/session.js.map +1 -1
- package/dist/mcp/store.d.ts +10 -1
- package/dist/mcp/store.d.ts.map +1 -1
- package/dist/mcp/store.js +72 -0
- package/dist/mcp/store.js.map +1 -1
- package/dist/mcp/token-expiry.d.ts +48 -0
- package/dist/mcp/token-expiry.d.ts.map +1 -0
- package/dist/mcp/token-expiry.js +69 -0
- package/dist/mcp/token-expiry.js.map +1 -0
- package/dist/mcp/tools.d.ts +92 -3
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +513 -28
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp/types.d.ts +103 -4
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/mcp/types.js +13 -1
- package/dist/mcp/types.js.map +1 -1
- package/dist/mcp/write-client.d.ts +81 -0
- package/dist/mcp/write-client.d.ts.map +1 -0
- package/dist/mcp/write-client.js +140 -0
- package/dist/mcp/write-client.js.map +1 -0
- package/dist/oura/history-policy.d.ts +12 -0
- package/dist/oura/history-policy.d.ts.map +1 -0
- package/dist/oura/history-policy.js +54 -0
- package/dist/oura/history-policy.js.map +1 -0
- package/dist/oura/index.d.ts +51 -0
- package/dist/oura/index.d.ts.map +1 -0
- package/dist/oura/index.js +315 -0
- package/dist/oura/index.js.map +1 -0
- package/dist/payment/own-app.d.ts +8 -0
- package/dist/payment/own-app.d.ts.map +1 -0
- package/dist/payment/own-app.js +47 -0
- package/dist/payment/own-app.js.map +1 -0
- package/dist/pdpp/approval.d.ts +271 -0
- package/dist/pdpp/approval.d.ts.map +1 -0
- package/dist/pdpp/approval.js +486 -0
- package/dist/pdpp/approval.js.map +1 -0
- package/dist/pdpp/client-identity.d.ts +88 -0
- package/dist/pdpp/client-identity.d.ts.map +1 -0
- package/dist/pdpp/client-identity.js +196 -0
- package/dist/pdpp/client-identity.js.map +1 -0
- package/dist/pdpp/client-metadata.d.ts +95 -0
- package/dist/pdpp/client-metadata.d.ts.map +1 -0
- package/dist/pdpp/client-metadata.js +96 -0
- package/dist/pdpp/client-metadata.js.map +1 -0
- package/dist/pdpp/commitments.d.ts +75 -0
- package/dist/pdpp/commitments.d.ts.map +1 -0
- package/dist/pdpp/commitments.js +113 -0
- package/dist/pdpp/commitments.js.map +1 -0
- package/dist/pdpp/declaration-limits.d.ts +7 -0
- package/dist/pdpp/declaration-limits.d.ts.map +1 -0
- package/dist/pdpp/declaration-limits.js +7 -0
- package/dist/pdpp/declaration-limits.js.map +1 -0
- package/dist/pdpp/declaration.d.ts +119 -0
- package/dist/pdpp/declaration.d.ts.map +1 -0
- package/dist/pdpp/declaration.js +837 -0
- package/dist/pdpp/declaration.js.map +1 -0
- package/dist/pdpp/index.d.ts +38 -0
- package/dist/pdpp/index.d.ts.map +1 -0
- package/dist/pdpp/index.js +24 -0
- package/dist/pdpp/index.js.map +1 -0
- package/dist/pdpp/issuance.d.ts +126 -0
- package/dist/pdpp/issuance.d.ts.map +1 -0
- package/dist/pdpp/issuance.js +184 -0
- package/dist/pdpp/issuance.js.map +1 -0
- package/dist/pdpp/pkce.d.ts +53 -0
- package/dist/pdpp/pkce.d.ts.map +1 -0
- package/dist/pdpp/pkce.js +109 -0
- package/dist/pdpp/pkce.js.map +1 -0
- package/dist/pdpp/redirect.d.ts +60 -0
- package/dist/pdpp/redirect.d.ts.map +1 -0
- package/dist/pdpp/redirect.js +125 -0
- package/dist/pdpp/redirect.js.map +1 -0
- package/dist/pdpp/resolve.d.ts +120 -0
- package/dist/pdpp/resolve.d.ts.map +1 -0
- package/dist/pdpp/resolve.js +491 -0
- package/dist/pdpp/resolve.js.map +1 -0
- package/dist/pdpp/review.d.ts +280 -0
- package/dist/pdpp/review.d.ts.map +1 -0
- package/dist/pdpp/review.js +205 -0
- package/dist/pdpp/review.js.map +1 -0
- package/dist/pdpp/selection.d.ts +79 -0
- package/dist/pdpp/selection.d.ts.map +1 -0
- package/dist/pdpp/selection.js +493 -0
- package/dist/pdpp/selection.js.map +1 -0
- package/dist/pdpp/store.d.ts +228 -0
- package/dist/pdpp/store.d.ts.map +1 -0
- package/dist/pdpp/store.js +542 -0
- package/dist/pdpp/store.js.map +1 -0
- package/dist/pdpp/time.d.ts +39 -0
- package/dist/pdpp/time.d.ts.map +1 -0
- package/dist/pdpp/time.js +173 -0
- package/dist/pdpp/time.js.map +1 -0
- package/dist/pdpp/tokens.d.ts +181 -0
- package/dist/pdpp/tokens.d.ts.map +1 -0
- package/dist/pdpp/tokens.js +421 -0
- package/dist/pdpp/tokens.js.map +1 -0
- package/dist/pdpp/types.d.ts +457 -0
- package/dist/pdpp/types.d.ts.map +1 -0
- package/dist/pdpp/types.js +68 -0
- package/dist/pdpp/types.js.map +1 -0
- package/dist/pdpp-version.d.ts +28 -0
- package/dist/pdpp-version.d.ts.map +1 -0
- package/dist/pdpp-version.js +28 -0
- package/dist/pdpp-version.js.map +1 -0
- package/dist/policy/data-read.d.ts +52 -1
- package/dist/policy/data-read.d.ts.map +1 -1
- package/dist/policy/data-read.js +157 -3
- package/dist/policy/data-read.js.map +1 -1
- package/dist/policy/data-write.d.ts.map +1 -1
- package/dist/policy/data-write.js +18 -1
- package/dist/policy/data-write.js.map +1 -1
- package/dist/policy/index.d.ts +2 -1
- package/dist/policy/index.d.ts.map +1 -1
- package/dist/policy/index.js +2 -1
- package/dist/policy/index.js.map +1 -1
- package/dist/policy/reserved-scopes.d.ts +10 -0
- package/dist/policy/reserved-scopes.d.ts.map +1 -0
- package/dist/policy/reserved-scopes.js +16 -0
- package/dist/policy/reserved-scopes.js.map +1 -0
- package/dist/ports/index.d.ts +266 -5
- package/dist/ports/index.d.ts.map +1 -1
- package/dist/ports/index.js.map +1 -1
- package/dist/ports/pdpp-auth.d.ts +119 -0
- package/dist/ports/pdpp-auth.d.ts.map +1 -0
- package/dist/ports/pdpp-auth.js +46 -0
- package/dist/ports/pdpp-auth.js.map +1 -0
- package/dist/ports/pdpp-auth.test-utils.d.ts +9 -0
- package/dist/ports/pdpp-auth.test-utils.d.ts.map +1 -0
- package/dist/ports/pdpp-auth.test-utils.js +18 -0
- package/dist/ports/pdpp-auth.test-utils.js.map +1 -0
- package/dist/publication/publish.d.ts +109 -0
- package/dist/publication/publish.d.ts.map +1 -0
- package/dist/publication/publish.js +263 -0
- package/dist/publication/publish.js.map +1 -0
- package/dist/replication/completion.d.ts +20 -0
- package/dist/replication/completion.d.ts.map +1 -0
- package/dist/replication/completion.js +73 -0
- package/dist/replication/completion.js.map +1 -0
- package/dist/replication/coordinator-state.d.ts +29 -0
- package/dist/replication/coordinator-state.d.ts.map +1 -0
- package/dist/replication/coordinator-state.js +88 -0
- package/dist/replication/coordinator-state.js.map +1 -0
- package/dist/replication/coordinator-state.test-utils.d.ts +32 -0
- package/dist/replication/coordinator-state.test-utils.d.ts.map +1 -0
- package/dist/replication/coordinator-state.test-utils.js +113 -0
- package/dist/replication/coordinator-state.test-utils.js.map +1 -0
- package/dist/replication/coordinator.d.ts +264 -0
- package/dist/replication/coordinator.d.ts.map +1 -0
- package/dist/replication/coordinator.js +499 -0
- package/dist/replication/coordinator.js.map +1 -0
- package/dist/replication/copies.d.ts +126 -0
- package/dist/replication/copies.d.ts.map +1 -0
- package/dist/replication/copies.js +437 -0
- package/dist/replication/copies.js.map +1 -0
- package/dist/replication/copy-promotion.d.ts +132 -0
- package/dist/replication/copy-promotion.d.ts.map +1 -0
- package/dist/replication/copy-promotion.js +126 -0
- package/dist/replication/copy-promotion.js.map +1 -0
- package/dist/replication/door.d.ts +33 -0
- package/dist/replication/door.d.ts.map +1 -0
- package/dist/replication/door.js +10 -0
- package/dist/replication/door.js.map +1 -0
- package/dist/replication/dpv2.d.ts +141 -0
- package/dist/replication/dpv2.d.ts.map +1 -0
- package/dist/replication/dpv2.js +320 -0
- package/dist/replication/dpv2.js.map +1 -0
- package/dist/replication/effects.d.ts +68 -0
- package/dist/replication/effects.d.ts.map +1 -0
- package/dist/replication/effects.js +89 -0
- package/dist/replication/effects.js.map +1 -0
- package/dist/replication/engine.d.ts +378 -0
- package/dist/replication/engine.d.ts.map +1 -0
- package/dist/replication/engine.js +3197 -0
- package/dist/replication/engine.js.map +1 -0
- package/dist/replication/envelope.d.ts +481 -0
- package/dist/replication/envelope.d.ts.map +1 -0
- package/dist/replication/envelope.js +192 -0
- package/dist/replication/envelope.js.map +1 -0
- package/dist/replication/evidence.d.ts +118 -0
- package/dist/replication/evidence.d.ts.map +1 -0
- package/dist/replication/evidence.js +198 -0
- package/dist/replication/evidence.js.map +1 -0
- package/dist/replication/finality.d.ts +16 -0
- package/dist/replication/finality.d.ts.map +1 -0
- package/dist/replication/finality.js +11 -0
- package/dist/replication/finality.js.map +1 -0
- package/dist/replication/fixtures.d.ts +16 -0
- package/dist/replication/fixtures.d.ts.map +1 -0
- package/dist/replication/fixtures.js +47 -0
- package/dist/replication/fixtures.js.map +1 -0
- package/dist/replication/host-config.d.ts +52 -0
- package/dist/replication/host-config.d.ts.map +1 -0
- package/dist/replication/host-config.js +111 -0
- package/dist/replication/host-config.js.map +1 -0
- package/dist/replication/host-driver.d.ts +95 -0
- package/dist/replication/host-driver.d.ts.map +1 -0
- package/dist/replication/host-driver.js +202 -0
- package/dist/replication/host-driver.js.map +1 -0
- package/dist/replication/host-ports.d.ts +48 -0
- package/dist/replication/host-ports.d.ts.map +1 -0
- package/dist/replication/host-ports.js +69 -0
- package/dist/replication/host-ports.js.map +1 -0
- package/dist/replication/identity.d.ts +13 -0
- package/dist/replication/identity.d.ts.map +1 -0
- package/dist/replication/identity.js +22 -0
- package/dist/replication/identity.js.map +1 -0
- package/dist/replication/limits.d.ts +124 -0
- package/dist/replication/limits.d.ts.map +1 -0
- package/dist/replication/limits.js +182 -0
- package/dist/replication/limits.js.map +1 -0
- package/dist/replication/merge-plan.d.ts +92 -0
- package/dist/replication/merge-plan.d.ts.map +1 -0
- package/dist/replication/merge-plan.js +229 -0
- package/dist/replication/merge-plan.js.map +1 -0
- package/dist/replication/namespace.d.ts +4 -0
- package/dist/replication/namespace.d.ts.map +1 -0
- package/dist/replication/namespace.js +7 -0
- package/dist/replication/namespace.js.map +1 -0
- package/dist/replication/outcome.d.ts +178 -0
- package/dist/replication/outcome.d.ts.map +1 -0
- package/dist/replication/outcome.js +83 -0
- package/dist/replication/outcome.js.map +1 -0
- package/dist/replication/payload.d.ts +39 -0
- package/dist/replication/payload.d.ts.map +1 -0
- package/dist/replication/payload.js +137 -0
- package/dist/replication/payload.js.map +1 -0
- package/dist/replication/preparation.d.ts +42 -0
- package/dist/replication/preparation.d.ts.map +1 -0
- package/dist/replication/preparation.js +118 -0
- package/dist/replication/preparation.js.map +1 -0
- package/dist/replication/rebaseline.d.ts +33 -0
- package/dist/replication/rebaseline.d.ts.map +1 -0
- package/dist/replication/rebaseline.js +40 -0
- package/dist/replication/rebaseline.js.map +1 -0
- package/dist/replication/rebinding.d.ts +43 -0
- package/dist/replication/rebinding.d.ts.map +1 -0
- package/dist/replication/rebinding.js +52 -0
- package/dist/replication/rebinding.js.map +1 -0
- package/dist/replication/receive.d.ts +57 -0
- package/dist/replication/receive.d.ts.map +1 -0
- package/dist/replication/receive.js +114 -0
- package/dist/replication/receive.js.map +1 -0
- package/dist/replication/record-reducer.d.ts +16 -0
- package/dist/replication/record-reducer.d.ts.map +1 -0
- package/dist/replication/record-reducer.js +52 -0
- package/dist/replication/record-reducer.js.map +1 -0
- package/dist/replication/revision.d.ts +24 -0
- package/dist/replication/revision.d.ts.map +1 -0
- package/dist/replication/revision.js +35 -0
- package/dist/replication/revision.js.map +1 -0
- package/dist/replication/roster.d.ts +53 -0
- package/dist/replication/roster.d.ts.map +1 -0
- package/dist/replication/roster.js +115 -0
- package/dist/replication/roster.js.map +1 -0
- package/dist/replication/schedule.d.ts +73 -0
- package/dist/replication/schedule.d.ts.map +1 -0
- package/dist/replication/schedule.js +182 -0
- package/dist/replication/schedule.js.map +1 -0
- package/dist/replication/stream.d.ts +73 -0
- package/dist/replication/stream.d.ts.map +1 -0
- package/dist/replication/stream.js +542 -0
- package/dist/replication/stream.js.map +1 -0
- package/dist/replication/transport.d.ts +236 -0
- package/dist/replication/transport.d.ts.map +1 -0
- package/dist/replication/transport.js +440 -0
- package/dist/replication/transport.js.map +1 -0
- package/dist/replication/visibility-engine.d.ts +337 -0
- package/dist/replication/visibility-engine.d.ts.map +1 -0
- package/dist/replication/visibility-engine.js +602 -0
- package/dist/replication/visibility-engine.js.map +1 -0
- package/dist/replication/visibility-policy.d.ts +26 -0
- package/dist/replication/visibility-policy.d.ts.map +1 -0
- package/dist/replication/visibility-policy.js +33 -0
- package/dist/replication/visibility-policy.js.map +1 -0
- package/dist/replication/writer-identity-store.d.ts +100 -0
- package/dist/replication/writer-identity-store.d.ts.map +1 -0
- package/dist/replication/writer-identity-store.js +218 -0
- package/dist/replication/writer-identity-store.js.map +1 -0
- package/dist/replication/writer-identity.d.ts +252 -0
- package/dist/replication/writer-identity.d.ts.map +1 -0
- package/dist/replication/writer-identity.js +281 -0
- package/dist/replication/writer-identity.js.map +1 -0
- package/dist/replication/writer-identity.test-utils.d.ts +24 -0
- package/dist/replication/writer-identity.test-utils.d.ts.map +1 -0
- package/dist/replication/writer-identity.test-utils.js +86 -0
- package/dist/replication/writer-identity.test-utils.js.map +1 -0
- package/dist/schemas/server-config.d.ts +71 -0
- package/dist/schemas/server-config.d.ts.map +1 -1
- package/dist/schemas/server-config.js +151 -0
- package/dist/schemas/server-config.js.map +1 -1
- package/dist/signing/request-signer.d.ts +2 -0
- package/dist/signing/request-signer.d.ts.map +1 -1
- package/dist/signing/request-signer.js +1 -0
- package/dist/signing/request-signer.js.map +1 -1
- package/dist/storage/adapters/index.d.ts +3 -1
- package/dist/storage/adapters/index.d.ts.map +1 -1
- package/dist/storage/adapters/index.js +2 -0
- package/dist/storage/adapters/index.js.map +1 -1
- package/dist/storage/adapters/interface.d.ts +21 -1
- package/dist/storage/adapters/interface.d.ts.map +1 -1
- package/dist/storage/adapters/interface.js +13 -1
- package/dist/storage/adapters/interface.js.map +1 -1
- package/dist/storage/adapters/sdk.d.ts +2 -1
- package/dist/storage/adapters/sdk.d.ts.map +1 -1
- package/dist/storage/adapters/sdk.js +21 -3
- package/dist/storage/adapters/sdk.js.map +1 -1
- package/dist/storage/adapters/vana-audience.d.ts +24 -0
- package/dist/storage/adapters/vana-audience.d.ts.map +1 -0
- package/dist/storage/adapters/vana-audience.js +87 -0
- package/dist/storage/adapters/vana-audience.js.map +1 -0
- package/dist/storage/adapters/vana.d.ts +5 -3
- package/dist/storage/adapters/vana.d.ts.map +1 -1
- package/dist/storage/adapters/vana.js +69 -23
- package/dist/storage/adapters/vana.js.map +1 -1
- package/dist/storage/blocks/cursor.d.ts +5 -1
- package/dist/storage/blocks/cursor.d.ts.map +1 -1
- package/dist/storage/blocks/cursor.js +13 -1
- package/dist/storage/blocks/cursor.js.map +1 -1
- package/dist/storage/blocks/page.d.ts +18 -0
- package/dist/storage/blocks/page.d.ts.map +1 -0
- package/dist/storage/blocks/page.js +113 -0
- package/dist/storage/blocks/page.js.map +1 -0
- package/dist/storage/canonical-legacy-projection.d.ts +262 -0
- package/dist/storage/canonical-legacy-projection.d.ts.map +1 -0
- package/dist/storage/canonical-legacy-projection.js +759 -0
- package/dist/storage/canonical-legacy-projection.js.map +1 -0
- 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 +30 -3
- package/dist/storage/index/manager.d.ts.map +1 -1
- package/dist/storage/index/schema.d.ts +1 -1
- package/dist/storage/index/schema.js +1 -1
- package/dist/storage/index/types.d.ts +7 -1
- package/dist/storage/index/types.d.ts.map +1 -1
- package/dist/storage/legacy-projection.d.ts +88 -0
- package/dist/storage/legacy-projection.d.ts.map +1 -0
- package/dist/storage/legacy-projection.js +755 -0
- package/dist/storage/legacy-projection.js.map +1 -0
- package/dist/storage/legacy-scope-coverage-exceptions.d.ts +13 -0
- package/dist/storage/legacy-scope-coverage-exceptions.d.ts.map +1 -0
- package/dist/storage/legacy-scope-coverage-exceptions.js +14 -0
- package/dist/storage/legacy-scope-coverage-exceptions.js.map +1 -0
- package/dist/storage/legacy-scope-coverage.d.ts +53 -0
- package/dist/storage/legacy-scope-coverage.d.ts.map +1 -0
- package/dist/storage/legacy-scope-coverage.js +416 -0
- package/dist/storage/legacy-scope-coverage.js.map +1 -0
- package/dist/storage/legacy-scope-entity-keys.d.ts +17 -0
- package/dist/storage/legacy-scope-entity-keys.d.ts.map +1 -0
- package/dist/storage/legacy-scope-entity-keys.js +109 -0
- package/dist/storage/legacy-scope-entity-keys.js.map +1 -0
- package/dist/storage/legacy-scope-view.d.ts +206 -0
- package/dist/storage/legacy-scope-view.d.ts.map +1 -0
- package/dist/storage/legacy-scope-view.js +1061 -0
- package/dist/storage/legacy-scope-view.js.map +1 -0
- package/dist/storage/pdpp-records/completion.d.ts +91 -0
- package/dist/storage/pdpp-records/completion.d.ts.map +1 -0
- package/dist/storage/pdpp-records/completion.js +170 -0
- package/dist/storage/pdpp-records/completion.js.map +1 -0
- package/dist/storage/pdpp-records/cursor.d.ts +86 -0
- package/dist/storage/pdpp-records/cursor.d.ts.map +1 -0
- package/dist/storage/pdpp-records/cursor.js +56 -0
- package/dist/storage/pdpp-records/cursor.js.map +1 -0
- package/dist/storage/pdpp-records/declaration-witness.d.ts +58 -0
- package/dist/storage/pdpp-records/declaration-witness.d.ts.map +1 -0
- package/dist/storage/pdpp-records/declaration-witness.js +230 -0
- package/dist/storage/pdpp-records/declaration-witness.js.map +1 -0
- package/dist/storage/pdpp-records/enforcement.d.ts +39 -0
- package/dist/storage/pdpp-records/enforcement.d.ts.map +1 -0
- package/dist/storage/pdpp-records/enforcement.js +143 -0
- package/dist/storage/pdpp-records/enforcement.js.map +1 -0
- package/dist/storage/pdpp-records/index.d.ts +7 -0
- package/dist/storage/pdpp-records/index.d.ts.map +1 -0
- package/dist/storage/pdpp-records/index.js +6 -0
- package/dist/storage/pdpp-records/index.js.map +1 -0
- package/dist/storage/pdpp-records/ingest-plan.d.ts +39 -0
- package/dist/storage/pdpp-records/ingest-plan.d.ts.map +1 -0
- package/dist/storage/pdpp-records/ingest-plan.js +103 -0
- package/dist/storage/pdpp-records/ingest-plan.js.map +1 -0
- package/dist/storage/pdpp-records/interface.d.ts +111 -0
- package/dist/storage/pdpp-records/interface.d.ts.map +1 -0
- package/dist/storage/pdpp-records/interface.js +2 -0
- package/dist/storage/pdpp-records/interface.js.map +1 -0
- package/dist/storage/pdpp-records/list-page.d.ts +35 -0
- package/dist/storage/pdpp-records/list-page.d.ts.map +1 -0
- package/dist/storage/pdpp-records/list-page.js +106 -0
- package/dist/storage/pdpp-records/list-page.js.map +1 -0
- package/dist/storage/pdpp-records/memory-store.d.ts +9 -0
- package/dist/storage/pdpp-records/memory-store.d.ts.map +1 -0
- package/dist/storage/pdpp-records/memory-store.js +462 -0
- package/dist/storage/pdpp-records/memory-store.js.map +1 -0
- package/dist/storage/pdpp-records/portable.d.ts +12 -0
- package/dist/storage/pdpp-records/portable.d.ts.map +1 -0
- package/dist/storage/pdpp-records/portable.js +11 -0
- package/dist/storage/pdpp-records/portable.js.map +1 -0
- package/dist/storage/pdpp-records/read-port.d.ts +44 -0
- package/dist/storage/pdpp-records/read-port.d.ts.map +1 -0
- package/dist/storage/pdpp-records/read-port.js +22 -0
- package/dist/storage/pdpp-records/read-port.js.map +1 -0
- package/dist/storage/pdpp-records/record-key.d.ts +52 -0
- package/dist/storage/pdpp-records/record-key.d.ts.map +1 -0
- package/dist/storage/pdpp-records/record-key.js +97 -0
- package/dist/storage/pdpp-records/record-key.js.map +1 -0
- package/dist/storage/pdpp-records/replication-journal.d.ts +20 -0
- package/dist/storage/pdpp-records/replication-journal.d.ts.map +1 -0
- package/dist/storage/pdpp-records/replication-journal.js +2 -0
- package/dist/storage/pdpp-records/replication-journal.js.map +1 -0
- package/dist/storage/pdpp-records/schema.d.ts +41 -0
- package/dist/storage/pdpp-records/schema.d.ts.map +1 -0
- package/dist/storage/pdpp-records/schema.js +153 -0
- package/dist/storage/pdpp-records/schema.js.map +1 -0
- package/dist/storage/pdpp-records/stream-declaration.d.ts +86 -0
- package/dist/storage/pdpp-records/stream-declaration.d.ts.map +1 -0
- package/dist/storage/pdpp-records/stream-declaration.js +48 -0
- package/dist/storage/pdpp-records/stream-declaration.js.map +1 -0
- package/dist/storage/pdpp-records/sync-selection.d.ts +4 -0
- package/dist/storage/pdpp-records/sync-selection.d.ts.map +1 -0
- package/dist/storage/pdpp-records/sync-selection.js +37 -0
- package/dist/storage/pdpp-records/sync-selection.js.map +1 -0
- package/dist/storage/pdpp-records/types.d.ts +202 -0
- package/dist/storage/pdpp-records/types.d.ts.map +1 -0
- package/dist/storage/pdpp-records/types.js +38 -0
- package/dist/storage/pdpp-records/types.js.map +1 -0
- package/dist/stream-sync/artifacts.d.ts +31 -0
- package/dist/stream-sync/artifacts.d.ts.map +1 -0
- package/dist/stream-sync/artifacts.js +106 -0
- package/dist/stream-sync/artifacts.js.map +1 -0
- package/dist/stream-sync/blobs.d.ts +11 -0
- package/dist/stream-sync/blobs.d.ts.map +1 -0
- package/dist/stream-sync/blobs.js +34 -0
- package/dist/stream-sync/blobs.js.map +1 -0
- package/dist/stream-sync/crypto.d.ts +21 -0
- package/dist/stream-sync/crypto.d.ts.map +1 -0
- package/dist/stream-sync/crypto.js +45 -0
- package/dist/stream-sync/crypto.js.map +1 -0
- package/dist/stream-sync/home.d.ts +46 -0
- package/dist/stream-sync/home.d.ts.map +1 -0
- package/dist/stream-sync/home.js +37 -0
- package/dist/stream-sync/home.js.map +1 -0
- package/dist/stream-sync/index.d.ts +14 -0
- package/dist/stream-sync/index.d.ts.map +1 -0
- package/dist/stream-sync/index.js +14 -0
- package/dist/stream-sync/index.js.map +1 -0
- package/dist/stream-sync/intake.d.ts +165 -0
- package/dist/stream-sync/intake.d.ts.map +1 -0
- package/dist/stream-sync/intake.js +467 -0
- package/dist/stream-sync/intake.js.map +1 -0
- package/dist/stream-sync/io-barrier.d.ts +39 -0
- package/dist/stream-sync/io-barrier.d.ts.map +1 -0
- package/dist/stream-sync/io-barrier.js +130 -0
- package/dist/stream-sync/io-barrier.js.map +1 -0
- package/dist/stream-sync/memory-files.d.ts +6 -0
- package/dist/stream-sync/memory-files.d.ts.map +1 -0
- package/dist/stream-sync/memory-files.js +50 -0
- package/dist/stream-sync/memory-files.js.map +1 -0
- package/dist/stream-sync/ports.d.ts +134 -0
- package/dist/stream-sync/ports.d.ts.map +1 -0
- package/dist/stream-sync/ports.js +26 -0
- package/dist/stream-sync/ports.js.map +1 -0
- package/dist/stream-sync/publish-plan.d.ts +157 -0
- package/dist/stream-sync/publish-plan.d.ts.map +1 -0
- package/dist/stream-sync/publish-plan.js +212 -0
- package/dist/stream-sync/publish-plan.js.map +1 -0
- package/dist/stream-sync/registry.d.ts +19 -0
- package/dist/stream-sync/registry.d.ts.map +1 -0
- package/dist/stream-sync/registry.js +125 -0
- package/dist/stream-sync/registry.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/spool.d.ts +69 -0
- package/dist/stream-sync/spool.d.ts.map +1 -0
- package/dist/stream-sync/spool.js +197 -0
- package/dist/stream-sync/spool.js.map +1 -0
- package/dist/stream-sync/writer-overlay.d.ts +19 -0
- package/dist/stream-sync/writer-overlay.d.ts.map +1 -0
- package/dist/stream-sync/writer-overlay.js +55 -0
- package/dist/stream-sync/writer-overlay.js.map +1 -0
- package/dist/stream-sync/writer.d.ts +404 -0
- package/dist/stream-sync/writer.d.ts.map +1 -0
- package/dist/stream-sync/writer.js +1994 -0
- package/dist/stream-sync/writer.js.map +1 -0
- package/dist/stream-sync-read/fold.d.ts +69 -0
- package/dist/stream-sync-read/fold.d.ts.map +1 -0
- package/dist/stream-sync-read/fold.js +83 -0
- package/dist/stream-sync-read/fold.js.map +1 -0
- package/dist/stream-sync-read/importer.d.ts +81 -0
- package/dist/stream-sync-read/importer.d.ts.map +1 -0
- package/dist/stream-sync-read/importer.js +226 -0
- package/dist/stream-sync-read/importer.js.map +1 -0
- package/dist/stream-sync-read/index.d.ts +8 -0
- package/dist/stream-sync-read/index.d.ts.map +1 -0
- package/dist/stream-sync-read/index.js +5 -0
- package/dist/stream-sync-read/index.js.map +1 -0
- package/dist/stream-sync-read/keys.d.ts +16 -0
- package/dist/stream-sync-read/keys.d.ts.map +1 -0
- package/dist/stream-sync-read/keys.js +48 -0
- package/dist/stream-sync-read/keys.js.map +1 -0
- package/dist/stream-sync-read/lines.d.ts +37 -0
- package/dist/stream-sync-read/lines.d.ts.map +1 -0
- package/dist/stream-sync-read/lines.js +98 -0
- package/dist/stream-sync-read/lines.js.map +1 -0
- package/dist/stream-sync-read/memory-files.d.ts +6 -0
- package/dist/stream-sync-read/memory-files.d.ts.map +1 -0
- package/dist/stream-sync-read/memory-files.js +34 -0
- package/dist/stream-sync-read/memory-files.js.map +1 -0
- package/dist/stream-sync-read/mirror.d.ts +80 -0
- package/dist/stream-sync-read/mirror.d.ts.map +1 -0
- package/dist/stream-sync-read/mirror.js +189 -0
- package/dist/stream-sync-read/mirror.js.map +1 -0
- package/dist/stream-sync-read/ports.d.ts +155 -0
- package/dist/stream-sync-read/ports.d.ts.map +1 -0
- package/dist/stream-sync-read/ports.js +9 -0
- package/dist/stream-sync-read/ports.js.map +1 -0
- package/dist/stream-sync-read/projection.d.ts +47 -0
- package/dist/stream-sync-read/projection.d.ts.map +1 -0
- package/dist/stream-sync-read/projection.js +338 -0
- package/dist/stream-sync-read/projection.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-fixture.d.ts +94 -0
- package/dist/stream-sync-read/service-fixture.d.ts.map +1 -0
- package/dist/stream-sync-read/service-fixture.js +227 -0
- package/dist/stream-sync-read/service-fixture.js.map +1 -0
- package/dist/stream-sync-read/service.d.ts +260 -0
- package/dist/stream-sync-read/service.d.ts.map +1 -0
- package/dist/stream-sync-read/service.js +975 -0
- package/dist/stream-sync-read/service.js.map +1 -0
- package/dist/stream-sync-read/testing.d.ts +54 -0
- package/dist/stream-sync-read/testing.d.ts.map +1 -0
- package/dist/stream-sync-read/testing.js +80 -0
- package/dist/stream-sync-read/testing.js.map +1 -0
- package/dist/stream-sync-read/view-store.d.ts +98 -0
- package/dist/stream-sync-read/view-store.d.ts.map +1 -0
- package/dist/stream-sync-read/view-store.js +278 -0
- package/dist/stream-sync-read/view-store.js.map +1 -0
- package/dist/stream-sync-read/writer-rig.d.ts +122 -0
- package/dist/stream-sync-read/writer-rig.d.ts.map +1 -0
- package/dist/stream-sync-read/writer-rig.js +301 -0
- package/dist/stream-sync-read/writer-rig.js.map +1 -0
- package/dist/sync/data-point-feed.d.ts +3 -0
- package/dist/sync/data-point-feed.d.ts.map +1 -1
- package/dist/sync/data-point-feed.js +20 -1
- package/dist/sync/data-point-feed.js.map +1 -1
- package/dist/sync/delete-data-port.d.ts +19 -0
- package/dist/sync/delete-data-port.d.ts.map +1 -1
- package/dist/sync/delete-data-port.js +42 -9
- package/dist/sync/delete-data-port.js.map +1 -1
- package/dist/sync/engine/sync-manager.d.ts +21 -1
- package/dist/sync/engine/sync-manager.d.ts.map +1 -1
- package/dist/sync/engine/sync-manager.js +140 -11
- 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 +7 -1
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/pdpp-import.d.ts +192 -0
- package/dist/sync/pdpp-import.d.ts.map +1 -0
- package/dist/sync/pdpp-import.js +441 -0
- package/dist/sync/pdpp-import.js.map +1 -0
- package/dist/sync/pending-blob-deletions.d.ts +18 -2
- package/dist/sync/pending-blob-deletions.d.ts.map +1 -1
- package/dist/sync/pending-blob-deletions.js +97 -23
- package/dist/sync/pending-blob-deletions.js.map +1 -1
- package/dist/sync/scope-deletions.d.ts +12 -0
- package/dist/sync/scope-deletions.d.ts.map +1 -1
- package/dist/sync/scope-deletions.js +99 -25
- package/dist/sync/scope-deletions.js.map +1 -1
- package/dist/sync/tombstone-finality.d.ts +36 -0
- package/dist/sync/tombstone-finality.d.ts.map +1 -0
- package/dist/sync/tombstone-finality.js +142 -0
- package/dist/sync/tombstone-finality.js.map +1 -0
- package/dist/sync/tombstone-resubmits.d.ts +61 -0
- package/dist/sync/tombstone-resubmits.d.ts.map +1 -0
- package/dist/sync/tombstone-resubmits.js +85 -0
- package/dist/sync/tombstone-resubmits.js.map +1 -0
- package/dist/sync/types.d.ts +10 -0
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/sync/workers/delete.d.ts +54 -5
- package/dist/sync/workers/delete.d.ts.map +1 -1
- package/dist/sync/workers/delete.js +594 -170
- package/dist/sync/workers/delete.js.map +1 -1
- package/dist/sync/workers/download.d.ts +42 -1
- package/dist/sync/workers/download.d.ts.map +1 -1
- package/dist/sync/workers/download.js +344 -24
- package/dist/sync/workers/download.js.map +1 -1
- package/dist/sync/workers/lost-data-points.d.ts +38 -0
- package/dist/sync/workers/lost-data-points.d.ts.map +1 -0
- package/dist/sync/workers/lost-data-points.js +72 -0
- package/dist/sync/workers/lost-data-points.js.map +1 -0
- package/dist/sync/workers/upload.d.ts +27 -6
- package/dist/sync/workers/upload.d.ts.map +1 -1
- package/dist/sync/workers/upload.js +169 -274
- package/dist/sync/workers/upload.js.map +1 -1
- package/dist/test-utils/memory-storage.d.ts +1 -1
- package/dist/test-utils/memory-storage.d.ts.map +1 -1
- package/dist/test-utils/memory-storage.js +83 -17
- package/dist/test-utils/memory-storage.js.map +1 -1
- package/dist/write/attribution.d.ts.map +1 -1
- package/dist/write/attribution.js +8 -4
- package/dist/write/attribution.js.map +1 -1
- package/dist/write/route.d.ts.map +1 -1
- package/dist/write/route.js +9 -10
- package/dist/write/route.js.map +1 -1
- package/dist/write/session.d.ts.map +1 -1
- package/dist/write/session.js +13 -0
- package/dist/write/session.js.map +1 -1
- package/package.json +103 -3
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { withScopeLock } from "../../additions/scope-lock.js";
|
|
1
2
|
import { computeDataPointId } from "../data-point-id.js";
|
|
3
|
+
import { isGatewayReservedScope } from "../delete-data-port.js";
|
|
4
|
+
import { createMemoryPendingBlobDeletionStore } from "../pending-blob-deletions.js";
|
|
5
|
+
import { DEFAULT_TOMBSTONE_RESUBMIT_MAX_ATTEMPTS, } from "../tombstone-resubmits.js";
|
|
2
6
|
import { deletionTimestamp, isEntryCoveredByTombstone, tombstoneVersion, } from "../scope-deletions.js";
|
|
3
7
|
/**
|
|
4
8
|
* Exact blob deletes sent per pass. vana-storage allows 30 DELETE requests
|
|
@@ -38,13 +42,71 @@ export function planBlobDeletions(storage, scope, tombstoneVersionValue) {
|
|
|
38
42
|
range: last === null || last < 1n ? null : { from: "1", to: last.toString() },
|
|
39
43
|
};
|
|
40
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Snapshot matching rows synchronously. Owner-intent capture precedes remote
|
|
47
|
+
* work; tombstone capture precedes blob cleanup. Later rows stay outside each fence.
|
|
48
|
+
*/
|
|
49
|
+
function captureEntries(storage, scope, includes) {
|
|
50
|
+
const covered = [];
|
|
51
|
+
const PAGE_SIZE = 500;
|
|
52
|
+
for (let offset = 0;; offset += PAGE_SIZE) {
|
|
53
|
+
const entries = storage.listVersions(scope, { limit: PAGE_SIZE, offset });
|
|
54
|
+
for (const entry of entries) {
|
|
55
|
+
if (includes(entry)) {
|
|
56
|
+
covered.push({
|
|
57
|
+
id: entry.id,
|
|
58
|
+
path: entry.path,
|
|
59
|
+
collectedAt: entry.collectedAt,
|
|
60
|
+
afterTombstoneVersion: entry.afterTombstoneVersion,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (entries.length < PAGE_SIZE)
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
return covered;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Erase exactly the fenced versions, one at a time, each through the storage's
|
|
71
|
+
* fenced erase. The storage checks the row's id and path at the erase itself,
|
|
72
|
+
* under its own lock or transaction, so a replacement that took a fenced stamp
|
|
73
|
+
* after capture is left alone and reported as not erased. No snapshot is taken
|
|
74
|
+
* here, because a snapshot is stale by the time the erase runs.
|
|
75
|
+
*
|
|
76
|
+
* The scope's first-seen sidecar was derived from the fenced rows, so it is
|
|
77
|
+
* dropped after the erases, under the scope lock: a rebuild that read the old
|
|
78
|
+
* rows cannot write it back once this returns. The next read rebuilds it from
|
|
79
|
+
* the rows that survive (a re-add starts afresh there).
|
|
80
|
+
*/
|
|
81
|
+
async function eraseCoveredEntries(storage, scope, fence) {
|
|
82
|
+
if (fence.length === 0)
|
|
83
|
+
return 0;
|
|
84
|
+
let erased = 0;
|
|
85
|
+
try {
|
|
86
|
+
for (const captured of fence) {
|
|
87
|
+
const removed = await storage.deleteVersion(scope, captured.collectedAt, {
|
|
88
|
+
id: captured.id,
|
|
89
|
+
path: captured.path,
|
|
90
|
+
});
|
|
91
|
+
if (removed)
|
|
92
|
+
erased += 1;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
finally {
|
|
96
|
+
await withScopeLock(scope, async () => {
|
|
97
|
+
await storage.deleteFirstSeenLedger?.(scope);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return erased;
|
|
101
|
+
}
|
|
41
102
|
/** Take up to `count` versions from the head of a range; `rest` is what remains. */
|
|
42
|
-
function takeFromRange(range, count) {
|
|
103
|
+
function takeFromRange(range, count, cap = null) {
|
|
43
104
|
const from = BigInt(range.from);
|
|
44
105
|
const to = BigInt(range.to);
|
|
106
|
+
const last = cap !== null && cap < to ? cap : to;
|
|
45
107
|
const versions = [];
|
|
46
108
|
let cursor = from;
|
|
47
|
-
while (cursor <=
|
|
109
|
+
while (cursor <= last && versions.length < count) {
|
|
48
110
|
versions.push(cursor.toString());
|
|
49
111
|
cursor += 1n;
|
|
50
112
|
}
|
|
@@ -74,29 +136,7 @@ function countPendingKeys(markers) {
|
|
|
74
136
|
? Number.MAX_SAFE_INTEGER
|
|
75
137
|
: Number(total);
|
|
76
138
|
}
|
|
77
|
-
|
|
78
|
-
* Durable scope deletion, in the only order that cannot resurrect data:
|
|
79
|
-
*
|
|
80
|
-
* 1. gateway tombstone (owner-signed AddData at current + 1; the fact)
|
|
81
|
-
* 2. storage blobs (exact keys of every version the tombstone covers)
|
|
82
|
-
* 3. local copy (index rows + files + sidecars)
|
|
83
|
-
*
|
|
84
|
-
* The local delete never runs before the gateway has acknowledged: until the
|
|
85
|
-
* registry says "deleted", the next sync cycle would re-pull the point from
|
|
86
|
-
* the still-live row. Step 2 deletes exact per-version keys, never the scope
|
|
87
|
-
* prefix, so a re-add another replica lands at any time keeps its ciphertext
|
|
88
|
-
* (it is registered above the tombstone version and stored under that key).
|
|
89
|
-
* Keys that could not be deleted in this pass are queued as exact retry
|
|
90
|
-
* markers; step 3 does not wait for them because the tombstone already makes
|
|
91
|
-
* the deletion stick.
|
|
92
|
-
*
|
|
93
|
-
* Not serialised here: the sync manager runs this under the same lock as its
|
|
94
|
-
* upload/download cycles so a delete cannot interleave with an upload of the
|
|
95
|
-
* same scope on this replica (see engine/sync-manager.ts). Uploads racing on
|
|
96
|
-
* another replica are handled by the upload worker's deletion guard and the
|
|
97
|
-
* download worker's reconcile.
|
|
98
|
-
*/
|
|
99
|
-
export async function deleteScope(deps, scope) {
|
|
139
|
+
export async function deleteScope(deps, scope, options = {}) {
|
|
100
140
|
const { storage, deleteData, pendingBlobDeletions, scopeDeletions, logger } = deps;
|
|
101
141
|
const now = deps.now ?? (() => new Date());
|
|
102
142
|
const dataPointId = deps.serverOwner
|
|
@@ -113,14 +153,27 @@ export async function deleteScope(deps, scope) {
|
|
|
113
153
|
},
|
|
114
154
|
pendingBlobDeletion: false,
|
|
115
155
|
};
|
|
156
|
+
// A new owner request also covers already-acknowledged local re-adds. Capture
|
|
157
|
+
// them before remote work; background retries never get this owner-intent fence.
|
|
158
|
+
const requestedReadds = deleteData
|
|
159
|
+
? captureEntries(storage, scope, (entry) => entry.dataPointId === null &&
|
|
160
|
+
Number.isSafeInteger(entry.afterTombstoneVersion) &&
|
|
161
|
+
Number(entry.afterTombstoneVersion) > 0)
|
|
162
|
+
: [];
|
|
163
|
+
// Set only once a gateway tombstone has landed (see step 2).
|
|
164
|
+
let covered = null;
|
|
116
165
|
if (deleteData) {
|
|
117
166
|
// 1. Gateway tombstone: the durable fact. Nothing else happens if it
|
|
118
167
|
// fails, so the owner gets a clear "nothing was deleted" instead of a
|
|
119
168
|
// local delete that sync silently undoes.
|
|
120
169
|
let tombstoneVersionValue = null;
|
|
121
170
|
let tombstoneKnown = false;
|
|
171
|
+
let replacedHead = null;
|
|
122
172
|
try {
|
|
123
|
-
|
|
173
|
+
const tombstone = () => options.fence
|
|
174
|
+
? deleteData.tombstone(scope, options.fence)
|
|
175
|
+
: deleteData.tombstone(scope);
|
|
176
|
+
let outcome = await tombstone();
|
|
124
177
|
if (outcome.status === "not-registered") {
|
|
125
178
|
// "Nothing to tombstone" is only durable if the registry still has
|
|
126
179
|
// no row. A registration racing our lookup would otherwise survive
|
|
@@ -129,7 +182,7 @@ export async function deleteScope(deps, scope) {
|
|
|
129
182
|
// registry cannot be asked, refuse rather than delete on a guess.
|
|
130
183
|
let registry = await registryState(deps, scope);
|
|
131
184
|
if (registry.status === "live") {
|
|
132
|
-
outcome = await
|
|
185
|
+
outcome = await tombstone();
|
|
133
186
|
registry = await registryState(deps, scope);
|
|
134
187
|
}
|
|
135
188
|
if (outcome.status === "not-registered" &&
|
|
@@ -144,6 +197,9 @@ export async function deleteScope(deps, scope) {
|
|
|
144
197
|
}
|
|
145
198
|
else {
|
|
146
199
|
tombstoneKnown = true;
|
|
200
|
+
if (outcome.status === "tombstoned") {
|
|
201
|
+
replacedHead = outcome.replaced ?? null;
|
|
202
|
+
}
|
|
147
203
|
tombstoneVersionValue =
|
|
148
204
|
outcome.version === null
|
|
149
205
|
? null
|
|
@@ -164,6 +220,9 @@ export async function deleteScope(deps, scope) {
|
|
|
164
220
|
deletedAt: outcome.deletedAt ?? now().toISOString(),
|
|
165
221
|
version: outcome.version,
|
|
166
222
|
}, "local-delete");
|
|
223
|
+
// A tombstone was just queued (or re-confirmed): read its finality
|
|
224
|
+
// on the next pass instead of waiting out an earlier backoff.
|
|
225
|
+
deps.tombstoneFinality?.recheckNow?.(scope);
|
|
167
226
|
}
|
|
168
227
|
result.durable = true;
|
|
169
228
|
}
|
|
@@ -176,31 +235,43 @@ export async function deleteScope(deps, scope) {
|
|
|
176
235
|
return result;
|
|
177
236
|
}
|
|
178
237
|
// 2. Storage blobs: exact keys, one pass of at most a batch, the rest
|
|
179
|
-
// queued. A
|
|
180
|
-
//
|
|
181
|
-
//
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
if (
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
238
|
+
// queued. A repeated delete of a scope whose cleanup is still running
|
|
239
|
+
// resumes from the queue: only work not taken on before is recorded, and
|
|
240
|
+
// the pass drains the scope's queue head, so no confirmed key is re-sent
|
|
241
|
+
// and no queued key is dropped. A tombstone whose version the gateway did
|
|
242
|
+
// not report cannot be expanded into registry keys yet; a version-less
|
|
243
|
+
// marker asks the retry to expand it once the registry answers.
|
|
244
|
+
// Fence first: the covered entries as they stand before the remote await.
|
|
245
|
+
covered = captureEntries(storage, scope, (entry) => isEntryCoveredByTombstone(entry, { version: tombstoneVersionValue }));
|
|
246
|
+
if (tombstoneVersionValue !== null) {
|
|
247
|
+
const anchor = BigInt(tombstoneVersionValue);
|
|
248
|
+
const coveredIds = new Set(covered.map((entry) => entry.id));
|
|
249
|
+
for (const entry of requestedReadds) {
|
|
250
|
+
if (typeof entry.afterTombstoneVersion === "number" &&
|
|
251
|
+
BigInt(entry.afterTombstoneVersion) <= anchor &&
|
|
252
|
+
!coveredIds.has(entry.id))
|
|
253
|
+
covered.push(entry);
|
|
254
|
+
}
|
|
195
255
|
}
|
|
196
|
-
const
|
|
256
|
+
const plan = planBlobDeletions(storage, scope, tombstoneVersionValue);
|
|
257
|
+
const storageStep = await deleteScopeBlobs({
|
|
258
|
+
deleteData,
|
|
259
|
+
pendingBlobDeletions,
|
|
260
|
+
tombstoneFinality: deps.tombstoneFinality,
|
|
261
|
+
logger,
|
|
262
|
+
}, scope, plan, tombstoneKnown && tombstoneVersionValue === null, options.storagePass ?? true, replacedHead);
|
|
197
263
|
result.steps.storage = storageStep.step;
|
|
198
264
|
result.pendingBlobDeletion = storageStep.pending > 0;
|
|
199
265
|
}
|
|
200
266
|
// 3. Local copy. Safe now: the registry row is a tombstone (or the point
|
|
201
|
-
// was never registered / sync is off), so nothing can re-pull it.
|
|
267
|
+
// was never registered / sync is off), so nothing can re-pull it. Only the
|
|
268
|
+
// versions fenced by the tombstone or this owner request are erased: a
|
|
269
|
+
// later re-add stays outside the owner fence. With no gateway
|
|
270
|
+
// there is no fence and the whole local copy goes.
|
|
202
271
|
try {
|
|
203
|
-
const deletedCount =
|
|
272
|
+
const deletedCount = covered
|
|
273
|
+
? await eraseCoveredEntries(storage, scope, covered)
|
|
274
|
+
: await storage.deleteScope(scope);
|
|
204
275
|
result.steps.local = { status: "ok", deletedCount };
|
|
205
276
|
}
|
|
206
277
|
catch (err) {
|
|
@@ -219,51 +290,329 @@ export async function deleteScope(deps, scope) {
|
|
|
219
290
|
return result;
|
|
220
291
|
}
|
|
221
292
|
/**
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
293
|
+
* Where a repeated delete of `scope` resumes: the highest tombstone version
|
|
294
|
+
* whose covered range was already taken on. The store's watermark says so
|
|
295
|
+
* directly; a queued range also proves its own upper bound was planned
|
|
296
|
+
* (which covers marker files written before the watermark existed).
|
|
225
297
|
*/
|
|
226
|
-
async function
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
298
|
+
async function resumePoint(store, scope, markers) {
|
|
299
|
+
const stored = store.plannedThrough
|
|
300
|
+
? await store.plannedThrough(scope)
|
|
301
|
+
: null;
|
|
302
|
+
let through = stored === null ? null : BigInt(stored);
|
|
303
|
+
for (const marker of markers) {
|
|
304
|
+
if (marker.scope !== scope || marker.version !== null || !marker.range) {
|
|
305
|
+
continue;
|
|
306
|
+
}
|
|
307
|
+
const to = BigInt(marker.range.to);
|
|
308
|
+
if (through === null || to > through)
|
|
309
|
+
through = to;
|
|
234
310
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
311
|
+
return through;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* The part of `plan` not taken on yet: its exact keys, and the registry range
|
|
315
|
+
* above `through`. Keys at or below `through` are already deleted or still
|
|
316
|
+
* queued, so planning them again would only re-send confirmed deletes.
|
|
317
|
+
*/
|
|
318
|
+
function unplannedWork(scope, plan, through, replacedHead = null) {
|
|
319
|
+
// A range is gated by its own `range.to`, the tombstone that covers it.
|
|
320
|
+
// The exact keys lie above that tombstone (or no tombstone exists), so
|
|
321
|
+
// their slots are still open: each is gated by its own version and waits
|
|
322
|
+
// for a finalized tombstone at or above it.
|
|
323
|
+
const work = plan.keys.map((version) => ({
|
|
324
|
+
scope,
|
|
325
|
+
version,
|
|
326
|
+
}));
|
|
327
|
+
if (plan.range) {
|
|
328
|
+
let from = BigInt(plan.range.from);
|
|
329
|
+
if (through !== null && through + 1n > from)
|
|
330
|
+
from = through + 1n;
|
|
331
|
+
if (from <= BigInt(plan.range.to)) {
|
|
332
|
+
work.push({
|
|
333
|
+
scope,
|
|
334
|
+
version: null,
|
|
335
|
+
range: { from: from.toString(), to: plan.range.to },
|
|
336
|
+
...(replacedHead ? { replacedHead } : {}),
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
return work;
|
|
341
|
+
}
|
|
342
|
+
/** Record work and its watermark together when the store supports it. */
|
|
343
|
+
async function recordPlannedWork(store, scope, work, through) {
|
|
344
|
+
if (store.enqueue)
|
|
345
|
+
await store.enqueue(scope, work, through);
|
|
346
|
+
else
|
|
347
|
+
await store.add(work);
|
|
348
|
+
}
|
|
349
|
+
function sameHead(a, b) {
|
|
350
|
+
return (a.expectedVersion === b.expectedVersion &&
|
|
351
|
+
a.dataHash.toLowerCase() === b.dataHash.toLowerCase() &&
|
|
352
|
+
a.metadataHash.toLowerCase() === b.metadataHash.toLowerCase());
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* The tombstone version whose finality frees a marker's keys: its recorded
|
|
356
|
+
* gate, else a range's upper bound, else an exact key's own version (a key at
|
|
357
|
+
* or below a finalized tombstone can never be registered again). Null for an
|
|
358
|
+
* unexpanded marker, which is never sent.
|
|
359
|
+
*/
|
|
360
|
+
function markerGate(marker) {
|
|
361
|
+
if (marker.tombstoneVersion !== undefined) {
|
|
362
|
+
return marker.version !== null || marker.range
|
|
363
|
+
? BigInt(marker.tombstoneVersion)
|
|
364
|
+
: null;
|
|
365
|
+
}
|
|
366
|
+
if (marker.version !== null)
|
|
367
|
+
return BigInt(marker.version);
|
|
368
|
+
if (marker.range)
|
|
369
|
+
return BigInt(marker.range.to);
|
|
370
|
+
return null;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* The markers whose keys may be sent now. Without a finality port, all of
|
|
374
|
+
* them (keys go on the tombstone's acknowledgement). With one, only markers
|
|
375
|
+
* gated at or below the scope's highest finalized tombstone: one inventory
|
|
376
|
+
* read per scope that has work. A read that fails holds the scope's markers
|
|
377
|
+
* for a later pass; holding a key only delays its deletion. Scopes whose
|
|
378
|
+
* deletion the registry rolled back are reported for re-submission.
|
|
379
|
+
*/
|
|
380
|
+
async function releasableMarkers(finality, markers, logger) {
|
|
381
|
+
const rolledBack = new Map();
|
|
382
|
+
const converged = new Set();
|
|
383
|
+
if (!finality) {
|
|
384
|
+
return {
|
|
385
|
+
released: markers.map((marker) => ({ marker, through: null })),
|
|
386
|
+
rolledBack,
|
|
387
|
+
converged,
|
|
242
388
|
};
|
|
243
389
|
}
|
|
244
|
-
const
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
390
|
+
const lowestGate = new Map();
|
|
391
|
+
for (const marker of markers) {
|
|
392
|
+
const gate = markerGate(marker);
|
|
393
|
+
if (gate === null)
|
|
394
|
+
continue;
|
|
395
|
+
const lowest = lowestGate.get(marker.scope);
|
|
396
|
+
if (lowest === undefined || gate < lowest) {
|
|
397
|
+
lowestGate.set(marker.scope, gate);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
const finalized = new Map();
|
|
401
|
+
for (const [scope, lowest] of lowestGate) {
|
|
252
402
|
try {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
if (
|
|
256
|
-
|
|
403
|
+
const state = await finality.tombstoneState(scope, lowest.toString());
|
|
404
|
+
finalized.set(scope, state.finalized === null ? null : BigInt(state.finalized));
|
|
405
|
+
if (state.rolledBack !== null)
|
|
406
|
+
rolledBack.set(scope, state.rolledBack);
|
|
407
|
+
else if (state.finalized !== null && !state.settling)
|
|
408
|
+
converged.add(scope);
|
|
409
|
+
}
|
|
410
|
+
catch (err) {
|
|
411
|
+
finalized.set(scope, null);
|
|
412
|
+
logger.warn({ scope, error: errorMessage(err) }, "Could not read tombstone finality; blob deletions wait for a later pass");
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
// A key at or below a finalized tombstone is free (see the safety argument
|
|
416
|
+
// on `TombstoneFinalityPort`): exact keys by their own version, ranges up
|
|
417
|
+
// to the finalized version, the rest of the range staying queued.
|
|
418
|
+
const released = [];
|
|
419
|
+
const held = new Map();
|
|
420
|
+
for (const marker of markers) {
|
|
421
|
+
const gate = markerGate(marker);
|
|
422
|
+
if (gate === null)
|
|
423
|
+
continue;
|
|
424
|
+
const through = finalized.get(marker.scope) ?? null;
|
|
425
|
+
const lowestKey = marker.version !== null
|
|
426
|
+
? BigInt(marker.version)
|
|
427
|
+
: BigInt(marker.range.from);
|
|
428
|
+
if (through !== null && lowestKey <= through) {
|
|
429
|
+
released.push({ marker, through: marker.range ? through : null });
|
|
430
|
+
}
|
|
431
|
+
const highestKey = marker.version !== null
|
|
432
|
+
? BigInt(marker.version)
|
|
433
|
+
: BigInt(marker.range.to);
|
|
434
|
+
if (through === null || highestKey > through) {
|
|
435
|
+
held.set(marker.scope, (held.get(marker.scope) ?? 0) + 1);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
for (const [scope, count] of held) {
|
|
439
|
+
logger.info({ scope, markers: count }, "Blob deletions wait until the covering tombstone is finalized");
|
|
440
|
+
}
|
|
441
|
+
return { released, rolledBack, converged };
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Send one rate-limited batch taken from `markers` (exact keys first, then
|
|
445
|
+
* range heads, in stored order) and reconcile the store: acknowledged exact
|
|
446
|
+
* markers (2xx or 404) leave it, a failed key taken from a range becomes an
|
|
447
|
+
* exact marker, and each consumed range is advanced in place. A key queued
|
|
448
|
+
* twice (an exact marker inside a range) is sent once.
|
|
449
|
+
*/
|
|
450
|
+
async function drainOnePass(deleteData, store, released) {
|
|
451
|
+
let budget = BLOB_DELETE_BATCH_SIZE;
|
|
452
|
+
const byScope = new Map();
|
|
453
|
+
const queued = new Set();
|
|
454
|
+
const exactOrigin = new Set();
|
|
455
|
+
// Gate of each key taken from a range, so a failed key keeps it.
|
|
456
|
+
const rangeGate = new Map();
|
|
457
|
+
const advancedRanges = [];
|
|
458
|
+
const keyOf = (scope, version) => `${scope}\u0000${version}`;
|
|
459
|
+
const take = (scope, version) => {
|
|
460
|
+
const id = keyOf(scope, version);
|
|
461
|
+
if (queued.has(id))
|
|
462
|
+
return false;
|
|
463
|
+
queued.add(id);
|
|
464
|
+
const versions = byScope.get(scope) ?? [];
|
|
465
|
+
versions.push(version);
|
|
466
|
+
byScope.set(scope, versions);
|
|
467
|
+
return true;
|
|
468
|
+
};
|
|
469
|
+
for (const { marker } of released) {
|
|
470
|
+
if (budget === 0)
|
|
471
|
+
break;
|
|
472
|
+
if (marker.version !== null) {
|
|
473
|
+
exactOrigin.add(keyOf(marker.scope, marker.version));
|
|
474
|
+
if (take(marker.scope, marker.version))
|
|
475
|
+
budget -= 1;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
for (const { marker, through } of released) {
|
|
479
|
+
if (budget === 0)
|
|
480
|
+
break;
|
|
481
|
+
if (marker.version === null && marker.range) {
|
|
482
|
+
const taken = takeFromRange(marker.range, budget, through);
|
|
483
|
+
const gate = marker.tombstoneVersion ?? marker.range.to;
|
|
484
|
+
for (const version of taken.versions) {
|
|
485
|
+
if (take(marker.scope, version)) {
|
|
486
|
+
budget -= 1;
|
|
487
|
+
rangeGate.set(keyOf(marker.scope, version), gate);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
advancedRanges.push({
|
|
491
|
+
old: marker,
|
|
492
|
+
next: taken.rest
|
|
493
|
+
? {
|
|
494
|
+
scope: marker.scope,
|
|
495
|
+
version: null,
|
|
496
|
+
range: taken.rest,
|
|
497
|
+
...(marker.tombstoneVersion !== undefined
|
|
498
|
+
? { tombstoneVersion: marker.tombstoneVersion }
|
|
499
|
+
: {}),
|
|
500
|
+
...(marker.replacedHead
|
|
501
|
+
? { replacedHead: marker.replacedHead }
|
|
502
|
+
: {}),
|
|
503
|
+
}
|
|
504
|
+
: null,
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
const outcomes = new Map();
|
|
509
|
+
for (const [scope, versions] of byScope) {
|
|
510
|
+
let outcome;
|
|
511
|
+
try {
|
|
512
|
+
outcome = await deleteData.deleteBlobVersions(scope, versions);
|
|
513
|
+
}
|
|
514
|
+
catch (err) {
|
|
515
|
+
// The port reports per-key failures; a thrown error means none of the
|
|
516
|
+
// batch can be trusted as done.
|
|
517
|
+
const message = errorMessage(err);
|
|
518
|
+
outcome = {
|
|
519
|
+
deleted: [],
|
|
520
|
+
missing: [],
|
|
521
|
+
failed: versions.map((version) => ({ version, error: message })),
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
outcomes.set(scope, outcome);
|
|
525
|
+
const completed = [...outcome.deleted, ...outcome.missing]
|
|
526
|
+
.filter((version) => exactOrigin.has(keyOf(scope, version)))
|
|
527
|
+
.map((version) => ({ scope, version }));
|
|
528
|
+
if (completed.length > 0)
|
|
529
|
+
await store.remove(completed);
|
|
530
|
+
// A failed key that came from a range becomes an exact marker; a failed
|
|
531
|
+
// exact marker simply stays.
|
|
532
|
+
const failedFromRange = outcome.failed
|
|
533
|
+
.filter(({ version }) => !exactOrigin.has(keyOf(scope, version)))
|
|
534
|
+
.map(({ version }) => {
|
|
535
|
+
const gate = rangeGate.get(keyOf(scope, version));
|
|
536
|
+
return {
|
|
537
|
+
scope,
|
|
538
|
+
version,
|
|
539
|
+
...(gate !== undefined ? { tombstoneVersion: gate } : {}),
|
|
540
|
+
};
|
|
541
|
+
});
|
|
542
|
+
if (failedFromRange.length > 0)
|
|
543
|
+
await store.add(failedFromRange);
|
|
544
|
+
}
|
|
545
|
+
// Advance the ranges only now: a crash mid-pass re-sends already-deleted
|
|
546
|
+
// keys (404, harmless) rather than skipping keys that were never sent. The
|
|
547
|
+
// successor is persisted before its predecessor is dropped, so a failed or
|
|
548
|
+
// interrupted write leaves the old range standing, never a gap.
|
|
549
|
+
for (const { old, next } of advancedRanges) {
|
|
550
|
+
if (next)
|
|
551
|
+
await store.add([next]);
|
|
552
|
+
await store.remove([old]);
|
|
553
|
+
}
|
|
554
|
+
return outcomes;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* The storage step of one DELETE call: record the work not taken on yet
|
|
558
|
+
* (with the scope's planned watermark), then send one batch from the head of
|
|
559
|
+
* the scope's queue and report what is still owed. A first delete and a
|
|
560
|
+
* repeat of it run the same path, so a repeat resumes where the queue stands.
|
|
561
|
+
*/
|
|
562
|
+
async function deleteScopeBlobs(deps, scope, plan, versionUnknown, storagePass, replacedHead) {
|
|
563
|
+
const { deleteData, logger } = deps;
|
|
564
|
+
const withUnknown = (work) => versionUnknown ? [...work, { scope, version: null }] : work;
|
|
565
|
+
let work = withUnknown(unplannedWork(scope, plan, null, replacedHead));
|
|
566
|
+
let store = deps.pendingBlobDeletions ?? null;
|
|
567
|
+
// This scope's markers already in the durable store before this call.
|
|
568
|
+
let queuedBefore = [];
|
|
569
|
+
if (store) {
|
|
570
|
+
try {
|
|
571
|
+
const markers = await store.list();
|
|
572
|
+
queuedBefore = markers.filter((m) => m.scope === scope);
|
|
573
|
+
const through = await resumePoint(store, scope, markers);
|
|
574
|
+
work = withUnknown(unplannedWork(scope, plan, through, replacedHead));
|
|
575
|
+
await recordPlannedWork(store, scope, work, plan.range?.to ?? null);
|
|
257
576
|
}
|
|
258
577
|
catch (markerErr) {
|
|
259
|
-
|
|
260
|
-
|
|
578
|
+
logger.error({ scope, error: errorMessage(markerErr), keys: countPendingKeys(work) }, "Could not record pending blob deletion markers");
|
|
579
|
+
store = null;
|
|
261
580
|
}
|
|
262
581
|
}
|
|
263
|
-
|
|
264
|
-
|
|
582
|
+
// Without a usable marker store this pass still sends a batch, taken from
|
|
583
|
+
// the scope's queue as last read plus the new work. The new work it cannot
|
|
584
|
+
// send is reported, not recorded; the durable queue keeps its old markers
|
|
585
|
+
// untouched, so that work is still owed and reported as pending.
|
|
586
|
+
const recorded = store !== null;
|
|
587
|
+
const passStore = store ?? createMemoryPendingBlobDeletionStore();
|
|
588
|
+
if (!recorded)
|
|
589
|
+
await passStore.add([...queuedBefore, ...work]);
|
|
590
|
+
const durablyOwed = recorded ? 0 : countPendingKeys(queuedBefore);
|
|
591
|
+
let outcome;
|
|
592
|
+
let remainingKeys;
|
|
593
|
+
try {
|
|
594
|
+
const { released: queued } = storagePass
|
|
595
|
+
? await releasableMarkers(deps.tombstoneFinality, (await passStore.list()).filter((m) => m.scope === scope), logger)
|
|
596
|
+
: { released: [] };
|
|
597
|
+
outcome = (await drainOnePass(deleteData, passStore, queued)).get(scope) ?? { deleted: [], missing: [], failed: [] };
|
|
598
|
+
remainingKeys = countPendingKeys((await passStore.list()).filter((m) => m.scope === scope));
|
|
599
|
+
}
|
|
600
|
+
catch (markerErr) {
|
|
601
|
+
// A marker write failed mid-pass. The store never loses owed keys (see
|
|
602
|
+
// drainOnePass), so the queue still holds this scope's work.
|
|
603
|
+
const message = errorMessage(markerErr);
|
|
604
|
+
logger.error({ scope, error: message }, "Could not update pending blob deletion markers");
|
|
605
|
+
return {
|
|
606
|
+
step: { status: "failed", error: message },
|
|
607
|
+
pending: recorded || durablyOwed > 0 ? 1 : 0,
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
if (!recorded && remainingKeys > durablyOwed) {
|
|
265
611
|
logger.error({ scope, keys: remainingKeys }, "Blob deletions left unfinished with no marker store to retry them");
|
|
266
612
|
}
|
|
613
|
+
if (!recorded)
|
|
614
|
+
remainingKeys = Math.max(remainingKeys, durablyOwed);
|
|
615
|
+
const pending = recorded ? remainingKeys : durablyOwed;
|
|
267
616
|
const counts = {
|
|
268
617
|
blobsDeleted: outcome.deleted.length,
|
|
269
618
|
blobsMissing: outcome.missing.length,
|
|
@@ -271,24 +620,19 @@ async function deleteBlobKeys(deps, scope, batch, leftovers) {
|
|
|
271
620
|
};
|
|
272
621
|
if (outcome.failed.length > 0) {
|
|
273
622
|
const first = outcome.failed[0];
|
|
274
|
-
logger.warn({
|
|
275
|
-
scope,
|
|
276
|
-
failed: outcome.failed.length,
|
|
277
|
-
pending: recorded,
|
|
278
|
-
error: first.error,
|
|
279
|
-
}, "Storage blob deletion failed for some keys after gateway tombstone; will retry");
|
|
623
|
+
logger.warn({ scope, failed: outcome.failed.length, pending, error: first.error }, "Storage blob deletion failed for some keys after gateway tombstone; will retry");
|
|
280
624
|
return {
|
|
281
625
|
step: {
|
|
282
626
|
status: "failed",
|
|
283
627
|
error: `${outcome.failed.length} blob delete(s) failed: ${first.error}`,
|
|
284
628
|
...counts,
|
|
285
629
|
},
|
|
286
|
-
pending
|
|
630
|
+
pending,
|
|
287
631
|
};
|
|
288
632
|
}
|
|
289
|
-
if (
|
|
633
|
+
if (remainingKeys > 0) {
|
|
290
634
|
logger.info({ scope, ...counts }, "Storage blob deletion continues on later sync cycles (rate-limited batch)");
|
|
291
|
-
return { step: { status: "deferred", ...counts }, pending
|
|
635
|
+
return { step: { status: "deferred", ...counts }, pending };
|
|
292
636
|
}
|
|
293
637
|
return { step: { status: "ok", ...counts }, pending: 0 };
|
|
294
638
|
}
|
|
@@ -301,8 +645,12 @@ async function deleteBlobKeys(deps, scope, batch, leftovers) {
|
|
|
301
645
|
* are expanded from the registry first; if the registry shows the scope live
|
|
302
646
|
* again the old tombstone's version is unknowable, so the marker is dropped
|
|
303
647
|
* and the pre-tombstone ciphertext stays (owner-decryptable only) until the
|
|
304
|
-
* next delete of that scope.
|
|
648
|
+
* next delete of that scope. With `tombstoneFinality` wired, a key is sent
|
|
649
|
+
* only once a tombstone at or above its gate is finalized; a failed
|
|
650
|
+
* tombstone's keys stay queued (the deletion did not happen) until a later
|
|
651
|
+
* deletion of the scope is finalized.
|
|
305
652
|
*/
|
|
653
|
+
export const TOMBSTONE_RESUBMIT_MAX_ATTEMPTS = DEFAULT_TOMBSTONE_RESUBMIT_MAX_ATTEMPTS;
|
|
306
654
|
export async function retryPendingBlobDeletions(deps) {
|
|
307
655
|
const { deleteData, pendingBlobDeletions, logger } = deps;
|
|
308
656
|
const result = {
|
|
@@ -332,85 +680,28 @@ export async function retryPendingBlobDeletions(deps) {
|
|
|
332
680
|
result.superseded.push(marker.scope);
|
|
333
681
|
logger.warn({
|
|
334
682
|
scope: marker.scope,
|
|
335
|
-
dataPointId: registry.
|
|
336
|
-
version: registry.
|
|
683
|
+
dataPointId: registry.id,
|
|
684
|
+
version: registry.expectedVersion,
|
|
337
685
|
}, "Scope was re-added after its tombstone; dropping the unexpanded blob deletion marker so the live version's ciphertext survives");
|
|
338
686
|
continue;
|
|
339
687
|
}
|
|
340
688
|
const plan = planBlobDeletions(deps.storage ?? { listVersions: () => [] }, marker.scope, registry.status === "deleted" ? registry.version : null);
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
689
|
+
// Only the part not taken on yet: a repeated delete may already have
|
|
690
|
+
// queued (or finished) the same tombstone's range.
|
|
691
|
+
const expanded = unplannedWork(marker.scope, plan, await resumePoint(pendingBlobDeletions, marker.scope, markers));
|
|
692
|
+
// Persist the expansion before dropping the unexpanded marker: a failed or
|
|
693
|
+
// interrupted write leaves the marker to expand again (the same keys), and
|
|
694
|
+
// never drops keys that are still owed.
|
|
695
|
+
await recordPlannedWork(pendingBlobDeletions, marker.scope, expanded, plan.range?.to ?? null);
|
|
348
696
|
await pendingBlobDeletions.remove([marker]);
|
|
349
|
-
await pendingBlobDeletions.add(expanded);
|
|
350
697
|
}
|
|
351
698
|
markers = await pendingBlobDeletions.list();
|
|
352
|
-
// One rate-limited batch in stored order: exact keys, then range heads
|
|
353
|
-
|
|
354
|
-
const
|
|
355
|
-
const
|
|
356
|
-
const
|
|
357
|
-
const enqueue = (scope, version) => {
|
|
358
|
-
const versions = byScope.get(scope) ?? [];
|
|
359
|
-
versions.push(version);
|
|
360
|
-
byScope.set(scope, versions);
|
|
361
|
-
};
|
|
362
|
-
for (const marker of markers) {
|
|
363
|
-
if (budget === 0)
|
|
364
|
-
break;
|
|
365
|
-
if (marker.version !== null) {
|
|
366
|
-
enqueue(marker.scope, marker.version);
|
|
367
|
-
exactOrigin.add(`${marker.scope}\u0000${marker.version}`);
|
|
368
|
-
budget -= 1;
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
for (const marker of markers) {
|
|
372
|
-
if (budget === 0)
|
|
373
|
-
break;
|
|
374
|
-
if (marker.version === null && marker.range) {
|
|
375
|
-
const taken = takeFromRange(marker.range, budget);
|
|
376
|
-
for (const version of taken.versions)
|
|
377
|
-
enqueue(marker.scope, version);
|
|
378
|
-
budget -= taken.versions.length;
|
|
379
|
-
advancedRanges.push({
|
|
380
|
-
old: marker,
|
|
381
|
-
next: taken.rest
|
|
382
|
-
? { scope: marker.scope, version: null, range: taken.rest }
|
|
383
|
-
: null,
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
for (const [scope, versions] of byScope) {
|
|
388
|
-
let outcome;
|
|
389
|
-
try {
|
|
390
|
-
outcome = await deleteData.deleteBlobVersions(scope, versions);
|
|
391
|
-
}
|
|
392
|
-
catch (err) {
|
|
393
|
-
const message = errorMessage(err);
|
|
394
|
-
outcome = {
|
|
395
|
-
deleted: [],
|
|
396
|
-
missing: [],
|
|
397
|
-
failed: versions.map((version) => ({ version, error: message })),
|
|
398
|
-
};
|
|
399
|
-
}
|
|
400
|
-
const completed = [...outcome.deleted, ...outcome.missing]
|
|
401
|
-
.filter((version) => exactOrigin.has(`${scope}\u0000${version}`))
|
|
402
|
-
.map((version) => ({ scope, version }));
|
|
403
|
-
if (completed.length > 0)
|
|
404
|
-
await pendingBlobDeletions.remove(completed);
|
|
699
|
+
// One rate-limited batch in stored order: exact keys, then range heads,
|
|
700
|
+
// taken only from markers whose covering tombstone is final.
|
|
701
|
+
const decision = await releasableMarkers(deps.tombstoneFinality, markers, logger);
|
|
702
|
+
const outcomes = await drainOnePass(deleteData, pendingBlobDeletions, decision.released);
|
|
703
|
+
for (const [scope, outcome] of outcomes) {
|
|
405
704
|
result.completed.push(...[...outcome.deleted, ...outcome.missing].map((version) => ({ scope, version })));
|
|
406
|
-
// A failed key that came from a range becomes an exact marker; a failed
|
|
407
|
-
// exact marker simply stays.
|
|
408
|
-
const failedFromRange = outcome.failed
|
|
409
|
-
.filter(({ version }) => !exactOrigin.has(`${scope}\u0000${version}`))
|
|
410
|
-
.map(({ version }) => ({ scope, version }));
|
|
411
|
-
if (failedFromRange.length > 0) {
|
|
412
|
-
await pendingBlobDeletions.add(failedFromRange);
|
|
413
|
-
}
|
|
414
705
|
for (const failure of outcome.failed) {
|
|
415
706
|
result.failed.push({ scope, ...failure });
|
|
416
707
|
}
|
|
@@ -429,16 +720,119 @@ export async function retryPendingBlobDeletions(deps) {
|
|
|
429
720
|
}, "Pending blob deletion failed again");
|
|
430
721
|
}
|
|
431
722
|
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
723
|
+
for (const [scope, rollback] of decision.rolledBack) {
|
|
724
|
+
await resubmitRolledBackDeletion(deps, scope, rollback, markers.filter((marker) => marker.scope === scope));
|
|
725
|
+
}
|
|
726
|
+
const left = await pendingBlobDeletions.list();
|
|
727
|
+
// A scope with nothing left to free has converged; forget its attempts.
|
|
728
|
+
if (deps.tombstoneResubmits) {
|
|
729
|
+
const waiting = new Set(left.map((marker) => marker.scope));
|
|
730
|
+
const tracked = deps.tombstoneResubmits.snapshot();
|
|
731
|
+
for (const { scope } of [...tracked.retrying, ...tracked.failed]) {
|
|
732
|
+
if (!waiting.has(scope) || decision.converged.has(scope)) {
|
|
733
|
+
deps.tombstoneResubmits.reset(scope);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
438
736
|
}
|
|
439
|
-
result.remaining =
|
|
737
|
+
result.remaining = left.length;
|
|
440
738
|
return result;
|
|
441
739
|
}
|
|
740
|
+
/**
|
|
741
|
+
* The user deleted `scope`, its tombstone failed to settle, and the gateway
|
|
742
|
+
* shows the scope live again (the finality port only reports a rollback when
|
|
743
|
+
* no newer version of the scope exists). Re-submit the delete through the
|
|
744
|
+
* ordinary delete path, but only over exactly the head the user's tombstone
|
|
745
|
+
* replaced: the queued range marker remembers that head, the inventory read
|
|
746
|
+
* reports the restored one, and the port refuses any other. A different
|
|
747
|
+
* restored head is reported once as a failed delete instead. A write that
|
|
748
|
+
* recovered a failed slot below the tombstone, or that lands between the read
|
|
749
|
+
* and the re-submission, is therefore never deleted. This replica's own
|
|
750
|
+
* index is checked too: any unsynced entry (written after the delete erased
|
|
751
|
+
* the covered ones), or a synced one at or above the failed tombstone, is a
|
|
752
|
+
* re-add, and a re-add is never deleted again.
|
|
753
|
+
*
|
|
754
|
+
* Bounded by the tracker: attempts back off exponentially, and after the
|
|
755
|
+
* last one the scope is logged as an error and reported in the tracker's
|
|
756
|
+
* `failed` list. Its markers stay queued (nothing is freed while the scope
|
|
757
|
+
* is live) and drain if a later delete of the scope becomes final.
|
|
758
|
+
*/
|
|
759
|
+
async function resubmitRolledBackDeletion(deps, scope, rollback, scopeMarkers) {
|
|
760
|
+
const { logger, tombstoneResubmits: tracker } = deps;
|
|
761
|
+
const failedVersion = rollback.tombstoneVersion;
|
|
762
|
+
if (!deps.resubmitDeletion || !tracker) {
|
|
763
|
+
logger.warn({ scope, tombstoneVersion: failedVersion }, "Scope tombstone failed and the scope is live again; its storage copies stay until the scope is deleted again");
|
|
764
|
+
return;
|
|
765
|
+
}
|
|
766
|
+
const remembered = scopeMarkers.find((marker) => marker.version === null &&
|
|
767
|
+
marker.range &&
|
|
768
|
+
BigInt(marker.range.to) === BigInt(failedVersion) &&
|
|
769
|
+
marker.replacedHead)?.replacedHead;
|
|
770
|
+
if (readdedLocally(deps.storage, scope, failedVersion)) {
|
|
771
|
+
logger.info({ scope, tombstoneVersion: failedVersion }, "Scope tombstone failed, but the scope was re-added after the delete; not deleting it again");
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
774
|
+
if (tracker.exhausted(scope))
|
|
775
|
+
return;
|
|
776
|
+
if (!remembered || !sameHead(remembered, rollback.head)) {
|
|
777
|
+
// The user's delete did not happen and the scope is live again, but the
|
|
778
|
+
// restored head may be newer data, so it is not deleted automatically.
|
|
779
|
+
// Report it once, so no surface shows the scope as deleted.
|
|
780
|
+
const state = tracker.giveUp(scope, failedVersion, "head-changed");
|
|
781
|
+
logger.error({
|
|
782
|
+
scope,
|
|
783
|
+
tombstoneVersion: failedVersion,
|
|
784
|
+
head: rollback.head.expectedVersion,
|
|
785
|
+
remembered: remembered?.expectedVersion ?? null,
|
|
786
|
+
}, "Scope deletion did not complete: the gateway tombstone failed and the restored head is not the one the delete replaced, so it is not deleted again automatically. Delete it again to retry.");
|
|
787
|
+
deps.onDeletionAbandoned?.(state);
|
|
788
|
+
return;
|
|
789
|
+
}
|
|
790
|
+
if (tracker.outOfAttempts(scope)) {
|
|
791
|
+
const state = tracker.giveUp(scope, failedVersion);
|
|
792
|
+
logger.error({
|
|
793
|
+
scope,
|
|
794
|
+
attempts: state.attempts,
|
|
795
|
+
tombstoneVersion: failedVersion,
|
|
796
|
+
}, "Scope deletion did not complete: every gateway tombstone failed and the scope is live again. Delete it again to retry.");
|
|
797
|
+
deps.onDeletionAbandoned?.(state);
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
if (!tracker.due(scope))
|
|
801
|
+
return;
|
|
802
|
+
const attempt = tracker.recordAttempt(scope, failedVersion);
|
|
803
|
+
logger.warn({ scope, tombstoneVersion: failedVersion, attempt }, "Scope tombstone failed and the scope is live again; re-submitting the user's delete");
|
|
804
|
+
try {
|
|
805
|
+
const outcome = await deps.resubmitDeletion(scope, {
|
|
806
|
+
fence: { head: rollback.head },
|
|
807
|
+
storagePass: false,
|
|
808
|
+
});
|
|
809
|
+
if (outcome.steps.gateway.status === "failed") {
|
|
810
|
+
logger.warn({ scope, attempt, error: outcome.steps.gateway.error }, "Re-submitted scope delete was refused by the gateway; will retry");
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
catch (err) {
|
|
814
|
+
logger.warn({ scope, attempt, error: errorMessage(err) }, "Re-submitted scope delete failed; will retry");
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
/** Whether this replica holds data of `scope` the failed delete did not cover. */
|
|
818
|
+
function readdedLocally(storage, scope, failedVersion) {
|
|
819
|
+
// Without a local index nothing proves the scope was not re-added.
|
|
820
|
+
if (!storage)
|
|
821
|
+
return true;
|
|
822
|
+
const failed = BigInt(failedVersion);
|
|
823
|
+
const PAGE_SIZE = 500;
|
|
824
|
+
for (let offset = 0;; offset += PAGE_SIZE) {
|
|
825
|
+
const entries = storage.listVersions(scope, { limit: PAGE_SIZE, offset });
|
|
826
|
+
for (const entry of entries) {
|
|
827
|
+
if (entry.dataPointId === null)
|
|
828
|
+
return true;
|
|
829
|
+
if (BigInt(entry.version) >= failed)
|
|
830
|
+
return true;
|
|
831
|
+
}
|
|
832
|
+
if (entries.length < PAGE_SIZE)
|
|
833
|
+
return false;
|
|
834
|
+
}
|
|
835
|
+
}
|
|
442
836
|
/**
|
|
443
837
|
* What the registry currently says about `scope`. "live" means a row exists
|
|
444
838
|
* that is not a tombstone; "deleted" carries the tombstone's version;
|
|
@@ -446,6 +840,31 @@ export async function retryPendingBlobDeletions(deps) {
|
|
|
446
840
|
* wired) or the row is gone.
|
|
447
841
|
*/
|
|
448
842
|
async function registryState(deps, scope) {
|
|
843
|
+
// The gateway refuses an unsigned read of a reserved point; ask the port.
|
|
844
|
+
if (isGatewayReservedScope(scope) &&
|
|
845
|
+
deps.deleteData?.head &&
|
|
846
|
+
deps.serverOwner) {
|
|
847
|
+
let head;
|
|
848
|
+
try {
|
|
849
|
+
head = await deps.deleteData.head(scope);
|
|
850
|
+
}
|
|
851
|
+
catch (err) {
|
|
852
|
+
return {
|
|
853
|
+
status: "unknown",
|
|
854
|
+
error: err instanceof Error ? err : new Error(String(err)),
|
|
855
|
+
};
|
|
856
|
+
}
|
|
857
|
+
if (head === null)
|
|
858
|
+
return { status: "deleted-or-absent" };
|
|
859
|
+
if (head.deletedAt === null) {
|
|
860
|
+
return {
|
|
861
|
+
status: "live",
|
|
862
|
+
id: computeDataPointId(deps.serverOwner, scope),
|
|
863
|
+
expectedVersion: head.expectedVersion,
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
return { status: "deleted", version: tombstoneVersion(head) };
|
|
867
|
+
}
|
|
449
868
|
if (!deps.dataPointFeed || !deps.serverOwner) {
|
|
450
869
|
return { status: "deleted-or-absent" };
|
|
451
870
|
}
|
|
@@ -464,8 +883,13 @@ async function registryState(deps, scope) {
|
|
|
464
883
|
}
|
|
465
884
|
if (record === null)
|
|
466
885
|
return { status: "deleted-or-absent" };
|
|
467
|
-
if (deletionTimestamp(record) === null)
|
|
468
|
-
return {
|
|
886
|
+
if (deletionTimestamp(record) === null) {
|
|
887
|
+
return {
|
|
888
|
+
status: "live",
|
|
889
|
+
id: record.id,
|
|
890
|
+
expectedVersion: record.expectedVersion,
|
|
891
|
+
};
|
|
892
|
+
}
|
|
469
893
|
return { status: "deleted", version: tombstoneVersion(record) };
|
|
470
894
|
}
|
|
471
895
|
function errorMessage(err) {
|