Skip to content

Commit

Permalink
Merge branch 'master' into feature/undo-redo
Browse files Browse the repository at this point in the history
* master:
  📚 Update CHANGELOG.md and main package.json to 0.206.0
  🔖 Release n8n@0.206.0
  ⬆️ Set n8n-core@0.146.0, n8n-editor-ui@0.172.0, n8n-nodes-base@0.204.0 and n8n-workflow@0.128.0 on n8n
  🔖 Release n8n-editor-ui@0.172.0
  ⬆️ Set n8n-design-system@0.46.0 and n8n-workflow@0.128.0 on n8n-editor-ui
  🔖 Release n8n-design-system@0.46.0
  🔖 Release n8n-nodes-base@0.204.0
  ⬆️ Set n8n-core@0.146.0 and n8n-workflow@0.128.0 on n8n-nodes-base
  🔖 Release n8n-node-dev@0.85.0
  ⬆️ Set n8n-core@0.146.0 and n8n-workflow@0.128.0 on n8n-node-dev
  🔖 Release n8n-core@0.146.0
  ⬆️ Set n8n-workflow@0.128.0 on n8n-core
  🔖 Release n8n-workflow@0.128.0
  fix: Make `nodes.exclude` and `nodes.include` work with lazy-loaded nodes (#4833)
  ci: Use multiple jobs for publishing various docker images (#4837)
  feat(editor): Alert design system component (#4834)
  • Loading branch information
MiloradFilipovic committed Dec 7, 2022
2 parents c44951a + b7a18c5 commit 791af5e
Show file tree
Hide file tree
Showing 19 changed files with 477 additions and 91 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ on:
jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
docker-context: ['', '-debian']
platforms: [linux/amd64, linux/arm64, linux/arm/v7]

steps:
- uses: actions/checkout@v3

Expand All @@ -30,23 +36,11 @@ jobs:
- name: Build
uses: docker/build-push-action@v2
with:
context: ./docker/images/n8n
build-args: |
N8N_VERSION=${{steps.vars.outputs.tag}}
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/n8n:${{ steps.vars.outputs.tag }}
${{ secrets.DOCKER_USERNAME }}/n8n:latest
- name: Build (debian)
uses: docker/build-push-action@v2
with:
context: ./docker/images/n8n-debian
context: ./docker/images/n8n${{ matrix.docker-context }}
build-args: |
N8N_VERSION=${{ steps.vars.outputs.tag }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
platforms: ${{ matrix.platforms }}
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/n8n:${{ steps.vars.outputs.tag }}-debian
${{ secrets.DOCKER_USERNAME }}/n8n:latest-debian
${{ secrets.DOCKER_USERNAME }}/n8n:${{ steps.vars.outputs.tag }}${{ matrix.docker-context }}
${{ secrets.DOCKER_USERNAME }}/n8n:latest${{ matrix.docker-context }}
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# [0.206.0](https://github.com/n8n-io/n8n/compare/n8n@0.205.0...n8n@0.206.0) (2022-12-06)


### Bug Fixes

* **Code Node:** Restore `pairedItem` to required n8n item keys ([#4821](https://github.com/n8n-io/n8n/issues/4821)) ([915f144](https://github.com/n8n-io/n8n/commit/915f1445c26d834e3d43602f901a198931a107e1))
* **core:** Fix linter error ([#4808](https://github.com/n8n-io/n8n/issues/4808)) ([3bb3809](https://github.com/n8n-io/n8n/commit/3bb3809eecd1b660c0d05c26164b9ccc90a37008))
* **core:** Fix partial execution with pinned data on child node run ([#4764](https://github.com/n8n-io/n8n/issues/4764)) ([5d75e6c](https://github.com/n8n-io/n8n/commit/5d75e6ceb3bf7d88229b4e71dda3250086aceb05))
* **core:** OAuth2 scopes does not save ([7aefed4](https://github.com/n8n-io/n8n/commit/7aefed46dcdb5d795fe9755c9fc64f445136bc17))
* Enable source-maps on WorkflowRunnerProcess in `own` mode ([#4832](https://github.com/n8n-io/n8n/issues/4832)) ([9485e2f](https://github.com/n8n-io/n8n/commit/9485e2f12a4131ec24f504591290246e24f1cd09))
* **Execute Workflow Node:** Update Execute Workflow node info notice text ([#4809](https://github.com/n8n-io/n8n/issues/4809)) ([9e7a156](https://github.com/n8n-io/n8n/commit/9e7a156532293956e74103c66babd6c967bb062c))
* **Gmail Trigger Node:** Trigger node missing some emails ([67aad63](https://github.com/n8n-io/n8n/commit/67aad6334358dfecd5ba3a6e8f085fca73bd40ad))
* Handle error when workflow does not exist or is inaccessible ([#4831](https://github.com/n8n-io/n8n/issues/4831)) ([b71295e](https://github.com/n8n-io/n8n/commit/b71295e4de658fb134b67eaa0b630704f858ce7e))
* **Local File Trigger Node:** Fix issue that causes a crash if the ignore field is empty ([#4824](https://github.com/n8n-io/n8n/issues/4824)) ([#4825](https://github.com/n8n-io/n8n/issues/4825)) ([c311424](https://github.com/n8n-io/n8n/commit/c3114241fdd399555666d2f5890815b6196ce1bf))
* Make `nodes.exclude` and `nodes.include` work with lazy-loaded nodes ([#4833](https://github.com/n8n-io/n8n/issues/4833)) ([85241fd](https://github.com/n8n-io/n8n/commit/85241fd230675691828c8d711f86aabb7e48dabe))


### Features

* Add message for readonly nodes. Improve foreign credentials handling ([#4759](https://github.com/n8n-io/n8n/issues/4759)) ([eb112ff](https://github.com/n8n-io/n8n/commit/eb112ffd23cec04f290d515917c227b628db2834))
* Add prompt to overwrite changes when concurrent editing occurs ([#4817](https://github.com/n8n-io/n8n/issues/4817)) ([af6ac42](https://github.com/n8n-io/n8n/commit/af6ac42aa3ec6805a2a18b920128beafcb9a3cdc))
* **core:** Workflow Execution Statistics ([#4200](https://github.com/n8n-io/n8n/issues/4200)) ([1722c6b](https://github.com/n8n-io/n8n/commit/1722c6b0c5dde87d3389c328b611cbb611b2853e))
* **editor:** Alert design system component ([#4834](https://github.com/n8n-io/n8n/issues/4834)) ([9dbb3ea](https://github.com/n8n-io/n8n/commit/9dbb3ea182cba890781a89fe28eda2c7b50dbc65))
* **editor:** Schema view ([#4615](https://github.com/n8n-io/n8n/issues/4615)) ([4528f34](https://github.com/n8n-io/n8n/commit/4528f34462396b5faf550c5a58c4dd9163bdbc40))
* Fix checkbox line height and make checkbox label clickable ([#4818](https://github.com/n8n-io/n8n/issues/4818)) ([1b7952a](https://github.com/n8n-io/n8n/commit/1b7952a516a5c5dfe1f79e25f811fc044a5e4962))
* **KoBoToolbox Node:** Add support for Media file API ([#4578](https://github.com/n8n-io/n8n/issues/4578)) ([37e580e](https://github.com/n8n-io/n8n/commit/37e580eb0628a651ecbc8faa3ad447cd0177d7cf))



# [0.205.0](https://github.com/n8n-io/n8n/compare/n8n@0.204.0...n8n@0.205.0) (2022-12-02)


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.205.0",
"version": "0.206.0",
"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.205.0",
"version": "0.206.0",
"description": "n8n Workflow Automation Tool",
"license": "SEE LICENSE IN LICENSE.md",
"homepage": "https://n8n.io",
Expand Down Expand Up @@ -150,10 +150,10 @@
"lodash.split": "^4.4.2",
"lodash.unset": "^4.5.2",
"mysql2": "~2.3.0",
"n8n-core": "~0.145.0",
"n8n-editor-ui": "~0.171.0",
"n8n-nodes-base": "~0.203.0",
"n8n-workflow": "~0.127.0",
"n8n-core": "~0.146.0",
"n8n-editor-ui": "~0.172.0",
"n8n-nodes-base": "~0.204.0",
"n8n-workflow": "~0.128.0",
"nodemailer": "^6.7.1",
"oauth-1.0a": "^2.2.6",
"open": "^7.0.0",
Expand Down
71 changes: 31 additions & 40 deletions packages/cli/src/config/schema.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,32 @@
/* eslint-disable no-restricted-syntax */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */

import path from 'path';
import * as core from 'n8n-core';
import convict from 'convict';
import { UserSettings } from 'n8n-core';
import { jsonParse } from 'n8n-workflow';

convict.addFormat({
name: 'nodes-list',
// @ts-ignore
validate(values: string[], { env }: { env: string }): void {
try {
if (!Array.isArray(values)) {
throw new Error();
}

for (const value of values) {
if (typeof value !== 'string') {
throw new Error();
}
}
} catch (error) {
throw new TypeError(`${env} is not a valid Array of strings.`);
}
},
coerce(rawValue: string): string[] {
return jsonParse(rawValue, { errorMessage: 'nodes-list needs to be valid JSON' });
},
});

export const schema = {
database: {
Expand Down Expand Up @@ -716,47 +740,14 @@ export const schema = {
nodes: {
include: {
doc: 'Nodes to load',
format: function check(rawValue: string): void {
if (rawValue === '') {
return;
}
try {
const values = JSON.parse(rawValue);
if (!Array.isArray(values)) {
throw new Error();
}

for (const value of values) {
if (typeof value !== 'string') {
throw new Error();
}
}
} catch (error) {
throw new TypeError(`The Nodes to include is not a valid Array of strings.`);
}
},
format: 'nodes-list',
default: undefined,
env: 'NODES_INCLUDE',
},
exclude: {
doc: 'Nodes not to load',
format: function check(rawValue: string): void {
try {
const values = JSON.parse(rawValue);
if (!Array.isArray(values)) {
throw new Error();
}

for (const value of values) {
if (typeof value !== 'string') {
throw new Error();
}
}
} catch (error) {
throw new TypeError(`The Nodes to exclude is not a valid Array of strings.`);
}
},
default: '[]',
format: 'nodes-list',
default: undefined,
env: 'NODES_EXCLUDE',
},
errorTriggerType: {
Expand Down Expand Up @@ -804,7 +795,7 @@ export const schema = {
location: {
doc: 'Log file location; only used if log output is set to file.',
format: String,
default: path.join(core.UserSettings.getUserN8nFolderPath(), 'logs/n8n.log'),
default: path.join(UserSettings.getUserN8nFolderPath(), 'logs/n8n.log'),
env: 'N8N_LOG_FILE_LOCATION',
},
},
Expand Down Expand Up @@ -861,7 +852,7 @@ export const schema = {
},
localStoragePath: {
format: String,
default: path.join(core.UserSettings.getUserN8nFolderPath(), 'binaryData'),
default: path.join(UserSettings.getUserN8nFolderPath(), 'binaryData'),
env: 'N8N_BINARY_DATA_STORAGE_PATH',
doc: 'Path for binary data storage in "filesystem" mode',
},
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/src/config/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ type ToReturnType<T extends ConfigOptionPath> = T extends NumericPath
type ExceptionPaths = {
'queue.bull.redis': object;
binaryDataManager: IBinaryDataConfig;
'nodes.include': undefined;
'nodes.exclude': string[] | undefined;
'nodes.include': string[] | undefined;
'userManagement.isInstanceOwnerSetUp': boolean;
'userManagement.skipInstanceOwnerSetup': boolean;
};
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.145.0",
"version": "0.146.0",
"description": "Core functionality of n8n",
"license": "SEE LICENSE IN LICENSE.md",
"homepage": "https://n8n.io",
Expand Down Expand Up @@ -53,7 +53,7 @@
"form-data": "^4.0.0",
"lodash.get": "^4.4.2",
"mime-types": "^2.1.27",
"n8n-workflow": "~0.127.0",
"n8n-workflow": "~0.128.0",
"oauth-1.0a": "^2.2.6",
"p-cancelable": "^2.0.0",
"pretty-bytes": "^5.6.0",
Expand Down
30 changes: 26 additions & 4 deletions packages/core/src/DirectoryLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export abstract class DirectoryLoader {

constructor(
protected readonly directory: string,
private readonly excludeNodes?: string,
private readonly includeNodes?: string,
protected readonly excludeNodes: string[] = [],
protected readonly includeNodes: string[] = [],
) {}

abstract loadAll(): Promise<void>;
Expand All @@ -69,11 +69,11 @@ export abstract class DirectoryLoader {

const fullNodeName = `${packageName}.${tempNode.description.name}`;

if (this.includeNodes !== undefined && !this.includeNodes.includes(fullNodeName)) {
if (this.includeNodes.length && !this.includeNodes.includes(fullNodeName)) {
return;
}

if (this.excludeNodes?.includes(fullNodeName)) {
if (this.excludeNodes.includes(fullNodeName)) {
return;
}

Expand Down Expand Up @@ -338,6 +338,28 @@ export class LazyPackageDirectoryLoader extends PackageDirectoryLoader {
this.types.nodes = await this.readJSON('dist/types/nodes.json');
this.types.credentials = await this.readJSON('dist/types/credentials.json');

if (this.includeNodes.length) {
const allowedNodes: typeof this.known.nodes = {};
for (const nodeName of this.includeNodes) {
allowedNodes[nodeName] = this.known.nodes[nodeName];
}
this.known.nodes = allowedNodes;

this.types.nodes = this.types.nodes.filter((nodeType) =>
this.includeNodes.includes(nodeType.name),
);
}

if (this.excludeNodes.length) {
for (const nodeName of this.excludeNodes) {
delete this.known.nodes[nodeName];
}

this.types.nodes = this.types.nodes.filter(
(nodeType) => !this.excludeNodes.includes(nodeType.name),
);
}

Logger.debug(`Lazy Loading credentials and nodes from ${this.packageJson.name}`, {
credentials: this.types.credentials?.length ?? 0,
nodes: this.types.nodes?.length ?? 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/design-system/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "n8n-design-system",
"version": "0.45.0",
"version": "0.46.0",
"license": "SEE LICENSE IN LICENSE.md",
"homepage": "https://n8n.io",
"author": {
Expand Down
65 changes: 65 additions & 0 deletions packages/design-system/src/components/N8nAlert/Alert.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import type { StoryFn } from '@storybook/vue';
import N8nAlert from './Alert.vue';
import N8nIcon from '../N8nIcon';

export default {
title: 'Atoms/Alert',
component: N8nAlert,
argTypes: {
type: {
type: 'select',
options: ['success', 'info', 'warning', 'error'],
},
effect: {
type: 'select',
options: ['light', 'dark'],
},
},
};

const Template: StoryFn = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: {
N8nAlert,
},
template:
'<div style="position: relative; width: 100%; height: 300px;"><n8n-alert v-bind="$props"><template #aside>custom content slot</template></n8n-alert></div>',
});

export const ContentAsProps = Template.bind({});
ContentAsProps.args = {
type: 'info',
effect: 'light',
title: 'Alert title',
description: 'Alert description',
center: false,
showIcon: true,
background: true,
};

const TemplateForSlots: StoryFn = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: {
N8nAlert,
N8nIcon,
},
template: `<div style="position: relative; width: 100%; height: 300px;">
<n8n-alert v-bind="$props">
<template #title>Title</template>
<template>Description</template>
<template #aside><button>Button</button></template>
<template #icon>
<n8n-icon icon="grin-stars" size="xlarge" />
</template>
</n8n-alert>
</div>`,
});

export const ContentInSlots = TemplateForSlots.bind({});
ContentInSlots.args = {
type: 'info',
effect: 'light',
center: false,
background: true,
showIcon: false,
};
Loading

0 comments on commit 791af5e

Please sign in to comment.