feat: 新增 dataset 数据集管理快捷命令(list/view/create/update/delete-attachment) #243

Merged
wbtiger merged 3 commits from luwanzhou/gitlink-cli:feat/dataset-shortcuts into master 2026-06-14 18:51:50 +08:00

3 Commits

Author SHA1 Message Date
Tiger ecc5578cf4 Merge upstream/master: resolve conflicts in README.zh-CN.md and register_test.go
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-14 18:50:50 +08:00
luwanzhou 29ca94db76 feat(dataset): add full dataset CRUD (view/create/update/delete-attachment)
Extend the dataset group beyond the verified project query to the full
documented contract:

- dataset +view              -> GET    /v1/{owner}/{repo}/dataset (+page/limit)
- dataset +list --ids        -> GET    /v1/project_datasets   (prod-verified)
- dataset +create            -> POST   /v1/{owner}/{repo}/dataset
- dataset +update            -> PUT    /v1/{owner}/{repo}/dataset
- dataset +delete-attachment -> DELETE /attachments/{uuid}

Quality over a bare contract port: bilingual (en-US/zh-CN) i18n help,
--dry-run preview on create/update, --yes confirmation guard on the
destructive attachment delete, and license-id validation.

Only /v1/project_datasets is currently reachable on production www; the
per-repo routes follow the published OpenAPI spec and return 404 there
until the platform deploys them (documented in the change note). Unit
tests exercise every command against a mock server.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 14:01:57 +08:00
luwanzhou 7f731eb04f feat(dataset): add dataset query shortcuts
Add a `dataset` shortcut group for querying GitLink research datasets,
which previously had no shortcut coverage:

- dataset +list --ids <ids>  -> GET /v1/project_datasets
- dataset +view              -> GET /v1/project_datasets (project ID
                                 resolved from --owner/--repo)

Only the platform-wide query endpoint is available on production
gitlink.org.cn; the documented per-repo dataset CRUD routes return 404
there (verified against the API), so this group wraps the query endpoint
for both listing and per-repo viewing.

Includes unit tests, bilingual (en-US/zh-CN) i18n help text, README
updates, and a change note.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 11:48:22 +08:00