Directus / @directus/sdk / rest / readOperation
Function: readOperation() ​
readOperation<
Schema
,TQuery
>(key
,query
?):RestCommand
<IfAny
<Schema
,Record
<string
,any
>, { [K in string | number | symbol]: Merge<MappedFunctionFields<Schema, UnpackList<IfAny<Schema, { date_created: (...) | (...); flow: (...) | (...); id: string; key: string; name: (...) | (...); options: (...) | (...); position_x: number; position_y: number; reject: (...) | (...) | (...); resolve: (...) | (...) | (...); timestamp: string; type: string; user_created: (...) | (...) | (...) }, "directus_operations" extends keyof (...) ? (...) extends (...) ? (...) : (...) : { date_created: ...; flow: ...; id: ...; key: ...; name: ...; options: ...; position_x: ...; position_y: ...; reject: ...; resolve: ...; timestamp: ...; type: ...; user_created: ... }>>> extends FF ? MapFlatFields<UnpackList<IfAny<Schema, { date_created: (...) | (...); flow: (...) | (...); id: string; key: string; name: (...) | (...); options: (...) | (...); position_x: number; position_y: number; reject: (...) | (...) | (...); resolve: (...) | (...) | (...); timestamp: string; type: string; user_created: (...) | (...) | (...) }, "directus_operations" extends keyof (...) ? (...) extends (...) ? (...) : (...) : { date_created: ...; flow: ...; id: ...; key: ...; name: ...; options: ...; position_x: ...; position_y: ...; reject: ...; resolve: ...; timestamp: ...; type: ...; user_created: ... }>>, FieldsWildcard<UnpackList<IfAny<Schema, { date_created: ...; flow: ...; id: ...; key: ...; name: ...; options: ...; position_x: ...; position_y: ...; reject: ...; resolve: ...; timestamp: ...; type: ...; user_created: ... }, (...) 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/operations.ts:35
List all Operations that exist in Directus.
Type Parameters ​
• Schema
• TQuery extends Query
<Schema
, DirectusOperation
<Schema
>>
Parameters ​
key ​
DirectusOperation
<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, { date_created: (...) | (...); flow: (...) | (...); id: string; key: string; name: (...) | (...); options: (...) | (...); position_x: number; position_y: number; reject: (...) | (...) | (...); resolve: (...) | (...) | (...); timestamp: string; type: string; user_created: (...) | (...) | (...) }, "directus_operations" extends keyof (...) ? (...) extends (...) ? (...) : (...) : { date_created: ...; flow: ...; id: ...; key: ...; name: ...; options: ...; position_x: ...; position_y: ...; reject: ...; resolve: ...; timestamp: ...; type: ...; user_created: ... }>>> extends FF ? MapFlatFields<UnpackList<IfAny<Schema, { date_created: (...) | (...); flow: (...) | (...); id: string; key: string; name: (...) | (...); options: (...) | (...); position_x: number; position_y: number; reject: (...) | (...) | (...); resolve: (...) | (...) | (...); timestamp: string; type: string; user_created: (...) | (...) | (...) }, "directus_operations" extends keyof (...) ? (...) extends (...) ? (...) : (...) : { date_created: ...; flow: ...; id: ...; key: ...; name: ...; options: ...; position_x: ...; position_y: ...; reject: ...; resolve: ...; timestamp: ...; type: ...; user_created: ... }>>, FieldsWildcard<UnpackList<IfAny<Schema, { date_created: ...; flow: ...; id: ...; key: ...; name: ...; options: ...; position_x: ...; position_y: ...; reject: ...; resolve: ...; timestamp: ...; type: ...; user_created: ... }, (...) 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 Operation object if a valid primary key was provided.
Throws ​
Will throw if key is empty