Skip to content

feat: add team member removal and a project filter for the member list - #53

Merged
bjarn merged 1 commit into
feat/team-rolesfrom
feat/team-member-removal
Oct 21, 2026
Merged

bjarn merged 1 commit into
feat/team-rolesfrom
feat/team-member-removal

Conversation

@bjarn

@bjarn bjarn commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Adds $lettermint->team->members->remove(string $userId): MessageResponse, which calls DELETE /team/members/{userId} with the team token.
    • The Owner can't be removed. That answers 409 and throws the existing ConflictException, with owner_protected in errorCode.
    • An unknown member throws NotFoundException.
    • Empty, . and .. user IDs are rejected before any request.
    • The request has no body and no Idempotency-Key.
  • team->members->list() and team->members->iterate() accept ['filter' => ['project_id' => …]], sent as filter[project_id].
    • The list then has only the members who can access that project: members with access to all projects, plus the members selected for it.
    • An unknown project returns an empty list.
    • Both methods already took the generated ListTeamMembersQuery shape, so the filter needed only docs and tests. The signatures don't change.
    • The tests cover the filter on list and through every page of iterate.
  • This PR makes the coverage test strict again. The pending list is gone, and every operation in the generated table (71) must have an SDK method.
  • README: remove is in the Team API table, with a note on the project filter.

Non-breaking.

Usage

// The members who can access a project.
$page = $lettermint->team->members->list(['filter' => ['project_id' => 'project-id']]);

foreach ($lettermint->team->members->iterate(['filter' => ['project_id' => 'project-id']]) as $member) {
    echo $member->email, PHP_EOL;
}

$lettermint->team->members->remove('user-id');

Checks

On this branch (top of the stack):

  • vendor/bin/pest --ci: 352 passed (3835 assertions)
  • vendor/bin/phpstan: no errors on PHP 8.5 and on PHP 8.4 (the CI version)
  • vendor/bin/pint --test: passed
  • composer generate:check (full regeneration check): 170 generated files up to date
  • composer generate:check in the header-only mode that CI runs: headers of 170 generated files OK
  • Test matrix: composer update --prefer-lowest and --prefer-stable, each followed by vendor/bin/pest --ci. All runs passed with 352 tests (3835 assertions).
    • PHP 8.5, 8.4 and 8.2 ran locally on macOS.
    • PHP 8.3 ran in the php:8.3-cli Docker image, because the local PHP 8.3 build crashes from a broken third-party extension. That crash isn't related to this change.

Not run locally

  • The Windows jobs of the test matrix.

🤖 Generated with Claude Code

Add `$lettermint->team->members->remove($userId)`. `members->list()` and
`members->iterate()` accept `filter[project_id]` to return only the
members who can access that project.

The operation coverage test is strict again: every operation in the
generated table needs an SDK method.

Co-Authored-By: Claude <noreply@anthropic.com>
@bjarn
bjarn requested a review from a team as a code owner October 20, 2026 20:49
@bjarn
bjarn added this pull request to stack #54 October 20, 2026 20:49
@bjarn
bjarn merged commit 101dd30 into main Oct 21, 2026
35 checks passed
@bjarn
bjarn deleted the feat/team-member-removal branch October 21, 2026 14:04
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.

2 participants