David Mehren
b2085efb1d
Add missing TagRepository provider in unit tests
...
Signed-off-by: David Mehren <git@herrmehren.de>
Co-authored-by: Yannick Bungers <git@innay.de>
2020-10-24 22:21:44 +02:00
David Mehren
c1886ff1dc
NotesController: Add PUT :noteIdOrAlias/metadata
route
...
Signed-off-by: David Mehren <git@herrmehren.de>
Co-authored-by: Yannick Bungers <git@innay.de>
2020-10-24 22:21:44 +02:00
David Mehren
0711dbb6ff
MediaService: Simplify saveFile
signature
...
As the `saveFile` method only really uses the files `Buffer`, this commit changes the signature so it directly gets a `Buffer` instead of a complicated `MulterFile` object. This also simplifies testing.
Signed-off-by: David Mehren <git@herrmehren.de>
2020-10-24 11:49:01 +02:00
David Mehren
3686685f08
MediaController: Add DELETE /{filename}
route
...
Signed-off-by: David Mehren <git@herrmehren.de>
2020-10-17 21:54:44 +02:00
David Mehren
16b5f3a5c8
Use POST /media
for file upload
...
The old `/media/upload` subpath does not follow the convention of REST APIs.
Signed-off-by: David Mehren <git@herrmehren.de>
2020-10-17 20:58:10 +02:00
David Mehren
ed142815e3
Add various missing imports and provider ovverides in unit tests
...
Signed-off-by: David Mehren <git@herrmehren.de>
2020-10-17 20:24:07 +02:00
David Mehren
4cd80a3212
MediaController: Handle errors when trying to save file
...
Signed-off-by: David Mehren <git@herrmehren.de>
2020-10-17 20:24:07 +02:00
David Mehren
7997a0955a
UsersService: Add methods to find, create and delete users
...
Signed-off-by: David Mehren <git@herrmehren.de>
2020-10-17 20:24:07 +02:00
David Mehren
dea3c1d393
MediaController: Get parent note from HedgeDoc-Note
header
...
Signed-off-by: David Mehren <git@herrmehren.de>
2020-10-17 19:58:22 +02:00
David Mehren
8e234962d6
MediaController: Use MediaService
to store media
...
Signed-off-by: David Mehren <git@herrmehren.de>
2020-10-17 19:58:22 +02:00
Yannick Bungers
258dd1db56
Added markdownbody-decorator
...
which puts the markdown text directly to a variable in the route function.
Content-type of the http request is checked to be text/markdown because we dealing with markdown. Technically by now there can be any content which can be encoded. There could be features in the software which do not work properly if the text can't be parsed as markdown.
Signed-off-by: Yannick Bungers <git@innay.de>
2020-10-02 21:31:10 +02:00
David Mehren
d7f407da2d
Switch to using the new custom logger
...
Signed-off-by: David Mehren <git@herrmehren.de>
2020-09-27 21:48:42 +02:00
David Mehren
2ce87f3d64
Add various missing imports and provider overrides to fix unit tests.
...
Signed-off-by: David Mehren <git@herrmehren.de>
2020-09-25 21:37:40 +02:00
David Mehren
8b9a45b738
NotesService: Let createNote
create an actual Note
and introduce createNoteDto
to create & convert in one step.
...
It might be handy to have access to the original `Note` after creating one, so the creation and conversion to a `NoteDto` is now split.
Signed-off-by: David Mehren <git@herrmehren.de>
2020-09-25 21:37:39 +02:00
David Mehren
e1079947e1
NotesController: revisionId
is a number
...
Signed-off-by: David Mehren <git@herrmehren.de>
2020-09-25 21:37:39 +02:00
David Mehren
e43008c627
NotesController: Get text from request body when updating and deleting a note.
...
Signed-off-by: David Mehren <git@herrmehren.de>
2020-09-25 21:37:39 +02:00
David Mehren
1a22f749be
NotesController: Get text from request body when creating a named note.
...
Signed-off-by: David Mehren <git@herrmehren.de>
2020-09-25 21:37:39 +02:00
David Mehren
a2a9ad224f
NotesService: Find note by ID or alias in database
...
This commit also introduces the `getNoteDtoByIdOrAlias` method, that converts a `Note` entity to a `NoteDto`
Signed-off-by: David Mehren <git@herrmehren.de>
2020-09-25 21:37:39 +02:00
David Mehren
2c3a75187e
NoteController: Do not use text/markdown as response content-type for createNote
...
Signed-off-by: David Mehren <git@herrmehren.de>
2020-09-25 21:37:38 +02:00
David Mehren
b4b91acddb
NotesController: Use custom logic to access raw markdown
...
NestJS does not support content-types other than application/json.
Therefore we need to directly access the request object to get the raw body content.
Signed-off-by: David Mehren <git@herrmehren.de>
2020-09-25 21:35:47 +02:00
David Mehren
d55e3bb622
NotesController: Add missing mock repositories for testing
...
Signed-off-by: David Mehren <git@herrmehren.de>
2020-08-20 19:57:56 +02:00
David Mehren
35051986be
MeController: Add missing mock repositories for testing
...
Signed-off-by: David Mehren <git@herrmehren.de>
2020-08-20 19:57:47 +02:00
David Mehren
84b7840ce3
Implement routes in MonitoringController
...
Signed-off-by: David Mehren <git@herrmehren.de>
2020-08-20 19:43:10 +02:00
David Mehren
eab06c0296
Add monitoring module
...
Signed-off-by: David Mehren <git@herrmehren.de>
2020-08-20 19:43:10 +02:00
David Mehren
f98bf0d32d
Add media upload route to MediaController
...
Signed-off-by: David Mehren <git@herrmehren.de>
2020-08-20 19:43:09 +02:00
David Mehren
eedaf61921
Implement /notes API routes
...
This adds all currently specified routes under /notes.
Signed-off-by: David Mehren <git@herrmehren.de>
2020-08-20 19:43:09 +02:00
David Mehren
e490ecba36
Add /me/notes route to MeController
...
Signed-off-by: David Mehren <git@herrmehren.de>
2020-08-20 19:43:08 +02:00
David Mehren
348cd3ffe1
Add PublicAPIModule
...
This adds all controllers needed in the public API (at least as currently specified) and implements some routes under `/me`
Signed-off-by: David Mehren <git@herrmehren.de>
2020-08-20 19:43:07 +02:00