/**
 * Minified by jsDelivr using Terser v5.37.0.
 * Original file: /npm/dynamic-route-generator@1.5.1/build/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const events=require("events"),error_1=require("./error"),exceptions_1=require("./exceptions"),plugin_support_1=require("./plugin-support"),route_1=require("./route/route");class RouteGenerator{constructor(e){this.event=new events.EventEmitter,this.options=Object.assign({app:void 0,baseUri:"/",database:e.database||"mongo",plugins:[],routes:[]},e),this.instantiate()}instantiate(){try{new plugin_support_1.PluginSupport(this.options,this.event),this.appInstanceIsPresent()&&this.routesArePresent()&&this.options.routes.forEach((e=>new route_1.Route(this.options,e))),this.event.emit("post-plugins")}catch(e){error_1.ErrorHandler.handleError(e)}}appInstanceIsPresent(){if(!this.options.app||"function"!=typeof this.options.app)throw new Error("Your must provide an instance of your application to assign routes to");return!0}routesArePresent(){if(!this.options.routes)throw new Error("You must provide a route property");return!0}}module.exports={BadRequest:exceptions_1.BadRequest,Forbidden:exceptions_1.Forbidden,InternalServerError:exceptions_1.InternalServerError,NotFound:exceptions_1.NotFound,RouteGenerator:RouteGenerator,Unauthorized:exceptions_1.Unauthorized};
//# sourceMappingURL=/sm/a7bd9a310ccdf84270306850648f6e90bc4f31556cca0054000b5af4fdff4c28.map