Remove initCollectionHooks and associated migration guides

- Delete `initCollectionHooks` implementation and its usage references
- Remove `MIGRATION-v0.0.24.md` and `NOT-IMPLEMENTING.md` as they are now obsolete
- Update related workflow executor logic and TypeScript definitions, ensuring compatibility
- Simplify error handling, input parsing, and logging within workflow execution
- Clean up and refactor redundant code to improve maintainability
This commit is contained in:
2025-09-10 17:36:56 +02:00
parent 435f9b0c69
commit 0f741acf73
19 changed files with 399 additions and 1077 deletions

View File

@@ -1,24 +1,17 @@
import type {TaskConfig} from "payload"
import type {CollectionConfig, TaskConfig} from "payload"
import type {Trigger} from "../triggers/types.js"
export type CollectionTriggerConfigCrud = {
create?: true
delete?: true
read?: true
update?: true
}
export type TriggerConfig = (config: WorkflowsPluginConfig) => Trigger
export type CollectionTriggerConfig = CollectionTriggerConfigCrud | true
export type TriggerConfig = <T extends string>(config: WorkflowsPluginConfig<T>) => Trigger
export type WorkflowsPluginConfig<TSlug extends string> = {
collectionTriggers: {
[key in TSlug]?: CollectionTriggerConfig
export type WorkflowsPluginConfig<TSlug extends string = string> = {
collectionTriggers?: {
[key in TSlug]?: {
[key in keyof CollectionConfig['hooks']]?: true
} | true
}
enabled?: boolean
steps: TaskConfig<string>[],
steps: TaskConfig<string>[]
triggers?: TriggerConfig[]
webhookPrefix?: string
}