src/audit-log/entities/audit-log.entity.ts
Properties |
|
| actionType |
Type : AuditActionType
|
Decorators :
@Column('varchar')
|
| Optional actorDisplay |
Type : string
|
Decorators :
@Column('varchar', {nullable: true})
|
| Optional actorId |
Type : string
|
Decorators :
@Column('varchar', {nullable: true})
|
| actorType |
Type : AuditActorType
|
Decorators :
@Column('varchar')
|
| Optional after |
Type : Record<string | unknown>
|
Decorators :
@Column('json', {nullable: true})
|
| Optional before |
Type : Record<string | unknown>
|
Decorators :
@Column('json', {nullable: true})
|
| Optional changedFields |
Type : string[]
|
Decorators :
@Column('json', {nullable: true})
|
| id |
Type : string
|
Decorators :
@PrimaryGeneratedColumn('uuid')
|
| Optional requestId |
Type : string
|
Decorators :
@Column('varchar', {nullable: true})
|
| tenantId |
Type : string
|
Decorators :
@Index()
|
| timestamp |
Type : Date
|
Decorators :
@CreateDateColumn()
|
import {
Column,
CreateDateColumn,
Entity,
Index,
PrimaryGeneratedColumn,
} from "typeorm";
export type AuditActionType =
| "tenant_created"
| "tenant_updated"
| "tenant_deleted"
| "presentation_config_created"
| "presentation_config_updated"
| "presentation_config_deleted"
| "issuance_config_updated"
| "credential_config_created"
| "credential_config_updated"
| "credential_config_deleted"
| "status_list_config_updated"
| "status_list_config_reset"
| "webhook_endpoint_created"
| "webhook_endpoint_updated"
| "webhook_endpoint_deleted"
| "attribute_provider_created"
| "attribute_provider_updated"
| "attribute_provider_deleted";
export type AuditActorType = "user" | "client" | "system";
// Keep the existing table name to avoid a migration
@Entity("tenant_action_log")
export class AuditLogEntity {
@PrimaryGeneratedColumn("uuid")
id!: string;
@Index()
@Column("varchar")
tenantId!: string;
@CreateDateColumn()
timestamp!: Date;
@Column("varchar")
actionType!: AuditActionType;
@Column("varchar")
actorType!: AuditActorType;
@Column("varchar", { nullable: true })
actorId?: string;
@Column("varchar", { nullable: true })
actorDisplay?: string;
@Column("json", { nullable: true })
changedFields?: string[];
@Column("json", { nullable: true })
before?: Record<string, unknown>;
@Column("json", { nullable: true })
after?: Record<string, unknown>;
@Column("varchar", { nullable: true })
requestId?: string;
}