hackmdio / hackmdio/api-client
Feature request: endpoints for retrieving note comments and reactions
- 主要言語
- TypeScript
- スター
- 19
- フォーク
- 8
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
## Summary
The `@hackmd/api` client currently has no methods for retrieving comment or reaction data from notes. The only comment-related field exposed is `commentPermission` (controlling who can comment), but the actual comment content, threads, and reactions are completely inaccessible via the API.
## Request
Add API endpoints and corresponding client methods for retrieving comments and reactions:
### Proposed endpoints
```
GET /v1/notes/:noteId/comments
GET /v1/notes/:noteId/reactions
```
### Proposed client methods
```typescript
// Get all comments on a note (including replies and reactions per comment)
async getComments(noteId: string): Promise
// Get all reactions on a note
async getReactions(noteId: string): Promise
```
### Suggested response types
```typescript
interface Comment {
id: string
author: {
id: string
name: string
}
body: string
createdAt: string // ISO 8601
updatedAt: string // ISO 8601
resolved: boolean
range?: {
startLine: number
endLine: number
}
replies: Reply[]
reactions: ReactionGroup[]
}
interface Reply {
id: string
author: {
id: string
name: string
}
body: string
createdAt: string
}
interface ReactionGroup {
emoji: string
users: string[] // user IDs
}
interface Reaction {
noteId: string
emoji: string
user: {
id: string
name: string
}
createdAt: string
}
```
## Motivation
HackMD's commenting and reaction features are valuable for collaboration, but teams that use the API or CLI to sync notes to external systems (e.g., GitHub repositories) lose all of this context. Exposing comment and reaction data via the API would enable:
- Backing up discussion context alongside note content
- Building integrations that preserve collaboration history
- Automating workflows that depend on comment/reaction data
## Related
- Broader feature request: https://github.com/hackmdio/hackmd-io-issues/issues/428
- Original request from 2020: https://github.com/hackmdio/hackmd-io-issues/issues/207
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
No files or tests are named. Start by reviewing the existing @hackmd/api client methods and the related issues #428 and #207; the work is complete when the proposed comment and reaction endpoints, client methods, and response types are defined and supported.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- api
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100