Commit graph

613 commits

Author SHA1 Message Date
David Mehren
f79492fe63
NoteEntity: Fix ESLint errors
We now use @types/shortid to provide type information

Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-24 21:10:24 +01:00
David Mehren
71e2f06bbb
Fix ESLint errors in main.ts
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-24 21:08:08 +01:00
David Mehren
cc1ca69bc1
Fix various ESLint errors in services
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-24 22:35:06 +01:00
David Mehren
f20c2f06e0
Fix various ESLint errors in E2E tests
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-24 21:14:16 +01:00
David Mehren
21403ba606
Fix various ESLint errors in unit tests
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-24 20:20:04 +01:00
David Mehren
208ff1d039
Fix various ESLint errors in configs
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-24 20:29:39 +01:00
David Mehren
616f963b8e
HistoryService: toHistoryEntryDto does not need to be async
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-24 21:19:48 +01:00
David Mehren
bfa5f0dfc6
NotesService: toNotePermissionsDto does not need to be async
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-24 21:17:05 +01:00
David Mehren
def4ef145e
AuthService: randomString does not need to by async
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-23 22:16:27 +01:00
David Mehren
fed3a12779
Add explicit Request type
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-23 21:48:37 +01:00
David Mehren
a5d922b5f8
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-23 21:20:01 +01:00
David Mehren
e4ba59f154
Don't await non-Promises
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-23 21:14:39 +01:00
David Mehren
cc010ddf2a
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-23 21:45:36 +01:00
David Mehren
68fd375d95
Enable ESLint rules with type-checks
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-23 21:15:10 +01:00
David Mehren
117e9ec708
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-20 21:27:37 +01:00
David Mehren
e83f1e206b
ESLint: Enable @typescript-eslint/naming-convention rule
This check enforces consistent variable naming.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-20 21:15:45 +01:00
David Mehren
1114127b80
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-20 20:41:42 +01:00
David Mehren
9485597e6f
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-20 20:14:36 +01:00
David Mehren
2ba824d9e2
ESLint: Re-enable @typescript-eslint/no-explicit-any rule
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-24 21:59:28 +01:00
Yannick Bungers
b1616ea854
Docs: Add description for special groups
Signed-off-by: Yannick Bungers <git@innay.de>
2021-02-27 14:16:29 +01:00
Philip Molares
0e4b65ca9d
MediaBackendInterface: Correct JSDoc of deleteFile
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-27 12:24:02 +01:00
Philip Molares
2c6af85f14
FilesystemBackend: Remove getFileURL
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-27 11:38:50 +01:00
Philip Molares
4ef3fd029d
MediaBackendInterface: Remove getFileURL
closes #957

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-26 16:15:46 +01:00
Renovate Bot
2c7f892069
Update dependency mkdocs-material to v7.0.3
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-26 16:08:02 +00:00
Renovate Bot
c930955123
Update dependency bcrypt to v5.0.1
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-26 05:34:10 +00:00
Renovate Bot
440f035438
Update dependency @nestjs/schematics to v7.2.8
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-26 09:55:26 +00:00
Philip Molares
3aeda955d9
MediaController: Handle MediaBackendErrors
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-25 13:59:32 +01:00
Philip Molares
8e7be737fa
FilesystemBackend: Throw MediaBackendError where appropriate
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-25 13:52:50 +01:00
Philip Molares
8515d824b7
MediaService: Add MediaBackendError
This get's thrown when the backend can't perform the required action.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-25 13:51:54 +01:00
Philip Molares
df1ae4d512
ConsoleLogger: Add typing to localeStringOptions
This is necessary as typescript is unable to determine that `year` in this object is of type "numeric" and not string.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-24 10:30:20 +01:00
Renovate Bot
7f27fb3768
Update dependency typescript to v4.2.2
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-23 23:51:55 +00:00
Renovate Bot
50fe3533f9
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
Philip Molares
1ea4bd03d9
ESLint: Remove prettier/@typescript-eslint
This rule no longer exists. According to the documentation on
https://github.com/prettier/eslint-config-prettier#installation this is
not needed anymore.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-21 16:51:48 +01:00
Renovate Bot
04bc1c587c
Update dependency eslint-config-prettier to v8
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-21 12:01:55 +00:00
Renovate Bot
580f6bbbcf
Update dependency mkdocs-material to v7
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-25 19:21:18 +00:00
Renovate Bot
1625872c8d
Update linters to v4.15.2
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-25 19:07:03 +00:00
Renovate Bot
2cd1554d79
Update dependency ts-jest to v26.5.2
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-25 19:03:08 +00:00
Renovate Bot
4ad723734b
Update dependency rxjs to v6.6.6
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-25 01:19:34 +00:00
Renovate Bot
99c50f1f91
Update NestJS packages
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-24 14:12:26 +00:00
Philip Molares
0c30f3f0cc
PermissionsModule: Remove unused imports
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-23 19:13:41 +01:00
Yannick Bungers
8b75867664
Rename getNoteContentByNote to getNoteContent
Signed-off-by: Yannick Bungers <git@innay.de>
2021-02-22 22:34:18 +01:00
Yannick Bungers
8ec756afb4
Remove unused getNoteContentByIdOrAlias
Signed-off-by: Yannick Bungers <git@innay.de>
2021-02-22 22:31:02 +01:00
Yannick Bungers
8873ac316a
Rename viewcount to viewCount for compliance
Signed-off-by: Yannick Bungers <git@innay.de>
2021-02-22 23:36:44 +01:00
Philip Molares
4d89ffd474
NotesService: Replace noteByIdOrAlias with note as parameter
As the NotesController has the note already, because it checked with it if the user has the permission to perform the action, it's not necessary to get the note from the DB again, instead we should just provide the note to the functions directly.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 16:50:11 +01:00
Philip Molares
e538056252
NotesController: Handle new errors
Handle the AlreadyInDB and PermissionsUpdateInconsistent errors and correctly show them to the api user as BadRequest errors.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 16:11:51 +01:00
Philip Molares
13955aebe5
NotesE2ETests: Ensure posting the same note alias twice fails
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 16:10:30 +01:00
Philip Molares
bafe379cc3
NotesService: Add unit tests
Fixed toUserDto method of UsersService: If a user has no email an empty string should be returned (like with the photoUrl) instead of null.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 16:09:22 +01:00
Philip Molares
128d861512
NotesService: Finished hardcoded functions
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 16:09:02 +01:00
Philip Molares
ff61fea96f
Errors: Add AlreadyInDB and PermissionsUpdateInconsistent error
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 16:07:09 +01:00
Philip Molares
b1683a5c64
GroupsService: Create new GroupsService
This service is necessary as we plan to have functions to create and manipulate groups in the future.
The GroupInfoDto was moved from the file note-permissions.dto.ts to mimic the UserInfoDto.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 11:41:15 +01:00