Commit graph

957 commits

Author SHA1 Message Date
Renovate Bot
805c6afde9
chore(deps): update dependency ts-node to v10
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-06-01 18:40:23 +00:00
Renovate Bot
510ee82a67
fix(deps): update dependency typeorm to v0.2.33
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-06-01 18:39:56 +00:00
Renovate Bot
94d89419b5
fix(deps): update dependency rxjs to v7.1.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-06-01 18:31:50 +00:00
Renovate Bot
1a2610a05e
fix(deps): update dependency file-type to v16.5.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-06-01 18:31:37 +00:00
Renovate Bot
43b283871b
chore(deps): update dependency typescript to v4.3.2
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-06-01 18:31:24 +00:00
Renovate Bot
af20b940ce
chore(deps): update dependency ts-loader to v9.2.2
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-06-01 18:22:22 +00:00
Renovate Bot
db9312a88a
fix(deps): update nestjs packages to v7.6.17
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-06-01 18:22:08 +00:00
Renovate Bot
fcb69776b9
chore(deps): update dependency @types/express to v4.17.12
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-06-01 18:05:20 +00:00
David Mehren
d3424d4096
Update dependency ts-jest to v27
Signed-off-by: David Mehren <git@herrmehren.de>
2021-06-01 20:10:06 +02:00
Renovate Bot
3db49e8535
chore(deps): update dependency jest to v27
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-06-01 18:07:00 +00:00
Renovate Bot
25851f7a8d
chore(deps): update dependency mkdocs-material to v7.1.6
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-31 20:44:54 +00:00
David Mehren
43f887b4c1
EditDto: Clarify that the username can be null
If the edit was made by a anonymous user, we don't have a username.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-31 22:04:59 +02:00
David Mehren
1b1e232476
Rename NoteAuthorshipDto to EditDto
After Authorship was renamed to Edit, the DTO should follow.
The file is also moved to the revisions folder, where the entity
already is.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-31 22:02:32 +02:00
David Mehren
b2d37abf6c
Rename Authorship entity to Edit
As we now have a separate Author entity, which holds information
about an author (the color), the Authorship name became confusing.
Edit seems to be a better name, as the entity saves information
about a change in a note.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-31 21:46:41 +02:00
David Mehren
5846ca75a9
NotesService: Implement getAuthorUsers
This reimplements logic to get all Users that ever edited a note
and fixes the empty `editedBy` property of `toNoteMetadataDto`
introduced in 81cc092e.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-24 21:58:44 +02:00
David Mehren
6abcb686ca
Seed: Generate multiple notes and authorships
Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-19 21:09:15 +02:00
David Mehren
f6d430c23f
Adjust tests to new Session and Author entities
Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-17 22:28:35 +02:00
David Mehren
3d07c5e443
AuthorshipEntity: Adjust to DB schema
This commit replaces the user property with a author property,
in accordance with the DB schema updated in 0d6c3002.

It also adjusts the NoteService accordingly.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-19 22:12:25 +02:00
David Mehren
8040f47d00
Add Author property to Session & User
The DB schema was updated in 0d6c3002,
this adds the new author property to
the Session and User entities.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-31 18:39:33 +02:00
David Mehren
1dc6db24a9
AuthorEntity: Add create method
Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-19 22:12:00 +02:00
David Mehren
4e14053f8f
AuthorEntity: Add missing properties
This adds the missing properties according to the DB PlantUML schema

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-31 18:11:48 +02:00
David Mehren
59a4c72299
UsersModule: Add Session to TypeORM module
This seems to have been missed in
db026d6a57, where the Session entity
was added.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-31 18:15:10 +02:00
David Mehren
283ec673cf
Remove AuthorColor entity
It will be replaced with the Author entity,
that will save the color

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-17 21:08:13 +02:00
David Mehren
fddb7e8c8c
Allow anonymous user colors in DB schema
Every authorship now has an author that saves the color.
The author links to the session and optionally the user.
For anonymous users, the session now can be used to reidentify the user.
 If the user is logged-in, the userId is saved into the author table.
 This allows to identify the user even after the session expired.

 A note created by an anonymous user does not have an owner.
 The cardinality was updated to reflect that.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-04-29 18:07:06 +02:00
