From 2a198b5503505c13641a7736df1f5a9c4fbdffaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Fri, 31 Mar 2023 11:54:20 +0200 Subject: [PATCH 1/8] :zap: Set up CI and commands --- .github/workflows/ci-pull-requests.yml | 2 ++ packages/core/package.json | 3 ++- packages/nodes-base/package.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-pull-requests.yml b/.github/workflows/ci-pull-requests.yml index 281aa36e6d979..954eb77278f9b 100644 --- a/.github/workflows/ci-pull-requests.yml +++ b/.github/workflows/ci-pull-requests.yml @@ -25,6 +25,8 @@ jobs: - name: Build run: pnpm build + env: + VALIDATE_LOAD_OPTIONS_METHODS: true - name: Cache build artifacts uses: actions/cache@v3 diff --git a/packages/core/package.json b/packages/core/package.json index c00bfb8e8931a..5d48be2b4d7de 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -16,7 +16,8 @@ "types": "dist/index.d.ts", "bin": { "n8n-generate-known": "./bin/generate-known", - "n8n-generate-ui-types": "./bin/generate-ui-types" + "n8n-generate-ui-types": "./bin/generate-ui-types", + "n8n-generate-ui-types-with-methods": "./bin/generate-ui-types-with-methods" }, "scripts": { "clean": "rimraf dist .turbo", diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 34e94c24292f0..e38871f89af85 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -19,7 +19,7 @@ "typecheck": "tsc", "build": "tsc -p tsconfig.build.json && gulp build:icons && gulp build:translations && pnpm build:metadata", "build:translations": "gulp build:translations", - "build:metadata": "pnpm n8n-generate-known && pnpm n8n-generate-ui-types", + "build:metadata": "[[ -z \"${VALIDATE_LOAD_OPTIONS_METHODS}\" ]] && pnpm n8n-generate-ui-types || pnpm n8n-generate-ui-types-with-methods && node ./scripts/validate-load-options-methods.js", "format": "prettier --write . --ignore-path ../../.prettierignore", "lint": "eslint --quiet nodes credentials", "lintfix": "eslint nodes credentials --fix", From fe14a4db6736c0228ba3f7ecb44bca3408baa187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Fri, 31 Mar 2023 11:54:34 +0200 Subject: [PATCH 2/8] :zap: Generate UI types with methods --- .../core/bin/generate-ui-types-with-methods | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100755 packages/core/bin/generate-ui-types-with-methods diff --git a/packages/core/bin/generate-ui-types-with-methods b/packages/core/bin/generate-ui-types-with-methods new file mode 100755 index 0000000000000..d370a496a2c21 --- /dev/null +++ b/packages/core/bin/generate-ui-types-with-methods @@ -0,0 +1,81 @@ +#!/usr/bin/env node + +/** + * Alternate version of generate-ui-types that validates all `loadOptions` + * methods defined and referenced in node types, only used during CI. + */ + +const { LoggerProxy, NodeHelpers } = require('n8n-workflow'); +const { PackageDirectoryLoader } = require('../dist/DirectoryLoader'); +const { packageDir, writeJSON } = require('./common'); + +LoggerProxy.init({ + log: console.log.bind(console), + warn: console.warn.bind(console), +}); + +function findReferencedMethods(obj, refs = {}, latestName = '') { + for (const key in obj) { + if (key === 'name' && 'group' in obj) { + latestName = obj[key]; + } + + if (typeof obj[key] === 'object') { + findReferencedMethods(obj[key], refs, latestName); + } + + if (key === 'loadOptionsMethod') { + refs[latestName] = refs[latestName] + ? [...new Set([...refs[latestName], obj[key]])] + : [obj[key]]; + } + } + + return refs; +} + +(async () => { + const loader = new PackageDirectoryLoader(packageDir); + await loader.loadAll({ withLoadOptionsMethods: true }); + + const credentialTypes = Object.values(loader.credentialTypes).map((data) => data.type); + + const loaderNodeTypes = Object.values(loader.nodeTypes); + + const definedMethods = loaderNodeTypes.reduce((acc, cur) => { + NodeHelpers.getVersionedNodeTypeAll(cur.type).forEach((type) => { + const methods = type.description?.__loadOptionsMethods; + + if (!methods) return; + + const { name } = type.description; + + acc[name] = acc[name] ? acc[name].push(methods) : methods; + }); + + return acc; + }, {}); + + const nodeTypes = loaderNodeTypes + .map((data) => { + const nodeType = NodeHelpers.getVersionedNodeType(data.type); + NodeHelpers.applySpecialNodeParameters(nodeType); + return data.type; + }) + .flatMap((nodeData) => { + return NodeHelpers.getVersionedNodeTypeAll(nodeData).map((item) => { + const { __loadOptionsMethods, ...rest } = item.description; + + return rest; + }); + }); + + const referencedMethods = findReferencedMethods(nodeTypes); + + await Promise.all([ + writeJSON('types/credentials.json', credentialTypes), + writeJSON('types/nodes.json', nodeTypes), + writeJSON('methods/defined.json', definedMethods), + writeJSON('methods/referenced.json', referencedMethods), + ]); +})(); From bc043d0280fd98cc27bcbcf88f4582c8dbac3cde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Fri, 31 Mar 2023 11:54:56 +0200 Subject: [PATCH 3/8] :zap: Validate `loadOptionsMethods` --- .../scripts/validate-load-options-methods.js | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 packages/nodes-base/scripts/validate-load-options-methods.js diff --git a/packages/nodes-base/scripts/validate-load-options-methods.js b/packages/nodes-base/scripts/validate-load-options-methods.js new file mode 100644 index 0000000000000..f6b200494b6ba --- /dev/null +++ b/packages/nodes-base/scripts/validate-load-options-methods.js @@ -0,0 +1,43 @@ +let referencedMethods; +let availableMethods; + +try { + referencedMethods = require('../dist/methods/referenced.json'); + availableMethods = require('../dist/methods/defined.json'); +} catch (error) { + console.error( + 'Failed to find methods. Please run `npm run n8n-generate-ui-types-with-methods` first.', + ); + process.exit(1); +} + +const compareMethods = (base, other) => { + const result = []; + + for (const [nodeName, methods] of Object.entries(base)) { + if (nodeName in other) { + const found = methods.filter((item) => !other[nodeName].includes(item)); + + if (found.length > 0) result.push({ [nodeName]: found }); + } + } + + return result; +}; + +const referencedButUndefined = compareMethods(referencedMethods, availableMethods); + +if (referencedButUndefined.length > 0) { + console.error('ERROR: The following load options methods are referenced but undefined.'); + console.error('Please fix or remove the references or add the methods.'); + console.error(referencedButUndefined); + process.exit(1); +} + +const definedButUnused = compareMethods(availableMethods, referencedMethods); + +if (definedButUnused.length > 0) { + console.warn('Warning: The following load options methods are defined but unused.'); + console.warn('Please consider using or removing them.'); + console.warn(definedButUnused); +} From 5b2890c1bae2975af93156cc30cd6986dd673c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Fri, 31 Mar 2023 11:55:24 +0200 Subject: [PATCH 4/8] :zap: Add flag to `DirectoryLoader` --- packages/core/src/DirectoryLoader.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/core/src/DirectoryLoader.ts b/packages/core/src/DirectoryLoader.ts index 296214a029794..99aeb450dbc0d 100644 --- a/packages/core/src/DirectoryLoader.ts +++ b/packages/core/src/DirectoryLoader.ts @@ -44,6 +44,8 @@ export abstract class DirectoryLoader { types: Types = { nodes: [], credentials: [] }; + withLoadOptionsMethods = false; // for CI validation only + constructor( readonly directory: string, protected readonly excludeNodes: string[] = [], @@ -103,6 +105,7 @@ export abstract class DirectoryLoader { const currentVersionNode = tempNode.nodeVersions[tempNode.currentVersion]; this.addCodex({ node: currentVersionNode, filePath, isCustom }); nodeVersion = tempNode.currentVersion; + if (this.withLoadOptionsMethods) this.addLoadOptionsMethods(currentVersionNode); if (currentVersionNode.hasOwnProperty('executeSingle')) { Logger.warn( @@ -111,6 +114,7 @@ export abstract class DirectoryLoader { ); } } else { + if (this.withLoadOptionsMethods) this.addLoadOptionsMethods(tempNode); // Short renaming to avoid type issues nodeVersion = Array.isArray(tempNode.description.version) @@ -244,6 +248,13 @@ export abstract class DirectoryLoader { } } + private addLoadOptionsMethods(node: INodeType) { + if (node?.methods?.loadOptions) { + // @ts-expect-error Field used for CI validation only + node.description.__loadOptionsMethods = Object.keys(node.methods.loadOptions); + } + } + private fixIconPath( obj: INodeTypeDescription | INodeTypeBaseDescription | ICredentialType, filePath: string, @@ -296,7 +307,9 @@ export class PackageDirectoryLoader extends DirectoryLoader { this.packageName = this.packageJson.name; } - override async loadAll() { + override async loadAll(options = { withLoadOptionsMethods: false }) { + this.withLoadOptionsMethods = options.withLoadOptionsMethods; + await this.readPackageJson(); const { n8n } = this.packageJson; From a19cb4df8b9d780e512120734ab738683b14f31d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Fri, 31 Mar 2023 11:55:52 +0200 Subject: [PATCH 5/8] :bug: Fix some invalid method references --- .../FreshworksCrm/descriptions/ContactDescription.ts | 9 --------- packages/nodes-base/nodes/Paddle/PaymentDescription.ts | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/packages/nodes-base/nodes/FreshworksCrm/descriptions/ContactDescription.ts b/packages/nodes-base/nodes/FreshworksCrm/descriptions/ContactDescription.ts index 22b685dce8423..197f21fe1df59 100644 --- a/packages/nodes-base/nodes/FreshworksCrm/descriptions/ContactDescription.ts +++ b/packages/nodes-base/nodes/FreshworksCrm/descriptions/ContactDescription.ts @@ -508,9 +508,6 @@ export const contactFields: INodeProperties[] = [ name: 'lead_source_id', type: 'options', default: '', - typeOptions: { - loadOptionsMethod: 'getLeadSources', - }, description: 'ID of the source where contact came from. Choose from the list, or specify an ID using an expression.', }, @@ -580,9 +577,6 @@ export const contactFields: INodeProperties[] = [ name: 'subscription_status', type: 'options', default: '', - typeOptions: { - loadOptionsMethod: 'getSubscriptionStatuses', - }, description: 'Status of subscription that the contact is in. Choose from the list, or specify an ID using an expression.', }, @@ -591,9 +585,6 @@ export const contactFields: INodeProperties[] = [ name: 'subscription_types', type: 'options', default: '', - typeOptions: { - loadOptionsMethod: 'getSubscriptionTypes', - }, description: 'Type of subscription that the contact is in. Choose from the list, or specify an ID using an expression.', }, diff --git a/packages/nodes-base/nodes/Paddle/PaymentDescription.ts b/packages/nodes-base/nodes/Paddle/PaymentDescription.ts index 45e90932b3535..4596c28472abe 100644 --- a/packages/nodes-base/nodes/Paddle/PaymentDescription.ts +++ b/packages/nodes-base/nodes/Paddle/PaymentDescription.ts @@ -184,7 +184,7 @@ export const paymentFields: INodeProperties[] = [ name: 'paymentId', type: 'options', typeOptions: { - loadOptionsMethod: 'getpayment', + loadOptionsMethod: 'getPayments', }, default: '', required: true, From 96e4fe908800b2addd2a560a98f559e6fcea1b75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Fri, 31 Mar 2023 12:03:42 +0200 Subject: [PATCH 6/8] :zap: Restore `pnpm n8n-generate-known` --- packages/nodes-base/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index e38871f89af85..6ab175a1a7eb4 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -19,7 +19,7 @@ "typecheck": "tsc", "build": "tsc -p tsconfig.build.json && gulp build:icons && gulp build:translations && pnpm build:metadata", "build:translations": "gulp build:translations", - "build:metadata": "[[ -z \"${VALIDATE_LOAD_OPTIONS_METHODS}\" ]] && pnpm n8n-generate-ui-types || pnpm n8n-generate-ui-types-with-methods && node ./scripts/validate-load-options-methods.js", + "build:metadata": "pnpm n8n-generate-known && ([[ -z \"${VALIDATE_LOAD_OPTIONS_METHODS}\" ]] && pnpm n8n-generate-ui-types || pnpm n8n-generate-ui-types-with-methods && node ./scripts/validate-load-options-methods.js)", "format": "prettier --write . --ignore-path ../../.prettierignore", "lint": "eslint --quiet nodes credentials", "lintfix": "eslint nodes credentials --fix", From 06e60b31d1f4549069355264bfb930c21e1f64b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Wed, 5 Apr 2023 11:17:15 +0200 Subject: [PATCH 7/8] :zap: Combine scripts, validate always --- .github/workflows/ci-pull-requests.yml | 2 - packages/core/bin/generate-ui-types | 51 +++++++++++- .../core/bin/generate-ui-types-with-methods | 81 ------------------- packages/core/package.json | 3 +- packages/core/src/DirectoryLoader.ts | 3 +- packages/nodes-base/package.json | 2 +- .../scripts/validate-load-options-methods.js | 14 ++-- packages/workflow/src/Interfaces.ts | 1 + 8 files changed, 58 insertions(+), 99 deletions(-) delete mode 100755 packages/core/bin/generate-ui-types-with-methods diff --git a/.github/workflows/ci-pull-requests.yml b/.github/workflows/ci-pull-requests.yml index 954eb77278f9b..281aa36e6d979 100644 --- a/.github/workflows/ci-pull-requests.yml +++ b/.github/workflows/ci-pull-requests.yml @@ -25,8 +25,6 @@ jobs: - name: Build run: pnpm build - env: - VALIDATE_LOAD_OPTIONS_METHODS: true - name: Cache build artifacts uses: actions/cache@v3 diff --git a/packages/core/bin/generate-ui-types b/packages/core/bin/generate-ui-types index ba7b020b6afc4..8f98f2fc0462f 100755 --- a/packages/core/bin/generate-ui-types +++ b/packages/core/bin/generate-ui-types @@ -9,25 +9,68 @@ LoggerProxy.init({ warn: console.warn.bind(console), }); +function findReferencedMethods(obj, refs = {}, latestName = '') { + for (const key in obj) { + if (key === 'name' && 'group' in obj) { + latestName = obj[key]; + } + + if (typeof obj[key] === 'object') { + findReferencedMethods(obj[key], refs, latestName); + } + + if (key === 'loadOptionsMethod') { + refs[latestName] = refs[latestName] + ? [...new Set([...refs[latestName], obj[key]])] + : [obj[key]]; + } + } + + return refs; +} + (async () => { const loader = new PackageDirectoryLoader(packageDir); - await loader.loadAll(); + await loader.loadAll({ withLoadOptionsMethods: true }); const credentialTypes = Object.values(loader.credentialTypes).map((data) => data.type); - const nodeTypes = Object.values(loader.nodeTypes) + const loaderNodeTypes = Object.values(loader.nodeTypes); + + const definedMethods = loaderNodeTypes.reduce((acc, cur) => { + NodeHelpers.getVersionedNodeTypeAll(cur.type).forEach((type) => { + const methods = type.description?.__loadOptionsMethods; + + if (!methods) return; + + const { name } = type.description; + + acc[name] = acc[name] ? acc[name].push(methods) : methods; + }); + + return acc; + }, {}); + + const nodeTypes = loaderNodeTypes .map((data) => { const nodeType = NodeHelpers.getVersionedNodeType(data.type); NodeHelpers.applySpecialNodeParameters(nodeType); return data.type; }) .flatMap((nodeData) => { - const allNodeTypes = NodeHelpers.getVersionedNodeTypeAll(nodeData); - return allNodeTypes.map((element) => element.description); + return NodeHelpers.getVersionedNodeTypeAll(nodeData).map((item) => { + const { __loadOptionsMethods, ...rest } = item.description; + + return rest; + }); }); + const referencedMethods = findReferencedMethods(nodeTypes); + await Promise.all([ writeJSON('types/credentials.json', credentialTypes), writeJSON('types/nodes.json', nodeTypes), + writeJSON('methods/defined.json', definedMethods), + writeJSON('methods/referenced.json', referencedMethods), ]); })(); diff --git a/packages/core/bin/generate-ui-types-with-methods b/packages/core/bin/generate-ui-types-with-methods deleted file mode 100755 index d370a496a2c21..0000000000000 --- a/packages/core/bin/generate-ui-types-with-methods +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env node - -/** - * Alternate version of generate-ui-types that validates all `loadOptions` - * methods defined and referenced in node types, only used during CI. - */ - -const { LoggerProxy, NodeHelpers } = require('n8n-workflow'); -const { PackageDirectoryLoader } = require('../dist/DirectoryLoader'); -const { packageDir, writeJSON } = require('./common'); - -LoggerProxy.init({ - log: console.log.bind(console), - warn: console.warn.bind(console), -}); - -function findReferencedMethods(obj, refs = {}, latestName = '') { - for (const key in obj) { - if (key === 'name' && 'group' in obj) { - latestName = obj[key]; - } - - if (typeof obj[key] === 'object') { - findReferencedMethods(obj[key], refs, latestName); - } - - if (key === 'loadOptionsMethod') { - refs[latestName] = refs[latestName] - ? [...new Set([...refs[latestName], obj[key]])] - : [obj[key]]; - } - } - - return refs; -} - -(async () => { - const loader = new PackageDirectoryLoader(packageDir); - await loader.loadAll({ withLoadOptionsMethods: true }); - - const credentialTypes = Object.values(loader.credentialTypes).map((data) => data.type); - - const loaderNodeTypes = Object.values(loader.nodeTypes); - - const definedMethods = loaderNodeTypes.reduce((acc, cur) => { - NodeHelpers.getVersionedNodeTypeAll(cur.type).forEach((type) => { - const methods = type.description?.__loadOptionsMethods; - - if (!methods) return; - - const { name } = type.description; - - acc[name] = acc[name] ? acc[name].push(methods) : methods; - }); - - return acc; - }, {}); - - const nodeTypes = loaderNodeTypes - .map((data) => { - const nodeType = NodeHelpers.getVersionedNodeType(data.type); - NodeHelpers.applySpecialNodeParameters(nodeType); - return data.type; - }) - .flatMap((nodeData) => { - return NodeHelpers.getVersionedNodeTypeAll(nodeData).map((item) => { - const { __loadOptionsMethods, ...rest } = item.description; - - return rest; - }); - }); - - const referencedMethods = findReferencedMethods(nodeTypes); - - await Promise.all([ - writeJSON('types/credentials.json', credentialTypes), - writeJSON('types/nodes.json', nodeTypes), - writeJSON('methods/defined.json', definedMethods), - writeJSON('methods/referenced.json', referencedMethods), - ]); -})(); diff --git a/packages/core/package.json b/packages/core/package.json index 5d48be2b4d7de..c00bfb8e8931a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -16,8 +16,7 @@ "types": "dist/index.d.ts", "bin": { "n8n-generate-known": "./bin/generate-known", - "n8n-generate-ui-types": "./bin/generate-ui-types", - "n8n-generate-ui-types-with-methods": "./bin/generate-ui-types-with-methods" + "n8n-generate-ui-types": "./bin/generate-ui-types" }, "scripts": { "clean": "rimraf dist .turbo", diff --git a/packages/core/src/DirectoryLoader.ts b/packages/core/src/DirectoryLoader.ts index 99aeb450dbc0d..0d2d9020c9bbb 100644 --- a/packages/core/src/DirectoryLoader.ts +++ b/packages/core/src/DirectoryLoader.ts @@ -44,7 +44,7 @@ export abstract class DirectoryLoader { types: Types = { nodes: [], credentials: [] }; - withLoadOptionsMethods = false; // for CI validation only + withLoadOptionsMethods = false; // only for validation during build constructor( readonly directory: string, @@ -250,7 +250,6 @@ export abstract class DirectoryLoader { private addLoadOptionsMethods(node: INodeType) { if (node?.methods?.loadOptions) { - // @ts-expect-error Field used for CI validation only node.description.__loadOptionsMethods = Object.keys(node.methods.loadOptions); } } diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 6ab175a1a7eb4..1da4c9f1f93ba 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -19,7 +19,7 @@ "typecheck": "tsc", "build": "tsc -p tsconfig.build.json && gulp build:icons && gulp build:translations && pnpm build:metadata", "build:translations": "gulp build:translations", - "build:metadata": "pnpm n8n-generate-known && ([[ -z \"${VALIDATE_LOAD_OPTIONS_METHODS}\" ]] && pnpm n8n-generate-ui-types || pnpm n8n-generate-ui-types-with-methods && node ./scripts/validate-load-options-methods.js)", + "build:metadata": "pnpm n8n-generate-known && pnpm n8n-generate-ui-types && node ./scripts/validate-load-options-methods.js", "format": "prettier --write . --ignore-path ../../.prettierignore", "lint": "eslint --quiet nodes credentials", "lintfix": "eslint nodes credentials --fix", diff --git a/packages/nodes-base/scripts/validate-load-options-methods.js b/packages/nodes-base/scripts/validate-load-options-methods.js index f6b200494b6ba..9fa11a78222d8 100644 --- a/packages/nodes-base/scripts/validate-load-options-methods.js +++ b/packages/nodes-base/scripts/validate-load-options-methods.js @@ -1,12 +1,12 @@ let referencedMethods; -let availableMethods; +let definedMethods; try { referencedMethods = require('../dist/methods/referenced.json'); - availableMethods = require('../dist/methods/defined.json'); + definedMethods = require('../dist/methods/defined.json'); } catch (error) { console.error( - 'Failed to find methods. Please run `npm run n8n-generate-ui-types-with-methods` first.', + 'Failed to find methods to validate. Please run `npm run n8n-generate-ui-types` first.', ); process.exit(1); } @@ -25,19 +25,19 @@ const compareMethods = (base, other) => { return result; }; -const referencedButUndefined = compareMethods(referencedMethods, availableMethods); +const referencedButUndefined = compareMethods(referencedMethods, definedMethods); if (referencedButUndefined.length > 0) { console.error('ERROR: The following load options methods are referenced but undefined.'); - console.error('Please fix or remove the references or add the methods.'); + console.error('Please fix or remove the references or define the methods.'); console.error(referencedButUndefined); process.exit(1); } -const definedButUnused = compareMethods(availableMethods, referencedMethods); +const definedButUnused = compareMethods(definedMethods, referencedMethods); if (definedButUnused.length > 0) { console.warn('Warning: The following load options methods are defined but unused.'); - console.warn('Please consider using or removing them.'); + console.warn('Please consider using or removing the methods.'); console.warn(definedButUnused); } diff --git a/packages/workflow/src/Interfaces.ts b/packages/workflow/src/Interfaces.ts index e34457d8af535..e1c35590f00b7 100644 --- a/packages/workflow/src/Interfaces.ts +++ b/packages/workflow/src/Interfaces.ts @@ -1430,6 +1430,7 @@ export interface INodeTypeDescription extends INodeTypeBaseDescription { }; }; actions?: INodeActionTypeDescription[]; + __loadOptionsMethods?: string[]; // only for validation during build } export interface INodeHookDescription { From 9276366a09520bb307e44944acf0a5929590649d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Thu, 6 Apr 2023 14:53:42 +0200 Subject: [PATCH 8/8] :truck: Move to lint task --- packages/nodes-base/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 1da4c9f1f93ba..8276b02ed9f8a 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -19,9 +19,9 @@ "typecheck": "tsc", "build": "tsc -p tsconfig.build.json && gulp build:icons && gulp build:translations && pnpm build:metadata", "build:translations": "gulp build:translations", - "build:metadata": "pnpm n8n-generate-known && pnpm n8n-generate-ui-types && node ./scripts/validate-load-options-methods.js", + "build:metadata": "pnpm n8n-generate-known && pnpm n8n-generate-ui-types", "format": "prettier --write . --ignore-path ../../.prettierignore", - "lint": "eslint --quiet nodes credentials", + "lint": "eslint --quiet nodes credentials; node ./scripts/validate-load-options-methods.js", "lintfix": "eslint nodes credentials --fix", "watch": "tsc-watch -p tsconfig.build.json --onSuccess \"pnpm n8n-generate-ui-types\"", "test": "jest"