refactor(core): Convert dynamic node-parameter routes to a decorated controller (no-changelog) (#7284)

1. Reduce a lot of code duplication
2. Move more endpoints out of `Server.ts`
3. Move all query-param parsing and validation into a middleware to make
the route handlers simpler.
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-11-17 12:03:05 +01:00
committed by GitHub
parent 05ed86c64b
commit fc60e9a809
14 changed files with 426 additions and 572 deletions

View File

@@ -166,7 +166,6 @@ import stringify from 'fast-json-stable-stringify';
import type { EventBus } from 'n8n-design-system/utils';
import { createEventBus } from 'n8n-design-system/utils';
import type {
ILoadOptions,
INode,
INodeCredentials,
INodeListSearchItems,
@@ -688,9 +687,6 @@ export default defineComponent({
const loadOptionsMethod = this.getPropertyArgument(this.currentMode, 'searchListMethod') as
| string
| undefined;
const searchList = this.getPropertyArgument(this.currentMode, 'searchList') as
| ILoadOptions
| undefined;
const requestParams: IResourceLocatorReqParams = {
nodeTypeAndVersion: {
@@ -699,7 +695,6 @@ export default defineComponent({
},
path: this.path,
methodName: loadOptionsMethod,
searchList,
currentNodeParameters: resolvedNodeParameters,
credentials: this.node.credentials,
...(params.filter ? { filter: params.filter } : {}),