Renovate Bot
4205856b41
chore(deps): update linters
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-31 17:49:08 +00:00
Sheogorath
3672a42fc0
Fix link is SECURITY.md
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2021-05-27 15:18:09 +02:00
David Mehren
9e5d95657d
Move publicID creation to Note.create
Before this commit, `Note.create()` did not return a complete object,
as the `publicId` property was missing.
This adds the generation of the property to the `create` method and
moves the actual generation code from the `NotesService`
to a utility method.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-19 21:19:08 +02:00
Renovate Bot
0aa27e01b0
chore(deps): update dependency mkdocs-material to v7.1.5
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-19 09:14:00 +00:00
Philip Molares
0f58757858
chore(test): Change test to work with publicId
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-16 22:46:02 +02:00
Philip Molares
b7e52f8166
feat(notes): Use publicId in notes service
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-16 22:44:43 +02:00
Philip Molares
e1ac2cfa69
chore(dependency): Add base32-encode
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-17 07:59:51 +02:00
Philip Molares
ce132f2432
feat(note): Add publicId field
This field is a randomly generated 128-bit value encoded with base32-encode using the crockford variant and converted to lowercase.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-16 22:43:42 +02:00
Philip Molares
92066d0746
chore(plantuml): Add publicId to note
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-16 22:54:45 +02:00
Philip Molares
875e848b80
refactor: Remove randomString function
This was done because it was only a wrapper for a nodejs function to check if the given parameter is a positive number.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-16 22:41:01 +02:00
Renovate Bot
69a2a24511
Update linters to v4.24.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-17 17:58:33 +00:00
Renovate Bot
942abfdc3d
Lock file maintenance
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-17 02:45:24 +00:00
Thomas Snowden
7087135ea4
Add API decorator to reduce clutter
Signed-off-by: Thomas Snowden <zapperchamp1@gmail.com>
2021-04-24 19:10:16 -04:00
David Mehren
eaf1852fe5
Format with Prettier 2.3
Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-15 21:13:44 +02:00
Renovate Bot
6658f0d5b4
Update dependency prettier to v2.3.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-15 19:06:39 +00:00
Renovate Bot
52d58f2d7e
Lock file maintenance
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-15 20:10:29 +00:00
Renovate Bot
b965d62dc6
Update linters
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-15 19:06:53 +00:00
Renovate Bot
d0d211e7ad
Update dependency rxjs to v7.0.1
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-13 21:31:38 +00:00
Renovate Bot
1b949fce99
Update dependency @types/node to v13.13.52
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-12 20:40:04 +00:00
Philip Molares
f739687b00
Refactor(note): Remove shortid from note
This is a 1.x relict and isn't used anymore in 2.x. All 1.x shortids will be converted to aliases on migration of 1.x to 2.x.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-11 22:37:52 +02:00
Philip Molares
f5039791ed
Linting: Fixed wrong logger contexts
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-02 21:53:28 +02:00
Philip Molares
8cc9e12bc3
ESLint: Add custom rule 'correct-logger-context'
This rule ensures, that the correct context is given in any logger statements.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-02 19:45:47 +02:00
David Mehren
375cb4eae9
AuthTokenEntity: Make validUntil not nullable
As all tokens are valid for a maximum of 2 years, the
validUntil attribute is always populated.

This updates the database schema and the DTO to reflect that.

Fixes #1256

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-09 22:05:47 +02:00
David Mehren
6ddaa59e8c
Remove superfluous overrideProvider statements
Fixes #1254

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-09 21:34:43 +02:00
Renovate Bot
6319b69aee
Update dependency @types/bcrypt to v5
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-09 19:42:04 +00:00
David Mehren
076c9c502d
Add error handling in seed.ts
Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-02 18:35:38 +02:00