Skip to content

feat: support upload note image api#55

Open
EastSun5566 wants to merge 4 commits into
developfrom
feature/dev-2776-support-upload-note-image
Open

feat: support upload note image api#55
EastSun5566 wants to merge 4 commits into
developfrom
feature/dev-2776-support-upload-note-image

Conversation

@EastSun5566
Copy link
Copy Markdown

Description

  • support for uploading note images via POST /notes/{noteId}/images
  • Add uploadNoteImage(noteId, image, options) with multipart FormData support
  • Add integration / e2e tests

Manual testing

I manually tested:

  • npm run test
  • HACKMD_ACCESS_TOKEN=<TOKEN>HACKMD_E2E_MUTATIONS=1 HACKMD_E2E_FOLDERS=0 npm run test:e2e
> @hackmd/api@2.5.0 test:e2e
> jest --config jest.e2e.config.ts

 PASS  tests/e2e/api.e2e.spec.ts
  HackMD API (live e2e)
    read-only
      ✓ getMe returns the current user profile (589 ms)
      ✓ getNoteList returns an array (106 ms)
      ✓ getTeams returns an array (112 ms)
      ✓ getHistory accepts limit and returns an array (216 ms)
      ✓ getFolderList returns folders when the server exposes /folders (223 ms)
    mutations (optional)
      notes CRUD when HACKMD_E2E_MUTATIONS=1
        ✓ createNote creates a note (204 ms)
        ✓ getNote returns the note (209 ms)
        ✓ updateNote updates title, content, and tags (820 ms)
        ✓ uploadNoteImage uploads an image to the note (448 ms)
        ✓ getNoteList includes the note (177 ms)
        ✓ deleteNote removes the note (320 ms)
      folders CRUD when HACKMD_E2E_MUTATIONS=1
        ○ skipped folders: create → get → update → nested folder → list → order round-trip → delete

Test Suites: 1 passed, 1 total
Tests:       1 skipped, 11 passed, 12 total
Snapshots:   0 total
Time:        4.457 s, estimated 7 s
Ran all test suites.

@EastSun5566 EastSun5566 self-assigned this Jun 4, 2026
@EastSun5566 EastSun5566 changed the title feat: support upload image api feat: support upload note image api Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant