@dedel.alex/adonis6-swagger
Version:
Swagger provider for AdonisJS 6
25 lines (24 loc) • 726 B
TypeScript
import swaggerJSDoc from 'swagger-jsdoc';
export type SwaggerMode = 'PRODUCTION' | 'RUNTIME';
export type CredentialsCheckFunction = (login: string, password: string) => Promise<boolean> | boolean;
export type AuthCredentials = {
login: string;
password: string;
};
export type SwaggerAuthConfig = {
authMiddleware: string;
authCheck?: CredentialsCheckFunction;
authCredentials?: AuthCredentials;
};
export interface SwaggerConfig {
uiEnabled: boolean;
uiUrl: string;
specEnabled: boolean;
specUrl: string;
middleware: string[];
options: swaggerJSDoc.Options;
specFilePath?: string;
mode?: SwaggerMode;
swaggerUiDistPath?: string;
swaggerAuth?: SwaggerAuthConfig;
}