@fluojs/http 2.0.1 → 3.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/README.ko.md +417 -16
- package/README.md +424 -16
- package/dist/access-log-observer.d.ts +77 -0
- package/dist/access-log-observer.d.ts.map +1 -0
- package/dist/access-log-observer.js +171 -0
- package/dist/adapter.d.ts +9 -0
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +15 -1
- package/dist/adapters/binding.d.ts.map +1 -1
- package/dist/adapters/binding.js +18 -16
- package/dist/adapters/dto-binding-plan.d.ts +2 -2
- package/dist/adapters/dto-binding-plan.d.ts.map +1 -1
- package/dist/adapters/dto-binding-plan.js +13 -4
- package/dist/adapters/dto-validation-adapter.d.ts +2 -1
- package/dist/adapters/dto-validation-adapter.d.ts.map +1 -1
- package/dist/adapters/dto-validation-adapter.js +2 -2
- package/dist/byte-range-response.d.ts +71 -0
- package/dist/byte-range-response.d.ts.map +1 -0
- package/dist/byte-range-response.js +347 -0
- package/dist/client-identity.d.ts +8 -4
- package/dist/client-identity.d.ts.map +1 -1
- package/dist/client-identity.js +12 -93
- package/dist/compiled-route-identity.d.ts +17 -0
- package/dist/compiled-route-identity.d.ts.map +1 -0
- package/dist/compiled-route-identity.js +29 -0
- package/dist/connection.d.ts +67 -0
- package/dist/connection.d.ts.map +1 -0
- package/dist/connection.js +480 -0
- package/dist/context/request-context-node-store.d.ts +6 -0
- package/dist/context/request-context-node-store.d.ts.map +1 -1
- package/dist/context/request-context-node-store.js +14 -0
- package/dist/context/request-context.d.ts +5 -5
- package/dist/context/request-context.d.ts.map +1 -1
- package/dist/context/request-context.js +8 -83
- package/dist/context/request-id.d.ts +10 -0
- package/dist/context/request-id.d.ts.map +1 -0
- package/dist/context/request-id.js +27 -0
- package/dist/context/sse.d.ts +13 -0
- package/dist/context/sse.d.ts.map +1 -1
- package/dist/context/sse.js +36 -6
- package/dist/cookie-helpers.d.ts +47 -0
- package/dist/cookie-helpers.d.ts.map +1 -0
- package/dist/cookie-helpers.js +166 -0
- package/dist/decorators.d.ts +52 -19
- package/dist/decorators.d.ts.map +1 -1
- package/dist/decorators.js +57 -10
- package/dist/dispatch/conditional-request-policy.d.ts +67 -0
- package/dist/dispatch/conditional-request-policy.d.ts.map +1 -0
- package/dist/dispatch/conditional-request-policy.js +297 -0
- package/dist/dispatch/dispatch-content-negotiation.d.ts +8 -0
- package/dist/dispatch/dispatch-content-negotiation.d.ts.map +1 -1
- package/dist/dispatch/dispatch-content-negotiation.js +89 -42
- package/dist/dispatch/dispatch-error-negotiation.d.ts +26 -0
- package/dist/dispatch/dispatch-error-negotiation.d.ts.map +1 -0
- package/dist/dispatch/dispatch-error-negotiation.js +110 -0
- package/dist/dispatch/dispatch-error-policy.d.ts +1 -10
- package/dist/dispatch/dispatch-error-policy.d.ts.map +1 -1
- package/dist/dispatch/dispatch-error-policy.js +1 -33
- package/dist/dispatch/dispatch-error-representation.d.ts +18 -0
- package/dist/dispatch/dispatch-error-representation.d.ts.map +1 -0
- package/dist/dispatch/dispatch-error-representation.js +125 -0
- package/dist/dispatch/dispatch-response-metadata.d.ts +10 -0
- package/dist/dispatch/dispatch-response-metadata.d.ts.map +1 -0
- package/dist/dispatch/dispatch-response-metadata.js +12 -0
- package/dist/dispatch/dispatch-response-policy.d.ts +30 -3
- package/dist/dispatch/dispatch-response-policy.d.ts.map +1 -1
- package/dist/dispatch/dispatch-response-policy.js +104 -15
- package/dist/dispatch/dispatcher.d.ts +5 -1
- package/dist/dispatch/dispatcher.d.ts.map +1 -1
- package/dist/dispatch/dispatcher.js +140 -100
- package/dist/dispatch/fast-path/debug-visibility.d.ts.map +1 -1
- package/dist/dispatch/fast-path/debug-visibility.js +6 -3
- package/dist/dispatch/fast-path/dispatcher-state.d.ts +10 -0
- package/dist/dispatch/fast-path/dispatcher-state.d.ts.map +1 -0
- package/dist/dispatch/fast-path/dispatcher-state.js +52 -0
- package/dist/dispatch/fast-path/eligibility-checker.d.ts.map +1 -1
- package/dist/dispatch/fast-path/eligibility-checker.js +27 -15
- package/dist/dispatch/fast-path/eligibility.d.ts +16 -10
- package/dist/dispatch/fast-path/eligibility.d.ts.map +1 -1
- package/dist/dispatch/fast-path/eligibility.js +10 -4
- package/dist/dispatch/fast-path/fast-path-executor.d.ts +1 -1
- package/dist/dispatch/fast-path/fast-path-executor.d.ts.map +1 -1
- package/dist/dispatch/fast-path/fast-path-executor.js +8 -5
- package/dist/dispatch/request-abort.d.ts +22 -0
- package/dist/dispatch/request-abort.d.ts.map +1 -0
- package/dist/dispatch/request-abort.js +30 -0
- package/dist/dispatch/response-integration.d.ts +55 -0
- package/dist/dispatch/response-integration.d.ts.map +1 -0
- package/dist/dispatch/response-integration.js +57 -0
- package/dist/errors.d.ts +10 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +19 -0
- package/dist/guards.d.ts +1 -1
- package/dist/guards.d.ts.map +1 -1
- package/dist/header-helpers.d.ts +59 -0
- package/dist/header-helpers.d.ts.map +1 -0
- package/dist/header-helpers.js +185 -0
- package/dist/index.d.ts +1 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -15
- package/dist/index.portable.d.ts +25 -0
- package/dist/index.portable.d.ts.map +1 -0
- package/dist/index.portable.js +21 -0
- package/dist/internal.d.ts +3 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +2 -0
- package/dist/mapping.d.ts.map +1 -1
- package/dist/mapping.js +100 -15
- package/dist/middleware/correlation.d.ts +9 -1
- package/dist/middleware/correlation.d.ts.map +1 -1
- package/dist/middleware/correlation.js +25 -14
- package/dist/middleware/cors.d.ts.map +1 -1
- package/dist/middleware/cors.js +5 -8
- package/dist/middleware/middleware.d.ts +3 -3
- package/dist/middleware/middleware.d.ts.map +1 -1
- package/dist/middleware/rate-limit.d.ts +13 -2
- package/dist/middleware/rate-limit.d.ts.map +1 -1
- package/dist/middleware/rate-limit.js +1 -0
- package/dist/static-assets.d.ts +77 -0
- package/dist/static-assets.d.ts.map +1 -0
- package/dist/static-assets.js +270 -0
- package/dist/types.d.ts +209 -16
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +69 -1
- package/package.json +19 -9
package/dist/types.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** HTTP
|
|
1
|
+
/** Canonical uppercase HTTP method token or Fluo's reserved `ALL` wildcard sentinel. */
|
|
2
2
|
|
|
3
3
|
/** Strategies that decide how versioned HTTP routes are selected for one request. */
|
|
4
4
|
export let VersioningType = /*#__PURE__*/function (VersioningType) {
|
|
@@ -17,6 +17,14 @@ export let VersioningType = /*#__PURE__*/function (VersioningType) {
|
|
|
17
17
|
* request objects.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Runtime-neutral transport metadata captured when an adapter receives a request.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* Fetch-only adapters may omit this value because the Web `Request` contract
|
|
25
|
+
* does not expose a peer address.
|
|
26
|
+
*/
|
|
27
|
+
|
|
20
28
|
/** Runtime-neutral multipart file shape attached by adapters that parse uploads. */
|
|
21
29
|
|
|
22
30
|
/**
|
|
@@ -26,6 +34,19 @@ export let VersioningType = /*#__PURE__*/function (VersioningType) {
|
|
|
26
34
|
* contract before the underlying platform commits the response.
|
|
27
35
|
*/
|
|
28
36
|
|
|
37
|
+
/** Per-response write controls owned by response policies. */
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Headers accepted by one HTTP 103 Early Hints write.
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* Node-backed transports require at least one non-empty `link` value. Additional
|
|
44
|
+
* informational header fields must use valid HTTP names and values. Header names
|
|
45
|
+
* are case-insensitive and cannot be repeated with different casing.
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
/** Optional request-scoped capability for writing HTTP 103 Early Hints. */
|
|
49
|
+
|
|
29
50
|
/** Compression writer used when a platform can stream encoded response bodies. */
|
|
30
51
|
|
|
31
52
|
/** Additional metadata passed to a response compression writer. */
|
|
@@ -38,6 +59,39 @@ export let VersioningType = /*#__PURE__*/function (VersioningType) {
|
|
|
38
59
|
|
|
39
60
|
/** Response negotiation settings applied to one route or dispatcher instance. */
|
|
40
61
|
|
|
62
|
+
/** Strength used when serializing one generated HTTP entity tag. */
|
|
63
|
+
|
|
64
|
+
/** Portable entity tag generated for one selected resource representation. */
|
|
65
|
+
|
|
66
|
+
/** Validators that describe the current selected resource representation. */
|
|
67
|
+
|
|
68
|
+
/** Route and request information supplied when resolving a selected representation. */
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Current existence and validators for the selected representation.
|
|
72
|
+
*
|
|
73
|
+
* @remarks `exists` controls wildcard conditional fields independently from
|
|
74
|
+
* validator metadata, so an existing representation may intentionally omit
|
|
75
|
+
* both `ETag` and `Last-Modified`.
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
/** Resolves the selected representation before its route handler executes. */
|
|
79
|
+
|
|
80
|
+
/** Dispatcher-owned HTTP conditional request configuration. */
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* HTTP-classified failure data passed to an application HTML representation provider.
|
|
84
|
+
*
|
|
85
|
+
* @remarks
|
|
86
|
+
* The context intentionally omits `FrameworkResponse`. Providers may resolve
|
|
87
|
+
* request-scoped dependencies, but status, headers, body suppression, and
|
|
88
|
+
* response commit remain owned by the HTTP dispatcher.
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
/** Application-owned renderer for optional HTML error and not-found documents. */
|
|
92
|
+
|
|
93
|
+
/** Optional error representation providers registered for one HTTP application. */
|
|
94
|
+
|
|
41
95
|
/** Authenticated caller identity attached to the active request context. */
|
|
42
96
|
|
|
43
97
|
/**
|
|
@@ -55,6 +109,8 @@ export let VersioningType = /*#__PURE__*/function (VersioningType) {
|
|
|
55
109
|
|
|
56
110
|
/** Derived metadata used while mapping controllers into dispatchable handlers. */
|
|
57
111
|
|
|
112
|
+
/** Immutable route metadata retained by a handler mapping snapshot. */
|
|
113
|
+
|
|
58
114
|
/** Fully resolved controller handler descriptor stored in handler mappings. */
|
|
59
115
|
|
|
60
116
|
/** Result returned when request matching resolves one handler and path params. */
|
|
@@ -85,6 +141,12 @@ export let VersioningType = /*#__PURE__*/function (VersioningType) {
|
|
|
85
141
|
|
|
86
142
|
/** Declarative middleware binding for selected route patterns. */
|
|
87
143
|
|
|
144
|
+
/**
|
|
145
|
+
* Immutable route-binding view retained by handler mapping snapshots.
|
|
146
|
+
*
|
|
147
|
+
* @internal
|
|
148
|
+
*/
|
|
149
|
+
|
|
88
150
|
/** Guard execution context for one matched handler invocation. */
|
|
89
151
|
|
|
90
152
|
/** Authorization or precondition contract evaluated before handler execution. */
|
|
@@ -109,6 +171,12 @@ export let VersioningType = /*#__PURE__*/function (VersioningType) {
|
|
|
109
171
|
|
|
110
172
|
/** Middleware reference accepted by module/runtime configuration. */
|
|
111
173
|
|
|
174
|
+
/**
|
|
175
|
+
* Middleware reference retained by handler mapping snapshots.
|
|
176
|
+
*
|
|
177
|
+
* @internal
|
|
178
|
+
*/
|
|
179
|
+
|
|
112
180
|
/** Guard reference accepted by route metadata and runtime configuration. */
|
|
113
181
|
|
|
114
182
|
/** Interceptor reference accepted by route metadata and runtime configuration. */
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"controller",
|
|
11
11
|
"rest"
|
|
12
12
|
],
|
|
13
|
-
"version": "
|
|
13
|
+
"version": "3.0.0",
|
|
14
14
|
"private": false,
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"repository": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"directory": "packages/http"
|
|
20
20
|
},
|
|
21
21
|
"engines": {
|
|
22
|
-
"node": ">=
|
|
22
|
+
"node": ">=24.0.0 <27"
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public"
|
|
@@ -28,29 +28,39 @@
|
|
|
28
28
|
"exports": {
|
|
29
29
|
".": {
|
|
30
30
|
"types": "./dist/index.d.ts",
|
|
31
|
-
"
|
|
31
|
+
"bun": "./dist/index.js",
|
|
32
|
+
"deno": "./dist/index.portable.js",
|
|
33
|
+
"workerd": "./dist/index.portable.js",
|
|
34
|
+
"worker": "./dist/index.portable.js",
|
|
35
|
+
"browser": "./dist/index.portable.js",
|
|
36
|
+
"node": "./dist/index.js",
|
|
37
|
+
"import": "./dist/index.portable.js"
|
|
32
38
|
},
|
|
33
39
|
"./internal": {
|
|
34
40
|
"types": "./dist/internal.d.ts",
|
|
35
41
|
"import": "./dist/internal.js"
|
|
42
|
+
},
|
|
43
|
+
"./portable": {
|
|
44
|
+
"types": "./dist/index.portable.d.ts",
|
|
45
|
+
"import": "./dist/index.portable.js"
|
|
36
46
|
}
|
|
37
47
|
},
|
|
38
|
-
"main": "./dist/index.js",
|
|
48
|
+
"main": "./dist/index.portable.js",
|
|
39
49
|
"types": "./dist/index.d.ts",
|
|
40
50
|
"files": [
|
|
41
51
|
"dist"
|
|
42
52
|
],
|
|
43
53
|
"dependencies": {
|
|
44
|
-
"@fluojs/core": "^
|
|
45
|
-
"@fluojs/validation": "^
|
|
46
|
-
"@fluojs/di": "^
|
|
54
|
+
"@fluojs/core": "^2.0.0",
|
|
55
|
+
"@fluojs/validation": "^2.0.0",
|
|
56
|
+
"@fluojs/di": "^3.0.0"
|
|
47
57
|
},
|
|
48
58
|
"devDependencies": {
|
|
49
|
-
"vitest": "^
|
|
59
|
+
"vitest": "^4.1.11"
|
|
50
60
|
},
|
|
51
61
|
"scripts": {
|
|
52
62
|
"prebuild": "node ../../tooling/scripts/clean-dist.mjs",
|
|
53
|
-
"build": "pnpm exec babel src --extensions .ts --ignore 'src/**/*.test.ts' --out-dir dist --config-file ../../tooling/babel/babel.config.cjs && pnpm exec tsc -p tsconfig.build.json",
|
|
63
|
+
"build": "pnpm exec babel src --extensions .ts --ignore 'src/**/*.test.ts','src/**/*.test-fixture.ts' --out-dir dist --config-file ../../tooling/babel/babel.config.cjs && pnpm exec tsc -p tsconfig.build.json",
|
|
54
64
|
"typecheck": "pnpm exec tsc -p tsconfig.json --noEmit",
|
|
55
65
|
"test": "pnpm exec vitest run -c vitest.config.ts",
|
|
56
66
|
"test:watch": "pnpm exec vitest -c vitest.config.ts"
|