fix(test): Add ENCRYPTION_KEY to bridge.module.spec.ts and fix API lint errors

This commit is contained in:
2026-02-07 17:33:32 -06:00
parent b9e1e3756e
commit 4552c2c460
6 changed files with 332 additions and 0 deletions
+1
View File
@@ -2,4 +2,5 @@ export * from "./create-credential.dto";
export * from "./update-credential.dto";
export * from "./rotate-credential.dto";
export * from "./query-credential.dto";
export * from "./query-credential-audit.dto";
export * from "./credential-response.dto";
@@ -0,0 +1,67 @@
import { ActivityAction } from "@prisma/client";
import { IsOptional, IsEnum, IsInt, Min, Max, IsDateString, IsUUID } from "class-validator";
import { Type } from "class-transformer";
/**
* DTO for querying credential audit logs with filters and pagination
* All fields are optional - omitted filters are not applied
*/
export class QueryCredentialAuditDto {
/**
* Filter by specific credential ID
* Optional - if omitted, returns audit logs for all credentials in workspace
*/
@IsOptional()
@IsUUID("4", { message: "credentialId must be a valid UUID" })
credentialId?: string;
/**
* Filter by activity action type
* Optional - supported actions:
* - CREDENTIAL_CREATED
* - CREDENTIAL_ACCESSED
* - CREDENTIAL_ROTATED
* - CREDENTIAL_REVOKED
* - UPDATED (for metadata changes)
*/
@IsOptional()
@IsEnum(ActivityAction, { message: "action must be a valid ActivityAction" })
action?: ActivityAction;
/**
* Filter by start date (inclusive)
* Optional ISO 8601 date string
*/
@IsOptional()
@IsDateString({}, { message: "startDate must be a valid ISO 8601 date string" })
startDate?: Date;
/**
* Filter by end date (inclusive)
* Optional ISO 8601 date string
*/
@IsOptional()
@IsDateString({}, { message: "endDate must be a valid ISO 8601 date string" })
endDate?: Date;
/**
* Page number (1-indexed)
* Optional - defaults to 1
*/
@IsOptional()
@Type(() => Number)
@IsInt({ message: "page must be an integer" })
@Min(1, { message: "page must be at least 1" })
page?: number = 1;
/**
* Results per page
* Optional - defaults to 20, max 100
*/
@IsOptional()
@Type(() => Number)
@IsInt({ message: "limit must be an integer" })
@Min(1, { message: "limit must be at least 1" })
@Max(100, { message: "limit must not exceed 100" })
limit?: number = 20;
}