UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

1 lines 1.3 kB
{"version":3,"file":"hook-map.mjs","names":[],"sources":["../../../src/libs/hooks/hook-map.ts"],"sourcesContent":["import type {\n\tHookExecutionKind,\n\tHookExecutionKindMap,\n\tHookServiceHandlers,\n} from \"./types.js\";\n\n/**\n * Defines whether each hook event transforms request data or runs only for\n * side effects. Transform hooks run sequentially with Immer-drafted data while\n * effect hooks keep the lightweight fire-in-order behaviour.\n */\nexport const hookExecutionKinds = {\n\tdocuments: {\n\t\tbeforeUpsert: \"transform\",\n\t\tafterUpsert: \"effect\",\n\t\tafterFetch: \"transform\",\n\t\tbeforeDelete: \"effect\",\n\t\tafterDelete: \"effect\",\n\t\tversionPromote: \"effect\",\n\t},\n\tdocumentWorkflows: {\n\t\tafterUpdate: \"effect\",\n\t},\n\tpublishOperations: {\n\t\tafterEvent: \"effect\",\n\t},\n\tmedia: {\n\t\tafterCreate: \"effect\",\n\t\tafterUpdate: \"effect\",\n\t\tafterDelete: \"effect\",\n\t},\n} satisfies {\n\t[S in keyof HookServiceHandlers]: {\n\t\t[E in keyof HookServiceHandlers[S]]: HookExecutionKind;\n\t};\n} & HookExecutionKindMap;\n"],"mappings":"AAWA,MAAa,EAAqB,CACjC,UAAW,CACV,aAAc,YACd,YAAa,SACb,WAAY,YACZ,aAAc,SACd,YAAa,SACb,eAAgB,QACjB,EACA,kBAAmB,CAClB,YAAa,QACd,EACA,kBAAmB,CAClB,WAAY,QACb,EACA,MAAO,CACN,YAAa,SACb,YAAa,SACb,YAAa,QACd,CACD"}