mirror of
https://github.com/xtr-dev/payload-automation.git
synced 2025-12-11 09:13:24 +00:00
- Replace duplicate type definitions with PayloadCMS generated types - Fix workflow context serialization with safeSerialize() method - Resolve type mismatches (id: string vs number) - Update all imports to use PayloadWorkflow type - Ensure workflow runs are created successfully without serialization errors 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
// Pure type definitions for client-safe exports
|
|
// This file contains NO runtime code and can be safely bundled
|
|
|
|
export interface CustomTriggerOptions {
|
|
workflowId: string
|
|
triggerData?: any
|
|
req?: any // PayloadRequest type, but avoiding import to keep this client-safe
|
|
}
|
|
|
|
export interface TriggerResult {
|
|
success: boolean
|
|
runId?: string
|
|
error?: string
|
|
}
|
|
|
|
export interface ExecutionContext {
|
|
trigger: {
|
|
type: string
|
|
doc?: any
|
|
data?: any
|
|
}
|
|
steps: Record<string, {
|
|
output?: any
|
|
state: 'pending' | 'running' | 'succeeded' | 'failed'
|
|
}>
|
|
payload: any // Payload instance
|
|
req: any // PayloadRequest
|
|
}
|
|
|
|
// NOTE: Workflow, WorkflowStep, and WorkflowTrigger types are now imported from the generated PayloadCMS types
|
|
// These interfaces have been removed to avoid duplication and inconsistencies
|
|
// Import them from 'payload' or the generated payload-types.ts file instead
|
|
|
|
export interface WorkflowsPluginConfig {
|
|
collections?: string[]
|
|
globals?: string[]
|
|
logging?: {
|
|
level?: 'debug' | 'info' | 'warn' | 'error'
|
|
enabled?: boolean
|
|
}
|
|
} |