From 3c48b06884411ec4ae1d0d4421562d28db85e204 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 8 Apr 2021 23:34:10 +0200 Subject: [PATCH 001/231] :bug: Fix issue that RabbitMQ Trigger node did reuse same item --- .../nodes-base/nodes/RabbitMQ/RabbitMQTrigger.node.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/nodes-base/nodes/RabbitMQ/RabbitMQTrigger.node.ts b/packages/nodes-base/nodes/RabbitMQ/RabbitMQTrigger.node.ts index 446bd82352..f39cacf080 100644 --- a/packages/nodes-base/nodes/RabbitMQ/RabbitMQTrigger.node.ts +++ b/packages/nodes-base/nodes/RabbitMQ/RabbitMQTrigger.node.ts @@ -107,15 +107,15 @@ export class RabbitMQTrigger implements INodeType { const self = this; - const item: INodeExecutionData = { - json: {}, - }; - const startConsumer = async () => { await channel.consume(queue, async (message: IDataObject) => { if (message !== null) { let content: IDataObject | string = message!.content!.toString(); + const item: INodeExecutionData = { + json: {}, + }; + if (options.contentIsBinary === true) { item.binary = { data: await this.helpers.prepareBinaryData(message.content), From 2273a4cff2c65bc13754c822ba9206b8601aa1fc Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Fri, 9 Apr 2021 12:13:42 +0200 Subject: [PATCH 002/231] :zap: Make max payload size configurable #1447 --- packages/cli/config/index.ts | 6 ++++++ packages/cli/src/Server.ts | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/cli/config/index.ts b/packages/cli/config/index.ts index 0b136b52e4..9b2c6ea614 100644 --- a/packages/cli/config/index.ts +++ b/packages/cli/config/index.ts @@ -446,6 +446,12 @@ const config = convict({ }, endpoints: { + payloadSizeMax: { + format: Number, + default: 16, + env: 'N8N_PAYLOAD_SIZE_MAX', + doc: 'Maximum payload size in MB.', + }, metrics: { enable: { format: 'Boolean', diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index 39fb76cc18..51e015d29c 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -132,6 +132,7 @@ class App { protocol: string; sslKey: string; sslCert: string; + payloadSizeMax: number; presetCredentialsLoaded: boolean; @@ -145,6 +146,7 @@ class App { this.saveManualExecutions = config.get('executions.saveDataManualExecutions') as boolean; this.executionTimeout = config.get('executions.timeout') as number; this.maxExecutionTimeout = config.get('executions.maxTimeout') as number; + this.payloadSizeMax = config.get('endpoints.payloadSizeMax') as number; this.timezone = config.get('generic.timezone') as string; this.restEndpoint = config.get('endpoints.rest') as string; @@ -369,7 +371,7 @@ class App { // Support application/json type post data this.app.use(bodyParser.json({ - limit: '16mb', verify: (req, res, buf) => { + limit: this.payloadSizeMax + 'mb', verify: (req, res, buf) => { // @ts-ignore req.rawBody = buf; }, @@ -378,7 +380,7 @@ class App { // Support application/xml type post data // @ts-ignore this.app.use(bodyParser.xml({ - limit: '16mb', xmlParseOptions: { + limit: this.payloadSizeMax + 'mb', xmlParseOptions: { normalize: true, // Trim whitespace inside text nodes normalizeTags: true, // Transform tags to lowercase explicitArray: false, // Only put properties in array if length > 1 @@ -386,7 +388,7 @@ class App { })); this.app.use(bodyParser.text({ - limit: '16mb', verify: (req, res, buf) => { + limit: this.payloadSizeMax + 'mb', verify: (req, res, buf) => { // @ts-ignore req.rawBody = buf; }, From 75dd058ce216c5cd990057ffe71b923e5bfe72e0 Mon Sep 17 00:00:00 2001 From: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> Date: Fri, 9 Apr 2021 23:44:53 +0300 Subject: [PATCH 003/231] :sparkles: Add support to dynamically add menu items * add menu items POC * remove sidebar hook * use getters * update menu to add items * add home icon for CLD-202 * center icon * address comments * :zap: Minor improvements Co-authored-by: Jan Oberhauser --- packages/editor-ui/src/Interface.ts | 17 +++++++ .../editor-ui/src/components/MainSidebar.vue | 44 +++++++++++++++++++ packages/editor-ui/src/main.ts | 2 + packages/editor-ui/src/store.ts | 16 +++++-- 4 files changed, 76 insertions(+), 3 deletions(-) diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index 972ef0cbd8..745e0f11fb 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -428,3 +428,20 @@ export interface ITimeoutHMS { } export type WorkflowTitleStatus = 'EXECUTING' | 'IDLE' | 'ERROR'; + +export type MenuItemType = 'link'; +export type MenuItemPosition = 'top' | 'bottom'; + +export interface IMenuItem { + id: string; + type: MenuItemType; + position: MenuItemPosition; + properties: ILinkMenuItemProperties; +} + +export interface ILinkMenuItemProperties { + title: string; + icon: string; + href: string; + newWindow?: boolean; +} \ No newline at end of file diff --git a/packages/editor-ui/src/components/MainSidebar.vue b/packages/editor-ui/src/components/MainSidebar.vue index 2b6ae3e054..6de1de6c98 100644 --- a/packages/editor-ui/src/components/MainSidebar.vue +++ b/packages/editor-ui/src/components/MainSidebar.vue @@ -21,6 +21,22 @@ + + + + {{ item.properties.title }} + + +