🔨 Infer typings for config schema (#2656)
* 🚚 Move schema to standalone file * ⚡ Add assertions to string literal arrays * ✨ Infer typings for convict schema * 🔥 Remove unneeded assertions * 🔨 Fix errors surfaced by typings * ⚡ Type nodes.include/exclude per docs * ⚡ Account for types for exception paths * ⚡ Set method alias to flag incorrect paths * ⚡ Replace original with alias * ⚡ Make allowance for nodes.include * ⚡ Adjust leftover calls * 🔀 Fix conflicts * 🔥 Remove unneeded castings * 📘 Simplify exception path type * 📦 Update package-lock.json * 🔥 Remove unneeded imports * 🔥 Remove unrelated file * ⚡ Update schema * ⚡ Update interface * 📦 Update package-lock.json * 📦 Update package-lock.json * 🔥 Remove leftover assertions Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
@@ -31,7 +31,7 @@ export function usersNamespace(this: N8nApp): void {
|
||||
this.app.post(
|
||||
`/${this.restEndpoint}/users`,
|
||||
ResponseHelper.send(async (req: UserRequest.Invite) => {
|
||||
if (config.get('userManagement.emails.mode') === '') {
|
||||
if (config.getEnv('userManagement.emails.mode') === '') {
|
||||
Logger.debug(
|
||||
'Request to send email invite(s) to user(s) failed because emailing was not set up',
|
||||
);
|
||||
@@ -56,14 +56,14 @@ export function usersNamespace(this: N8nApp): void {
|
||||
}
|
||||
|
||||
// TODO: this should be checked in the middleware rather than here
|
||||
if (config.get('userManagement.disabled')) {
|
||||
if (config.getEnv('userManagement.disabled')) {
|
||||
Logger.debug(
|
||||
'Request to send email invite(s) to user(s) failed because user management is disabled',
|
||||
);
|
||||
throw new ResponseHelper.ResponseError('User management is disabled');
|
||||
}
|
||||
|
||||
if (!config.get('userManagement.isInstanceOwnerSetUp')) {
|
||||
if (!config.getEnv('userManagement.isInstanceOwnerSetUp')) {
|
||||
Logger.debug(
|
||||
'Request to send email invite(s) to user(s) failed because the owner account is not set up',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user