Support the full v1 API through the generated API client
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- openapi, typescript
Hướng nghiên cứu
Begin with the proposed api operations, api describe, and api call entry points, then inspect the generated client's vendored OpenAPI spec and @hackmd/api/raw. Confirm the API client version includes /raw and the registry before implementing. Done means existing commands still work and the new API entry handles the listed request, response, and error cases against a local server.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Why
The CLI has useful notes and folders commands, but adding a dedicated command for every v1 endpoint would duplicate the API client and leave coverage gaps.
Design
Keep all existing commands and add one generic api entry:
api operationsandapi describe <OperationId>read the installed API client registry offline. They do not claim that a connected EE server supports every operation.api call <OperationId>delegates to@hackmd/api/raw, using the existing token and endpoint settings. Accept explicit--path,--query,--header, JSON--body, and multipart--fileoptions.- Print the response body by default;
--includealso shows status and headers. Handle empty responses, 207, NDJSON, and HTTP errors. Do not automatically retry writes.
This follows the GitHub CLI gh api design: dedicated commands for common workflows, plus a generic API entry for broader coverage. We borrow the interface idea, but delegate requests to the API client rather than adding another HTTP transport.
Generate the operation registry from the API client's vendored OpenAPI spec. Do not download a spec at CLI runtime or add another HTTP transport.
Example
# GitHub CLI: a focused command and a generic API entry
gh issue list --repo OWNER/REPO
gh api repos/OWNER/REPO/issues --include
# HackMD CLI: the same two-layer idea
hackmd-cli notes --noteId=abc
hackmd-cli api describe GetNote
hackmd-cli api call GetNote --path noteId=abc --include
Before release
This depends on the HackMD OpenAPI update and the API client PR. Publish a new API client version with /raw and the registry, then pin it in the CLI.
Reference
hmd is another reference for operation discovery and generic HackMD API commands. It reads OpenAPI at runtime; our CLI instead uses the installed API client's generated registry and raw operations.
- Ngôn ngữ chính
- TypeScript
- Star
- 176
- Fork
- 13
- Merge trung bình
- 4 giờ 35 phút
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của hackmdio/hackmd-cli
-
Config commandĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
hackmdio/hackmd-cli#45 · 2 bình luận ·
-
login problemĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
hackmdio/hackmd-cli#108 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
hackmdio/hackmd-cli#105 · 1 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
hackmdio/hackmd-cli#89 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
hackmdio/hackmd-cli#87 ·
Tất cả issue của hackmdio/hackmd-cli
Issue tương tự
-
Mend: dependency security vulnerability untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
opensearch-project/security-dashboards-plugin#2545 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: Dream TR SDĐang mởcheck:passed streams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
doctor integrity sample scans soft-deleted pages on Postgres (batch path has no deleted_at filter)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
SocialGouv/egapro#4672 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area:agents area:tui bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
anthropics/claude-code#98358 ·
Maintainer thường phản hồi trong vòng 1 ngày