-
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90be033
commit 1e9d5bb
Showing
12 changed files
with
0 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,15 @@ | ||
import { ApiProperty } from '@nestjs/swagger' | ||
import { ApiKey, Authority } from '@prisma/client' | ||
import { IsArray, IsOptional, IsString } from 'class-validator' | ||
|
||
export class CreateApiKey { | ||
@IsString() | ||
@ApiProperty({ | ||
name: 'name', | ||
description: 'Name of the API key', | ||
required: true, | ||
type: String, | ||
example: 'My API Key' | ||
}) | ||
name: ApiKey['name'] | ||
|
||
@IsString() | ||
@IsOptional() | ||
@ApiProperty({ | ||
name: 'expiresAfter', | ||
description: 'API key expiration time in hours', | ||
required: false, | ||
type: String, | ||
example: '24', | ||
default: 'never' | ||
}) | ||
expiresAfter?: '24' | '168' | '720' | '8760' | 'never' = 'never' | ||
|
||
@IsArray() | ||
@IsOptional() | ||
@ApiProperty({ | ||
name: 'authorities', | ||
description: 'API key authorities', | ||
required: false, | ||
type: [String], | ||
example: ['READ_SELF', 'UPDATE_SELF'], | ||
default: [] | ||
}) | ||
authorities?: Authority[] = [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.