mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-27 15:12:53 +02:00
- 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
56 lines
1.2 KiB
TypeScript
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;
|
|
}
|