src/auth/dto/create-api-key.dto.ts
Properties |
|
| Optional expiresAt |
Type : string
|
Decorators :
@ApiPropertyOptional({example: '2027-01-01T00:00:00.000Z', description: 'Optional expiration date'})
|
|
Defined in src/auth/dto/create-api-key.dto.ts:21
|
| name |
Type : string
|
Decorators :
@ApiProperty({example: 'ERP Integration', description: 'Human-readable name for this API key'})
|
|
Defined in src/auth/dto/create-api-key.dto.ts:7
|
| permissions |
Type : string[]
|
Decorators :
@ApiProperty({example: undefined, description: 'Permission scopes granted to this key'})
|
|
Defined in src/auth/dto/create-api-key.dto.ts:16
|
import { IsString, IsArray, IsOptional, IsDateString, ArrayNotEmpty } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
export class CreateApiKeyDto {
@ApiProperty({ example: 'ERP Integration', description: 'Human-readable name for this API key' })
@IsString()
name: string;
@ApiProperty({
example: ['orders:read', 'orders:write', 'vehicles:read'],
description: 'Permission scopes granted to this key',
})
@IsArray()
@ArrayNotEmpty()
@IsString({ each: true })
permissions: string[];
@ApiPropertyOptional({ example: '2027-01-01T00:00:00.000Z', description: 'Optional expiration date' })
@IsOptional()
@IsDateString()
expiresAt?: string;
}