@jwn-js/common 1.3.24 → 1.3.25
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/{Jwt-f1da5291.js → Jwt-e49753f6.js} +2 -2
- package/Jwt.js +1 -1
- package/{Server-77093d28.js → Server-dadc1f87.js} +5 -5
- package/Server.js +1 -1
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +36 -0
- package/docs/assets/icons.css +1043 -0
- package/docs/assets/{images/icons.png → icons.png} +0 -0
- package/docs/assets/{images/icons@2x.png → icons@2x.png} +0 -0
- package/docs/assets/main.js +52 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1388 -0
- package/docs/assets/{images/widgets.png → widgets.png} +0 -0
- package/docs/assets/{images/widgets@2x.png → widgets@2x.png} +0 -0
- package/docs/classes/ApiError.html +18 -560
- package/docs/classes/AsyncJwt.html +17 -312
- package/docs/classes/Controller.html +27 -1005
- package/docs/classes/Jwt.html +17 -312
- package/docs/classes/Memcached.html +20 -384
- package/docs/classes/Model.html +7 -664
- package/docs/classes/Server.html +25 -461
- package/docs/classes/Ssr.html +11 -307
- package/docs/classes/Web.html +11 -437
- package/docs/index.html +18 -258
- package/docs/interfaces/ApiErrorMessage.html +1 -219
- package/docs/interfaces/ContextSsr.html +23 -324
- package/docs/interfaces/ContextWeb.html +1 -288
- package/docs/interfaces/OptionsSsr.html +1 -181
- package/docs/interfaces/OptionsWeb.html +1 -209
- package/docs/interfaces/Route.html +1 -191
- package/docs/interfaces/Schema.html +1 -177
- package/docs/interfaces/ServerHandler.html +1 -218
- package/docs/interfaces/ServerOptions.html +1 -233
- package/docs/interfaces/ServerWebsocket.html +1 -191
- package/docs/modules.html +70 -2005
- package/index.d.ts +4 -0
- package/index.js +20 -12
- package/multipartBody.js +1 -1
- package/package.json +3 -3
- package/readConfig.js +1 -1
- package/readConfigSync.js +2 -2
- package/staticBody.js +1 -1
- package/urlencodedBody.js +1 -1
- package/docs/assets/css/main.css +0 -2660
- package/docs/assets/js/main.js +0 -248
- package/docs/assets/js/search.js +0 -1
|
@@ -31,7 +31,7 @@ class Jwt {
|
|
|
31
31
|
return false;
|
|
32
32
|
}
|
|
33
33
|
const parts = jwt.split(".");
|
|
34
|
-
const signature = urlEncode(crypto__default[
|
|
34
|
+
const signature = urlEncode(crypto__default["default"].createHmac(this.algorithm, this.secret).update(`${parts[0]}.${parts[1]}`).digest("base64"));
|
|
35
35
|
return signature === parts[2];
|
|
36
36
|
}
|
|
37
37
|
sign(data) {
|
|
@@ -40,7 +40,7 @@ class Jwt {
|
|
|
40
40
|
typ: "JWT"
|
|
41
41
|
});
|
|
42
42
|
const body = toBase64url(data);
|
|
43
|
-
const signature = urlEncode(crypto__default[
|
|
43
|
+
const signature = urlEncode(crypto__default["default"].createHmac(this.algorithm, this.secret).update(`${head}.${body}`).digest("base64"));
|
|
44
44
|
return `${head}.${body}.${signature}`;
|
|
45
45
|
}
|
|
46
46
|
decode(jwt) {
|
package/Jwt.js
CHANGED
|
@@ -102,12 +102,12 @@ class Server {
|
|
|
102
102
|
}
|
|
103
103
|
app() {
|
|
104
104
|
this._protocol = "http";
|
|
105
|
-
this._app = uws__default[
|
|
105
|
+
this._app = uws__default["default"].App(this._appOptions);
|
|
106
106
|
return this;
|
|
107
107
|
}
|
|
108
108
|
sslApp() {
|
|
109
109
|
this._protocol = "https";
|
|
110
|
-
this._app = uws__default[
|
|
110
|
+
this._app = uws__default["default"].SSLApp(this._appOptions);
|
|
111
111
|
return this;
|
|
112
112
|
}
|
|
113
113
|
push(route) {
|
|
@@ -170,7 +170,7 @@ class Server {
|
|
|
170
170
|
}
|
|
171
171
|
async close() {
|
|
172
172
|
if (this._socket) {
|
|
173
|
-
await uws__default[
|
|
173
|
+
await uws__default["default"].us_listen_socket_close(this._socket);
|
|
174
174
|
while (true) {
|
|
175
175
|
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
176
176
|
if (await this.socketPort() < 0) {
|
|
@@ -185,7 +185,7 @@ class Server {
|
|
|
185
185
|
if (!this._socket) {
|
|
186
186
|
return -1;
|
|
187
187
|
}
|
|
188
|
-
return uws__default[
|
|
188
|
+
return uws__default["default"].us_socket_local_port(this._socket);
|
|
189
189
|
}
|
|
190
190
|
_createHandler(res, req, fn) {
|
|
191
191
|
return new Promise(async (resolve) => {
|
|
@@ -241,7 +241,7 @@ class Server {
|
|
|
241
241
|
});
|
|
242
242
|
}
|
|
243
243
|
_lookup(host, resolve) {
|
|
244
|
-
dns__default[
|
|
244
|
+
dns__default["default"].lookup(this._host, (err, addresses) => {
|
|
245
245
|
if (err) {
|
|
246
246
|
console.log(`${this._host} error: ${err.message}`);
|
|
247
247
|
} else {
|
package/Server.js
CHANGED
package/docs/.nojekyll
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--light-hl-0: #000000;
|
|
3
|
+
--dark-hl-0: #D4D4D4;
|
|
4
|
+
--light-hl-1: #001080;
|
|
5
|
+
--dark-hl-1: #9CDCFE;
|
|
6
|
+
--light-code-background: #FFFFFF;
|
|
7
|
+
--dark-code-background: #1E1E1E;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@media (prefers-color-scheme: light) { :root {
|
|
11
|
+
--hl-0: var(--light-hl-0);
|
|
12
|
+
--hl-1: var(--light-hl-1);
|
|
13
|
+
--code-background: var(--light-code-background);
|
|
14
|
+
} }
|
|
15
|
+
|
|
16
|
+
@media (prefers-color-scheme: dark) { :root {
|
|
17
|
+
--hl-0: var(--dark-hl-0);
|
|
18
|
+
--hl-1: var(--dark-hl-1);
|
|
19
|
+
--code-background: var(--dark-code-background);
|
|
20
|
+
} }
|
|
21
|
+
|
|
22
|
+
body.light {
|
|
23
|
+
--hl-0: var(--light-hl-0);
|
|
24
|
+
--hl-1: var(--light-hl-1);
|
|
25
|
+
--code-background: var(--light-code-background);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
body.dark {
|
|
29
|
+
--hl-0: var(--dark-hl-0);
|
|
30
|
+
--hl-1: var(--dark-hl-1);
|
|
31
|
+
--code-background: var(--dark-code-background);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.hl-0 { color: var(--hl-0); }
|
|
35
|
+
.hl-1 { color: var(--hl-1); }
|
|
36
|
+
pre, code { background: var(--code-background); }
|