@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.
Files changed (125) hide show
  1. package/README.ko.md +417 -16
  2. package/README.md +424 -16
  3. package/dist/access-log-observer.d.ts +77 -0
  4. package/dist/access-log-observer.d.ts.map +1 -0
  5. package/dist/access-log-observer.js +171 -0
  6. package/dist/adapter.d.ts +9 -0
  7. package/dist/adapter.d.ts.map +1 -1
  8. package/dist/adapter.js +15 -1
  9. package/dist/adapters/binding.d.ts.map +1 -1
  10. package/dist/adapters/binding.js +18 -16
  11. package/dist/adapters/dto-binding-plan.d.ts +2 -2
  12. package/dist/adapters/dto-binding-plan.d.ts.map +1 -1
  13. package/dist/adapters/dto-binding-plan.js +13 -4
  14. package/dist/adapters/dto-validation-adapter.d.ts +2 -1
  15. package/dist/adapters/dto-validation-adapter.d.ts.map +1 -1
  16. package/dist/adapters/dto-validation-adapter.js +2 -2
  17. package/dist/byte-range-response.d.ts +71 -0
  18. package/dist/byte-range-response.d.ts.map +1 -0
  19. package/dist/byte-range-response.js +347 -0
  20. package/dist/client-identity.d.ts +8 -4
  21. package/dist/client-identity.d.ts.map +1 -1
  22. package/dist/client-identity.js +12 -93
  23. package/dist/compiled-route-identity.d.ts +17 -0
  24. package/dist/compiled-route-identity.d.ts.map +1 -0
  25. package/dist/compiled-route-identity.js +29 -0
  26. package/dist/connection.d.ts +67 -0
  27. package/dist/connection.d.ts.map +1 -0
  28. package/dist/connection.js +480 -0
  29. package/dist/context/request-context-node-store.d.ts +6 -0
  30. package/dist/context/request-context-node-store.d.ts.map +1 -1
  31. package/dist/context/request-context-node-store.js +14 -0
  32. package/dist/context/request-context.d.ts +5 -5
  33. package/dist/context/request-context.d.ts.map +1 -1
  34. package/dist/context/request-context.js +8 -83
  35. package/dist/context/request-id.d.ts +10 -0
  36. package/dist/context/request-id.d.ts.map +1 -0
  37. package/dist/context/request-id.js +27 -0
  38. package/dist/context/sse.d.ts +13 -0
  39. package/dist/context/sse.d.ts.map +1 -1
  40. package/dist/context/sse.js +36 -6
  41. package/dist/cookie-helpers.d.ts +47 -0
  42. package/dist/cookie-helpers.d.ts.map +1 -0
  43. package/dist/cookie-helpers.js +166 -0
  44. package/dist/decorators.d.ts +52 -19
  45. package/dist/decorators.d.ts.map +1 -1
  46. package/dist/decorators.js +57 -10
  47. package/dist/dispatch/conditional-request-policy.d.ts +67 -0
  48. package/dist/dispatch/conditional-request-policy.d.ts.map +1 -0
  49. package/dist/dispatch/conditional-request-policy.js +297 -0
  50. package/dist/dispatch/dispatch-content-negotiation.d.ts +8 -0
  51. package/dist/dispatch/dispatch-content-negotiation.d.ts.map +1 -1
  52. package/dist/dispatch/dispatch-content-negotiation.js +89 -42
  53. package/dist/dispatch/dispatch-error-negotiation.d.ts +26 -0
  54. package/dist/dispatch/dispatch-error-negotiation.d.ts.map +1 -0
  55. package/dist/dispatch/dispatch-error-negotiation.js +110 -0
  56. package/dist/dispatch/dispatch-error-policy.d.ts +1 -10
  57. package/dist/dispatch/dispatch-error-policy.d.ts.map +1 -1
  58. package/dist/dispatch/dispatch-error-policy.js +1 -33
  59. package/dist/dispatch/dispatch-error-representation.d.ts +18 -0
  60. package/dist/dispatch/dispatch-error-representation.d.ts.map +1 -0
  61. package/dist/dispatch/dispatch-error-representation.js +125 -0
  62. package/dist/dispatch/dispatch-response-metadata.d.ts +10 -0
  63. package/dist/dispatch/dispatch-response-metadata.d.ts.map +1 -0
  64. package/dist/dispatch/dispatch-response-metadata.js +12 -0
  65. package/dist/dispatch/dispatch-response-policy.d.ts +30 -3
  66. package/dist/dispatch/dispatch-response-policy.d.ts.map +1 -1
  67. package/dist/dispatch/dispatch-response-policy.js +104 -15
  68. package/dist/dispatch/dispatcher.d.ts +5 -1
  69. package/dist/dispatch/dispatcher.d.ts.map +1 -1
  70. package/dist/dispatch/dispatcher.js +140 -100
  71. package/dist/dispatch/fast-path/debug-visibility.d.ts.map +1 -1
  72. package/dist/dispatch/fast-path/debug-visibility.js +6 -3
  73. package/dist/dispatch/fast-path/dispatcher-state.d.ts +10 -0
  74. package/dist/dispatch/fast-path/dispatcher-state.d.ts.map +1 -0
  75. package/dist/dispatch/fast-path/dispatcher-state.js +52 -0
  76. package/dist/dispatch/fast-path/eligibility-checker.d.ts.map +1 -1
  77. package/dist/dispatch/fast-path/eligibility-checker.js +27 -15
  78. package/dist/dispatch/fast-path/eligibility.d.ts +16 -10
  79. package/dist/dispatch/fast-path/eligibility.d.ts.map +1 -1
  80. package/dist/dispatch/fast-path/eligibility.js +10 -4
  81. package/dist/dispatch/fast-path/fast-path-executor.d.ts +1 -1
  82. package/dist/dispatch/fast-path/fast-path-executor.d.ts.map +1 -1
  83. package/dist/dispatch/fast-path/fast-path-executor.js +8 -5
  84. package/dist/dispatch/request-abort.d.ts +22 -0
  85. package/dist/dispatch/request-abort.d.ts.map +1 -0
  86. package/dist/dispatch/request-abort.js +30 -0
  87. package/dist/dispatch/response-integration.d.ts +55 -0
  88. package/dist/dispatch/response-integration.d.ts.map +1 -0
  89. package/dist/dispatch/response-integration.js +57 -0
  90. package/dist/errors.d.ts +10 -0
  91. package/dist/errors.d.ts.map +1 -1
  92. package/dist/errors.js +19 -0
  93. package/dist/guards.d.ts +1 -1
  94. package/dist/guards.d.ts.map +1 -1
  95. package/dist/header-helpers.d.ts +59 -0
  96. package/dist/header-helpers.d.ts.map +1 -0
  97. package/dist/header-helpers.js +185 -0
  98. package/dist/index.d.ts +1 -16
  99. package/dist/index.d.ts.map +1 -1
  100. package/dist/index.js +4 -15
  101. package/dist/index.portable.d.ts +25 -0
  102. package/dist/index.portable.d.ts.map +1 -0
  103. package/dist/index.portable.js +21 -0
  104. package/dist/internal.d.ts +3 -1
  105. package/dist/internal.d.ts.map +1 -1
  106. package/dist/internal.js +2 -0
  107. package/dist/mapping.d.ts.map +1 -1
  108. package/dist/mapping.js +100 -15
  109. package/dist/middleware/correlation.d.ts +9 -1
  110. package/dist/middleware/correlation.d.ts.map +1 -1
  111. package/dist/middleware/correlation.js +25 -14
  112. package/dist/middleware/cors.d.ts.map +1 -1
  113. package/dist/middleware/cors.js +5 -8
  114. package/dist/middleware/middleware.d.ts +3 -3
  115. package/dist/middleware/middleware.d.ts.map +1 -1
  116. package/dist/middleware/rate-limit.d.ts +13 -2
  117. package/dist/middleware/rate-limit.d.ts.map +1 -1
  118. package/dist/middleware/rate-limit.js +1 -0
  119. package/dist/static-assets.d.ts +77 -0
  120. package/dist/static-assets.d.ts.map +1 -0
  121. package/dist/static-assets.js +270 -0
  122. package/dist/types.d.ts +209 -16
  123. package/dist/types.d.ts.map +1 -1
  124. package/dist/types.js +69 -1
  125. package/package.json +19 -9
package/dist/types.js CHANGED
@@ -1,4 +1,4 @@
1
- /** HTTP methods understood by Fluo route metadata and dispatcher matching. */
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": "2.0.1",
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": ">=20.0.0"
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
- "import": "./dist/index.js"
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": "^1.1.0",
45
- "@fluojs/validation": "^1.0.6",
46
- "@fluojs/di": "^2.0.0"
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": "^3.2.4"
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"