diff --git a/packages/cli/src/NodeTypes.ts b/packages/cli/src/NodeTypes.ts index 0901ab7ed7..08c15bd5d5 100644 --- a/packages/cli/src/NodeTypes.ts +++ b/packages/cli/src/NodeTypes.ts @@ -1,4 +1,5 @@ import { + CodexSearchProperties, INodeType, INodeTypeData, INodeTypes, @@ -25,7 +26,15 @@ class NodeTypesClass implements INodeTypes { } getAll(): INodeType[] { - return Object.values(this.nodeTypes).map((data) => data.type); + return Object.values(this.nodeTypes).map((data) => { + try { + data.type.description.codex = this.getCodexSearchProperties(data.sourcePath); + } catch (error) { + console.error(`No codex available for: ${data.sourcePath.split('/').pop()}`); + } + + return data.type; + }); } getByName(nodeType: string): INodeType | undefined { @@ -34,6 +43,15 @@ class NodeTypesClass implements INodeTypes { } return this.nodeTypes[nodeType].type; } + + getCodexSearchProperties(fullNodePath: string): CodexSearchProperties { + const codex = require(`${fullNodePath}on`); // .js to .json + + return { + categories: codex.categories ?? [], + alias: codex.alias ?? [], + }; + } } diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index ba4eb543d0..a530129b47 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -442,7 +442,6 @@ class App { // Healthcheck // ---------------------------------------- - // Does very basic health check this.app.get('/healthz', async (req: express.Request, res: express.Response) => { diff --git a/packages/workflow/src/Interfaces.ts b/packages/workflow/src/Interfaces.ts index cecdaf925a..d395305298 100644 --- a/packages/workflow/src/Interfaces.ts +++ b/packages/workflow/src/Interfaces.ts @@ -566,6 +566,7 @@ export interface INodeTypeDescription { deactivate?: INodeHookDescription[]; }; webhooks?: IWebhookDescription[]; + codex?: CodexSearchProperties; } export interface INodeHookDescription { @@ -781,3 +782,8 @@ export interface IRawErrorObject { export interface IStatusCodeMessages { [key: string]: string; } + +export type CodexSearchProperties = { + categories: string[]; + alias: string[]; +};