Commit graph

514 commits

Author SHA1 Message Date
Philip Molares
3594d904f7
PrivateE2E: Add history test
Test the /me/history route in the private API.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-04 10:20:58 +01:00
Philip Molares
29dbf0b657
PrivateAPI: Add history controller
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-03 15:25:11 +01:00
Philip Molares
b872694158
HistoryService: Add deleteHistory method
This method deletes all history entries of a user.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-03 15:23:45 +01:00
Renovate Bot
8273d8a5b9
Update dependency @types/jest to v26.0.21
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-17 16:05:02 +00:00
Renovate Bot
14e3035e96
Update dependency ts-jest to v26.5.4
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-17 13:46:03 +00:00
Renovate Bot
dc825bc200
Update dependency @types/node to v13.13.47
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-15 22:49:00 +00:00
Philip Molares
6e29ffba65
MediaService: Remove allowedMimeType application/pdf
Uploading PDFs does not work with imgur and therefore HedgeDoc should not offer that.

See #533

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-15 22:41:40 +01:00
Renovate Bot
96396ea237
Update linters to v4.18.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-15 19:22:12 +00:00
Yannick Bungers
f47d85b301
Add GET /me/media
Returns all media files uploaded by the authenticated user.

Signed-off-by: Yannick Bungers <git@innay.de>
2021-03-14 17:47:16 +01:00
Philip Molares
7a7b3d3a50
AppConfig: Fix bug in the schema of forbiddenNoteIds
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-14 17:54:50 +01:00
Renovate Bot
d09bbf661d
Lock file maintenance
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-15 07:54:51 +00:00
Renovate Bot
981aecaa99
Update dependency ts-loader to v8.0.18
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-14 17:52:33 +00:00
Renovate Bot
4942b4b922
Update dependency @azure/storage-blob to v12.5.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-14 17:49:35 +00:00
Renovate Bot
793ab84e0f
Update dependency @types/node to v13.13.46
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-14 17:46:28 +00:00
Renovate Bot
9d192567e5
Update NestJS packages
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-14 17:42:57 +00:00
Renovate Bot
45a0bae1e8
Update linters
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-14 16:21:22 +00:00
Renovate Bot
10835b53bd
Update dependency mkdocs-material to v7.0.6
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-14 14:36:58 +00:00
Philip Molares
50d950c5f2
PublicE2E: Add test for GET /me/history/{note} in me.e2e-spec.ts
add test for GET /me/history/{note}
add error cases to PUT /me/history/{note} and DELETE /me/history/{note}
activate missing test GET /me/notes/

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-05 12:04:06 +01:00
Philip Molares
82ef4a10cb
PublicAPI: Add /me/history/:note
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-05 12:01:43 +01:00
Philip Molares
521ddc36c6
HistoryService: Add unit test for getEntryByNoteIdOrAlias
Also add extra test to deleteHistoryEntry

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-05 12:01:04 +01:00
Philip Molares
6ed686e657
HistoryService: Add JSDocs for all methods
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-05 11:59:07 +01:00
Philip Molares
66e2340009
NotesService: Add e2e tests for forbidden note alias
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 22:24:17 +01:00
Philip Molares
54d0aa2197
NotesService: Add unit tests for forbidden note alias
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 22:23:52 +01:00
Philip Molares
c82f317ef0
NotesService: Check if note alias is forbidden
If the note alias is forbidden return a BadRequest.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 22:21:31 +01:00
Philip Molares
dbbee13913
Errors: Add ForbiddenIdError
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 22:16:50 +01:00
Philip Molares
966f5ee2fe
Config: Add forbiddenNoteIds to AppConfig
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 22:15:04 +01:00
Renovate Bot
2a83c9b2ac
Lock file maintenance
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-07 21:36:19 +00:00
Renovate Bot
68fdfebc23
Update linters
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-07 21:23:35 +00:00
Renovate Bot
2abc81134d
Update dependency typescript to v4.2.3
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-07 21:16:23 +00:00
Renovate Bot
aeda6fb577
Update dependency file-type to v16.3.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-07 21:16:11 +00:00
Renovate Bot
8bbc89bed2
Update dependency mkdocs-material to v7.0.5
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-07 19:04:16 +00:00
Philip Molares
bb6d34c88c
Docs: Add Azure, Filesystem, Imgur and S3
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-28 17:46:00 +01:00
Philip Molares
0ac88439ea
Fix compilation with ts-node
ts-node by default does not respect the `files` setting in `tsconfig.json`
and therefore does not respect the d.ts file under `types/`.

This commit adds an explicit `typeRoots` option, as recommended by
https://github.com/TypeStrong/ts-node#help-my-types-are-missing

Fixes #989

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-05 00:37:35 +01:00
Renovate Bot
e1cf539b1c
Update dependency ts-jest to v26.5.3
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-04 08:30:33 +00:00
Renovate Bot
4e532a2c5a
Pin dependencies
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-27 22:12:19 +00:00
Philip Molares
b2008ae734
AppModule: Add reminder to remove synchronize
This auto creates schema on startup and is not intended for production use
See https://typeorm.io/#/connection-options/common-connection-options

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-27 22:58:34 +01:00
Philip Molares
d6e8d9a592
S3Backend: Add S3 MediaBackend
Add minio dependency

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-23 16:14:14 +01:00
Philip Molares
d2bce6e091
MediaConfig: Change s3 config
remove region as this is specified by endPoint now
add bucket in schema and actual assignment

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-23 16:13:33 +01:00
Philip Molares
5195955eb8
MediaConfig: Fix Joi schema alternatives
'...use' tries to go up one level and grab the value of 'use' there and not the same level 'use' as we want here

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-23 15:45:59 +01:00
Philip Molares
1942df0da0
AzureBackend: Add Azure MediaBackend
Add @azure/storage-blob dependency
This is the relevant part of the official azure sdk.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-22 22:33:56 +01:00
Philip Molares
95b3c628ce
DBSchema: Add fileUrl to media_upload table
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-27 11:24:41 +01:00
Philip Molares
a00a093a14
ImgurBackend: Add Imgur MediaBackend
Add node-fetch dependency.
This was chosen as other libs we use already use node-fetch.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-26 16:16:00 +01:00
Philip Molares
c64ca9c012
MediaUploadEntity: Add fileUrl
Save the fileUrl, returned to the user on creation, in the DB.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-26 16:12:14 +01:00
David Mehren
3dd4bf1582
Refactor server version object into own interface
This makes the type of getServerVersionFromPackageJson() way easier
to read.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 21:21:41 +01:00
David Mehren
b0c5cdaa0d
Enforce the use of function declarations
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 17:54:24 +01:00
David Mehren
5987e2ed7e
Refactor config utils to use functions instead of consts
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 17:45:44 +01:00
David Mehren
b128efebff
Enforce explicit function return types
This re-enables the `@typescript-eslint/explicit-module-boundary-types`
check and also enables the
`@typescript-eslint/explicit-function-return-type` check.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 17:41:32 +01:00
David Mehren
05926c08d6
FilesystemBackend: Fix ESLint errors
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-26 12:24:35 +01:00
David Mehren
56d28188e7
NotesController: Fix ESLint errors
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-24 22:33:47 +01:00
David Mehren
dd424cbcee
MeController: Fix ESLint errors
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-24 22:33:29 +01:00