/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/swagger-autogen-doc@1.0.4/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
const Parser=require("./parser/Parser"),SwaggerSchemeGenerator=require("./doc-generate/swagger-generator"),Options=require("./common/options"),BasicAuth=require("./auth/prototypes/BasicAuth"),BearerAuth=require("./auth/prototypes/BearerAuth"),ApiKeyAuth=require("./auth/prototypes/ApiKeyAuth"),run=require("./listeners/run"),swaggerUI=require("swagger-ui-express"),ApiRepository=require("./repositories/api-repositories"),SchemaRepository=require("./repositories/schem-repositories"),hotLoad=require("./middleware/hot-load");class SwaggerAutogen{constructor(e,r){this.options=r,this.app=e,this.parser=new Parser(this.options),this.pathToSwaggerDoc=r.absolutePath+r.pathDoc.slice(1),this.url=this.options.endpointSwagger,this.openapi={swagger:"2.0",info:{title:"API on Express",version:"1.0.0",description:""},schemes:["http","https"]},0!=r.foldersSchems.length&&SchemaRepository.addFromFolder(r.foldersSchems),r.Title&&(this.openapi.info.title=r.Title),r.Version&&(this.openapi.info.version=r.Version),r.Description&&(this.openapi.info.description=r.Description),r.Schemes&&(this.openapi.schemes=r.Schemes)}Use(){let e=this.parser.parse(this.options.folderApi),r=new SwaggerSchemeGenerator(this.openapi,e,this.options).writeDoc();this.app.use(this.url,hotLoad(this.pathToSwaggerDoc),swaggerUI.serveFiles(r),swaggerUI.setup()),console.log("The endpoint swagger docs: "+this.url),this.app.on("run",run(this.pathToSwaggerDoc))}}const swaggerApi=function(e,r=null){return ApiRepository.add({api:e,auth:r}),e};module.exports={swaggerApi:swaggerApi,Swagger:SwaggerAutogen,OptionsSwagger:Options,AuthTypes:{BasicAuth:BasicAuth,BearerAuth:BearerAuth,ApiKeyAuth:ApiKeyAuth},configure:function(e,r,s){let t=new Options(r,s);new SwaggerAutogen(e,t).Use()}};
//# sourceMappingURL=/sm/354887a89842a8857f0fc04abbdb2a431cf2dcc178ea5f50d9ef6bbd1b125904.map