Skip to content

feat(pinning): add WithFilterMatch for spec-compliant name search - #102

Merged
pcfreak30 merged 1 commit into
developfrom
feat/pinning-match-filter
Aug 15, 2026
Merged

feat(pinning): add WithFilterMatch for spec-compliant name search#102
pcfreak30 merged 1 commit into
developfrom
feat/pinning-match-filter

Conversation

@pcfreak30

@pcfreak30 pcfreak30 commented Aug 15, 2026

Copy link
Copy Markdown
Member

Adds a WithFilterMatch option to ListPins so callers can request substring name search (match=partial) per the IPFS Pinning Services API TextMatchingStrategy.

ListPins exposed only WithFilterName, which defaults to an exact name match. The spec's name filter supports a match query param (exact, iexact, partial, ipartial) where partial matches anywhere in the name. The generated pinning client already serializes GetPinsParams.Match into the match query param, but ListPins dropped it and there was no public option to set it.

Changes:

  • WithFilterMatch(strategy) threads the TextMatchingStrategy enum through ListOption into GetPinsParams.Match.
  • ListPins now copies opt.Match into params.Match so the match query param is actually emitted.

End-to-end test asserts name + match=partial are sent together on the wire; option tests cover the full exact/iexact/partial/ipartial enum. All tests pass.


This pull request adds support for the IPFS Pinning Services API's TextMatchingStrategy parameter when searching and listing pinned items by name.

Key Changes:

  1. New function WithFilterMatch: Added a new list option function that allows specifying a text matching strategy (exact, iexact, partial, or ipartial) to be used in combination with the existing WithFilterName filter. This enables clients to perform substring matching anywhere in pin names, per the IPFS Pinning Services API specification.

  2. API parameter propagation: Updated the ListPins method to send the match query parameter to the server when a matching strategy is specified, complementing the existing name parameter. This ensures the matching strategy is properly transmitted to the pinning service.

  3. Zero-value behavior: When no matching strategy is set (empty value), the parameter is not sent, preserving backward compatibility with existing behavior.

Tests Added:

  • Unit tests verifying that WithFilterMatch correctly sets all four supported matching strategies (exact, iexact, partial, ipartial).
  • An end-to-end test confirming that when WithFilterName is combined with WithFilterMatch(Partial), both the name and match=partial query parameters are correctly sent to the server, enabling substring-based pin searches.

…search

ListPins exposed only WithFilterName (exact match by default), so callers
could not request the IPFS Pinning Services API's match query param for
substring name search (match=partial). Add WithFilterMatch(strategy)
threading the TextMatchingStrategy enum through ListOption into
GetPinsParams.Match, which the generated client already serializes as the
match query param.

End-to-end test asserts name + match=partial are actually sent on the wire;
option tests cover the full exact/iexact/partial/ipartial enum.
@kody-ai

kody-ai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Business Logic

Access your configuration settings here.

@pcfreak30
pcfreak30 merged commit c3f5654 into develop Aug 15, 2026
4 checks passed
@github-actions

Copy link
Copy Markdown

Code Coverage Report

Total Coverage: 11.2%

Generated from commit: 81c3cdc
Repository: LumeWeb/ipfs-sdk

@pcfreak30
pcfreak30 deleted the feat/pinning-match-filter branch August 20, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant