mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
Merge branch 'add-codex-data' of github.com:n8n-io/n8n into PROD-819-nodes-panel-redesign
This commit is contained in:
commit
38b7d7ead1
|
@ -1,4 +1,5 @@
|
||||||
import {
|
import {
|
||||||
|
CodexSearchProperties,
|
||||||
INodeType,
|
INodeType,
|
||||||
INodeTypeData,
|
INodeTypeData,
|
||||||
INodeTypes,
|
INodeTypes,
|
||||||
|
@ -25,7 +26,15 @@ class NodeTypesClass implements INodeTypes {
|
||||||
}
|
}
|
||||||
|
|
||||||
getAll(): INodeType[] {
|
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 {
|
getByName(nodeType: string): INodeType | undefined {
|
||||||
|
@ -34,6 +43,15 @@ class NodeTypesClass implements INodeTypes {
|
||||||
}
|
}
|
||||||
return this.nodeTypes[nodeType].type;
|
return this.nodeTypes[nodeType].type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getCodexSearchProperties(fullNodePath: string): CodexSearchProperties {
|
||||||
|
const codex = require(`${fullNodePath}on`); // .js to .json
|
||||||
|
|
||||||
|
return {
|
||||||
|
categories: codex.categories ?? [],
|
||||||
|
alias: codex.alias ?? [],
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -442,7 +442,6 @@ class App {
|
||||||
// Healthcheck
|
// Healthcheck
|
||||||
// ----------------------------------------
|
// ----------------------------------------
|
||||||
|
|
||||||
|
|
||||||
// Does very basic health check
|
// Does very basic health check
|
||||||
this.app.get('/healthz', async (req: express.Request, res: express.Response) => {
|
this.app.get('/healthz', async (req: express.Request, res: express.Response) => {
|
||||||
|
|
||||||
|
|
|
@ -566,6 +566,7 @@ export interface INodeTypeDescription {
|
||||||
deactivate?: INodeHookDescription[];
|
deactivate?: INodeHookDescription[];
|
||||||
};
|
};
|
||||||
webhooks?: IWebhookDescription[];
|
webhooks?: IWebhookDescription[];
|
||||||
|
codex?: CodexSearchProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface INodeHookDescription {
|
export interface INodeHookDescription {
|
||||||
|
@ -781,3 +782,8 @@ export interface IRawErrorObject {
|
||||||
export interface IStatusCodeMessages {
|
export interface IStatusCodeMessages {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type CodexSearchProperties = {
|
||||||
|
categories: string[];
|
||||||
|
alias: string[];
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in a new issue