managarten/services/mana-api-gateway/src/api-keys/dto/update-api-key.dto.ts
Till-JS fc0ed636fc feat(api-gateway): add Swagger, admin endpoints, and scheduler
- Add Swagger/OpenAPI documentation at /docs endpoint
- Add admin module for system-wide API key management
- Add scheduler for monthly credit reset and usage cleanup
- Add Docker Compose entry for Mac Mini deployment
- Document all endpoints with descriptions and examples
2026-01-29 18:03:16 +01:00

56 lines
1.2 KiB
TypeScript

import { IsString, IsOptional, IsBoolean, IsArray, IsDateString } from 'class-validator';
import { ApiPropertyOptional } from '@nestjs/swagger';
export class UpdateApiKeyDto {
@ApiPropertyOptional({
description: 'Update the display name',
example: 'Updated API Key Name',
})
@IsString()
@IsOptional()
name?: string;
@ApiPropertyOptional({
description: 'Update the description',
example: 'Updated description for this key',
})
@IsString()
@IsOptional()
description?: string;
@ApiPropertyOptional({
description: 'Update allowed endpoints',
example: ['search', 'stt', 'tts'],
type: [String],
})
@IsArray()
@IsString({ each: true })
@IsOptional()
allowedEndpoints?: string[];
@ApiPropertyOptional({
description: 'Update IP whitelist',
example: ['192.168.1.0/24'],
type: [String],
})
@IsArray()
@IsString({ each: true })
@IsOptional()
allowedIps?: string[];
@ApiPropertyOptional({
description: 'Enable or disable the API key',
example: true,
})
@IsBoolean()
@IsOptional()
active?: boolean;
@ApiPropertyOptional({
description: 'Update expiration date (ISO 8601)',
example: '2025-12-31T23:59:59Z',
})
@IsDateString()
@IsOptional()
expiresAt?: string;
}