@aigne/afs-did-space 1.12.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +26 -0
- package/README.md +129 -0
- package/dist/_virtual/_@oxc-project_runtime@0.108.0/helpers/decorate.cjs +11 -0
- package/dist/_virtual/_@oxc-project_runtime@0.108.0/helpers/decorate.mjs +10 -0
- package/dist/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/afs-metadata-context.cjs +20 -0
- package/dist/afs-metadata-context.d.cts +21 -0
- package/dist/afs-metadata-context.d.cts.map +1 -0
- package/dist/afs-metadata-context.d.mts +21 -0
- package/dist/afs-metadata-context.d.mts.map +1 -0
- package/dist/afs-metadata-context.mjs +18 -0
- package/dist/afs-metadata-context.mjs.map +1 -0
- package/dist/blocklet-hook.cjs +180 -0
- package/dist/blocklet-hook.d.cts +29 -0
- package/dist/blocklet-hook.d.cts.map +1 -0
- package/dist/blocklet-hook.d.mts +29 -0
- package/dist/blocklet-hook.d.mts.map +1 -0
- package/dist/blocklet-hook.mjs +178 -0
- package/dist/blocklet-hook.mjs.map +1 -0
- package/dist/changelog-schema.cjs +603 -0
- package/dist/changelog-schema.d.cts +395 -0
- package/dist/changelog-schema.d.cts.map +1 -0
- package/dist/changelog-schema.d.mts +395 -0
- package/dist/changelog-schema.d.mts.map +1 -0
- package/dist/changelog-schema.mjs +570 -0
- package/dist/changelog-schema.mjs.map +1 -0
- package/dist/changelog-write.cjs +80 -0
- package/dist/changelog-write.d.cts +70 -0
- package/dist/changelog-write.d.cts.map +1 -0
- package/dist/changelog-write.d.mts +70 -0
- package/dist/changelog-write.d.mts.map +1 -0
- package/dist/changelog-write.mjs +77 -0
- package/dist/changelog-write.mjs.map +1 -0
- package/dist/cid-byte-cache.cjs +126 -0
- package/dist/cid-byte-cache.d.cts +46 -0
- package/dist/cid-byte-cache.d.cts.map +1 -0
- package/dist/cid-byte-cache.d.mts +47 -0
- package/dist/cid-byte-cache.d.mts.map +1 -0
- package/dist/cid-byte-cache.mjs +125 -0
- package/dist/cid-byte-cache.mjs.map +1 -0
- package/dist/cid.cjs +68 -0
- package/dist/cid.d.cts +22 -0
- package/dist/cid.d.cts.map +1 -0
- package/dist/cid.d.mts +22 -0
- package/dist/cid.d.mts.map +1 -0
- package/dist/cid.mjs +65 -0
- package/dist/cid.mjs.map +1 -0
- package/dist/client.cjs +221 -0
- package/dist/client.d.cts +72 -0
- package/dist/client.d.cts.map +1 -0
- package/dist/client.d.mts +72 -0
- package/dist/client.d.mts.map +1 -0
- package/dist/client.mjs +220 -0
- package/dist/client.mjs.map +1 -0
- package/dist/cloudflare.cjs +510 -0
- package/dist/cloudflare.d.cts +307 -0
- package/dist/cloudflare.d.cts.map +1 -0
- package/dist/cloudflare.d.mts +308 -0
- package/dist/cloudflare.d.mts.map +1 -0
- package/dist/cloudflare.mjs +507 -0
- package/dist/cloudflare.mjs.map +1 -0
- package/dist/ctime-backfill.cjs +272 -0
- package/dist/ctime-backfill.d.cts +169 -0
- package/dist/ctime-backfill.d.cts.map +1 -0
- package/dist/ctime-backfill.d.mts +169 -0
- package/dist/ctime-backfill.d.mts.map +1 -0
- package/dist/ctime-backfill.mjs +267 -0
- package/dist/ctime-backfill.mjs.map +1 -0
- package/dist/d1-gc-queue.cjs +80 -0
- package/dist/d1-gc-queue.d.cts +59 -0
- package/dist/d1-gc-queue.d.cts.map +1 -0
- package/dist/d1-gc-queue.d.mts +59 -0
- package/dist/d1-gc-queue.d.mts.map +1 -0
- package/dist/d1-gc-queue.mjs +81 -0
- package/dist/d1-gc-queue.mjs.map +1 -0
- package/dist/d1-resolve-store.cjs +189 -0
- package/dist/d1-resolve-store.d.cts +93 -0
- package/dist/d1-resolve-store.d.cts.map +1 -0
- package/dist/d1-resolve-store.d.mts +93 -0
- package/dist/d1-resolve-store.d.mts.map +1 -0
- package/dist/d1-resolve-store.mjs +190 -0
- package/dist/d1-resolve-store.mjs.map +1 -0
- package/dist/d1-schema.cjs +361 -0
- package/dist/d1-schema.d.cts +237 -0
- package/dist/d1-schema.d.cts.map +1 -0
- package/dist/d1-schema.d.mts +237 -0
- package/dist/d1-schema.d.mts.map +1 -0
- package/dist/d1-schema.mjs +341 -0
- package/dist/d1-schema.mjs.map +1 -0
- package/dist/d1-share-store.cjs +0 -0
- package/dist/d1-share-store.d.cts +53 -0
- package/dist/d1-share-store.d.cts.map +1 -0
- package/dist/d1-share-store.d.mts +53 -0
- package/dist/d1-share-store.d.mts.map +1 -0
- package/dist/d1-share-store.mjs +0 -0
- package/dist/d1-share-store.mjs.map +1 -0
- package/dist/d1-tree-index.cjs +1098 -0
- package/dist/d1-tree-index.d.cts +203 -0
- package/dist/d1-tree-index.d.cts.map +1 -0
- package/dist/d1-tree-index.d.mts +203 -0
- package/dist/d1-tree-index.d.mts.map +1 -0
- package/dist/d1-tree-index.mjs +1094 -0
- package/dist/d1-tree-index.mjs.map +1 -0
- package/dist/data-backend.cjs +147 -0
- package/dist/data-backend.d.cts +30 -0
- package/dist/data-backend.d.cts.map +1 -0
- package/dist/data-backend.d.mts +30 -0
- package/dist/data-backend.d.mts.map +1 -0
- package/dist/data-backend.mjs +148 -0
- package/dist/data-backend.mjs.map +1 -0
- package/dist/dedup-backfill.cjs +278 -0
- package/dist/dedup-backfill.d.cts +165 -0
- package/dist/dedup-backfill.d.cts.map +1 -0
- package/dist/dedup-backfill.d.mts +165 -0
- package/dist/dedup-backfill.d.mts.map +1 -0
- package/dist/dedup-backfill.mjs +273 -0
- package/dist/dedup-backfill.mjs.map +1 -0
- package/dist/did-space-like.d.cts +2 -0
- package/dist/did-space-like.d.mts +2 -0
- package/dist/did-utils.cjs +44 -0
- package/dist/did-utils.d.cts +25 -0
- package/dist/did-utils.d.cts.map +1 -0
- package/dist/did-utils.d.mts +25 -0
- package/dist/did-utils.d.mts.map +1 -0
- package/dist/did-utils.mjs +43 -0
- package/dist/did-utils.mjs.map +1 -0
- package/dist/dirty-path-queue.cjs +31 -0
- package/dist/dirty-path-queue.d.cts +104 -0
- package/dist/dirty-path-queue.d.cts.map +1 -0
- package/dist/dirty-path-queue.d.mts +104 -0
- package/dist/dirty-path-queue.d.mts.map +1 -0
- package/dist/dirty-path-queue.mjs +31 -0
- package/dist/dirty-path-queue.mjs.map +1 -0
- package/dist/dirty-path-schema.cjs +142 -0
- package/dist/dirty-path-schema.d.cts +90 -0
- package/dist/dirty-path-schema.d.cts.map +1 -0
- package/dist/dirty-path-schema.d.mts +90 -0
- package/dist/dirty-path-schema.d.mts.map +1 -0
- package/dist/dirty-path-schema.mjs +136 -0
- package/dist/dirty-path-schema.mjs.map +1 -0
- package/dist/download-actions.cjs +43 -0
- package/dist/download-actions.mjs +40 -0
- package/dist/download-actions.mjs.map +1 -0
- package/dist/fs-object-store.cjs +153 -0
- package/dist/fs-object-store.d.cts +21 -0
- package/dist/fs-object-store.d.cts.map +1 -0
- package/dist/fs-object-store.d.mts +22 -0
- package/dist/fs-object-store.d.mts.map +1 -0
- package/dist/fs-object-store.mjs +153 -0
- package/dist/fs-object-store.mjs.map +1 -0
- package/dist/gc-queue.d.cts +43 -0
- package/dist/gc-queue.d.cts.map +1 -0
- package/dist/gc-queue.d.mts +43 -0
- package/dist/gc-queue.d.mts.map +1 -0
- package/dist/index.cjs +2712 -0
- package/dist/index.d.cts +504 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +505 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2537 -0
- package/dist/index.mjs.map +1 -0
- package/dist/inline-content-migration.cjs +212 -0
- package/dist/inline-content-migration.d.cts +110 -0
- package/dist/inline-content-migration.d.cts.map +1 -0
- package/dist/inline-content-migration.d.mts +111 -0
- package/dist/inline-content-migration.d.mts.map +1 -0
- package/dist/inline-content-migration.mjs +207 -0
- package/dist/inline-content-migration.mjs.map +1 -0
- package/dist/inline-content.cjs +145 -0
- package/dist/inline-content.d.cts +98 -0
- package/dist/inline-content.d.cts.map +1 -0
- package/dist/inline-content.d.mts +98 -0
- package/dist/inline-content.d.mts.map +1 -0
- package/dist/inline-content.mjs +137 -0
- package/dist/inline-content.mjs.map +1 -0
- package/dist/local-changelog.cjs +241 -0
- package/dist/local-changelog.d.cts +119 -0
- package/dist/local-changelog.d.cts.map +1 -0
- package/dist/local-changelog.d.mts +119 -0
- package/dist/local-changelog.d.mts.map +1 -0
- package/dist/local-changelog.mjs +240 -0
- package/dist/local-changelog.mjs.map +1 -0
- package/dist/local.cjs +435 -0
- package/dist/local.d.cts +254 -0
- package/dist/local.d.cts.map +1 -0
- package/dist/local.d.mts +254 -0
- package/dist/local.d.mts.map +1 -0
- package/dist/local.mjs +427 -0
- package/dist/local.mjs.map +1 -0
- package/dist/memory-gc-queue.cjs +36 -0
- package/dist/memory-gc-queue.d.cts +22 -0
- package/dist/memory-gc-queue.d.cts.map +1 -0
- package/dist/memory-gc-queue.d.mts +22 -0
- package/dist/memory-gc-queue.d.mts.map +1 -0
- package/dist/memory-gc-queue.mjs +36 -0
- package/dist/memory-gc-queue.mjs.map +1 -0
- package/dist/memory-tree-index.cjs +734 -0
- package/dist/memory-tree-index.d.cts +159 -0
- package/dist/memory-tree-index.d.cts.map +1 -0
- package/dist/memory-tree-index.d.mts +159 -0
- package/dist/memory-tree-index.d.mts.map +1 -0
- package/dist/memory-tree-index.mjs +735 -0
- package/dist/memory-tree-index.mjs.map +1 -0
- package/dist/metadata-db.cjs +562 -0
- package/dist/metadata-db.d.cts +102 -0
- package/dist/metadata-db.d.cts.map +1 -0
- package/dist/metadata-db.d.mts +102 -0
- package/dist/metadata-db.d.mts.map +1 -0
- package/dist/metadata-db.mjs +562 -0
- package/dist/metadata-db.mjs.map +1 -0
- package/dist/mime-utils.cjs +2 -0
- package/dist/mime-utils.d.cts +2 -0
- package/dist/mime-utils.d.mts +2 -0
- package/dist/mime-utils.mjs +3 -0
- package/dist/object-key.cjs +41 -0
- package/dist/object-key.d.cts +25 -0
- package/dist/object-key.d.cts.map +1 -0
- package/dist/object-key.d.mts +25 -0
- package/dist/object-key.d.mts.map +1 -0
- package/dist/object-key.mjs +40 -0
- package/dist/object-key.mjs.map +1 -0
- package/dist/packages/session/dist/index.cjs +788 -0
- package/dist/packages/session/dist/index.mjs +782 -0
- package/dist/packages/session/dist/index.mjs.map +1 -0
- package/dist/platform/r2/dist/types.d.cts +49 -0
- package/dist/platform/r2/dist/types.d.cts.map +1 -0
- package/dist/prefix-range.cjs +33 -0
- package/dist/prefix-range.d.cts +29 -0
- package/dist/prefix-range.d.cts.map +1 -0
- package/dist/prefix-range.d.mts +29 -0
- package/dist/prefix-range.d.mts.map +1 -0
- package/dist/prefix-range.mjs +33 -0
- package/dist/prefix-range.mjs.map +1 -0
- package/dist/prefixed-tree-index.cjs +238 -0
- package/dist/prefixed-tree-index.d.cts +85 -0
- package/dist/prefixed-tree-index.d.cts.map +1 -0
- package/dist/prefixed-tree-index.d.mts +85 -0
- package/dist/prefixed-tree-index.d.mts.map +1 -0
- package/dist/prefixed-tree-index.mjs +239 -0
- package/dist/prefixed-tree-index.mjs.map +1 -0
- package/dist/presign-signer.cjs +7 -0
- package/dist/presign-signer.d.cts +99 -0
- package/dist/presign-signer.d.cts.map +1 -0
- package/dist/presign-signer.d.mts +99 -0
- package/dist/presign-signer.d.mts.map +1 -0
- package/dist/presign-signer.mjs +7 -0
- package/dist/presign-signer.mjs.map +1 -0
- package/dist/providers/platform/r2/dist/index.d.mts +3 -0
- package/dist/providers/platform/r2/dist/types.d.mts +49 -0
- package/dist/providers/platform/r2/dist/types.d.mts.map +1 -0
- package/dist/reconcile.cjs +184 -0
- package/dist/reconcile.d.cts +26 -0
- package/dist/reconcile.d.cts.map +1 -0
- package/dist/reconcile.d.mts +26 -0
- package/dist/reconcile.d.mts.map +1 -0
- package/dist/reconcile.mjs +184 -0
- package/dist/reconcile.mjs.map +1 -0
- package/dist/reference-check.cjs +49 -0
- package/dist/reference-check.d.cts +10 -0
- package/dist/reference-check.d.cts.map +1 -0
- package/dist/reference-check.d.mts +10 -0
- package/dist/reference-check.d.mts.map +1 -0
- package/dist/reference-check.mjs +48 -0
- package/dist/reference-check.mjs.map +1 -0
- package/dist/remote-afs.cjs +681 -0
- package/dist/remote-afs.d.cts +236 -0
- package/dist/remote-afs.d.cts.map +1 -0
- package/dist/remote-afs.d.mts +236 -0
- package/dist/remote-afs.d.mts.map +1 -0
- package/dist/remote-afs.mjs +676 -0
- package/dist/remote-afs.mjs.map +1 -0
- package/dist/rename-guard.cjs +18 -0
- package/dist/rename-guard.mjs +18 -0
- package/dist/rename-guard.mjs.map +1 -0
- package/dist/resolve.cjs +260 -0
- package/dist/resolve.d.cts +113 -0
- package/dist/resolve.d.cts.map +1 -0
- package/dist/resolve.d.mts +113 -0
- package/dist/resolve.d.mts.map +1 -0
- package/dist/resolve.mjs +260 -0
- package/dist/resolve.mjs.map +1 -0
- package/dist/rsync-content.cjs +33 -0
- package/dist/rsync-content.mjs +33 -0
- package/dist/rsync-content.mjs.map +1 -0
- package/dist/rsync.cjs +400 -0
- package/dist/rsync.d.cts +157 -0
- package/dist/rsync.d.cts.map +1 -0
- package/dist/rsync.d.mts +157 -0
- package/dist/rsync.d.mts.map +1 -0
- package/dist/rsync.mjs +397 -0
- package/dist/rsync.mjs.map +1 -0
- package/dist/run-gc.cjs +57 -0
- package/dist/run-gc.d.cts +40 -0
- package/dist/run-gc.d.cts.map +1 -0
- package/dist/run-gc.d.mts +41 -0
- package/dist/run-gc.d.mts.map +1 -0
- package/dist/run-gc.mjs +57 -0
- package/dist/run-gc.mjs.map +1 -0
- package/dist/scope-id.cjs +70 -0
- package/dist/scope-id.d.cts +35 -0
- package/dist/scope-id.d.cts.map +1 -0
- package/dist/scope-id.d.mts +35 -0
- package/dist/scope-id.d.mts.map +1 -0
- package/dist/scope-id.mjs +68 -0
- package/dist/scope-id.mjs.map +1 -0
- package/dist/scope-migration-node.cjs +172 -0
- package/dist/scope-migration-node.d.cts +44 -0
- package/dist/scope-migration-node.d.cts.map +1 -0
- package/dist/scope-migration-node.d.mts +44 -0
- package/dist/scope-migration-node.d.mts.map +1 -0
- package/dist/scope-migration-node.mjs +171 -0
- package/dist/scope-migration-node.mjs.map +1 -0
- package/dist/scope-migration.cjs +155 -0
- package/dist/scope-migration.d.cts +65 -0
- package/dist/scope-migration.d.cts.map +1 -0
- package/dist/scope-migration.d.mts +65 -0
- package/dist/scope-migration.d.mts.map +1 -0
- package/dist/scope-migration.mjs +154 -0
- package/dist/scope-migration.mjs.map +1 -0
- package/dist/share-declaration.cjs +225 -0
- package/dist/share-declaration.d.cts +30 -0
- package/dist/share-declaration.d.cts.map +1 -0
- package/dist/share-declaration.d.mts +32 -0
- package/dist/share-declaration.d.mts.map +1 -0
- package/dist/share-declaration.mjs +221 -0
- package/dist/share-declaration.mjs.map +1 -0
- package/dist/share-hook.cjs +63 -0
- package/dist/share-hook.mjs +62 -0
- package/dist/share-hook.mjs.map +1 -0
- package/dist/share-resolve.cjs +176 -0
- package/dist/share-resolve.d.cts +36 -0
- package/dist/share-resolve.d.cts.map +1 -0
- package/dist/share-resolve.d.mts +36 -0
- package/dist/share-resolve.d.mts.map +1 -0
- package/dist/share-resolve.mjs +177 -0
- package/dist/share-resolve.mjs.map +1 -0
- package/dist/share-serve.cjs +145 -0
- package/dist/share-serve.d.cts +30 -0
- package/dist/share-serve.d.cts.map +1 -0
- package/dist/share-serve.d.mts +30 -0
- package/dist/share-serve.d.mts.map +1 -0
- package/dist/share-serve.mjs +144 -0
- package/dist/share-serve.mjs.map +1 -0
- package/dist/share-store.cjs +25 -0
- package/dist/share-store.d.cts +65 -0
- package/dist/share-store.d.cts.map +1 -0
- package/dist/share-store.d.mts +65 -0
- package/dist/share-store.d.mts.map +1 -0
- package/dist/share-store.mjs +25 -0
- package/dist/share-store.mjs.map +1 -0
- package/dist/share-virtual-path.cjs +102 -0
- package/dist/share-virtual-path.mjs +101 -0
- package/dist/share-virtual-path.mjs.map +1 -0
- package/dist/space-resolver.cjs +54 -0
- package/dist/space-resolver.d.cts +34 -0
- package/dist/space-resolver.d.cts.map +1 -0
- package/dist/space-resolver.d.mts +34 -0
- package/dist/space-resolver.d.mts.map +1 -0
- package/dist/space-resolver.mjs +55 -0
- package/dist/space-resolver.mjs.map +1 -0
- package/dist/sqlite-gc-queue.cjs +51 -0
- package/dist/sqlite-gc-queue.d.cts +22 -0
- package/dist/sqlite-gc-queue.d.cts.map +1 -0
- package/dist/sqlite-gc-queue.d.mts +22 -0
- package/dist/sqlite-gc-queue.d.mts.map +1 -0
- package/dist/sqlite-gc-queue.mjs +52 -0
- package/dist/sqlite-gc-queue.mjs.map +1 -0
- package/dist/sqlite-resolve-store.cjs +163 -0
- package/dist/sqlite-resolve-store.d.cts +50 -0
- package/dist/sqlite-resolve-store.d.cts.map +1 -0
- package/dist/sqlite-resolve-store.d.mts +50 -0
- package/dist/sqlite-resolve-store.d.mts.map +1 -0
- package/dist/sqlite-resolve-store.mjs +164 -0
- package/dist/sqlite-resolve-store.mjs.map +1 -0
- package/dist/sqlite-share-store.cjs +157 -0
- package/dist/sqlite-share-store.d.cts +31 -0
- package/dist/sqlite-share-store.d.cts.map +1 -0
- package/dist/sqlite-share-store.d.mts +31 -0
- package/dist/sqlite-share-store.d.mts.map +1 -0
- package/dist/sqlite-share-store.mjs +157 -0
- package/dist/sqlite-share-store.mjs.map +1 -0
- package/dist/sqlite-tree-index.cjs +901 -0
- package/dist/sqlite-tree-index.d.cts +107 -0
- package/dist/sqlite-tree-index.d.cts.map +1 -0
- package/dist/sqlite-tree-index.d.mts +107 -0
- package/dist/sqlite-tree-index.d.mts.map +1 -0
- package/dist/sqlite-tree-index.mjs +902 -0
- package/dist/sqlite-tree-index.mjs.map +1 -0
- package/dist/sync-engine.cjs +1324 -0
- package/dist/sync-engine.d.cts +473 -0
- package/dist/sync-engine.d.cts.map +1 -0
- package/dist/sync-engine.d.mts +473 -0
- package/dist/sync-engine.d.mts.map +1 -0
- package/dist/sync-engine.mjs +1315 -0
- package/dist/sync-engine.mjs.map +1 -0
- package/dist/sync-state.cjs +303 -0
- package/dist/sync-state.d.cts +224 -0
- package/dist/sync-state.d.cts.map +1 -0
- package/dist/sync-state.d.mts +224 -0
- package/dist/sync-state.d.mts.map +1 -0
- package/dist/sync-state.mjs +297 -0
- package/dist/sync-state.mjs.map +1 -0
- package/dist/timestamp.cjs +92 -0
- package/dist/timestamp.mjs +91 -0
- package/dist/timestamp.mjs.map +1 -0
- package/dist/transports/http.cjs +54 -0
- package/dist/transports/http.d.cts +26 -0
- package/dist/transports/http.d.cts.map +1 -0
- package/dist/transports/http.d.mts +26 -0
- package/dist/transports/http.d.mts.map +1 -0
- package/dist/transports/http.mjs +54 -0
- package/dist/transports/http.mjs.map +1 -0
- package/dist/transports/static.cjs +55 -0
- package/dist/transports/static.d.cts +28 -0
- package/dist/transports/static.d.cts.map +1 -0
- package/dist/transports/static.d.mts +28 -0
- package/dist/transports/static.d.mts.map +1 -0
- package/dist/transports/static.mjs +55 -0
- package/dist/transports/static.mjs.map +1 -0
- package/dist/transports/types.cjs +13 -0
- package/dist/transports/types.d.cts +72 -0
- package/dist/transports/types.d.cts.map +1 -0
- package/dist/transports/types.d.mts +72 -0
- package/dist/transports/types.d.mts.map +1 -0
- package/dist/transports/types.mjs +13 -0
- package/dist/transports/types.mjs.map +1 -0
- package/dist/transports/ws.cjs +207 -0
- package/dist/transports/ws.d.cts +47 -0
- package/dist/transports/ws.d.cts.map +1 -0
- package/dist/transports/ws.d.mts +47 -0
- package/dist/transports/ws.d.mts.map +1 -0
- package/dist/transports/ws.mjs +206 -0
- package/dist/transports/ws.mjs.map +1 -0
- package/dist/tree-index.cjs +333 -0
- package/dist/tree-index.d.cts +524 -0
- package/dist/tree-index.d.cts.map +1 -0
- package/dist/tree-index.d.mts +524 -0
- package/dist/tree-index.d.mts.map +1 -0
- package/dist/tree-index.mjs +322 -0
- package/dist/tree-index.mjs.map +1 -0
- package/dist/tree-query.cjs +655 -0
- package/dist/tree-query.d.cts +70 -0
- package/dist/tree-query.d.cts.map +1 -0
- package/dist/tree-query.d.mts +70 -0
- package/dist/tree-query.d.mts.map +1 -0
- package/dist/tree-query.mjs +648 -0
- package/dist/tree-query.mjs.map +1 -0
- package/dist/upload-actions.cjs +97 -0
- package/dist/upload-actions.d.cts +19 -0
- package/dist/upload-actions.d.cts.map +1 -0
- package/dist/upload-actions.d.mts +21 -0
- package/dist/upload-actions.d.mts.map +1 -0
- package/dist/upload-actions.mjs +90 -0
- package/dist/upload-actions.mjs.map +1 -0
- package/dist/upload-session-store.cjs +185 -0
- package/dist/upload-session-store.d.cts +99 -0
- package/dist/upload-session-store.d.cts.map +1 -0
- package/dist/upload-session-store.d.mts +99 -0
- package/dist/upload-session-store.d.mts.map +1 -0
- package/dist/upload-session-store.mjs +184 -0
- package/dist/upload-session-store.mjs.map +1 -0
- package/dist/url-normalize.cjs +61 -0
- package/dist/url-normalize.d.cts +33 -0
- package/dist/url-normalize.d.cts.map +1 -0
- package/dist/url-normalize.d.mts +33 -0
- package/dist/url-normalize.d.mts.map +1 -0
- package/dist/url-normalize.mjs +61 -0
- package/dist/url-normalize.mjs.map +1 -0
- package/dist/versioned-content-backends.cjs +155 -0
- package/dist/versioned-content-backends.d.cts +49 -0
- package/dist/versioned-content-backends.d.cts.map +1 -0
- package/dist/versioned-content-backends.d.mts +49 -0
- package/dist/versioned-content-backends.d.mts.map +1 -0
- package/dist/versioned-content-backends.mjs +154 -0
- package/dist/versioned-content-backends.mjs.map +1 -0
- package/dist/versioned-content-index.cjs +102 -0
- package/dist/versioned-content-index.d.cts +46 -0
- package/dist/versioned-content-index.d.cts.map +1 -0
- package/dist/versioned-content-index.d.mts +46 -0
- package/dist/versioned-content-index.d.mts.map +1 -0
- package/dist/versioned-content-index.mjs +103 -0
- package/dist/versioned-content-index.mjs.map +1 -0
- package/dist/versioned-content-store.cjs +121 -0
- package/dist/versioned-content-store.d.cts +90 -0
- package/dist/versioned-content-store.d.cts.map +1 -0
- package/dist/versioned-content-store.d.mts +90 -0
- package/dist/versioned-content-store.d.mts.map +1 -0
- package/dist/versioned-content-store.mjs +122 -0
- package/dist/versioned-content-store.mjs.map +1 -0
- package/dist/versioned-scope.cjs +39 -0
- package/dist/versioned-scope.d.cts +57 -0
- package/dist/versioned-scope.d.cts.map +1 -0
- package/dist/versioned-scope.d.mts +57 -0
- package/dist/versioned-scope.d.mts.map +1 -0
- package/dist/versioned-scope.mjs +37 -0
- package/dist/versioned-scope.mjs.map +1 -0
- package/migrations/0001_tree_entries.sql +17 -0
- package/migrations/0002_resolve_entries.sql +7 -0
- package/migrations/0003_entries_v2.sql +38 -0
- package/migrations/0004_gc_queue.sql +5 -0
- package/migrations/0006_resolve_enhance.sql +14 -0
- package/migrations/0007_resolve_created_at.sql +10 -0
- package/migrations/0008_changelog.sql +34 -0
- package/migrations/0009_device_sync_state.sql +29 -0
- package/migrations/0010_scope_meta.sql +33 -0
- package/migrations/0011_shares.sql +25 -0
- package/migrations/0012_scope_meta_file_count.sql +41 -0
- package/migrations/0013_scope_meta_total_bytes.sql +47 -0
- package/migrations/0014_rename_tables.sql +62 -0
- package/package.json +102 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
const require_tree_index = require('./tree-index.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/prefixed-tree-index.ts
|
|
4
|
+
var PrefixedTreeIndex = class {
|
|
5
|
+
constructor(inner, prefix) {
|
|
6
|
+
this.inner = inner;
|
|
7
|
+
this.prefix = prefix;
|
|
8
|
+
}
|
|
9
|
+
async get(path, opts) {
|
|
10
|
+
return this.inner.get(this.prefix + path, opts);
|
|
11
|
+
}
|
|
12
|
+
async getDirTimes(dirPath) {
|
|
13
|
+
return await this.inner.getDirTimes?.(this.prefix + dirPath) ?? null;
|
|
14
|
+
}
|
|
15
|
+
async put(path, entry, opts) {
|
|
16
|
+
const prefixed = entry.dedupScope != null ? {
|
|
17
|
+
...entry,
|
|
18
|
+
dedupScope: this.prefix + entry.dedupScope
|
|
19
|
+
} : entry;
|
|
20
|
+
return this.inner.put(this.prefix + path, prefixed, opts);
|
|
21
|
+
}
|
|
22
|
+
async delete(path, opts) {
|
|
23
|
+
return this.inner.delete(this.prefix + path, opts);
|
|
24
|
+
}
|
|
25
|
+
/** Dedup lookup (#1159) — prefix the scope in, strip the prefix off the result path. */
|
|
26
|
+
async findByDedupKey(dedupScope, dedupKey) {
|
|
27
|
+
const r = await this.inner.findByDedupKey?.(this.prefix + dedupScope, dedupKey);
|
|
28
|
+
if (!r) return null;
|
|
29
|
+
return {
|
|
30
|
+
...r,
|
|
31
|
+
path: r.path.slice(this.prefix.length)
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/** Dedup reindex seam (#1159) — prefix both the path and the dedup scope. */
|
|
35
|
+
async setDedupKey(path, dedupScope, dedupKey, opts) {
|
|
36
|
+
await this.inner.setDedupKey?.(this.prefix + path, this.prefix + dedupScope, dedupKey, opts);
|
|
37
|
+
}
|
|
38
|
+
async list(listPrefix, options) {
|
|
39
|
+
const result = await this.inner.list(this.prefix + listPrefix, options);
|
|
40
|
+
return {
|
|
41
|
+
entries: result.entries.map((e) => ({ path: e.path.slice(this.prefix.length) })),
|
|
42
|
+
hasMore: result.hasMore,
|
|
43
|
+
cursor: result.cursor
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
async listEntries(listPrefix, options) {
|
|
47
|
+
const result = await this.inner.listEntries(this.prefix + listPrefix, options);
|
|
48
|
+
return {
|
|
49
|
+
entries: result.entries.map((e) => ({
|
|
50
|
+
...e,
|
|
51
|
+
path: e.path.slice(this.prefix.length)
|
|
52
|
+
})),
|
|
53
|
+
hasMore: result.hasMore,
|
|
54
|
+
cursor: result.cursor
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
async hasChildren(listPrefix) {
|
|
58
|
+
return this.inner.hasChildren(this.prefix + listPrefix);
|
|
59
|
+
}
|
|
60
|
+
async getAndHasChildren(filePath, dirPrefix) {
|
|
61
|
+
if (this.inner.getAndHasChildren) return this.inner.getAndHasChildren(this.prefix + filePath, this.prefix + dirPrefix);
|
|
62
|
+
const [entry, hasChildren] = await Promise.all([this.inner.get(this.prefix + filePath), this.inner.hasChildren(this.prefix + dirPrefix)]);
|
|
63
|
+
return [entry, hasChildren];
|
|
64
|
+
}
|
|
65
|
+
async count(listPrefix) {
|
|
66
|
+
return this.inner.count(this.prefix + listPrefix);
|
|
67
|
+
}
|
|
68
|
+
async deleteByPrefix(listPrefix, opts) {
|
|
69
|
+
return this.inner.deleteByPrefix(this.prefix + listPrefix, opts);
|
|
70
|
+
}
|
|
71
|
+
async listChildren(parent, options) {
|
|
72
|
+
const result = await this.inner.listChildren(this.prefix + parent, options);
|
|
73
|
+
return {
|
|
74
|
+
entries: result.entries.map((e) => ({
|
|
75
|
+
...e,
|
|
76
|
+
path: e.path.slice(this.prefix.length)
|
|
77
|
+
})),
|
|
78
|
+
hasMore: result.hasMore,
|
|
79
|
+
cursor: result.cursor
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
async countChildren(parent) {
|
|
83
|
+
return this.inner.countChildren(this.prefix + parent);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Collection query — delegate with the fragment prefix prepended, strip it
|
|
87
|
+
* off result row paths. The prefix is the blocklet-isolation boundary: a
|
|
88
|
+
* fragment can only ever query its own sub-tree.
|
|
89
|
+
*/
|
|
90
|
+
async query(parent, spec) {
|
|
91
|
+
if (!this.inner.query) throw new Error("Collection query is not supported by the underlying index");
|
|
92
|
+
const result = await this.inner.query(this.prefix + parent, spec);
|
|
93
|
+
return {
|
|
94
|
+
...result,
|
|
95
|
+
rows: result.rows.map((r) => ({
|
|
96
|
+
...r,
|
|
97
|
+
path: r.path.slice(this.prefix.length)
|
|
98
|
+
}))
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
async countChildrenMany(parents) {
|
|
102
|
+
const out = /* @__PURE__ */ new Map();
|
|
103
|
+
if (!this.inner.countChildrenMany) {
|
|
104
|
+
for (const p of parents) {
|
|
105
|
+
const cnt = await this.inner.countChildren(this.prefix + p);
|
|
106
|
+
if (cnt > 0) out.set(p, cnt);
|
|
107
|
+
}
|
|
108
|
+
return out;
|
|
109
|
+
}
|
|
110
|
+
const inner = await this.inner.countChildrenMany(parents.map((p) => this.prefix + p));
|
|
111
|
+
for (const [parent, cnt] of inner) out.set(parent.slice(this.prefix.length), cnt);
|
|
112
|
+
return out;
|
|
113
|
+
}
|
|
114
|
+
async aggregate(prefix) {
|
|
115
|
+
return this.inner.aggregate(this.prefix + prefix);
|
|
116
|
+
}
|
|
117
|
+
async putBatch(entries, opts) {
|
|
118
|
+
return this.inner.putBatch(entries.map((e) => ({
|
|
119
|
+
path: this.prefix + e.path,
|
|
120
|
+
entry: e.entry
|
|
121
|
+
})), opts);
|
|
122
|
+
}
|
|
123
|
+
mapPrereadIn(ctx) {
|
|
124
|
+
if (!ctx?.preread) return ctx;
|
|
125
|
+
const inner = /* @__PURE__ */ new Map();
|
|
126
|
+
for (const [k, v] of ctx.preread) inner.set(this.prefix + k, v);
|
|
127
|
+
return {
|
|
128
|
+
...ctx,
|
|
129
|
+
preread: inner
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
async getMany(paths) {
|
|
133
|
+
if (!this.inner.getMany) {
|
|
134
|
+
const map$1 = /* @__PURE__ */ new Map();
|
|
135
|
+
for (const p of paths) map$1.set(p, await this.get(p));
|
|
136
|
+
return map$1;
|
|
137
|
+
}
|
|
138
|
+
const innerMap = await this.inner.getMany(paths.map((p) => this.prefix + p));
|
|
139
|
+
const map = /* @__PURE__ */ new Map();
|
|
140
|
+
for (const p of paths) map.set(p, innerMap.get(this.prefix + p) ?? null);
|
|
141
|
+
return map;
|
|
142
|
+
}
|
|
143
|
+
/** Inline policy is path-independent — delegate straight to the inner index.
|
|
144
|
+
* An inner without inline support resolves to NULL (loop keeps the legacy skip). */
|
|
145
|
+
inlineForEntry(entry) {
|
|
146
|
+
return this.inner.inlineForEntry?.(entry) ?? Promise.resolve(null);
|
|
147
|
+
}
|
|
148
|
+
async batchPutEntries(entries, ctx) {
|
|
149
|
+
if (!this.inner.batchPutEntries) return require_tree_index.loopBatchPutEntries(this, entries, ctx);
|
|
150
|
+
return (await this.inner.batchPutEntries(entries.map((e) => ({
|
|
151
|
+
...e,
|
|
152
|
+
path: this.prefix + e.path
|
|
153
|
+
})), this.mapPrereadIn(ctx))).map((r) => ({
|
|
154
|
+
...r,
|
|
155
|
+
path: r.path.slice(this.prefix.length)
|
|
156
|
+
}));
|
|
157
|
+
}
|
|
158
|
+
async batchDeleteEntries(entries, ctx) {
|
|
159
|
+
if (!this.inner.batchDeleteEntries) return require_tree_index.loopBatchDeleteEntries(this, entries, ctx);
|
|
160
|
+
return (await this.inner.batchDeleteEntries(entries.map((e) => ({
|
|
161
|
+
...e,
|
|
162
|
+
path: this.prefix + e.path
|
|
163
|
+
})), this.mapPrereadIn(ctx))).map((r) => ({
|
|
164
|
+
...r,
|
|
165
|
+
path: r.path.slice(this.prefix.length)
|
|
166
|
+
}));
|
|
167
|
+
}
|
|
168
|
+
async listModifiedSince(prefix, since, options) {
|
|
169
|
+
const result = await this.inner.listModifiedSince(this.prefix + prefix, since, options);
|
|
170
|
+
return {
|
|
171
|
+
entries: result.entries.map((e) => ({
|
|
172
|
+
...e,
|
|
173
|
+
path: e.path.slice(this.prefix.length)
|
|
174
|
+
})),
|
|
175
|
+
hasMore: result.hasMore,
|
|
176
|
+
cursor: result.cursor
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
async getMaxSeq() {
|
|
180
|
+
return this.inner.getMaxSeq();
|
|
181
|
+
}
|
|
182
|
+
async getPrefixWatermark(prefix) {
|
|
183
|
+
if (!this.inner.getPrefixWatermark) return null;
|
|
184
|
+
return this.inner.getPrefixWatermark(this.prefix + prefix);
|
|
185
|
+
}
|
|
186
|
+
async getChangelogSince(sinceSeq, limit) {
|
|
187
|
+
const inner = await this.inner.getChangelogSince(sinceSeq, limit);
|
|
188
|
+
return {
|
|
189
|
+
entries: inner.entries.filter((r) => r.path.startsWith(this.prefix)).map((r) => ({
|
|
190
|
+
...r,
|
|
191
|
+
path: r.path.slice(this.prefix.length)
|
|
192
|
+
})),
|
|
193
|
+
hasMore: inner.hasMore,
|
|
194
|
+
cursor: inner.cursor
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
async getCompactedBelowSeq() {
|
|
198
|
+
return await this.inner.getCompactedBelowSeq?.() ?? 0;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* PREFIX-LOCAL read-auth (design §4.1, P0#2): authorize a cid ONLY when this
|
|
202
|
+
* fragment's own sub-tree references it. Delegates with the fragment prefix
|
|
203
|
+
* prepended, so app A can never read app B's object under the same user by
|
|
204
|
+
* knowing the cid. The unprefixed space-root provider stays whole-scope.
|
|
205
|
+
*/
|
|
206
|
+
async isReferenced(cid, pathPrefix = "") {
|
|
207
|
+
return this.inner.isReferenced(cid, this.prefix + pathPrefix);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* PREFIX-LOCAL batch read-auth (design §7.2): authorize ONLY cids this
|
|
211
|
+
* fragment's own sub-tree references. Same prefix-prepend delegation as the
|
|
212
|
+
* single-cid {@link isReferenced}.
|
|
213
|
+
*/
|
|
214
|
+
async isReferencedMany(cids, pathPrefix = "") {
|
|
215
|
+
return this.inner.isReferencedMany(cids, this.prefix + pathPrefix);
|
|
216
|
+
}
|
|
217
|
+
async listDirtyPaths(options) {
|
|
218
|
+
if (!this.inner.listDirtyPaths) return [];
|
|
219
|
+
return (await this.inner.listDirtyPaths({
|
|
220
|
+
...options,
|
|
221
|
+
prefix: this.prefix + options.prefix
|
|
222
|
+
})).map((r) => ({
|
|
223
|
+
...r,
|
|
224
|
+
path: r.path.slice(this.prefix.length)
|
|
225
|
+
}));
|
|
226
|
+
}
|
|
227
|
+
async ackDirtyPath(path, latestSeq) {
|
|
228
|
+
if (!this.inner.ackDirtyPath) return false;
|
|
229
|
+
return this.inner.ackDirtyPath(this.prefix + path, latestSeq);
|
|
230
|
+
}
|
|
231
|
+
async markDirtyPathError(path, latestSeq, error, nextAttemptAt) {
|
|
232
|
+
if (!this.inner.markDirtyPathError) return false;
|
|
233
|
+
return this.inner.markDirtyPathError(this.prefix + path, latestSeq, error, nextAttemptAt);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
//#endregion
|
|
238
|
+
exports.PrefixedTreeIndex = PrefixedTreeIndex;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { TreeQueryResult, TreeQuerySpec } from "./tree-query.cjs";
|
|
2
|
+
import { DirtyPathRow, ListDirtyPathOptions } from "./dirty-path-queue.cjs";
|
|
3
|
+
import { BatchDeleteEntry, BatchDeleteEntryResult, BatchIndexContext, BatchPutEntry, BatchPutEntryResult, ChangelogEntry, PutOpts, TreeEntry, TreeIndex, TreeIndexListEntriesResult, TreeIndexListOptions, TreeIndexListResult } from "./tree-index.cjs";
|
|
4
|
+
|
|
5
|
+
//#region src/prefixed-tree-index.d.ts
|
|
6
|
+
declare class PrefixedTreeIndex implements TreeIndex {
|
|
7
|
+
private inner;
|
|
8
|
+
private prefix;
|
|
9
|
+
constructor(inner: TreeIndex, prefix: string);
|
|
10
|
+
get(path: string, opts?: {
|
|
11
|
+
includeContent?: boolean;
|
|
12
|
+
}): Promise<TreeEntry | null>;
|
|
13
|
+
getDirTimes(dirPath: string): Promise<{
|
|
14
|
+
ctime: number;
|
|
15
|
+
mtime: number;
|
|
16
|
+
} | null>;
|
|
17
|
+
put(path: string, entry: TreeEntry, opts: PutOpts): Promise<{
|
|
18
|
+
oldCid?: string;
|
|
19
|
+
}>;
|
|
20
|
+
delete(path: string, opts: PutOpts): Promise<void>;
|
|
21
|
+
/** Dedup lookup (#1159) — prefix the scope in, strip the prefix off the result path. */
|
|
22
|
+
findByDedupKey(dedupScope: string, dedupKey: string): Promise<({
|
|
23
|
+
path: string;
|
|
24
|
+
} & TreeEntry) | null>;
|
|
25
|
+
/** Dedup reindex seam (#1159) — prefix both the path and the dedup scope. */
|
|
26
|
+
setDedupKey(path: string, dedupScope: string, dedupKey: string, opts: PutOpts): Promise<void>;
|
|
27
|
+
list(listPrefix: string, options?: TreeIndexListOptions): Promise<TreeIndexListResult>;
|
|
28
|
+
listEntries(listPrefix: string, options?: TreeIndexListOptions): Promise<TreeIndexListEntriesResult>;
|
|
29
|
+
hasChildren(listPrefix: string): Promise<boolean>;
|
|
30
|
+
getAndHasChildren(filePath: string, dirPrefix: string): Promise<[TreeEntry | null, boolean]>;
|
|
31
|
+
count(listPrefix: string): Promise<number>;
|
|
32
|
+
deleteByPrefix(listPrefix: string, opts: PutOpts): Promise<number>;
|
|
33
|
+
listChildren(parent: string, options?: TreeIndexListOptions): Promise<TreeIndexListEntriesResult>;
|
|
34
|
+
countChildren(parent: string): Promise<number>;
|
|
35
|
+
/**
|
|
36
|
+
* Collection query — delegate with the fragment prefix prepended, strip it
|
|
37
|
+
* off result row paths. The prefix is the blocklet-isolation boundary: a
|
|
38
|
+
* fragment can only ever query its own sub-tree.
|
|
39
|
+
*/
|
|
40
|
+
query(parent: string, spec: TreeQuerySpec): Promise<TreeQueryResult>;
|
|
41
|
+
countChildrenMany(parents: string[]): Promise<Map<string, number>>;
|
|
42
|
+
aggregate(prefix: string): Promise<{
|
|
43
|
+
fileCount: number;
|
|
44
|
+
totalSize: number;
|
|
45
|
+
}>;
|
|
46
|
+
putBatch(entries: Array<{
|
|
47
|
+
path: string;
|
|
48
|
+
entry: TreeEntry;
|
|
49
|
+
}>, opts: PutOpts): Promise<void>;
|
|
50
|
+
private mapPrereadIn;
|
|
51
|
+
getMany(paths: string[]): Promise<Map<string, TreeEntry | null>>;
|
|
52
|
+
/** Inline policy is path-independent — delegate straight to the inner index.
|
|
53
|
+
* An inner without inline support resolves to NULL (loop keeps the legacy skip). */
|
|
54
|
+
inlineForEntry(entry: TreeEntry): Promise<string | null>;
|
|
55
|
+
batchPutEntries(entries: BatchPutEntry[], ctx?: BatchIndexContext): Promise<BatchPutEntryResult[]>;
|
|
56
|
+
batchDeleteEntries(entries: BatchDeleteEntry[], ctx?: BatchIndexContext): Promise<BatchDeleteEntryResult[]>;
|
|
57
|
+
listModifiedSince(prefix: string, since: number, options?: TreeIndexListOptions): Promise<TreeIndexListEntriesResult>;
|
|
58
|
+
getMaxSeq(): Promise<number>;
|
|
59
|
+
getPrefixWatermark(prefix: string): Promise<number | null>;
|
|
60
|
+
getChangelogSince(sinceSeq: number, limit: number): Promise<{
|
|
61
|
+
entries: ChangelogEntry[];
|
|
62
|
+
hasMore: boolean;
|
|
63
|
+
cursor: number;
|
|
64
|
+
}>;
|
|
65
|
+
getCompactedBelowSeq(): Promise<number>;
|
|
66
|
+
/**
|
|
67
|
+
* PREFIX-LOCAL read-auth (design §4.1, P0#2): authorize a cid ONLY when this
|
|
68
|
+
* fragment's own sub-tree references it. Delegates with the fragment prefix
|
|
69
|
+
* prepended, so app A can never read app B's object under the same user by
|
|
70
|
+
* knowing the cid. The unprefixed space-root provider stays whole-scope.
|
|
71
|
+
*/
|
|
72
|
+
isReferenced(cid: string, pathPrefix?: string): Promise<boolean>;
|
|
73
|
+
/**
|
|
74
|
+
* PREFIX-LOCAL batch read-auth (design §7.2): authorize ONLY cids this
|
|
75
|
+
* fragment's own sub-tree references. Same prefix-prepend delegation as the
|
|
76
|
+
* single-cid {@link isReferenced}.
|
|
77
|
+
*/
|
|
78
|
+
isReferencedMany(cids: string[], pathPrefix?: string): Promise<Set<string>>;
|
|
79
|
+
listDirtyPaths(options: ListDirtyPathOptions): Promise<DirtyPathRow[]>;
|
|
80
|
+
ackDirtyPath(path: string, latestSeq: number): Promise<boolean>;
|
|
81
|
+
markDirtyPathError(path: string, latestSeq: number, error: string, nextAttemptAt: number): Promise<boolean>;
|
|
82
|
+
}
|
|
83
|
+
//#endregion
|
|
84
|
+
export { PrefixedTreeIndex };
|
|
85
|
+
//# sourceMappingURL=prefixed-tree-index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prefixed-tree-index.d.cts","names":[],"sources":["../src/prefixed-tree-index.ts"],"mappings":";;;;;cAyBa,iBAAA,YAA6B,SAAA;EAAA,QAE9B,KAAA;EAAA,QACA,MAAA;cADA,KAAA,EAAO,SAAA,EACP,MAAA;EAGJ,GAAA,CAAI,IAAA,UAAc,IAAA;IAAS,cAAA;EAAA,IAA6B,OAAA,CAAQ,SAAA;EAIhE,WAAA,CAAY,OAAA,WAAkB,OAAA;IAAU,KAAA;IAAe,KAAA;EAAA;EAIvD,GAAA,CAAI,IAAA,UAAc,KAAA,EAAO,SAAA,EAAW,IAAA,EAAM,OAAA,GAAU,OAAA;IAAU,MAAA;EAAA;EAU9D,MAAA,CAAO,IAAA,UAAc,IAAA,EAAM,OAAA,GAAU,OAAA;EAwBqB;EAnB1D,cAAA,CACJ,UAAA,UACA,QAAA,WACC,OAAA;IAAW,IAAA;EAAA,IAAiB,SAAA;EA2CQ;EApCjC,WAAA,CACJ,IAAA,UACA,UAAA,UACA,QAAA,UACA,IAAA,EAAM,OAAA,GACL,OAAA;EAIG,IAAA,CAAK,UAAA,UAAoB,OAAA,GAAU,oBAAA,GAAuB,OAAA,CAAQ,mBAAA;EAYlE,WAAA,CACJ,UAAA,UACA,OAAA,GAAU,oBAAA,GACT,OAAA,CAAQ,0BAAA;EAYL,WAAA,CAAY,UAAA,WAAqB,OAAA;EAIjC,iBAAA,CACJ,QAAA,UACA,SAAA,WACC,OAAA,EAAS,SAAA;EAWN,KAAA,CAAM,UAAA,WAAqB,OAAA;EAI3B,cAAA,CAAe,UAAA,UAAoB,IAAA,EAAM,OAAA,GAAU,OAAA;EAMnD,YAAA,CACJ,MAAA,UACA,OAAA,GAAU,oBAAA,GACT,OAAA,CAAQ,0BAAA;EAYL,aAAA,CAAc,MAAA,WAAiB,OAAA;EAAO;;;;;EAStC,KAAA,CACJ,MAAA,UACA,IAAA,EAX0C,aAAA,GAYzC,OAAA,CAD4C,eAAA;EAYzC,iBAAA,CAAkB,OAAA,aAAoB,OAAA,CAAQ,GAAA;EAmB9C,SAAA,CAAU,MAAA,WAAiB,OAAA;IAAU,SAAA;IAAmB,SAAA;EAAA;EAIxD,QAAA,CAAS,OAAA,EAAS,KAAA;IAAQ,IAAA;IAAc,KAAA,EAAO,SAAA;EAAA,IAAc,IAAA,EAAM,OAAA,GAAU,OAAA;EAAA,QAW3E,YAAA;EAOF,OAAA,CAAQ,KAAA,aAAkB,OAAA,CAAQ,GAAA,SAAY,SAAA;EAqBzC;;EAPX,cAAA,CAAe,KAAA,EAAO,SAAA,GAAY,OAAA;EAI5B,eAAA,CACJ,OAAA,EAAS,aAAA,IACT,GAAA,GAAM,iBAAA,GACL,OAAA,CAAQ,mBAAA;EASL,kBAAA,CACJ,OAAA,EAAS,gBAAA,IACT,GAAA,GAAM,iBAAA,GACL,OAAA,CAAQ,sBAAA;EASL,iBAAA,CACJ,MAAA,UACA,KAAA,UACA,OAAA,GAAU,oBAAA,GACT,OAAA,CAAQ,0BAAA;EAYL,SAAA,CAAA,GAAa,OAAA;EAMb,kBAAA,CAAmB,MAAA,WAAiB,OAAA;EAYpC,iBAAA,CACJ,QAAA,UACA,KAAA,WACC,OAAA;IAAU,OAAA,EAAS,cAAA;IAAkB,OAAA;IAAkB,MAAA;EAAA;EAiBpD,oBAAA,CAAA,GAAwB,OAAA;EAUoB;;;;;;EAA5C,YAAA,CAAa,GAAA,UAAa,UAAA,YAAkB,OAAA;EA2C/C;;;;;EAlCG,gBAAA,CAAiB,IAAA,YAAgB,UAAA,YAAkB,OAAA,CAAQ,GAAA;EAe3D,cAAA,CAAe,OAAA,EAAS,oBAAA,GAAuB,OAAA,CAAQ,YAAA;EASvD,YAAA,CAAa,IAAA,UAAc,SAAA,WAAoB,OAAA;EAK/C,kBAAA,CACJ,IAAA,UACA,SAAA,UACA,KAAA,UACA,aAAA,WACC,OAAA;AAAA"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { TreeQueryResult, TreeQuerySpec } from "./tree-query.mjs";
|
|
2
|
+
import { DirtyPathRow, ListDirtyPathOptions } from "./dirty-path-queue.mjs";
|
|
3
|
+
import { BatchDeleteEntry, BatchDeleteEntryResult, BatchIndexContext, BatchPutEntry, BatchPutEntryResult, ChangelogEntry, PutOpts, TreeEntry, TreeIndex, TreeIndexListEntriesResult, TreeIndexListOptions, TreeIndexListResult } from "./tree-index.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/prefixed-tree-index.d.ts
|
|
6
|
+
declare class PrefixedTreeIndex implements TreeIndex {
|
|
7
|
+
private inner;
|
|
8
|
+
private prefix;
|
|
9
|
+
constructor(inner: TreeIndex, prefix: string);
|
|
10
|
+
get(path: string, opts?: {
|
|
11
|
+
includeContent?: boolean;
|
|
12
|
+
}): Promise<TreeEntry | null>;
|
|
13
|
+
getDirTimes(dirPath: string): Promise<{
|
|
14
|
+
ctime: number;
|
|
15
|
+
mtime: number;
|
|
16
|
+
} | null>;
|
|
17
|
+
put(path: string, entry: TreeEntry, opts: PutOpts): Promise<{
|
|
18
|
+
oldCid?: string;
|
|
19
|
+
}>;
|
|
20
|
+
delete(path: string, opts: PutOpts): Promise<void>;
|
|
21
|
+
/** Dedup lookup (#1159) — prefix the scope in, strip the prefix off the result path. */
|
|
22
|
+
findByDedupKey(dedupScope: string, dedupKey: string): Promise<({
|
|
23
|
+
path: string;
|
|
24
|
+
} & TreeEntry) | null>;
|
|
25
|
+
/** Dedup reindex seam (#1159) — prefix both the path and the dedup scope. */
|
|
26
|
+
setDedupKey(path: string, dedupScope: string, dedupKey: string, opts: PutOpts): Promise<void>;
|
|
27
|
+
list(listPrefix: string, options?: TreeIndexListOptions): Promise<TreeIndexListResult>;
|
|
28
|
+
listEntries(listPrefix: string, options?: TreeIndexListOptions): Promise<TreeIndexListEntriesResult>;
|
|
29
|
+
hasChildren(listPrefix: string): Promise<boolean>;
|
|
30
|
+
getAndHasChildren(filePath: string, dirPrefix: string): Promise<[TreeEntry | null, boolean]>;
|
|
31
|
+
count(listPrefix: string): Promise<number>;
|
|
32
|
+
deleteByPrefix(listPrefix: string, opts: PutOpts): Promise<number>;
|
|
33
|
+
listChildren(parent: string, options?: TreeIndexListOptions): Promise<TreeIndexListEntriesResult>;
|
|
34
|
+
countChildren(parent: string): Promise<number>;
|
|
35
|
+
/**
|
|
36
|
+
* Collection query — delegate with the fragment prefix prepended, strip it
|
|
37
|
+
* off result row paths. The prefix is the blocklet-isolation boundary: a
|
|
38
|
+
* fragment can only ever query its own sub-tree.
|
|
39
|
+
*/
|
|
40
|
+
query(parent: string, spec: TreeQuerySpec): Promise<TreeQueryResult>;
|
|
41
|
+
countChildrenMany(parents: string[]): Promise<Map<string, number>>;
|
|
42
|
+
aggregate(prefix: string): Promise<{
|
|
43
|
+
fileCount: number;
|
|
44
|
+
totalSize: number;
|
|
45
|
+
}>;
|
|
46
|
+
putBatch(entries: Array<{
|
|
47
|
+
path: string;
|
|
48
|
+
entry: TreeEntry;
|
|
49
|
+
}>, opts: PutOpts): Promise<void>;
|
|
50
|
+
private mapPrereadIn;
|
|
51
|
+
getMany(paths: string[]): Promise<Map<string, TreeEntry | null>>;
|
|
52
|
+
/** Inline policy is path-independent — delegate straight to the inner index.
|
|
53
|
+
* An inner without inline support resolves to NULL (loop keeps the legacy skip). */
|
|
54
|
+
inlineForEntry(entry: TreeEntry): Promise<string | null>;
|
|
55
|
+
batchPutEntries(entries: BatchPutEntry[], ctx?: BatchIndexContext): Promise<BatchPutEntryResult[]>;
|
|
56
|
+
batchDeleteEntries(entries: BatchDeleteEntry[], ctx?: BatchIndexContext): Promise<BatchDeleteEntryResult[]>;
|
|
57
|
+
listModifiedSince(prefix: string, since: number, options?: TreeIndexListOptions): Promise<TreeIndexListEntriesResult>;
|
|
58
|
+
getMaxSeq(): Promise<number>;
|
|
59
|
+
getPrefixWatermark(prefix: string): Promise<number | null>;
|
|
60
|
+
getChangelogSince(sinceSeq: number, limit: number): Promise<{
|
|
61
|
+
entries: ChangelogEntry[];
|
|
62
|
+
hasMore: boolean;
|
|
63
|
+
cursor: number;
|
|
64
|
+
}>;
|
|
65
|
+
getCompactedBelowSeq(): Promise<number>;
|
|
66
|
+
/**
|
|
67
|
+
* PREFIX-LOCAL read-auth (design §4.1, P0#2): authorize a cid ONLY when this
|
|
68
|
+
* fragment's own sub-tree references it. Delegates with the fragment prefix
|
|
69
|
+
* prepended, so app A can never read app B's object under the same user by
|
|
70
|
+
* knowing the cid. The unprefixed space-root provider stays whole-scope.
|
|
71
|
+
*/
|
|
72
|
+
isReferenced(cid: string, pathPrefix?: string): Promise<boolean>;
|
|
73
|
+
/**
|
|
74
|
+
* PREFIX-LOCAL batch read-auth (design §7.2): authorize ONLY cids this
|
|
75
|
+
* fragment's own sub-tree references. Same prefix-prepend delegation as the
|
|
76
|
+
* single-cid {@link isReferenced}.
|
|
77
|
+
*/
|
|
78
|
+
isReferencedMany(cids: string[], pathPrefix?: string): Promise<Set<string>>;
|
|
79
|
+
listDirtyPaths(options: ListDirtyPathOptions): Promise<DirtyPathRow[]>;
|
|
80
|
+
ackDirtyPath(path: string, latestSeq: number): Promise<boolean>;
|
|
81
|
+
markDirtyPathError(path: string, latestSeq: number, error: string, nextAttemptAt: number): Promise<boolean>;
|
|
82
|
+
}
|
|
83
|
+
//#endregion
|
|
84
|
+
export { PrefixedTreeIndex };
|
|
85
|
+
//# sourceMappingURL=prefixed-tree-index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prefixed-tree-index.d.mts","names":[],"sources":["../src/prefixed-tree-index.ts"],"mappings":";;;;;cAyBa,iBAAA,YAA6B,SAAA;EAAA,QAE9B,KAAA;EAAA,QACA,MAAA;cADA,KAAA,EAAO,SAAA,EACP,MAAA;EAGJ,GAAA,CAAI,IAAA,UAAc,IAAA;IAAS,cAAA;EAAA,IAA6B,OAAA,CAAQ,SAAA;EAIhE,WAAA,CAAY,OAAA,WAAkB,OAAA;IAAU,KAAA;IAAe,KAAA;EAAA;EAIvD,GAAA,CAAI,IAAA,UAAc,KAAA,EAAO,SAAA,EAAW,IAAA,EAAM,OAAA,GAAU,OAAA;IAAU,MAAA;EAAA;EAU9D,MAAA,CAAO,IAAA,UAAc,IAAA,EAAM,OAAA,GAAU,OAAA;EAwBqB;EAnB1D,cAAA,CACJ,UAAA,UACA,QAAA,WACC,OAAA;IAAW,IAAA;EAAA,IAAiB,SAAA;EA2CQ;EApCjC,WAAA,CACJ,IAAA,UACA,UAAA,UACA,QAAA,UACA,IAAA,EAAM,OAAA,GACL,OAAA;EAIG,IAAA,CAAK,UAAA,UAAoB,OAAA,GAAU,oBAAA,GAAuB,OAAA,CAAQ,mBAAA;EAYlE,WAAA,CACJ,UAAA,UACA,OAAA,GAAU,oBAAA,GACT,OAAA,CAAQ,0BAAA;EAYL,WAAA,CAAY,UAAA,WAAqB,OAAA;EAIjC,iBAAA,CACJ,QAAA,UACA,SAAA,WACC,OAAA,EAAS,SAAA;EAWN,KAAA,CAAM,UAAA,WAAqB,OAAA;EAI3B,cAAA,CAAe,UAAA,UAAoB,IAAA,EAAM,OAAA,GAAU,OAAA;EAMnD,YAAA,CACJ,MAAA,UACA,OAAA,GAAU,oBAAA,GACT,OAAA,CAAQ,0BAAA;EAYL,aAAA,CAAc,MAAA,WAAiB,OAAA;EAAO;;;;;EAStC,KAAA,CACJ,MAAA,UACA,IAAA,EAX0C,aAAA,GAYzC,OAAA,CAD4C,eAAA;EAYzC,iBAAA,CAAkB,OAAA,aAAoB,OAAA,CAAQ,GAAA;EAmB9C,SAAA,CAAU,MAAA,WAAiB,OAAA;IAAU,SAAA;IAAmB,SAAA;EAAA;EAIxD,QAAA,CAAS,OAAA,EAAS,KAAA;IAAQ,IAAA;IAAc,KAAA,EAAO,SAAA;EAAA,IAAc,IAAA,EAAM,OAAA,GAAU,OAAA;EAAA,QAW3E,YAAA;EAOF,OAAA,CAAQ,KAAA,aAAkB,OAAA,CAAQ,GAAA,SAAY,SAAA;EAqBzC;;EAPX,cAAA,CAAe,KAAA,EAAO,SAAA,GAAY,OAAA;EAI5B,eAAA,CACJ,OAAA,EAAS,aAAA,IACT,GAAA,GAAM,iBAAA,GACL,OAAA,CAAQ,mBAAA;EASL,kBAAA,CACJ,OAAA,EAAS,gBAAA,IACT,GAAA,GAAM,iBAAA,GACL,OAAA,CAAQ,sBAAA;EASL,iBAAA,CACJ,MAAA,UACA,KAAA,UACA,OAAA,GAAU,oBAAA,GACT,OAAA,CAAQ,0BAAA;EAYL,SAAA,CAAA,GAAa,OAAA;EAMb,kBAAA,CAAmB,MAAA,WAAiB,OAAA;EAYpC,iBAAA,CACJ,QAAA,UACA,KAAA,WACC,OAAA;IAAU,OAAA,EAAS,cAAA;IAAkB,OAAA;IAAkB,MAAA;EAAA;EAiBpD,oBAAA,CAAA,GAAwB,OAAA;EAUoB;;;;;;EAA5C,YAAA,CAAa,GAAA,UAAa,UAAA,YAAkB,OAAA;EA2C/C;;;;;EAlCG,gBAAA,CAAiB,IAAA,YAAgB,UAAA,YAAkB,OAAA,CAAQ,GAAA;EAe3D,cAAA,CAAe,OAAA,EAAS,oBAAA,GAAuB,OAAA,CAAQ,YAAA;EASvD,YAAA,CAAa,IAAA,UAAc,SAAA,WAAoB,OAAA;EAK/C,kBAAA,CACJ,IAAA,UACA,SAAA,UACA,KAAA,UACA,aAAA,WACC,OAAA;AAAA"}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { loopBatchDeleteEntries, loopBatchPutEntries } from "./tree-index.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/prefixed-tree-index.ts
|
|
4
|
+
var PrefixedTreeIndex = class {
|
|
5
|
+
constructor(inner, prefix) {
|
|
6
|
+
this.inner = inner;
|
|
7
|
+
this.prefix = prefix;
|
|
8
|
+
}
|
|
9
|
+
async get(path, opts) {
|
|
10
|
+
return this.inner.get(this.prefix + path, opts);
|
|
11
|
+
}
|
|
12
|
+
async getDirTimes(dirPath) {
|
|
13
|
+
return await this.inner.getDirTimes?.(this.prefix + dirPath) ?? null;
|
|
14
|
+
}
|
|
15
|
+
async put(path, entry, opts) {
|
|
16
|
+
const prefixed = entry.dedupScope != null ? {
|
|
17
|
+
...entry,
|
|
18
|
+
dedupScope: this.prefix + entry.dedupScope
|
|
19
|
+
} : entry;
|
|
20
|
+
return this.inner.put(this.prefix + path, prefixed, opts);
|
|
21
|
+
}
|
|
22
|
+
async delete(path, opts) {
|
|
23
|
+
return this.inner.delete(this.prefix + path, opts);
|
|
24
|
+
}
|
|
25
|
+
/** Dedup lookup (#1159) — prefix the scope in, strip the prefix off the result path. */
|
|
26
|
+
async findByDedupKey(dedupScope, dedupKey) {
|
|
27
|
+
const r = await this.inner.findByDedupKey?.(this.prefix + dedupScope, dedupKey);
|
|
28
|
+
if (!r) return null;
|
|
29
|
+
return {
|
|
30
|
+
...r,
|
|
31
|
+
path: r.path.slice(this.prefix.length)
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/** Dedup reindex seam (#1159) — prefix both the path and the dedup scope. */
|
|
35
|
+
async setDedupKey(path, dedupScope, dedupKey, opts) {
|
|
36
|
+
await this.inner.setDedupKey?.(this.prefix + path, this.prefix + dedupScope, dedupKey, opts);
|
|
37
|
+
}
|
|
38
|
+
async list(listPrefix, options) {
|
|
39
|
+
const result = await this.inner.list(this.prefix + listPrefix, options);
|
|
40
|
+
return {
|
|
41
|
+
entries: result.entries.map((e) => ({ path: e.path.slice(this.prefix.length) })),
|
|
42
|
+
hasMore: result.hasMore,
|
|
43
|
+
cursor: result.cursor
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
async listEntries(listPrefix, options) {
|
|
47
|
+
const result = await this.inner.listEntries(this.prefix + listPrefix, options);
|
|
48
|
+
return {
|
|
49
|
+
entries: result.entries.map((e) => ({
|
|
50
|
+
...e,
|
|
51
|
+
path: e.path.slice(this.prefix.length)
|
|
52
|
+
})),
|
|
53
|
+
hasMore: result.hasMore,
|
|
54
|
+
cursor: result.cursor
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
async hasChildren(listPrefix) {
|
|
58
|
+
return this.inner.hasChildren(this.prefix + listPrefix);
|
|
59
|
+
}
|
|
60
|
+
async getAndHasChildren(filePath, dirPrefix) {
|
|
61
|
+
if (this.inner.getAndHasChildren) return this.inner.getAndHasChildren(this.prefix + filePath, this.prefix + dirPrefix);
|
|
62
|
+
const [entry, hasChildren] = await Promise.all([this.inner.get(this.prefix + filePath), this.inner.hasChildren(this.prefix + dirPrefix)]);
|
|
63
|
+
return [entry, hasChildren];
|
|
64
|
+
}
|
|
65
|
+
async count(listPrefix) {
|
|
66
|
+
return this.inner.count(this.prefix + listPrefix);
|
|
67
|
+
}
|
|
68
|
+
async deleteByPrefix(listPrefix, opts) {
|
|
69
|
+
return this.inner.deleteByPrefix(this.prefix + listPrefix, opts);
|
|
70
|
+
}
|
|
71
|
+
async listChildren(parent, options) {
|
|
72
|
+
const result = await this.inner.listChildren(this.prefix + parent, options);
|
|
73
|
+
return {
|
|
74
|
+
entries: result.entries.map((e) => ({
|
|
75
|
+
...e,
|
|
76
|
+
path: e.path.slice(this.prefix.length)
|
|
77
|
+
})),
|
|
78
|
+
hasMore: result.hasMore,
|
|
79
|
+
cursor: result.cursor
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
async countChildren(parent) {
|
|
83
|
+
return this.inner.countChildren(this.prefix + parent);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Collection query — delegate with the fragment prefix prepended, strip it
|
|
87
|
+
* off result row paths. The prefix is the blocklet-isolation boundary: a
|
|
88
|
+
* fragment can only ever query its own sub-tree.
|
|
89
|
+
*/
|
|
90
|
+
async query(parent, spec) {
|
|
91
|
+
if (!this.inner.query) throw new Error("Collection query is not supported by the underlying index");
|
|
92
|
+
const result = await this.inner.query(this.prefix + parent, spec);
|
|
93
|
+
return {
|
|
94
|
+
...result,
|
|
95
|
+
rows: result.rows.map((r) => ({
|
|
96
|
+
...r,
|
|
97
|
+
path: r.path.slice(this.prefix.length)
|
|
98
|
+
}))
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
async countChildrenMany(parents) {
|
|
102
|
+
const out = /* @__PURE__ */ new Map();
|
|
103
|
+
if (!this.inner.countChildrenMany) {
|
|
104
|
+
for (const p of parents) {
|
|
105
|
+
const cnt = await this.inner.countChildren(this.prefix + p);
|
|
106
|
+
if (cnt > 0) out.set(p, cnt);
|
|
107
|
+
}
|
|
108
|
+
return out;
|
|
109
|
+
}
|
|
110
|
+
const inner = await this.inner.countChildrenMany(parents.map((p) => this.prefix + p));
|
|
111
|
+
for (const [parent, cnt] of inner) out.set(parent.slice(this.prefix.length), cnt);
|
|
112
|
+
return out;
|
|
113
|
+
}
|
|
114
|
+
async aggregate(prefix) {
|
|
115
|
+
return this.inner.aggregate(this.prefix + prefix);
|
|
116
|
+
}
|
|
117
|
+
async putBatch(entries, opts) {
|
|
118
|
+
return this.inner.putBatch(entries.map((e) => ({
|
|
119
|
+
path: this.prefix + e.path,
|
|
120
|
+
entry: e.entry
|
|
121
|
+
})), opts);
|
|
122
|
+
}
|
|
123
|
+
mapPrereadIn(ctx) {
|
|
124
|
+
if (!ctx?.preread) return ctx;
|
|
125
|
+
const inner = /* @__PURE__ */ new Map();
|
|
126
|
+
for (const [k, v] of ctx.preread) inner.set(this.prefix + k, v);
|
|
127
|
+
return {
|
|
128
|
+
...ctx,
|
|
129
|
+
preread: inner
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
async getMany(paths) {
|
|
133
|
+
if (!this.inner.getMany) {
|
|
134
|
+
const map$1 = /* @__PURE__ */ new Map();
|
|
135
|
+
for (const p of paths) map$1.set(p, await this.get(p));
|
|
136
|
+
return map$1;
|
|
137
|
+
}
|
|
138
|
+
const innerMap = await this.inner.getMany(paths.map((p) => this.prefix + p));
|
|
139
|
+
const map = /* @__PURE__ */ new Map();
|
|
140
|
+
for (const p of paths) map.set(p, innerMap.get(this.prefix + p) ?? null);
|
|
141
|
+
return map;
|
|
142
|
+
}
|
|
143
|
+
/** Inline policy is path-independent — delegate straight to the inner index.
|
|
144
|
+
* An inner without inline support resolves to NULL (loop keeps the legacy skip). */
|
|
145
|
+
inlineForEntry(entry) {
|
|
146
|
+
return this.inner.inlineForEntry?.(entry) ?? Promise.resolve(null);
|
|
147
|
+
}
|
|
148
|
+
async batchPutEntries(entries, ctx) {
|
|
149
|
+
if (!this.inner.batchPutEntries) return loopBatchPutEntries(this, entries, ctx);
|
|
150
|
+
return (await this.inner.batchPutEntries(entries.map((e) => ({
|
|
151
|
+
...e,
|
|
152
|
+
path: this.prefix + e.path
|
|
153
|
+
})), this.mapPrereadIn(ctx))).map((r) => ({
|
|
154
|
+
...r,
|
|
155
|
+
path: r.path.slice(this.prefix.length)
|
|
156
|
+
}));
|
|
157
|
+
}
|
|
158
|
+
async batchDeleteEntries(entries, ctx) {
|
|
159
|
+
if (!this.inner.batchDeleteEntries) return loopBatchDeleteEntries(this, entries, ctx);
|
|
160
|
+
return (await this.inner.batchDeleteEntries(entries.map((e) => ({
|
|
161
|
+
...e,
|
|
162
|
+
path: this.prefix + e.path
|
|
163
|
+
})), this.mapPrereadIn(ctx))).map((r) => ({
|
|
164
|
+
...r,
|
|
165
|
+
path: r.path.slice(this.prefix.length)
|
|
166
|
+
}));
|
|
167
|
+
}
|
|
168
|
+
async listModifiedSince(prefix, since, options) {
|
|
169
|
+
const result = await this.inner.listModifiedSince(this.prefix + prefix, since, options);
|
|
170
|
+
return {
|
|
171
|
+
entries: result.entries.map((e) => ({
|
|
172
|
+
...e,
|
|
173
|
+
path: e.path.slice(this.prefix.length)
|
|
174
|
+
})),
|
|
175
|
+
hasMore: result.hasMore,
|
|
176
|
+
cursor: result.cursor
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
async getMaxSeq() {
|
|
180
|
+
return this.inner.getMaxSeq();
|
|
181
|
+
}
|
|
182
|
+
async getPrefixWatermark(prefix) {
|
|
183
|
+
if (!this.inner.getPrefixWatermark) return null;
|
|
184
|
+
return this.inner.getPrefixWatermark(this.prefix + prefix);
|
|
185
|
+
}
|
|
186
|
+
async getChangelogSince(sinceSeq, limit) {
|
|
187
|
+
const inner = await this.inner.getChangelogSince(sinceSeq, limit);
|
|
188
|
+
return {
|
|
189
|
+
entries: inner.entries.filter((r) => r.path.startsWith(this.prefix)).map((r) => ({
|
|
190
|
+
...r,
|
|
191
|
+
path: r.path.slice(this.prefix.length)
|
|
192
|
+
})),
|
|
193
|
+
hasMore: inner.hasMore,
|
|
194
|
+
cursor: inner.cursor
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
async getCompactedBelowSeq() {
|
|
198
|
+
return await this.inner.getCompactedBelowSeq?.() ?? 0;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* PREFIX-LOCAL read-auth (design §4.1, P0#2): authorize a cid ONLY when this
|
|
202
|
+
* fragment's own sub-tree references it. Delegates with the fragment prefix
|
|
203
|
+
* prepended, so app A can never read app B's object under the same user by
|
|
204
|
+
* knowing the cid. The unprefixed space-root provider stays whole-scope.
|
|
205
|
+
*/
|
|
206
|
+
async isReferenced(cid, pathPrefix = "") {
|
|
207
|
+
return this.inner.isReferenced(cid, this.prefix + pathPrefix);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* PREFIX-LOCAL batch read-auth (design §7.2): authorize ONLY cids this
|
|
211
|
+
* fragment's own sub-tree references. Same prefix-prepend delegation as the
|
|
212
|
+
* single-cid {@link isReferenced}.
|
|
213
|
+
*/
|
|
214
|
+
async isReferencedMany(cids, pathPrefix = "") {
|
|
215
|
+
return this.inner.isReferencedMany(cids, this.prefix + pathPrefix);
|
|
216
|
+
}
|
|
217
|
+
async listDirtyPaths(options) {
|
|
218
|
+
if (!this.inner.listDirtyPaths) return [];
|
|
219
|
+
return (await this.inner.listDirtyPaths({
|
|
220
|
+
...options,
|
|
221
|
+
prefix: this.prefix + options.prefix
|
|
222
|
+
})).map((r) => ({
|
|
223
|
+
...r,
|
|
224
|
+
path: r.path.slice(this.prefix.length)
|
|
225
|
+
}));
|
|
226
|
+
}
|
|
227
|
+
async ackDirtyPath(path, latestSeq) {
|
|
228
|
+
if (!this.inner.ackDirtyPath) return false;
|
|
229
|
+
return this.inner.ackDirtyPath(this.prefix + path, latestSeq);
|
|
230
|
+
}
|
|
231
|
+
async markDirtyPathError(path, latestSeq, error, nextAttemptAt) {
|
|
232
|
+
if (!this.inner.markDirtyPathError) return false;
|
|
233
|
+
return this.inner.markDirtyPathError(this.prefix + path, latestSeq, error, nextAttemptAt);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
//#endregion
|
|
238
|
+
export { PrefixedTreeIndex };
|
|
239
|
+
//# sourceMappingURL=prefixed-tree-index.mjs.map
|