Directus / @directus/sdk / rest / readWebhook
Function: readWebhook() ​
readWebhook<
Schema,TQuery>(key,query?):RestCommand<IfAny<Schema,Record<string,any>, { [K in string | number | symbol]: Merge<MappedFunctionFields<Schema, UnpackList<IfAny<Schema, { actions: (...) | (...); collections: (...) | (...); data: boolean; headers: (...) | (...); id: number; method: string; name: string; status: string; url: string }, "directus_webhooks" extends keyof (...) ? (...) extends (...) ? (...) : (...) : { actions: ...; collections: ...; data: ...; headers: ...; id: ...; method: ...; name: ...; status: ...; url: ... }>>> extends FF ? MapFlatFields<UnpackList<IfAny<Schema, { actions: (...) | (...); collections: (...) | (...); data: boolean; headers: (...) | (...); id: number; method: string; name: string; status: string; url: string }, "directus_webhooks" extends keyof (...) ? (...) extends (...) ? (...) : (...) : { actions: ...; collections: ...; data: ...; headers: ...; id: ...; method: ...; name: ...; status: ...; url: ... }>>, FieldsWildcard<UnpackList<IfAny<Schema, { actions: ...; collections: ...; data: ...; headers: ...; id: ...; method: ...; name: ...; status: ...; url: ... }, (...) extends (...) ? (...) : (...)>>, Exclude<UnpackList<Mutable<(...)>>, PickRelationalFields<(...)> extends never ? never : AllKeys<(...)>>>, FF extends Record<string, string> ? FF<FF> : Record<string, string>> : never, PickRelationalFields<UnpackList<Mutable<TQuery["fields"]>>> extends never ? never : { [Field in string | number | symbol]: Field extends keyof UnpackList<IfAny<(...), (...), (...)>> ? Extract<(...)[(...)], ItemType<(...)>> extends RelatedCollection ? IsNullable<(...)[(...)], (...) | (...), (...) extends (...) ? (...) : (...)> : never : never }>[K] }>,Schema>
Defined in: rest/commands/read/webhooks.ts:35
List an existing Webhook by primary key.
Type Parameters ​
• Schema
• TQuery extends Query<Schema, DirectusWebhook<Schema>>
Parameters ​
key ​
DirectusWebhook<Schema>["id"]
The primary key of the dashboard
query? ​
TQuery
The query parameters
Returns ​
RestCommand<IfAny<Schema, Record<string, any>, { [K in string | number | symbol]: Merge<MappedFunctionFields<Schema, UnpackList<IfAny<Schema, { actions: (...) | (...); collections: (...) | (...); data: boolean; headers: (...) | (...); id: number; method: string; name: string; status: string; url: string }, "directus_webhooks" extends keyof (...) ? (...) extends (...) ? (...) : (...) : { actions: ...; collections: ...; data: ...; headers: ...; id: ...; method: ...; name: ...; status: ...; url: ... }>>> extends FF ? MapFlatFields<UnpackList<IfAny<Schema, { actions: (...) | (...); collections: (...) | (...); data: boolean; headers: (...) | (...); id: number; method: string; name: string; status: string; url: string }, "directus_webhooks" extends keyof (...) ? (...) extends (...) ? (...) : (...) : { actions: ...; collections: ...; data: ...; headers: ...; id: ...; method: ...; name: ...; status: ...; url: ... }>>, FieldsWildcard<UnpackList<IfAny<Schema, { actions: ...; collections: ...; data: ...; headers: ...; id: ...; method: ...; name: ...; status: ...; url: ... }, (...) extends (...) ? (...) : (...)>>, Exclude<UnpackList<Mutable<(...)>>, PickRelationalFields<(...)> extends never ? never : AllKeys<(...)>>>, FF extends Record<string, string> ? FF<FF> : Record<string, string>> : never, PickRelationalFields<UnpackList<Mutable<TQuery["fields"]>>> extends never ? never : { [Field in string | number | symbol]: Field extends keyof UnpackList<IfAny<(...), (...), (...)>> ? Extract<(...)[(...)], ItemType<(...)>> extends RelatedCollection ? IsNullable<(...)[(...)], (...) | (...), (...) extends (...) ? (...) : (...)> : never : never }>[K] }>, Schema>
Returns a Webhook object if a valid primary key was provided.
Throws ​
Will throw if key is empty