mirror of
https://github.com/outline/outline.git
synced 2026-11-25 07:04:37 +03:00
Surface when a history event was performed via the API or MCP, e.g. "Tom published via MCP". Moves AuthenticationType to shared types and exposes authType on the event presenter. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
48 lines
880 B
TypeScript
48 lines
880 B
TypeScript
import type { AuthenticationType } from "@shared/types";
|
|
import Collection from "./Collection";
|
|
import Document from "./Document";
|
|
import User from "./User";
|
|
import Model from "./base/Model";
|
|
import Relation from "./decorators/Relation";
|
|
|
|
class Event<T extends Model> extends Model {
|
|
static modelName = "Event";
|
|
|
|
name: string;
|
|
|
|
modelId: string | undefined;
|
|
|
|
actorIpAddress: string | null | undefined;
|
|
|
|
@Relation(() => Document)
|
|
document: Document;
|
|
|
|
documentId: string | undefined;
|
|
|
|
@Relation(() => Collection)
|
|
collection: Collection;
|
|
|
|
collectionId: string | undefined;
|
|
|
|
@Relation(() => User)
|
|
user: User;
|
|
|
|
userId: string;
|
|
|
|
@Relation(() => User)
|
|
actor: User;
|
|
|
|
actorId: string;
|
|
|
|
authType: AuthenticationType | null;
|
|
|
|
data: Partial<T> | null;
|
|
|
|
changes: {
|
|
attributes: Partial<T>;
|
|
previous: Partial<T>;
|
|
} | null;
|
|
}
|
|
|
|
export default Event;
|