import { SmrtCollection } from '@happyvertical/smrt-core'; import { SecretAuditAction, SecretAuditLog, SecretAuditResult } from '../models/SecretAuditLog.js'; /** * Options for listing audit logs */ export interface ListAuditLogsOptions { /** * Scope results to a single tenant's audit trail. Tenant-facing callers * (e.g. SecretService.getAuditLogs) must always set this — audit rows * reference secret names and must not leak across tenants (issue #1501). * Omit only for cross-tenant compliance tooling running under * withSuperAdminBypass(). */ tenantId?: string; /** Filter by secret name */ secretName?: string; /** Filter by user ID */ userId?: string; /** Filter by action type */ action?: SecretAuditAction; /** Filter by result */ result?: SecretAuditResult; /** Filter by date range start */ since?: Date; /** Filter by date range end */ until?: Date; /** Maximum number of results */ limit?: number; /** Offset for pagination */ offset?: number; } /** * Collection for managing SecretAuditLog objects */ export declare class SecretAuditLogCollection extends SmrtCollection { static readonly _itemClass: typeof SecretAuditLog; /** * List audit logs with filtering options */ listLogs(options?: ListAuditLogsOptions): Promise; /** * Get audit logs for a specific secret. * * @param tenantId - Scope to this tenant's audit trail, or `null` for a * cross-tenant compliance query (which must run under * `withSuperAdminBypass()` from `@happyvertical/smrt-tenancy`). Audit rows * reference secret names and must not leak across tenants (#1503). */ getSecretHistory(tenantId: string | null, secretName: string, limit?: number): Promise; /** * Get audit logs for a specific user. * * @param tenantId - Scope to this tenant's audit trail, or `null` for a * cross-tenant compliance query under `withSuperAdminBypass()` (#1503). */ getUserActivity(tenantId: string | null, userId: string, limit?: number): Promise; /** * Get recent failures. * * @param tenantId - Scope to this tenant's audit trail, or `null` for a * cross-tenant compliance query under `withSuperAdminBypass()` (#1503). */ getRecentFailures(tenantId: string | null, limit?: number): Promise; /** * Get recent denied access attempts. * * @param tenantId - Scope to this tenant's audit trail, or `null` for a * cross-tenant compliance query under `withSuperAdminBypass()` (#1503). */ getRecentDenials(tenantId: string | null, limit?: number): Promise; /** * Count operations by action type. * * @param tenantId - Scope to this tenant's audit trail, or `null` for a * cross-tenant compliance count under `withSuperAdminBypass()` (#1503). */ countByAction(tenantId: string | null, since?: Date): Promise>; /** * Count operations by result. * * @param tenantId - Scope to this tenant's audit trail, or `null` for a * cross-tenant compliance count under `withSuperAdminBypass()` (#1503). */ countByResult(tenantId: string | null, since?: Date): Promise>; /** * Delete old audit logs * @param olderThanDays Delete logs older than this many days */ cleanup(olderThanDays?: number): Promise; } //# sourceMappingURL=SecretAuditLogCollection.d.ts.map