Feature request: endpoints for retrieving note comments and reactions

Abierto
#48 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
typescript
Área
api

Línea de trabajo

No se nombran archivos ni pruebas. Empieza revisando los métodos de cliente existentes de @hackmd/api y los issues relacionados #428 y #207; el trabajo estará completo cuando los endpoints, métodos de cliente y tipos de respuesta propuestos para comentarios y reacciones estén definidos y sean compatibles.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
TypeScript
Estrellas
20
Forks
8
Merge medio
47 min
PR fusionados (30 d)
5

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de hackmdio/api-client

Todos los issues de hackmdio/api-client

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.