Feature request: endpoints for retrieving note comments and reactions

オープン
#48 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
typescript
領域
api

調査の方向性

ファイルやテストは指定されていません。まず既存の @hackmd/api クライアントメソッドと関連する issue #428 および #207 を確認してください。提案されているコメントおよびリアクションのエンドポイント、クライアントメソッド、レスポンスタイプが定義され、サポートされた時点で作業は完了です。

索引モデルが issue の本文から書いたものです。

説明

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
// Get all comments on a note (including replies and reactions per comment)
async getComments(noteId: string): Promise<Comment[]>

// Get all reactions on a note
async getReactions(noteId: string): Promise<Reaction[]>
Suggested response types
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

主要言語
TypeScript
スター
20
フォーク
8
平均マージ
47分
マージ済み PR(30日)
5

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

hackmdio/api-client のほかの issue

hackmdio/api-client の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。