Commit graph

1345 commits

Author SHA1 Message Date
David Mehren
5ecb0c0694
RevisionsService: Refactor getFirst/LastRevision
The functions now expect a `Note` object instead of a noteId to
make it more consistent with other functions.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-08-29 22:45:56 +02:00
David Mehren
fe26f1689c
MediaService: Refactor saveFile
The function now expects a `Note` object instead of a noteId
and a `User` instead of a username to
make it more consistent with other functions.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-08-29 22:28:21 +02:00
David Mehren
341e3a3e5a
HistoryService: Remove getEntryByNoteIdOrAlias
As we now have a GetNotePipe, we can easily get rid of this function.
All clients can directly provide a `Note` instance
and use `getEntryByNote`.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-08-29 21:57:35 +02:00
David Mehren
d2b60a316f
HistoryService: Refactor deleteHistoryEntry
The function now expects a `Note` object instead of a noteId to
make it more consistent with other functions.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-08-29 21:42:46 +02:00
David Mehren
839877dbc5
HistoryService: Refactor updateHistoryEntry
The function now expects a `Note` object instead of a noteId to
make it more consistent with `updateHistoryEntryTimestamp`.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-08-29 21:38:10 +02:00
David Mehren
3396d3e47d
UserService: Improve method naming
This renames `createOrUpdateHistoryEntry` to `updateHistoryEntryTimestamp`,
which reduces confusion with the similarly named
`updateHistoryEntry` function.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-08-29 21:19:53 +02:00
David Mehren
e65c19ddd8
Public API: Test that forbidden notes can't be accessed
Signed-off-by: David Mehren <git@herrmehren.de>
2021-08-29 17:36:03 +02:00
David Mehren
470f09d8fe
Private API: Use GetNotePipe
This replaces repeated calls to `noteService.getNoteByIdOrAlias`
and associated error handling with the `GetNotePipe`
in the `Param` decorator.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-08-29 17:33:02 +02:00
David Mehren
ed8fd3939c
Public API: Remove superfluous try/catch
`getNoteMetadata` does not use a method that
can throw a `PermissionsUpdateInconsistentError`.
The try/catch-block seems to be a copy-paste error.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-08-29 17:32:45 +02:00
David Mehren
83869aaa48
Public API: Use GetNotePipe
This replaces repeated calls to `noteService.getNoteByIdOrAlias`
and associated error handling with the `GetNotePipe`
in the `Param` decorator.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-08-29 17:28:14 +02:00
David Mehren
73be10e606
Implement GetNotePipe
This pipe transforms a note ID or alias to a Note object
by loading it from the database.
It also performs error handling

