fix: webhook and 4 other nodes incorrectly marked as non-triggers
Updated trigger detection logic in both parsers to check if a node's group array includes 'trigger'. This fixes an issue where webhook, cron, interval, and emailReadImap nodes were not being identified as triggers despite having category='trigger'. Note: After pulling this change, run `npm run rebuild` to update your local database. Fixes #13 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -107,6 +107,14 @@ export class NodeParser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private detectTrigger(description: any): boolean {
|
private detectTrigger(description: any): boolean {
|
||||||
|
// Primary check: group includes 'trigger'
|
||||||
|
if (description.group && Array.isArray(description.group)) {
|
||||||
|
if (description.group.includes('trigger')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fallback checks for edge cases
|
||||||
return description.polling === true ||
|
return description.polling === true ||
|
||||||
description.trigger === true ||
|
description.trigger === true ||
|
||||||
description.eventTrigger === true ||
|
description.eventTrigger === true ||
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ export class SimpleParser {
|
|||||||
properties: description.properties || [],
|
properties: description.properties || [],
|
||||||
credentials: description.credentials || [],
|
credentials: description.credentials || [],
|
||||||
isAITool: description.usableAsTool === true,
|
isAITool: description.usableAsTool === true,
|
||||||
isTrigger: description.polling === true || description.trigger === true,
|
isTrigger: this.detectTrigger(description),
|
||||||
isWebhook: description.webhooks?.length > 0,
|
isWebhook: description.webhooks?.length > 0,
|
||||||
operations: isDeclarative ? this.extractOperations(description.routing) : this.extractProgrammaticOperations(description),
|
operations: isDeclarative ? this.extractOperations(description.routing) : this.extractProgrammaticOperations(description),
|
||||||
version: this.extractVersion(nodeClass),
|
version: this.extractVersion(nodeClass),
|
||||||
@@ -87,6 +87,21 @@ export class SimpleParser {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private detectTrigger(description: any): boolean {
|
||||||
|
// Primary check: group includes 'trigger'
|
||||||
|
if (description.group && Array.isArray(description.group)) {
|
||||||
|
if (description.group.includes('trigger')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fallback checks for edge cases
|
||||||
|
return description.polling === true ||
|
||||||
|
description.trigger === true ||
|
||||||
|
description.eventTrigger === true ||
|
||||||
|
description.name?.toLowerCase().includes('trigger');
|
||||||
|
}
|
||||||
|
|
||||||
private extractOperations(routing: any): any[] {
|
private extractOperations(routing: any): any[] {
|
||||||
// Simple extraction without complex logic
|
// Simple extraction without complex logic
|
||||||
const operations: any[] = [];
|
const operations: any[] = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user