Directus / @directus/sdk / rest / readActivity
Function: readActivity() ​
readActivity<
Schema
,TQuery
>(key
,query
?):RestCommand
<IfAny
<Schema
,Record
<string
,any
>, { [K in string | number | symbol]: Merge<MappedFunctionFields<Schema, UnpackList<IfAny<Schema, { action: string; collection: string; id: number; ip: (...) | (...); item: string; origin: (...) | (...); revisions: (...) | (...) | (...); timestamp: "datetime"; user: (...) | (...) | (...); user_agent: (...) | (...) }, "directus_activity" extends keyof (...) ? (...) extends (...) ? (...) : (...) : { action: ...; collection: ...; id: ...; ip: ...; item: ...; origin: ...; revisions: ...; timestamp: ...; user: ...; user_agent: ... }>>> extends FF ? MapFlatFields<UnpackList<IfAny<Schema, { action: string; collection: string; id: number; ip: (...) | (...); item: string; origin: (...) | (...); revisions: (...) | (...) | (...); timestamp: "datetime"; user: (...) | (...) | (...); user_agent: (...) | (...) }, "directus_activity" extends keyof (...) ? (...) extends (...) ? (...) : (...) : { action: ...; collection: ...; id: ...; ip: ...; item: ...; origin: ...; revisions: ...; timestamp: ...; user: ...; user_agent: ... }>>, FieldsWildcard<UnpackList<IfAny<Schema, { action: ...; collection: ...; id: ...; ip: ...; item: ...; origin: ...; revisions: ...; timestamp: ...; user: ...; user_agent: ... }, (...) 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/activity.ts:35
Returns a single activity action by primary key.
Type Parameters ​
• Schema
• TQuery extends Query
<Schema
, DirectusActivity
<Schema
>>
Parameters ​
key ​
DirectusActivity
<Schema
>["id"
]
The primary key of the activity
query? ​
TQuery
The query parameters
Returns ​
RestCommand
<IfAny
<Schema
, Record
<string
, any
>, { [K in string | number | symbol]: Merge<MappedFunctionFields<Schema, UnpackList<IfAny<Schema, { action: string; collection: string; id: number; ip: (...) | (...); item: string; origin: (...) | (...); revisions: (...) | (...) | (...); timestamp: "datetime"; user: (...) | (...) | (...); user_agent: (...) | (...) }, "directus_activity" extends keyof (...) ? (...) extends (...) ? (...) : (...) : { action: ...; collection: ...; id: ...; ip: ...; item: ...; origin: ...; revisions: ...; timestamp: ...; user: ...; user_agent: ... }>>> extends FF ? MapFlatFields<UnpackList<IfAny<Schema, { action: string; collection: string; id: number; ip: (...) | (...); item: string; origin: (...) | (...); revisions: (...) | (...) | (...); timestamp: "datetime"; user: (...) | (...) | (...); user_agent: (...) | (...) }, "directus_activity" extends keyof (...) ? (...) extends (...) ? (...) : (...) : { action: ...; collection: ...; id: ...; ip: ...; item: ...; origin: ...; revisions: ...; timestamp: ...; user: ...; user_agent: ... }>>, FieldsWildcard<UnpackList<IfAny<Schema, { action: ...; collection: ...; id: ...; ip: ...; item: ...; origin: ...; revisions: ...; timestamp: ...; user: ...; user_agent: ... }, (...) 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 an activity object if a valid identifier was provided.
Throws ​
Will throw if key is empty