UNPKG

@sapphire/plugin-api

Version:

Plugin for @sapphire/framework to expose a REST API

31 lines (28 loc) 1.12 kB
'use strict'; var pieces = require('@sapphire/pieces'); var __defProp = Object.defineProperty; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); var __publicField = (obj, key, value) => __defNormalProp(obj, key + "" , value); var _Middleware = class _Middleware extends pieces.Piece { constructor(context, options = {}) { super(context, options); /** * The position the middleware has. The {@link MiddlewareStore} will run all middlewares with lower position than * this one. * * The built-in middlewares follow the following positions: * - headers: 10 * - body: 20 * - cookies: 30 * - auth: 40 */ __publicField(this, "position"); this.position = options.position ?? 1e3; } }; __name(_Middleware, "Middleware"); var Middleware = _Middleware; exports.Middleware = Middleware; //# sourceMappingURL=Middleware.cjs.map //# sourceMappingURL=Middleware.cjs.map