diff --git a/.prettierignore b/.prettierignore index 02a74339d6cf9..bc11e15aa2619 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,9 +1,3 @@ dist packages/editor-ui package.json - -!packages/nodes-base/src -!packages/nodes-base/test -!packages/nodes-base/nodes - -packages/nodes-base/nodes/UProc/Json/Tools.ts diff --git a/packages/nodes-base/.eslintrc.js b/packages/nodes-base/.eslintrc.js index 59062ee8fa0d5..7ab688b3b04c9 100644 --- a/packages/nodes-base/.eslintrc.js +++ b/packages/nodes-base/.eslintrc.js @@ -2,9 +2,10 @@ * @type {import('@types/eslint').ESLint.ConfigData} */ module.exports = { - extends: ['@n8n_io/eslint-config/base'], + extends: ['@n8n_io/eslint-config/node'], parserOptions: { project: ['./tsconfig.json'], + tsconfigRootDir: __dirname, }, rules: { @@ -15,7 +16,6 @@ module.exports = { 'import/order': 'off', 'prefer-const': 'off', 'prefer-spread': 'off', - 'prettier/prettier': 'off', 'import/no-extraneous-dependencies': 'off', '@typescript-eslint/array-type': 'off', diff --git a/packages/nodes-base/README.md b/packages/nodes-base/README.md index 9c94eaf04fe5f..89f2e86c7e183 100644 --- a/packages/nodes-base/README.md +++ b/packages/nodes-base/README.md @@ -8,7 +8,6 @@ The nodes which are included by default in n8n npm install n8n-nodes-base -g ``` - ## License n8n is [fair-code](http://faircode.io) distributed under the [**Sustainable Use License**](https://github.com/n8n-io/n8n/blob/master/packages/cli/LICENSE.md). diff --git a/packages/nodes-base/credentials/CloudflareApi.credentials.ts b/packages/nodes-base/credentials/CloudflareApi.credentials.ts index a034af4cbd21b..b15bf48ca75ca 100644 --- a/packages/nodes-base/credentials/CloudflareApi.credentials.ts +++ b/packages/nodes-base/credentials/CloudflareApi.credentials.ts @@ -22,7 +22,7 @@ export class CloudflareApi implements ICredentialType { type: 'generic', properties: { headers: { - 'Authorization': '=Bearer {{$credentials.apiToken}}', + Authorization: '=Bearer {{$credentials.apiToken}}', }, }, }; diff --git a/packages/nodes-base/credentials/HubspotAppToken.credentials.ts b/packages/nodes-base/credentials/HubspotAppToken.credentials.ts index 0bd7ffda436c6..4c5b35a9af48c 100644 --- a/packages/nodes-base/credentials/HubspotAppToken.credentials.ts +++ b/packages/nodes-base/credentials/HubspotAppToken.credentials.ts @@ -1,4 +1,9 @@ -import { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow'; +import { + IAuthenticateGeneric, + ICredentialTestRequest, + ICredentialType, + INodeProperties, +} from 'n8n-workflow'; export class HubspotAppToken implements ICredentialType { name = 'hubspotAppToken'; diff --git a/packages/nodes-base/credentials/MicrosoftSql.credentials.ts b/packages/nodes-base/credentials/MicrosoftSql.credentials.ts index 35686addc7a19..bf6f2183c1551 100644 --- a/packages/nodes-base/credentials/MicrosoftSql.credentials.ts +++ b/packages/nodes-base/credentials/MicrosoftSql.credentials.ts @@ -91,7 +91,8 @@ export class MicrosoftSql implements ICredentialType { }, ], default: '7_4', - description: 'The version of TDS to use. If server doesn\'t support specified version, negotiated version is used instead.', + description: + "The version of TDS to use. If server doesn't support specified version, negotiated version is used instead.", }, ]; } diff --git a/packages/nodes-base/credentials/RundeckApi.credentials.ts b/packages/nodes-base/credentials/RundeckApi.credentials.ts index 9cd4b3ffc17af..bbfc7c366580c 100644 --- a/packages/nodes-base/credentials/RundeckApi.credentials.ts +++ b/packages/nodes-base/credentials/RundeckApi.credentials.ts @@ -24,7 +24,7 @@ export class RundeckApi implements ICredentialType { default: '', }, ]; - + authenticate: IAuthenticateGeneric = { type: 'generic', properties: { @@ -41,5 +41,5 @@ export class RundeckApi implements ICredentialType { url: '/api/14/system/info', method: 'GET', }, - }; + }; } diff --git a/packages/nodes-base/credentials/VenafiTlsProtectDatacenterApi.credentials.ts b/packages/nodes-base/credentials/VenafiTlsProtectDatacenterApi.credentials.ts index 5ffe0ffd49105..dddd67352c4e1 100644 --- a/packages/nodes-base/credentials/VenafiTlsProtectDatacenterApi.credentials.ts +++ b/packages/nodes-base/credentials/VenafiTlsProtectDatacenterApi.credentials.ts @@ -78,7 +78,9 @@ export class VenafiTlsProtectDatacenterApi implements ICredentialType { }, }; - const { access_token } = await this.helpers.httpRequest(requestOptions) as { access_token: string }; + const { access_token } = (await this.helpers.httpRequest(requestOptions)) as { + access_token: string; + }; return { token: access_token }; } diff --git a/packages/nodes-base/gulpfile.js b/packages/nodes-base/gulpfile.js index 07b01e26ddea3..312fc4d465f0b 100644 --- a/packages/nodes-base/gulpfile.js +++ b/packages/nodes-base/gulpfile.js @@ -1,4 +1,7 @@ -const { existsSync, promises: { writeFile } } = require('fs'); +const { + existsSync, + promises: { writeFile }, +} = require('fs'); const path = require('path'); const { task, src, dest } = require('gulp'); @@ -8,7 +11,7 @@ const PURPLE_ANSI_COLOR_CODE = 35; task('build:icons', copyIcons); function copyIcons() { - src('nodes/**/*.{png,svg}').pipe(dest('dist/nodes')) + src('nodes/**/*.{png,svg}').pipe(dest('dist/nodes')); return src('credentials/**/*.{png,svg}').pipe(dest('dist/credentials')); } @@ -55,7 +58,7 @@ function getNodeTranslationPaths() { if (existsSync(nodeTranslationPath)) { acc.push(nodeTranslationPath); - }; + } return acc; }, []); @@ -74,7 +77,6 @@ function getHeaders(nodeTranslationPaths) { }, {}); } - // ---------------------------------- // helpers // ---------------------------------- @@ -89,24 +91,18 @@ function isValidHeader(header, allowedHeaderKeys) { const headerKeys = Object.keys(header); - return headerKeys.length > 0 && - headerKeys.every(key => allowedHeaderKeys.includes(key)); + return headerKeys.length > 0 && headerKeys.every((key) => allowedHeaderKeys.includes(key)); } function writeDistFile(data, distPath) { - writeFile( - distPath, - `module.exports = ${JSON.stringify(data, null, 2)}`, - ); + writeFile(distPath, `module.exports = ${JSON.stringify(data, null, 2)}`); } const log = (string, { bulletpoint } = { bulletpoint: false }) => { if (bulletpoint) { - process.stdout.write( - colorize(PURPLE_ANSI_COLOR_CODE, `- ${string}\n`), - ); + process.stdout.write(colorize(PURPLE_ANSI_COLOR_CODE, `- ${string}\n`)); return; - }; + } process.stdout.write(`${string}\n`); }; diff --git a/packages/nodes-base/nodes/EmailReadImap/EmailReadImap.node.json b/packages/nodes-base/nodes/EmailReadImap/EmailReadImap.node.json index 0843f7582eee1..66db7844572a7 100644 --- a/packages/nodes-base/nodes/EmailReadImap/EmailReadImap.node.json +++ b/packages/nodes-base/nodes/EmailReadImap/EmailReadImap.node.json @@ -23,9 +23,6 @@ ] }, "subcategories": { - "Core Nodes": [ - "Helpers", - "Other Trigger Nodes" - ] + "Core Nodes": ["Helpers", "Other Trigger Nodes"] } } diff --git a/packages/nodes-base/nodes/ErrorTrigger/ErrorTrigger.node.json b/packages/nodes-base/nodes/ErrorTrigger/ErrorTrigger.node.json index 51b79a3cb3551..1ea73accf2ab8 100644 --- a/packages/nodes-base/nodes/ErrorTrigger/ErrorTrigger.node.json +++ b/packages/nodes-base/nodes/ErrorTrigger/ErrorTrigger.node.json @@ -19,9 +19,6 @@ ] }, "subcategories": { - "Core Nodes": [ - "Helpers", - "Other Trigger Nodes" - ] + "Core Nodes": ["Helpers", "Other Trigger Nodes"] } } diff --git a/packages/nodes-base/nodes/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.json b/packages/nodes-base/nodes/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.json index ae51338adb61d..72e5179f3019a 100644 --- a/packages/nodes-base/nodes/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.json +++ b/packages/nodes-base/nodes/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.json @@ -2,9 +2,7 @@ "node": "n8n-nodes-base.executeWorkflowTrigger", "nodeVersion": "1.0", "codexVersion": "1.0", - "categories": [ - "Core Nodes" - ], + "categories": ["Core Nodes"], "resources": { "primaryDocumentation": [ { @@ -14,8 +12,6 @@ "generic": [] }, "subcategories": { - "Core Nodes": [ - "Helpers" - ] + "Core Nodes": ["Helpers"] } } diff --git a/packages/nodes-base/nodes/Interval/Interval.node.json b/packages/nodes-base/nodes/Interval/Interval.node.json index 94a3238f124e3..78e423243f2c6 100644 --- a/packages/nodes-base/nodes/Interval/Interval.node.json +++ b/packages/nodes-base/nodes/Interval/Interval.node.json @@ -24,9 +24,6 @@ }, "alias": ["Time", "Scheduler", "Polling"], "subcategories": { - "Core Nodes": [ - "Flow", - "Other Trigger Nodes" - ] + "Core Nodes": ["Flow", "Other Trigger Nodes"] } } diff --git a/packages/nodes-base/nodes/LocalFileTrigger/LocalFileTrigger.node.json b/packages/nodes-base/nodes/LocalFileTrigger/LocalFileTrigger.node.json index 5c7809d89424d..42496c221b26a 100644 --- a/packages/nodes-base/nodes/LocalFileTrigger/LocalFileTrigger.node.json +++ b/packages/nodes-base/nodes/LocalFileTrigger/LocalFileTrigger.node.json @@ -12,9 +12,6 @@ }, "alias": ["Watch", "Monitor"], "subcategories": { - "Core Nodes":[ - "Files", - "Other Trigger Nodes" - ] + "Core Nodes": ["Files", "Other Trigger Nodes"] } } diff --git a/packages/nodes-base/nodes/ManualTrigger/ManualTrigger.node.json b/packages/nodes-base/nodes/ManualTrigger/ManualTrigger.node.json index b4e9e0ecd995a..5b3d13f82fdcd 100644 --- a/packages/nodes-base/nodes/ManualTrigger/ManualTrigger.node.json +++ b/packages/nodes-base/nodes/ManualTrigger/ManualTrigger.node.json @@ -2,9 +2,7 @@ "node": "n8n-nodes-base.manualTrigger", "nodeVersion": "1.0", "codexVersion": "1.0", - "categories": [ - "Core Nodes" - ], + "categories": ["Core Nodes"], "resources": { "primaryDocumentation": [ { diff --git a/packages/nodes-base/nodes/N8nTrigger/N8nTrigger.node.json b/packages/nodes-base/nodes/N8nTrigger/N8nTrigger.node.json index 426fe4d764d4e..1be5c3b24131f 100644 --- a/packages/nodes-base/nodes/N8nTrigger/N8nTrigger.node.json +++ b/packages/nodes-base/nodes/N8nTrigger/N8nTrigger.node.json @@ -11,9 +11,6 @@ ] }, "subcategories": { - "Core Nodes": [ - "Flow", - "Other Trigger Nodes" - ] + "Core Nodes": ["Flow", "Other Trigger Nodes"] } } diff --git a/packages/nodes-base/nodes/SseTrigger/SseTrigger.node.json b/packages/nodes-base/nodes/SseTrigger/SseTrigger.node.json index 6e29a867cc486..3a46546a738cc 100644 --- a/packages/nodes-base/nodes/SseTrigger/SseTrigger.node.json +++ b/packages/nodes-base/nodes/SseTrigger/SseTrigger.node.json @@ -18,9 +18,6 @@ ] }, "subcategories": { - "Core Nodes": [ - "Flow", - "Other Trigger Nodes" - ] + "Core Nodes": ["Flow", "Other Trigger Nodes"] } } diff --git a/packages/nodes-base/nodes/Stripe/README.md b/packages/nodes-base/nodes/Stripe/README.md index ee3fdd4aa4267..ca207d6d6dc92 100644 --- a/packages/nodes-base/nodes/Stripe/README.md +++ b/packages/nodes-base/nodes/Stripe/README.md @@ -3,15 +3,15 @@ All Stripe webhook events are taken from docs: To get the entire list of events as a JS array, scrape the website: - 1. manually add the id #event-types to `