Pin API alignment: option and response records, streaming/progress options #48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Implementation of ipfs-shipyard/net-ipfs-core#53
This PR was prepared by checking Kubo version changelogs 0.9.0 through 0.37.0 for any mentioned changes related to pinning, then these findings were cross-referenced with our existing codebase to identify the changes needed.
The IPinApi and a few other APIs that touch pinning (
add
,dag import
etc.) have been brought fully in line with the (as yet unreleased) Kubo 0.37.0:Task<IEnumerable<Cid>>
is nowIAsyncEnumerable<PinListItem>
, and aPinListOptions
param was added containing name filters, recurse and stream options.PinAddOptions
(replaces therecursive
boolean parameter).Name
support (PinAddOptions/PinListItem) and optional name filter inPinListOptions
.Changes (core)
PinListOptions
andPinListItem
domain model (list streaming and filtering preserved at the core surface).IPinApi.ListAsync(...)
unified as IAsyncEnumerable; added overload withPinListOptions
.IPinApi.AddAsync(...)
updated to takePinAddOptions
(replaces therecursive
boolean); added overload withIProgress<BlocksPinnedProgress>
.PinAddOptions.Name
;PinListItem.Name
;PinListOptions.Name
filter andNames
toggle.RemoveAsync
remarks clarify that unpinning does not delete blocks; GC required to reclaim.DagApi.ImportAsync(...)
: omitpin-roots
when null so Kubo default applies (roots pinned by default).CarImportOutput
withRoot
and optionalStats
.AddFileOptions
: addedPinName
; minor docs/option clarifications. In downstream HTTP client wiring, fixedhash
parameter formatting and correctedfscache
flag mapping.Tests
Compatibility / Notes
--pin-name
; net-ipfs-core exposes property but behavior depends on daemon version.pin-roots=false
; the client tolerates this by returning an empty object.IPinApi.ListAsync(...)
now returnsIAsyncEnumerable<PinListItem>
(previously returned a materialized collection of CIDs); also addedListAsync(PinListOptions)
.IPinApi.AddAsync(...)
signature changed to usePinAddOptions
(replaces therecursive
bool parameter).IPinApi.AddAsync(..., IProgress<BlocksPinnedProgress> progress, ...)
.AddFileOptions.PinName
is additive and forward-compatible (effect depends on daemon version).PinListOptions
,PinListItem
.--name/-n
is provided at the HTTP client layer; core exposes the filter option.