The previous Profile type was renamed to PassportProfile, as it is only used for profile-information from Passport plugins.
All functions relating to profile-parsing are now encapsulated in the PhotoProfile class (naming still debatable).
Signed-off-by: David Mehren <dmehren1@gmail.com>
It should be possible to run a backend build without the need to start
the application and without the need to fiddle around with PATH or
fiddling with `node_modules`. Therefore this patch splits the build
command into `build-frontend` and `build-backend`, which will allow
those builds to be done independent and have a separate command `build`
which will provide the combination of both of them.
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
It turns out our shiny new typed ES2015 `Map`s are not serializable to JSON. :(
Luckily, we only use strings as keys and can write a function that converts them to serializable objects!
Signed-off-by: David Mehren <dmehren1@gmail.com>
a7aaded6 started to use a Map for a users note history in various places, but didn't update the code to actually use the Map operations. This broke updating the note history.
Signed-off-by: David Mehren <dmehren1@gmail.com>
`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>
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>
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>
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>