From 6f348e240e3c539acbd17acf1967604722228540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 28 Jun 2022 15:25:17 +0200 Subject: [PATCH 01/15] :zap: Make paths OS-agnostic --- gulpfile.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 5cab748..831c707 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,11 +1,16 @@ +const path = require('path'); const { task, src, dest } = require('gulp'); task('build:icons', copyIcons); function copyIcons() { - src('nodes/**/*.{png,svg}').pipe(dest('dist/nodes')); + const nodeSource = path.resolve('nodes', '**', '*.{png,svg}'); + const nodeDestination = path.resolve('dist', 'nodes'); - return src('credentials/**/*.{png,svg}').pipe(dest('dist/credentials')); + src(nodeSource).pipe(dest(nodeDestination)); + + const credSource = path.resolve('credentials', '**', '*.{png,svg}'); + const credDestination = path.resolve('dist', 'credentials'); + + return src(credSource).pipe(dest(credDestination)); } - -// TODO: Add i18n to pipeline From 82b2552d10beee972cef8fd457dc3a403aba9307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 28 Jun 2022 15:27:25 +0200 Subject: [PATCH 02/15] :zap: General improvements Improve explanatory comments, correct typings, make param names consistent, and simplify execute block. --- credentials/ExampleCredentials.credentials.ts | 18 ++++++------- nodes/ExampleNode/ExampleNode.node.ts | 19 +++++-------- nodes/HttpBin/HttpBin.node.ts | 14 +++++----- ...Descriptions.ts => HttpVerbDescription.ts} | 27 ++++++++++--------- 4 files changed, 36 insertions(+), 42 deletions(-) rename nodes/HttpBin/{HttpVerbDescriptions.ts => HttpVerbDescription.ts} (86%) diff --git a/credentials/ExampleCredentials.credentials.ts b/credentials/ExampleCredentials.credentials.ts index 2484f47..038f97e 100644 --- a/credentials/ExampleCredentials.credentials.ts +++ b/credentials/ExampleCredentials.credentials.ts @@ -1,22 +1,22 @@ -import { ICredentialType, NodePropertyTypes } from 'n8n-workflow'; +import { ICredentialType, INodeProperties } from 'n8n-workflow'; export class ExampleCredentials implements ICredentialType { name = 'exampleCredentials'; displayName = 'Example Credentials'; - properties = [ - // The credentials to get from user and save encrypted. - // Properties can be defined exactly in the same way - // as node properties. + properties: INodeProperties[] = [ + // Credential data to request from the user, saved in encrypted format. + // Credential properties are defined exactly like node properties. { - displayName: 'User', - name: 'user', - type: 'string' as NodePropertyTypes, + displayName: 'Base URL', + name: 'url', + type: 'string', default: '', + placeholder: 'https://example.com', }, { displayName: 'Access Token', name: 'accessToken', - type: 'string' as NodePropertyTypes, + type: 'string', default: '', }, ]; diff --git a/nodes/ExampleNode/ExampleNode.node.ts b/nodes/ExampleNode/ExampleNode.node.ts index 3bbadf4..770d495 100644 --- a/nodes/ExampleNode/ExampleNode.node.ts +++ b/nodes/ExampleNode/ExampleNode.node.ts @@ -10,20 +10,18 @@ export class ExampleNode implements INodeType { description: 'Basic Example Node', defaults: { name: 'Example Node', - color: '#772244', }, inputs: ['main'], outputs: ['main'], properties: [ - // Node properties which the user gets displayed and - // can change on the node. + // Node properties that the user can see and change on the node. { displayName: 'My String', name: 'myString', type: 'string', default: '', placeholder: 'Placeholder value', - description: 'The description text', + description: 'This is a description', }, ], }; @@ -31,15 +29,12 @@ export class ExampleNode implements INodeType { async execute(this: IExecuteFunctions): Promise { const items = this.getInputData(); - let item: INodeExecutionData; - let myString: string; - - // Iterates over all input items and add the key "myString" with the - // value the parameter "myString" resolves to. - // (This could be a different value for each item in case it contains an expression) + // The node iterates over all input items and adds the key "myString" with the + // value the parameter "myString" resolves to. (This could be a different value + // for each item in case it contains an expression.) for (let itemIndex = 0; itemIndex < items.length; itemIndex++) { - myString = this.getNodeParameter('myString', itemIndex, '') as string; - item = items[itemIndex]; + const myString = this.getNodeParameter('myString', itemIndex, '') as string; + const item = items[itemIndex]; item.json['myString'] = myString; } diff --git a/nodes/HttpBin/HttpBin.node.ts b/nodes/HttpBin/HttpBin.node.ts index 00eaee7..7fad43d 100644 --- a/nodes/HttpBin/HttpBin.node.ts +++ b/nodes/HttpBin/HttpBin.node.ts @@ -1,11 +1,10 @@ -/* eslint-disable n8n-nodes-base/filesystem-wrong-node-filename */ import { INodeType, INodeTypeDescription } from 'n8n-workflow'; -import { httpVerbFields, httpVerbOperations } from './HttpVerbDescriptions'; +import { httpVerbFields, httpVerbOperations } from './HttpVerbDescription'; export class HttpBin implements INodeType { description: INodeTypeDescription = { displayName: 'HttpBin', - name: 'httpbin', + name: 'httpBin', icon: 'file:httpbin.svg', group: ['transform'], version: 1, @@ -36,11 +35,10 @@ export class HttpBin implements INodeType { * * [Resource & Operation] * - * * https://docs.n8n.io/integrations/creating-nodes/code/create-first-node/#resources-and-operations * - * In our example, the operations are separated into their own file (HTTPVerbDescription) - * to keep this class easy to read + * In our example, the operations are separated into their own file (HTTPVerbDescription.ts) + * to keep this class easy to read. * */ properties: [ @@ -52,10 +50,10 @@ export class HttpBin implements INodeType { options: [ { name: 'HTTP Verb', - value: 'httpverbs', + value: 'httpVerb', }, ], - default: 'httpverbs', + default: 'httpVerb', }, ...httpVerbOperations, diff --git a/nodes/HttpBin/HttpVerbDescriptions.ts b/nodes/HttpBin/HttpVerbDescription.ts similarity index 86% rename from nodes/HttpBin/HttpVerbDescriptions.ts rename to nodes/HttpBin/HttpVerbDescription.ts index 80efc5b..95bc8a1 100644 --- a/nodes/HttpBin/HttpVerbDescriptions.ts +++ b/nodes/HttpBin/HttpVerbDescription.ts @@ -1,15 +1,16 @@ import { INodeProperties } from 'n8n-workflow'; -// This maps the operations to when the Resource option HTTP Verbs is selected +// When the resource `httpVerb` is selected, this `operation` parameter will be shown. export const httpVerbOperations: INodeProperties[] = [ { displayName: 'Operation', name: 'operation', type: 'options', noDataExpression: true, + displayOptions: { show: { - resource: ['httpverbs'], + resource: ['httpVerb'], }, }, options: [ @@ -38,8 +39,8 @@ export const httpVerbOperations: INodeProperties[] = [ }, ]; -// Here we define what to show when the GET Operation is selected -// We do that by adding operation: ["get"], to "displayOptions.show" +// Here we define what to show when the `get` operation is selected. +// We do that by adding `operation: ["get"]` to `displayOptions.show` const getOperation: INodeProperties[] = [ { name: 'typeofData', @@ -48,7 +49,7 @@ const getOperation: INodeProperties[] = [ displayName: 'Type of Data', displayOptions: { show: { - resource: ['httpverbs'], + resource: ['httpVerb'], operation: ['get'], }, }, @@ -68,7 +69,7 @@ const getOperation: INodeProperties[] = [ displayName: 'Query Parameters', displayOptions: { show: { - resource: ['httpverbs'], + resource: ['httpVerb'], operation: ['get'], }, }, @@ -109,8 +110,8 @@ const getOperation: INodeProperties[] = [ }, ]; -// Here we define what to show when the DELETE Operation is selected -// We do that by adding operation: ["delete"], to "displayOptions.show" +// Here we define what to show when the DELETE Operation is selected. +// We do that by adding `operation: ["delete"]` to `displayOptions.show` const deleteOperation: INodeProperties[] = [ { name: 'typeofData', @@ -119,7 +120,7 @@ const deleteOperation: INodeProperties[] = [ displayName: 'Type of Data', displayOptions: { show: { - resource: ['httpverbs'], + resource: ['httpVerb'], operation: ['delete'], }, }, @@ -143,7 +144,7 @@ const deleteOperation: INodeProperties[] = [ displayName: 'Query Parameters', displayOptions: { show: { - resource: ['httpverbs'], + resource: ['httpVerb'], operation: ['delete'], typeofData: ['queryParameter'], }, @@ -190,7 +191,7 @@ const deleteOperation: INodeProperties[] = [ displayName: 'JSON Object', displayOptions: { show: { - resource: ['httpverbs'], + resource: ['httpVerb'], operation: ['delete'], typeofData: ['jsonData'], }, @@ -234,12 +235,12 @@ const deleteOperation: INodeProperties[] = [ export const httpVerbFields: INodeProperties[] = [ /* -------------------------------------------------------------------------- */ - /* Http Verbs:Get */ + /* httpVerb:get */ /* -------------------------------------------------------------------------- */ ...getOperation, /* -------------------------------------------------------------------------- */ - /* Http Verbs:Delete */ + /* httpVerb:delete */ /* -------------------------------------------------------------------------- */ ...deleteOperation, ]; From 8254a885d5f9204637294a9ba875b1d2c340420c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 28 Jun 2022 15:38:34 +0200 Subject: [PATCH 03/15] :zap: Add `prepare` script --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 72720bc..786448b 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "dev": "tsc --watch", "format": "prettier nodes credentials --write", "lint": "tslint -p tsconfig.json -c tslint.json; eslint nodes credentials package.json", - "lintfix": "tslint --fix -p tsconfig.json -c tslint.json; eslint nodes credentials package.json --fix" + "lintfix": "tslint --fix -p tsconfig.json -c tslint.json; eslint nodes credentials package.json --fix", + "prepare": "npm run build && npm run lint" }, "files": [ "dist" From e9942e17d1d9618d3fdce553bdd4964430b5f9bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 28 Jun 2022 15:39:11 +0200 Subject: [PATCH 04/15] :shirt: Remove `quotemark` conflicting with Prettier --- tslint.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tslint.json b/tslint.json index d8dc7ad..f03bbfe 100644 --- a/tslint.json +++ b/tslint.json @@ -111,10 +111,6 @@ "allow-null-check" ], "use-isnan": true, - "quotemark": [ - true, - "single" - ], "quotes": [ "error", "single" From 68b3bf2d8b4ef2375bf5199bc96ade34f8b60f65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 28 Jun 2022 15:40:48 +0200 Subject: [PATCH 05/15] :fire: Remove contributor license agreement --- CONTRIBUTOR_LICENSE_AGREEMENT.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 CONTRIBUTOR_LICENSE_AGREEMENT.md diff --git a/CONTRIBUTOR_LICENSE_AGREEMENT.md b/CONTRIBUTOR_LICENSE_AGREEMENT.md deleted file mode 100644 index 104e263..0000000 --- a/CONTRIBUTOR_LICENSE_AGREEMENT.md +++ /dev/null @@ -1,5 +0,0 @@ -# n8n Contributor License Agreement - -I give n8n permission to license my contributions on any terms they like. I am giving them this license in order to make it possible for them to accept my contributions into their project. - -***As far as the law allows, my contributions come as is, without any warranty or condition, and I will not be liable to anyone for any damages related to this software or this license, under any kind of legal claim.*** From 4319962141a107bbb00efc1af14a0a8e025a82d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 28 Jun 2022 15:41:05 +0200 Subject: [PATCH 06/15] :page_facing_up: Adjust MIT license --- LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index fa28b97..cb69586 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright 2022 n8n GmbH +Copyright Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in From dc1db201b6cdadcf5a36f772fc575388e9726cd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 28 Jun 2022 16:50:33 +0200 Subject: [PATCH 07/15] :zap: Set up `action` for operation options --- .eslintrc.js | 2 ++ nodes/HttpBin/HttpVerbDescription.ts | 2 ++ package.json | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index fec36fa..762a3ff 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -115,6 +115,8 @@ module.exports = { 'n8n-nodes-base/node-param-display-name-wrong-for-update-fields': 'error', 'n8n-nodes-base/node-param-min-value-wrong-for-limit': 'error', 'n8n-nodes-base/node-param-multi-options-type-unsorted-items': 'error', + // 'n8n-nodes-base/node-param-operation-option-action-miscased': 'error', // TODO: Uncomment once #3610 merged to master + // 'n8n-nodes-base/node-param-operation-option-without-action': 'error', // TODO: Uncomment once #3610 merged to master 'n8n-nodes-base/node-param-operation-without-no-data-expression': 'error', 'n8n-nodes-base/node-param-option-description-identical-to-name': 'error', 'n8n-nodes-base/node-param-option-name-containing-star': 'error', diff --git a/nodes/HttpBin/HttpVerbDescription.ts b/nodes/HttpBin/HttpVerbDescription.ts index 95bc8a1..727c7f7 100644 --- a/nodes/HttpBin/HttpVerbDescription.ts +++ b/nodes/HttpBin/HttpVerbDescription.ts @@ -17,6 +17,7 @@ export const httpVerbOperations: INodeProperties[] = [ { name: 'GET', value: 'get', + // action: 'Perform a GET request', // TODO: Uncomment once #3610 merged to master routing: { request: { method: 'GET', @@ -27,6 +28,7 @@ export const httpVerbOperations: INodeProperties[] = [ { name: 'DELETE', value: 'delete', + // action: 'Perform a DELETE request', // TODO: Uncomment once #3610 merged to master routing: { request: { method: 'DELETE', diff --git a/package.json b/package.json index 786448b..5e2e750 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "@types/express": "^4.17.6", "@types/request-promise-native": "~1.0.15", "@typescript-eslint/parser": "^5.29.0", - "eslint-plugin-n8n-nodes-base": "~1.1.1", + "eslint-plugin-n8n-nodes-base": "^1.2.0", "gulp": "^4.0.2", "n8n-core": "~0.122.1", "n8n-workflow": "~0.104.0", From e9538b13d00f6868a6a982dac6f20fea63aae7bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 28 Jun 2022 16:51:05 +0200 Subject: [PATCH 08/15] :arrow_up: Upgrade `n8n-core` and `n8n-workflow` --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5e2e750..45ee704 100644 --- a/package.json +++ b/package.json @@ -43,8 +43,8 @@ "@typescript-eslint/parser": "^5.29.0", "eslint-plugin-n8n-nodes-base": "^1.2.0", "gulp": "^4.0.2", - "n8n-core": "~0.122.1", - "n8n-workflow": "~0.104.0", + "n8n-core": "~0.123.0", + "n8n-workflow": "~0.105.0", "prettier": "^2.7.1", "tslint": "^6.1.2", "typescript": "~4.6.0" From eb80b1edb3aae522e7ac85c0a277f415ccf79d09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Thu, 30 Jun 2022 17:11:44 +0200 Subject: [PATCH 09/15] :shirt: Adjust rules per renamings --- .eslintrc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 762a3ff..e737932 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -52,14 +52,14 @@ module.exports = { files: ['./credentials/**/*.ts'], plugins: ['eslint-plugin-n8n-nodes-base'], rules: { - 'n8n-nodes-base/filesystem-wrong-cred-filename': 'error', + 'n8n-nodes-base/cred-filename-against-convention': 'error', }, }, { files: ['./nodes/**/*.ts'], plugins: ['eslint-plugin-n8n-nodes-base'], rules: { - 'n8n-nodes-base/filesystem-wrong-node-filename': 'error', + 'n8n-nodes-base/node-filename-against-convention': 'error', 'n8n-nodes-base/node-class-description-empty-string': 'error', 'n8n-nodes-base/node-class-description-icon-not-svg': 'error', 'n8n-nodes-base/node-class-description-inputs-wrong-trigger-node': 'error', From 4e292c7f53e29579129985cf68c60749b2e8a7d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Thu, 30 Jun 2022 17:12:17 +0200 Subject: [PATCH 10/15] :fire: Remove changes related to `action` --- .eslintrc.js | 2 -- nodes/HttpBin/HttpVerbDescription.ts | 2 -- 2 files changed, 4 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index e737932..6c45200 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -115,8 +115,6 @@ module.exports = { 'n8n-nodes-base/node-param-display-name-wrong-for-update-fields': 'error', 'n8n-nodes-base/node-param-min-value-wrong-for-limit': 'error', 'n8n-nodes-base/node-param-multi-options-type-unsorted-items': 'error', - // 'n8n-nodes-base/node-param-operation-option-action-miscased': 'error', // TODO: Uncomment once #3610 merged to master - // 'n8n-nodes-base/node-param-operation-option-without-action': 'error', // TODO: Uncomment once #3610 merged to master 'n8n-nodes-base/node-param-operation-without-no-data-expression': 'error', 'n8n-nodes-base/node-param-option-description-identical-to-name': 'error', 'n8n-nodes-base/node-param-option-name-containing-star': 'error', diff --git a/nodes/HttpBin/HttpVerbDescription.ts b/nodes/HttpBin/HttpVerbDescription.ts index 727c7f7..95bc8a1 100644 --- a/nodes/HttpBin/HttpVerbDescription.ts +++ b/nodes/HttpBin/HttpVerbDescription.ts @@ -17,7 +17,6 @@ export const httpVerbOperations: INodeProperties[] = [ { name: 'GET', value: 'get', - // action: 'Perform a GET request', // TODO: Uncomment once #3610 merged to master routing: { request: { method: 'GET', @@ -28,7 +27,6 @@ export const httpVerbOperations: INodeProperties[] = [ { name: 'DELETE', value: 'delete', - // action: 'Perform a DELETE request', // TODO: Uncomment once #3610 merged to master routing: { request: { method: 'DELETE', From 03db036295bc698f8a321921977d2906334a1e25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 4 Jul 2022 13:14:28 +0200 Subject: [PATCH 11/15] :shirt: Adjust lintings --- .eslintrc.js | 100 +++++---------------------------------------------- 1 file changed, 9 insertions(+), 91 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 6c45200..08d3c24 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -28,108 +28,26 @@ module.exports = { { files: ['package.json'], plugins: ['eslint-plugin-n8n-nodes-base'], - rules: { - 'n8n-nodes-base/community-package-json-author-email-still-default': 'error', - 'n8n-nodes-base/community-package-json-author-missing': 'error', - 'n8n-nodes-base/community-package-json-author-name-missing': 'error', - 'n8n-nodes-base/community-package-json-author-name-still-default': 'error', - 'n8n-nodes-base/community-package-json-description-missing': 'error', - 'n8n-nodes-base/community-package-json-description-still-default': 'error', - 'n8n-nodes-base/community-package-json-keywords-missing': 'error', - 'n8n-nodes-base/community-package-json-keywords-without-official-tag': 'error', - 'n8n-nodes-base/community-package-json-license-missing': 'error', - 'n8n-nodes-base/community-package-json-license-not-default': 'error', - 'n8n-nodes-base/community-package-json-n8n-missing': 'error', - 'n8n-nodes-base/community-package-json-n8n-nodes-empty': 'error', - 'n8n-nodes-base/community-package-json-n8n-nodes-missing': 'error', - 'n8n-nodes-base/community-package-json-name-missing': 'error', - 'n8n-nodes-base/community-package-json-name-still-default': 'error', - 'n8n-nodes-base/community-package-json-repository-url-still-default': 'error', - 'n8n-nodes-base/community-package-json-version-missing': 'error', - }, + extends: ['plugin:n8n-nodes-base/community'], }, { files: ['./credentials/**/*.ts'], plugins: ['eslint-plugin-n8n-nodes-base'], + extends: ['plugin:n8n-nodes-base/credentials'], rules: { - 'n8n-nodes-base/cred-filename-against-convention': 'error', + 'n8n-nodes-base/cred-class-field-documentation-url-missing': 'off', }, }, { files: ['./nodes/**/*.ts'], plugins: ['eslint-plugin-n8n-nodes-base'], + extends: ['plugin:n8n-nodes-base/nodes'], rules: { - 'n8n-nodes-base/node-filename-against-convention': 'error', - 'n8n-nodes-base/node-class-description-empty-string': 'error', - 'n8n-nodes-base/node-class-description-icon-not-svg': 'error', - 'n8n-nodes-base/node-class-description-inputs-wrong-trigger-node': 'error', - 'n8n-nodes-base/node-class-description-missing-subtitle': 'error', - 'n8n-nodes-base/node-class-description-outputs-wrong': 'error', - 'n8n-nodes-base/node-execute-block-double-assertion-for-items': 'error', - 'n8n-nodes-base/node-param-collection-type-unsorted-items': 'error', - 'n8n-nodes-base/node-param-default-missing': 'error', - 'n8n-nodes-base/node-param-default-wrong-for-boolean': 'error', - 'n8n-nodes-base/node-param-default-wrong-for-collection': 'error', - 'n8n-nodes-base/node-param-default-wrong-for-fixed-collection': 'error', - 'n8n-nodes-base/node-param-default-wrong-for-fixed-collection': 'error', - 'n8n-nodes-base/node-param-default-wrong-for-multi-options': 'error', - 'n8n-nodes-base/node-param-default-wrong-for-number': 'error', - 'n8n-nodes-base/node-param-default-wrong-for-simplify': 'error', - 'n8n-nodes-base/node-param-default-wrong-for-string': 'error', - 'n8n-nodes-base/node-param-description-boolean-without-whether': 'error', - 'n8n-nodes-base/node-param-description-comma-separated-hyphen': 'error', - 'n8n-nodes-base/node-param-description-empty-string': 'error', - 'n8n-nodes-base/node-param-description-excess-final-period': 'error', - 'n8n-nodes-base/node-param-description-excess-inner-whitespace': 'error', - 'n8n-nodes-base/node-param-description-identical-to-display-name': 'error', - 'n8n-nodes-base/node-param-description-line-break-html-tag': 'error', - 'n8n-nodes-base/node-param-description-lowercase-first-char': 'error', - 'n8n-nodes-base/node-param-description-miscased-id': 'error', - 'n8n-nodes-base/node-param-description-miscased-json': 'error', - 'n8n-nodes-base/node-param-description-miscased-url': 'error', - 'n8n-nodes-base/node-param-description-missing-final-period': 'error', - 'n8n-nodes-base/node-param-description-missing-for-ignore-ssl-issues': 'error', - 'n8n-nodes-base/node-param-description-missing-for-return-all': 'error', - 'n8n-nodes-base/node-param-description-missing-for-simplify': 'error', - 'n8n-nodes-base/node-param-description-missing-from-dynamic-options': 'error', - 'n8n-nodes-base/node-param-description-missing-from-limit': 'error', - 'n8n-nodes-base/node-param-description-unencoded-angle-brackets': 'error', - 'n8n-nodes-base/node-param-description-unneeded-backticks': 'error', - 'n8n-nodes-base/node-param-description-untrimmed': 'error', - 'n8n-nodes-base/node-param-description-url-missing-protocol': 'error', - 'n8n-nodes-base/node-param-description-weak': 'error', - 'n8n-nodes-base/node-param-description-wrong-for-dynamic-multi-options': 'error', - 'n8n-nodes-base/node-param-description-wrong-for-dynamic-options': 'error', - 'n8n-nodes-base/node-param-description-wrong-for-ignore-ssl-issues': 'error', - 'n8n-nodes-base/node-param-description-wrong-for-limit': 'error', - 'n8n-nodes-base/node-param-description-wrong-for-return-all': 'error', - 'n8n-nodes-base/node-param-description-wrong-for-simplify': 'error', - 'n8n-nodes-base/node-param-description-wrong-for-upsert': 'error', - 'n8n-nodes-base/node-param-display-name-excess-inner-whitespace': 'error', - 'n8n-nodes-base/node-param-display-name-miscased': 'error', - 'n8n-nodes-base/node-param-display-name-miscased-id': 'error', - 'n8n-nodes-base/node-param-display-name-untrimmed': 'error', - 'n8n-nodes-base/node-param-display-name-wrong-for-dynamic-multi-options': 'error', - 'n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options': 'error', - 'n8n-nodes-base/node-param-display-name-wrong-for-simplify': 'error', - 'n8n-nodes-base/node-param-display-name-wrong-for-update-fields': 'error', - 'n8n-nodes-base/node-param-min-value-wrong-for-limit': 'error', - 'n8n-nodes-base/node-param-multi-options-type-unsorted-items': 'error', - 'n8n-nodes-base/node-param-operation-without-no-data-expression': 'error', - 'n8n-nodes-base/node-param-option-description-identical-to-name': 'error', - 'n8n-nodes-base/node-param-option-name-containing-star': 'error', - 'n8n-nodes-base/node-param-option-name-duplicate': 'error', - 'n8n-nodes-base/node-param-option-name-wrong-for-get-all': 'error', - 'n8n-nodes-base/node-param-option-name-wrong-for-upsert': 'error', - 'n8n-nodes-base/node-param-option-value-duplicate': 'error', - 'n8n-nodes-base/node-param-options-type-unsorted-items': 'error', - 'n8n-nodes-base/node-param-placeholder-miscased-id': 'error', - 'n8n-nodes-base/node-param-placeholder-missing-email': 'error', - 'n8n-nodes-base/node-param-required-false': 'error', - 'n8n-nodes-base/node-param-resource-with-plural-option': 'error', - 'n8n-nodes-base/node-param-resource-without-no-data-expression': 'error', - 'n8n-nodes-base/node-param-type-options-missing-from-limit': 'error', - 'n8n-nodes-base/node-class-description-inputs-wrong-regular-node': 'error', + 'n8n-nodes-base/node-execute-block-missing-continue-on-fail': 'off', + 'n8n-nodes-base/node-resource-description-filename-against-convention': 'off', + 'n8n-nodes-base/node-param-fixed-collection-type-unsorted-items': 'off', + 'n8n-nodes-base/node-param-fixed-collection-type-unsorted-items': 'off', + 'n8n-nodes-base/node-param-operation-option-without-action': 'off', }, }, ], From f58a0689a530a5acadce3c0320b615d74a000b27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 4 Jul 2022 13:14:38 +0200 Subject: [PATCH 12/15] :shirt: Adjust credentials file per lintings --- ....credentials.ts => ExampleCredentialsApi.credentials.ts} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename credentials/{ExampleCredentials.credentials.ts => ExampleCredentialsApi.credentials.ts} (89%) diff --git a/credentials/ExampleCredentials.credentials.ts b/credentials/ExampleCredentialsApi.credentials.ts similarity index 89% rename from credentials/ExampleCredentials.credentials.ts rename to credentials/ExampleCredentialsApi.credentials.ts index fe42466..3d7f059 100644 --- a/credentials/ExampleCredentials.credentials.ts +++ b/credentials/ExampleCredentialsApi.credentials.ts @@ -5,9 +5,9 @@ import { INodeProperties, } from 'n8n-workflow'; -export class ExampleCredentials implements ICredentialType { - name = 'exampleCredentials'; - displayName = 'Example Credentials'; +export class ExampleCredentialsApi implements ICredentialType { + name = 'exampleCredentialsApi'; + displayName = 'Example Credentials API'; properties: INodeProperties[] = [ // The credentials to get from user and save encrypted. // Properties can be defined exactly in the same way From 991b13bafd05619fd9c2480eec431bbe2d6c088b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 4 Jul 2022 13:16:53 +0200 Subject: [PATCH 13/15] :fire: Remove repetition --- .eslintrc.js | 1 - 1 file changed, 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index 08d3c24..69bccbf 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -46,7 +46,6 @@ module.exports = { 'n8n-nodes-base/node-execute-block-missing-continue-on-fail': 'off', 'n8n-nodes-base/node-resource-description-filename-against-convention': 'off', 'n8n-nodes-base/node-param-fixed-collection-type-unsorted-items': 'off', - 'n8n-nodes-base/node-param-fixed-collection-type-unsorted-items': 'off', 'n8n-nodes-base/node-param-operation-option-without-action': 'off', }, }, From 9a6c7a9c8b54912ae401b362c4533fbfac064f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 4 Jul 2022 13:38:14 +0200 Subject: [PATCH 14/15] :shirt: Enable `node-param-operation-option-without-action` --- .eslintrc.js | 1 - 1 file changed, 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index 69bccbf..f9550f1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -46,7 +46,6 @@ module.exports = { 'n8n-nodes-base/node-execute-block-missing-continue-on-fail': 'off', 'n8n-nodes-base/node-resource-description-filename-against-convention': 'off', 'n8n-nodes-base/node-param-fixed-collection-type-unsorted-items': 'off', - 'n8n-nodes-base/node-param-operation-option-without-action': 'off', }, }, ], From 4998bfd3c726038e82d759ef5c3d4da8e07c38ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Wed, 6 Jul 2022 10:30:58 +0200 Subject: [PATCH 15/15] :zap: Add `action` to `HttpVerbDescription` --- nodes/HttpBin/HttpVerbDescription.ts | 2 ++ package.json | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nodes/HttpBin/HttpVerbDescription.ts b/nodes/HttpBin/HttpVerbDescription.ts index 95bc8a1..c025130 100644 --- a/nodes/HttpBin/HttpVerbDescription.ts +++ b/nodes/HttpBin/HttpVerbDescription.ts @@ -17,6 +17,7 @@ export const httpVerbOperations: INodeProperties[] = [ { name: 'GET', value: 'get', + action: 'Perform a GET request', routing: { request: { method: 'GET', @@ -27,6 +28,7 @@ export const httpVerbOperations: INodeProperties[] = [ { name: 'DELETE', value: 'delete', + action: 'Perform a DELETE request', routing: { request: { method: 'DELETE', diff --git a/package.json b/package.json index 6d30295..ccf505b 100644 --- a/package.json +++ b/package.json @@ -43,8 +43,8 @@ "@typescript-eslint/parser": "^5.29.0", "eslint-plugin-n8n-nodes-base": "^1.2.0", "gulp": "^4.0.2", - "n8n-core": "^0.124.0", - "n8n-workflow": "^0.106.0", + "n8n-core": "^0.125.0", + "n8n-workflow": "^0.107.0", "prettier": "^2.7.1", "tslint": "^6.1.2", "typescript": "~4.6.0"