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:
  📚 Update CHANGELOG.md and main package.json to 0.212.1
  🔖 Release n8n@0.212.1
  ⬆️ Set n8n-core@0.151.2, n8n-editor-ui@0.178.1, n8n-nodes-base@0.210.1 and n8n-workflow@0.133.2 on n8n
  🔖 Release n8n-editor-ui@0.178.1
  ⬆️ Set n8n-workflow@0.133.2 on n8n-editor-ui
  🔖 Release n8n-nodes-base@0.210.1
  ⬆️ Set n8n-core@0.151.2 and n8n-workflow@0.133.2 on n8n-nodes-base
  🔖 Release n8n-node-dev@0.90.2
  ⬆️ Set n8n-core@0.151.2 and n8n-workflow@0.133.2 on n8n-node-dev
  🔖 Release n8n-core@0.151.2
  ⬆️ Set n8n-workflow@0.133.2 on n8n-core
  🔖 Release n8n-workflow@0.133.2
  ci: Fix typing issues in cli tests (no-changelog) (#5227)
  fix(editor): Remove infinite loading in not found workflow level execution (#5174)
  fix: IsWeekend not checking if DateTime (#5221) (no-changelog)
  fix(core): Fix execute-once incoming data handling (#5211)
  fix(core): Make pindata with webhook responding on last node manual-only (#5223)
  fix(core): Fix onWorkflowPostExecute not being called (#5224)
  fix(core): Fix expression extension misdetection (#5219)
  fix: Add schema to postgres migrations (hotfix) (#5218)
  • Loading branch information
MiloradFilipovic committed Jan 24, 2023
2 parents 926f1ca + 726b573 commit 3bd5ea5
Show file tree
Hide file tree
Showing 25 changed files with 125 additions and 90 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
## [0.212.1](https://github.com/n8n-io/n8n/compare/n8n@0.212.0...n8n@0.212.1) (2023-01-23)


### Bug Fixes

* Add schema to postgres migrations (hotfix) ([#5218](https://github.com/n8n-io/n8n/issues/5218)) ([c5245dd](https://github.com/n8n-io/n8n/commit/c5245dd387f8829210a922223e46df7f275e79ca))
* **core:** Fix execute-once incoming data handling ([#5211](https://github.com/n8n-io/n8n/issues/5211)) ([3ea83d8](https://github.com/n8n-io/n8n/commit/3ea83d872ee2f8326fc9cb898fdb05bbe3b827bf))
* **core:** Fix expression extension misdetection ([#5219](https://github.com/n8n-io/n8n/issues/5219)) ([0b123ce](https://github.com/n8n-io/n8n/commit/0b123ce05e14a996f74ed4fe16008edca836d099))
* **core:** Fix onWorkflowPostExecute not being called ([#5224](https://github.com/n8n-io/n8n/issues/5224)) ([4f89fb4](https://github.com/n8n-io/n8n/commit/4f89fb4d4d663a0a39081ceda9d6e88e6c605859))
* **core:** Fix url in error handelling for the error Trigger ([#5201](https://github.com/n8n-io/n8n/issues/5201)) ([6e39175](https://github.com/n8n-io/n8n/commit/6e391755e47efc8a10529b24dee5e90c466b20b9))
* **core:** Make pindata with webhook responding on last node manual-only ([#5223](https://github.com/n8n-io/n8n/issues/5223)) ([fcbf4fd](https://github.com/n8n-io/n8n/commit/fcbf4fd587c0c8721f58b09edc68fe140acaf9f6))
* **editor:** Making parameter input components label configurable ([#5195](https://github.com/n8n-io/n8n/issues/5195)) ([9ce526e](https://github.com/n8n-io/n8n/commit/9ce526e784a6e61ed0f5b0a9ddb9d4ea21584ab2))
* **editor:** Remove infinite loading in not found workflow level execution ([#5174](https://github.com/n8n-io/n8n/issues/5174)) ([96dddf1](https://github.com/n8n-io/n8n/commit/96dddf12e1561935fa191e55baa950c207796e83))
* **Linear Node:** Fix issue with single item not being returned ([#5193](https://github.com/n8n-io/n8n/issues/5193)) ([e810966](https://github.com/n8n-io/n8n/commit/e810966a3b00e7a581120df2b22d71026e9ba4cb))
* **Notion (Beta) Node:** Fix create database page fails if relation param is empty/undefined ([#5182](https://github.com/n8n-io/n8n/issues/5182)) ([11da863](https://github.com/n8n-io/n8n/commit/11da863a2104259248b67edfff7bee3e18b3789a))


### Features

* **Google Analytics Node:** Overhaul for google analytics node ([736e700](https://github.com/n8n-io/n8n/commit/736e700902d333df55abff86c15c688de15c9bde))



# [0.212.0](https://github.com/n8n-io/n8n/compare/n8n@0.211.2...n8n@0.212.0) (2023-01-19)


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.212.0",
"version": "0.212.1",
"private": true,
"homepage": "https://n8n.io",
"engines": {
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.212.0",
"version": "0.212.1",
"description": "n8n Workflow Automation Tool",
"license": "SEE LICENSE IN LICENSE.md",
"homepage": "https://n8n.io",
Expand Down Expand Up @@ -163,10 +163,10 @@
"lodash.unset": "^4.5.2",
"luxon": "^3.1.0",
"mysql2": "~2.3.3",
"n8n-core": "~0.151.1",
"n8n-editor-ui": "~0.178.0",
"n8n-nodes-base": "~0.210.0",
"n8n-workflow": "~0.133.1",
"n8n-core": "~0.151.2",
"n8n-editor-ui": "~0.178.1",
"n8n-nodes-base": "~0.210.1",
"n8n-workflow": "~0.133.2",
"nodemailer": "^6.7.1",
"oauth-1.0a": "^2.2.6",
"open": "^7.0.0",
Expand Down
7 changes: 6 additions & 1 deletion packages/cli/src/WorkflowExecuteAdditionalData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,12 @@ async function executeWorkflow(

await externalHooks.run('workflow.postExecute', [data, workflowData, executionId]);

void InternalHooksManager.getInstance().onWorkflowBeforeExecute(executionId || '', runData);
void InternalHooksManager.getInstance().onWorkflowPostExecute(
executionId,
workflowData,
data,
additionalData.userId,
);

if (data.finished === true) {
// Workflow did finish successfully
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/WorkflowHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function getDataLastExecutedNodeData(inputData: IRun): ITaskData | undefi

let lastNodePinData = pinData[lastNodeExecuted];

if (lastNodePinData) {
if (lastNodePinData && inputData.mode === 'manual') {
if (!Array.isArray(lastNodePinData)) lastNodePinData = [lastNodePinData];

const itemsPerRun = lastNodePinData.map((item, index) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import { logMigrationEnd, logMigrationStart } from '@db/utils/migrationHelpers';
import config from '@/config';
import { getTablePrefix, logMigrationEnd, logMigrationStart } from '@db/utils/migrationHelpers';

export class DeleteExecutionsWithWorkflows1673268682475 implements MigrationInterface {
name = 'DeleteExecutionsWithWorkflows1673268682475';
public async up(queryRunner: QueryRunner): Promise<void> {
logMigrationStart(this.name);
const tablePrefix = config.getEnv('database.tablePrefix');
const tablePrefix = getTablePrefix();

await queryRunner.query(`ALTER TABLE \`${tablePrefix}execution_entity\` MODIFY workflowId INT`);

Expand All @@ -31,7 +30,7 @@ export class DeleteExecutionsWithWorkflows1673268682475 implements MigrationInte
}

public async down(queryRunner: QueryRunner): Promise<void> {
const tablePrefix = config.getEnv('database.tablePrefix');
const tablePrefix = getTablePrefix();
await queryRunner.query(
`ALTER TABLE \`${tablePrefix}execution_entity\`
DROP FOREIGN KEY \`FK_${tablePrefix}execution_entity_workflowId\``,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import { logMigrationEnd, logMigrationStart } from '@db/utils/migrationHelpers';
import config from '@/config';
import { getTablePrefix, logMigrationEnd, logMigrationStart } from '@db/utils/migrationHelpers';

export class DeleteExecutionsWithWorkflows1673268682475 implements MigrationInterface {
name = 'DeleteExecutionsWithWorkflows1673268682475';
public async up(queryRunner: QueryRunner): Promise<void> {
logMigrationStart(this.name);
const tablePrefix = config.getEnv('database.tablePrefix');
const tablePrefix = getTablePrefix();

await queryRunner.query(
`ALTER TABLE ${tablePrefix}execution_entity
Expand Down Expand Up @@ -38,7 +37,7 @@ export class DeleteExecutionsWithWorkflows1673268682475 implements MigrationInte
}

public async down(queryRunner: QueryRunner): Promise<void> {
const tablePrefix = config.getEnv('database.tablePrefix');
const tablePrefix = getTablePrefix();
await queryRunner.query(
`ALTER TABLE ${tablePrefix}execution_entity
DROP CONSTRAINT "FK_${tablePrefix}execution_entity_workflowId"`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import { logMigrationEnd, logMigrationStart } from '@db/utils/migrationHelpers';
import config from '@/config';
import { getTablePrefix, logMigrationEnd, logMigrationStart } from '@db/utils/migrationHelpers';

export class DeleteExecutionsWithWorkflows1673268682475 implements MigrationInterface {
name = 'DeleteExecutionsWithWorkflows1673268682475';
public async up(queryRunner: QueryRunner): Promise<void> {
logMigrationStart(this.name);
const tablePrefix = config.getEnv('database.tablePrefix');
const tablePrefix = getTablePrefix();

const workflowIds: Array<{ id: number }> = await queryRunner.query(`
SELECT id FROM "${tablePrefix}workflow_entity"
Expand Down Expand Up @@ -64,7 +63,7 @@ export class DeleteExecutionsWithWorkflows1673268682475 implements MigrationInte
}

public async down(queryRunner: QueryRunner): Promise<void> {
const tablePrefix = config.getEnv('database.tablePrefix');
const tablePrefix = getTablePrefix();

await queryRunner.query(`DROP TABLE IF EXISTS "${tablePrefix}temporary_execution_entity"`);
await queryRunner.query(
Expand Down
15 changes: 8 additions & 7 deletions packages/cli/test/integration/audit/instance.risk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ test('should not report webhooks having basic or header auth', async () => {
await Promise.all(promises);

const testAudit = await audit(['instance']);
if (Array.isArray(testAudit)) fail('audit is empty');

const report = testAudit?.[toReportTitle('instance')];

const report = testAudit[toReportTitle('instance')];
if (!report) {
fail('Expected test audit to have instance risk report');
}
Expand Down Expand Up @@ -160,9 +160,9 @@ test('should not report webhooks validated by direct children', async () => {
await Promise.all(promises);

const testAudit = await audit(['instance']);
if (Array.isArray(testAudit)) fail('audit is empty');

const report = testAudit?.[toReportTitle('instance')];

const report = testAudit[toReportTitle('instance')];
if (!report) {
fail('Expected test audit to have instance risk report');
}
Expand All @@ -176,8 +176,9 @@ test('should not report non-webhook node', async () => {
await saveManualTriggerWorkflow();

const testAudit = await audit(['instance']);
if (Array.isArray(testAudit)) fail('audit is empty');

const report = testAudit?.[toReportTitle('instance')];
const report = testAudit[toReportTitle('instance')];

if (!report) {
fail('Expected test audit to have instance risk report');
Expand Down Expand Up @@ -210,9 +211,9 @@ test('should report outdated instance when outdated', async () => {

test('should not report outdated instance when up to date', async () => {
const testAudit = await audit(['instance']);
if (Array.isArray(testAudit)) fail('audit is empty');

const report = testAudit?.[toReportTitle('instance')];

const report = testAudit[toReportTitle('instance')];
if (!report) {
fail('Expected test audit to have instance risk report');
}
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/test/integration/audit/nodes.risk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ test('should not report non-risky official nodes', async () => {
await saveManualTriggerWorkflow();

const testAudit = await audit(['nodes']);
if (Array.isArray(testAudit)) return;

const report = testAudit?.[toReportTitle('nodes')];

const report = testAudit[toReportTitle('nodes')];
if (!report) return;

for (const section of report.sections) {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/integration/eventbus.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ test('should send message to sentry ', async () => {

sentryDestination.enable();

const mockedSentryCaptureMessage = jest.spyOn(sentryDestination.sentryClient, 'captureMessage');
const mockedSentryCaptureMessage = jest.spyOn(sentryDestination.sentryClient!, 'captureMessage');
mockedSentryCaptureMessage.mockImplementation((_m, _level, _hint, _scope) => {
eventBus.confirmSent(testMessage, {
id: sentryDestination.id,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "n8n-core",
"version": "0.151.1",
"version": "0.151.2",
"description": "Core functionality of n8n",
"license": "SEE LICENSE IN LICENSE.md",
"homepage": "https://n8n.io",
Expand Down Expand Up @@ -55,7 +55,7 @@
"form-data": "^4.0.0",
"lodash.get": "^4.4.2",
"mime-types": "^2.1.27",
"n8n-workflow": "~0.133.1",
"n8n-workflow": "~0.133.2",
"oauth-1.0a": "^2.2.6",
"p-cancelable": "^2.0.0",
"pretty-bytes": "^5.6.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "n8n-editor-ui",
"version": "0.178.0",
"version": "0.178.1",
"description": "Workflow Editor UI for n8n",
"license": "SEE LICENSE IN LICENSE.md",
"homepage": "https://n8n.io",
Expand Down Expand Up @@ -58,7 +58,7 @@
"luxon": "^2.3.0",
"monaco-editor": "^0.33.0",
"n8n-design-system": "~0.51.1",
"n8n-workflow": "~0.133.1",
"n8n-workflow": "~0.133.2",
"normalize-wheel": "^1.0.1",
"pinia": "^2.0.22",
"prismjs": "^1.17.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,12 @@ export default mixins(
computed: {
...mapStores(useTagsStore, useNodeTypesStore, useSettingsStore, useUIStore, useWorkflowsStore),
hidePreview(): boolean {
const nothingToShow = this.executions.length === 0 && this.filterApplied;
const activeNotPresent =
this.filterApplied &&
(this.executions as IExecutionsSummary[]).find(
(ex) => ex.id === this.activeExecution.id,
) === undefined;
return this.loading || nothingToShow || activeNotPresent;
return this.loading || !this.executions.length || activeNotPresent;
},
filterApplied(): boolean {
return this.filter.status !== '';
Expand Down Expand Up @@ -393,9 +392,7 @@ export default mixins(
return [];
}
try {
const executions: IExecutionsSummary[] =
await this.workflowsStore.loadCurrentWorkflowExecutions(this.filter);
return executions;
return await this.workflowsStore.loadCurrentWorkflowExecutions(this.filter);
} catch (error) {
this.$showError(error, this.$locale.baseText('executionsList.showError.refreshData.title'));
return [];
Expand Down
6 changes: 3 additions & 3 deletions packages/node-dev/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "n8n-node-dev",
"version": "0.90.1",
"version": "0.90.2",
"description": "CLI to simplify n8n credentials/node development",
"license": "SEE LICENSE IN LICENSE.md",
"homepage": "https://n8n.io",
Expand Down Expand Up @@ -59,8 +59,8 @@
"change-case": "^4.1.1",
"fast-glob": "^3.2.5",
"inquirer": "^7.0.1",
"n8n-core": "~0.151.1",
"n8n-workflow": "~0.133.1",
"n8n-core": "~0.151.2",
"n8n-workflow": "~0.133.2",
"oauth-1.0a": "^2.2.6",
"replace-in-file": "^6.0.0",
"request": "^2.88.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/nodes-base/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "n8n-nodes-base",
"version": "0.210.0",
"version": "0.210.1",
"description": "Base nodes of n8n",
"license": "SEE LICENSE IN LICENSE.md",
"homepage": "https://n8n.io",
Expand Down Expand Up @@ -757,7 +757,7 @@
"@types/xml2js": "^0.4.3",
"eslint-plugin-n8n-nodes-base": "^1.12.0",
"gulp": "^4.0.0",
"n8n-workflow": "~0.133.1"
"n8n-workflow": "~0.133.2"
},
"dependencies": {
"@kafkajs/confluent-schema-registry": "1.0.6",
Expand Down Expand Up @@ -796,7 +796,7 @@
"mqtt": "4.2.6",
"mssql": "^8.1.2",
"mysql2": "~2.3.0",
"n8n-core": "~0.151.1",
"n8n-core": "~0.151.2",
"node-html-markdown": "^1.1.3",
"node-ssh": "^12.0.0",
"nodemailer": "^6.7.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/workflow/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "n8n-workflow",
"version": "0.133.1",
"version": "0.133.2",
"description": "Workflow base code of n8n",
"license": "SEE LICENSE IN LICENSE.md",
"homepage": "https://n8n.io",
Expand Down
10 changes: 7 additions & 3 deletions packages/workflow/src/Expression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,15 @@ export class Expression {
}

extendSyntax(bracketedExpression: string): string {
if (!hasExpressionExtension(bracketedExpression) || hasNativeMethod(bracketedExpression))
return bracketedExpression;

const chunks = splitExpression(bracketedExpression);

const codeChunks = chunks
.filter((c) => c.type === 'code')
.map((c) => c.text.replace(/("|').*?("|')/, '').trim());

if (!codeChunks.some(hasExpressionExtension) || hasNativeMethod(bracketedExpression))
return bracketedExpression;

const extendedChunks = chunks.map((chunk): ExpressionChunk => {
if (chunk.type === 'code') {
const output = extendTransform(chunk.text);
Expand Down
12 changes: 9 additions & 3 deletions packages/workflow/src/Extensions/DateExtensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ function isBetween(date: Date | DateTime, extraArgs: unknown[]): boolean {
return secondDate > date && date > firstDate;
}

function isDst(date: Date): boolean {
function isDst(date: Date | DateTime): boolean {
if (isDateTime(date)) {
return date.isInDST;
}
return DateTime.fromJSDate(date).isInDST;
}

Expand All @@ -154,11 +157,14 @@ function isInLast(date: Date | DateTime, extraArgs: unknown[]): boolean {
return dateInThePast <= thisDate && thisDate <= DateTime.now();
}

function isWeekend(date: Date): boolean {
function isWeekend(date: Date | DateTime): boolean {
enum DAYS {
saturday = 6,
sunday = 7,
}
if (isDateTime(date)) {
return [DAYS.saturday, DAYS.sunday].includes(date.weekday);
}
return [DAYS.saturday, DAYS.sunday].includes(DateTime.fromJSDate(date).weekday);
}

Expand Down Expand Up @@ -200,7 +206,7 @@ function toLocaleString(date: Date | DateTime, extraArgs: unknown[]): string {
return DateTime.fromJSDate(date).toLocaleString(dateFormat, { locale });
}

function toTimeFromNow(date: Date): string {
function toTimeFromNow(date: Date | DateTime): string {
let diffObj: Duration;
if (isDateTime(date)) {
diffObj = date.diffNow();
Expand Down
Loading

0 comments on commit 3bd5ea5

Please sign in to comment.