File

src/session/entities/session-log-entry.entity.ts

Index

Properties

Properties

Optional detail
Type : Record<string | unknown>
Decorators :
@Column('json', {nullable: true})
id
Type : string
Decorators :
@PrimaryGeneratedColumn('uuid')
level
Type : SessionLogLevel
Decorators :
@Column('varchar')
message
Type : string
Decorators :
@Column('varchar')
session
Type : Session
Decorators :
@ManyToOne(undefined, {onDelete: 'CASCADE'})
sessionId
Type : string
Decorators :
@Index()
@Column('uuid')
Optional stage
Type : string
Decorators :
@Column('varchar', {nullable: true})
timestamp
Type : Date
Decorators :
@CreateDateColumn()
import {
    Column,
    CreateDateColumn,
    Entity,
    Index,
    ManyToOne,
    PrimaryGeneratedColumn,
} from "typeorm";
import { Session } from "./session.entity";

export type SessionLogLevel = "info" | "warn" | "error";

@Entity()
export class SessionLogEntry {
    @PrimaryGeneratedColumn("uuid")
    id!: string;

    @Index()
    @Column("uuid")
    sessionId!: string;

    @ManyToOne(() => Session, { onDelete: "CASCADE" })
    session!: Session;

    @CreateDateColumn()
    timestamp!: Date;

    @Column("varchar")
    level!: SessionLogLevel;

    @Column("varchar", { nullable: true })
    stage?: string;

    @Column("varchar")
    message!: string;

    @Column("json", { nullable: true })
    detail?: Record<string, unknown>;
}

results matching ""

    No results matching ""