feat: 子チームの一覧とメンバー取得に対応する - #63
Merged
Merged
Conversation
ppworks
force-pushed
the
child_team
branch
2 times, most recently
from
September 2, 2026 02:06
d6fff1d to
b06d596
Compare
連結請求で紐付いた子チームを親チームの owner として見られるようにする。
esa team children で子チーム名を調べ、esa member list / view の
--child-team にその名前を渡す。
--child-team は対象を差し替えるオプションで、省けば対象チーム自身の
メンバーを見る。あわせて esa member view を足し、自チームのメンバーも
1件表示できるようにする
(GET /v1/teams/{team_name}/members/{screen_name_or_email})。
--child-team には read:child_team_member が要る。既定の要求スコープには
足さず、README とオプションのヘルプに書いて esa auth login --scopes で
足してもらう。team children は read:team なので既定のまま動く。
子チームのメンバー一覧は並び替えを受け付けないので、--child-team と
--sort / --order の同時指定はネットワークより先に弾く。送っても黙って
無視され、並んでいるつもりの結果を渡すことになるため。
メンバー一覧に EMAIL 列を足す。子チームのメンバー一覧は email を常に
返し、それが子チームのメンバーを見分ける手がかりになる。解決できない
場合は null が返るので、その場合は空にする。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lb7Mgptgn9MXvs4CcZL7AA
同じ「空なら弾く」検証が attachment upload の --name と config set の 値とで別々に書かれていたので、parse.ts の nonEmpty に統一する。 専用の attachment.emptyName / config.emptyValue は parse.empty に 置き換えて消す。 --name は trim せず空文字だけを弾いていたため、空白のみの名前が そのまま送られていた。nonEmpty に寄せることでこれも弾き、前後の空白は 除いて送る。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lb7Mgptgn9MXvs4CcZL7AA
positiveInt と nonEmpty の第2引数は、検証した値そのものではなく
エラーに出すその入力の呼び名だが、name という引数名からは読み取れず、
config set のように呼び名と値が別の引数から来る呼び出しで紛らわしい。
ロケールキーが既に post.idLabel のように Label を使っているので、
語彙をそちらに揃える。
補間名も {{label}} にする。parse.* の {{name}} だけが「入力の呼び名」で、
他のキーの {{name}} はファイル名や記事名そのものを指していた。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lb7Mgptgn9MXvs4CcZL7AA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
概要
連結請求で紐付いた子チームを、親チームの owner として CLI から見られるようにします。
include=available_scopesは openapi.yaml の再生成で型に入っていますが、CLI では使いません。必要なスコープ
--child-teamにはread:child_team_memberが要ります。既定の要求スコープには足していないので、使う場合は要求スコープに足して認証し直してください。
esa auth login --scopes "read:team read:child_team_member"esa team childrenはread:team(既定に含まれる)で動きます。持っていないトークンではAPI が要求スコープを添えて 403 を返します。
ESA_ACCESS_TOKENを使う場合は v2 token が要ります。設計
対象チームは
--team、その子チームは--child-teamで指定します。--team parent --child-team subと並び、
--child-teamを省けば対象チーム自身のメンバーを見ます。esa member viewはGET /v1/teams/{team_name}/members/{screen_name_or_email}を呼びます。--child-teamを付けると子チームのメンバーを引きます。子チーム一覧は
esa team childrenです。--page/--per-page/--jsonを取り、所属チーム一覧と同じ列で出します。
--child-teamと--sort/--orderは同時に指定できません。子チームのメンバー一覧は並び替えを受け付けず、送っても黙って無視されるので、ネットワークより先に弾きます。
メンバー一覧に EMAIL 列を足します。子チームのメンバー一覧は email を常に返し、それが
子チームのメンバーを見分ける手がかりになります。解決できない場合は null が返るので、
そのときは空にします。
リファクタ
同じ「値が空なら弾く」検証が
attachment uploadの--nameとconfig setの値とで別々に書かれていたので、
parse.tsのnonEmptyに統一します。これに伴い--nameはtrim されるようになり、空白のみの名前を弾きます。
positiveInt/nonEmptyの第2引数は、検証した値ではなくエラーに出す入力の呼び名なので、nameからlabelに改名します。ロケールキーが既にpost.idLabelのように Label を使っているので、語彙をそちらに揃えます。
🤖 Generated with Claude Code
https://claude.ai/code/session_01Lb7Mgptgn9MXvs4CcZL7AA