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 importetc.) have been brought fully in line with the (as yet unreleased) Kubo 0.37.0:Task<IEnumerable<Cid>>is nowIAsyncEnumerable<PinListItem>, and aPinListOptionsparam was added containing name filters, recurse and stream options.PinAddOptions(replaces therecursiveboolean parameter).Namesupport (PinAddOptions/PinListItem) and optional name filter inPinListOptions.Changes (core)
PinListOptionsandPinListItemdomain model (list streaming and filtering preserved at the core surface).IPinApi.ListAsync(...)unified as IAsyncEnumerable; added overload withPinListOptions.IPinApi.AddAsync(...)updated to takePinAddOptions(replaces therecursiveboolean); added overload withIProgress<BlocksPinnedProgress>.PinAddOptions.Name;PinListItem.Name;PinListOptions.Namefilter andNamestoggle.RemoveAsyncremarks clarify that unpinning does not delete blocks; GC required to reclaim.DagApi.ImportAsync(...): omitpin-rootswhen null so Kubo default applies (roots pinned by default).CarImportOutputwithRootand optionalStats.AddFileOptions: addedPinName; minor docs/option clarifications. In downstream HTTP client wiring, fixedhashparameter formatting and correctedfscacheflag 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 therecursivebool parameter).IPinApi.AddAsync(..., IProgress<BlocksPinnedProgress> progress, ...).AddFileOptions.PinNameis additive and forward-compatible (effect depends on daemon version).PinListOptions,PinListItem.--name/-nis provided at the HTTP client layer; core exposes the filter option.