Skip to content

Commit

Permalink
Merge branch 'master' into ado-6-ndv-simplify-credentials
Browse files Browse the repository at this point in the history
* master:
  ci: Fix linting on builds (no-changelog) (#5062)
  refactor: Lint for no interpolation in regular string (#5060) (no-changelog)
  ci: Fix lint for build (no-changelog) (#5059)
  perf: Prevent oclif from loading ts-node and typescript (#5047) (no-changelog)
  fix(editor): Make node title non-editable in executions view (#5046)
  refactor: Lint for no unneeded backticks (#5057) (no-changelog)
  fix(core): Fix full manual execution for error trigger as starter of 2+ node workflow (#5055)
  fix(editor): Support tabbing away from inline expression editor (#5056)
  refactor(editor): Usage and plans page on Desktop (#5051)
  📚 Update CHANGELOG.md and main package.json to 0.209.4
  🔖 Release n8n@0.209.4
  ⬆️ Set n8n-editor-ui@0.175.4 on n8n
  🔖 Release n8n-editor-ui@0.175.4
  fix(editor): Usage and plans page on Desktop (#5045)
  feat(editor): Switch to expression on `=` input (#5044)
  fix(editor): Fix trigger node type identification on add to canvas (#5043)
  • Loading branch information
MiloradFilipovic committed Dec 29, 2022
2 parents e65f6f0 + 99e3eb6 commit 5af8613
Show file tree
Hide file tree
Showing 256 changed files with 964 additions and 802 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## [0.209.4](https://github.com/n8n-io/n8n/compare/n8n@0.209.3...n8n@0.209.4) (2022-12-28)


### Bug Fixes

* **editor:** Add sticky note without manual trigger ([#5039](https://github.com/n8n-io/n8n/issues/5039)) ([18140e0](https://github.com/n8n-io/n8n/commit/18140e059bd95d51ad24a4ef4d6e6c72ce3137f3))
* **editor:** Display default missing value in table view as `undefined` ([#5038](https://github.com/n8n-io/n8n/issues/5038)) ([33d7a13](https://github.com/n8n-io/n8n/commit/33d7a13e73dffc72b1a9aa4cf603e7758c65e40c))
* **editor:** Fix displaying of some trigger nodes in the creator panel ([#5040](https://github.com/n8n-io/n8n/issues/5040)) ([4daf905](https://github.com/n8n-io/n8n/commit/4daf905ce264f6f76045a508e2f9ed849f2b1f5e))
* **editor:** Fix trigger node type identification on add to canvas ([#5043](https://github.com/n8n-io/n8n/issues/5043)) ([2aba0c6](https://github.com/n8n-io/n8n/commit/2aba0c6d47d6d87038db6877a29e15ed079d712b))
* **editor:** Usage and plans page on Desktop ([#5045](https://github.com/n8n-io/n8n/issues/5045)) ([26e2321](https://github.com/n8n-io/n8n/commit/26e2321a710d7b42559492a6605cef3a248d918e))


### Features

* **editor:** Switch to expression on `=` input ([#5044](https://github.com/n8n-io/n8n/issues/5044)) ([16bd761](https://github.com/n8n-io/n8n/commit/16bd7610fc337fa5ba9b0088b91396bb13570bcb))



## [0.209.3](https://github.com/n8n-io/n8n/compare/n8n@0.209.2...n8n@0.209.3) (2022-12-27)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "n8n",
"version": "0.209.3",
"version": "0.209.4",
"private": true,
"homepage": "https://n8n.io",
"engines": {
Expand Down
4 changes: 4 additions & 0 deletions packages/@n8n_io/eslint-config/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,10 @@ const config = (module.exports = {

'n8n-local-rules/no-json-parse-json-stringify': 'error',

'n8n-local-rules/no-unneeded-backticks': 'error',

'n8n-local-rules/no-interpolation-in-regular-string': 'error',

// ******************************************************************
// overrides to base ruleset
// ******************************************************************
Expand Down
63 changes: 63 additions & 0 deletions packages/@n8n_io/eslint-config/local-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,69 @@ module.exports = {
};
},
},

'no-unneeded-backticks': {
meta: {
type: 'problem',
docs: {
description:
'Template literal backticks may only be used for string interpolation or multiline strings.',
recommended: 'error',
},
messages: {
noUneededBackticks: 'Use single or double quotes, not backticks',
},
fixable: 'code',
},
create(context) {
return {
TemplateLiteral(node) {
if (node.expressions.length > 0) return;
if (node.quasis.every((q) => q.loc.start.line !== q.loc.end.line)) return;

node.quasis.forEach((q) => {
const escaped = q.value.raw.replace(/(?<!\\)'/g, "\\'");

context.report({
messageId: 'noUneededBackticks',
node,
fix: (fixer) => fixer.replaceText(q, `'${escaped}'`),
});
});
},
};
},
},

'no-interpolation-in-regular-string': {
meta: {
type: 'problem',
docs: {
description:
'String interpolation `${...}` requires backticks, not single or double quotes.',
recommended: 'error',
},
messages: {
useBackticks: 'Use backticks to interpolate',
},
fixable: 'code',
},
create(context) {
return {
Literal(node) {
if (typeof node.value !== 'string') return;

if (/\$\{/.test(node.value)) {
context.report({
messageId: 'useBackticks',
node,
fix: (fixer) => fixer.replaceText(node, `\`${node.value}\``),
});
}
},
};
},
},
};

const isJsonParseCall = (node) =>
Expand Down
3 changes: 3 additions & 0 deletions packages/cli/bin/n8n
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ if (![14, 16, 18].includes(nodeVersionMajor)) {
process.exit(1);
}

// Prevent oclif from loading ts-node and typescript
process.env.OCLIF_TS_NODE = '0';

require('source-map-support').install();

require('@oclif/command')
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "n8n",
"version": "0.209.3",
"version": "0.209.4",
"description": "n8n Workflow Automation Tool",
"license": "SEE LICENSE IN LICENSE.md",
"homepage": "https://n8n.io",
Expand Down Expand Up @@ -151,7 +151,7 @@
"lodash.unset": "^4.5.2",
"mysql2": "~2.3.0",
"n8n-core": "~0.149.2",
"n8n-editor-ui": "~0.175.3",
"n8n-editor-ui": "~0.175.4",
"n8n-nodes-base": "~0.207.2",
"n8n-workflow": "~0.131.2",
"nodemailer": "^6.7.1",
Expand Down
13 changes: 7 additions & 6 deletions packages/cli/src/ActiveWorkflowRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ import { WorkflowRunner } from '@/WorkflowRunner';
import { ExternalHooks } from '@/ExternalHooks';
import { whereClause } from './UserManagement/UserManagementHelper';

const WEBHOOK_PROD_UNREGISTERED_HINT = `The workflow must be active for a production URL to run successfully. You can activate the workflow using the toggle in the top-right of the editor. Note that unlike test URL calls, production URL calls aren't shown on the canvas (only in the executions list)`;
const WEBHOOK_PROD_UNREGISTERED_HINT =
"The workflow must be active for a production URL to run successfully. You can activate the workflow using the toggle in the top-right of the editor. Note that unlike test URL calls, production URL calls aren't shown on the canvas (only in the executions list)";

export class ActiveWorkflowRunner {
private activeWorkflows: ActiveWorkflows | null = null;
Expand Down Expand Up @@ -118,11 +119,11 @@ export class ActiveWorkflowRunner {
workflowName: workflowData.name,
workflowId: workflowData.id,
});
console.log(` => Started`);
console.log(' => Started');
} catch (error) {
ErrorReporter.error(error);
console.log(
` => ERROR: Workflow could not be activated on first try, keep on trying`,
' => ERROR: Workflow could not be activated on first try, keep on trying',
);
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
console.log(` ${error.message}`);
Expand Down Expand Up @@ -773,7 +774,7 @@ export class ActiveWorkflowRunner {
workflowData?: IWorkflowDb,
): Promise<void> {
if (this.activeWorkflows === null) {
throw new Error(`The "activeWorkflows" instance did not get initialized yet.`);
throw new Error('The "activeWorkflows" instance did not get initialized yet.');
}

let workflowInstance: Workflow;
Expand Down Expand Up @@ -806,7 +807,7 @@ export class ActiveWorkflowRunner {
if (!canBeActivated) {
Logger.error(`Unable to activate workflow "${workflowData.name}"`);
throw new Error(
`The workflow can not be activated because it does not contain any nodes which could start the workflow. Only workflows which have trigger or webhook nodes can be activated.`,
'The workflow can not be activated because it does not contain any nodes which could start the workflow. Only workflows which have trigger or webhook nodes can be activated.',
);
}

Expand Down Expand Up @@ -1001,7 +1002,7 @@ export class ActiveWorkflowRunner {
return;
}

throw new Error(`The "activeWorkflows" instance did not get initialized yet.`);
throw new Error('The "activeWorkflows" instance did not get initialized yet.');
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/Push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class Push {
this.channel.on('disconnect', (channel: string, res: Response) => {
if (res.req !== undefined) {
const { sessionId } = res.req.query;
Logger.debug(`Remove editor-UI session`, { sessionId });
Logger.debug('Remove editor-UI session', { sessionId });
delete this.connections[sessionId as string];
}
});
Expand All @@ -27,7 +27,7 @@ export class Push {
* @param {Response} res The response
*/
add(sessionId: string, req: Request, res: Response) {
Logger.debug(`Add editor-UI session`, { sessionId });
Logger.debug('Add editor-UI session', { sessionId });

if (this.connections[sessionId] !== undefined) {
// Make sure to remove existing connection with the same session
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ class App {
const parameters = toHttpNodeParameters(curlCommand);
return ResponseHelper.flattenObject(parameters, 'parameters');
} catch (e) {
throw new ResponseHelper.BadRequestError(`Invalid cURL command`);
throw new ResponseHelper.BadRequestError('Invalid cURL command');
}
},
),
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/src/TestWebhooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import * as Push from '@/Push';
import * as ResponseHelper from '@/ResponseHelper';
import * as WebhookHelpers from '@/WebhookHelpers';

const WEBHOOK_TEST_UNREGISTERED_HINT = `Click the 'Execute workflow' button on the canvas, then try again. (In test mode, the webhook only works for one call after you click this button)`;
const WEBHOOK_TEST_UNREGISTERED_HINT =
"Click the 'Execute workflow' button on the canvas, then try again. (In test mode, the webhook only works for one call after you click this button)";

export class TestWebhooks {
private testWebhookData: {
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/src/UserManagement/routes/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export function usersNamespace(this: N8nApp): void {
const usersToSetUp = Object.keys(createUsers).filter((email) => createUsers[email] === null);
const total = usersToSetUp.length;

Logger.debug(total > 1 ? `Creating ${total} user shells...` : `Creating 1 user shell...`);
Logger.debug(total > 1 ? `Creating ${total} user shells...` : 'Creating 1 user shell...');

try {
await Db.transaction(async (transactionManager) => {
Expand Down Expand Up @@ -156,7 +156,7 @@ export function usersNamespace(this: N8nApp): void {
}

Logger.info('Created user shell(s) successfully', { userId: req.user.id });
Logger.verbose(total > 1 ? `${total} user shells created` : `1 user shell created`, {
Logger.verbose(total > 1 ? `${total} user shells created` : '1 user shell created', {
userShells: createUsers,
});

Expand Down Expand Up @@ -200,7 +200,7 @@ export function usersNamespace(this: N8nApp): void {
domain: baseUrl,
email,
});
resp.error = `Email could not be sent`;
resp.error = 'Email could not be sent';
}
return resp;
}),
Expand All @@ -211,7 +211,7 @@ export function usersNamespace(this: N8nApp): void {
Logger.debug(
usersPendingSetup.length > 1
? `Sent ${usersPendingSetup.length} invite emails successfully`
: `Sent 1 invite email successfully`,
: 'Sent 1 invite email successfully',
{ userShells: createUsers },
);

Expand Down
12 changes: 6 additions & 6 deletions packages/cli/src/WorkflowExecuteAdditionalData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export function executeErrorWorkflow(
workflowData.settings.errorWorkflow.toString() === workflowData.id.toString()
)
) {
Logger.verbose(`Start external error workflow`, {
Logger.verbose('Start external error workflow', {
executionId,
errorWorkflowId: workflowData.settings.errorWorkflow.toString(),
workflowId: workflowData.id,
Expand Down Expand Up @@ -177,7 +177,7 @@ export function executeErrorWorkflow(
workflowData.id !== undefined &&
workflowData.nodes.some((node) => node.type === ERROR_TRIGGER_TYPE)
) {
Logger.verbose(`Start internal error workflow`, { executionId, workflowId: workflowData.id });
Logger.verbose('Start internal error workflow', { executionId, workflowId: workflowData.id });
void getWorkflowOwner(workflowData.id).then((user) => {
void WorkflowHelpers.executeErrorWorkflow(
workflowData.id!.toString(),
Expand Down Expand Up @@ -293,7 +293,7 @@ function hookFunctionsPush(): IWorkflowExecuteHooks {
],
workflowExecuteBefore: [
async function (this: WorkflowHooks): Promise<void> {
Logger.debug(`Executing hook (hookFunctionsPush)`, {
Logger.debug('Executing hook (hookFunctionsPush)', {
executionId: this.executionId,
sessionId: this.sessionId,
workflowId: this.workflowData.id,
Expand Down Expand Up @@ -324,7 +324,7 @@ function hookFunctionsPush(): IWorkflowExecuteHooks {
fullRunData: IRun,
newStaticData: IDataObject,
): Promise<void> {
Logger.debug(`Executing hook (hookFunctionsPush)`, {
Logger.debug('Executing hook (hookFunctionsPush)', {
executionId: this.executionId,
sessionId: this.sessionId,
workflowId: this.workflowData.id,
Expand Down Expand Up @@ -490,7 +490,7 @@ function hookFunctionsSave(parentProcessMode?: string): IWorkflowExecuteHooks {
fullRunData: IRun,
newStaticData: IDataObject,
): Promise<void> {
Logger.debug(`Executing hook (hookFunctionsSave)`, {
Logger.debug('Executing hook (hookFunctionsSave)', {
executionId: this.executionId,
workflowId: this.workflowData.id,
});
Expand Down Expand Up @@ -830,7 +830,7 @@ export async function getWorkflowData(
): Promise<IWorkflowBase> {
if (workflowInfo.id === undefined && workflowInfo.code === undefined) {
throw new Error(
`No information about the workflow to execute found. Please provide either the "id" or "code"!`,
'No information about the workflow to execute found. Please provide either the "id" or "code"!',
);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/api/e2e.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const setupUserManagement = async () => {
`INSERT INTO user (id, globalRoleId) values ("${uuid()}", ${instanceOwnerRole[0].insertId})`,
);
await connection.query(
`INSERT INTO "settings" (key, value, loadOnStartup) values ('userManagement.isInstanceOwnerSetUp', 'false', true), ('userManagement.skipInstanceOwnerSetup', 'false', true)`,
"INSERT INTO \"settings\" (key, value, loadOnStartup) values ('userManagement.isInstanceOwnerSetUp', 'false', true), ('userManagement.skipInstanceOwnerSetup', 'false', true)",
);
};

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/db/revert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class DbRevertMigrationCommand extends Command {
connection = Db.collections.Credentials.manager.connection;

if (!connection) {
throw new Error(`No database connection available.`);
throw new Error('No database connection available.');
}

const connectionOptions: ConnectionOptions = Object.assign(connection.options, {
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/commands/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { findCliWorkflowStart } from '@/utils';
export class Execute extends Command {
static description = '\nExecutes a given workflow';

static examples = [`$ n8n execute --id=5`, `$ n8n execute --file=workflow.json`];
static examples = ['$ n8n execute --id=5', '$ n8n execute --file=workflow.json'];

static flags = {
help: flags.help({ char: 'h' }),
Expand Down Expand Up @@ -59,12 +59,12 @@ export class Execute extends Command {
const loadNodesAndCredentialsPromise = loadNodesAndCredentials.init();

if (!flags.id && !flags.file) {
console.info(`Either option "--id" or "--file" have to be set!`);
console.info('Either option "--id" or "--file" have to be set!');
return;
}

if (flags.id && flags.file) {
console.info(`Either "id" or "file" can be set never both!`);
console.info('Either "id" or "file" can be set never both!');
return;
}

Expand Down
Loading

0 comments on commit 5af8613

Please sign in to comment.