Commit graph

2851 commits

Author SHA1 Message Date
David Mehren
7359b468e4
ESLint fixes for tests 🚨
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-22 21:48:15 +02:00
David Mehren
ac030760ba
Fix mocha tests in TypeScript
`mock-require` does not work with TypeScript, as the compiled JS expects a sub-object: `import { config } from Config` compiles to `const config_1 = require("./config")`, but the config object is now in `config_1.config`, *not* in `config_1` directly.

Therefore `mock-require` was replaced with `ts-mock-imports`, which also simplifies the code a bit.

Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-22 21:48:15 +02:00
David Mehren
3b8c85cc9b
Migrate tests to TypeScript
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-22 21:48:11 +02:00
David Mehren
2121e271ac
errors.ts: Convert require to import
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-22 21:11:59 +02:00
David Mehren
5cda02590b
ESLint fixes for Notes
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-22 21:11:58 +02:00
David Mehren
acdd627027
Lint .ts files too
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-22 21:11:37 +02:00
David Mehren
c164746cae
Fixes for formatting and broken rebase
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-22 21:11:02 +02:00
Sheogorath
6d2a70210a
Merge branch 'pr-origin-365' into release/2.0.x 2020-05-22 16:21:17 +02:00
Sheogorath
415a725484
Merge branch 'pr-origin-361' into release/2.0.x 2020-05-22 16:18:42 +02:00
David Mehren
aaff73036b
Fix remaining paths after moving everything to src
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-22 14:19:12 +02:00
David Mehren
3bf54999f1
Remove file extension from dmpWorker path
Node automatically loads the .js or .ts file depending on how it is run.

Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-22 14:19:12 +02:00
David Mehren
852096d1ab
Remove remaining (empty) .js files
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-22 14:19:12 +02:00
Philip Molares
8246175b5a
Only include src directory in tsconfig.json
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2020-05-22 14:19:12 +02:00
Philip Molares
fab2607e4d
Move lib and test into src directory
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2020-05-22 14:19:05 +02:00
Sheogorath
241c418ea7
Merge pull request #358 from davidmehren/more-types
More type annotations
2020-05-17 15:05:51 +02:00
Sheogorath
06cb64de31
Merge pull request #342 from SuperSandro2000/fix-links
Fix redirected, outdated links and convert all to https
2020-05-17 14:59:26 +02:00
David Mehren
798586c996
Add basic test for auth middlewares
To check for basic mistakes like broken imports, these tests try to create all middlewares (excluding SAML, because that requires a certificate file on disk)

Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-16 21:16:38 +02:00
David Mehren
3262315248
Fix generateAvatarURL
Previously, we checked for `typeof email !== 'string'`. This code got turned into `email.length === 0`, which changed the behaviour of the method.
Because TypeScript makes sure that `email` is always a string, we can get rid of the check altogether.

Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-16 21:16:38 +02:00
David Mehren
08655f06f9
Profile.emails is now a string array 🏷️
Dropbox wrapped their email attribute in another object. We now unwrap this object in the DropboxMiddleware and don't need to special-case the email attribute in User.parsePhotoByProfile and the Profile type anymore.

Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-16 21:16:38 +02:00
David Mehren
9c720183aa
Fix import in DropboxMiddleware
The passport plugin does not have a default export.

Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-16 21:16:38 +02:00
Sheogorath
5b05760c8f
Merge pull request #356 from davidmehren/fix-history-get
setHistory: Do not parse history into an array again
2020-05-10 17:15:19 +02:00
David Mehren
6c8c5f1062
Type annotations for realtime.ts
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-09 19:59:38 +02:00
David Mehren
642ae9417c
Fix interchanged parameters in socket.io disconnect handler. 🐛
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-09 19:59:38 +02:00
David Mehren
394abe7cf8
Fix typings for connect-flash.
The `msg` argument is optional.

Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-09 19:59:37 +02:00
David Mehren
dcdbd3bf35
Replace processData calls with ??
Many times processData was just used to ensure a default value is present. Since TS 3.7 the nullish coalescing operator ?? is supported for that.

Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-09 19:59:37 +02:00
David Mehren
ea9cd56a20
Simplify processData
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-09 19:59:37 +02:00
David Mehren
539d99b835
setHistory: Do not parse history into an array again, historyPost already made sure we have an array
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-09 14:35:06 +02:00
Sheogorath
d3aa040626
Merge pull request #345 from davidmehren/fix-343
findNoteOrCreate: Create new note with empty string instead of `null`
2020-04-28 00:08:02 +02:00
David Mehren
3ac388b765
findNoteOrCreate: Create new note with empty string instead of null
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-26 22:10:20 +02:00
Sandro Jäckel
00bf2e417b
Update all links with https
Signed-off-by: Sandro Jäckel <sandro.jaeckel@gmail.com>
2020-04-26 21:59:08 +02:00
Sandro Jäckel
df1fa4f0c9
Update outdated links
Signed-off-by: Sandro Jäckel <sandro.jaeckel@gmail.com>
2020-04-26 21:59:07 +02:00
Sheogorath
2c7d743cb6
Merge pull request #338 from davidmehren/typescript-pr
Migrate Backend to TypeScript
2020-04-26 15:44:17 +02:00
David Mehren
5996e4c594
Always sync session table to database
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:20 +02:00
Philip Molares
6480c142a9
fixed usage of migrations
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:20 +02:00
Philip Molares
94c3857d49
sort app.ts
moved handleTermSignals to utils.ts

Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:20 +02:00
Philip Molares
9d17f6a7f4
removed anonymous function to generate ca
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:19 +02:00
Philip Molares
e015234aaf
ordered imports
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:19 +02:00
David Mehren
ba6055a03d
Downgrade jQuery to 3.4.1
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:19 +02:00
Yannick Bungers
9c38a339df
Added types and removed requires from app.ts
Signed-off-by: Yannick Bungers <git@innay.de>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:19 +02:00
David Mehren
e0192b5652
history.ts: Fix 🚑 getHistory
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:19 +02:00
David Mehren
2408aef54c
dmpWorker.ts: Wrap process.send in a function to not lose this 🐛
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:18 +02:00
David Mehren
d89cf23fdd
revision.ts: Remove .connected from dmpWorker check in sendDmpWorker.
Why did it appear there? Nobody knows...

Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:18 +02:00
David Mehren
3f87539d7d
dmpWorker.ts: Fix check for attributes on data object
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:18 +02:00
David Mehren
dd63f789f7
auth/email: Redirect on (un)successful registration
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:18 +02:00
David Mehren
3ea64b2308
models/revision.ts: Fix primary key default value
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:18 +02:00
Yannick Bungers
c24023437f
Fixed Bug with multiple messages
Signed-off-by: Yannick Bungers <git@innay.de>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:17 +02:00
David Mehren
dc3a3f2994
Migrate editor-socketio-server.js to TypeScript
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:17 +02:00
David Mehren
c7478157e2
models/revision.ts: Use .js extension to load dump worker.
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:17 +02:00
David Mehren
73d4023155
note/actions.ts: Formatting fixes and lint exceptions
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:17 +02:00
Philip Molares
5a1a25dda4
added auth/oauth2.ts
added oauth2 to ProviderEnum

Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:17 +02:00