mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-15 00:54:06 -08:00
27 lines
648 B
TypeScript
27 lines
648 B
TypeScript
import type { ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
|
|
|
|
export async function getNodeTypes(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
|
const types = this.getKnownNodeTypes() as {
|
|
[key: string]: {
|
|
className: string;
|
|
};
|
|
};
|
|
|
|
const returnData: INodePropertyOptions[] = [];
|
|
|
|
let typeNames = Object.keys(types);
|
|
|
|
if (this.getNode().type === 'n8n-nodes-base.simulateTrigger') {
|
|
typeNames = typeNames.filter((type) => type.toLowerCase().includes('trigger'));
|
|
}
|
|
|
|
for (const type of typeNames) {
|
|
returnData.push({
|
|
name: types[type].className,
|
|
value: type,
|
|
});
|
|
}
|
|
|
|
return returnData;
|
|
}
|