Fix linting issues

This commit is contained in:
ricardo 2022-04-28 20:53:54 -04:00
parent ffdce3b1a2
commit fc0bd9f07c
3 changed files with 16 additions and 18 deletions

View file

@ -1,4 +1,4 @@
import { In, Equal, Not, ObjectLiteral, MoreThan, LessThan } from 'typeorm'; import { In, Equal, Not, ObjectLiteral, LessThan } from 'typeorm';
import { Db, IExecutionFlattedDb } from '../..'; import { Db, IExecutionFlattedDb } from '../..';
import { ExecutionStatus } from '../publicApiRequest'; import { ExecutionStatus } from '../publicApiRequest';

View file

@ -1,6 +1,3 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable import/no-cycle */ /* eslint-disable import/no-cycle */
// eslint-disable-next-line import/no-extraneous-dependencies // eslint-disable-next-line import/no-extraneous-dependencies
import { pick } from 'lodash'; import { pick } from 'lodash';
@ -141,18 +138,20 @@ async function invite(
const resp: { success?: boolean; id?: string } = {}; const resp: { success?: boolean; id?: string } = {};
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
const inviteAcceptUrl = `${baseUrl}/signup?inviterId=${apiKeyOwnerId}&inviteeId=${user?.id}`; const inviteAcceptUrl = `${baseUrl}/signup?inviterId=${apiKeyOwnerId}&inviteeId=${user?.id}`;
const sentEmail = await mailer?.invite({ if (user?.email) {
email: user!.email, const sentEmail = await mailer?.invite({
inviteAcceptUrl, email: user.email,
domain: baseUrl, inviteAcceptUrl,
}); domain: baseUrl,
});
if (sentEmail?.success) { if (sentEmail?.success) {
resp.success = true; resp.success = true;
resp.id = user?.id; resp.id = user?.id;
} else { } else {
resp.success = false; resp.success = false;
resp.id = user?.id; resp.id = user?.id;
}
} }
return resp; return resp;
}), }),
@ -333,7 +332,7 @@ export function clean(
export async function authenticationHandler( export async function authenticationHandler(
req: express.Request, req: express.Request,
scopes: any, scopes: unknown,
schema: OpenAPIV3.ApiKeySecurityScheme, schema: OpenAPIV3.ApiKeySecurityScheme,
): Promise<boolean> { ): Promise<boolean> {
const apiKey = req.headers[schema.name.toLowerCase()]; const apiKey = req.headers[schema.name.toLowerCase()];

View file

@ -5,6 +5,7 @@ import express from 'express';
import validator from 'validator'; import validator from 'validator';
import { LoggerProxy as Logger } from 'n8n-workflow'; import { LoggerProxy as Logger } from 'n8n-workflow';
import { randomBytes } from 'crypto';
import { Db, InternalHooksManager, ResponseHelper } from '../..'; import { Db, InternalHooksManager, ResponseHelper } from '../..';
import { issueCookie } from '../auth/jwt'; import { issueCookie } from '../auth/jwt';
import { N8nApp, PublicUser } from '../Interfaces'; import { N8nApp, PublicUser } from '../Interfaces';
@ -12,8 +13,6 @@ import { validatePassword, sanitizeUser, compareHash, hashPassword } from '../Us
import type { AuthenticatedRequest, MeRequest } from '../../requests'; import type { AuthenticatedRequest, MeRequest } from '../../requests';
import { validateEntity } from '../../GenericHelpers'; import { validateEntity } from '../../GenericHelpers';
import { User } from '../../databases/entities/User'; import { User } from '../../databases/entities/User';
import { randomBytes } from 'crypto';
import { userInfo } from 'os';
export function meNamespace(this: N8nApp): void { export function meNamespace(this: N8nApp): void {
/** /**