Commit graph

3307 commits

Author SHA1 Message Date
Philip Molares
eb7e6b55eb DBSchema: Add fileUrl to media_upload table
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-27 22:03:09 +01:00
Philip Molares
e2b2059bde 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-27 21:29:14 +01:00
Philip Molares
165bb7602b 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-27 21:29:14 +01:00
Yannick Bungers
a92096034d
Merge pull request #936 from hedgedoc/maint/stronger_lint_checks 2021-02-27 21:24:35 +01:00
David Mehren
609b1cf3a3
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
fc1008e773
Enforce the use of function declarations
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 17:54:24 +01:00
David Mehren
235d7efa19
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
9fcc3c6cee
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
73db821649
FilesystemBackend: Fix ESLint errors
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 16:11:27 +01:00
David Mehren
0a23538389
NotesController: Fix ESLint errors
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 16:11:27 +01:00
David Mehren
38b787fe25
MeController: Fix ESLint errors
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 16:11:27 +01:00
David Mehren
b22d641406
ConsoleLoggerService: Fix ESLint errors
We now use @types/cli-color to provide type information

Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 16:11:27 +01:00
David Mehren
a0ffa3be04
NoteEntity: Fix ESLint errors
We now use @types/shortid to provide type information

Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 16:11:27 +01:00
David Mehren
2c841ae578
Fix ESLint errors in main.ts
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 16:11:27 +01:00
David Mehren
1cc86a728a
Fix various ESLint errors in services
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 16:11:27 +01:00
David Mehren
4d94739a9f
Fix various ESLint errors in E2E tests
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 16:11:27 +01:00
David Mehren
8c3bf66469
Fix various ESLint errors in unit tests
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 16:11:27 +01:00
David Mehren
c5fb87de05
Fix various ESLint errors in configs
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 16:11:27 +01:00
David Mehren
b37b2d1047
HistoryService: toHistoryEntryDto does not need to be async
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 16:11:27 +01:00
David Mehren
d8d105ed75
NotesService: toNotePermissionsDto does not need to be async
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 16:11:27 +01:00
David Mehren
b5281991ef
AuthService: randomString does not need to by async
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 16:11:27 +01:00
David Mehren
ba4825a99f
Add explicit Request type
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 16:11:27 +01:00
David Mehren
b78c94c3a1
Use Req decorator instead of Request
This avoids a clash with the Request type from express

Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 16:11:27 +01:00
David Mehren
2b14ad92cd
Don't await non-Promises
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 16:11:27 +01:00
David Mehren
f3f0360a95
Add custom express types
We add a custom User object into the request object. To be able to use
that object in a strongly-typed situation, we need to tell TypeScript
that it exists.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 16:11:27 +01:00
David Mehren
1818365d49
Merge pull request #967 from hedgedoc/docs/special-groups
Docs: Add description for special groups
2021-02-27 14:39:34 +01:00
Yannick Bungers
e351d8557a Docs: Add description for special groups
Signed-off-by: Yannick Bungers <git@innay.de>
2021-02-27 14:16:29 +01:00
David Mehren
b93cf3ef2f
Merge pull request #964 from hedgedoc/mediaBackend/removeGetFileUrl 2021-02-27 13:03:42 +01:00
Philip Molares
7f9c310e58 MediaBackendInterface: Correct JSDoc of deleteFile
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-27 12:24:02 +01:00
Philip Molares
062104f64b FilesystemBackend: Remove getFileURL
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-27 11:38:50 +01:00
Philip Molares
d83e0004b7 MediaBackendInterface: Remove getFileURL
closes #957

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-27 00:28:17 +01:00
David Mehren
8326fb6aaa
Merge pull request #963 from hedgedoc/renovate/develop-mkdocs-material-7.x
Update dependency mkdocs-material to v7.0.3 (develop)
2021-02-26 18:45:57 +01:00
Renovate Bot
2e949175e8
Update dependency mkdocs-material to v7.0.3
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-26 16:08:02 +00:00
David Mehren
ba771fb7b6
Enable ESLint rules with type-checks
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-26 12:10:53 +01:00
David Mehren
0a337f03c5
ESLint: Remove @typescript-eslint/explicit-function-return-type rule
The rule does not seem to be enabled at all, as it is not part of the
recommended set.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-26 12:10:53 +01:00
David Mehren
3626ce9dff
ESLint: Enable @typescript-eslint/naming-convention rule
This check enforces consistent variable naming.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-26 12:10:53 +01:00
David Mehren
c3129d40e0
ESLint: Remove @typescript-eslint/interface-name-prefix rule
The check was removed from typescript-eslint and replaced by the
naming-convention rule.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-26 12:10:53 +01:00
David Mehren
6ffeb2e9c9
ESLint: Enable @typescript-eslint/return-await rule
This ensures stack traces are helpful at the cost of a slightly
lower performance (one more tick in the event loop).

Fixes #838

Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-26 12:10:51 +01:00
David Mehren
6a6dc7ea21
ESLint: Re-enable @typescript-eslint/no-explicit-any rule
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-26 12:10:05 +01:00
David Mehren
d13466a626
Merge pull request #959 from hedgedoc/renovate/develop-bcrypt-5.x
Update dependency bcrypt to v5.0.1 (develop)
2021-02-26 12:06:34 +01:00
David Mehren
30c13621a5
Merge pull request #960 from hedgedoc/renovate/develop-nestjs-packages
Update dependency @nestjs/schematics to v7.2.8 (develop)
2021-02-26 12:06:20 +01:00
Renovate Bot
022070107c
Update dependency @nestjs/schematics to v7.2.8
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-26 09:55:26 +00:00
Renovate Bot
b9f2cce548
Update dependency bcrypt to v5.0.1
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-26 05:34:10 +00:00
Yannick Bungers
75be4611d3
Merge pull request #953 from hedgedoc/mediaBackendErrors 2021-02-25 22:23:11 +01:00
David Mehren
25bb00c5ef
Merge pull request #950 from hedgedoc/renovate/develop-typescript-4.x 2021-02-25 21:48:49 +01:00
David Mehren
de30189ba4
Merge pull request #956 from hedgedoc/renovate/develop-linters
Update dependency eslint-config-prettier to v8.1.0 (develop)
2021-02-25 21:44:53 +01:00
Renovate Bot
7e5e366c4b
Update dependency eslint-config-prettier to v8.1.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-25 20:02:01 +00:00
David Mehren
8c784beaf8
Merge pull request #938 from hedgedoc/renovate/develop-major-linters 2021-02-25 21:00:56 +01:00
David Mehren
0dac8672f8
Merge pull request #946 from hedgedoc/renovate/develop-mkdocs-material-7.x
Update dependency mkdocs-material to v7 (develop)
2021-02-25 20:46:01 +01:00
Renovate Bot
906bf7d321
Update dependency mkdocs-material to v7
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-25 19:21:18 +00:00