Path: blob/main/components/gitpod-db/src/audit-log-db.ts
2498 views
/**1* Copyright (c) 2024 Gitpod GmbH. All rights reserved.2* Licensed under the GNU Affero General Public License (AGPL).3* See License.AGPL.txt in the project root for license information.4*/56import { AuditLog } from "@gitpod/gitpod-protocol/lib/audit-log";78export const AuditLogDB = Symbol("AuditLogDB");910export interface AuditLogDB {11/**12* Records an audit log entry.13*14* @param logEntry15*/16recordAuditLog(logEntry: AuditLog): Promise<void>;1718/**19* Lists audit logs.20*21* @param organizationId22* @param params23*/24listAuditLogs(25organizationId: string,26params?: {27from?: string;28to?: string;29actorId?: string;30action?: string;31pagination?: {32offset?: number;33// must not be larger than 250, default is 10034limit?: number;35};36},37): Promise<AuditLog[]>;3839/**40* Purges audit logs older than the given date.41*42* @param before ISO 8601 date string43*/44purgeAuditLogs(before: string, organizationId?: string): Promise<number>;45}464748