adonis5-swagger
Version:
Swagger provider for AdonisJS 5
28 lines (27 loc) • 875 B
TypeScript
/// <reference types="swagger-jsdoc" />
declare module '@ioc:Adonis/Addons/Swagger' {
import swaggerJSDoc from 'swagger-jsdoc';
type SwaggerMode = 'PRODUCTION' | 'RUNTIME';
type CredentialsCheckFunction = (login: string, password: string) => Promise<boolean> | boolean;
type AuthCredentials = {
login: string;
password: string;
};
type SwaggerAuthConfig = {
authMiddleware: string;
authCheck?: CredentialsCheckFunction;
authCredentials?: AuthCredentials;
};
interface SwaggerConfig {
uiEnabled: boolean;
uiUrl: string;
specEnabled: boolean;
specUrl: string;
middleware: string[];
options: swaggerJSDoc.Options;
specFilePath?: string;
mode?: SwaggerMode;
swaggerUiDistPath?: string;
swaggerAuth?: SwaggerAuthConfig;
}
}