⚡ Enable esModuleInterop compiler option and upgrade to TypeScript 4.6 (#3106)
* ⚡ Enable `esModuleInterop` for /core * ⚡ Adjust imports in /core * ⚡ Enable `esModuleInterop` for /cli * ⚡ Adjust imports in /cli * ⚡ Enable `esModuleInterop` for /nodes-base * ⚡ Adjust imports in /nodes-base * ⚡ Make imports consistent * ⬆️ Upgrade TypeScript to 4.6 (#3109) * ⬆️ Upgrade TypeScript to 4.6 * 📦 Update package-lock.json * 🔧 Avoid erroring on untyped errors * 📘 Fix type error Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable import/no-cycle */
|
||||
import { Workflow } from 'n8n-workflow';
|
||||
import { In, IsNull, Not } from 'typeorm';
|
||||
import express = require('express');
|
||||
import { In } from 'typeorm';
|
||||
import express from 'express';
|
||||
import { compare, genSaltSync, hash } from 'bcryptjs';
|
||||
|
||||
import { PublicUser } from './Interfaces';
|
||||
@@ -11,7 +11,7 @@ import { Db, ResponseHelper } from '..';
|
||||
import { MAX_PASSWORD_LENGTH, MIN_PASSWORD_LENGTH, User } from '../databases/entities/User';
|
||||
import { Role } from '../databases/entities/Role';
|
||||
import { AuthenticatedRequest } from '../requests';
|
||||
import config = require('../../config');
|
||||
import * as config from '../../config';
|
||||
import { getWebhookBaseUrl } from '../WebhookHelpers';
|
||||
|
||||
export async function getWorkflowOwner(workflowId: string | number): Promise<User> {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable import/no-cycle */
|
||||
|
||||
import * as jwt from 'jsonwebtoken';
|
||||
import jwt from 'jsonwebtoken';
|
||||
import { Response } from 'express';
|
||||
import { createHash } from 'crypto';
|
||||
import { Db } from '../..';
|
||||
import { AUTH_COOKIE_NAME } from '../../constants';
|
||||
import { JwtToken, JwtPayload } from '../Interfaces';
|
||||
import { User } from '../../databases/entities/User';
|
||||
import config = require('../../../config');
|
||||
import * as config from '../../../config';
|
||||
|
||||
export function issueJWT(user: User): JwtToken {
|
||||
const { id, email, password } = user;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
import { createTransport, Transporter } from 'nodemailer';
|
||||
import { LoggerProxy as Logger } from 'n8n-workflow';
|
||||
import config = require('../../../config');
|
||||
import * as config from '../../../config';
|
||||
import { MailData, SendEmailResult, UserManagementMailerImplementation } from './Interfaces';
|
||||
|
||||
export class NodeMailer implements UserManagementMailerImplementation {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { existsSync, readFileSync } from 'fs';
|
||||
import { IDataObject } from 'n8n-workflow';
|
||||
import { join as pathJoin } from 'path';
|
||||
import { GenericHelpers } from '../..';
|
||||
import config = require('../../../config');
|
||||
import * as config from '../../../config';
|
||||
import {
|
||||
InviteEmailData,
|
||||
PasswordResetData,
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||
/* eslint-disable import/no-cycle */
|
||||
import cookieParser = require('cookie-parser');
|
||||
import * as passport from 'passport';
|
||||
import cookieParser from 'cookie-parser';
|
||||
import passport from 'passport';
|
||||
import { Strategy } from 'passport-jwt';
|
||||
import { NextFunction, Request, Response } from 'express';
|
||||
import * as jwt from 'jsonwebtoken';
|
||||
import jwt from 'jsonwebtoken';
|
||||
import { LoggerProxy as Logger } from 'n8n-workflow';
|
||||
|
||||
import { JwtPayload, N8nApp } from '../Interfaces';
|
||||
import { authenticationMethods } from './auth';
|
||||
import config = require('../../../config');
|
||||
import * as config from '../../../config';
|
||||
import { AUTH_COOKIE_NAME } from '../../constants';
|
||||
import { issueCookie, resolveJwtContent } from '../auth/jwt';
|
||||
import { meNamespace } from './me';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable import/no-cycle */
|
||||
|
||||
import express = require('express');
|
||||
import express from 'express';
|
||||
import validator from 'validator';
|
||||
import { LoggerProxy as Logger } from 'n8n-workflow';
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/* eslint-disable import/no-cycle */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import * as express from 'express';
|
||||
import express from 'express';
|
||||
import validator from 'validator';
|
||||
import { LoggerProxy as Logger } from 'n8n-workflow';
|
||||
|
||||
import { Db, InternalHooksManager, ResponseHelper } from '../..';
|
||||
import config = require('../../../config');
|
||||
import * as config from '../../../config';
|
||||
import { validateEntity } from '../../GenericHelpers';
|
||||
import { AuthenticatedRequest, OwnerRequest } from '../../requests';
|
||||
import { issueCookie } from '../auth/jwt';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable import/no-cycle */
|
||||
|
||||
import express = require('express');
|
||||
import express from 'express';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { URL } from 'url';
|
||||
import validator from 'validator';
|
||||
@@ -14,7 +14,7 @@ import { getInstanceBaseUrl, hashPassword, validatePassword } from '../UserManag
|
||||
import * as UserManagementMailer from '../email';
|
||||
import type { PasswordResetRequest } from '../../requests';
|
||||
import { issueCookie } from '../auth/jwt';
|
||||
import config = require('../../../config');
|
||||
import * as config from '../../../config';
|
||||
|
||||
export function passwordResetNamespace(this: N8nApp): void {
|
||||
/**
|
||||
|
||||
@@ -21,7 +21,7 @@ import { SharedWorkflow } from '../../databases/entities/SharedWorkflow';
|
||||
import { SharedCredentials } from '../../databases/entities/SharedCredentials';
|
||||
import * as UserManagementMailer from '../email/UserManagementMailer';
|
||||
|
||||
import config = require('../../../config');
|
||||
import * as config from '../../../config';
|
||||
import { issueCookie } from '../auth/jwt';
|
||||
|
||||
export function usersNamespace(this: N8nApp): void {
|
||||
|
||||
Reference in New Issue
Block a user