@wooksjs/event-http 0.4.29 → 0.4.31
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/dist/index.cjs +7 -2
- package/dist/index.d.ts +4 -0
- package/dist/index.mjs +7 -2
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -579,7 +579,7 @@ class HttpErrorRenderer extends BaseHttpResponseRenderer {
|
|
|
579
579
|
`<head><title>${data.statusCode} ${httpStatusCodes[data.statusCode]}</title></head>` +
|
|
580
580
|
`<body><center><h1>${data.statusCode} ${httpStatusCodes[data.statusCode]}</h1></center>` +
|
|
581
581
|
`<center><h4>${data.message}</h1></center><hr color="#666">` +
|
|
582
|
-
`<center style="color: #666;"> Wooks v${"0.4.
|
|
582
|
+
`<center style="color: #666;"> Wooks v${"0.4.31"} </center>` +
|
|
583
583
|
`${keys.length > 0
|
|
584
584
|
? `<pre style="${preStyles}">${JSON.stringify({
|
|
585
585
|
...data,
|
|
@@ -917,7 +917,12 @@ class WooksHttp extends wooks.WooksAdapterBase {
|
|
|
917
917
|
return new Promise((resolve, reject) => {
|
|
918
918
|
server.once('listening', resolve);
|
|
919
919
|
server.once('error', reject);
|
|
920
|
-
|
|
920
|
+
let args = [port, hostname, backlog, listeningListener];
|
|
921
|
+
const ui = args.indexOf(undefined);
|
|
922
|
+
if (ui >= 0) {
|
|
923
|
+
args = args.slice(0, ui);
|
|
924
|
+
}
|
|
925
|
+
server.listen(...args);
|
|
921
926
|
});
|
|
922
927
|
}
|
|
923
928
|
close(server) {
|
package/dist/index.d.ts
CHANGED
|
@@ -399,6 +399,8 @@ declare function createHttpContext(data: THttpEventData, options: TEventOptions)
|
|
|
399
399
|
};
|
|
400
400
|
getStore: <K_1 extends keyof THttpContextStore | keyof _wooksjs_event_core.TGenericContextStore<THttpEventData>>(key: K_1) => (THttpContextStore & _wooksjs_event_core.TGenericContextStore<THttpEventData>)[K_1];
|
|
401
401
|
setStore: <K_2 extends keyof THttpContextStore | keyof _wooksjs_event_core.TGenericContextStore<THttpEventData>>(key: K_2, v: (THttpContextStore & _wooksjs_event_core.TGenericContextStore<THttpEventData>)[K_2]) => void;
|
|
402
|
+
setParentCtx: (parentCtx: unknown) => void;
|
|
403
|
+
restoreParentCtx: () => _wooksjs_event_core.TGenericContextStore<TEmpty> | null;
|
|
402
404
|
};
|
|
403
405
|
/**
|
|
404
406
|
* Wrapper on useEventContext with HTTP event types
|
|
@@ -424,6 +426,8 @@ declare function useHttpContext<T extends TEmpty>(): {
|
|
|
424
426
|
};
|
|
425
427
|
getStore: <K_1 extends keyof THttpContextStore | keyof _wooksjs_event_core.TGenericContextStore<THttpEventData> | keyof T>(key: K_1) => (THttpContextStore & T & _wooksjs_event_core.TGenericContextStore<THttpEventData>)[K_1];
|
|
426
428
|
setStore: <K_2 extends keyof THttpContextStore | keyof _wooksjs_event_core.TGenericContextStore<THttpEventData> | keyof T>(key: K_2, v: (THttpContextStore & T & _wooksjs_event_core.TGenericContextStore<THttpEventData>)[K_2]) => void;
|
|
429
|
+
setParentCtx: (parentCtx: unknown) => void;
|
|
430
|
+
restoreParentCtx: () => _wooksjs_event_core.TGenericContextStore<TEmpty> | null;
|
|
427
431
|
};
|
|
428
432
|
|
|
429
433
|
declare function createWooksResponder(renderer?: TWooksResponseRenderer<any>, errorRenderer?: TWooksResponseRenderer<any>): {
|
package/dist/index.mjs
CHANGED
|
@@ -577,7 +577,7 @@ class HttpErrorRenderer extends BaseHttpResponseRenderer {
|
|
|
577
577
|
`<head><title>${data.statusCode} ${httpStatusCodes[data.statusCode]}</title></head>` +
|
|
578
578
|
`<body><center><h1>${data.statusCode} ${httpStatusCodes[data.statusCode]}</h1></center>` +
|
|
579
579
|
`<center><h4>${data.message}</h1></center><hr color="#666">` +
|
|
580
|
-
`<center style="color: #666;"> Wooks v${"0.4.
|
|
580
|
+
`<center style="color: #666;"> Wooks v${"0.4.31"} </center>` +
|
|
581
581
|
`${keys.length > 0
|
|
582
582
|
? `<pre style="${preStyles}">${JSON.stringify({
|
|
583
583
|
...data,
|
|
@@ -915,7 +915,12 @@ class WooksHttp extends WooksAdapterBase {
|
|
|
915
915
|
return new Promise((resolve, reject) => {
|
|
916
916
|
server.once('listening', resolve);
|
|
917
917
|
server.once('error', reject);
|
|
918
|
-
|
|
918
|
+
let args = [port, hostname, backlog, listeningListener];
|
|
919
|
+
const ui = args.indexOf(undefined);
|
|
920
|
+
if (ui >= 0) {
|
|
921
|
+
args = args.slice(0, ui);
|
|
922
|
+
}
|
|
923
|
+
server.listen(...args);
|
|
919
924
|
});
|
|
920
925
|
}
|
|
921
926
|
close(server) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wooksjs/event-http",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.31",
|
|
4
4
|
"description": "@wooksjs/event-http",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"url": "https://github.com/wooksjs/wooksjs/issues"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"wooks": "0.4.
|
|
42
|
+
"wooks": "0.4.31",
|
|
43
43
|
"@prostojs/router": "^0.2.1",
|
|
44
|
-
"@wooksjs/event-core": "0.4.
|
|
44
|
+
"@wooksjs/event-core": "0.4.31"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@prostojs/logger": "^0.4.0"
|