Interface Activity<TPayload>

One row from the activities collection. Both user and org may be set when the source document references both.

interface Activity<TPayload = any> {
    id: string;
    user?: string;
    org?: string;
    resource: string;
    resource_id: string;
    operation: ActivityOperation;
    payload: TPayload;
    event_id?: string;
    created_at: string;
}

Type Parameters

  • TPayload = any

Properties

id: string

Stringified ObjectId of the activity row itself.

user?: string

Stringified ObjectId of the owning user, if any.

org?: string

Stringified ObjectId of the owning org, if any.

resource: string

Normalized resource name (e.g. 'drive', 'task', 'vector_index').

resource_id: string

Stringified ObjectId of the affected source document.

What kind of change occurred.

payload: TPayload

Snapshot of the source document at the time of the change.

event_id?: string

Resume-token-derived dedupe key (server-side, usually not needed).

created_at: string

When the activity row was written.