collections module manages a user’s saved-content collections. Every user has a single root collection, under which they can nest sub-collections and into which they can save entities.
Collections are always scoped to a specific user. Pass that user’s Sublay ID as
userId on every call — your service key performs the operation on behalf of
that named user.fetchRootCollection
Fetches a user’s root collection, creating it on first access if it does not yet exist.Promise<Collection>
fetchSubCollections
Fetches the direct child collections nested under a given collection.Promise<Collection[]>
createNewCollection
Creates a new sub-collection under an existing parent collection.Promise<Collection>
fetchCollectionEntities
Fetches a paginated list of entities saved in a collection.Comma-separated list of associations to populate:
"user", "space", "topComment", "files", "grants".Promise<PaginatedResponse<Entity>>
addEntityToCollection
Saves an entity into a collection.Promise<Collection>
removeEntityFromCollection
Removes an entity from a collection.Promise<void>
updateCollection
Renames a collection.Promise<Collection>
deleteCollection
Deletes a collection.Promise<void>
