Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Support the full v1 API through the generated API client

Abierto
#118 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
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
openapi, typescript
Área
api, cli

Línea de trabajo

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.

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

Descripción

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 operations and api 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 --file options.
  • Print the response body by default; --include also 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.

Lenguaje dominante
TypeScript
Estrellas
176
Forks
13
Merge medio
4 h 35 min
PR fusionados (30 d)
4

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/hackmd-cli

Todos los issues de hackmdio/hackmd-cli

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.