@znight/http 0.6.1 → 0.6.2
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/README.md +8 -10
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1662,9 +1662,7 @@ export class StatusPlugin implements Plugin, PluginHttpRoutes {
|
|
|
1662
1662
|
|
|
1663
1663
|
### Upgrade routes
|
|
1664
1664
|
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
A plugin accepting WebSocket connections (`@znight/websocket`, RFC 0003, in progress) implements
|
|
1665
|
+
A plugin accepting WebSocket connections (`@znight/websocket`, RFC 0003) implements
|
|
1668
1666
|
`PluginHttpUpgrades`: `httpUpgrades(context)` returns `{ routes, bunWebSocket? }`, called once in
|
|
1669
1667
|
`HttpPlugin.onBootstrap` after `httpRoutes()`. Each `PluginUpgradeRoute` has a `path`, a `name`,
|
|
1670
1668
|
optional `meta`, `guards`, `timeoutMs` and `precheck`, and an `accept(ctx, upgrade)` that completes
|
|
@@ -1929,13 +1927,13 @@ for await (const item of parseSseStream(response.body!)) {
|
|
|
1929
1927
|
|
|
1930
1928
|
## Lifecycle and graceful shutdown
|
|
1931
1929
|
|
|
1932
|
-
| Plugin hook | What happens
|
|
1933
|
-
| ------------- |
|
|
1934
|
-
| `register` | Declares the request-scoped externals `HttpContext` and `RequestId`, registers the plugin
|
|
1935
|
-
| `onBootstrap` | Resolves options, controllers, guards, interceptors and mappers; collects plugin routes; checks route decisions (ZNIGHT023); validates and registers routes
|
|
1936
|
-
| `onStart` | Listens (logs the address)
|
|
1937
|
-
| `onStop` | Closes the event streams gracefully (see below), stops accepting connections, closes idle ones, waits for in-flight requests and streamed or file responses (`drainTimeoutMs`), then closes the remaining connections
|
|
1938
|
-
| `onDispose` | Closes the server and the adapter
|
|
1930
|
+
| Plugin hook | What happens |
|
|
1931
|
+
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1932
|
+
| `register` | Declares the request-scoped externals `HttpContext` and `RequestId`, registers the plugin |
|
|
1933
|
+
| `onBootstrap` | Resolves options, controllers, guards, interceptors and mappers; collects plugin routes and upgrade routes (`httpRoutes()`, then `httpUpgrades()`); checks route decisions (ZNIGHT023); validates and registers routes |
|
|
1934
|
+
| `onStart` | Listens (logs the address) |
|
|
1935
|
+
| `onStop` | Closes the event streams gracefully (see below), stops accepting connections, closes idle ones, waits for in-flight requests and streamed or file responses (`drainTimeoutMs`), then closes the remaining connections |
|
|
1936
|
+
| `onDispose` | Closes the server and the adapter |
|
|
1939
1937
|
|
|
1940
1938
|
While draining, responses carry `connection: close`. Event streams never end by themselves, so
|
|
1941
1939
|
`onStop` closes them first: their `ctx.signal` aborts (`'shutdown'`), their sources get
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@znight/http",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Znight HTTP plugin: controllers, routing, guards, interceptors, validation with Fastify, Express or Hono",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ugho STEPHAN",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@znight/core": "0.6.
|
|
82
|
+
"@znight/core": "0.6.2"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"@hono/node-server": "^2.1.5",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"fastify": "^5.12.7",
|
|
88
88
|
"hono": "^4.13.14",
|
|
89
89
|
"light-my-request": "^6.8.0",
|
|
90
|
-
"@znight/compiler": "^0.6.
|
|
90
|
+
"@znight/compiler": "^0.6.2"
|
|
91
91
|
},
|
|
92
92
|
"peerDependenciesMeta": {
|
|
93
93
|
"@hono/node-server": {
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"valibot": "1.5.0",
|
|
119
119
|
"zod": "4.6.7",
|
|
120
120
|
"light-my-request": "6.8.0",
|
|
121
|
-
"@znight/compiler": "0.6.
|
|
121
|
+
"@znight/compiler": "0.6.2"
|
|
122
122
|
},
|
|
123
123
|
"znight": {
|
|
124
124
|
"apiVersion": 1,
|