@sapphire/plugin-api 7.0.0-next.fc8e636 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/README.md +0 -1
- package/dist/cjs/index.cjs +6 -32
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +91 -109
- package/dist/cjs/lib/structures/Augmentations.d.cjs +1 -1
- package/dist/cjs/lib/structures/Augmentations.d.cjs.map +1 -1
- package/dist/cjs/lib/structures/Middleware.cjs +2 -2
- package/dist/cjs/lib/structures/Middleware.cjs.map +1 -1
- package/dist/cjs/lib/structures/MiddlewareStore.cjs +2 -2
- package/dist/cjs/lib/structures/MiddlewareStore.cjs.map +1 -1
- package/dist/cjs/lib/structures/Route.cjs +5 -10
- package/dist/cjs/lib/structures/Route.cjs.map +1 -1
- package/dist/cjs/lib/structures/RouteLoaderStrategy.cjs +1 -1
- package/dist/cjs/lib/structures/RouteLoaderStrategy.cjs.map +1 -1
- package/dist/cjs/lib/structures/RouteStore.cjs +2 -2
- package/dist/cjs/lib/structures/RouteStore.cjs.map +1 -1
- package/dist/cjs/lib/structures/api/ApiRequest.cjs +129 -5
- package/dist/cjs/lib/structures/api/ApiRequest.cjs.map +1 -1
- package/dist/cjs/lib/structures/api/ApiResponse.cjs +6 -7
- package/dist/cjs/lib/structures/api/ApiResponse.cjs.map +1 -1
- package/dist/cjs/lib/structures/api/CookieStore.cjs +1 -1
- package/dist/cjs/lib/structures/api/CookieStore.cjs.map +1 -1
- package/dist/cjs/lib/structures/http/Auth.cjs +2 -2
- package/dist/cjs/lib/structures/http/Auth.cjs.map +1 -1
- package/dist/cjs/lib/structures/http/HttpCodes.cjs +1 -1
- package/dist/cjs/lib/structures/http/HttpCodes.cjs.map +1 -1
- package/dist/cjs/lib/structures/http/HttpMethods.cjs +2 -1
- package/dist/cjs/lib/structures/http/HttpMethods.cjs.map +1 -1
- package/dist/cjs/lib/structures/http/Server.cjs +2 -9
- package/dist/cjs/lib/structures/http/Server.cjs.map +1 -1
- package/dist/cjs/lib/structures/router/RouterBranch.cjs +1 -1
- package/dist/cjs/lib/structures/router/RouterBranch.cjs.map +1 -1
- package/dist/cjs/lib/structures/router/RouterNode.cjs +2 -2
- package/dist/cjs/lib/structures/router/RouterNode.cjs.map +1 -1
- package/dist/cjs/lib/structures/router/RouterRoot.cjs +12 -2
- package/dist/cjs/lib/structures/router/RouterRoot.cjs.map +1 -1
- package/dist/cjs/lib/utils/MimeType.cjs +4 -0
- package/dist/cjs/lib/utils/MimeType.cjs.map +1 -0
- package/dist/cjs/lib/utils/_body/RequestHeadersProxy.cjs +100 -0
- package/dist/cjs/lib/utils/_body/RequestHeadersProxy.cjs.map +1 -0
- package/dist/cjs/lib/utils/_body/RequestProxy.cjs +124 -0
- package/dist/cjs/lib/utils/_body/RequestProxy.cjs.map +1 -0
- package/dist/cjs/lib/utils/_body/RequestURLProxy.cjs +179 -0
- package/dist/cjs/lib/utils/_body/RequestURLProxy.cjs.map +1 -0
- package/dist/cjs/lib/utils/constants.cjs +8 -0
- package/dist/cjs/lib/utils/constants.cjs.map +1 -0
- package/dist/cjs/listeners/PluginRouteError.cjs +1 -1
- package/dist/cjs/listeners/PluginRouteError.cjs.map +1 -1
- package/dist/cjs/listeners/PluginServerMiddlewareError.cjs +1 -1
- package/dist/cjs/listeners/PluginServerMiddlewareError.cjs.map +1 -1
- package/dist/cjs/listeners/PluginServerMiddlewareSuccess.cjs +1 -1
- package/dist/cjs/listeners/PluginServerMiddlewareSuccess.cjs.map +1 -1
- package/dist/cjs/listeners/PluginServerRequest.cjs +2 -2
- package/dist/cjs/listeners/PluginServerRequest.cjs.map +1 -1
- package/dist/cjs/listeners/PluginServerRouterBranchMethodNotAllowed.cjs +1 -1
- package/dist/cjs/listeners/PluginServerRouterBranchMethodNotAllowed.cjs.map +1 -1
- package/dist/cjs/listeners/PluginServerRouterBranchNotFound.cjs +1 -1
- package/dist/cjs/listeners/PluginServerRouterBranchNotFound.cjs.map +1 -1
- package/dist/cjs/listeners/PluginServerRouterFound.cjs +3 -2
- package/dist/cjs/listeners/PluginServerRouterFound.cjs.map +1 -1
- package/dist/cjs/listeners/_load.cjs +1 -1
- package/dist/cjs/listeners/_load.cjs.map +1 -1
- package/dist/cjs/middlewares/_load.cjs +1 -1
- package/dist/cjs/middlewares/_load.cjs.map +1 -1
- package/dist/cjs/middlewares/auth.cjs +2 -2
- package/dist/cjs/middlewares/auth.cjs.map +1 -1
- package/dist/cjs/middlewares/body.cjs +2 -18
- package/dist/cjs/middlewares/body.cjs.map +1 -1
- package/dist/cjs/middlewares/cookies.cjs +1 -1
- package/dist/cjs/middlewares/cookies.cjs.map +1 -1
- package/dist/cjs/middlewares/headers.cjs +1 -1
- package/dist/cjs/middlewares/headers.cjs.map +1 -1
- package/dist/cjs/register.cjs +3 -4
- package/dist/cjs/register.cjs.map +1 -1
- package/dist/cjs/register.d.cts +0 -1
- package/dist/cjs/routes/_load.cjs +1 -1
- package/dist/cjs/routes/_load.cjs.map +1 -1
- package/dist/cjs/routes/oauth/callback.post.cjs +3 -3
- package/dist/cjs/routes/oauth/callback.post.cjs.map +1 -1
- package/dist/cjs/routes/oauth/logout.post.cjs +1 -1
- package/dist/cjs/routes/oauth/logout.post.cjs.map +1 -1
- package/dist/esm/chunk-S573YWRP.mjs +1 -1
- package/dist/esm/chunk-S573YWRP.mjs.map +1 -1
- package/dist/esm/index.d.mts +91 -109
- package/dist/esm/index.mjs +2 -6
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/lib/structures/Augmentations.d.mjs +1 -1
- package/dist/esm/lib/structures/Augmentations.d.mjs.map +1 -1
- package/dist/esm/lib/structures/Middleware.mjs +1 -1
- package/dist/esm/lib/structures/Middleware.mjs.map +1 -1
- package/dist/esm/lib/structures/MiddlewareStore.mjs +1 -1
- package/dist/esm/lib/structures/MiddlewareStore.mjs.map +1 -1
- package/dist/esm/lib/structures/Route.mjs +5 -10
- package/dist/esm/lib/structures/Route.mjs.map +1 -1
- package/dist/esm/lib/structures/RouteLoaderStrategy.mjs +1 -1
- package/dist/esm/lib/structures/RouteLoaderStrategy.mjs.map +1 -1
- package/dist/esm/lib/structures/RouteStore.mjs +1 -1
- package/dist/esm/lib/structures/RouteStore.mjs.map +1 -1
- package/dist/esm/lib/structures/api/ApiRequest.mjs +123 -6
- package/dist/esm/lib/structures/api/ApiRequest.mjs.map +1 -1
- package/dist/esm/lib/structures/api/ApiResponse.mjs +5 -6
- package/dist/esm/lib/structures/api/ApiResponse.mjs.map +1 -1
- package/dist/esm/lib/structures/api/CookieStore.mjs +1 -1
- package/dist/esm/lib/structures/api/CookieStore.mjs.map +1 -1
- package/dist/esm/lib/structures/http/Auth.mjs +1 -1
- package/dist/esm/lib/structures/http/Auth.mjs.map +1 -1
- package/dist/esm/lib/structures/http/HttpCodes.mjs +1 -1
- package/dist/esm/lib/structures/http/HttpCodes.mjs.map +1 -1
- package/dist/esm/lib/structures/http/HttpMethods.mjs +2 -1
- package/dist/esm/lib/structures/http/HttpMethods.mjs.map +1 -1
- package/dist/esm/lib/structures/http/Server.mjs +2 -9
- package/dist/esm/lib/structures/http/Server.mjs.map +1 -1
- package/dist/esm/lib/structures/router/RouterBranch.mjs +1 -1
- package/dist/esm/lib/structures/router/RouterBranch.mjs.map +1 -1
- package/dist/esm/lib/structures/router/RouterNode.mjs +1 -1
- package/dist/esm/lib/structures/router/RouterNode.mjs.map +1 -1
- package/dist/esm/lib/structures/router/RouterRoot.mjs +12 -2
- package/dist/esm/lib/structures/router/RouterRoot.mjs.map +1 -1
- package/dist/esm/lib/utils/MimeType.mjs +3 -0
- package/dist/esm/lib/utils/MimeType.mjs.map +1 -0
- package/dist/esm/lib/utils/_body/RequestHeadersProxy.mjs +95 -0
- package/dist/esm/lib/utils/_body/RequestHeadersProxy.mjs.map +1 -0
- package/dist/esm/lib/utils/_body/RequestProxy.mjs +112 -0
- package/dist/esm/lib/utils/_body/RequestProxy.mjs.map +1 -0
- package/dist/esm/lib/utils/_body/RequestURLProxy.mjs +167 -0
- package/dist/esm/lib/utils/_body/RequestURLProxy.mjs.map +1 -0
- package/dist/esm/lib/utils/constants.mjs +8 -0
- package/dist/esm/lib/utils/constants.mjs.map +1 -0
- package/dist/esm/listeners/PluginRouteError.mjs +1 -1
- package/dist/esm/listeners/PluginRouteError.mjs.map +1 -1
- package/dist/esm/listeners/PluginServerMiddlewareError.mjs +1 -1
- package/dist/esm/listeners/PluginServerMiddlewareError.mjs.map +1 -1
- package/dist/esm/listeners/PluginServerMiddlewareSuccess.mjs +1 -1
- package/dist/esm/listeners/PluginServerMiddlewareSuccess.mjs.map +1 -1
- package/dist/esm/listeners/PluginServerRequest.mjs +2 -2
- package/dist/esm/listeners/PluginServerRequest.mjs.map +1 -1
- package/dist/esm/listeners/PluginServerRouterBranchMethodNotAllowed.mjs +1 -1
- package/dist/esm/listeners/PluginServerRouterBranchMethodNotAllowed.mjs.map +1 -1
- package/dist/esm/listeners/PluginServerRouterBranchNotFound.mjs +1 -1
- package/dist/esm/listeners/PluginServerRouterBranchNotFound.mjs.map +1 -1
- package/dist/esm/listeners/PluginServerRouterFound.mjs +3 -2
- package/dist/esm/listeners/PluginServerRouterFound.mjs.map +1 -1
- package/dist/esm/listeners/_load.mjs +1 -1
- package/dist/esm/listeners/_load.mjs.map +1 -1
- package/dist/esm/middlewares/_load.mjs +1 -1
- package/dist/esm/middlewares/_load.mjs.map +1 -1
- package/dist/esm/middlewares/auth.mjs +1 -1
- package/dist/esm/middlewares/auth.mjs.map +1 -1
- package/dist/esm/middlewares/body.mjs +3 -17
- package/dist/esm/middlewares/body.mjs.map +1 -1
- package/dist/esm/middlewares/cookies.mjs +1 -1
- package/dist/esm/middlewares/cookies.mjs.map +1 -1
- package/dist/esm/middlewares/headers.mjs +1 -1
- package/dist/esm/middlewares/headers.mjs.map +1 -1
- package/dist/esm/register.d.mts +0 -1
- package/dist/esm/register.mjs +3 -4
- package/dist/esm/register.mjs.map +1 -1
- package/dist/esm/routes/_load.mjs +1 -1
- package/dist/esm/routes/_load.mjs.map +1 -1
- package/dist/esm/routes/oauth/callback.post.mjs +2 -2
- package/dist/esm/routes/oauth/callback.post.mjs.map +1 -1
- package/dist/esm/routes/oauth/logout.post.mjs +1 -1
- package/dist/esm/routes/oauth/logout.post.mjs.map +1 -1
- package/package.json +14 -12
- package/dist/cjs/lib/structures/MediaParser.cjs +0 -79
- package/dist/cjs/lib/structures/MediaParser.cjs.map +0 -1
- package/dist/cjs/lib/structures/MediaParserStore.cjs +0 -27
- package/dist/cjs/lib/structures/MediaParserStore.cjs.map +0 -1
- package/dist/cjs/lib/utils/MimeTypes.cjs +0 -26
- package/dist/cjs/lib/utils/MimeTypes.cjs.map +0 -1
- package/dist/cjs/mediaParsers/_load.cjs +0 -20
- package/dist/cjs/mediaParsers/_load.cjs.map +0 -1
- package/dist/cjs/mediaParsers/applicationFormUrlEncoded.cjs +0 -23
- package/dist/cjs/mediaParsers/applicationFormUrlEncoded.cjs.map +0 -1
- package/dist/cjs/mediaParsers/applicationJson.cjs +0 -22
- package/dist/cjs/mediaParsers/applicationJson.cjs.map +0 -1
- package/dist/cjs/mediaParsers/textPlain.cjs +0 -22
- package/dist/cjs/mediaParsers/textPlain.cjs.map +0 -1
- package/dist/esm/lib/structures/MediaParser.mjs +0 -76
- package/dist/esm/lib/structures/MediaParser.mjs.map +0 -1
- package/dist/esm/lib/structures/MediaParserStore.mjs +0 -24
- package/dist/esm/lib/structures/MediaParserStore.mjs.map +0 -1
- package/dist/esm/lib/utils/MimeTypes.mjs +0 -26
- package/dist/esm/lib/utils/MimeTypes.mjs.map +0 -1
- package/dist/esm/mediaParsers/_load.mjs +0 -17
- package/dist/esm/mediaParsers/_load.mjs.map +0 -1
- package/dist/esm/mediaParsers/applicationFormUrlEncoded.mjs +0 -20
- package/dist/esm/mediaParsers/applicationFormUrlEncoded.mjs.map +0 -1
- package/dist/esm/mediaParsers/applicationJson.mjs +0 -19
- package/dist/esm/mediaParsers/applicationJson.mjs.map +0 -1
- package/dist/esm/mediaParsers/textPlain.mjs +0 -19
- package/dist/esm/mediaParsers/textPlain.mjs.map +0 -1
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { __name, __publicField, __privateAdd, __privateSet, __privateGet } from '../../../chunk-S573YWRP.mjs';
|
|
2
|
+
import { isNullishOrEmpty } from '@sapphire/utilities';
|
|
3
|
+
import { NodeUtilInspectSymbol } from '../constants.mjs';
|
|
4
|
+
|
|
5
|
+
var _protocol, _hostname, _port, _pathname, _search, _searchParams, _request;
|
|
6
|
+
var _RequestURLProxy = class _RequestURLProxy {
|
|
7
|
+
constructor(request) {
|
|
8
|
+
__publicField(this, "hash", "");
|
|
9
|
+
__publicField(this, "password", "");
|
|
10
|
+
__publicField(this, "username", "");
|
|
11
|
+
__privateAdd(this, _protocol, null);
|
|
12
|
+
__privateAdd(this, _hostname, null);
|
|
13
|
+
__privateAdd(this, _port, null);
|
|
14
|
+
__privateAdd(this, _pathname, null);
|
|
15
|
+
__privateAdd(this, _search, null);
|
|
16
|
+
__privateAdd(this, _searchParams, null);
|
|
17
|
+
__privateAdd(this, _request);
|
|
18
|
+
__privateSet(this, _request, request);
|
|
19
|
+
}
|
|
20
|
+
get host() {
|
|
21
|
+
return __privateGet(this, _request).headers.host ?? "";
|
|
22
|
+
}
|
|
23
|
+
set host(value) {
|
|
24
|
+
__privateSet(this, _hostname, null);
|
|
25
|
+
__privateSet(this, _port, null);
|
|
26
|
+
__privateGet(this, _request).headers.host = value;
|
|
27
|
+
}
|
|
28
|
+
get hostname() {
|
|
29
|
+
if (__privateGet(this, _hostname) === null) {
|
|
30
|
+
const [hostname, port] = parseHost(__privateGet(this, _request).headers.host);
|
|
31
|
+
__privateSet(this, _hostname, hostname);
|
|
32
|
+
__privateSet(this, _port, port === -1 ? "" : String(port));
|
|
33
|
+
}
|
|
34
|
+
return __privateGet(this, _hostname);
|
|
35
|
+
}
|
|
36
|
+
set hostname(value) {
|
|
37
|
+
__privateSet(this, _hostname, value);
|
|
38
|
+
}
|
|
39
|
+
get port() {
|
|
40
|
+
if (__privateGet(this, _port) === null) {
|
|
41
|
+
const [hostname, port] = parseHost(__privateGet(this, _request).headers.host);
|
|
42
|
+
__privateSet(this, _hostname, hostname);
|
|
43
|
+
__privateSet(this, _port, port === -1 ? String(__privateGet(this, _request).socket.localPort ?? "") : String(port));
|
|
44
|
+
}
|
|
45
|
+
return __privateGet(this, _port);
|
|
46
|
+
}
|
|
47
|
+
set port(value) {
|
|
48
|
+
__privateSet(this, _port, String(Number(value || "")));
|
|
49
|
+
}
|
|
50
|
+
get pathname() {
|
|
51
|
+
if (__privateGet(this, _pathname) === null) {
|
|
52
|
+
const [pathname, search] = parsePath(__privateGet(this, _request).url);
|
|
53
|
+
__privateSet(this, _pathname, pathname);
|
|
54
|
+
__privateGet(this, _search) ?? __privateSet(this, _search, search);
|
|
55
|
+
}
|
|
56
|
+
return __privateGet(this, _pathname);
|
|
57
|
+
}
|
|
58
|
+
set pathname(value) {
|
|
59
|
+
const normalized = value.startsWith("/") ? value : `/${value}`;
|
|
60
|
+
if (normalized === __privateGet(this, _pathname)) return;
|
|
61
|
+
__privateSet(this, _pathname, normalized);
|
|
62
|
+
__privateGet(this, _request).url = normalized + this.search;
|
|
63
|
+
}
|
|
64
|
+
get search() {
|
|
65
|
+
if (__privateGet(this, _search) === null) {
|
|
66
|
+
const [pathname, search] = parsePath(__privateGet(this, _request).url);
|
|
67
|
+
__privateGet(this, _pathname) ?? __privateSet(this, _pathname, pathname);
|
|
68
|
+
__privateSet(this, _search, search);
|
|
69
|
+
}
|
|
70
|
+
return __privateGet(this, _search);
|
|
71
|
+
}
|
|
72
|
+
set search(value) {
|
|
73
|
+
let normalized;
|
|
74
|
+
if (value === "?") {
|
|
75
|
+
normalized = "";
|
|
76
|
+
} else if (value && !value.startsWith("?")) {
|
|
77
|
+
normalized = `?${value}`;
|
|
78
|
+
} else {
|
|
79
|
+
normalized = value;
|
|
80
|
+
}
|
|
81
|
+
if (normalized === __privateGet(this, _search)) return;
|
|
82
|
+
__privateSet(this, _search, normalized);
|
|
83
|
+
__privateSet(this, _searchParams, null);
|
|
84
|
+
__privateGet(this, _request).url = this.pathname + normalized;
|
|
85
|
+
}
|
|
86
|
+
get searchParams() {
|
|
87
|
+
__privateGet(this, _searchParams) ?? __privateSet(this, _searchParams, new URLSearchParams(this.search));
|
|
88
|
+
return __privateGet(this, _searchParams);
|
|
89
|
+
}
|
|
90
|
+
set searchParams(value) {
|
|
91
|
+
__privateSet(this, _searchParams, value);
|
|
92
|
+
this.search = value.toString();
|
|
93
|
+
}
|
|
94
|
+
get protocol() {
|
|
95
|
+
__privateGet(this, _protocol) ?? __privateSet(this, _protocol, __privateGet(this, _request).socket.encrypted || __privateGet(this, _request).headers["x-forwarded-proto"] === "https" ? "https:" : "http:");
|
|
96
|
+
return __privateGet(this, _protocol);
|
|
97
|
+
}
|
|
98
|
+
set protocol(value) {
|
|
99
|
+
__privateSet(this, _protocol, value);
|
|
100
|
+
}
|
|
101
|
+
get origin() {
|
|
102
|
+
return `${this.protocol}//${this.host}`;
|
|
103
|
+
}
|
|
104
|
+
set origin(_value) {
|
|
105
|
+
}
|
|
106
|
+
get href() {
|
|
107
|
+
return `${this.protocol}//${this.host}${this.pathname}${this.search}`;
|
|
108
|
+
}
|
|
109
|
+
set href(value) {
|
|
110
|
+
const url = new URL(value);
|
|
111
|
+
__privateSet(this, _protocol, url.protocol);
|
|
112
|
+
this.username = url.username;
|
|
113
|
+
this.password = url.password;
|
|
114
|
+
__privateSet(this, _hostname, url.hostname);
|
|
115
|
+
__privateSet(this, _port, url.port);
|
|
116
|
+
__privateSet(this, _pathname, url.pathname);
|
|
117
|
+
__privateSet(this, _search, url.search);
|
|
118
|
+
this.hash = url.hash;
|
|
119
|
+
}
|
|
120
|
+
toString() {
|
|
121
|
+
return this.href;
|
|
122
|
+
}
|
|
123
|
+
toJSON() {
|
|
124
|
+
return this.href;
|
|
125
|
+
}
|
|
126
|
+
// eslint-disable-next-line @typescript-eslint/class-literal-property-style
|
|
127
|
+
get [Symbol.toStringTag]() {
|
|
128
|
+
return "URL";
|
|
129
|
+
}
|
|
130
|
+
[NodeUtilInspectSymbol]() {
|
|
131
|
+
return this.href;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
_protocol = new WeakMap();
|
|
135
|
+
_hostname = new WeakMap();
|
|
136
|
+
_port = new WeakMap();
|
|
137
|
+
_pathname = new WeakMap();
|
|
138
|
+
_search = new WeakMap();
|
|
139
|
+
_searchParams = new WeakMap();
|
|
140
|
+
_request = new WeakMap();
|
|
141
|
+
__name(_RequestURLProxy, "RequestURLProxy");
|
|
142
|
+
var RequestURLProxy = _RequestURLProxy;
|
|
143
|
+
function parsePath(input) {
|
|
144
|
+
const url = (input ?? "/").replaceAll("\\", "/");
|
|
145
|
+
const index = url.indexOf("?");
|
|
146
|
+
if (index === -1) {
|
|
147
|
+
return [url, ""];
|
|
148
|
+
}
|
|
149
|
+
return [url.slice(0, index), url.slice(index)];
|
|
150
|
+
}
|
|
151
|
+
__name(parsePath, "parsePath");
|
|
152
|
+
function parseHost(host) {
|
|
153
|
+
if (isNullishOrEmpty(host)) {
|
|
154
|
+
return ["localhost", -1];
|
|
155
|
+
}
|
|
156
|
+
const index = host.indexOf(":");
|
|
157
|
+
if (index === -1) {
|
|
158
|
+
return [host, -1];
|
|
159
|
+
}
|
|
160
|
+
const port = Number(host.slice(index));
|
|
161
|
+
return [host.slice(0, index), Number.isSafeInteger(port) ? port : -1];
|
|
162
|
+
}
|
|
163
|
+
__name(parseHost, "parseHost");
|
|
164
|
+
|
|
165
|
+
export { RequestURLProxy };
|
|
166
|
+
//# sourceMappingURL=RequestURLProxy.mjs.map
|
|
167
|
+
//# sourceMappingURL=RequestURLProxy.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/lib/utils/_body/RequestURLProxy.ts"],"names":[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,EAAA,MAAM,IAAO,GAAA,MAAA,CAAO,IAAK,CAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AACrC,EAAO,OAAA,CAAC,IAAK,CAAA,KAAA,CAAM,CAAG,EAAA,KAAK,CAAG,EAAA,MAAA,CAAO,aAAc,CAAA,IAAI,CAAI,GAAA,IAAA,GAAO,CAAE,CAAA,CAAA;AACrE;AAZS,MAAA,CAAA,SAAA,EAAA,WAAA,CAAA","file":"RequestURLProxy.mjs","sourcesContent":["import { isNullishOrEmpty } from '@sapphire/utilities';\nimport type { ApiRequest } from '../../structures/api/ApiRequest';\nimport { NodeUtilInspectSymbol } from '../constants';\n\nexport class RequestURLProxy implements URL {\n\tpublic hash: string = '';\n\tpublic password: string = '';\n\tpublic username: string = '';\n\n\t#protocol: URLProtocol | null = null;\n\t#hostname: string | null = null;\n\t#port: string | null = null;\n\n\t#pathname: string | null = null;\n\t#search: string | null = null;\n\t#searchParams: URLSearchParams | null = null;\n\n\treadonly #request: ApiRequest;\n\n\tpublic constructor(request: ApiRequest) {\n\t\tthis.#request = request;\n\t}\n\n\tpublic get host(): string {\n\t\treturn this.#request.headers.host ?? '';\n\t}\n\n\tpublic set host(value: string) {\n\t\tthis.#hostname = null;\n\t\tthis.#port = null;\n\t\tthis.#request.headers.host = value;\n\t}\n\n\tpublic get hostname(): string {\n\t\tif (this.#hostname === null) {\n\t\t\tconst [hostname, port] = parseHost(this.#request.headers.host);\n\t\t\tthis.#hostname = hostname;\n\t\t\tthis.#port = port === -1 ? '' : String(port);\n\t\t}\n\n\t\treturn this.#hostname;\n\t}\n\n\tpublic set hostname(value: string) {\n\t\tthis.#hostname = value;\n\t}\n\n\tpublic get port(): string {\n\t\tif (this.#port === null) {\n\t\t\tconst [hostname, port] = parseHost(this.#request.headers.host);\n\t\t\tthis.#hostname = hostname;\n\t\t\tthis.#port = port === -1 ? String(this.#request.socket.localPort ?? '') : String(port);\n\t\t}\n\n\t\treturn this.#port;\n\t}\n\n\tpublic set port(value: string) {\n\t\tthis.#port = String(Number(value || ''));\n\t}\n\n\tpublic get pathname(): string {\n\t\tif (this.#pathname === null) {\n\t\t\tconst [pathname, search] = parsePath(this.#request.url);\n\t\t\tthis.#pathname = pathname;\n\t\t\tthis.#search ??= search;\n\t\t}\n\n\t\treturn this.#pathname;\n\t}\n\n\tpublic set pathname(value: string) {\n\t\tconst normalized = value.startsWith('/') ? value : `/${value}`;\n\t\tif (normalized === this.#pathname) return;\n\n\t\tthis.#pathname = normalized;\n\t\tthis.#request.url = normalized + this.search;\n\t}\n\n\tpublic get search(): string {\n\t\tif (this.#search === null) {\n\t\t\tconst [pathname, search] = parsePath(this.#request.url);\n\t\t\tthis.#pathname ??= pathname;\n\t\t\tthis.#search = search;\n\t\t}\n\n\t\treturn this.#search;\n\t}\n\n\tpublic set search(value: string) {\n\t\tlet normalized: string;\n\t\tif (value === '?') {\n\t\t\tnormalized = '';\n\t\t} else if (value && !value.startsWith('?')) {\n\t\t\tnormalized = `?${value}`;\n\t\t} else {\n\t\t\tnormalized = value;\n\t\t}\n\n\t\tif (normalized === this.#search) return;\n\n\t\tthis.#search = normalized;\n\t\tthis.#searchParams = null;\n\t\tthis.#request.url = this.pathname + normalized;\n\t}\n\n\tpublic get searchParams(): URLSearchParams {\n\t\tthis.#searchParams ??= new URLSearchParams(this.search);\n\t\treturn this.#searchParams;\n\t}\n\n\tpublic set searchParams(value: URLSearchParams) {\n\t\tthis.#searchParams = value;\n\t\tthis.search = value.toString();\n\t}\n\n\tpublic get protocol(): URLProtocol {\n\t\tthis.#protocol ??= (this.#request.socket as any).encrypted || this.#request.headers['x-forwarded-proto'] === 'https' ? 'https:' : 'http:';\n\t\treturn this.#protocol;\n\t}\n\n\tpublic set protocol(value: URLProtocol) {\n\t\tthis.#protocol = value;\n\t}\n\n\tpublic get origin(): string {\n\t\treturn `${this.protocol}//${this.host}`;\n\t}\n\n\tpublic set origin(_value: string) {\n\t\t// No-op\n\t}\n\n\tpublic get href(): string {\n\t\treturn `${this.protocol}//${this.host}${this.pathname}${this.search}`;\n\t}\n\n\tpublic set href(value: string) {\n\t\tconst url = new URL(value);\n\t\tthis.#protocol = url.protocol as URLProtocol;\n\t\tthis.username = url.username;\n\t\tthis.password = url.password;\n\t\tthis.#hostname = url.hostname;\n\t\tthis.#port = url.port;\n\t\tthis.#pathname = url.pathname;\n\t\tthis.#search = url.search;\n\t\tthis.hash = url.hash;\n\t}\n\n\tpublic toString(): string {\n\t\treturn this.href;\n\t}\n\n\tpublic toJSON(): string {\n\t\treturn this.href;\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/class-literal-property-style\n\tpublic get [Symbol.toStringTag]() {\n\t\treturn 'URL';\n\t}\n\n\tpublic [NodeUtilInspectSymbol]() {\n\t\treturn this.href;\n\t}\n}\n\nexport type URLProtocol = 'https:' | 'http:';\n\nfunction parsePath(input: string | undefined): [pathname: string, search: string] {\n\tconst url = (input ?? '/').replaceAll('\\\\', '/');\n\tconst index = url.indexOf('?');\n\tif (index === -1) {\n\t\treturn [url, ''];\n\t}\n\n\treturn [url.slice(0, index), url.slice(index)];\n}\n\nfunction parseHost(host: string | undefined): [hostname: string, port: number] {\n\tif (isNullishOrEmpty(host)) {\n\t\treturn ['localhost', -1];\n\t}\n\n\tconst index = host.indexOf(':');\n\tif (index === -1) {\n\t\treturn [host, -1];\n\t}\n\n\tconst port = Number(host.slice(index));\n\treturn [host.slice(0, index), Number.isSafeInteger(port) ? port : -1];\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/utils/constants.ts"],"names":[],"mappings":";;;AAAa,IAAA,qBAAA,GAAwB,MAAO,CAAA,GAAA,CAAI,4BAA4B","file":"constants.mjs","sourcesContent":["export const NodeUtilInspectSymbol = Symbol.for('nodejs.util.inspect.custom');\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/listeners/PluginRouteError.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"sources":["../../../src/listeners/PluginRouteError.ts"],"names":[],"mappings":";;;;;AAMO,IAAM,eAAA,GAAN,MAAM,eAAA,SAAuB,QAAS,CAAA;AAAA,EACrC,YAAY,OAAiC,EAAA;AACnD,IAAA,KAAA,CAAM,SAAS,EAAE,OAAA,EAAS,UAAU,KAAO,EAAA,WAAA,CAAY,YAAY,CAAA;AAAA;AACpE,EAEgB,GAAA,CAAI,KAAc,EAAA,QAAA,EAAsB,QAAuB,EAAA;AAE9E,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,KAAA,CAAM,KAAK,CAAA;AAGjC,IAAA,IAAI,CAAC,QAAA,CAAS,aAAe,EAAA,QAAA,CAAS,OAAO,SAAU,CAAA,mBAAmB,CAAE,CAAA,IAAA,CAAK,EAAE,KAAA,EAAO,KAAM,CAAA,OAAA,IAAW,OAAO,CAAA;AAAA;AAEpH,CAAA;AAZ6C,MAAA,CAAA,eAAA,EAAA,gBAAA,CAAA;AAAtC,IAAM,cAAN,GAAA","file":"PluginRouteError.mjs","sourcesContent":["import { Listener } from '@sapphire/framework';\nimport type { ApiRequest } from '../lib/structures/api/ApiRequest';\nimport type { ApiResponse } from '../lib/structures/api/ApiResponse';\nimport { HttpCodes } from '../lib/structures/http/HttpCodes';\nimport { ServerEvent } from '../lib/structures/http/Server';\n\nexport class PluginListener extends Listener {\n\tpublic constructor(context: Listener.LoaderContext) {\n\t\tsuper(context, { emitter: 'server', event: ServerEvent.RouteError });\n\t}\n\n\tpublic override run(error: Error, _request: ApiRequest, response: ApiResponse) {\n\t\t// Log the error to console:\n\t\tthis.container.logger.fatal(error);\n\n\t\t// Send a response to the client if none was sent:\n\t\tif (!response.writableEnded) response.status(HttpCodes.InternalServerError).json({ error: error.message ?? error });\n\t}\n}\n"]}
|
|
@@ -16,5 +16,5 @@ __name(_PluginListener, "PluginListener");
|
|
|
16
16
|
var PluginListener = _PluginListener;
|
|
17
17
|
|
|
18
18
|
export { PluginListener };
|
|
19
|
-
//# sourceMappingURL=
|
|
19
|
+
//# sourceMappingURL=PluginServerMiddlewareError.mjs.map
|
|
20
20
|
//# sourceMappingURL=PluginServerMiddlewareError.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/listeners/PluginServerMiddlewareError.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"sources":["../../../src/listeners/PluginServerMiddlewareError.ts"],"names":[],"mappings":";;;;;AAMO,IAAM,eAAA,GAAN,MAAM,eAAA,SAAuB,QAAS,CAAA;AAAA,EACrC,YAAY,OAAiC,EAAA;AACnD,IAAA,KAAA,CAAM,SAAS,EAAE,OAAA,EAAS,UAAU,KAAO,EAAA,WAAA,CAAY,iBAAiB,CAAA;AAAA;AACzE,EAEgB,GAAA,CAAI,KAAc,EAAA,QAAA,EAAsB,QAAuB,EAAA;AAE9E,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,KAAA,CAAM,KAAK,CAAA;AAGjC,IAAA,IAAI,CAAC,QAAA,CAAS,aAAe,EAAA,QAAA,CAAS,OAAO,SAAU,CAAA,mBAAmB,CAAE,CAAA,IAAA,CAAK,EAAE,KAAA,EAAO,KAAM,CAAA,OAAA,IAAW,OAAO,CAAA;AAAA;AAEpH,CAAA;AAZ6C,MAAA,CAAA,eAAA,EAAA,gBAAA,CAAA;AAAtC,IAAM,cAAN,GAAA","file":"PluginServerMiddlewareError.mjs","sourcesContent":["import { Listener } from '@sapphire/framework';\nimport type { ApiRequest } from '../lib/structures/api/ApiRequest';\nimport type { ApiResponse } from '../lib/structures/api/ApiResponse';\nimport { HttpCodes } from '../lib/structures/http/HttpCodes';\nimport { ServerEvent } from '../lib/structures/http/Server';\n\nexport class PluginListener extends Listener {\n\tpublic constructor(context: Listener.LoaderContext) {\n\t\tsuper(context, { emitter: 'server', event: ServerEvent.MiddlewareError });\n\t}\n\n\tpublic override run(error: Error, _request: ApiRequest, response: ApiResponse) {\n\t\t// Log the error to console:\n\t\tthis.container.logger.fatal(error);\n\n\t\t// Send a response to the client if none was sent:\n\t\tif (!response.writableEnded) response.status(HttpCodes.InternalServerError).json({ error: error.message ?? error });\n\t}\n}\n"]}
|
|
@@ -18,5 +18,5 @@ __name(_PluginListener, "PluginListener");
|
|
|
18
18
|
var PluginListener = _PluginListener;
|
|
19
19
|
|
|
20
20
|
export { PluginListener };
|
|
21
|
-
//# sourceMappingURL=
|
|
21
|
+
//# sourceMappingURL=PluginServerMiddlewareSuccess.mjs.map
|
|
22
22
|
//# sourceMappingURL=PluginServerMiddlewareSuccess.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/listeners/PluginServerMiddlewareSuccess.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/listeners/PluginServerMiddlewareSuccess.ts"],"names":[],"mappings":";;;;AAKO,IAAM,eAAA,GAAN,MAAM,eAAA,SAAuB,QAAS,CAAA;AAAA,EACrC,YAAY,OAAiC,EAAA;AACnD,IAAA,KAAA,CAAM,SAAS,EAAE,OAAA,EAAS,UAAU,KAAO,EAAA,WAAA,CAAY,mBAAmB,CAAA;AAAA;AAC3E,EAEA,MAAsB,GAAI,CAAA,OAAA,EAAqB,QAAuB,EAAA;AACrE,IAAI,IAAA;AACH,MAAA,MAAM,OAAQ,CAAA,KAAA,CAAO,GAAI,CAAA,OAAA,EAAS,QAAQ,CAAA;AAAA,aAClC,KAAO,EAAA;AACf,MAAA,IAAA,CAAK,UAAU,MAAO,CAAA,IAAA,CAAK,YAAY,UAAY,EAAA,KAAA,EAAgB,SAAS,QAAQ,CAAA;AAAA;AACrF;AAEF,CAAA;AAZ6C,MAAA,CAAA,eAAA,EAAA,gBAAA,CAAA;AAAtC,IAAM,cAAN,GAAA","file":"PluginServerMiddlewareSuccess.mjs","sourcesContent":["import { Listener } from '@sapphire/framework';\nimport type { ApiRequest } from '../lib/structures/api/ApiRequest';\nimport type { ApiResponse } from '../lib/structures/api/ApiResponse';\nimport { ServerEvent } from '../lib/structures/http/Server';\n\nexport class PluginListener extends Listener {\n\tpublic constructor(context: Listener.LoaderContext) {\n\t\tsuper(context, { emitter: 'server', event: ServerEvent.MiddlewareSuccess });\n\t}\n\n\tpublic override async run(request: ApiRequest, response: ApiResponse) {\n\t\ttry {\n\t\t\tawait request.route!.run(request, response);\n\t\t} catch (error) {\n\t\t\tthis.container.server.emit(ServerEvent.RouteError, error as Error, request, response);\n\t\t}\n\t}\n}\n"]}
|
|
@@ -29,7 +29,7 @@ var _PluginListener = class _PluginListener extends Listener {
|
|
|
29
29
|
if (branch === null) {
|
|
30
30
|
this.container.server.emit(ServerEvent.RouterBranchNotFound, request, response);
|
|
31
31
|
} else if (route === null) {
|
|
32
|
-
this.container.server.emit(ServerEvent.RouterBranchMethodNotAllowed, request, response);
|
|
32
|
+
this.container.server.emit(ServerEvent.RouterBranchMethodNotAllowed, request, response, branch);
|
|
33
33
|
} else {
|
|
34
34
|
this.container.server.emit(ServerEvent.RouterFound, request, response);
|
|
35
35
|
}
|
|
@@ -53,5 +53,5 @@ __name(_PluginListener, "PluginListener");
|
|
|
53
53
|
var PluginListener = _PluginListener;
|
|
54
54
|
|
|
55
55
|
export { PluginListener };
|
|
56
|
-
//# sourceMappingURL=
|
|
56
|
+
//# sourceMappingURL=PluginServerRequest.mjs.map
|
|
57
57
|
//# sourceMappingURL=PluginServerRequest.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/listeners/PluginServerRequest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/listeners/PluginServerRequest.ts"],"names":[],"mappings":";;;;;AAAA,IAAA,yBAAA,EAAA,WAAA;AAOO,IAAM,eAAA,GAAN,MAAM,eAAA,SAAuB,QAAS,CAAA;AAAA,EACrC,YAAY,OAAiC,EAAA;AACnD,IAAA,KAAA,CAAM,SAAS,EAAE,OAAA,EAAS,UAAU,KAAO,EAAA,WAAA,CAAY,SAAS,C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AA;AAAA,KAC/E,MAAA,IAAW,UAAU,IAAM,EAAA;AAC1B,MAAA,IAAA,CAAK,UAAU,MAAO,CAAA,IAAA,CAAK,YAAY,4BAA8B,EAAA,OAAA,EAAS,UAAU,MAAM,CAAA;AAAA,KACxF,MAAA;AACN,MAAA,IAAA,CAAK,UAAU,MAAO,CAAA,IAAA,CAAK,WAAY,CAAA,WAAA,EAAa,SAAS,QAAQ,CAAA;AAAA;AACtE;AAkBF,CAAA;AAtDO,yBAAA,GAAA,IAAA,OAAA,EAAA;AAuCN,WAAS,mBAAA,MAAA,CAAA,SAAC,MAAM,EAAI,EAAA;AACnB,EAAM,MAAA,KAAA,GAAQ,GAAI,CAAA,OAAA,CAAQ,GAAG,CAAA;AAE7B,EAAI,IAAA,QAAA;AACJ,EAAI,IAAA,WAAA;AACJ,EAAA,IAAI,UAAU,CAAI,CAAA,EAAA;AACjB,IAAW,QAAA,GAAA,GAAA;AACX,IAAc,WAAA,GAAA,EAAA;AAAA,GACR,MAAA;AACN,IAAW,QAAA,GAAA,GAAA,CAAI,SAAU,CAAA,CAAA,EAAG,KAAK,CAAA;AACjC,IAAc,WAAA,GAAA,GAAA,CAAI,SAAU,CAAA,KAAA,GAAQ,CAAC,CAAA;AAAA;AAGtC,EAAA,OAAO,EAAE,KAAO,EAAA,UAAA,CAAW,SAAU,CAAA,QAAQ,GAAG,WAAY,EAAA;AAC7D,CAdS,EAAA,WAAA,CAAA;AAvCmC,MAAA,CAAA,eAAA,EAAA,gBAAA,CAAA;AAAtC,IAAM,cAAN,GAAA","file":"PluginServerRequest.mjs","sourcesContent":["import { Listener } from '@sapphire/framework';\nimport type { ApiRequest } from '../lib/structures/api/ApiRequest';\nimport type { ApiResponse } from '../lib/structures/api/ApiResponse';\nimport type { MethodName } from '../lib/structures/http/HttpMethods';\nimport { ServerEvent } from '../lib/structures/http/Server';\nimport { RouterRoot } from '../lib/structures/router/RouterRoot';\n\nexport class PluginListener extends Listener {\n\tpublic constructor(context: Listener.LoaderContext) {\n\t\tsuper(context, { emitter: 'server', event: ServerEvent.Request });\n\t}\n\n\tpublic override async run(request: ApiRequest, response: ApiResponse) {\n\t\tconst { parts, querystring } = this.#parseURL(request.url);\n\t\trequest.query = Object.fromEntries(new URLSearchParams(querystring).entries());\n\n\t\tconst branch = this.container.server.routes.router.find(parts);\n\t\tconst node = branch ? branch.node : null;\n\t\tconst route = node ? node.get((request.method ?? 'GET') as MethodName) : null;\n\n\t\tif (node !== null) {\n\t\t\trequest.params = node!.extractParameters(parts);\n\t\t}\n\n\t\trequest.routerNode = node;\n\t\trequest.route = route;\n\n\t\ttry {\n\t\t\t// Middlewares need to be run regardless of the match, specially since browsers do an OPTIONS request first.\n\t\t\tawait this.container.server.middlewares.run(request, response);\n\t\t} catch (error) {\n\t\t\tthis.container.server.emit(ServerEvent.MiddlewareError, error as Error, request, response);\n\n\t\t\t// If a middleware errored, it might cause undefined behavior in the routes, so we will return early.\n\t\t\treturn;\n\t\t}\n\n\t\tif (branch === null) {\n\t\t\tthis.container.server.emit(ServerEvent.RouterBranchNotFound, request, response);\n\t\t} else if (route === null) {\n\t\t\tthis.container.server.emit(ServerEvent.RouterBranchMethodNotAllowed, request, response, branch);\n\t\t} else {\n\t\t\tthis.container.server.emit(ServerEvent.RouterFound, request, response);\n\t\t}\n\t}\n\n\t#parseURL(url = '') {\n\t\tconst index = url.indexOf('?');\n\n\t\tlet pathname: string;\n\t\tlet querystring: string;\n\t\tif (index === -1) {\n\t\t\tpathname = url;\n\t\t\tquerystring = '';\n\t\t} else {\n\t\t\tpathname = url.substring(0, index);\n\t\t\tquerystring = url.substring(index + 1);\n\t\t}\n\n\t\treturn { parts: RouterRoot.normalize(pathname), querystring };\n\t}\n}\n"]}
|
|
@@ -14,5 +14,5 @@ __name(_PluginListener, "PluginListener");
|
|
|
14
14
|
var PluginListener = _PluginListener;
|
|
15
15
|
|
|
16
16
|
export { PluginListener };
|
|
17
|
-
//# sourceMappingURL=
|
|
17
|
+
//# sourceMappingURL=PluginServerRouterBranchMethodNotAllowed.mjs.map
|
|
18
18
|
//# sourceMappingURL=PluginServerRouterBranchMethodNotAllowed.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/listeners/PluginServerRouterBranchMethodNotAllowed.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/listeners/PluginServerRouterBranchMethodNotAllowed.ts"],"names":[],"mappings":";;;;AAKO,IAAM,eAAA,GAAN,MAAM,eAAA,SAAuB,QAAS,CAAA;AAAA,EACrC,YAAY,OAAiC,EAAA;AACnD,IAAA,KAAA,CAAM,SAAS,EAAE,OAAA,EAAS,UAAU,KAAO,EAAA,WAAA,CAAY,8BAA8B,CAAA;AAAA;AACtF,EAEgB,GAAA,CAAI,GAAe,QAAuB,EAAA;AACzD,IAAA,IAAI,CAAC,QAAA,CAAS,aAAe,EAAA,QAAA,CAAS,gBAAiB,EAAA;AAAA;AAEzD,CAAA;AAR6C,MAAA,CAAA,eAAA,EAAA,gBAAA,CAAA;AAAtC,IAAM,cAAN,GAAA","file":"PluginServerRouterBranchMethodNotAllowed.mjs","sourcesContent":["import { Listener } from '@sapphire/framework';\nimport type { ApiRequest } from '../lib/structures/api/ApiRequest';\nimport type { ApiResponse } from '../lib/structures/api/ApiResponse';\nimport { ServerEvent } from '../lib/structures/http/Server';\n\nexport class PluginListener extends Listener {\n\tpublic constructor(context: Listener.LoaderContext) {\n\t\tsuper(context, { emitter: 'server', event: ServerEvent.RouterBranchMethodNotAllowed });\n\t}\n\n\tpublic override run(_: ApiRequest, response: ApiResponse) {\n\t\tif (!response.writableEnded) response.methodNotAllowed();\n\t}\n}\n"]}
|
|
@@ -14,5 +14,5 @@ __name(_PluginListener, "PluginListener");
|
|
|
14
14
|
var PluginListener = _PluginListener;
|
|
15
15
|
|
|
16
16
|
export { PluginListener };
|
|
17
|
-
//# sourceMappingURL=
|
|
17
|
+
//# sourceMappingURL=PluginServerRouterBranchNotFound.mjs.map
|
|
18
18
|
//# sourceMappingURL=PluginServerRouterBranchNotFound.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/listeners/PluginServerRouterBranchNotFound.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/listeners/PluginServerRouterBranchNotFound.ts"],"names":[],"mappings":";;;;AAKO,IAAM,eAAA,GAAN,MAAM,eAAA,SAAuB,QAAS,CAAA;AAAA,EACrC,YAAY,OAAiC,EAAA;AACnD,IAAA,KAAA,CAAM,SAAS,EAAE,OAAA,EAAS,UAAU,KAAO,EAAA,WAAA,CAAY,sBAAsB,CAAA;AAAA;AAC9E,EAEgB,GAAA,CAAI,GAAe,QAAuB,EAAA;AACzD,IAAA,IAAI,CAAC,QAAA,CAAS,aAAe,EAAA,QAAA,CAAS,QAAS,EAAA;AAAA;AAEjD,CAAA;AAR6C,MAAA,CAAA,eAAA,EAAA,gBAAA,CAAA;AAAtC,IAAM,cAAN,GAAA","file":"PluginServerRouterBranchNotFound.mjs","sourcesContent":["import { Listener } from '@sapphire/framework';\nimport type { ApiRequest } from '../lib/structures/api/ApiRequest';\nimport type { ApiResponse } from '../lib/structures/api/ApiResponse';\nimport { ServerEvent } from '../lib/structures/http/Server';\n\nexport class PluginListener extends Listener {\n\tpublic constructor(context: Listener.LoaderContext) {\n\t\tsuper(context, { emitter: 'server', event: ServerEvent.RouterBranchNotFound });\n\t}\n\n\tpublic override run(_: ApiRequest, response: ApiResponse) {\n\t\tif (!response.writableEnded) response.notFound();\n\t}\n}\n"]}
|
|
@@ -7,12 +7,13 @@ var _PluginListener = class _PluginListener extends Listener {
|
|
|
7
7
|
super(context, { emitter: "server", event: ServerEvent.RouterFound });
|
|
8
8
|
}
|
|
9
9
|
run(request, response) {
|
|
10
|
-
|
|
10
|
+
const event = response.writableEnded ? ServerEvent.MiddlewareFailure : ServerEvent.MiddlewareSuccess;
|
|
11
|
+
this.container.server.emit(event, request, response);
|
|
11
12
|
}
|
|
12
13
|
};
|
|
13
14
|
__name(_PluginListener, "PluginListener");
|
|
14
15
|
var PluginListener = _PluginListener;
|
|
15
16
|
|
|
16
17
|
export { PluginListener };
|
|
17
|
-
//# sourceMappingURL=
|
|
18
|
+
//# sourceMappingURL=PluginServerRouterFound.mjs.map
|
|
18
19
|
//# sourceMappingURL=PluginServerRouterFound.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/listeners/PluginServerRouterFound.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/listeners/PluginServerRouterFound.ts"],"names":[],"mappings":";;;;AAKO,IAAM,eAAA,GAAN,MAAM,eAAA,SAAuB,QAAS,CAAA;AAAA,EACrC,YAAY,OAAiC,EAAA;AACnD,IAAA,KAAA,CAAM,SAAS,EAAE,OAAA,EAAS,UAAU,KAAO,EAAA,WAAA,CAAY,aAAa,CAAA;AAAA;AACrE,EAEgB,GAAA,CAAI,SAAqB,QAAuB,EAAA;AAC/D,IAAA,MAAM,KAAQ,GAAA,QAAA,CAAS,aAAgB,GAAA,WAAA,CAAY,oBAAoB,WAAY,CAAA,iBAAA;AACnF,IAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAO,IAAK,CAAA,KAAA,EAAO,SAAS,QAAQ,CAAA;AAAA;AAErD,CAAA;AAT6C,MAAA,CAAA,eAAA,EAAA,gBAAA,CAAA;AAAtC,IAAM,cAAN,GAAA","file":"PluginServerRouterFound.mjs","sourcesContent":["import { Listener } from '@sapphire/framework';\nimport type { ApiRequest } from '../lib/structures/api/ApiRequest';\nimport type { ApiResponse } from '../lib/structures/api/ApiResponse';\nimport { ServerEvent } from '../lib/structures/http/Server';\n\nexport class PluginListener extends Listener {\n\tpublic constructor(context: Listener.LoaderContext) {\n\t\tsuper(context, { emitter: 'server', event: ServerEvent.RouterFound });\n\t}\n\n\tpublic override run(request: ApiRequest, response: ApiResponse) {\n\t\tconst event = response.writableEnded ? ServerEvent.MiddlewareFailure : ServerEvent.MiddlewareSuccess;\n\t\tthis.container.server.emit(event, request, response);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/listeners/_load.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/listeners/_load.ts"],"names":["PluginRouteError","PluginServerMiddlewareError","PluginServerMiddlewareSuccess","PluginServerRequest","PluginServerRouterBranchMethodNotAllowed","PluginServerRouterBranchNotFound","PluginServerRouterFound"],"mappings":";;;;;;;;;;AASO,SAAS,aAAgB,GAAA;AAC/B,EAAA,MAAM,KAAQ,GAAA,WAAA;AACd,EAAK,KAAA,SAAA,CAAU,OAAO,SAAU,CAAA,EAAE,MAAM,kBAAoB,EAAA,KAAA,EAAOA,cAAkB,EAAA,KAAA,EAAO,CAAA;AAC5F,EAAK,KAAA,SAAA,CAAU,OAAO,SAAU,CAAA,EAAE,MAAM,6BAA+B,EAAA,KAAA,EAAOC,gBAA6B,EAAA,KAAA,EAAO,CAAA;AAClH,EAAK,KAAA,SAAA,CAAU,OAAO,SAAU,CAAA,EAAE,MAAM,+BAAiC,EAAA,KAAA,EAAOC,gBAA+B,EAAA,KAAA,EAAO,CAAA;AACtH,EAAK,KAAA,SAAA,CAAU,OAAO,SAAU,CAAA,EAAE,MAAM,qBAAuB,EAAA,KAAA,EAAOC,gBAAqB,EAAA,KAAA,EAAO,CAAA;AAClG,EAAK,KAAA,SAAA,CAAU,OAAO,SAAU,CAAA,EAAE,MAAM,0CAA4C,EAAA,KAAA,EAAOC,gBAA0C,EAAA,KAAA,EAAO,CAAA;AAC5I,EAAK,KAAA,SAAA,CAAU,OAAO,SAAU,CAAA,EAAE,MAAM,kCAAoC,EAAA,KAAA,EAAOC,gBAAkC,EAAA,KAAA,EAAO,CAAA;AAC5H,EAAK,KAAA,SAAA,CAAU,OAAO,SAAU,CAAA,EAAE,MAAM,yBAA2B,EAAA,KAAA,EAAOC,gBAAyB,EAAA,KAAA,EAAO,CAAA;AAC3G;AATgB,MAAA,CAAA,aAAA,EAAA,eAAA,CAAA","file":"_load.mjs","sourcesContent":["import { container } from '@sapphire/pieces';\nimport { PluginListener as PluginRouteError } from './PluginRouteError';\nimport { PluginListener as PluginServerMiddlewareError } from './PluginServerMiddlewareError';\nimport { PluginListener as PluginServerMiddlewareSuccess } from './PluginServerMiddlewareSuccess';\nimport { PluginListener as PluginServerRequest } from './PluginServerRequest';\nimport { PluginListener as PluginServerRouterBranchMethodNotAllowed } from './PluginServerRouterBranchMethodNotAllowed';\nimport { PluginListener as PluginServerRouterBranchNotFound } from './PluginServerRouterBranchNotFound';\nimport { PluginListener as PluginServerRouterFound } from './PluginServerRouterFound';\n\nexport function loadListeners() {\n\tconst store = 'listeners';\n\tvoid container.stores.loadPiece({ name: 'PluginRouteError', piece: PluginRouteError, store });\n\tvoid container.stores.loadPiece({ name: 'PluginServerMiddlewareError', piece: PluginServerMiddlewareError, store });\n\tvoid container.stores.loadPiece({ name: 'PluginServerMiddlewareSuccess', piece: PluginServerMiddlewareSuccess, store });\n\tvoid container.stores.loadPiece({ name: 'PluginServerRequest', piece: PluginServerRequest, store });\n\tvoid container.stores.loadPiece({ name: 'PluginServerRouterBranchMethodNotAllowed', piece: PluginServerRouterBranchMethodNotAllowed, store });\n\tvoid container.stores.loadPiece({ name: 'PluginServerRouterBranchNotFound', piece: PluginServerRouterBranchNotFound, store });\n\tvoid container.stores.loadPiece({ name: 'PluginServerRouterFound', piece: PluginServerRouterFound, store });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/middlewares/_load.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/middlewares/_load.ts"],"names":["PluginAuth","PluginBody","PluginCookies","PluginHeaders"],"mappings":";;;;;;;AAMO,SAAS,eAAkB,GAAA;AACjC,EAAA,MAAM,KAAQ,GAAA,aAAA;AACd,EAAK,KAAA,SAAA,CAAU,OAAO,SAAU,CAAA,EAAE,MAAM,MAAQ,EAAA,KAAA,EAAOA,gBAAY,EAAA,KAAA,EAAO,CAAA;AAC1E,EAAK,KAAA,SAAA,CAAU,OAAO,SAAU,CAAA,EAAE,MAAM,MAAQ,EAAA,KAAA,EAAOC,kBAAY,EAAA,KAAA,EAAO,CAAA;AAC1E,EAAK,KAAA,SAAA,CAAU,OAAO,SAAU,CAAA,EAAE,MAAM,SAAW,EAAA,KAAA,EAAOC,kBAAe,EAAA,KAAA,EAAO,CAAA;AAChF,EAAK,KAAA,SAAA,CAAU,OAAO,SAAU,CAAA,EAAE,MAAM,SAAW,EAAA,KAAA,EAAOC,kBAAe,EAAA,KAAA,EAAO,CAAA;AACjF;AANgB,MAAA,CAAA,eAAA,EAAA,iBAAA,CAAA","file":"_load.mjs","sourcesContent":["import { container } from '@sapphire/pieces';\nimport { PluginMiddleware as PluginAuth } from './auth';\nimport { PluginMiddleware as PluginBody } from './body';\nimport { PluginMiddleware as PluginCookies } from './cookies';\nimport { PluginMiddleware as PluginHeaders } from './headers';\n\nexport function loadMiddlewares() {\n\tconst store = 'middlewares';\n\tvoid container.stores.loadPiece({ name: 'auth', piece: PluginAuth, store });\n\tvoid container.stores.loadPiece({ name: 'body', piece: PluginBody, store });\n\tvoid container.stores.loadPiece({ name: 'cookies', piece: PluginCookies, store });\n\tvoid container.stores.loadPiece({ name: 'headers', piece: PluginHeaders, store });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/middlewares/auth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/middlewares/auth.ts"],"names":[],"mappings":";;;AAEO,IAAM,iBAAA,GAAN,MAAM,iBAAA,SAAyB,UAAW,CAAA;AAAA,EAGzC,YAAY,OAAmC,EAAA;AACrD,IAAA,KAAA,CAAM,OAAS,EAAA,EAAE,QAAU,EAAA,EAAA,EAAI,CAAA;AAHhC,IAAiB,aAAA,CAAA,IAAA,EAAA,YAAA,CAAA;AAKhB,IAAM,MAAA,EAAE,MAAO,EAAA,GAAI,IAAK,CAAA,SAAA;AACxB,IAAK,IAAA,CAAA,UAAA,GAAa,MAAO,CAAA,IAAA,EAAM,MAAU,IAAA,eAAA;AACzC,IAAK,IAAA,CAAA,OAAA,GAAU,OAAO,IAAS,KAAA,IAAA;AAAA;AAChC,EAEgB,GAAA,CAAI,SAA6B,QAA+B,EAAA;AAE/E,IAAA,MAAM,aAAgB,GAAA,QAAA,CAAS,OAAQ,CAAA,GAAA,CAAI,KAAK,UAAU,CAAA;AAC1D,IAAA,IAAI,CAAC,aAAe,EAAA;AACnB,MAAA,OAAA,CAAQ,IAAO,GAAA,IAAA;AACf,MAAA;AAAA;AAID,IAAA,OAAA,CAAQ,OAAO,IAAK,CAAA,SAAA,CAAU,MAAO,CAAA,IAAA,CAAM,QAAQ,aAAa,CAAA;AAChE,IAAA,IAAI,QAAQ,IAAS,KAAA,IAAA,WAAe,OAAQ,CAAA,MAAA,CAAO,KAAK,UAAU,CAAA;AAAA;AAEpE,CAAA;AAvBiD,MAAA,CAAA,iBAAA,EAAA,kBAAA,CAAA;AAA1C,IAAM,gBAAN,GAAA","file":"auth.mjs","sourcesContent":["import { Middleware } from '../lib/structures/Middleware';\n\nexport class PluginMiddleware extends Middleware {\n\tprivate readonly cookieName: string;\n\n\tpublic constructor(context: Middleware.LoaderContext) {\n\t\tsuper(context, { position: 40 });\n\n\t\tconst { server } = this.container;\n\t\tthis.cookieName = server.auth?.cookie ?? 'SAPPHIRE_AUTH';\n\t\tthis.enabled = server.auth !== null;\n\t}\n\n\tpublic override run(request: Middleware.Request, response: Middleware.Response) {\n\t\t// If there are no cookies, set auth as null:\n\t\tconst authorization = response.cookies.get(this.cookieName);\n\t\tif (!authorization) {\n\t\t\trequest.auth = null;\n\t\t\treturn;\n\t\t}\n\n\t\t// Decrypt the cookie, and if the token is invalid, remove the cookie:\n\t\trequest.auth = this.container.server.auth!.decrypt(authorization);\n\t\tif (request.auth === null) response.cookies.remove(this.cookieName);\n\t}\n}\n"]}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { __name
|
|
1
|
+
import { __name } from '../chunk-S573YWRP.mjs';
|
|
2
2
|
import { HttpCodes } from '../lib/structures/http/HttpCodes.mjs';
|
|
3
3
|
import { Middleware } from '../lib/structures/Middleware.mjs';
|
|
4
4
|
|
|
5
5
|
var _PluginMiddleware = class _PluginMiddleware extends Middleware {
|
|
6
6
|
constructor(context) {
|
|
7
7
|
super(context, { position: 20 });
|
|
8
|
-
__publicField(this, "mediaParsers");
|
|
9
|
-
this.mediaParsers = this.container.server.mediaParsers;
|
|
10
8
|
}
|
|
11
|
-
|
|
9
|
+
run(request, response) {
|
|
12
10
|
if (!request.route) return;
|
|
13
11
|
const contentType = request.headers["content-type"];
|
|
14
12
|
if (typeof contentType !== "string") return;
|
|
@@ -18,18 +16,6 @@ var _PluginMiddleware = class _PluginMiddleware extends Middleware {
|
|
|
18
16
|
const maximumLength = request.route.maximumBodyLength;
|
|
19
17
|
if (length > maximumLength) {
|
|
20
18
|
response.status(HttpCodes.PayloadTooLarge).json({ error: "Exceeded maximum content length." });
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
const type = this.mediaParsers.parseContentType(contentType);
|
|
24
|
-
const parser = this.mediaParsers.get(type);
|
|
25
|
-
if (!parser || !parser.accepts(request.route)) {
|
|
26
|
-
response.status(HttpCodes.UnsupportedMediaType).json({ error: `Unsupported type ${type}.` });
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
try {
|
|
30
|
-
request.body = await parser.run(request);
|
|
31
|
-
} catch {
|
|
32
|
-
response.status(HttpCodes.BadRequest).json({ error: `Cannot parse ${type} data.` });
|
|
33
19
|
}
|
|
34
20
|
}
|
|
35
21
|
};
|
|
@@ -37,5 +23,5 @@ __name(_PluginMiddleware, "PluginMiddleware");
|
|
|
37
23
|
var PluginMiddleware = _PluginMiddleware;
|
|
38
24
|
|
|
39
25
|
export { PluginMiddleware };
|
|
40
|
-
//# sourceMappingURL=
|
|
26
|
+
//# sourceMappingURL=body.mjs.map
|
|
41
27
|
//# sourceMappingURL=body.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/middlewares/body.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/middlewares/body.ts"],"names":[],"mappings":";;;;AAGO,IAAM,iBAAA,GAAN,MAAM,iBAAA,SAAyB,UAAW,CAAA;AAAA,EACzC,YAAY,OAAmC,EAAA;AACrD,IAAA,KAAA,CAAM,OAAS,EAAA,EAAE,QAAU,EAAA,EAAA,EAAI,CAAA;AAAA;AAChC,EAEgB,GAAA,CAAI,SAA6B,QAA+B,EAAA;AAC/E,IAAI,IAAA,CAAC,QAAQ,KAAO,EAAA;AAGpB,IAAM,MAAA,WAAA,GAAc,OAAQ,CAAA,OAAA,CAAQ,cAAc,CAAA;AAClD,IAAI,IAAA,OAAO,gBAAgB,QAAU,EAAA;AAGrC,IAAM,MAAA,YAAA,GAAe,OAAQ,CAAA,OAAA,CAAQ,gBAAgB,CAAA;AACrD,IAAI,IAAA,OAAO,iBAAiB,QAAU,EAAA;AAGtC,IAAM,MAAA,MAAA,GAAS,OAAO,YAAY,CAAA;AAClC,IAAM,MAAA,aAAA,GAAgB,QAAQ,KAAM,CAAA,iBAAA;AACpC,IAAA,IAAI,SAAS,aAAe,EAAA;AAC3B,MAAS,QAAA,CAAA,MAAA,CAAO,UAAU,eAAe,CAAA,CAAE,KAAK,EAAE,KAAA,EAAO,oCAAoC,CAAA;AAAA;AAC9F;AAEF,CAAA;AAvBiD,MAAA,CAAA,iBAAA,EAAA,kBAAA,CAAA;AAA1C,IAAM,gBAAN,GAAA","file":"body.mjs","sourcesContent":["import { HttpCodes } from '../lib/structures/http/HttpCodes';\nimport { Middleware } from '../lib/structures/Middleware';\n\nexport class PluginMiddleware extends Middleware {\n\tpublic constructor(context: Middleware.LoaderContext) {\n\t\tsuper(context, { position: 20 });\n\t}\n\n\tpublic override run(request: Middleware.Request, response: Middleware.Response) {\n\t\tif (!request.route) return;\n\n\t\t// RFC 1341 4.\n\t\tconst contentType = request.headers['content-type'];\n\t\tif (typeof contentType !== 'string') return;\n\n\t\t// RFC 7230 3.3.2.\n\t\tconst lengthString = request.headers['content-length'];\n\t\tif (typeof lengthString !== 'string') return;\n\n\t\t// Verify if the content length is lower than accepted:\n\t\tconst length = Number(lengthString);\n\t\tconst maximumLength = request.route.maximumBodyLength;\n\t\tif (length > maximumLength) {\n\t\t\tresponse.status(HttpCodes.PayloadTooLarge).json({ error: 'Exceeded maximum content length.' });\n\t\t}\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/middlewares/cookies.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/middlewares/cookies.ts"],"names":[],"mappings":";;;;AAGO,IAAM,iBAAA,GAAN,MAAM,iBAAA,SAAyB,UAAW,CAAA;AAAA,EAIzC,YAAY,OAAmC,EAAA;AACrD,IAAA,KAAA,CAAM,OAAS,EAAA,EAAE,QAAU,EAAA,EAAA,EAAI,CAAA;AAJhC,IAAiB,aAAA,CAAA,IAAA,EAAA,YAAA,EAAsB,OAAQ,CAAA,GAAA,CAAI,QAAa,KAAA,YAAA,CAAA;AAChE,IAAA,aAAA,CAAA,IAAA,EAAQ,iBAAiC,EAAA,IAAA,CAAA;AAKxC,IAAM,MAAA,EAAE,MAAO,EAAA,GAAI,IAAK,CAAA,SAAA;AACxB,IAAK,IAAA,CAAA,eAAA,GAAkB,MAAO,CAAA,IAAA,EAAM,eAAmB,IAAA,IAAA;AAAA;AACxD,EAEgB,GAAA,CAAI,SAA6B,QAA+B,EAAA;AAC/E,IAAS,QAAA,CAAA,OAAA,GAAU,IAAI,WAAY,CAAA,OAAA,EAAS,UAAU,IAAK,CAAA,UAAA,EAAY,KAAK,eAAe,CAAA;AAAA;AAE7F,CAAA;AAdiD,MAAA,CAAA,iBAAA,EAAA,kBAAA,CAAA;AAA1C,IAAM,gBAAN,GAAA","file":"cookies.mjs","sourcesContent":["import { Middleware } from '../lib/structures/Middleware';\nimport { CookieStore } from '../lib/structures/api/CookieStore';\n\nexport class PluginMiddleware extends Middleware {\n\tprivate readonly production: boolean = process.env.NODE_ENV === 'production';\n\tprivate domainOverwrite: string | null = null;\n\n\tpublic constructor(context: Middleware.LoaderContext) {\n\t\tsuper(context, { position: 30 });\n\n\t\tconst { server } = this.container;\n\t\tthis.domainOverwrite = server.auth?.domainOverwrite ?? null;\n\t}\n\n\tpublic override run(request: Middleware.Request, response: Middleware.Response) {\n\t\tresponse.cookies = new CookieStore(request, response, this.production, this.domainOverwrite);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/middlewares/headers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/middlewares/headers.ts"],"names":[],"mappings":";;;;AAKO,IAAM,iBAAA,GAAN,MAAM,iBAAA,SAAyB,UAAW,CAAA;AAAA,EAIzC,YAAY,OAAmC,EAAA;AACrD,IAAA,KAAA,CAAM,OAAS,EAAA,EAAE,QAAU,EAAA,EAAA,EAAI,CAAA;AAJhC,IAAiB,aAAA,CAAA,IAAA,EAAA,QAAA,CAAA;AACjB,IAAiB,aAAA,CAAA,IAAA,EAAA,QAAA,CAAA;AAIhB,IAAA,IAAA,CAAK,MAAS,GAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAO,QAAQ,MAAU,IAAA,GAAA;AACtD,IAAA,IAAA,CAAK,MAAS,GAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAO,IAAI,QAAQ,CAAA;AAAA;AACjD,EAEgB,GAAA,CAAI,SAA6B,QAA+B,EAAA;AAC/E,IAAA,QAAA,CAAS,UAAU,MAAQ,EAAA,iBAAA,IAAI,IAAK,EAAA,EAAE,aAAa,CAAA;AACnD,IAAS,QAAA,CAAA,SAAA,CAAU,oCAAo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,GAAI,EAAA;AAAA,KACzC,MAAA,IAAW,UAAU,IAAM,EAAA;AAC1B,MAAA,QAAA,CAAS,MAAO,CAAA,SAAA,CAAU,gBAAgB,CAAA,CAAE,GAAI,EAAA;AAAA;AACjD;AAEF,CAAA;AAxDiD,MAAA,CAAA,iBAAA,EAAA,kBAAA,CAAA;AAA1C,IAAM,gBAAN,GAAA","file":"headers.mjs","sourcesContent":["import { Middleware } from '../lib/structures/Middleware';\nimport type { Route } from '../lib/structures/Route';\nimport type { RouteStore } from '../lib/structures/RouteStore';\nimport { HttpCodes } from '../lib/structures/http/HttpCodes';\n\nexport class PluginMiddleware extends Middleware {\n\tprivate readonly origin: string;\n\tprivate readonly routes: RouteStore;\n\n\tpublic constructor(context: Middleware.LoaderContext) {\n\t\tsuper(context, { position: 10 });\n\t\tthis.origin = this.container.server.options.origin ?? '*';\n\t\tthis.routes = this.container.stores.get('routes');\n\t}\n\n\tpublic override run(request: Middleware.Request, response: Middleware.Response) {\n\t\tresponse.setHeader('Date', new Date().toUTCString());\n\t\tresponse.setHeader('Access-Control-Allow-Credentials', 'true');\n\t\tresponse.setHeader('Access-Control-Allow-Origin', this.origin);\n\t\tresponse.setHeader('Access-Control-Allow-Headers', 'Authorization, User-Agent, Content-Type');\n\t\tresponse.setHeader('Access-Control-Allow-Methods', this.getMethods(request.route ?? null));\n\n\t\tthis.ensurePotentialEarlyExit(request, response);\n\t}\n\n\tprivate getMethods(route: Route | null) {\n\t\tif (route === null) {\n\t\t\treturn this.routes.router.supportedMethods.join(', ');\n\t\t}\n\n\t\tif (route.methods.size === 0) return '';\n\t\tif (route.methods.size === 1) return route.methods.keys().next().value;\n\t\treturn [...route.methods].join(', ');\n\t}\n\n\t/**\n\t * **RFC 7231 4.3.7.**\n\t * > This method allows a client to determine the options and/or requirements associated with a\n\t * > resource, or the capabilities of a server, without implying a resource action.\n\t *\n\t * This method ensures that the request is exited early in case required\n\t * The conditions in which an early exit is required are:\n\t * 1. If the request method is 'OPTIONS'. In this case the request is returned with status code 200\n\t * 2. If the requested route isn't matched with any existing route in the RouteStore.\n\t * In this case the request is returned with a status code 404.\n\t *\n\t * @param request The API Request coming in\n\t * @param response The API response that will go out\n\t * @param route The route being requested by the request\n\t */\n\tprivate ensurePotentialEarlyExit({ method, route, routerNode }: Middleware.Request, response: Middleware.Response) {\n\t\tif (method === 'OPTIONS') {\n\t\t\tif (!route || !route.methods.has('OPTIONS')) {\n\t\t\t\tresponse.end();\n\t\t\t}\n\t\t} else if (routerNode === null) {\n\t\t\tresponse.status(HttpCodes.NotFound).end();\n\t\t} else if (route === null) {\n\t\t\tresponse.status(HttpCodes.MethodNotAllowed).end();\n\t\t}\n\t}\n}\n"]}
|
package/dist/esm/register.d.mts
CHANGED
package/dist/esm/register.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __name } from './chunk-S573YWRP.mjs';
|
|
2
|
-
import { Server, loadListeners, loadMediaParsers, loadMiddlewares, loadRoutes } from './index.mjs';
|
|
3
2
|
import { SapphireClient, postInitialization, preLogin, Plugin } from '@sapphire/framework';
|
|
3
|
+
import { Server, loadListeners, loadMiddlewares, loadRoutes } from './index.mjs';
|
|
4
4
|
|
|
5
5
|
var _Api = class _Api extends Plugin {
|
|
6
6
|
/**
|
|
@@ -8,9 +8,8 @@ var _Api = class _Api extends Plugin {
|
|
|
8
8
|
*/
|
|
9
9
|
static [postInitialization](options) {
|
|
10
10
|
this.server = new Server(options.api);
|
|
11
|
-
this.stores.register(this.server.routes).register(this.server.
|
|
11
|
+
this.stores.register(this.server.routes).register(this.server.middlewares);
|
|
12
12
|
loadListeners();
|
|
13
|
-
loadMediaParsers();
|
|
14
13
|
loadMiddlewares();
|
|
15
14
|
loadRoutes();
|
|
16
15
|
}
|
|
@@ -30,5 +29,5 @@ SapphireClient.plugins.registerPostInitializationHook(Api[postInitialization], "
|
|
|
30
29
|
SapphireClient.plugins.registerPreLoginHook(Api[preLogin], "API-PreLogin");
|
|
31
30
|
|
|
32
31
|
export { Api };
|
|
33
|
-
//# sourceMappingURL=
|
|
32
|
+
//# sourceMappingURL=register.mjs.map
|
|
34
33
|
//# sourceMappingURL=register.mjs.map
|