mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-23 11:44:06 -08:00
⚡ 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:
parent
37a6e329af
commit
027dfb2f0a
1433
package-lock.json
generated
1433
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -22,7 +22,7 @@ import {
|
|||
} from '../src';
|
||||
|
||||
import { getLogger } from '../src/Logger';
|
||||
import config = require('../config');
|
||||
import config from '../config';
|
||||
import { getInstanceOwner } from '../src/UserManagement/UserManagementHelper';
|
||||
|
||||
export class Execute extends Command {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* eslint-disable no-param-reassign */
|
||||
/* eslint-disable @typescript-eslint/unbound-method */
|
||||
/* eslint-disable no-console */
|
||||
import * as fs from 'fs';
|
||||
import fs from 'fs';
|
||||
import { Command, flags } from '@oclif/command';
|
||||
|
||||
import { BinaryDataManager, UserSettings } from 'n8n-core';
|
||||
|
@ -36,7 +36,7 @@ import {
|
|||
NodeTypes,
|
||||
WorkflowRunner,
|
||||
} from '../src';
|
||||
import config = require('../config');
|
||||
import config from '../config';
|
||||
import { User } from '../src/databases/entities/User';
|
||||
import { getInstanceOwner } from '../src/UserManagement/UserManagementHelper';
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ import { Credentials, UserSettings } from 'n8n-core';
|
|||
|
||||
import { IDataObject, LoggerProxy } from 'n8n-workflow';
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { getLogger } from '../../src/Logger';
|
||||
import { Db, ICredentialsDecryptedDb } from '../../src';
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ import { Command, flags } from '@oclif/command';
|
|||
|
||||
import { IDataObject, LoggerProxy } from 'n8n-workflow';
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { getLogger } from '../../src/Logger';
|
||||
import { Db } from '../../src';
|
||||
|
||||
|
|
|
@ -12,9 +12,9 @@ import { Credentials, UserSettings } from 'n8n-core';
|
|||
|
||||
import { LoggerProxy } from 'n8n-workflow';
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as glob from 'fast-glob';
|
||||
import * as path from 'path';
|
||||
import fs from 'fs';
|
||||
import glob from 'fast-glob';
|
||||
import path from 'path';
|
||||
import { EntityManager, getConnection } from 'typeorm';
|
||||
import { getLogger } from '../../src/Logger';
|
||||
import { Db } from '../../src';
|
||||
|
|
|
@ -12,8 +12,8 @@ import { Command, flags } from '@oclif/command';
|
|||
|
||||
import { INode, INodeCredentialsDetails, LoggerProxy } from 'n8n-workflow';
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as glob from 'fast-glob';
|
||||
import fs from 'fs';
|
||||
import glob from 'fast-glob';
|
||||
import { UserSettings } from 'n8n-core';
|
||||
import { EntityManager, getConnection } from 'typeorm';
|
||||
import { getLogger } from '../../src/Logger';
|
||||
|
|
|
@ -6,15 +6,15 @@
|
|||
/* eslint-disable no-console */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
import * as localtunnel from 'localtunnel';
|
||||
import localtunnel from 'localtunnel';
|
||||
import { BinaryDataManager, TUNNEL_SUBDOMAIN_ENV, UserSettings } from 'n8n-core';
|
||||
import { Command, flags } from '@oclif/command';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import * as Redis from 'ioredis';
|
||||
import Redis from 'ioredis';
|
||||
|
||||
import { IDataObject, LoggerProxy } from 'n8n-workflow';
|
||||
import { createHash } from 'crypto';
|
||||
import * as config from '../config';
|
||||
import config from '../config';
|
||||
import {
|
||||
ActiveExecutions,
|
||||
ActiveWorkflowRunner,
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
import { BinaryDataManager, UserSettings } from 'n8n-core';
|
||||
import { Command, flags } from '@oclif/command';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import * as Redis from 'ioredis';
|
||||
import Redis from 'ioredis';
|
||||
|
||||
import { IDataObject, LoggerProxy } from 'n8n-workflow';
|
||||
import * as config from '../config';
|
||||
import config from '../config';
|
||||
import {
|
||||
ActiveExecutions,
|
||||
ActiveWorkflowRunner,
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import * as express from 'express';
|
||||
import * as http from 'http';
|
||||
import * as PCancelable from 'p-cancelable';
|
||||
import express from 'express';
|
||||
import http from 'http';
|
||||
import PCancelable from 'p-cancelable';
|
||||
|
||||
import { Command, flags } from '@oclif/command';
|
||||
import { BinaryDataManager, IBinaryDataConfig, UserSettings, WorkflowExecute } from 'n8n-core';
|
||||
|
@ -18,7 +18,7 @@ import { IExecuteResponsePromiseData, INodeTypes, IRun, Workflow, LoggerProxy }
|
|||
|
||||
import { FindOneOptions, getConnectionManager } from 'typeorm';
|
||||
|
||||
import * as Bull from 'bull';
|
||||
import Bull from 'bull';
|
||||
import {
|
||||
CredentialsOverwrites,
|
||||
CredentialTypes,
|
||||
|
@ -39,7 +39,7 @@ import {
|
|||
|
||||
import { getLogger } from '../src/Logger';
|
||||
|
||||
import * as config from '../config';
|
||||
import config from '../config';
|
||||
import * as Queue from '../src/Queue';
|
||||
import {
|
||||
checkPermissionsForExecution,
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
/* eslint-disable @typescript-eslint/unbound-method */
|
||||
/* eslint-disable no-console */
|
||||
|
||||
import * as convict from 'convict';
|
||||
import * as dotenv from 'dotenv';
|
||||
import convict from 'convict';
|
||||
import dotenv from 'dotenv';
|
||||
import { schema } from './schema';
|
||||
|
||||
dotenv.config();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* eslint-disable no-restricted-syntax */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
|
||||
import * as path from 'path';
|
||||
import path from 'path';
|
||||
import * as core from 'n8n-core';
|
||||
|
||||
export const schema = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import * as path from 'path';
|
||||
import path from 'path';
|
||||
import { UserSettings } from 'n8n-core';
|
||||
import { entities } from '../src/databases/entities';
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
"ts-jest": "^27.1.3",
|
||||
"ts-node": "^8.9.1",
|
||||
"tslint": "^6.1.2",
|
||||
"typescript": "~4.3.5"
|
||||
"typescript": "~4.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@oclif/command": "^1.5.18",
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
import { ChildProcess } from 'child_process';
|
||||
import { stringify } from 'flatted';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import * as PCancelable from 'p-cancelable';
|
||||
import PCancelable from 'p-cancelable';
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
import {
|
||||
Db,
|
||||
|
|
|
@ -30,7 +30,7 @@ import {
|
|||
LoggerProxy as Logger,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import * as express from 'express';
|
||||
import express from 'express';
|
||||
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
import {
|
||||
|
@ -48,7 +48,7 @@ import {
|
|||
WorkflowRunner,
|
||||
ExternalHooks,
|
||||
} from '.';
|
||||
import config = require('../config');
|
||||
import config from '../config';
|
||||
import { User } from './databases/entities/User';
|
||||
import { whereClause } from './WorkflowHelpers';
|
||||
import { WorkflowEntity } from './databases/entities/WorkflowEntity';
|
||||
|
|
|
@ -15,11 +15,11 @@ import {
|
|||
Repository,
|
||||
} from 'typeorm';
|
||||
import { TlsOptions } from 'tls';
|
||||
import * as path from 'path';
|
||||
import path from 'path';
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
import { DatabaseType, GenericHelpers, IDatabaseCollections } from '.';
|
||||
|
||||
import * as config from '../config';
|
||||
import config from '../config';
|
||||
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
import { entities } from './databases/entities';
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
// eslint-disable-next-line import/no-cycle
|
||||
import { Db, IExternalHooksClass, IExternalHooksFileData, IExternalHooksFunctions } from '.';
|
||||
|
||||
import * as config from '../config';
|
||||
import config from '../config';
|
||||
|
||||
class ExternalHooksClass implements IExternalHooksClass {
|
||||
externalHooks: {
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
/* eslint-disable no-param-reassign */
|
||||
/* eslint-disable no-underscore-dangle */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
import * as express from 'express';
|
||||
import express from 'express';
|
||||
import { join as pathJoin } from 'path';
|
||||
import { readFile as fsReadFile } from 'fs/promises';
|
||||
import { IDataObject } from 'n8n-workflow';
|
||||
import { validate } from 'class-validator';
|
||||
import * as config from '../config';
|
||||
import config from '../config';
|
||||
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
import { Db, ICredentialsDb, IPackageVersions, ResponseHelper } from '.';
|
||||
|
|
|
@ -21,7 +21,7 @@ import {
|
|||
import { WorkflowExecute } from 'n8n-core';
|
||||
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import * as PCancelable from 'p-cancelable';
|
||||
import PCancelable from 'p-cancelable';
|
||||
import { Repository } from 'typeorm';
|
||||
|
||||
import { ChildProcess } from 'child_process';
|
||||
|
|
|
@ -26,10 +26,10 @@ import {
|
|||
readFile as fsReadFile,
|
||||
stat as fsStat,
|
||||
} from 'fs/promises';
|
||||
import * as glob from 'fast-glob';
|
||||
import * as path from 'path';
|
||||
import glob from 'fast-glob';
|
||||
import path from 'path';
|
||||
import { getLogger } from './Logger';
|
||||
import * as config from '../config';
|
||||
import config from '../config';
|
||||
|
||||
const CUSTOM_NODES_CATEGORY = 'Custom Nodes';
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/* eslint-disable @typescript-eslint/no-shadow */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
import * as winston from 'winston';
|
||||
import winston from 'winston';
|
||||
|
||||
import { IDataObject, ILogger, LogTypes } from 'n8n-workflow';
|
||||
|
||||
import * as callsites from 'callsites';
|
||||
import callsites from 'callsites';
|
||||
import { basename } from 'path';
|
||||
import config = require('../config');
|
||||
import config from '../config';
|
||||
|
||||
class Logger implements ILogger {
|
||||
private logger: winston.Logger;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
// @ts-ignore
|
||||
import * as sseChannel from 'sse-channel';
|
||||
import * as express from 'express';
|
||||
import sseChannel from 'sse-channel';
|
||||
import express from 'express';
|
||||
|
||||
import { LoggerProxy as Logger } from 'n8n-workflow';
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
import * as Bull from 'bull';
|
||||
import * as config from '../config';
|
||||
import Bull from 'bull';
|
||||
import config from '../config';
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
import { IBullJobData, IBullWebhookResponse } from './Interfaces';
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
|
|
|
@ -29,10 +29,10 @@
|
|||
/* eslint-disable import/no-dynamic-require */
|
||||
/* eslint-disable no-await-in-loop */
|
||||
|
||||
import * as express from 'express';
|
||||
import express from 'express';
|
||||
import { readFileSync } from 'fs';
|
||||
import { readFile } from 'fs/promises';
|
||||
import { cloneDeep } from 'lodash';
|
||||
import _, { cloneDeep } from 'lodash';
|
||||
import { dirname as pathDirname, join as pathJoin, resolve as pathResolve } from 'path';
|
||||
import {
|
||||
FindConditions,
|
||||
|
@ -47,22 +47,19 @@ import {
|
|||
Not,
|
||||
Raw,
|
||||
} from 'typeorm';
|
||||
import * as bodyParser from 'body-parser';
|
||||
import * as cookieParser from 'cookie-parser';
|
||||
import * as history from 'connect-history-api-fallback';
|
||||
import * as os from 'os';
|
||||
import bodyParser from 'body-parser';
|
||||
import cookieParser from 'cookie-parser';
|
||||
import history from 'connect-history-api-fallback';
|
||||
import os from 'os';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import * as _ from 'lodash';
|
||||
import * as clientOAuth2 from 'client-oauth2';
|
||||
import * as clientOAuth1 from 'oauth-1.0a';
|
||||
import { RequestOptions } from 'oauth-1.0a';
|
||||
import * as csrf from 'csrf';
|
||||
import * as requestPromise from 'request-promise-native';
|
||||
import clientOAuth2 from 'client-oauth2';
|
||||
import clientOAuth1, { RequestOptions } from 'oauth-1.0a';
|
||||
import csrf from 'csrf';
|
||||
import requestPromise, { OptionsWithUrl } from 'request-promise-native';
|
||||
import { createHmac } from 'crypto';
|
||||
// IMPORTANT! Do not switch to anther bcrypt library unless really necessary and
|
||||
// tested with all possible systems like Windows, Alpine on ARM, FreeBSD, ...
|
||||
import { compare } from 'bcryptjs';
|
||||
import * as promClient from 'prom-client';
|
||||
|
||||
import {
|
||||
BinaryDataManager,
|
||||
|
@ -91,16 +88,15 @@ import {
|
|||
WorkflowExecuteMode,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import * as basicAuth from 'basic-auth';
|
||||
import * as compression from 'compression';
|
||||
import * as jwt from 'jsonwebtoken';
|
||||
import * as jwks from 'jwks-rsa';
|
||||
import basicAuth from 'basic-auth';
|
||||
import compression from 'compression';
|
||||
import jwt from 'jsonwebtoken';
|
||||
import jwks from 'jwks-rsa';
|
||||
// @ts-ignore
|
||||
import * as timezones from 'google-timezones-json';
|
||||
import * as parseUrl from 'parseurl';
|
||||
import * as querystring from 'querystring';
|
||||
import { OptionsWithUrl } from 'request-promise-native';
|
||||
import { Registry } from 'prom-client';
|
||||
import timezones from 'google-timezones-json';
|
||||
import parseUrl from 'parseurl';
|
||||
import querystring from 'querystring';
|
||||
import promClient, { Registry } from 'prom-client';
|
||||
import * as Queue from './Queue';
|
||||
import {
|
||||
ActiveExecutions,
|
||||
|
@ -143,7 +139,7 @@ import {
|
|||
getCredentialForUser,
|
||||
} from '.';
|
||||
|
||||
import * as config from '../config';
|
||||
import config from '../config';
|
||||
|
||||
import * as TagHelpers from './TagHelpers';
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* eslint-disable consistent-return */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable no-param-reassign */
|
||||
import * as express from 'express';
|
||||
import express from 'express';
|
||||
|
||||
import { ActiveWebhooks } from 'n8n-core';
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -12,7 +12,7 @@ import {
|
|||
LoggerProxy as Logger,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import * as express from 'express';
|
||||
import express from 'express';
|
||||
|
||||
import {
|
||||
Db,
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable prefer-destructuring */
|
||||
import * as express from 'express';
|
||||
import express from 'express';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { get } from 'lodash';
|
||||
|
||||
|
|
|
@ -6,16 +6,16 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
import * as express from 'express';
|
||||
import express from 'express';
|
||||
import { readFileSync } from 'fs';
|
||||
import { getConnectionManager } from 'typeorm';
|
||||
import * as bodyParser from 'body-parser';
|
||||
import bodyParser from 'body-parser';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies, @typescript-eslint/no-unused-vars
|
||||
import * as _ from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
import * as compression from 'compression';
|
||||
import compression from 'compression';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import * as parseUrl from 'parseurl';
|
||||
import parseUrl from 'parseurl';
|
||||
import { WebhookHttpMethod } from 'n8n-workflow';
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
import {
|
||||
|
@ -31,7 +31,7 @@ import {
|
|||
WaitingWebhooks,
|
||||
} from '.';
|
||||
|
||||
import * as config from '../config';
|
||||
import config from '../config';
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
import { WEBHOOK_METHODS } from './WebhookHelpers';
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ import {
|
|||
|
||||
import { LessThanOrEqual } from 'typeorm';
|
||||
import { DateUtils } from 'typeorm/util/DateUtils';
|
||||
import * as config from '../config';
|
||||
import config from '../config';
|
||||
import {
|
||||
ActiveExecutions,
|
||||
CredentialsHelper,
|
||||
|
|
|
@ -33,7 +33,7 @@ import {
|
|||
WorkflowRunner,
|
||||
} from '.';
|
||||
|
||||
import * as config from '../config';
|
||||
import config from '../config';
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
import { WorkflowEntity } from './databases/entities/WorkflowEntity';
|
||||
import { User } from './databases/entities/User';
|
||||
|
|
|
@ -26,12 +26,12 @@ import {
|
|||
} from 'n8n-workflow';
|
||||
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import * as PCancelable from 'p-cancelable';
|
||||
import PCancelable from 'p-cancelable';
|
||||
import { join as pathJoin } from 'path';
|
||||
import { fork } from 'child_process';
|
||||
|
||||
import * as Bull from 'bull';
|
||||
import * as config from '../config';
|
||||
import Bull from 'bull';
|
||||
import config from '../config';
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
import {
|
||||
ActiveExecutions,
|
||||
|
|
|
@ -44,7 +44,7 @@ import {
|
|||
|
||||
import { getLogger } from './Logger';
|
||||
|
||||
import * as config from '../config';
|
||||
import config from '../config';
|
||||
import { InternalHooksManager } from './InternalHooksManager';
|
||||
import { checkPermissionsForExecution } from './UserManagement/UserManagementHelper';
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
/* eslint-disable no-restricted-syntax */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable import/no-cycle */
|
||||
import express = require('express');
|
||||
import express from 'express';
|
||||
import { In } from 'typeorm';
|
||||
import { UserSettings, Credentials } from 'n8n-core';
|
||||
import { INodeCredentialTestResult, LoggerProxy } from 'n8n-workflow';
|
||||
|
@ -24,7 +24,7 @@ import { CredentialsEntity } from '../databases/entities/CredentialsEntity';
|
|||
import { SharedCredentials } from '../databases/entities/SharedCredentials';
|
||||
import { validateEntity } from '../GenericHelpers';
|
||||
import type { CredentialRequest } from '../requests';
|
||||
import config = require('../../config');
|
||||
import * as config from '../../config';
|
||||
import { externalHooks } from '../Server';
|
||||
|
||||
export const credentialsController = express.Router();
|
||||
|
|
|
@ -14,7 +14,7 @@ import {
|
|||
} from 'typeorm';
|
||||
|
||||
import { IsArray, IsObject, IsString, Length } from 'class-validator';
|
||||
import config = require('../../../config');
|
||||
import * as config from '../../../config';
|
||||
import { DatabaseType, ICredentialsDb } from '../..';
|
||||
import { SharedCredentials } from './SharedCredentials';
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import { WorkflowExecuteMode } from 'n8n-workflow';
|
||||
|
||||
import { Column, ColumnOptions, Entity, Index, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import config = require('../../../config');
|
||||
import * as config from '../../../config';
|
||||
import { DatabaseType, IExecutionFlattedDb, IWorkflowDb } from '../..';
|
||||
|
||||
function resolveDataType(dataType: string) {
|
||||
|
|
|
@ -11,7 +11,7 @@ import {
|
|||
} from 'typeorm';
|
||||
import { IsDate, IsOptional, IsString, Length } from 'class-validator';
|
||||
|
||||
import config = require('../../../config');
|
||||
import * as config from '../../../config';
|
||||
import { DatabaseType } from '../../index';
|
||||
import { User } from './User';
|
||||
import { SharedWorkflow } from './SharedWorkflow';
|
||||
|
|
|
@ -9,7 +9,7 @@ import {
|
|||
} from 'typeorm';
|
||||
import { IsDate, IsOptional } from 'class-validator';
|
||||
|
||||
import config = require('../../../config');
|
||||
import * as config from '../../../config';
|
||||
import { DatabaseType } from '../../index';
|
||||
import { CredentialsEntity } from './CredentialsEntity';
|
||||
import { User } from './User';
|
||||
|
|
|
@ -9,7 +9,7 @@ import {
|
|||
} from 'typeorm';
|
||||
import { IsDate, IsOptional } from 'class-validator';
|
||||
|
||||
import config = require('../../../config');
|
||||
import * as config from '../../../config';
|
||||
import { DatabaseType } from '../../index';
|
||||
import { WorkflowEntity } from './WorkflowEntity';
|
||||
import { User } from './User';
|
||||
|
|
|
@ -13,7 +13,7 @@ import {
|
|||
} from 'typeorm';
|
||||
import { IsDate, IsOptional, IsString, Length } from 'class-validator';
|
||||
|
||||
import config = require('../../../config');
|
||||
import * as config from '../../../config';
|
||||
import { DatabaseType } from '../../index';
|
||||
import { ITagDb } from '../../Interfaces';
|
||||
import { idStringifier } from '../utils/transformers';
|
||||
|
|
|
@ -14,7 +14,7 @@ import {
|
|||
UpdateDateColumn,
|
||||
} from 'typeorm';
|
||||
import { IsEmail, IsString, Length } from 'class-validator';
|
||||
import config = require('../../../config');
|
||||
import * as config from '../../../config';
|
||||
import { DatabaseType, IPersonalizationSurveyAnswers } from '../..';
|
||||
import { Role } from './Role';
|
||||
import { SharedWorkflow } from './SharedWorkflow';
|
||||
|
|
|
@ -18,7 +18,7 @@ import {
|
|||
UpdateDateColumn,
|
||||
} from 'typeorm';
|
||||
|
||||
import config = require('../../../config');
|
||||
import * as config from '../../../config';
|
||||
import { DatabaseType, IWorkflowDb } from '../..';
|
||||
import { TagEntity } from './TagEntity';
|
||||
import { SharedWorkflow } from './SharedWorkflow';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {MigrationInterface, QueryRunner} from "typeorm";
|
||||
import config = require("../../../../config");
|
||||
import * as config from '../../../../config';
|
||||
|
||||
export class UniqueWorkflowNames1620826335440 implements MigrationInterface {
|
||||
name = 'UniqueWorkflowNames1620826335440';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
import config = require('../../../../config');
|
||||
import * as config from '../../../../config';
|
||||
|
||||
export class CertifyCorrectCollation1623936588000 implements MigrationInterface {
|
||||
name = 'CertifyCorrectCollation1623936588000';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
import config = require('../../../../config');
|
||||
import * as config from '../../../../config';
|
||||
import { MigrationHelpers } from '../../MigrationHelpers';
|
||||
|
||||
// replacing the credentials in workflows and execution
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import config = require('../../../../config');
|
||||
import * as config from '../../../../config';
|
||||
import { loadSurveyFromDisk } from '../../utils/migrationHelpers';
|
||||
|
||||
export class CreateUserManagement1646992772331 implements MigrationInterface {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
import config = require('../../../../config');
|
||||
import * as config from '../../../../config';
|
||||
|
||||
export class UniqueWorkflowNames1620824779533 implements MigrationInterface {
|
||||
name = 'UniqueWorkflowNames1620824779533';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
import config = require('../../../../config');
|
||||
import * as config from '../../../../config';
|
||||
import { MigrationHelpers } from '../../MigrationHelpers';
|
||||
|
||||
// replacing the credentials in workflows and execution
|
||||
|
|
|
@ -3,7 +3,7 @@ import {
|
|||
QueryRunner,
|
||||
} from 'typeorm';
|
||||
|
||||
import config = require('../../../../config');
|
||||
import * as config from '../../../../config';
|
||||
|
||||
export class IncreaseTypeVarcharLimit1646834195327 implements MigrationInterface {
|
||||
name = 'IncreaseTypeVarcharLimit1646834195327';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import config = require('../../../../config');
|
||||
import config from '../../../../config';
|
||||
import { loadSurveyFromDisk } from '../../utils/migrationHelpers';
|
||||
|
||||
export class CreateUserManagement1646992772331 implements MigrationInterface {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
import config = require('../../../../config');
|
||||
import * as config from '../../../../config';
|
||||
import { logMigrationEnd, logMigrationStart } from '../../utils/migrationHelpers';
|
||||
|
||||
export class UniqueWorkflowNames1620821879465 implements MigrationInterface {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
import config = require('../../../../config');
|
||||
import * as config from '../../../../config';
|
||||
import { MigrationHelpers } from '../../MigrationHelpers';
|
||||
import { logMigrationEnd, logMigrationStart } from '../../utils/migrationHelpers';
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import config = require('../../../../config');
|
||||
import * as config from '../../../../config';
|
||||
import {
|
||||
loadSurveyFromDisk,
|
||||
logMigrationEnd,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import config = require('../../../../config');
|
||||
import config from '../../../../config';
|
||||
|
||||
import { InitialMigration1588102412422 } from './1588102412422-InitialMigration';
|
||||
import { WebhookModel1592445003908 } from './1592445003908-WebhookModel';
|
||||
|
|
2
packages/cli/src/requests.d.ts
vendored
2
packages/cli/src/requests.d.ts
vendored
|
@ -1,5 +1,5 @@
|
|||
/* eslint-disable import/no-cycle */
|
||||
import express = require('express');
|
||||
import express from 'express';
|
||||
import {
|
||||
IConnections,
|
||||
ICredentialDataDecryptedObject,
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/* eslint-disable import/no-cycle */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
import TelemetryClient = require('@rudderstack/rudder-sdk-node');
|
||||
import TelemetryClient from '@rudderstack/rudder-sdk-node';
|
||||
import { IDataObject, LoggerProxy } from 'n8n-workflow';
|
||||
import config = require('../../config');
|
||||
import * as config from '../../config';
|
||||
import { getLogger } from '../Logger';
|
||||
|
||||
type CountBufferItemKey =
|
||||
|
|
149
packages/cli/test/integration/auth.endpoints.test.ts
Normal file
149
packages/cli/test/integration/auth.endpoints.test.ts
Normal file
|
@ -0,0 +1,149 @@
|
|||
import { hashSync, genSaltSync } from 'bcryptjs';
|
||||
import express from 'express';
|
||||
import validator from 'validator';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
|
||||
import * as config from '../../config';
|
||||
import * as utils from './shared/utils';
|
||||
import { LOGGED_OUT_RESPONSE_BODY } from './shared/constants';
|
||||
import { Db } from '../../src';
|
||||
import { Role } from '../../src/databases/entities/Role';
|
||||
import { randomEmail, randomValidPassword, randomName } from './shared/random';
|
||||
import { getGlobalOwnerRole } from './shared/testDb';
|
||||
import * as testDb from './shared/testDb';
|
||||
|
||||
jest.mock('../../src/telemetry');
|
||||
|
||||
let globalOwnerRole: Role;
|
||||
|
||||
let app: express.Application;
|
||||
let testDbName = '';
|
||||
|
||||
beforeAll(async () => {
|
||||
app = utils.initTestServer({ endpointGroups: ['auth'], applyAuth: true });
|
||||
const initResult = await testDb.init();
|
||||
testDbName = initResult.testDbName;
|
||||
|
||||
await testDb.truncate(['User'], testDbName);
|
||||
|
||||
globalOwnerRole = await getGlobalOwnerRole();
|
||||
utils.initTestLogger();
|
||||
utils.initTestTelemetry();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await testDb.createUser({
|
||||
id: uuid(),
|
||||
email: TEST_USER.email,
|
||||
firstName: TEST_USER.firstName,
|
||||
lastName: TEST_USER.lastName,
|
||||
password: TEST_USER.password,
|
||||
globalRole: globalOwnerRole,
|
||||
});
|
||||
|
||||
config.set('userManagement.isInstanceOwnerSetUp', true);
|
||||
|
||||
await Db.collections.Settings!.update(
|
||||
{ key: 'userManagement.isInstanceOwnerSetUp' },
|
||||
{ value: JSON.stringify(true) },
|
||||
);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await testDb.truncate(['User'], testDbName);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await testDb.terminate(testDbName);
|
||||
});
|
||||
|
||||
test('POST /login should log user in', async () => {
|
||||
const authlessAgent = utils.createAgent(app);
|
||||
|
||||
const response = await authlessAgent.post('/login').send({
|
||||
email: TEST_USER.email,
|
||||
password: TEST_USER.password,
|
||||
});
|
||||
|
||||
expect(response.statusCode).toBe(200);
|
||||
|
||||
const {
|
||||
id,
|
||||
email,
|
||||
firstName,
|
||||
lastName,
|
||||
password,
|
||||
personalizationAnswers,
|
||||
globalRole,
|
||||
resetPasswordToken,
|
||||
} = response.body.data;
|
||||
|
||||
expect(validator.isUUID(id)).toBe(true);
|
||||
expect(email).toBe(TEST_USER.email);
|
||||
expect(firstName).toBe(TEST_USER.firstName);
|
||||
expect(lastName).toBe(TEST_USER.lastName);
|
||||
expect(password).toBeUndefined();
|
||||
expect(personalizationAnswers).toBeNull();
|
||||
expect(password).toBeUndefined();
|
||||
expect(resetPasswordToken).toBeUndefined();
|
||||
expect(globalRole).toBeDefined();
|
||||
expect(globalRole.name).toBe('owner');
|
||||
expect(globalRole.scope).toBe('global');
|
||||
|
||||
const authToken = utils.getAuthToken(response);
|
||||
expect(authToken).toBeDefined();
|
||||
});
|
||||
|
||||
test('GET /login should receive logged in user', async () => {
|
||||
const owner = await Db.collections.User!.findOneOrFail();
|
||||
const authOwnerAgent = utils.createAgent(app, { auth: true, user: owner });
|
||||
|
||||
const response = await authOwnerAgent.get('/login');
|
||||
|
||||
expect(response.statusCode).toBe(200);
|
||||
|
||||
const {
|
||||
id,
|
||||
email,
|
||||
firstName,
|
||||
lastName,
|
||||
password,
|
||||
personalizationAnswers,
|
||||
globalRole,
|
||||
resetPasswordToken,
|
||||
} = response.body.data;
|
||||
|
||||
expect(validator.isUUID(id)).toBe(true);
|
||||
expect(email).toBe(TEST_USER.email);
|
||||
expect(firstName).toBe(TEST_USER.firstName);
|
||||
expect(lastName).toBe(TEST_USER.lastName);
|
||||
expect(password).toBeUndefined();
|
||||
expect(personalizationAnswers).toBeNull();
|
||||
expect(password).toBeUndefined();
|
||||
expect(resetPasswordToken).toBeUndefined();
|
||||
expect(globalRole).toBeDefined();
|
||||
expect(globalRole.name).toBe('owner');
|
||||
expect(globalRole.scope).toBe('global');
|
||||
|
||||
expect(response.headers['set-cookie']).toBeUndefined();
|
||||
});
|
||||
|
||||
test('POST /logout should log user out', async () => {
|
||||
const owner = await Db.collections.User!.findOneOrFail();
|
||||
const authOwnerAgent = utils.createAgent(app, { auth: true, user: owner });
|
||||
|
||||
const response = await authOwnerAgent.post('/logout');
|
||||
|
||||
expect(response.statusCode).toBe(200);
|
||||
expect(response.body).toEqual(LOGGED_OUT_RESPONSE_BODY);
|
||||
|
||||
const authToken = utils.getAuthToken(response);
|
||||
expect(authToken).toBeUndefined();
|
||||
});
|
||||
|
||||
const TEST_USER = {
|
||||
email: randomEmail(),
|
||||
password: randomValidPassword(),
|
||||
firstName: randomName(),
|
||||
lastName: randomName(),
|
||||
};
|
|
@ -1,6 +1,6 @@
|
|||
import express = require('express');
|
||||
import express from 'express';
|
||||
|
||||
import * as request from 'supertest';
|
||||
import request from 'supertest';
|
||||
import {
|
||||
REST_PATH_SEGMENT,
|
||||
ROUTES_REQUIRING_AUTHORIZATION,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import express = require('express');
|
||||
import express from 'express';
|
||||
import { UserSettings } from 'n8n-core';
|
||||
import { Db } from '../../src';
|
||||
import { randomName, randomString } from './shared/random';
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import express = require('express');
|
||||
import express from 'express';
|
||||
import validator from 'validator';
|
||||
import { IsNull } from 'typeorm';
|
||||
|
||||
import config = require('../../config');
|
||||
import config from '../../config';
|
||||
import * as utils from './shared/utils';
|
||||
import { SUCCESS_RESPONSE_BODY } from './shared/constants';
|
||||
import { Db } from '../../src';
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import express = require('express');
|
||||
import express from 'express';
|
||||
import validator from 'validator';
|
||||
|
||||
import * as utils from './shared/utils';
|
||||
import * as testDb from './shared/testDb';
|
||||
import { Db } from '../../src';
|
||||
import config = require('../../config');
|
||||
import config from '../../config';
|
||||
import {
|
||||
randomEmail,
|
||||
randomName,
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import express = require('express');
|
||||
import express from 'express';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
|
||||
import * as utils from './shared/utils';
|
||||
import { Db } from '../../src';
|
||||
import config = require('../../config');
|
||||
import config from '../../config';
|
||||
import { compare } from 'bcryptjs';
|
||||
import {
|
||||
randomEmail,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import config = require('../../../config');
|
||||
import config from '../../../config';
|
||||
|
||||
export const REST_PATH_SEGMENT = config.getEnv('endpoints.rest') as Readonly<string>;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { createConnection, getConnection, ConnectionOptions, Connection } from 'typeorm';
|
||||
import { Credentials, UserSettings } from 'n8n-core';
|
||||
|
||||
import config = require('../../../config');
|
||||
import config from '../../../config';
|
||||
import { BOOTSTRAP_MYSQL_CONNECTION_NAME, BOOTSTRAP_POSTGRES_CONNECTION_NAME } from './constants';
|
||||
import { DatabaseType, Db, ICredentialsDb, IDatabaseCollections } from '../../../src';
|
||||
import { randomEmail, randomName, randomString, randomValidPassword } from './random';
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import { randomBytes } from 'crypto';
|
||||
import { existsSync } from 'fs';
|
||||
import express = require('express');
|
||||
import * as superagent from 'superagent';
|
||||
import * as request from 'supertest';
|
||||
import express from 'express';
|
||||
import superagent from 'superagent';
|
||||
import request from 'supertest';
|
||||
import { URL } from 'url';
|
||||
import bodyParser = require('body-parser');
|
||||
import * as util from 'util';
|
||||
import bodyParser from 'body-parser';
|
||||
import util from 'util';
|
||||
import { createTestAccount } from 'nodemailer';
|
||||
import { INodeTypes, LoggerProxy } from 'n8n-workflow';
|
||||
import { UserSettings } from 'n8n-core';
|
||||
|
||||
import config = require('../../../config');
|
||||
import config from '../../../config';
|
||||
import { AUTHLESS_ENDPOINTS, REST_PATH_SEGMENT } from './constants';
|
||||
import { AUTH_COOKIE_NAME } from '../../../src/constants';
|
||||
import { addRoutes as authMiddleware } from '../../../src/UserManagement/routes';
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import express = require('express');
|
||||
import express from 'express';
|
||||
import validator from 'validator';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
|
||||
import { Db } from '../../src';
|
||||
import config = require('../../config');
|
||||
import config from '../../config';
|
||||
import { SUCCESS_RESPONSE_BODY } from './shared/constants';
|
||||
import {
|
||||
randomEmail,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { exec as callbackExec } from 'child_process';
|
||||
import { promisify } from 'util';
|
||||
|
||||
import config = require('../config');
|
||||
import config from '../config';
|
||||
import { BOOTSTRAP_MYSQL_CONNECTION_NAME } from './integration/shared/constants';
|
||||
|
||||
const exec = promisify(callbackExec);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { createConnection } from 'typeorm';
|
||||
import config = require('../config');
|
||||
import config from '../config';
|
||||
import { exec } from 'child_process';
|
||||
import { getBootstrapMySqlOptions, getBootstrapPostgresOptions } from './integration/shared/testDb';
|
||||
import { BOOTSTRAP_MYSQL_CONNECTION_NAME } from './integration/shared/constants';
|
||||
|
|
|
@ -20,7 +20,8 @@
|
|||
"target": "es2017",
|
||||
"sourceMap": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true
|
||||
"experimentalDecorators": true,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"include": [
|
||||
"**/*.d.ts",
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
"source-map-support": "^0.5.9",
|
||||
"ts-jest": "^27.1.3",
|
||||
"tslint": "^6.1.2",
|
||||
"typescript": "~4.3.5"
|
||||
"typescript": "~4.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.21.1",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { promises as fs } from 'fs';
|
||||
import * as path from 'path';
|
||||
import path from 'path';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
|
||||
import { IBinaryDataConfig, IBinaryDataManager } from '../Interfaces';
|
||||
|
|
|
@ -23,7 +23,7 @@ import {
|
|||
} from 'n8n-workflow';
|
||||
|
||||
import { OptionsWithUri, OptionsWithUrl } from 'request';
|
||||
import * as requestPromise from 'request-promise-native';
|
||||
import requestPromise from 'request-promise-native';
|
||||
|
||||
interface Constructable<T> {
|
||||
new (): T;
|
||||
|
|
|
@ -60,20 +60,17 @@ import {
|
|||
|
||||
import { Agent } from 'https';
|
||||
import { stringify } from 'qs';
|
||||
import * as clientOAuth1 from 'oauth-1.0a';
|
||||
import { Token } from 'oauth-1.0a';
|
||||
import * as clientOAuth2 from 'client-oauth2';
|
||||
import * as crypto from 'crypto';
|
||||
import * as url from 'url';
|
||||
import clientOAuth1, { Token } from 'oauth-1.0a';
|
||||
import clientOAuth2 from 'client-oauth2';
|
||||
import crypto, { createHmac } from 'crypto';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { get } from 'lodash';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import * as express from 'express';
|
||||
import * as FormData from 'form-data';
|
||||
import * as path from 'path';
|
||||
import express from 'express';
|
||||
import FormData from 'form-data';
|
||||
import path from 'path';
|
||||
import { OptionsWithUri, OptionsWithUrl } from 'request';
|
||||
import * as requestPromise from 'request-promise-native';
|
||||
import { createHmac } from 'crypto';
|
||||
import requestPromise from 'request-promise-native';
|
||||
import { fromBuffer } from 'file-type';
|
||||
import { lookup } from 'mime-types';
|
||||
|
||||
|
@ -84,7 +81,7 @@ import axios, {
|
|||
AxiosResponse,
|
||||
Method,
|
||||
} from 'axios';
|
||||
import { URL, URLSearchParams } from 'url';
|
||||
import url, { URL, URLSearchParams } from 'url';
|
||||
import { BinaryDataManager } from './BinaryDataManager';
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
import {
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
/* eslint-disable @typescript-eslint/no-use-before-define */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { createHash, randomBytes } from 'crypto';
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
import {
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
/* eslint-disable no-restricted-syntax */
|
||||
/* eslint-disable no-param-reassign */
|
||||
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
|
||||
import * as PCancelable from 'p-cancelable';
|
||||
import PCancelable from 'p-cancelable';
|
||||
|
||||
import {
|
||||
ExecutionError,
|
||||
|
|
|
@ -17,7 +17,9 @@
|
|||
"declaration": true,
|
||||
"outDir": "./dist/",
|
||||
"target": "es2019",
|
||||
"sourceMap": true
|
||||
"sourceMap": true,
|
||||
"esModuleInterop": true,
|
||||
"useUnknownInCatchVariables": false,
|
||||
},
|
||||
"include": [
|
||||
"**/*.d.ts",
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
"storybook-addon-designs": "^6.0.1",
|
||||
"storybook-addon-themes": "^6.1.0",
|
||||
"trim": ">=0.0.3",
|
||||
"typescript": "~4.3.5",
|
||||
"typescript": "~4.6.0",
|
||||
"vue": "^2.6.11",
|
||||
"vue-class-component": "^7.2.3",
|
||||
"vue-loader": "^15.9.7",
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
"string-template-parser": "^1.2.6",
|
||||
"ts-jest": "^27.1.3",
|
||||
"tslint": "^6.1.2",
|
||||
"typescript": "~4.3.5",
|
||||
"typescript": "~4.6.0",
|
||||
"uuid": "^8.3.2",
|
||||
"vue": "^2.6.11",
|
||||
"vue-agile": "^2.0.0",
|
||||
|
|
|
@ -3,8 +3,8 @@ import Vue from 'vue';
|
|||
export const deviceSupportHelpers = Vue.extend({
|
||||
data() {
|
||||
return {
|
||||
isTouchDevice: 'ontouchstart' in window || navigator.msMaxTouchPoints,
|
||||
isMacOs: /(ipad|iphone|ipod|mac)/i.test(navigator.platform),
|
||||
isTouchDevice: 'ontouchstart' in window || navigator.maxTouchPoints,
|
||||
isMacOs: /(ipad|iphone|ipod|mac)/i.test(navigator.platform), // TODO: `platform` deprecated
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
"moduleResolution": "node",
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"useUnknownInCatchVariables": false,
|
||||
"sourceMap": true,
|
||||
"baseUrl": ".",
|
||||
"types": [
|
||||
|
|
|
@ -67,6 +67,6 @@
|
|||
"replace-in-file": "^6.0.0",
|
||||
"request": "^2.88.2",
|
||||
"tmp-promise": "^3.0.2",
|
||||
"typescript": "~4.3.5"
|
||||
"typescript": "~4.6.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import {
|
|||
INodePropertyOptions,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import * as moment from 'moment-timezone';
|
||||
import moment from 'moment-timezone';
|
||||
|
||||
// Get options for timezones
|
||||
const timezones: INodePropertyOptions[] = moment.tz.countries().reduce( (timezones: INodePropertyOptions[], country: string) => {
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
downloadRecordAttachments,
|
||||
} from './GenericFunctions';
|
||||
|
||||
import * as moment from 'moment';
|
||||
import moment from 'moment';
|
||||
|
||||
export class AirtableTrigger implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
|
|
@ -20,7 +20,7 @@ import {
|
|||
getWorkspaces,
|
||||
} from './GenericFunctions';
|
||||
|
||||
import * as moment from 'moment-timezone';
|
||||
import moment from 'moment-timezone';
|
||||
|
||||
import { snakeCase } from 'change-case';
|
||||
|
||||
|
|
|
@ -11,9 +11,9 @@ import {
|
|||
apiRequest,
|
||||
} from '../../../transport';
|
||||
|
||||
import * as moment from 'moment';
|
||||
import moment from 'moment';
|
||||
|
||||
import {
|
||||
import {
|
||||
capitalCase
|
||||
} from 'change-case';
|
||||
|
||||
|
@ -96,4 +96,4 @@ export async function create(this: IExecuteFunctions, index: number): Promise<IN
|
|||
|
||||
//return
|
||||
return this.helpers.returnJsonArray({ id: employeeId });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import {
|
|||
apiRequest,
|
||||
} from '../../../transport';
|
||||
|
||||
import * as moment from 'moment';
|
||||
import moment from 'moment';
|
||||
|
||||
import {
|
||||
capitalCase,
|
||||
|
@ -54,7 +54,7 @@ export async function update(this: IExecuteFunctions, index: number): Promise<IN
|
|||
body.preferredName = this.getNodeParameter('preferredName', index) as string;
|
||||
body.ssn = this.getNodeParameter('ssn', index) as string;
|
||||
} else {
|
||||
|
||||
|
||||
if (!Object.keys(updateFields).length) {
|
||||
throw new NodeOperationError(this.getNode(), 'At least one fields must be updated');
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ import {
|
|||
beeminderApiRequest,
|
||||
} from './GenericFunctions';
|
||||
|
||||
import * as moment from 'moment-timezone';
|
||||
import moment from 'moment-timezone';
|
||||
|
||||
export class Beeminder implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
|
|
@ -26,7 +26,7 @@ import {
|
|||
folderOperations,
|
||||
} from './FolderDescription';
|
||||
|
||||
import * as moment from 'moment-timezone';
|
||||
import moment from 'moment-timezone';
|
||||
|
||||
import {
|
||||
noCase,
|
||||
|
|
|
@ -28,7 +28,7 @@ import {
|
|||
messageOperations,
|
||||
} from './descriptions';
|
||||
|
||||
import * as moment from 'moment-timezone';
|
||||
import moment from 'moment-timezone';
|
||||
|
||||
export class CiscoWebex implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
|
|
@ -101,7 +101,7 @@ import {
|
|||
IList,
|
||||
} from './ListInterface';
|
||||
|
||||
import * as moment from 'moment-timezone';
|
||||
import moment from 'moment-timezone';
|
||||
|
||||
export class ClickUp implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
|
|
@ -49,7 +49,7 @@ import {
|
|||
timeEntryOperations,
|
||||
} from './TimeEntryDescription';
|
||||
|
||||
import * as moment from 'moment-timezone';
|
||||
import moment from 'moment-timezone';
|
||||
|
||||
export class Clockify implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue