diff --git a/package.json b/package.json index 429aae7..390c966 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "directus-helpers", - "version": "1.0.3", + "version": "1.1.0", "description": "Helpers Directus Extensions", "license": "ISC", "author": "AntoXa PRO ", diff --git a/src/operations/index.ts b/src/operations/index.ts index 21279ad..316f80a 100644 --- a/src/operations/index.ts +++ b/src/operations/index.ts @@ -1 +1,11 @@ +import type { Accountability } from '@directus/types' +import type { TTrigger } from './trigger' + +export type TOperationContextData = { + $trigger: TTrigger, + $last: TTrigger + $accountability: Accountability + $env: Record +} + export * from './trigger' diff --git a/src/operations/trigger.ts b/src/operations/trigger.ts index 6e21b8d..2bc3333 100644 --- a/src/operations/trigger.ts +++ b/src/operations/trigger.ts @@ -1,7 +1,21 @@ -export type TTreggerData = { - $trigger: { - body: { - collection: TName - } +export type TTrigger = { + path: string + query: any, + body: { + collection: string + }, + method: 'GET' | 'POST', + headers: { + host: string + connection: string + origin: string + referer: string + cookie: string + accept: string + 'accept-encoding': string + 'accept-language': string + 'user-agent': string + 'content-type': string + 'content-length': string } }