feat(token-plan): add Token Plan organization & seats commands#75
Merged
Conversation
新增 tokenplan seats 命令,支持分页和状态过滤,提供详细的座位信息查询功能。相关文档已更新。
新增 `tokenplan add-member`、`tokenplan assign-seats` 和 `tokenplan create-key` 命令,支持管理 Token Plan 组织成员和 API 密钥。相关文档已更新,提供使用示例和参数说明。
修改 `assign-seats` 命令中的 AccountIds 参数处理,将字符串类型的 AccountIds 转换为数组。同时,更新相关的测试用例以验证新逻辑的正确性。
更新 `assign-seats` 和 `seats` 命令中的参数处理逻辑,简化对 AccountIds 和 StatusList 的检查,确保在缺少必要参数时抛出相应错误。同时,增强对 `--query-assigned` 参数的验证,确保其值为 'true' 或 'false'。此更改提高了代码的可读性和健壮性。
对 `tokenplan` 相关命令进行了重构,新增了 `ak-sign` 模块以支持 ACS3-HMAC-SHA256 签名,优化了参数处理逻辑,简化了对凭证的处理。更新了 `add-member`、`assign-seats`、`create-key` 和 `seats` 命令,增强了对参数的验证和处理,确保代码的可读性和健壮性。同时,新增了类型定义和工具函数以支持更好的代码结构。
Token plan openapi
Rename the public command group from `bl tokenplan` to `bl token-plan` for kebab-case consistency. Source directory and reference doc renamed accordingly; remote API paths (/tokenplan/...) and internal TS identifiers are unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
Adds a new
token-plancommand group that talks to the ModelStudio Token Plan POP APIs (ACS3-HMAC-SHA256 signed), plus a few small follow-ups.New commands
bl token-plan seats— list subscription seat detailsbl token-plan create-key— create an access keybl token-plan assign-seats— assign seatsbl token-plan add-member— add an organization member (with optional seat tier / role)Supporting changes
token-plan/utils.ts,types.ts,ak-sign.ts: shared ACS3 query-string signer + credential resolution + common query/AK optionscatalog.tsurls.tsskills/bailian-clireference docs (token-plan.md, setup, index) and READMEschore: bump Node.js to 24 (.node-version)Test plan
bl token-plan seats --dry-runresolves and dispatches correctlybl tokenplan seatsreports "Unknown command" (old name removed, no alias)pnpm run checkpasses (0 errors)bl token-plan create-key/assign-seats/add-memberround-trip against stagingomniandvideoe2e tests still pass🤖 Generated with Claude Code