Signed-off-by: David Mehren <git@herrmehren.de>
2021-08-29 17:18:54 +02:00
renovate[bot]
3265c72515
chore(deps): lock file maintenance (#1620)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-06 04:53:58 +00:00
renovate[bot]
5f3024d42f
chore(deps): lock file maintenance (#1618)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-06 02:24:16 +00:00
Erik Michelson
5d725d04d6
Update readme link to explanation page
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2021-09-05 11:52:12 +02:00
Renovate Bot
71f15ebec5
chore(deps): update dependency eslint-plugin-prettier to v4
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-09-04 17:19:26 +00:00
Renovate Bot
2e4282bc61
chore(deps): update linters to v4.30.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-09-04 17:19:14 +00:00
David Mehren
b480adc807
Public API: Introduce RequestUser decorator
This introduces the `RequestUser` decorator
to extract the `User` from a request.

It reduces code duplication across the public API
and allows us to drop the override of the `Request` type from express.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-08-28 19:03:15 +02:00
Yannick Bungers
3b5ccddfcc
Fix copy paste error in auth toAuthTokenDto test
Add an hour difference between createdAt and validUntil to better detect
these errors.

Signed-off-by: Yannick Bungers <git@innay.de>
2021-09-03 19:15:42 +02:00
renovate[bot]
8517eda620
chore(deps): update dependency mkdocs-material to v7.2.6 (#1606)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-01 22:18:35 +00:00
renovate[bot]
904b4c6ff4
chore(deps): update dependency @types/node to v14.17.14 (#1603)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-01 00:40:16 +00:00
renovate[bot]
c3f38c03e9
chore(deps): update dependency @types/node to v14.17.13 (#1601)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-31 19:05:45 +00:00
renovate[bot]
4c3ca0bbdc
chore(deps): lock file maintenance (#1597)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-30 02:35:31 +00:00
Renovate Bot
bc03a41782
chore(deps): pin dependency @trivago/prettier-plugin-sort-imports to 2.0.4
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-08-29 19:44:38 +00:00
Renovate Bot
6ef470953b
chore(deps): pin dependency eslint-plugin-prettier to 3.4.1
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-08-29 19:44:51 +00:00
David Mehren
4d60686591
Run prettier format checks in ESLint
This enables the prettier ESLint plugin.
In contrast to the prettier ESLint config (which is already enabled),
the plugin also runs checks against prettiers format rules
as part of ESLint.
This enables instant feedback in the editor,
when code violates the format rules and allows for quick-fix actions.

See also https://github.com/prettier/eslint-plugin-prettier#recommended-configuration

Signed-off-by: David Mehren <git@herrmehren.de>
2021-08-29 19:54:56 +02:00
David Mehren
9450f500d6
Cleanup some imports
Signed-off-by: David Mehren <git@herrmehren.de>
2021-08-29 18:57:00 +02:00
David Mehren
5ed2fae44e
Enforce import order with prettier
Signed-off-by: David Mehren <git@herrmehren.de>
2021-08-29 18:45:46 +02:00
David Mehren
879fd1be5a
Setup prettier plugin to sort imports
Signed-off-by: David Mehren <git@herrmehren.de>
2021-08-29 18:45:06 +02:00
Renovate Bot
923d033e9b
chore(deps): update dependency tsconfig-paths to v3.11.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-08-29 14:11:47 +00:00
Renovate Bot
c03e9b25d0
chore(deps): update dependency typescript to v4.4.2
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-08-29 13:48:58 +00:00
Renovate Bot
8bd0b46b28
chore(deps): update dependency jest to v27.1.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-08-27 12:25:08 +00:00
renovate[bot]
aad08587fd
fix(deps): update dependency @types/minio to v7.0.10 (#1581)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-26 10:06:09 +00:00
renovate[bot]
61fc6b7172
chore(deps): update dependency @types/node to v14.17.12 (#1579)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-26 03:09:55 +00:00
renovate[bot]
01f737aa12
chore(deps): update dependency mkdocs-material to v7.2.5 (#1577)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-25 08:56:08 +00:00
renovate[bot]
b9074c9a2e
chore(deps): update dependency eslint-plugin-import to v2.24.2 (#1575)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-25 02:27:59 +00:00
renovate[bot]
2474167f38
chore(deps): update linters to v4.29.3 (#1572)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-23 19:01:13 +00:00
renovate[bot]
9b68560072
chore(deps): update dependency @nestjs/schematics to v8.0.3 (#1569)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-23 09:39:11 +00:00
renovate[bot]
e2fbf96227
chore(deps): update dependency @types/node to v14.17.11 (#1567)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-21 03:44:45 +00:00
renovate[bot]
27412918ac
fix(deps): update dependency minio to v7.0.19 (#1565)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-20 02:44:58 +00:00
renovate[bot]
d9c298e616
chore(deps): update dependency eslint-plugin-import to v2.24.1 (#1564)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-19 23:32:21 +00:00
David Mehren
7de9275f4b
Port over PR template from master
Signed-off-by: David Mehren <git@herrmehren.de>
2021-08-19 19:55:09 +02:00
renovate[bot]
24e020ca58
chore(deps): update dependency @types/node to v14.17.10 (#1560)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-19 00:30:29 +00:00
renovate[bot]
e8bd20dc3a
chore(deps): update dependency ts-node to v10.2.1 (#1558)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-18 19:19:06 +00:00
renovate[bot]
2f11ff5e2b
chore(deps): update dependency supertest to v6.1.6 (#1557)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-18 00:16:13 +00:00
renovate[bot]
520a9e122c
chore(deps): update dependency ts-jest to v27.0.5 (#1553)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-17 11:03:59 +00:00
renovate[bot]
e6ba6c7774
chore(deps): update linters to v4.29.2 (#1552)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-16 19:19:15 +00:00
renovate[bot]
1199b17596
chore(deps): lock file maintenance (#1550)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-16 03:30:02 +00:00
Renovate Bot
2748d68f0b
chore(deps): update dependency @types/jest to v27
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-08-13 09:08:16 +00:00
renovate[bot]
44c2cd05ba
fix(deps): update dependency typeorm to v0.2.37 (#1534)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-13 09:07:04 +00:00
renovate[bot]
3de55a6b63
chore(deps): update dependency mkdocs-material to v7.2.4 (#1529)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-11 22:21:33 +00:00