diff --git a/packages/cli/bin/n8n b/packages/cli/bin/n8n index 3cc5be4f6c..b72c643fb3 100755 --- a/packages/cli/bin/n8n +++ b/packages/cli/bin/n8n @@ -1,7 +1,6 @@ #!/usr/bin/env node -var alias = require('module-alias'); + var path = require('path'); // tslint:disable-line:no-var-keyword -alias(path.resolve(__dirname, "../")); // Make sure that it also find the config folder when it // did get started from another folder that the root one. diff --git a/packages/cli/commands/start.ts b/packages/cli/commands/start.ts index 69b71ca483..023e3e827f 100644 --- a/packages/cli/commands/start.ts +++ b/packages/cli/commands/start.ts @@ -7,7 +7,7 @@ import { Command, flags } from '@oclif/command'; const open = require('open'); import * as Redis from 'ioredis'; -import { config } from '@config'; +import * as config from '../config'; import { ActiveExecutions, ActiveWorkflowRunner, @@ -25,7 +25,7 @@ import { } from '../src'; import { IDataObject } from 'n8n-workflow'; -import { +import { getLogger, } from '../src/Logger'; diff --git a/packages/cli/commands/webhook.ts b/packages/cli/commands/webhook.ts index 7f3019575e..e1acc94874 100644 --- a/packages/cli/commands/webhook.ts +++ b/packages/cli/commands/webhook.ts @@ -4,7 +4,7 @@ import { import { Command, flags } from '@oclif/command'; import * as Redis from 'ioredis'; -import { config } from '@config'; +import * as config from '../config'; import { ActiveExecutions, ActiveWorkflowRunner, @@ -20,7 +20,7 @@ import { } from '../src'; import { IDataObject } from 'n8n-workflow'; -import { +import { getLogger, } from '../src/Logger'; diff --git a/packages/cli/commands/worker.ts b/packages/cli/commands/worker.ts index 5974934718..56da5d9c98 100644 --- a/packages/cli/commands/worker.ts +++ b/packages/cli/commands/worker.ts @@ -37,7 +37,7 @@ import { WorkflowExecuteAdditionalData, } from '../src'; -import { +import { getLogger, } from '../src/Logger'; @@ -45,7 +45,7 @@ import { LoggerProxy, } from 'n8n-workflow'; -import { config } from '@config'; +import * as config from '../config'; import * as Bull from 'bull'; import * as Queue from '../src/Queue'; diff --git a/packages/cli/config/index.ts b/packages/cli/config/index.ts index 8aef25f0fe..0da11e786a 100644 --- a/packages/cli/config/index.ts +++ b/packages/cli/config/index.ts @@ -5,7 +5,7 @@ import * as core from 'n8n-core'; dotenv.config(); -export const config = convict({ +const config = convict({ database: { type: { @@ -633,3 +633,4 @@ config.validate({ allowed: 'strict', }); +export = config; diff --git a/packages/cli/package.json b/packages/cli/package.json index 13523c82c9..e4a23302ad 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -105,7 +105,6 @@ "jwks-rsa": "~1.12.1", "localtunnel": "^2.0.0", "lodash.get": "^4.4.2", - "module-alias": "^2.2.2", "mysql2": "~2.2.0", "n8n-core": "~0.75.0", "n8n-editor-ui": "~0.95.0", @@ -122,9 +121,6 @@ "typeorm": "^0.2.30", "winston": "^3.3.3" }, - "_moduleAliases": { - "@config": "./dist/config/index.js" - }, "jest": { "transform": { "^.+\\.tsx?$": "ts-jest" diff --git a/packages/cli/src/Db.ts b/packages/cli/src/Db.ts index 5d548c63d5..c91c872693 100644 --- a/packages/cli/src/Db.ts +++ b/packages/cli/src/Db.ts @@ -16,7 +16,7 @@ import { import { TlsOptions } from 'tls'; -import { config } from '@config'; +import * as config from '../config'; import { entities } from './databases/entities'; diff --git a/packages/cli/src/ExternalHooks.ts b/packages/cli/src/ExternalHooks.ts index 39f2201686..aa14662a60 100644 --- a/packages/cli/src/ExternalHooks.ts +++ b/packages/cli/src/ExternalHooks.ts @@ -5,7 +5,7 @@ import { IExternalHooksFunctions, } from './'; -import { config } from '@config'; +import * as config from '../config'; class ExternalHooksClass implements IExternalHooksClass { diff --git a/packages/cli/src/GenericHelpers.ts b/packages/cli/src/GenericHelpers.ts index 89e5cdaa0f..d6da9e87da 100644 --- a/packages/cli/src/GenericHelpers.ts +++ b/packages/cli/src/GenericHelpers.ts @@ -1,4 +1,4 @@ -import { config } from '@config'; +import * as config from '../config'; import * as express from 'express'; import { join as pathJoin } from 'path'; import { readFile as fsReadFile } from 'fs/promises'; diff --git a/packages/cli/src/LoadNodesAndCredentials.ts b/packages/cli/src/LoadNodesAndCredentials.ts index 637f016f1c..777fa0bb00 100644 --- a/packages/cli/src/LoadNodesAndCredentials.ts +++ b/packages/cli/src/LoadNodesAndCredentials.ts @@ -11,7 +11,7 @@ import { LoggerProxy, } from 'n8n-workflow'; -import { config } from '@config'; +import * as config from '../config'; import { getLogger, diff --git a/packages/cli/src/Logger.ts b/packages/cli/src/Logger.ts index b70be03596..3bbc61e6a9 100644 --- a/packages/cli/src/Logger.ts +++ b/packages/cli/src/Logger.ts @@ -1,4 +1,4 @@ -import { config } from '@config'; +import config = require('../config'); import * as winston from 'winston'; import { diff --git a/packages/cli/src/Queue.ts b/packages/cli/src/Queue.ts index b2d7cf4788..1b85fe4bc4 100644 --- a/packages/cli/src/Queue.ts +++ b/packages/cli/src/Queue.ts @@ -1,14 +1,14 @@ import * as Bull from 'bull'; -import { config } from '@config'; +import * as config from '../config'; import { IBullJobData } from './Interfaces'; export class Queue { private jobQueue: Bull.Queue; - + constructor() { const prefix = config.get('queue.bull.prefix') as string; const redisOptions = config.get('queue.bull.redis') as object; - // Disabling ready check is necessary as it allows worker to + // Disabling ready check is necessary as it allows worker to // quickly reconnect to Redis if Redis crashes or is unreachable // for some time. With it enabled, worker might take minutes to realize // redis is back up and resume working. @@ -16,25 +16,25 @@ export class Queue { // @ts-ignore this.jobQueue = new Bull('jobs', { prefix, redis: redisOptions, enableReadyCheck: false }); } - + async add(jobData: IBullJobData, jobOptions: object): Promise { return await this.jobQueue.add(jobData,jobOptions); } - + async getJob(jobId: Bull.JobId): Promise { return await this.jobQueue.getJob(jobId); } - + async getJobs(jobTypes: Bull.JobStatus[]): Promise { return await this.jobQueue.getJobs(jobTypes); } - + getBullObjectInstance(): Bull.Queue { return this.jobQueue; } /** - * + * * @param job A Bull.Job instance * @returns boolean true if we were able to securely stop the job */ @@ -62,6 +62,6 @@ export function getInstance(): Queue { if (activeQueueInstance === undefined) { activeQueueInstance = new Queue(); } - + return activeQueueInstance; } diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index 5566dd8657..0a31144999 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -101,7 +101,7 @@ import { import * as basicAuth from 'basic-auth'; import * as compression from 'compression'; -import { config } from '@config'; +import * as config from '../config'; import * as jwt from 'jsonwebtoken'; import * as jwks from 'jwks-rsa'; // @ts-ignore diff --git a/packages/cli/src/WebhookServer.ts b/packages/cli/src/WebhookServer.ts index c49e1803a8..becfb71af7 100644 --- a/packages/cli/src/WebhookServer.ts +++ b/packages/cli/src/WebhookServer.ts @@ -22,7 +22,7 @@ import { } from './'; import * as compression from 'compression'; -import { config } from '@config'; +import * as config from '../config'; import * as parseUrl from 'parseurl'; export function registerProductionWebhooks() { @@ -111,7 +111,7 @@ export function registerProductionWebhooks() { } class App { - + app: express.Application; activeWorkflowRunner: ActiveWorkflowRunner.ActiveWorkflowRunner; endpointWebhook: string; @@ -129,12 +129,12 @@ class App { protocol: string; sslKey: string; sslCert: string; - + presetCredentialsLoaded: boolean; - + constructor() { this.app = express(); - + this.endpointWebhook = config.get('endpoints.webhook') as string; this.saveDataErrorExecution = config.get('executions.saveDataOnError') as string; this.saveDataSuccessExecution = config.get('executions.saveDataOnSuccess') as string; @@ -143,22 +143,22 @@ class App { this.maxExecutionTimeout = config.get('executions.maxTimeout') as number; this.timezone = config.get('generic.timezone') as string; this.restEndpoint = config.get('endpoints.rest') as string; - + this.activeWorkflowRunner = ActiveWorkflowRunner.getInstance(); - + this.activeExecutionsInstance = ActiveExecutions.getInstance(); - + this.protocol = config.get('protocol'); this.sslKey = config.get('ssl_key'); this.sslCert = config.get('ssl_cert'); - + this.externalHooks = ExternalHooks(); - + this.presetCredentialsLoaded = false; this.endpointPresetCredentials = config.get('credentials.overwrite.endpoint') as string; } - - + + /** * Returns the current epoch time * @@ -168,15 +168,15 @@ class App { getCurrentDate(): Date { return new Date(); } - - + + async config(): Promise { - + this.versions = await GenericHelpers.getVersions(); - + // Compress the response data this.app.use(compression()); - + // Make sure that each request has the "parsedUrl" parameter this.app.use((req: express.Request, res: express.Response, next: express.NextFunction) => { (req as ICustomRequest).parsedUrl = parseUrl(req); @@ -184,7 +184,7 @@ class App { req.rawBody = Buffer.from('', 'base64'); next(); }); - + // Support application/json type post data this.app.use(bodyParser.json({ limit: '16mb', verify: (req, res, buf) => { @@ -192,7 +192,7 @@ class App { req.rawBody = buf; }, })); - + // Support application/xml type post data // @ts-ignore this.app.use(bodyParser.xml({ @@ -202,14 +202,14 @@ class App { explicitArray: false, // Only put properties in array if length > 1 }, })); - + this.app.use(bodyParser.text({ limit: '16mb', verify: (req, res, buf) => { // @ts-ignore req.rawBody = buf; }, })); - + //support application/x-www-form-urlencoded post data this.app.use(bodyParser.urlencoded({ extended: false, verify: (req, res, buf) => { @@ -217,7 +217,7 @@ class App { req.rawBody = buf; }, })); - + if (process.env['NODE_ENV'] !== 'production') { this.app.use((req: express.Request, res: express.Response, next: express.NextFunction) => { // Allow access also from frontend when developing @@ -227,64 +227,64 @@ class App { next(); }); } - - + + this.app.use((req: express.Request, res: express.Response, next: express.NextFunction) => { if (Db.collections.Workflow === null) { const error = new ResponseHelper.ResponseError('Database is not ready!', undefined, 503); return ResponseHelper.sendErrorResponse(res, error); } - + next(); }); - - - + + + // ---------------------------------------- // Healthcheck // ---------------------------------------- - - + + // Does very basic health check this.app.get('/healthz', async (req: express.Request, res: express.Response) => { - + const connectionManager = getConnectionManager(); - + if (connectionManager.connections.length === 0) { const error = new ResponseHelper.ResponseError('No Database connection found!', undefined, 503); return ResponseHelper.sendErrorResponse(res, error); } - + if (connectionManager.connections[0].isConnected === false) { // Connection is not active const error = new ResponseHelper.ResponseError('Database connection not active!', undefined, 503); return ResponseHelper.sendErrorResponse(res, error); } - + // Everything fine const responseData = { status: 'ok', }; - + ResponseHelper.sendSuccessResponse(res, responseData, true, 200); }); - + registerProductionWebhooks.apply(this); - + } - + } export async function start(): Promise { const PORT = config.get('port'); const ADDRESS = config.get('listen_address'); - + const app = new App(); - + await app.config(); - + let server; - + if (app.protocol === 'https' && app.sslKey && app.sslCert) { const https = require('https'); const privateKey = readFileSync(app.sslKey, 'utf8'); @@ -295,12 +295,12 @@ export async function start(): Promise { const http = require('http'); server = http.createServer(app.app); } - + server.listen(PORT, ADDRESS, async () => { const versions = await GenericHelpers.getVersions(); console.log(`n8n ready on ${ADDRESS}, port ${PORT}`); console.log(`Version: ${versions.cli}`); - + await app.externalHooks.run('n8n.ready', [app]); }); } diff --git a/packages/cli/src/WorkflowExecuteAdditionalData.ts b/packages/cli/src/WorkflowExecuteAdditionalData.ts index e6eafd4c2c..9d0478d997 100644 --- a/packages/cli/src/WorkflowExecuteAdditionalData.ts +++ b/packages/cli/src/WorkflowExecuteAdditionalData.ts @@ -43,7 +43,7 @@ import { WorkflowHooks, } from 'n8n-workflow'; -import { config } from '@config'; +import * as config from '../config'; import { LessThanOrEqual } from 'typeorm'; diff --git a/packages/cli/src/WorkflowHelpers.ts b/packages/cli/src/WorkflowHelpers.ts index 61be6d744c..68718dc4cf 100644 --- a/packages/cli/src/WorkflowHelpers.ts +++ b/packages/cli/src/WorkflowHelpers.ts @@ -22,7 +22,7 @@ import { LoggerProxy as Logger, Workflow,} from 'n8n-workflow'; -import { config } from '@config'; +import * as config from '../config'; import { WorkflowEntity } from './databases/entities/WorkflowEntity'; import { validate } from 'class-validator'; diff --git a/packages/cli/src/WorkflowRunner.ts b/packages/cli/src/WorkflowRunner.ts index 352cf9a209..56031d5a77 100644 --- a/packages/cli/src/WorkflowRunner.ts +++ b/packages/cli/src/WorkflowRunner.ts @@ -36,7 +36,7 @@ import { WorkflowOperationError, } from 'n8n-workflow'; -import { config } from '@config'; +import * as config from '../config'; import * as PCancelable from 'p-cancelable'; import { join as pathJoin } from 'path'; import { fork } from 'child_process'; diff --git a/packages/cli/src/WorkflowRunnerProcess.ts b/packages/cli/src/WorkflowRunnerProcess.ts index 7f03fe221d..3dbc77cf6c 100644 --- a/packages/cli/src/WorkflowRunnerProcess.ts +++ b/packages/cli/src/WorkflowRunnerProcess.ts @@ -38,7 +38,7 @@ import { getLogger, } from '../src/Logger'; -import { config } from '@config'; +import * as config from '../config'; export class WorkflowRunnerProcess { data: IWorkflowExecutionDataProcessWithExecution | undefined; diff --git a/packages/cli/src/databases/mysqldb/migrations/1588157391238-InitialMigration.ts b/packages/cli/src/databases/mysqldb/migrations/1588157391238-InitialMigration.ts index 8125fb43d5..1d1d4d8cc5 100644 --- a/packages/cli/src/databases/mysqldb/migrations/1588157391238-InitialMigration.ts +++ b/packages/cli/src/databases/mysqldb/migrations/1588157391238-InitialMigration.ts @@ -1,6 +1,6 @@ import { MigrationInterface, QueryRunner } from 'typeorm'; -import { config } from '@config'; +import * as config from '../../../../config'; export class InitialMigration1588157391238 implements MigrationInterface { name = 'InitialMigration1588157391238'; diff --git a/packages/cli/src/databases/mysqldb/migrations/1592447867632-WebhookModel.ts b/packages/cli/src/databases/mysqldb/migrations/1592447867632-WebhookModel.ts index 0054ece048..13969d72ef 100644 --- a/packages/cli/src/databases/mysqldb/migrations/1592447867632-WebhookModel.ts +++ b/packages/cli/src/databases/mysqldb/migrations/1592447867632-WebhookModel.ts @@ -3,7 +3,7 @@ import { QueryRunner, } from 'typeorm'; -import { config } from '@config'; +import * as config from '../../../../config'; export class WebhookModel1592447867632 implements MigrationInterface { name = 'WebhookModel1592447867632'; diff --git a/packages/cli/src/databases/mysqldb/migrations/1594902918301-CreateIndexStoppedAt.ts b/packages/cli/src/databases/mysqldb/migrations/1594902918301-CreateIndexStoppedAt.ts index 2527374eb2..24556ea6bd 100644 --- a/packages/cli/src/databases/mysqldb/migrations/1594902918301-CreateIndexStoppedAt.ts +++ b/packages/cli/src/databases/mysqldb/migrations/1594902918301-CreateIndexStoppedAt.ts @@ -1,6 +1,6 @@ import { MigrationInterface, QueryRunner } from "typeorm"; -import { config } from '@config'; +import * as config from '../../../../config'; export class CreateIndexStoppedAt1594902918301 implements MigrationInterface { name = 'CreateIndexStoppedAt1594902918301'; diff --git a/packages/cli/src/databases/mysqldb/migrations/1607431743767-MakeStoppedAtNullable.ts b/packages/cli/src/databases/mysqldb/migrations/1607431743767-MakeStoppedAtNullable.ts index d6d3e5d710..dd261b6620 100644 --- a/packages/cli/src/databases/mysqldb/migrations/1607431743767-MakeStoppedAtNullable.ts +++ b/packages/cli/src/databases/mysqldb/migrations/1607431743767-MakeStoppedAtNullable.ts @@ -1,6 +1,6 @@ import { MigrationInterface, QueryRunner } from "typeorm"; -import { config } from '@config'; +import * as config from '../../../../config'; export class MakeStoppedAtNullable1607431743767 implements MigrationInterface { diff --git a/packages/cli/src/databases/mysqldb/migrations/1611149998770-AddWebhookId.ts b/packages/cli/src/databases/mysqldb/migrations/1611149998770-AddWebhookId.ts index 4df194a8ed..7eb1e7aee7 100644 --- a/packages/cli/src/databases/mysqldb/migrations/1611149998770-AddWebhookId.ts +++ b/packages/cli/src/databases/mysqldb/migrations/1611149998770-AddWebhookId.ts @@ -1,5 +1,5 @@ import {MigrationInterface, QueryRunner} from "typeorm"; -import { config } from '@config'; +import * as config from '../../../../config'; export class AddWebhookId1611149998770 implements MigrationInterface { name = 'AddWebhookId1611149998770'; diff --git a/packages/cli/src/databases/mysqldb/migrations/1615306975123-ChangeDataSize.ts b/packages/cli/src/databases/mysqldb/migrations/1615306975123-ChangeDataSize.ts index a8bb2a54f6..793b178ef3 100644 --- a/packages/cli/src/databases/mysqldb/migrations/1615306975123-ChangeDataSize.ts +++ b/packages/cli/src/databases/mysqldb/migrations/1615306975123-ChangeDataSize.ts @@ -1,5 +1,5 @@ import { MigrationInterface, QueryRunner } from 'typeorm'; -import { config } from '@config'; +import * as config from '../../../../config'; export class ChangeDataSize1615306975123 implements MigrationInterface { name = 'ChangeDataSize1615306975123'; diff --git a/packages/cli/src/databases/mysqldb/migrations/1617268711084-CreateTagEntity.ts b/packages/cli/src/databases/mysqldb/migrations/1617268711084-CreateTagEntity.ts index 615100fcbe..cd2ec52c5b 100644 --- a/packages/cli/src/databases/mysqldb/migrations/1617268711084-CreateTagEntity.ts +++ b/packages/cli/src/databases/mysqldb/migrations/1617268711084-CreateTagEntity.ts @@ -1,5 +1,5 @@ import {MigrationInterface, QueryRunner} from "typeorm"; -import { config } from '@config'; +import * as config from '../../../../config'; export class CreateTagEntity1617268711084 implements MigrationInterface { name = 'CreateTagEntity1617268711084'; diff --git a/packages/cli/src/databases/mysqldb/migrations/1620729500000-ChangeCredentialDataSize.ts b/packages/cli/src/databases/mysqldb/migrations/1620729500000-ChangeCredentialDataSize.ts index 1ecfc0a2ca..ea1bd42049 100644 --- a/packages/cli/src/databases/mysqldb/migrations/1620729500000-ChangeCredentialDataSize.ts +++ b/packages/cli/src/databases/mysqldb/migrations/1620729500000-ChangeCredentialDataSize.ts @@ -1,5 +1,5 @@ import { MigrationInterface, QueryRunner } from 'typeorm'; -import { config } from '@config'; +import * as config from '../../../../config'; export class ChangeCredentialDataSize1620729500000 implements MigrationInterface { name = 'ChangeCredentialDataSize1620729500000'; diff --git a/packages/cli/src/databases/mysqldb/migrations/1620826335440-UniqueWorkflowNames.ts b/packages/cli/src/databases/mysqldb/migrations/1620826335440-UniqueWorkflowNames.ts index d05dfef3d2..3dcf379028 100644 --- a/packages/cli/src/databases/mysqldb/migrations/1620826335440-UniqueWorkflowNames.ts +++ b/packages/cli/src/databases/mysqldb/migrations/1620826335440-UniqueWorkflowNames.ts @@ -1,5 +1,5 @@ import {MigrationInterface, QueryRunner} from "typeorm"; -import { config } from '@config'; +import config = require("../../../../config"); export class UniqueWorkflowNames1620826335440 implements MigrationInterface { name = 'UniqueWorkflowNames1620826335440'; diff --git a/packages/cli/src/databases/mysqldb/migrations/1623936588000-CertifyCorrectCollation.ts b/packages/cli/src/databases/mysqldb/migrations/1623936588000-CertifyCorrectCollation.ts index 08961e92c1..079cd9cc70 100644 --- a/packages/cli/src/databases/mysqldb/migrations/1623936588000-CertifyCorrectCollation.ts +++ b/packages/cli/src/databases/mysqldb/migrations/1623936588000-CertifyCorrectCollation.ts @@ -1,5 +1,5 @@ import { MigrationInterface, QueryRunner } from 'typeorm'; -import { config } from '@config'; +import config = require('../../../../config'); export class CertifyCorrectCollation1623936588000 implements MigrationInterface { name = 'CertifyCorrectCollation1623936588000'; diff --git a/packages/cli/src/databases/postgresdb/migrations/1587669153312-InitialMigration.ts b/packages/cli/src/databases/postgresdb/migrations/1587669153312-InitialMigration.ts index eb337a36cc..eace7a92fb 100644 --- a/packages/cli/src/databases/postgresdb/migrations/1587669153312-InitialMigration.ts +++ b/packages/cli/src/databases/postgresdb/migrations/1587669153312-InitialMigration.ts @@ -1,7 +1,7 @@ import { MigrationInterface, QueryRunner } from 'typeorm'; -import { config } from '@config'; +import * as config from '../../../../config'; export class InitialMigration1587669153312 implements MigrationInterface { name = 'InitialMigration1587669153312'; diff --git a/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts b/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts index b38dbc876e..cbc0de279d 100644 --- a/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts +++ b/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts @@ -3,7 +3,7 @@ import { QueryRunner, } from 'typeorm'; -import { config } from '@config'; +import * as config from '../../../../config'; export class WebhookModel1589476000887 implements MigrationInterface { name = 'WebhookModel1589476000887'; diff --git a/packages/cli/src/databases/postgresdb/migrations/1594828256133-CreateIndexStoppedAt.ts b/packages/cli/src/databases/postgresdb/migrations/1594828256133-CreateIndexStoppedAt.ts index c560e0e326..664834082e 100644 --- a/packages/cli/src/databases/postgresdb/migrations/1594828256133-CreateIndexStoppedAt.ts +++ b/packages/cli/src/databases/postgresdb/migrations/1594828256133-CreateIndexStoppedAt.ts @@ -1,6 +1,6 @@ import { MigrationInterface, QueryRunner } from "typeorm"; -import { config } from '@config'; +import * as config from '../../../../config'; export class CreateIndexStoppedAt1594828256133 implements MigrationInterface { name = 'CreateIndexStoppedAt1594828256133'; diff --git a/packages/cli/src/databases/postgresdb/migrations/1607431743768-MakeStoppedAtNullable.ts b/packages/cli/src/databases/postgresdb/migrations/1607431743768-MakeStoppedAtNullable.ts index 8dc4c78dba..5f0a05c02c 100644 --- a/packages/cli/src/databases/postgresdb/migrations/1607431743768-MakeStoppedAtNullable.ts +++ b/packages/cli/src/databases/postgresdb/migrations/1607431743768-MakeStoppedAtNullable.ts @@ -1,6 +1,6 @@ import {MigrationInterface, QueryRunner} from "typeorm"; -import { config } from '@config'; +import * as config from '../../../../config'; export class MakeStoppedAtNullable1607431743768 implements MigrationInterface { name = 'MakeStoppedAtNullable1607431743768'; diff --git a/packages/cli/src/databases/postgresdb/migrations/1611144599516-AddWebhookId.ts b/packages/cli/src/databases/postgresdb/migrations/1611144599516-AddWebhookId.ts index 8bf811a9a4..b6f4d1a684 100644 --- a/packages/cli/src/databases/postgresdb/migrations/1611144599516-AddWebhookId.ts +++ b/packages/cli/src/databases/postgresdb/migrations/1611144599516-AddWebhookId.ts @@ -1,5 +1,5 @@ import {MigrationInterface, QueryRunner} from "typeorm"; -import { config } from '@config'; +import * as config from '../../../../config'; export class AddWebhookId1611144599516 implements MigrationInterface { name = 'AddWebhookId1611144599516'; diff --git a/packages/cli/src/databases/postgresdb/migrations/1617270242566-CreateTagEntity.ts b/packages/cli/src/databases/postgresdb/migrations/1617270242566-CreateTagEntity.ts index 3fc8216fb6..7ccdcd3181 100644 --- a/packages/cli/src/databases/postgresdb/migrations/1617270242566-CreateTagEntity.ts +++ b/packages/cli/src/databases/postgresdb/migrations/1617270242566-CreateTagEntity.ts @@ -1,5 +1,5 @@ import {MigrationInterface, QueryRunner} from "typeorm"; -import { config } from '@config'; +import * as config from '../../../../config'; export class CreateTagEntity1617270242566 implements MigrationInterface { name = 'CreateTagEntity1617270242566'; diff --git a/packages/cli/src/databases/postgresdb/migrations/1620824779533-UniqueWorkflowNames.ts b/packages/cli/src/databases/postgresdb/migrations/1620824779533-UniqueWorkflowNames.ts index bfd2ea324f..ab6adb2995 100644 --- a/packages/cli/src/databases/postgresdb/migrations/1620824779533-UniqueWorkflowNames.ts +++ b/packages/cli/src/databases/postgresdb/migrations/1620824779533-UniqueWorkflowNames.ts @@ -1,5 +1,5 @@ import {MigrationInterface, QueryRunner} from "typeorm"; -import { config } from '@config'; +import config = require("../../../../config"); export class UniqueWorkflowNames1620824779533 implements MigrationInterface { name = 'UniqueWorkflowNames1620824779533'; diff --git a/packages/cli/src/databases/sqlite/migrations/1588102412422-InitialMigration.ts b/packages/cli/src/databases/sqlite/migrations/1588102412422-InitialMigration.ts index fd5f51239a..09a0da911a 100644 --- a/packages/cli/src/databases/sqlite/migrations/1588102412422-InitialMigration.ts +++ b/packages/cli/src/databases/sqlite/migrations/1588102412422-InitialMigration.ts @@ -3,7 +3,7 @@ import { QueryRunner, } from 'typeorm'; -import { config } from '@config'; +import * as config from '../../../../config'; export class InitialMigration1588102412422 implements MigrationInterface { name = 'InitialMigration1588102412422'; diff --git a/packages/cli/src/databases/sqlite/migrations/1592445003908-WebhookModel.ts b/packages/cli/src/databases/sqlite/migrations/1592445003908-WebhookModel.ts index b956751834..b011061e28 100644 --- a/packages/cli/src/databases/sqlite/migrations/1592445003908-WebhookModel.ts +++ b/packages/cli/src/databases/sqlite/migrations/1592445003908-WebhookModel.ts @@ -3,7 +3,7 @@ import { QueryRunner, } from 'typeorm'; -import { config } from '@config'; +import * as config from '../../../../config'; export class WebhookModel1592445003908 implements MigrationInterface { name = 'WebhookModel1592445003908'; diff --git a/packages/cli/src/databases/sqlite/migrations/1594825041918-CreateIndexStoppedAt.ts b/packages/cli/src/databases/sqlite/migrations/1594825041918-CreateIndexStoppedAt.ts index 3d5c7860d5..7c8104f06a 100644 --- a/packages/cli/src/databases/sqlite/migrations/1594825041918-CreateIndexStoppedAt.ts +++ b/packages/cli/src/databases/sqlite/migrations/1594825041918-CreateIndexStoppedAt.ts @@ -1,6 +1,6 @@ import { MigrationInterface, QueryRunner } from "typeorm"; -import { config } from '@config'; +import * as config from '../../../../config'; export class CreateIndexStoppedAt1594825041918 implements MigrationInterface { name = 'CreateIndexStoppedAt1594825041918'; diff --git a/packages/cli/src/databases/sqlite/migrations/1607431743769-MakeStoppedAtNullable.ts b/packages/cli/src/databases/sqlite/migrations/1607431743769-MakeStoppedAtNullable.ts index 50cbe8d74d..29285c9192 100644 --- a/packages/cli/src/databases/sqlite/migrations/1607431743769-MakeStoppedAtNullable.ts +++ b/packages/cli/src/databases/sqlite/migrations/1607431743769-MakeStoppedAtNullable.ts @@ -1,6 +1,6 @@ import {MigrationInterface, QueryRunner} from "typeorm"; -import { config } from '@config'; +import * as config from '../../../../config'; export class MakeStoppedAtNullable1607431743769 implements MigrationInterface { diff --git a/packages/cli/src/databases/sqlite/migrations/1611071044839-AddWebhookId.ts b/packages/cli/src/databases/sqlite/migrations/1611071044839-AddWebhookId.ts index bcb0afc49a..c4489ad6a6 100644 --- a/packages/cli/src/databases/sqlite/migrations/1611071044839-AddWebhookId.ts +++ b/packages/cli/src/databases/sqlite/migrations/1611071044839-AddWebhookId.ts @@ -1,5 +1,5 @@ import {MigrationInterface, QueryRunner} from "typeorm"; -import { config } from '@config'; +import * as config from '../../../../config'; export class AddWebhookId1611071044839 implements MigrationInterface { name = 'AddWebhookId1611071044839'; diff --git a/packages/cli/src/databases/sqlite/migrations/1617213344594-CreateTagEntity.ts b/packages/cli/src/databases/sqlite/migrations/1617213344594-CreateTagEntity.ts index db00d17152..3f52eed827 100644 --- a/packages/cli/src/databases/sqlite/migrations/1617213344594-CreateTagEntity.ts +++ b/packages/cli/src/databases/sqlite/migrations/1617213344594-CreateTagEntity.ts @@ -1,5 +1,5 @@ import {MigrationInterface, QueryRunner} from "typeorm"; -import { config } from '@config'; +import * as config from '../../../../config'; export class CreateTagEntity1617213344594 implements MigrationInterface { name = 'CreateTagEntity1617213344594'; diff --git a/packages/cli/src/databases/sqlite/migrations/1620821879465-UniqueWorkflowNames.ts b/packages/cli/src/databases/sqlite/migrations/1620821879465-UniqueWorkflowNames.ts index 2e18b35889..732b080ed0 100644 --- a/packages/cli/src/databases/sqlite/migrations/1620821879465-UniqueWorkflowNames.ts +++ b/packages/cli/src/databases/sqlite/migrations/1620821879465-UniqueWorkflowNames.ts @@ -1,5 +1,5 @@ import {MigrationInterface, QueryRunner} from "typeorm"; -import { config } from '@config'; +import config = require("../../../../config"); export class UniqueWorkflowNames1620821879465 implements MigrationInterface { name = 'UniqueWorkflowNames1620821879465'; diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index a4288ebfaa..4aaf4747fc 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -19,13 +19,7 @@ "target": "es2017", "sourceMap": true, "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "baseUrl": ".", - "paths": { - "@config": [ - "config/index" - ] - } + "experimentalDecorators": true }, "include": [ "**/*.d.ts",