Skip to content

BeechCMS


BeechCMS / @beechcms/core / IActivityLogRepository

Interface: IActivityLogRepository ​

Methods ​

countSince() ​

countSince(options): Promise<number>

Count entries with the given action and entityType whose createdAt is greater-than-or-equal to sinceTimestamp.

Used by the dashboard /stats/total widget to surface today/week/month create-event counts without hardcoding SQL in the handler. Each period is one call so the repository contract stays narrow and deterministic.

Parameters ​

options ​

CountSinceOptions

Returns ​

Promise<number>


lastContentWriters() ​

lastContentWriters(entryIds): Promise<ContentLastWriter[]>

For each id in entryIds, the actor of its most recent create, update or publish row with entityType = 'content'. Ids with no such row are absent from the result; order is unspecified. Keyed on the entry id alone: public-API writes store the entry slug, not the seed slug, in entitySlug. An empty entryIds resolves to [].

Parameters ​

entryIds ​

readonly string[]

Returns ​

Promise<ContentLastWriter[]>


list() ​

list(options): Promise<ActivityLogRecord[]>

Return the most recent activity entries matching the given filters.

The list is always ordered by createdAt DESC so callers get newest-first data without paying extra sort costs in TypeScript. Used by the settings activity tab (per-user) and by the stats recent-activity feed (scope-projected).

Parameters ​

options ​

ActivityLogListOptions

Returns ​

Promise<ActivityLogRecord[]>