Skip to content

Commit

Permalink
Revert "update master (#5)" (#6)
Browse files Browse the repository at this point in the history
This reverts commit 40b5a12.
  • Loading branch information
LefebvreJonathan authored Jan 19, 2022
1 parent 40b5a12 commit 3428951
Show file tree
Hide file tree
Showing 592 changed files with 4,230 additions and 16,809 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ _START_PACKAGE
.vscode/*
!.vscode/extensions.json
.idea
vetur.config.js
nodelinter.config.json
packages/*/package-lock.json
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ npm install -g lerna

### Actual n8n setup

> **IMPORTANT**: All the steps below have to get executed at least once to get the development setup up and running!
> **IMPORTANT**: All the steps bellow have to get executed at least once to get the development setup up and running!
Now that everything n8n requires to run is installed the actual n8n code can be
checked out and set up:
Expand Down
3,468 changes: 1,881 additions & 1,587 deletions package-lock.json

Large diffs are not rendered by default.

22 changes: 7 additions & 15 deletions packages/cli/commands/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
/* eslint-disable no-console */
import { promises as fs } from 'fs';
import { Command, flags } from '@oclif/command';
import {
BinaryDataManager,
IBinaryDataConfig,
UserSettings,
PLACEHOLDER_EMPTY_WORKFLOW_ID,
} from 'n8n-core';
import { UserSettings } from 'n8n-core';
import { INode, LoggerProxy } from 'n8n-workflow';

import {
Expand All @@ -27,7 +22,6 @@ import {
} from '../src';

import { getLogger } from '../src/Logger';
import config = require('../config');

export class Execute extends Command {
static description = '\nExecutes a given workflow';
Expand All @@ -51,8 +45,6 @@ export class Execute extends Command {
async run() {
const logger = getLogger();
LoggerProxy.init(logger);
const binaryDataConfig = config.get('binaryDataManager') as IBinaryDataConfig;
await BinaryDataManager.init(binaryDataConfig, true);

// eslint-disable-next-line @typescript-eslint/no-shadow
const { flags } = this.parse(Execute);
Expand Down Expand Up @@ -101,8 +93,8 @@ export class Execute extends Command {
console.info(`The file "${flags.file}" does not contain valid workflow data.`);
return;
}

workflowId = workflowData.id ? workflowData.id.toString() : PLACEHOLDER_EMPTY_WORKFLOW_ID;
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
workflowId = workflowData.id!.toString();
}

// Wait till the database is ready
Expand Down Expand Up @@ -133,16 +125,16 @@ export class Execute extends Command {
const externalHooks = ExternalHooks();
await externalHooks.init();

const instanceId = await UserSettings.getInstanceId();
const { cli } = await GenericHelpers.getVersions();
InternalHooksManager.init(instanceId, cli);

// Add the found types to an instance other parts of the application can use
const nodeTypes = NodeTypes();
await nodeTypes.init(loadNodesAndCredentials.nodeTypes);
const credentialTypes = CredentialTypes();
await credentialTypes.init(loadNodesAndCredentials.credentialTypes);

const instanceId = await UserSettings.getInstanceId();
const { cli } = await GenericHelpers.getVersions();
InternalHooksManager.init(instanceId, cli, nodeTypes);

if (!WorkflowHelpers.isWorkflowIdValid(workflowId)) {
workflowId = undefined;
}
Expand Down
13 changes: 5 additions & 8 deletions packages/cli/commands/executeBatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import * as fs from 'fs';
import { Command, flags } from '@oclif/command';

import { BinaryDataManager, IBinaryDataConfig, UserSettings } from 'n8n-core';
import { UserSettings } from 'n8n-core';

// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { INode, ITaskData, LoggerProxy } from 'n8n-workflow';
Expand All @@ -36,7 +36,6 @@ import {
NodeTypes,
WorkflowRunner,
} from '../src';
import config = require('../config');

export class ExecuteBatch extends Command {
static description = '\nExecutes multiple workflows once';
Expand Down Expand Up @@ -191,8 +190,6 @@ export class ExecuteBatch extends Command {

const logger = getLogger();
LoggerProxy.init(logger);
const binaryDataConfig = config.get('binaryDataManager') as IBinaryDataConfig;
await BinaryDataManager.init(binaryDataConfig, true);

// eslint-disable-next-line @typescript-eslint/no-shadow
const { flags } = this.parse(ExecuteBatch);
Expand Down Expand Up @@ -308,16 +305,16 @@ export class ExecuteBatch extends Command {
const externalHooks = ExternalHooks();
await externalHooks.init();

const instanceId = await UserSettings.getInstanceId();
const { cli } = await GenericHelpers.getVersions();
InternalHooksManager.init(instanceId, cli);

// Add the found types to an instance other parts of the application can use
const nodeTypes = NodeTypes();
await nodeTypes.init(loadNodesAndCredentials.nodeTypes);
const credentialTypes = CredentialTypes();
await credentialTypes.init(loadNodesAndCredentials.credentialTypes);

const instanceId = await UserSettings.getInstanceId();
const { cli } = await GenericHelpers.getVersions();
InternalHooksManager.init(instanceId, cli, nodeTypes);

// Send a shallow copy of allWorkflows so we still have all workflow data.
const results = await this.runTests([...allWorkflows]);

Expand Down
7 changes: 2 additions & 5 deletions packages/cli/commands/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import * as localtunnel from 'localtunnel';
import { BinaryDataManager, IBinaryDataConfig, TUNNEL_SUBDOMAIN_ENV, UserSettings } from 'n8n-core';
import { 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';
Expand Down Expand Up @@ -303,10 +303,7 @@ export class Start extends Command {

const instanceId = await UserSettings.getInstanceId();
const { cli } = await GenericHelpers.getVersions();
InternalHooksManager.init(instanceId, cli, nodeTypes);

const binaryDataConfig = config.get('binaryDataManager') as IBinaryDataConfig;
await BinaryDataManager.init(binaryDataConfig, true);
InternalHooksManager.init(instanceId, cli);

await Server.start();

Expand Down
7 changes: 2 additions & 5 deletions packages/cli/commands/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/unbound-method */
import { BinaryDataManager, IBinaryDataConfig, UserSettings } from 'n8n-core';
import { UserSettings } from 'n8n-core';
import { Command, flags } from '@oclif/command';
// eslint-disable-next-line import/no-extraneous-dependencies
import * as Redis from 'ioredis';
Expand Down Expand Up @@ -150,10 +150,7 @@ export class Webhook extends Command {

const instanceId = await UserSettings.getInstanceId();
const { cli } = await GenericHelpers.getVersions();
InternalHooksManager.init(instanceId, cli, nodeTypes);

const binaryDataConfig = config.get('binaryDataManager') as IBinaryDataConfig;
await BinaryDataManager.init(binaryDataConfig);
InternalHooksManager.init(instanceId, cli);

if (config.get('executions.mode') === 'queue') {
const redisHost = config.get('queue.bull.redis.host');
Expand Down
7 changes: 2 additions & 5 deletions packages/cli/commands/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import * as PCancelable from 'p-cancelable';

import { Command, flags } from '@oclif/command';
import { BinaryDataManager, IBinaryDataConfig, UserSettings, WorkflowExecute } from 'n8n-core';
import { UserSettings, WorkflowExecute } from 'n8n-core';

import { IExecuteResponsePromiseData, INodeTypes, IRun, Workflow, LoggerProxy } from 'n8n-workflow';

Expand Down Expand Up @@ -274,10 +274,7 @@ export class Worker extends Command {
const versions = await GenericHelpers.getVersions();
const instanceId = await UserSettings.getInstanceId();

InternalHooksManager.init(instanceId, versions.cli, nodeTypes);

const binaryDataConfig = config.get('binaryDataManager') as IBinaryDataConfig;
await BinaryDataManager.init(binaryDataConfig);
InternalHooksManager.init(instanceId, versions.cli);

console.info('\nn8n worker is now ready');
console.info(` * Version: ${versions.cli}`);
Expand Down
46 changes: 0 additions & 46 deletions packages/cli/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,12 +507,6 @@ const config = convict({
env: 'N8N_ENDPOINT_WEBHOOK_TEST',
doc: 'Path for test-webhook endpoint',
},
disableUi: {
format: Boolean,
default: false,
env: 'N8N_DISABLE_UI',
doc: 'Disable N8N UI (Frontend).',
},
disableProductionWebhooksOnMainProcess: {
format: Boolean,
default: false,
Expand Down Expand Up @@ -656,39 +650,6 @@ const config = convict({
},
},

binaryDataManager: {
availableModes: {
format: String,
default: 'filesystem',
env: 'N8N_AVAILABLE_BINARY_DATA_MODES',
doc: 'Available modes of binary data storage, as comma separated strings',
},
mode: {
format: String,
default: 'default',
env: 'N8N_DEFAULT_BINARY_DATA_MODE',
doc: 'Storage mode for binary data, default | filesystem',
},
localStoragePath: {
format: String,
default: path.join(core.UserSettings.getUserN8nFolderPath(), 'binaryData'),
env: 'N8N_BINARY_DATA_STORAGE_PATH',
doc: 'Path for binary data storage in "filesystem" mode',
},
binaryDataTTL: {
format: Number,
default: 60,
env: 'N8N_BINARY_DATA_TTL',
doc: 'TTL for binary data of unsaved executions in minutes',
},
persistedBinaryDataTTL: {
format: Number,
default: 1440,
env: 'N8N_PERSISTED_BINARY_DATA_TTL',
doc: 'TTL for persisted binary data in minutes (binary data gets deleted if not persisted before TTL expires)',
},
},

deployment: {
type: {
format: String,
Expand Down Expand Up @@ -728,13 +689,6 @@ const config = convict({
},
},
},

defaultLocale: {
doc: 'Default locale for the UI',
format: String,
default: 'en',
env: 'N8N_DEFAULT_LOCALE',
},
});

// Overwrite default configuration with settings which got defined in
Expand Down
10 changes: 5 additions & 5 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "n8n",
"version": "0.159.1",
"version": "0.153.0",
"description": "n8n Workflow Automation Tool",
"license": "SEE LICENSE IN LICENSE.md",
"homepage": "https://n8n.io",
Expand Down Expand Up @@ -111,10 +111,10 @@
"localtunnel": "^2.0.0",
"lodash.get": "^4.4.2",
"mysql2": "~2.3.0",
"n8n-core": "~0.101.1",
"n8n-editor-ui": "~0.126.0",
"n8n-nodes-base": "~0.157.0",
"n8n-workflow": "~0.83.0",
"n8n-core": "~0.96.0",
"n8n-editor-ui": "~0.120.0",
"n8n-nodes-base": "~0.150.0",
"n8n-workflow": "~0.79.0",
"oauth-1.0a": "^2.2.6",
"open": "^7.0.0",
"pg": "^8.3.0",
Expand Down
3 changes: 0 additions & 3 deletions packages/cli/src/ActiveWorkflowRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import {
WorkflowExecuteAdditionalData,
WorkflowHelpers,
WorkflowRunner,
ExternalHooks,
} from '.';
import config = require('../config');

Expand Down Expand Up @@ -113,8 +112,6 @@ export class ActiveWorkflowRunner {
}
Logger.verbose('Finished initializing active workflows (startup)');
}
const externalHooks = ExternalHooks();
await externalHooks.run('activeWorkflows.initialized', []);
}

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
Expand Down
8 changes: 1 addition & 7 deletions packages/cli/src/Interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ export interface IDiagnosticInfo {
[key: string]: string | number | undefined;
};
deploymentType: string;
binaryDataMode: string;
}

export interface IInternalHooksClass {
Expand All @@ -323,11 +322,7 @@ export interface IInternalHooksClass {
onWorkflowCreated(workflow: IWorkflowBase): Promise<void>;
onWorkflowDeleted(workflowId: string): Promise<void>;
onWorkflowSaved(workflow: IWorkflowBase): Promise<void>;
onWorkflowPostExecute(
executionId: string,
workflow: IWorkflowBase,
runData?: IRun,
): Promise<void>;
onWorkflowPostExecute(workflow: IWorkflowBase, runData?: IRun): Promise<void>;
}

export interface IN8nConfig {
Expand Down Expand Up @@ -408,7 +403,6 @@ export interface IN8nUISettings {
instanceId: string;
telemetry: ITelemetrySettings;
personalizationSurvey: IPersonalizationSurvey;
defaultLocale: string;
}

export interface IPersonalizationSurveyAnswers {
Expand Down
Loading

0 comments on commit 3428951

Please sign in to comment.