mirror of
https://github.com/langgenius/dify.git
synced 2026-01-14 06:07:33 +08:00
- Add isStart: true to all trigger nodes (TriggerWebhook, TriggerSchedule, TriggerPlugin) - Replace hardcoded BlockEnum checks in use-checklist.ts with metadata-driven logic - Update trigger node tests to validate metadata instead of obsolete methods - Add webhook URL validation to TriggerWebhook node - Ensure backward compatibility with existing workflow configurations This change migrates from hardcoded trigger node identification to a centralized metadata-driven approach, improving maintainability and consistency across the workflow system.
29 lines
616 B
TypeScript
29 lines
616 B
TypeScript
import { BlockEnum } from '../../types'
|
|
import type { NodeDefault } from '../../types'
|
|
import { genNodeMetaData } from '../../utils'
|
|
import type { PluginTriggerNodeType } from './types'
|
|
|
|
const metaData = genNodeMetaData({
|
|
sort: 1,
|
|
type: BlockEnum.TriggerPlugin,
|
|
isStart: true,
|
|
})
|
|
|
|
const nodeDefault: NodeDefault<PluginTriggerNodeType> = {
|
|
metaData,
|
|
defaultValue: {
|
|
plugin_id: '',
|
|
trigger_name: '',
|
|
// event_type: '',
|
|
config: {},
|
|
},
|
|
checkValid(_payload: PluginTriggerNodeType, _t: any) {
|
|
return {
|
|
isValid: true,
|
|
errorMessage: '',
|
|
}
|
|
},
|
|
}
|
|
|
|
export default nodeDefault
|