mirror of
https://github.com/n8n-io/n8n.git
synced 2026-11-04 15:23:47 +08:00
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com> Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
16 lines
537 B
TypeScript
16 lines
537 B
TypeScript
import type { INodeTypeDescription } from 'n8n-workflow';
|
|
|
|
import type { SimpleWorkflow } from '@/types';
|
|
import { validateTrigger } from '@/validation/checks';
|
|
import type { SingleEvaluatorResult } from '@/validation/types';
|
|
|
|
import { calcSingleEvaluatorScore } from '../score';
|
|
|
|
export function evaluateTrigger(
|
|
workflow: SimpleWorkflow,
|
|
nodeTypes: INodeTypeDescription[],
|
|
): SingleEvaluatorResult {
|
|
const violations = validateTrigger(workflow, nodeTypes);
|
|
return { violations, score: calcSingleEvaluatorScore({ violations }) };
|
|
}
|