all

abstract fun all(pageSize: Int = 20, scope: CoroutineScope): PaginatedResource<PublicationShort>

Retrieves a paginated list of publication content accessible to the current user profile.

The returned PaginatedResource's reactivity (restarting on profile/language change, and on auth state changes) is bound to scope: its internal machinery stops once scope has no active collectors of PaginatedResource.state, and resumes on the next collection.

Return

A PaginatedResource wrapping the fetched co.cafeyn.cgs.api.model.Publication.

Parameters

pageSize

Specify a limit for the number of items returned per page.

scope

The CoroutineScope used to bound the lifecycle of the returned PaginatedResource.


abstract fun all(publicationIds: List<PublicationId>, topicIds: List<TopicId>, pageSize: Int = 20, scope: CoroutineScope): PaginatedResource<PublicationShort>

Retrieves a paginated list of publication content accessible to the current user profile filtered by publicationIds and topicIds.

The returned PaginatedResource's reactivity (restarting on profile/language change, and on auth state changes) is bound to scope: its internal machinery stops once scope has no active collectors of PaginatedResource.state, and resumes on the next collection.

Return

A PaginatedResource wrapping the fetched co.cafeyn.cgs.api.model.PublicationShort. Returns a PaginatedResource in an error state with co.cafeyn.cgs.api.errors.CgsError.Content.NotFound if both lists are empty.

Parameters

publicationIds

Publication identifiers to query.

topicIds

Topic identifiers to query.

pageSize

Specify a limit for the number of items returned per page.

scope

The CoroutineScope used to bound the lifecycle of the returned PaginatedResource.