Files
payload-automation/src/triggers/global-trigger.ts
Bas van den Aakster b18e2eaf49 WIP: Refactor triggers to TriggerConfig pattern
- Convert webhook, global, and cron triggers to use TriggerConfig pattern like collectionTrigger
- Simplify trigger slug names (remove '-trigger' suffix)
- Update validation to use new slug names
- Add perfectionist/sort-exports rule disable
- Note: Workflow.ts integration still needs fixes for type compatibility
2025-09-10 13:48:26 +02:00

25 lines
569 B
TypeScript

import type {TriggerConfig} from '../plugin/config-types.js'
export const globalTrigger: TriggerConfig = () => ({
slug: 'global',
fields: [
{
name: 'global',
type: 'select',
admin: {
description: 'Global that triggers the workflow',
},
options: [], // Will be populated dynamically based on available globals
},
{
name: 'globalOperation',
type: 'select',
admin: {
description: 'Global operation that triggers the workflow',
},
options: [
'update'
],
}
]
})