mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
feat: api key dto docs
This commit is contained in:
52
packages/server/src/modules/Auth/dtos/ApiKey.dto.ts
Normal file
52
packages/server/src/modules/Auth/dtos/ApiKey.dto.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class ApiKeyResponseDto {
|
||||
@ApiProperty({ example: 1, description: 'API key ID' })
|
||||
id: number;
|
||||
|
||||
@ApiProperty({
|
||||
example: 'bc_1234567890abcdef',
|
||||
description: 'The API key string',
|
||||
})
|
||||
key: string;
|
||||
}
|
||||
|
||||
export class ApiKeyRevokeResponseDto {
|
||||
@ApiProperty({ example: 1, description: 'API key ID' })
|
||||
id: number;
|
||||
|
||||
@ApiProperty({
|
||||
example: true,
|
||||
description: 'Whether the API key was revoked',
|
||||
})
|
||||
revoked: boolean;
|
||||
}
|
||||
|
||||
export class ApiKeyListItemDto {
|
||||
@ApiProperty({ example: 1, description: 'API key ID' })
|
||||
id: number;
|
||||
|
||||
@ApiProperty({ example: 'My API Key', description: 'API key name' })
|
||||
name?: string;
|
||||
|
||||
@ApiProperty({
|
||||
example: '2024-01-01T00:00:00.000Z',
|
||||
description: 'Creation date',
|
||||
})
|
||||
createdAt: Date;
|
||||
|
||||
@ApiProperty({
|
||||
example: '2024-12-31T23:59:59.000Z',
|
||||
required: false,
|
||||
description: 'Expiration date',
|
||||
})
|
||||
expiresAt?: Date;
|
||||
|
||||
@ApiProperty({ example: false, description: 'Whether the key is revoked' })
|
||||
revoked: boolean;
|
||||
}
|
||||
|
||||
export class ApiKeyListResponseDto {
|
||||
@ApiProperty({ type: [ApiKeyListItemDto] })
|
||||
data: ApiKeyListItemDto[];
|
||||
}
|
||||
Reference in New Issue
Block a user