@orkestrel/middleware 0.0.18 → 0.0.20
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 +20 -15
- package/dist/src/core/index.cjs +393 -312
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +497 -328
- package/dist/src/core/index.d.ts +497 -328
- package/dist/src/core/index.js +391 -311
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +486 -422
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +316 -232
- package/dist/src/server/index.d.ts +316 -232
- package/dist/src/server/index.js +478 -417
- package/dist/src/server/index.js.map +1 -1
- package/package.json +21 -23
package/README.md
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
# @orkestrel/middleware
|
|
2
2
|
|
|
3
|
-
Batteries for the `@orkestrel/server` middleware seam
|
|
4
|
-
`MiddlewareHandler<TState>`
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
> Batteries for the `@orkestrel/server` middleware seam:
|
|
4
|
+
> `create{Noun}(options) => MiddlewareHandler<TState>` factories for error
|
|
5
|
+
> boundaries, telemetry, compression, security headers, CORS, deadlines,
|
|
6
|
+
> trusted-proxy client facts, ETag, bearer authentication, rate limiting, body
|
|
7
|
+
> parsing, sessions, and CSRF in the fetch-native core, plus in-memory assets,
|
|
8
|
+
> static files, streaming multipart uploads, and a `node:zlib` compression
|
|
9
|
+
> sibling in the node face.
|
|
10
|
+
|
|
11
|
+
Mount the batteries your threat model needs over the `compose` seam: each one
|
|
12
|
+
closes over its guarded options and returns a `MiddlewareHandler<TState>`, and
|
|
13
|
+
its position in the chain decides what it can see. Read
|
|
14
|
+
[`guides/middleware.md`](guides/middleware.md) for the ordering doctrine and
|
|
15
|
+
the security acceptance bar before you fix an order. Part of the `@orkestrel`
|
|
16
|
+
line.
|
|
10
17
|
|
|
11
18
|
## Install
|
|
12
19
|
|
|
@@ -16,11 +23,11 @@ npm install @orkestrel/middleware @orkestrel/server
|
|
|
16
23
|
|
|
17
24
|
## Requirements
|
|
18
25
|
|
|
19
|
-
- Node.js >=
|
|
26
|
+
- Node.js >= 22.12.0
|
|
20
27
|
- `@orkestrel/server` as a peer dependency (the seam and substrate are
|
|
21
28
|
imported, never bundled)
|
|
22
|
-
- ESM core (`.`)
|
|
23
|
-
|
|
29
|
+
- Dual ESM and CommonJS entries: the core (`.`) and the node face (`./server`),
|
|
30
|
+
which carries the node-bound batteries
|
|
24
31
|
|
|
25
32
|
## Usage
|
|
26
33
|
|
|
@@ -40,15 +47,13 @@ const handle = compose<State>([boundary, security], async (_request, context) =>
|
|
|
40
47
|
```
|
|
41
48
|
|
|
42
49
|
Each battery is a typed `options => MiddlewareHandler<TState>` factory that composes with
|
|
43
|
-
the others through the frozen `@orkestrel/server` seam
|
|
44
|
-
|
|
45
|
-
`DatabaseSessionStore` over `@orkestrel/database`), CSRF, static files, and multipart uploads
|
|
46
|
-
in any combination, scoped with `only()` / `except()` where needed.
|
|
50
|
+
the others through the frozen `@orkestrel/server` seam, in any combination, scoped with
|
|
51
|
+
`only()` and `except()` where needed.
|
|
47
52
|
|
|
48
53
|
## Guides
|
|
49
54
|
|
|
50
55
|
See [`guides/README.md`](./guides/README.md) for the concept and dependency
|
|
51
|
-
index; the full battery-by-battery surface docs land in `guides/
|
|
56
|
+
index; the full battery-by-battery surface docs land in `guides/middleware.md`
|
|
52
57
|
alongside the implementation.
|
|
53
58
|
|
|
54
59
|
## License
|