-
Notifications
You must be signed in to change notification settings - Fork 0
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
9a8ae45
commit 054a9ba
Showing
12 changed files
with
83 additions
and
43 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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { OS3Security } from '@tsed/openspec'; | ||
import { EnumObject, SwaggerSecurityScheme } from '../types'; | ||
|
||
export const SWAGGER_SECURITY_SCHEMES: EnumObject<SwaggerSecurityScheme, OS3Security> = { | ||
[SwaggerSecurityScheme.BEARER_JWT]: { | ||
type: 'http', | ||
scheme: 'bearer', | ||
bearerFormat: 'JWT', | ||
description: 'Bearer JWT token' | ||
}, | ||
[SwaggerSecurityScheme.BASIC]: { | ||
type: 'http', | ||
scheme: 'basic', | ||
description: 'Basic authentication' | ||
} | ||
}; |
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
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
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,9 +1,9 @@ | ||
import { Type } from '@tsed/core'; | ||
import { SwaggerDocsVersion } from './SwaggerDocsVersion.enum'; | ||
import { SwaggerDocConfig } from './ConfigSwaggerOptions'; | ||
|
||
export type ConfigLoaderOptions<T = object> = { | ||
service: string; | ||
port: number; | ||
configModel: Type<T>; | ||
generateDocs?: SwaggerDocsVersion[]; | ||
swagger?: SwaggerDocConfig[]; | ||
}; |
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,8 +1,14 @@ | ||
import { SwaggerDocsVersion } from './SwaggerDocsVersion.enum'; | ||
import { SwaggerSecurityScheme } from './SwaggerSecurityScheme.enum'; | ||
|
||
export type SwaggerDocConfig = { | ||
doc: SwaggerDocsVersion; | ||
security: SwaggerSecurityScheme[]; | ||
}; | ||
|
||
export type ConfigSwaggerOptions = { | ||
title: string; | ||
version: string; | ||
description: string; | ||
generateDocs: SwaggerDocsVersion[]; | ||
swagger: SwaggerDocConfig[]; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export type EnumObject<TKey extends string | symbol | number, TType> = { [key in TKey]: TType }; |
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