Directus / @directus/sdk / rest / readActivity
Function: readActivity() ​
readActivity<
Schema
,TQuery
>(key
,query
?):RestCommand
<IfAny
<Schema
,Record
<string
,any
>,Merge
<MappedFunctionFields
<Schema
,UnpackList
<IfAny
<Schema
,Object
,"directus_activity"
extends keyofSchema
?UnpackList
<...[...]> extendsItem
?{ [Field in (...)]: (...) }
&Object
:never
:Object
>>> extendsFF
?MapFlatFields
<UnpackList
<IfAny
<Schema
,Object
,"directus_activity"
extends keyofSchema
?UnpackList
<...[...]> extendsItem
?{ [Field in (...)]: (...) }
&Object
:never
:Object
>>,FieldsWildcard
<UnpackList
<IfAny
<Schema
,Object
,"directus_activity"
extends keyofSchema
?UnpackList
<...> extendsItem
? ... & ... :never
:Object
>>,Exclude
<UnpackList
<Mutable
<TQuery
["fields"
]>>,PickRelationalFields
<UnpackList
<Mutable
<...>>> extendsnever
?never
:AllKeys
<UnpackList
<...> extendsField
? ... extends ... ? ... : ... :never
>>>,FF
extendsRecord
<string
,string
> ?FF
<FF
> :Record
<string
,string
>> :never
,PickRelationalFields
<UnpackList
<Mutable
<TQuery
["fields"
]>>> extendsnever
?never
:{ [Field in string | number | symbol]: Field extends keyof UnpackList<IfAny<Schema, Object, "directus_activity" extends keyof (...) ? (...) extends (...) ? (...) : (...) : Object>> ? Extract<UnpackList<IfAny<(...), (...), (...)>>[Field<Field>], ItemType<Schema>> extends RelatedCollection ? IsNullable<UnpackList<IfAny<(...), (...), (...)>>[Field<Field>], null | (RelatedCollection extends (...)[] ? (...) extends (...) ? (...) : (...) : ApplyNestedQueryFields<(...), (...), (...)>), RelatedCollection extends any[] ? HasManyToAnyRelation<(...)> extends never ? (...) | (...) : (...)[] : ApplyNestedQueryFields<Schema, RelatedCollection, (...)[(...)]>> : never : never }
>>,Schema
>
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
>, Merge
<MappedFunctionFields
<Schema
, UnpackList
<IfAny
<Schema
, Object
, "directus_activity"
extends keyof Schema
? UnpackList
<...[...]> extends Item
? { [Field in (...)]: (...) }
& Object
: never
: Object
>>> extends FF
? MapFlatFields
<UnpackList
<IfAny
<Schema
, Object
, "directus_activity"
extends keyof Schema
? UnpackList
<...[...]> extends Item
? { [Field in (...)]: (...) }
& Object
: never
: Object
>>, FieldsWildcard
<UnpackList
<IfAny
<Schema
, Object
, "directus_activity"
extends keyof Schema
? UnpackList
<...> extends Item
? ... & ... : never
: Object
>>, Exclude
<UnpackList
<Mutable
<TQuery
["fields"
]>>, PickRelationalFields
<UnpackList
<Mutable
<...>>> extends never
? never
: AllKeys
<UnpackList
<...> extends Field
? ... extends ... ? ... : ... : never
>>>, 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<Schema, Object, "directus_activity" extends keyof (...) ? (...) extends (...) ? (...) : (...) : Object>> ? Extract<UnpackList<IfAny<(...), (...), (...)>>[Field<Field>], ItemType<Schema>> extends RelatedCollection ? IsNullable<UnpackList<IfAny<(...), (...), (...)>>[Field<Field>], null | (RelatedCollection extends (...)[] ? (...) extends (...) ? (...) : (...) : ApplyNestedQueryFields<(...), (...), (...)>), RelatedCollection extends any[] ? HasManyToAnyRelation<(...)> extends never ? (...) | (...) : (...)[] : ApplyNestedQueryFields<Schema, RelatedCollection, (...)[(...)]>> : never : never }
>>, Schema
>
Returns an activity object if a valid identifier was provided.
Throws ​
Will throw if key is empty