From 7130fc7a973963a0853e3cf6c368343248fcc86f Mon Sep 17 00:00:00 2001 From: Azure Pipelines Date: Thu, 15 Aug 2019 21:51:54 +0000 Subject: [PATCH] Docs build: 8fb1006fb25287dfb6bc70c083c20d8ce68ad7e9 --- IncomingMessage-ServerResponse-refactor.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IncomingMessage-ServerResponse-refactor.json b/IncomingMessage-ServerResponse-refactor.json index 4f1ad6d9..7c823fc4 100644 --- a/IncomingMessage-ServerResponse-refactor.json +++ b/IncomingMessage-ServerResponse-refactor.json @@ -1 +1 @@ -{"meta":{"generator":"0.0.1","format":19},"custom":{"Getting Started":{"name":"Getting Started","files":{"GettingStarted":{"name":"Getting Started","type":"md","content":"## Getting Started\n\nplaceholder\n","path":"guides/Getting Started/GettingStarted.md"}}},"Piece Basics":{"name":"Piece Basics","files":{"CreatingRoutes":{"name":"Creating Routes","type":"md","content":"Routes are http request/response handlers for the route specfied. New routes are created in the `./routes/` folder.\n\n```javascript\nconst { Route } = require('klasa-dashboard-hooks');\n\nmodule.exports = class extends Route {\n\n\tconstructor(...args) {\n\t\tsuper(...args, {\n\t\t\troute: '/',\n\t\t\tauthenticated: false\n\t\t});\n\t}\n\n\tget(request, response) {\n\t\t// This is where you place the code you want to run for get requests\n\t}\n\n\tpost(request, response) {\n\t\t// This is where you place the code you want to run for post requests\n\t}\n\n\tpatch(request, response) {\n\t\t// This is where you place the code you want to run for patch requests\n\t}\n\n\tdelete(request, response) {\n\t\t// This is where you place the code you want to run for delete requests\n\t}\n\n\t// ect\n\n};\n```\n\nThe http methods in {@link Route} takes 2 parameters:\n\n| Name | Type | Description |\n| ---------------- | -------------------------------- | -------------------------- |\n| **request** | {@link KlasaIncomingMessage} | The incomming request |\n| **response** | {@link external:ServerResponse} | The outgoing response |\n\n```javascript\nconst { Route } = require('klasa-dashboard-hooks');\n\nmodule.exports = class extends Route {\n\n\tconstructor(...args) {\n\t\tsuper(...args, { route: 'users' });\n\t}\n\n\tget(request, response) {\n\t\treturn response.end(JSON.stringify(this.client.users.keyArray()));\n\t}\n\n};\n```\n\nHow does the route work?\n\n1. A get request is made to your api at the `/users` route like: api.yourdomain.com/users\n2. After all {@link Middleware} have run, the code in the get method is run.\n3. You end the response with strinified json of the `this.client.users.keyArray()`\n\nStatic routes are all and good, but you are more likely going to need some dynamic routes too:\n\n```javascript\nconst { Route } = require('klasa-dashboard-hooks');\n\nmodule.exports = class extends Route {\n\n\tconstructor(...args) {\n\t\tsuper(...args, { route: 'users/:userID' });\n\t}\n\n\tget(request, response) {\n\t\tconst { userID } = request.params;\n\t\tconst user = this.client.users.get(userID);\n\t\tif (!user) response.end('{}');\n\t\treturn response.end(JSON.stringify(user));\n\t}\n\n};\n```\n\n>Note the colon in front of the userID portion of the route\n\nHow does the new route work?\n\n1. A get request is made to your api at the `/users/:userID` route like: api.yourdomain.com/users/167383252271628289\n2. After all {@link Middleware} have run, the code in the get method is run.\n3. You access the userID variable from the `request.params`\n4. After trying to get the user from your cache, you either respond with `'{}'` or the stringified user.\n\n# Further reading\n\n- {@tutorial CreatingMiddlewares}\n","path":"guides/Piece Basics/CreatingRoutes.md"},"CreatingMiddlewares":{"name":"Creating Middlewares","type":"md","content":"Middlewares are http middleware handlers that run on all routes. New middlewares are created in the `./middlewares/` folder.\n\n```javascript\nconst { Middleware } = require('klasa-dashboard-hooks');\n\nmodule.exports = class extends Middleware {\n\n\tasync run(request, response, route) {\n\t\t// This is where you place the code you want to run on all routes\n\t}\n\n};\n```\n\nThe run method in {@link Middleware} takes 3 parameters:\n\n| Name | Type | Description |\n| ---------------- | -------------------------------- | -------------------------- |\n| **request** | {@link KlasaIncomingMessage} | The incomming request |\n| **response** | {@link external:ServerResponse} | The outgoing response |\n| **route** | {@link Route} | The route being run |\n\n```javascript\nconst { Middleware } = require('klasa-dashboard-hooks');\n\nmodule.exports = class extends Middleware {\n\n\trun(request, response) {\n\t\tresponse.setHeader('Content-Type', 'application/json');\n\t}\n\n};\n```\n\nHow does the middleware work?\n\n1. A request is made to your api\n2. Since we are making a json api, we want to set the header in a way that clients know we are responding with json\n3. The method is implicently resolved, and the next {@link Middleware} is run, or finally the {@link Route}.\n\n>Note: the {@link Middleware#run()} may be async/return a promise as well.\n\n# Further reading\n\n- {@tutorial CreatingRoutes}\n","path":"guides/Piece Basics/CreatingMiddlewares.md"}}}},"classes":[{"name":"DashboardClient","description":"The client for handling everything. See {@tutorial GettingStarted} for more information how to get started using this class.","extends":["external:KlasaClient"],"construct":{"name":"DashboardClient","description":"Constructs the klasa-dashboard-hooks client","params":[{"name":"config","description":"The config to pass to the new client","type":[[["DashboardClientOptions"]]]}]},"props":[{"name":"server","description":"The http server handler for the api","type":[[["Server"]]],"meta":{"line":46,"file":"Client.js","path":"src/lib"},"since":"0.0.1"},{"name":"routes","description":"The cache where routes are stored","type":[[["RouteStore"]]],"meta":{"line":54,"file":"Client.js","path":"src/lib"},"since":"0.0.1"},{"name":"middlewares","description":"The cache where middlewares are stored","type":[[["MiddlewareStore"]]],"meta":{"line":62,"file":"Client.js","path":"src/lib"},"since":"0.0.1"},{"name":"dashboardUsers","description":"The cache where oauth data is temporarily stored","type":[[["DataStore"]]],"meta":{"line":70,"file":"Client.js","path":"src/lib"},"since":"0.0.1"}],"meta":{"line":38,"file":"Client.js","path":"src/lib"}},{"name":"KlasaIncomingMessage","description":"The custom class for KDH's incoming messages","extends":["external:IncomingMessage"],"construct":{"name":"KlasaIncomingMessage","params":[{"name":"socket","description":"The net.Socket","type":[[["external:Socket"]]]}]},"props":[{"name":"originalUrl","description":"The original url (automatic redirects)","type":[[["string"]]],"meta":{"line":25,"file":"KlasaIncomingMessage.js","path":"src/lib/http"}},{"name":"path","description":"The path of the url","type":[[["string"]]],"meta":{"line":31,"file":"KlasaIncomingMessage.js","path":"src/lib/http"}},{"name":"search","description":"The search string of the url","type":[[["string"]]],"meta":{"line":37,"file":"KlasaIncomingMessage.js","path":"src/lib/http"}},{"name":"query","description":"The parsed queury of the search string","type":[[["any"]]],"meta":{"line":43,"file":"KlasaIncomingMessage.js","path":"src/lib/http"}},{"name":"params","description":"The parsed params from the url","type":[[["any"]]],"meta":{"line":49,"file":"KlasaIncomingMessage.js","path":"src/lib/http"}},{"name":"route","description":"The Route this incoming message is for","type":[[["Route"]]],"meta":{"line":55,"file":"KlasaIncomingMessage.js","path":"src/lib/http"}},{"name":"methodLower","description":"The lowercase method name","readonly":true,"type":[[["string"]]],"meta":{"line":63,"file":"KlasaIncomingMessage.js","path":"src/lib/http"}}],"methods":[{"name":"execute","description":"Executes the Route this message is for","params":[{"name":"response","description":"The response object","type":[[["KlasaServerResponse"]]]}],"returns":[[["any"]]],"meta":{"line":72,"file":"KlasaIncomingMessage.js","path":"src/lib/http"}},{"name":"init","description":"Initializes this message for the Route","params":[{"name":"client","description":"The Klasa Client","type":[[["external:KlasaClient"]]]}],"meta":{"line":80,"file":"KlasaIncomingMessage.js","path":"src/lib/http"}}],"meta":{"line":16,"file":"KlasaIncomingMessage.js","path":"src/lib/http"}},{"name":"KlasaServerResponse","description":"The server response for KDH","extends":["external:ServerResponse"],"methods":[{"name":"status","description":"Sets the status code of this response","params":[{"name":"code","description":"The status code to set the response to","type":[[["number"]]]}],"returns":[[["this"]]],"meta":{"line":14,"file":"KlasaServerResponse.js","path":"src/lib/http"}},{"name":"json","description":"Ends the response with JSON.stringified data","params":[{"name":"data","description":"The data to respond with","type":[[["any"]]]}],"returns":[[["any"]]],"meta":{"line":24,"file":"KlasaServerResponse.js","path":"src/lib/http"}}],"meta":{"line":7,"file":"KlasaServerResponse.js","path":"src/lib/http"}},{"name":"Server","description":"The http server for klasa-dashboard-hooks","construct":{"name":"Server","params":[{"name":"client","description":"The Klasa client","type":[[["DashboardClient"]]]}]},"props":[{"name":"client","description":"The Client that manages this Server instance","type":[[["DashboardClient"]]],"meta":{"line":44,"file":"Server.js","path":"src/lib/http"},"since":"0.0.1"},{"name":"server","description":"The http.Server instance that manages the HTTP requests","type":[[["external:HTTPServer"]]],"meta":{"line":51,"file":"Server.js","path":"src/lib/http"},"since":"0.0.1"},{"name":"onNoMatch","description":"The onError function called when a url does not match","type":[[["function"]]],"meta":{"line":60,"file":"Server.js","path":"src/lib/http"},"since":"0.0.1"}],"methods":[{"name":"listen","description":"Starts the server listening to a port","params":[{"name":"port","description":"The port to run the server on","type":[[["number"]]]}],"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":68,"file":"Server.js","path":"src/lib/http"}},{"name":"handler","description":"The handler for incoming requests","params":[{"name":"request","description":"The request","type":[[["external:IncomingMessage"]]]},{"name":"response","description":"The response","type":[[["external:ServerResponse"]]]}],"async":true,"meta":{"line":80,"file":"Server.js","path":"src/lib/http"}},{"name":"onError","description":"The handler for errors","params":[{"name":"error","description":"The error","type":[[["Error"]],[["ErrorLike"]]]},{"name":"request","description":"The request","type":[[["KlasaIncomingMessage"]]]},{"name":"response","description":"The response","type":[[["external:ServerResponse"]]]}],"meta":{"line":98,"file":"Server.js","path":"src/lib/http"}}],"meta":{"line":37,"file":"Server.js","path":"src/lib/http"}},{"name":"DashboardGuild","description":"Represents an OAuthGuild","construct":{"name":"DashboardGuild","params":[{"name":"client","description":"The Dashboard Client","type":[[["DashboardClient"]]]},{"name":"guild","description":"The raw guild data","type":[[["Object"]]]},{"name":"user","description":"The OAuth User this Guild is for","type":[[["DashboardUser"]]]}]},"props":[{"name":"client","description":"The DashboardClient","type":[[["DashboardClient"]]],"meta":{"line":30,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"user","description":"The OAuth User this DashboardGuild is for","type":[[["DashboardUser"]]],"meta":{"line":37,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"id","description":"The guild id","type":[[["string"]]],"meta":{"line":44,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"name","description":"The guild name","type":[[["string"]]],"meta":{"line":51,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"icon","description":"The guild icon hash","nullable":true,"type":[[["string"]]],"meta":{"line":58,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"userIsOwner","description":"If the logged in OAuthUser is the owner of the guild","type":[[["boolean"]]],"meta":{"line":65,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"userGuildPermissions","description":"The guild permissions for the logged in OAuthUser","type":[[["external:Permissions"]]],"meta":{"line":72,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"userCanManage","description":"If the logged in OAuthUser can manage the guild (invite bots)","type":[[["boolean"]]],"meta":{"line":79,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"iconURL","description":"The url for the guild's icon","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":88,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"guild","description":"The guild for this DashboardGuild","readonly":true,"nullable":true,"type":[[["external:KlasaGuild"]]],"meta":{"line":101,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"}],"methods":[{"name":"toJSON","description":"The toJSON behavior of this structure","returns":[[["DashboardGuildJSON"]]],"meta":{"line":110,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"}],"meta":{"line":24,"file":"DashboardGuild.js","path":"src/lib/structures"}},{"name":"DashboardUser","description":"Represents an OAuth User","construct":{"name":"DashboardUser","params":[{"name":"client","description":"The client","type":[[["DashboardClient"]]]},{"name":"user","description":"The raw user data","type":[[["Object"]]]}]},"props":[{"name":"client","description":"The DashboardClient","type":[[["DashboardClient"]]],"meta":{"line":31,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"id","description":"The id of the OAuth User","type":[[["string"]]],"meta":{"line":38,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"username","description":"The username of the OAuth User","type":[[["string"]]],"meta":{"line":45,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"discriminator","description":"The discriminator of the OAuth User","type":[[["number"]]],"meta":{"line":52,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"locale","description":"The language of the OAuth User","type":[[["string"]]],"meta":{"line":59,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"mfaEnabled","description":"If the OAuth User has multi-factor Authentication enabled","type":[[["boolean"]]],"meta":{"line":66,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"avatar","description":"The OAuth User's avatar hash","type":[[["string"]]],"meta":{"line":73,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"guilds","description":"The collection of OAuth Guilds this OAuth User is in","type":[[["external:Collection","<"],["external:snowflake",", "],["DashboardGuild",">"]]],"meta":{"line":80,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"avatarURL","description":"The Avatar URL for this OAuth User","readonly":true,"type":[[["string"]]],"meta":{"line":91,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"user","description":"The User for this OAuth User","readonly":true,"type":[[["external:KlasaUser"]]],"meta":{"line":104,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"}],"methods":[{"name":"toJSON","description":"The toJSON behavior of this Object","returns":[[["DashboardUserJSON"]]],"meta":{"line":113,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"setupGuilds","description":"Setups all DashboardGuilds for the passed in Dashboard User","scope":"static","access":"private","params":[{"name":"dashboardUser","description":"The dashboard user guilds are being setup for","type":[[["DashboardUser"]]]},{"name":"guilds","description":"The raw guild data to setup","type":[[["Array","<"],["Object",">"]]]}],"returns":[[["void"]]],"meta":{"line":135,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"}],"meta":{"line":25,"file":"DashboardUser.js","path":"src/lib/structures"}},{"name":"Middleware","description":"Base class for all Klasa Middleware. See {@tutorial CreatingMiddlewares} for more information how to use this class\nto build custom events.","extends":["external:Piece"],"construct":{"name":"Middleware","params":[{"name":"client","description":"The Klasa client","type":[[["DashboardClient"]]]},{"name":"store","description":"The Middleware Store","type":[[["MiddlewareStore"]]]},{"name":"file","description":"The path from the pieces folder to the middleware file","type":[[["string"]]]},{"name":"core","description":"If the piece is in the core directory or not","type":[[["boolean"]]]},{"name":"options","description":"Optional Middleware settings","optional":true,"default":"{}","type":[[["MiddlewareOptions"]]]}]},"props":[{"name":"priority","description":"The priority in which this middleware should run","type":[[["number"]]],"meta":{"line":33,"file":"Middleware.js","path":"src/lib/structures"},"since":"0.0.1"}],"methods":[{"name":"run","description":"The run method to be overwritten in actual event handlers","abstract":true,"params":[{"name":"request","description":"The http request","type":[[["KlasaIncomingMessage"]]]},{"name":"response","description":"The http response","type":[[["external:ServerResponse"]]]},{"name":"route","description":"The route being run","nullable":true,"type":[[["Route"]]]}],"returns":[[["Promise","<"],["void",">"]]],"async":true,"meta":{"line":45,"file":"Middleware.js","path":"src/lib/structures"},"since":"0.0.1"}],"meta":{"line":25,"file":"Middleware.js","path":"src/lib/structures"}},{"name":"MiddlewareStore","description":"Stores all the middlewares that are part of Klasa-dashboard-hooks","extends":["external:Store"],"construct":{"name":"MiddlewareStore","params":[{"name":"client","description":"The Klasa client","type":[[["DashboardClient"]]]}]},"props":[{"name":"sortedMiddlwares","description":"The middlewares sorted by priority","type":[[["Array","<"],["Middleware",">"]]],"meta":{"line":22,"file":"MiddlewareStore.js","path":"src/lib/structures"}}],"methods":[{"name":"clear","description":"Clears the RouteStore","returns":[[["void"]]],"meta":{"line":30,"file":"MiddlewareStore.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"set","description":"Adds a Middleware to this MiddlewareStore","params":[{"name":"piece","description":"The Middleware to add to this store","type":[[["Middleware"]]]}],"returns":[[["Middleware"]]],"meta":{"line":40,"file":"MiddlewareStore.js","path":"src/lib/structures"}},{"name":"delete","description":"Deletes a Middleware from this MiddlewareStore","params":[{"name":"name","description":"The name of the Middleware or the Middleware","type":[[["Middleware"]],[["string"]]]}],"returns":[[["boolean"]]],"meta":{"line":55,"file":"MiddlewareStore.js","path":"src/lib/structures"}},{"name":"run","description":"Runs all the middleware.","params":[{"name":"request","description":"The http request","type":[[["KlasaIncomingMessage"]]]},{"name":"response","description":"The http response","type":[[["external:ServerResponse"]]]},{"name":"route","description":"The route being run","nullable":true,"type":[[["Route"]]]}],"returns":[[["Promise","<"],["void",">"]]],"async":true,"meta":{"line":70,"file":"MiddlewareStore.js","path":"src/lib/structures"},"since":"0.0.1"}],"meta":{"line":15,"file":"MiddlewareStore.js","path":"src/lib/structures"}},{"name":"Route","description":"Base class for all Klasa Routes. See {@tutorial CreatingRoutes} for more information how to use this class\nto build custom events.","extends":["external:Piece"],"construct":{"name":"Route","params":[{"name":"client","description":"The Klasa client","type":[[["DashboardClient"]]]},{"name":"store","description":"The Route Store","type":[[["RouteStore"]]]},{"name":"file","description":"The path from the pieces folder to the route file","type":[[["string"]]]},{"name":"core","description":"If the piece is in the core directory or not","type":[[["boolean"]]]},{"name":"options","description":"Optional Route settings","optional":true,"default":"{}","type":[[["RouteOptions"]]]}]},"props":[{"name":"route","description":"Stored bound run method, so it can be properly disabled and reloaded later","type":[[["string"]]],"meta":{"line":38,"file":"Route.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"authenticated","description":"If the route is authenticated","type":[[["string"]]],"meta":{"line":45,"file":"Route.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"parsed","description":"Stored parsed route","type":[[["ParsedRoute"]]],"meta":{"line":52,"file":"Route.js","path":"src/lib/structures"},"since":"0.0.1"}],"methods":[{"name":"matches","description":"If this route matches a provided url","params":[{"name":"split","description":"the url to check","type":[[["Array","<"],["string",">"]]]}],"returns":[[["boolean"]]],"meta":{"line":60,"file":"Route.js","path":"src/lib/structures"}},{"name":"execute","description":"Extracts the params from a provided url","params":[{"name":"split","description":"the url","type":[[["Array","<"],["string",">"]]]}],"returns":[[["Object","<"],["string",", "],["*",">"]]],"meta":{"line":71,"file":"Route.js","path":"src/lib/structures"}}],"meta":{"line":30,"file":"Route.js","path":"src/lib/structures"}},{"name":"RouteStore","description":"Stores all the routes that are part of Klasa-dashboard-hooks","extends":["external:Store"],"construct":{"name":"RouteStore","params":[{"name":"client","description":"The Klasa client","type":[[["DashboardClient"]]]}]},"props":[{"name":"registry","description":"A lookup registry of Maps keyed on http method","type":[[["any"]]],"meta":{"line":25,"file":"RouteStore.js","path":"src/lib/structures"},"since":"0.0.1"}],"methods":[{"name":"findRoute","description":"Finds a route using the registry","params":[{"name":"method","description":"The http method","type":[[["string"]]]},{"name":"splitURL","description":"the url to find","type":[[["Array","<"],["string",">"]]]}],"returns":{"types":[[["Route"]]],"nullable":true},"meta":{"line":37,"file":"RouteStore.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"clear","description":"Clears the RouteStore","returns":[[["void"]]],"meta":{"line":47,"file":"RouteStore.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"set","description":"Adds a Route to this RouteStore","params":[{"name":"piece","description":"The route to add to this store","type":[[["Route"]]]}],"returns":[[["Route"]]],"meta":{"line":57,"file":"RouteStore.js","path":"src/lib/structures"}},{"name":"delete","description":"Deletes a Route from this RouteStore","params":[{"name":"name","description":"The name of the Route or the Route","type":[[["Route"]],[["string"]]]}],"returns":[[["boolean"]]],"meta":{"line":69,"file":"RouteStore.js","path":"src/lib/structures"}}],"meta":{"line":17,"file":"RouteStore.js","path":"src/lib/structures"}},{"name":"Util","description":"Utility function class\nThis class cannot be initialized with new","methods":[{"name":"parsePart","description":"Parses a url part","scope":"static","params":[{"name":"val","description":"The string part to parse","type":[[["string"]]]}],"returns":[[["ParsedPart"]]],"meta":{"line":26,"file":"Util.js","path":"src/lib/util"}},{"name":"split","description":"Splits a url into it's parts","scope":"static","params":[{"name":"url","description":"The url to split","type":[[["string"]]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":37,"file":"Util.js","path":"src/lib/util"}},{"name":"parse","description":"Splits and parses a url into it's parts","scope":"static","params":[{"name":"url","description":"The url to split and parse","type":[[["string"]]]}],"returns":[[["Array","<"],["ParsedPart",">"]]],"meta":{"line":48,"file":"Util.js","path":"src/lib/util"}},{"name":"encrypt","description":"Encrypts an object with aes-256-cbc to use as a token","scope":"static","params":[{"name":"data","description":"An object to encrypt","type":[[["any"]]]},{"name":"secret","description":"The secret to encrypt the data with","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":58,"file":"Util.js","path":"src/lib/util"}},{"name":"decrypt","description":"Decrypts an object with aes-256-cbc to use as a token","scope":"static","params":[{"name":"token","description":"An data to decrypt","type":[[["string"]]]},{"name":"secret","description":"The secret to decrypt the data with","type":[[["string"]]]}],"returns":[[["any"]]],"meta":{"line":70,"file":"Util.js","path":"src/lib/util"}}],"meta":{"line":17,"file":"Util.js","path":"src/lib/util"}}],"typedefs":[{"name":"DashboardClientOptions","type":[[["external:KlasaClientOptions"]]],"props":[{"name":"dashboardHooks","description":"The Klasa-Dashboard-Hooks specific options","optional":true,"type":[[["KlasaDashboardHooksOptions"]]]}],"meta":{"line":19,"file":"Client.js","path":"src/lib"}},{"name":"KlasaDashboardHooksOptions","type":[[["Object"]]],"props":[{"name":"apiPrefix","description":"The route prefix for the api","optional":true,"default":"\"api/\"","type":[[["string"]]]},{"name":"origin","description":"The cross origin setting","optional":true,"default":"\"*\"","type":[[["string"]]]},{"name":"port","description":"The port the api runs on","optional":true,"default":4000,"type":[[["number"]]]},{"name":"http2","description":"Whether the server should use http/2 or not","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"sslOptions","description":"The SSL options","optional":true,"type":[[["external:SecureContextOptions"]]]}],"meta":{"line":24,"file":"Client.js","path":"src/lib"}},{"name":"AuthData","type":[[["Object"]]],"props":[{"name":"token","description":"The access token","type":[[["string"]]]},{"name":"scope","description":"The scopes","type":[[["Array","<"],["string",">"]]]}],"meta":{"line":8,"file":"Server.js","path":"src/lib/http"}},{"name":"KlasaIncomingMessage","type":[[["external:IncomingMessage"]]],"props":[{"name":"originalUrl","description":"The original URL","type":[[["string"]]]},{"name":"path","description":"The entire path section of the URL, including the `host`, `port`... and before the `query`/`hash` components","type":[[["string"]]]},{"name":"search","description":"The entire query string portion of the URL including the leading ASCII question mark (`?`) character","type":[[["string"]]]},{"name":"query","description":"The collection of key and value pairs parsed from the query string portion","type":[[["Object","<"],["string",", "],["*",">"]]]},{"name":"body","description":"The body parsed in POST requests","optional":true,"type":[[["any"]]]},{"name":"auth","description":"The auth access token and scopes","optional":true,"type":[[["AuthData"]]]}],"meta":{"line":14,"file":"Server.js","path":"src/lib/http"}},{"name":"ErrorLike","access":"private","type":[[["Object"]]],"props":[{"name":"code","optional":true,"type":[[["number"]]]},{"name":"status","optional":true,"type":[[["number"]]]},{"name":"statusCode","optional":true,"type":[[["number"]]]},{"name":"message","optional":true,"type":[[["string"]]]}],"meta":{"line":24,"file":"Server.js","path":"src/lib/http"}},{"name":"DashboardGuildJSON","type":[[["external:KlasaGuildJSON"]]],"props":[{"name":"id","description":"The id of the DashboardGuild","type":[[["string"]]]},{"name":"name","description":"The name of this DashboardGuild","type":[[["string"]]]},{"name":"icon","description":"The icon hash","type":[[["string"]]]},{"name":"userIsOwner","description":"If the user this is meant for is Owner of the guild","type":[[["boolean"]]]},{"name":"userGuildPermissions","description":"The permissions bitfield for the OAuth User in the Guild","type":[[["number"]]]},{"name":"userCanManage","description":"If the user can manage this DashboardGuild","type":[[["boolean"]]]}],"meta":{"line":8,"file":"DashboardGuild.js","path":"src/lib/structures"}},{"name":"DashboardUserJSON","type":[[["external:KlasaUserJSON"]]],"props":[{"name":"id","description":"The id of the DashboardUser","type":[[["string"]]]},{"name":"username","description":"The name of this DashboardUser","type":[[["string"]]]},{"name":"avatar","description":"The avatar hash","type":[[["string"]]]},{"name":"discriminator","description":"The discriminator of this DashboardUser","type":[[["number"]]]},{"name":"locale","description":"The language of this DashboardUser","type":[[["string"]]]},{"name":"mfaEnabled","description":"If the OAuth User has multi-factor Authentication enabled","type":[[["boolean"]]]},{"name":"guilds","description":"The guilds associated with this OAuth User","type":[[["Array","<"],["DashboardGuild",">"]]]}],"meta":{"line":9,"file":"DashboardUser.js","path":"src/lib/structures"}},{"name":"RouteOptions","type":[[["external:PieceOptions"]]],"props":[{"name":"route","optional":true,"type":[[["string"]]]}],"meta":{"line":17,"file":"Route.js","path":"src/lib/structures"}},{"name":"ParsedRoute","type":[[["Array","<"],["ParsedPart",">"]]],"meta":{"line":13,"file":"Route.js","path":"src/lib/structures"}},{"name":"ParsedPart","type":[[["Object"]]],"props":[{"name":"val","description":"The value of the url part","type":[[["string"]]]},{"name":"type","description":"The type of url part (0 for static, 1 for variable)","type":[[["number"]]]}],"meta":{"line":11,"file":"Util.js","path":"src/lib/util"}}],"externals":[{"name":"KlasaClient","see":["{@link https://klasa.js.org/#/docs/klasa/master/class/KlasaClient}"],"meta":{"line":19,"file":"index.js","path":"src"}},{"name":"Piece","see":["{@link https://klasa.js.org/#/docs/klasa/master/class/Piece}"],"meta":{"line":23,"file":"index.js","path":"src"}},{"name":"Store","see":["{@link https://klasa.js.org/#/docs/klasa/master/class/Store}"],"meta":{"line":27,"file":"index.js","path":"src"}},{"name":"KlasaClientOptions","see":["{@link https://klasa.js.org/#/docs/klasa/master/typedef/KlasaClientOptions}"],"meta":{"line":31,"file":"index.js","path":"src"}},{"name":"KlasaGuildJSON","see":["{@link https://klasa.js.org/#/docs/klasa/master/typedef/KlasaGuildJSON}"],"meta":{"line":35,"file":"index.js","path":"src"}},{"name":"KlasaUserJSON","see":["{@link https://klasa.js.org/#/docs/klasa/master/typedef/KlasaUserJSON}"],"meta":{"line":39,"file":"index.js","path":"src"}},{"name":"PieceOptions","see":["{@link https://klasa.js.org/#/docs/klasa/master/typedef/PieceOptions}"],"meta":{"line":43,"file":"index.js","path":"src"}},{"name":"HTTPServer","see":["{@link https://nodejs.org/dist/latest-v10.x/docs/api/http.html#http_class_http_server}"],"meta":{"line":47,"file":"index.js","path":"src"}},{"name":"SecureContextOptions","see":["{@link https://nodejs.org/dist/latest-v10.x/docs/api/tls.html#tls_tls_createsecurecontext_options}"],"meta":{"line":51,"file":"index.js","path":"src"}},{"name":"IncomingMessage","see":["{@link https://nodejs.org/dist/latest-v10.x/docs/api/http.html#http_class_http_incomingmessage}"],"meta":{"line":55,"file":"index.js","path":"src"}},{"name":"ServerResponse","see":["{@link https://nodejs.org/dist/latest-v10.x/docs/api/http.html#http_class_http_serverresponse}"],"meta":{"line":59,"file":"index.js","path":"src"}},{"name":"Socket","see":["{@link https://nodejs.org/dist/latest-v10.x/docs/api/net.html#net_class_net_socket}"],"meta":{"line":63,"file":"index.js","path":"src"}}]} \ No newline at end of file +{"meta":{"generator":"0.0.1","format":19},"custom":{"Getting Started":{"name":"Getting Started","files":{"GettingStarted":{"name":"Getting Started","type":"md","content":"## Getting Started\n\nplaceholder\n","path":"guides/Getting Started/GettingStarted.md"}}},"Piece Basics":{"name":"Piece Basics","files":{"CreatingRoutes":{"name":"Creating Routes","type":"md","content":"Routes are http request/response handlers for the route specfied. New routes are created in the `./routes/` folder.\n\n```javascript\nconst { Route } = require('klasa-dashboard-hooks');\n\nmodule.exports = class extends Route {\n\n\tconstructor(...args) {\n\t\tsuper(...args, {\n\t\t\troute: '/',\n\t\t\tauthenticated: false\n\t\t});\n\t}\n\n\tget(request, response) {\n\t\t// This is where you place the code you want to run for get requests\n\t}\n\n\tpost(request, response) {\n\t\t// This is where you place the code you want to run for post requests\n\t}\n\n\tpatch(request, response) {\n\t\t// This is where you place the code you want to run for patch requests\n\t}\n\n\tdelete(request, response) {\n\t\t// This is where you place the code you want to run for delete requests\n\t}\n\n\t// ect\n\n};\n```\n\nThe http methods in {@link Route} takes 2 parameters:\n\n| Name | Type | Description |\n| ---------------- | -------------------------------- | -------------------------- |\n| **request** | {@link KlasaIncomingMessage} | The incomming request |\n| **response** | {@link external:ServerResponse} | The outgoing response |\n\n```javascript\nconst { Route } = require('klasa-dashboard-hooks');\n\nmodule.exports = class extends Route {\n\n\tconstructor(...args) {\n\t\tsuper(...args, { route: 'users' });\n\t}\n\n\tget(request, response) {\n\t\treturn response.end(JSON.stringify(this.client.users.keyArray()));\n\t}\n\n};\n```\n\nHow does the route work?\n\n1. A get request is made to your api at the `/users` route like: api.yourdomain.com/users\n2. After all {@link Middleware} have run, the code in the get method is run.\n3. You end the response with strinified json of the `this.client.users.keyArray()`\n\nStatic routes are all and good, but you are more likely going to need some dynamic routes too:\n\n```javascript\nconst { Route } = require('klasa-dashboard-hooks');\n\nmodule.exports = class extends Route {\n\n\tconstructor(...args) {\n\t\tsuper(...args, { route: 'users/:userID' });\n\t}\n\n\tget(request, response) {\n\t\tconst { userID } = request.params;\n\t\tconst user = this.client.users.get(userID);\n\t\tif (!user) response.end('{}');\n\t\treturn response.end(JSON.stringify(user));\n\t}\n\n};\n```\n\n>Note the colon in front of the userID portion of the route\n\nHow does the new route work?\n\n1. A get request is made to your api at the `/users/:userID` route like: api.yourdomain.com/users/167383252271628289\n2. After all {@link Middleware} have run, the code in the get method is run.\n3. You access the userID variable from the `request.params`\n4. After trying to get the user from your cache, you either respond with `'{}'` or the stringified user.\n\n# Further reading\n\n- {@tutorial CreatingMiddlewares}\n","path":"guides/Piece Basics/CreatingRoutes.md"},"CreatingMiddlewares":{"name":"Creating Middlewares","type":"md","content":"Middlewares are http middleware handlers that run on all routes. New middlewares are created in the `./middlewares/` folder.\n\n```javascript\nconst { Middleware } = require('klasa-dashboard-hooks');\n\nmodule.exports = class extends Middleware {\n\n\tasync run(request, response, route) {\n\t\t// This is where you place the code you want to run on all routes\n\t}\n\n};\n```\n\nThe run method in {@link Middleware} takes 3 parameters:\n\n| Name | Type | Description |\n| ---------------- | -------------------------------- | -------------------------- |\n| **request** | {@link KlasaIncomingMessage} | The incomming request |\n| **response** | {@link external:ServerResponse} | The outgoing response |\n| **route** | {@link Route} | The route being run |\n\n```javascript\nconst { Middleware } = require('klasa-dashboard-hooks');\n\nmodule.exports = class extends Middleware {\n\n\trun(request, response) {\n\t\tresponse.setHeader('Content-Type', 'application/json');\n\t}\n\n};\n```\n\nHow does the middleware work?\n\n1. A request is made to your api\n2. Since we are making a json api, we want to set the header in a way that clients know we are responding with json\n3. The method is implicently resolved, and the next {@link Middleware} is run, or finally the {@link Route}.\n\n>Note: the {@link Middleware#run()} may be async/return a promise as well.\n\n# Further reading\n\n- {@tutorial CreatingRoutes}\n","path":"guides/Piece Basics/CreatingMiddlewares.md"}}}},"classes":[{"name":"DashboardClient","description":"The client for handling everything. See {@tutorial GettingStarted} for more information how to get started using this class.","extends":["external:KlasaClient"],"construct":{"name":"DashboardClient","description":"Constructs the klasa-dashboard-hooks client","params":[{"name":"config","description":"The config to pass to the new client","type":[[["DashboardClientOptions"]]]}]},"props":[{"name":"server","description":"The http server handler for the api","type":[[["Server"]]],"meta":{"line":46,"file":"Client.js","path":"src/lib"},"since":"0.0.1"},{"name":"routes","description":"The cache where routes are stored","type":[[["RouteStore"]]],"meta":{"line":54,"file":"Client.js","path":"src/lib"},"since":"0.0.1"},{"name":"middlewares","description":"The cache where middlewares are stored","type":[[["MiddlewareStore"]]],"meta":{"line":62,"file":"Client.js","path":"src/lib"},"since":"0.0.1"},{"name":"dashboardUsers","description":"The cache where oauth data is temporarily stored","type":[[["DataStore"]]],"meta":{"line":70,"file":"Client.js","path":"src/lib"},"since":"0.0.1"}],"meta":{"line":38,"file":"Client.js","path":"src/lib"}},{"name":"KlasaIncomingMessage","description":"The custom class for KDH's incoming messages when using HTTP/HTTPS","extends":["external:IncomingMessage"],"construct":{"name":"KlasaIncomingMessage","params":[{"name":"socket","description":"The net.Socket","type":[[["external:Socket"]]]}]},"props":[{"name":"originalUrl","description":"The original url (automatic redirects)","type":[[["string"]]],"meta":{"line":22,"file":"KlasaIncomingMessage.js","path":"src/lib/http"}},{"name":"path","description":"The path of the url","type":[[["string"]]],"meta":{"line":28,"file":"KlasaIncomingMessage.js","path":"src/lib/http"}},{"name":"search","description":"The search string of the url","type":[[["string"]]],"meta":{"line":34,"file":"KlasaIncomingMessage.js","path":"src/lib/http"}},{"name":"query","description":"The parsed query of the search string","type":[[["any"]]],"meta":{"line":40,"file":"KlasaIncomingMessage.js","path":"src/lib/http"}},{"name":"params","description":"The parsed params from the url","type":[[["any"]]],"meta":{"line":46,"file":"KlasaIncomingMessage.js","path":"src/lib/http"}},{"name":"route","description":"The Route this incoming message is for","type":[[["Route"]]],"meta":{"line":52,"file":"KlasaIncomingMessage.js","path":"src/lib/http"}},{"name":"methodLower","description":"The lowercase method name","readonly":true,"type":[[["string"]]],"meta":{"line":60,"file":"KlasaIncomingMessage.js","path":"src/lib/http"}}],"methods":[{"name":"execute","description":"Executes the Route this message is for","params":[{"name":"response","description":"The response object","type":[[["KlasaServerResponse"]]]}],"returns":[[["any"]]],"meta":{"line":69,"file":"KlasaIncomingMessage.js","path":"src/lib/http"}},{"name":"init","description":"Initializes this message for the Route","params":[{"name":"client","description":"The Klasa Client","type":[[["external:KlasaClient"]]]}],"meta":{"line":77,"file":"KlasaIncomingMessage.js","path":"src/lib/http"}}],"meta":{"line":15,"file":"KlasaIncomingMessage.js","path":"src/lib/http"}},{"name":"KlasaIncomingMessage2","description":"The custom class for KDH's incoming messages when using HTTP2","extends":["external:Http2ServerRequest"],"construct":{"name":"KlasaIncomingMessage2","params":[{"name":"stream","description":"The HTTP2 Server Stream","type":[[["external:ServerHttp2Stream"]]]},{"name":"headers","description":"The incoming http headers","type":[[["external:IncomingHttpHeaders"]]]},{"name":"options","description":"The stream readable options","type":[[["external:streamReadableOptions"]]]},{"name":"rawHeaders","description":"The raw headers","type":[[["Array","<"],["string",">"]]]}]},"props":[{"name":"originalUrl","description":"The original url (automatic redirects)","type":[[["string"]]],"meta":{"line":25,"file":"KlasaIncomingMessage2.js","path":"src/lib/http"}},{"name":"path","description":"The path of the url","type":[[["string"]]],"meta":{"line":31,"file":"KlasaIncomingMessage2.js","path":"src/lib/http"}},{"name":"search","description":"The search string of the url","type":[[["string"]]],"meta":{"line":37,"file":"KlasaIncomingMessage2.js","path":"src/lib/http"}},{"name":"query","description":"The parsed query of the search string","type":[[["any"]]],"meta":{"line":43,"file":"KlasaIncomingMessage2.js","path":"src/lib/http"}},{"name":"params","description":"The parsed params from the url","type":[[["any"]]],"meta":{"line":49,"file":"KlasaIncomingMessage2.js","path":"src/lib/http"}},{"name":"route","description":"The Route this incoming message is for","type":[[["Route"]]],"meta":{"line":55,"file":"KlasaIncomingMessage2.js","path":"src/lib/http"}},{"name":"methodLower","description":"The lowercase method name","readonly":true,"type":[[["string"]]],"meta":{"line":63,"file":"KlasaIncomingMessage2.js","path":"src/lib/http"}}],"methods":[{"name":"execute","description":"Executes the Route this message is for","params":[{"name":"response","description":"The response object","type":[[["KlasaServerResponse"]]]}],"returns":[[["any"]]],"meta":{"line":72,"file":"KlasaIncomingMessage2.js","path":"src/lib/http"}},{"name":"init","description":"Initializes this message for the Route","params":[{"name":"client","description":"The Klasa Client","type":[[["external:KlasaClient"]]]}],"meta":{"line":80,"file":"KlasaIncomingMessage2.js","path":"src/lib/http"}}],"meta":{"line":18,"file":"KlasaIncomingMessage2.js","path":"src/lib/http"}},{"name":"KlasaServerResponse","description":"The server response for KDH when using HTTP/HTTPS","extends":["external:ServerResponse"],"methods":[{"name":"status","description":"Sets the status code of this response","params":[{"name":"code","description":"The status code to set the response to","type":[[["number"]]]}],"returns":[[["this"]]],"meta":{"line":14,"file":"KlasaServerResponse.js","path":"src/lib/http"}},{"name":"json","description":"Ends the response with JSON.stringified data","params":[{"name":"data","description":"The data to respond with","type":[[["any"]]]}],"returns":[[["any"]]],"meta":{"line":24,"file":"KlasaServerResponse.js","path":"src/lib/http"}}],"meta":{"line":7,"file":"KlasaServerResponse.js","path":"src/lib/http"}},{"name":"KlasaServerResponse2","description":"The server response for KDH when using HTTP2","extends":["external:Http2ServerResponse"],"methods":[{"name":"status","description":"Sets the status code of this response","params":[{"name":"code","description":"The status code to set the response to","type":[[["number"]]]}],"returns":[[["this"]]],"meta":{"line":14,"file":"KlasaServerResponse2.js","path":"src/lib/http"}},{"name":"json","description":"Ends the response with JSON.stringified data","params":[{"name":"data","description":"The data to respond with","type":[[["any"]]]}],"returns":[[["any"]]],"meta":{"line":24,"file":"KlasaServerResponse2.js","path":"src/lib/http"}}],"meta":{"line":7,"file":"KlasaServerResponse2.js","path":"src/lib/http"}},{"name":"Server","description":"The http server for klasa-dashboard-hooks","construct":{"name":"Server","params":[{"name":"client","description":"The Klasa client","type":[[["DashboardClient"]]]}]},"props":[{"name":"client","description":"The Client that manages this Server instance","type":[[["DashboardClient"]]],"meta":{"line":44,"file":"Server.js","path":"src/lib/http"},"since":"0.0.1"},{"name":"server","description":"The http.Server instance that manages the HTTP requests","type":[[["external:HTTPServer"]]],"meta":{"line":51,"file":"Server.js","path":"src/lib/http"},"since":"0.0.1"},{"name":"onNoMatch","description":"The onError function called when a url does not match","type":[[["function"]]],"meta":{"line":60,"file":"Server.js","path":"src/lib/http"},"since":"0.0.1"}],"methods":[{"name":"listen","description":"Starts the server listening to a port","params":[{"name":"port","description":"The port to run the server on","type":[[["number"]]]}],"returns":[[["Promise","<"],["void",">"]]],"meta":{"line":68,"file":"Server.js","path":"src/lib/http"}},{"name":"handler","description":"The handler for incoming requests","params":[{"name":"request","description":"The request","type":[[["external:IncomingMessage"]]]},{"name":"response","description":"The response","type":[[["external:ServerResponse"]]]}],"async":true,"meta":{"line":80,"file":"Server.js","path":"src/lib/http"}},{"name":"onError","description":"The handler for errors","params":[{"name":"error","description":"The error","type":[[["Error"]],[["ErrorLike"]]]},{"name":"request","description":"The request","type":[[["KlasaIncomingMessage"]]]},{"name":"response","description":"The response","type":[[["external:ServerResponse"]]]}],"meta":{"line":98,"file":"Server.js","path":"src/lib/http"}}],"meta":{"line":37,"file":"Server.js","path":"src/lib/http"}},{"name":"DashboardGuild","description":"Represents an OAuthGuild","construct":{"name":"DashboardGuild","params":[{"name":"client","description":"The Dashboard Client","type":[[["DashboardClient"]]]},{"name":"guild","description":"The raw guild data","type":[[["Object"]]]},{"name":"user","description":"The OAuth User this Guild is for","type":[[["DashboardUser"]]]}]},"props":[{"name":"client","description":"The DashboardClient","type":[[["DashboardClient"]]],"meta":{"line":30,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"user","description":"The OAuth User this DashboardGuild is for","type":[[["DashboardUser"]]],"meta":{"line":37,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"id","description":"The guild id","type":[[["string"]]],"meta":{"line":44,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"name","description":"The guild name","type":[[["string"]]],"meta":{"line":51,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"icon","description":"The guild icon hash","nullable":true,"type":[[["string"]]],"meta":{"line":58,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"userIsOwner","description":"If the logged in OAuthUser is the owner of the guild","type":[[["boolean"]]],"meta":{"line":65,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"userGuildPermissions","description":"The guild permissions for the logged in OAuthUser","type":[[["external:Permissions"]]],"meta":{"line":72,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"userCanManage","description":"If the logged in OAuthUser can manage the guild (invite bots)","type":[[["boolean"]]],"meta":{"line":79,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"iconURL","description":"The url for the guild's icon","readonly":true,"nullable":true,"type":[[["string"]]],"meta":{"line":88,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"guild","description":"The guild for this DashboardGuild","readonly":true,"nullable":true,"type":[[["external:KlasaGuild"]]],"meta":{"line":101,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"}],"methods":[{"name":"toJSON","description":"The toJSON behavior of this structure","returns":[[["DashboardGuildJSON"]]],"meta":{"line":110,"file":"DashboardGuild.js","path":"src/lib/structures"},"since":"0.0.1"}],"meta":{"line":24,"file":"DashboardGuild.js","path":"src/lib/structures"}},{"name":"DashboardUser","description":"Represents an OAuth User","construct":{"name":"DashboardUser","params":[{"name":"client","description":"The client","type":[[["DashboardClient"]]]},{"name":"user","description":"The raw user data","type":[[["Object"]]]}]},"props":[{"name":"client","description":"The DashboardClient","type":[[["DashboardClient"]]],"meta":{"line":31,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"id","description":"The id of the OAuth User","type":[[["string"]]],"meta":{"line":38,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"username","description":"The username of the OAuth User","type":[[["string"]]],"meta":{"line":45,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"discriminator","description":"The discriminator of the OAuth User","type":[[["number"]]],"meta":{"line":52,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"locale","description":"The language of the OAuth User","type":[[["string"]]],"meta":{"line":59,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"mfaEnabled","description":"If the OAuth User has multi-factor Authentication enabled","type":[[["boolean"]]],"meta":{"line":66,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"avatar","description":"The OAuth User's avatar hash","type":[[["string"]]],"meta":{"line":73,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"guilds","description":"The collection of OAuth Guilds this OAuth User is in","type":[[["external:Collection","<"],["external:snowflake",", "],["DashboardGuild",">"]]],"meta":{"line":80,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"avatarURL","description":"The Avatar URL for this OAuth User","readonly":true,"type":[[["string"]]],"meta":{"line":91,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"user","description":"The User for this OAuth User","readonly":true,"type":[[["external:KlasaUser"]]],"meta":{"line":104,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"}],"methods":[{"name":"toJSON","description":"The toJSON behavior of this Object","returns":[[["DashboardUserJSON"]]],"meta":{"line":113,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"setupGuilds","description":"Setups all DashboardGuilds for the passed in Dashboard User","scope":"static","access":"private","params":[{"name":"dashboardUser","description":"The dashboard user guilds are being setup for","type":[[["DashboardUser"]]]},{"name":"guilds","description":"The raw guild data to setup","type":[[["Array","<"],["Object",">"]]]}],"returns":[[["void"]]],"meta":{"line":135,"file":"DashboardUser.js","path":"src/lib/structures"},"since":"0.0.1"}],"meta":{"line":25,"file":"DashboardUser.js","path":"src/lib/structures"}},{"name":"Middleware","description":"Base class for all Klasa Middleware. See {@tutorial CreatingMiddlewares} for more information how to use this class\nto build custom events.","extends":["external:Piece"],"construct":{"name":"Middleware","params":[{"name":"store","description":"The Middleware Store","type":[[["MiddlewareStore"]]]},{"name":"file","description":"The path from the pieces folder to the middleware file","type":[[["string"]]]},{"name":"core","description":"If the piece is in the core directory or not","type":[[["boolean"]]]},{"name":"options","description":"Optional Middleware settings","optional":true,"default":"{}","type":[[["MiddlewareOptions"]]]}]},"props":[{"name":"priority","description":"The priority in which this middleware should run","type":[[["number"]]],"meta":{"line":32,"file":"Middleware.js","path":"src/lib/structures"},"since":"0.0.1"}],"methods":[{"name":"run","description":"The run method to be overwritten in actual event handlers","abstract":true,"params":[{"name":"request","description":"The http request","type":[[["KlasaIncomingMessage"]]]},{"name":"response","description":"The http response","type":[[["external:ServerResponse"]]]},{"name":"route","description":"The route being run","nullable":true,"type":[[["Route"]]]}],"returns":[[["Promise","<"],["void",">"]]],"async":true,"meta":{"line":44,"file":"Middleware.js","path":"src/lib/structures"},"since":"0.0.1"}],"meta":{"line":24,"file":"Middleware.js","path":"src/lib/structures"}},{"name":"MiddlewareStore","description":"Stores all the middlewares that are part of Klasa-dashboard-hooks","extends":["external:Store"],"construct":{"name":"MiddlewareStore","params":[{"name":"client","description":"The Klasa client","type":[[["DashboardClient"]]]}]},"props":[{"name":"sortedMiddlwares","description":"The middlewares sorted by priority","type":[[["Array","<"],["Middleware",">"]]],"meta":{"line":22,"file":"MiddlewareStore.js","path":"src/lib/structures"}}],"methods":[{"name":"clear","description":"Clears the RouteStore","returns":[[["void"]]],"meta":{"line":30,"file":"MiddlewareStore.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"set","description":"Adds a Middleware to this MiddlewareStore","params":[{"name":"piece","description":"The Middleware to add to this store","type":[[["Middleware"]]]}],"returns":[[["Middleware"]]],"meta":{"line":40,"file":"MiddlewareStore.js","path":"src/lib/structures"}},{"name":"delete","description":"Deletes a Middleware from this MiddlewareStore","params":[{"name":"name","description":"The name of the Middleware or the Middleware","type":[[["Middleware"]],[["string"]]]}],"returns":[[["boolean"]]],"meta":{"line":55,"file":"MiddlewareStore.js","path":"src/lib/structures"}},{"name":"run","description":"Runs all the middleware.","params":[{"name":"request","description":"The http request","type":[[["KlasaIncomingMessage"]]]},{"name":"response","description":"The http response","type":[[["external:ServerResponse"]]]},{"name":"route","description":"The route being run","nullable":true,"type":[[["Route"]]]}],"returns":[[["Promise","<"],["void",">"]]],"async":true,"meta":{"line":70,"file":"MiddlewareStore.js","path":"src/lib/structures"},"since":"0.0.1"}],"meta":{"line":15,"file":"MiddlewareStore.js","path":"src/lib/structures"}},{"name":"Route","description":"Base class for all Klasa Routes. See {@tutorial CreatingRoutes} for more information how to use this class\nto build custom events.","extends":["external:Piece"],"construct":{"name":"Route","params":[{"name":"store","description":"The Route Store","type":[[["RouteStore"]]]},{"name":"file","description":"The path from the pieces folder to the route file","type":[[["string"]]]},{"name":"core","description":"If the piece is in the core directory or not","type":[[["boolean"]]]},{"name":"options","description":"Optional Route settings","optional":true,"default":"{}","type":[[["RouteOptions"]]]}]},"props":[{"name":"route","description":"Stored bound run method, so it can be properly disabled and reloaded later","type":[[["string"]]],"meta":{"line":37,"file":"Route.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"authenticated","description":"If the route is authenticated","type":[[["boolean"]]],"meta":{"line":44,"file":"Route.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"parsed","description":"Stored parsed route","type":[[["ParsedRoute"]]],"meta":{"line":51,"file":"Route.js","path":"src/lib/structures"},"since":"0.0.1"}],"methods":[{"name":"matches","description":"If this route matches a provided url","params":[{"name":"split","description":"the url to check","type":[[["Array","<"],["string",">"]]]}],"returns":[[["boolean"]]],"meta":{"line":59,"file":"Route.js","path":"src/lib/structures"}},{"name":"execute","description":"Extracts the params from a provided url","params":[{"name":"split","description":"the url","type":[[["Array","<"],["string",">"]]]}],"returns":[[["Object","<"],["string",", "],["*",">"]]],"meta":{"line":70,"file":"Route.js","path":"src/lib/structures"}}],"meta":{"line":29,"file":"Route.js","path":"src/lib/structures"}},{"name":"RouteStore","description":"Stores all the routes that are part of Klasa-dashboard-hooks","extends":["external:Store"],"construct":{"name":"RouteStore","params":[{"name":"client","description":"The Klasa client","type":[[["DashboardClient"]]]}]},"props":[{"name":"registry","description":"A lookup registry of Maps keyed on http method","type":[[["any"]]],"meta":{"line":25,"file":"RouteStore.js","path":"src/lib/structures"},"since":"0.0.1"}],"methods":[{"name":"findRoute","description":"Finds a route using the registry","params":[{"name":"method","description":"The http method","type":[[["string"]]]},{"name":"splitURL","description":"the url to find","type":[[["Array","<"],["string",">"]]]}],"returns":{"types":[[["Route"]]],"nullable":true},"meta":{"line":37,"file":"RouteStore.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"clear","description":"Clears the RouteStore","returns":[[["void"]]],"meta":{"line":47,"file":"RouteStore.js","path":"src/lib/structures"},"since":"0.0.1"},{"name":"set","description":"Adds a Route to this RouteStore","params":[{"name":"piece","description":"The route to add to this store","type":[[["Route"]]]}],"returns":[[["Route"]]],"meta":{"line":57,"file":"RouteStore.js","path":"src/lib/structures"}},{"name":"delete","description":"Deletes a Route from this RouteStore","params":[{"name":"name","description":"The name of the Route or the Route","type":[[["Route"]],[["string"]]]}],"returns":[[["boolean"]]],"meta":{"line":69,"file":"RouteStore.js","path":"src/lib/structures"}}],"meta":{"line":17,"file":"RouteStore.js","path":"src/lib/structures"}},{"name":"Util","description":"Utility function class\nThis class cannot be initialized with new","methods":[{"name":"parsePart","description":"Parses a url part","scope":"static","params":[{"name":"val","description":"The string part to parse","type":[[["string"]]]}],"returns":[[["ParsedPart"]]],"meta":{"line":26,"file":"Util.js","path":"src/lib/util"}},{"name":"split","description":"Splits a url into it's parts","scope":"static","params":[{"name":"url","description":"The url to split","type":[[["string"]]]}],"returns":[[["Array","<"],["string",">"]]],"meta":{"line":37,"file":"Util.js","path":"src/lib/util"}},{"name":"parse","description":"Splits and parses a url into it's parts","scope":"static","params":[{"name":"url","description":"The url to split and parse","type":[[["string"]]]}],"returns":[[["Array","<"],["ParsedPart",">"]]],"meta":{"line":48,"file":"Util.js","path":"src/lib/util"}},{"name":"encrypt","description":"Encrypts an object with aes-256-cbc to use as a token","scope":"static","params":[{"name":"data","description":"An object to encrypt","type":[[["any"]]]},{"name":"secret","description":"The secret to encrypt the data with","type":[[["string"]]]}],"returns":[[["string"]]],"meta":{"line":58,"file":"Util.js","path":"src/lib/util"}},{"name":"decrypt","description":"Decrypts an object with aes-256-cbc to use as a token","scope":"static","params":[{"name":"token","description":"An data to decrypt","type":[[["string"]]]},{"name":"secret","description":"The secret to decrypt the data with","type":[[["string"]]]}],"returns":[[["any"]]],"meta":{"line":70,"file":"Util.js","path":"src/lib/util"}}],"meta":{"line":17,"file":"Util.js","path":"src/lib/util"}}],"typedefs":[{"name":"DashboardClientOptions","type":[[["external:KlasaClientOptions"]]],"props":[{"name":"dashboardHooks","description":"The Klasa-Dashboard-Hooks specific options","optional":true,"type":[[["KlasaDashboardHooksOptions"]]]}],"meta":{"line":19,"file":"Client.js","path":"src/lib"}},{"name":"KlasaDashboardHooksOptions","type":[[["Object"]]],"props":[{"name":"apiPrefix","description":"The route prefix for the api","optional":true,"default":"\"api/\"","type":[[["string"]]]},{"name":"origin","description":"The cross origin setting","optional":true,"default":"\"*\"","type":[[["string"]]]},{"name":"port","description":"The port the api runs on","optional":true,"default":4000,"type":[[["number"]]]},{"name":"http2","description":"Whether the server should use http/2 or not","optional":true,"default":false,"type":[[["boolean"]]]},{"name":"sslOptions","description":"The SSL options","optional":true,"type":[[["external:SecureContextOptions"]]]}],"meta":{"line":24,"file":"Client.js","path":"src/lib"}},{"name":"AuthData","type":[[["Object"]]],"props":[{"name":"token","description":"The access token","type":[[["string"]]]},{"name":"scope","description":"The scopes","type":[[["Array","<"],["string",">"]]]}],"meta":{"line":8,"file":"Server.js","path":"src/lib/http"}},{"name":"KlasaIncomingMessage","type":[[["external:IncomingMessage"]]],"props":[{"name":"originalUrl","description":"The original URL","type":[[["string"]]]},{"name":"path","description":"The entire path section of the URL, including the `host`, `port`... and before the `query`/`hash` components","type":[[["string"]]]},{"name":"search","description":"The entire query string portion of the URL including the leading ASCII question mark (`?`) character","type":[[["string"]]]},{"name":"query","description":"The collection of key and value pairs parsed from the query string portion","type":[[["Object","<"],["string",", "],["*",">"]]]},{"name":"body","description":"The body parsed in POST requests","optional":true,"type":[[["any"]]]},{"name":"auth","description":"The auth access token and scopes","optional":true,"type":[[["AuthData"]]]}],"meta":{"line":14,"file":"Server.js","path":"src/lib/http"}},{"name":"ErrorLike","access":"private","type":[[["Object"]]],"props":[{"name":"code","optional":true,"type":[[["number"]]]},{"name":"status","optional":true,"type":[[["number"]]]},{"name":"statusCode","optional":true,"type":[[["number"]]]},{"name":"message","optional":true,"type":[[["string"]]]}],"meta":{"line":24,"file":"Server.js","path":"src/lib/http"}},{"name":"DashboardGuildJSON","type":[[["external:KlasaGuildJSON"]]],"props":[{"name":"id","description":"The id of the DashboardGuild","type":[[["string"]]]},{"name":"name","description":"The name of this DashboardGuild","type":[[["string"]]]},{"name":"icon","description":"The icon hash","type":[[["string"]]]},{"name":"userIsOwner","description":"If the user this is meant for is Owner of the guild","type":[[["boolean"]]]},{"name":"userGuildPermissions","description":"The permissions bitfield for the OAuth User in the Guild","type":[[["number"]]]},{"name":"userCanManage","description":"If the user can manage this DashboardGuild","type":[[["boolean"]]]}],"meta":{"line":8,"file":"DashboardGuild.js","path":"src/lib/structures"}},{"name":"DashboardUserJSON","type":[[["external:KlasaUserJSON"]]],"props":[{"name":"id","description":"The id of the DashboardUser","type":[[["string"]]]},{"name":"username","description":"The name of this DashboardUser","type":[[["string"]]]},{"name":"avatar","description":"The avatar hash","type":[[["string"]]]},{"name":"discriminator","description":"The discriminator of this DashboardUser","type":[[["number"]]]},{"name":"locale","description":"The language of this DashboardUser","type":[[["string"]]]},{"name":"mfaEnabled","description":"If the OAuth User has multi-factor Authentication enabled","type":[[["boolean"]]]},{"name":"guilds","description":"The guilds associated with this OAuth User","type":[[["Array","<"],["DashboardGuild",">"]]]}],"meta":{"line":9,"file":"DashboardUser.js","path":"src/lib/structures"}},{"name":"RouteOptions","type":[[["external:PieceOptions"]]],"props":[{"name":"route","optional":true,"type":[[["string"]]]}],"meta":{"line":17,"file":"Route.js","path":"src/lib/structures"}},{"name":"ParsedRoute","type":[[["Array","<"],["ParsedPart",">"]]],"meta":{"line":13,"file":"Route.js","path":"src/lib/structures"}},{"name":"ParsedPart","type":[[["Object"]]],"props":[{"name":"val","description":"The value of the url part","type":[[["string"]]]},{"name":"type","description":"The type of url part (0 for static, 1 for variable)","type":[[["number"]]]}],"meta":{"line":11,"file":"Util.js","path":"src/lib/util"}}],"externals":[{"name":"KlasaClient","see":["{@link https://klasa.js.org/#/docs/klasa/master/class/KlasaClient}"],"meta":{"line":21,"file":"index.js","path":"src"}},{"name":"Piece","see":["{@link https://klasa.js.org/#/docs/klasa/master/class/Piece}"],"meta":{"line":25,"file":"index.js","path":"src"}},{"name":"Store","see":["{@link https://klasa.js.org/#/docs/klasa/master/class/Store}"],"meta":{"line":29,"file":"index.js","path":"src"}},{"name":"KlasaClientOptions","see":["{@link https://klasa.js.org/#/docs/klasa/master/typedef/KlasaClientOptions}"],"meta":{"line":33,"file":"index.js","path":"src"}},{"name":"KlasaGuildJSON","see":["{@link https://klasa.js.org/#/docs/klasa/master/typedef/KlasaGuildJSON}"],"meta":{"line":37,"file":"index.js","path":"src"}},{"name":"KlasaUserJSON","see":["{@link https://klasa.js.org/#/docs/klasa/master/typedef/KlasaUserJSON}"],"meta":{"line":41,"file":"index.js","path":"src"}},{"name":"PieceOptions","see":["{@link https://klasa.js.org/#/docs/klasa/master/typedef/PieceOptions}"],"meta":{"line":45,"file":"index.js","path":"src"}},{"name":"HTTPServer","see":["{@link https://nodejs.org/dist/latest-v10.x/docs/api/http.html#http_class_http_server}"],"meta":{"line":49,"file":"index.js","path":"src"}},{"name":"SecureContextOptions","see":["{@link https://nodejs.org/dist/latest-v10.x/docs/api/tls.html#tls_tls_createsecurecontext_options}"],"meta":{"line":53,"file":"index.js","path":"src"}},{"name":"IncomingMessage","see":["{@link https://nodejs.org/dist/latest-v10.x/docs/api/http.html#http_class_http_incomingmessage}"],"meta":{"line":57,"file":"index.js","path":"src"}},{"name":"ServerResponse","see":["{@link https://nodejs.org/dist/latest-v10.x/docs/api/http.html#http_class_http_serverresponse}"],"meta":{"line":61,"file":"index.js","path":"src"}},{"name":"Socket","see":["{@link https://nodejs.org/dist/latest-v10.x/docs/api/net.html#net_class_net_socket}"],"meta":{"line":65,"file":"index.js","path":"src"}}]} \ No newline at end of file