keq 5.0.0-alpha.9 → 5.0.0-beta.10

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 (213) hide show
  1. package/CHANGELOG.md +298 -0
  2. package/README.md +2 -2
  3. package/dist/index.d.mts +962 -0
  4. package/dist/index.d.mts.map +1 -0
  5. package/dist/index.d.ts +961 -6
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1796 -1416
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +1740 -1365
  10. package/dist/index.mjs.map +1 -1
  11. package/package.json +12 -11
  12. package/tsdown.config.ts +12 -0
  13. package/.turbo/turbo-build.log +0 -18
  14. package/dist/context/execution-context.d.ts +0 -24
  15. package/dist/context/execution-context.d.ts.map +0 -1
  16. package/dist/context/index.d.ts +0 -4
  17. package/dist/context/index.d.ts.map +0 -1
  18. package/dist/context/middleware-context.d.ts +0 -9
  19. package/dist/context/middleware-context.d.ts.map +0 -1
  20. package/dist/context/orchestrator-context.d.ts +0 -10
  21. package/dist/context/orchestrator-context.d.ts.map +0 -1
  22. package/dist/context/shared-context.d.ts +0 -38
  23. package/dist/context/shared-context.d.ts.map +0 -1
  24. package/dist/context/types/index.d.ts +0 -6
  25. package/dist/context/types/index.d.ts.map +0 -1
  26. package/dist/context/types/keq-context-data.d.ts +0 -7
  27. package/dist/context/types/keq-context-data.d.ts.map +0 -1
  28. package/dist/context/types/keq-context-emitter.d.ts +0 -35
  29. package/dist/context/types/keq-context-emitter.d.ts.map +0 -1
  30. package/dist/context/types/keq-context-options/index.d.ts +0 -6
  31. package/dist/context/types/keq-context-options/index.d.ts.map +0 -1
  32. package/dist/context/types/keq-context-options/keq-context-options.d.ts +0 -5
  33. package/dist/context/types/keq-context-options/keq-context-options.d.ts.map +0 -1
  34. package/dist/context/types/keq-context-options/keq-middleware-options.d.ts +0 -33
  35. package/dist/context/types/keq-context-options/keq-middleware-options.d.ts.map +0 -1
  36. package/dist/context/types/keq-context-options/keq-module-options.d.ts +0 -5
  37. package/dist/context/types/keq-context-options/keq-module-options.d.ts.map +0 -1
  38. package/dist/context/types/keq-context-options/keq-resolve-with-mode.d.ts +0 -2
  39. package/dist/context/types/keq-context-options/keq-resolve-with-mode.d.ts.map +0 -1
  40. package/dist/context/types/keq-context-options/keq-retry-options.d.ts +0 -9
  41. package/dist/context/types/keq-context-options/keq-retry-options.d.ts.map +0 -1
  42. package/dist/context/types/keq-context.d.ts +0 -17
  43. package/dist/context/types/keq-context.d.ts.map +0 -1
  44. package/dist/context/types/keq-global.d.ts +0 -7
  45. package/dist/context/types/keq-global.d.ts.map +0 -1
  46. package/dist/context/utils/index.d.ts +0 -2
  47. package/dist/context/utils/index.d.ts.map +0 -1
  48. package/dist/context/utils/watch-object.d.ts +0 -5
  49. package/dist/context/utils/watch-object.d.ts.map +0 -1
  50. package/dist/exception/abort.exception.d.ts +0 -4
  51. package/dist/exception/abort.exception.d.ts.map +0 -1
  52. package/dist/exception/exception.d.ts +0 -5
  53. package/dist/exception/exception.d.ts.map +0 -1
  54. package/dist/exception/index.d.ts +0 -6
  55. package/dist/exception/index.d.ts.map +0 -1
  56. package/dist/exception/request.exception.d.ts +0 -7
  57. package/dist/exception/request.exception.d.ts.map +0 -1
  58. package/dist/exception/timeout.exception.d.ts +0 -5
  59. package/dist/exception/timeout.exception.d.ts.map +0 -1
  60. package/dist/exception/type.exception.d.ts +0 -5
  61. package/dist/exception/type.exception.d.ts.map +0 -1
  62. package/dist/middleware/index.d.ts +0 -3
  63. package/dist/middleware/index.d.ts.map +0 -1
  64. package/dist/middleware/types/index.d.ts +0 -3
  65. package/dist/middleware/types/index.d.ts.map +0 -1
  66. package/dist/middleware/types/keq-middleware.d.ts +0 -7
  67. package/dist/middleware/types/keq-middleware.d.ts.map +0 -1
  68. package/dist/middleware/types/keq-next.d.ts +0 -2
  69. package/dist/middleware/types/keq-next.d.ts.map +0 -1
  70. package/dist/middleware/utils/compose-middleware.d.ts +0 -7
  71. package/dist/middleware/utils/compose-middleware.d.ts.map +0 -1
  72. package/dist/middleware/utils/index.d.ts +0 -2
  73. package/dist/middleware/utils/index.d.ts.map +0 -1
  74. package/dist/middlewares/fetch-middleware/index.d.ts +0 -6
  75. package/dist/middlewares/fetch-middleware/index.d.ts.map +0 -1
  76. package/dist/middlewares/flow-control-middleware/abort-flow-control-middleware.d.ts +0 -3
  77. package/dist/middlewares/flow-control-middleware/abort-flow-control-middleware.d.ts.map +0 -1
  78. package/dist/middlewares/flow-control-middleware/index.d.ts +0 -4
  79. package/dist/middlewares/flow-control-middleware/index.d.ts.map +0 -1
  80. package/dist/middlewares/flow-control-middleware/serial-flow-control-middleware.d.ts +0 -3
  81. package/dist/middlewares/flow-control-middleware/serial-flow-control-middleware.d.ts.map +0 -1
  82. package/dist/middlewares/flow-control-middleware/types/keq-flow-control.d.ts +0 -8
  83. package/dist/middlewares/flow-control-middleware/types/keq-flow-control.d.ts.map +0 -1
  84. package/dist/middlewares/index.d.ts +0 -4
  85. package/dist/middlewares/index.d.ts.map +0 -1
  86. package/dist/middlewares/timeout-middleware/index.d.ts +0 -6
  87. package/dist/middlewares/timeout-middleware/index.d.ts.map +0 -1
  88. package/dist/orchestrator/executor.d.ts +0 -12
  89. package/dist/orchestrator/executor.d.ts.map +0 -1
  90. package/dist/orchestrator/index.d.ts +0 -3
  91. package/dist/orchestrator/index.d.ts.map +0 -1
  92. package/dist/orchestrator/orchestrator.d.ts +0 -13
  93. package/dist/orchestrator/orchestrator.d.ts.map +0 -1
  94. package/dist/orchestrator/types/keq-middleware-context.d.ts +0 -4
  95. package/dist/orchestrator/types/keq-middleware-context.d.ts.map +0 -1
  96. package/dist/request/core.d.ts +0 -49
  97. package/dist/request/core.d.ts.map +0 -1
  98. package/dist/request/create-request.d.ts +0 -7
  99. package/dist/request/create-request.d.ts.map +0 -1
  100. package/dist/request/index.d.ts +0 -6
  101. package/dist/request/index.d.ts.map +0 -1
  102. package/dist/request/keq.d.ts +0 -115
  103. package/dist/request/keq.d.ts.map +0 -1
  104. package/dist/request/request.d.ts +0 -74
  105. package/dist/request/request.d.ts.map +0 -1
  106. package/dist/request/types/api-schema/api-schema-select.d.ts +0 -42
  107. package/dist/request/types/api-schema/api-schema-select.d.ts.map +0 -1
  108. package/dist/request/types/api-schema/api-schema.d.ts +0 -8
  109. package/dist/request/types/api-schema/api-schema.d.ts.map +0 -1
  110. package/dist/request/types/api-schema/default-operation.d.ts +0 -18
  111. package/dist/request/types/api-schema/default-operation.d.ts.map +0 -1
  112. package/dist/request/types/api-schema/extract-method-operations.d.ts +0 -31
  113. package/dist/request/types/api-schema/extract-method-operations.d.ts.map +0 -1
  114. package/dist/request/types/api-schema/index.d.ts +0 -6
  115. package/dist/request/types/api-schema/index.d.ts.map +0 -1
  116. package/dist/request/types/api-schema/operation.d.ts +0 -16
  117. package/dist/request/types/api-schema/operation.d.ts.map +0 -1
  118. package/dist/request/types/content-type.d.ts +0 -3
  119. package/dist/request/types/content-type.d.ts.map +0 -1
  120. package/dist/request/types/index.d.ts +0 -7
  121. package/dist/request/types/index.d.ts.map +0 -1
  122. package/dist/request/types/keq-attachable-file.d.ts +0 -2
  123. package/dist/request/types/keq-attachable-file.d.ts.map +0 -1
  124. package/dist/request/types/keq-param-value.d.ts +0 -3
  125. package/dist/request/types/keq-param-value.d.ts.map +0 -1
  126. package/dist/request/types/keq-query-options.d.ts +0 -7
  127. package/dist/request/types/keq-query-options.d.ts.map +0 -1
  128. package/dist/request/types/keq-query-value.d.ts +0 -7
  129. package/dist/request/types/keq-query-value.d.ts.map +0 -1
  130. package/dist/request/utils/fix-content-type.d.ts +0 -4
  131. package/dist/request/utils/fix-content-type.d.ts.map +0 -1
  132. package/dist/request/utils/get-location-id.d.ts +0 -2
  133. package/dist/request/utils/get-location-id.d.ts.map +0 -1
  134. package/dist/request/utils/index.d.ts +0 -6
  135. package/dist/request/utils/index.d.ts.map +0 -1
  136. package/dist/request/utils/intelligent-parse-response.d.ts +0 -2
  137. package/dist/request/utils/intelligent-parse-response.d.ts.map +0 -1
  138. package/dist/request/utils/merge-keq-request-body.d.ts +0 -3
  139. package/dist/request/utils/merge-keq-request-body.d.ts.map +0 -1
  140. package/dist/request/utils/query-stringify.d.ts +0 -3
  141. package/dist/request/utils/query-stringify.d.ts.map +0 -1
  142. package/dist/request-init/index.d.ts +0 -3
  143. package/dist/request-init/index.d.ts.map +0 -1
  144. package/dist/request-init/request-init.d.ts +0 -42
  145. package/dist/request-init/request-init.d.ts.map +0 -1
  146. package/dist/request-init/types/index.d.ts +0 -3
  147. package/dist/request-init/types/index.d.ts.map +0 -1
  148. package/dist/request-init/types/keq-request-body.d.ts +0 -2
  149. package/dist/request-init/types/keq-request-body.d.ts.map +0 -1
  150. package/dist/request-init/types/keq-request-method.d.ts +0 -2
  151. package/dist/request-init/types/keq-request-method.d.ts.map +0 -1
  152. package/dist/request-init/utils/clone-body.d.ts +0 -2
  153. package/dist/request-init/utils/clone-body.d.ts.map +0 -1
  154. package/dist/request-init/utils/clone-headers.d.ts +0 -2
  155. package/dist/request-init/utils/clone-headers.d.ts.map +0 -1
  156. package/dist/request-init/utils/compile-url.d.ts +0 -3
  157. package/dist/request-init/utils/compile-url.d.ts.map +0 -1
  158. package/dist/request-init/utils/index.d.ts +0 -6
  159. package/dist/request-init/utils/index.d.ts.map +0 -1
  160. package/dist/request-init/utils/to-form-data.d.ts +0 -2
  161. package/dist/request-init/utils/to-form-data.d.ts.map +0 -1
  162. package/dist/request-init/utils/to-url-search-params.d.ts +0 -2
  163. package/dist/request-init/utils/to-url-search-params.d.ts.map +0 -1
  164. package/dist/router/index.d.ts +0 -9
  165. package/dist/router/index.d.ts.map +0 -1
  166. package/dist/router/keq-host-route.d.ts +0 -3
  167. package/dist/router/keq-host-route.d.ts.map +0 -1
  168. package/dist/router/keq-location-route.d.ts +0 -3
  169. package/dist/router/keq-location-route.d.ts.map +0 -1
  170. package/dist/router/keq-method-route.d.ts +0 -3
  171. package/dist/router/keq-method-route.d.ts.map +0 -1
  172. package/dist/router/keq-module-route.d.ts +0 -3
  173. package/dist/router/keq-module-route.d.ts.map +0 -1
  174. package/dist/router/keq-pathname-route.d.ts +0 -3
  175. package/dist/router/keq-pathname-route.d.ts.map +0 -1
  176. package/dist/router/keq-router.d.ts +0 -13
  177. package/dist/router/keq-router.d.ts.map +0 -1
  178. package/dist/router/types/index.d.ts +0 -2
  179. package/dist/router/types/index.d.ts.map +0 -1
  180. package/dist/router/types/keq-route.d.ts +0 -3
  181. package/dist/router/types/keq-route.d.ts.map +0 -1
  182. package/dist/router/utils/compose-route.d.ts +0 -3
  183. package/dist/router/utils/compose-route.d.ts.map +0 -1
  184. package/dist/router/utils/index.d.ts +0 -2
  185. package/dist/router/utils/index.d.ts.map +0 -1
  186. package/dist/types/enabled-if-string-index.d.ts +0 -24
  187. package/dist/types/enabled-if-string-index.d.ts.map +0 -1
  188. package/dist/types/exclude-unknown-properties.d.ts +0 -19
  189. package/dist/types/exclude-unknown-properties.d.ts.map +0 -1
  190. package/dist/types/index-keys.d.ts +0 -18
  191. package/dist/types/index-keys.d.ts.map +0 -1
  192. package/dist/types/index.d.ts +0 -7
  193. package/dist/types/index.d.ts.map +0 -1
  194. package/dist/types/literal-keys.d.ts +0 -18
  195. package/dist/types/literal-keys.d.ts.map +0 -1
  196. package/dist/types/loose-nested-like.d.ts +0 -11
  197. package/dist/types/loose-nested-like.d.ts.map +0 -1
  198. package/dist/types/string-index-value-of.d.ts +0 -18
  199. package/dist/types/string-index-value-of.d.ts.map +0 -1
  200. package/dist/utils/base64.d.ts +0 -3
  201. package/dist/utils/base64.d.ts.map +0 -1
  202. package/dist/utils/index.d.ts +0 -4
  203. package/dist/utils/index.d.ts.map +0 -1
  204. package/dist/utils/shallow-clone.d.ts +0 -5
  205. package/dist/utils/shallow-clone.d.ts.map +0 -1
  206. package/dist/utils/sleep.d.ts +0 -2
  207. package/dist/utils/sleep.d.ts.map +0 -1
  208. package/dist/validator/index.d.ts +0 -2
  209. package/dist/validator/index.d.ts.map +0 -1
  210. package/dist/validator/validator.d.ts +0 -65
  211. package/dist/validator/validator.d.ts.map +0 -1
  212. package/jest.browser.config.ts +0 -22
  213. package/jest.config.cts +0 -22
package/CHANGELOG.md CHANGED
@@ -1,5 +1,303 @@
1
+ ## 5.0.0-beta.10
2
+
3
+ ### Minor Changes
4
+
5
+ - 95908fd: **Feat:** add `mutex` flow control mode that rejects new requests when a request with the same signal key is already in-flight, throwing `MutexException`
6
+
7
+ ## 5.0.0-beta.9
8
+
9
+ ## 5.0.0-beta.8
10
+
11
+ ## 5.0.0-beta.7
12
+
13
+ ## 5.0.0-beta.6
14
+
15
+ ## 5.0.0-beta.5
16
+
17
+ ## 5.0.0-beta.4
18
+
19
+ ## 5.0.0-beta.3
20
+
21
+ ## 5.0.0-beta.2
22
+
23
+ ## 5.0.0-beta.1
24
+
25
+ ### Major Changes
26
+
27
+ - 153244f: **BREAKING CHANGE:** Add an options to control query serialization.
28
+
29
+ - `.query({ a: [1, 2]})` => `?a[0]=1&a[1]=2`
30
+ - `.query({ a: [1, 2]}, { arrayFormat: 'brackets' })` => `?a[]=1&a[]=2`(default in keq@2)
31
+ - `.query({ a: [1, 2]}, { arrayFormat: 'repeat' })` => `?a=1&a=2`
32
+ - `.query({ a: [1, 2]}, { arrayFormat: 'comma' })` => `?a=1,2`
33
+
34
+ - 153244f: **BREAKING CHANGE:** Prevent modification of the immutable properties of the context.
35
+ - 153244f: **BREAKING CHANGE:** `.params(key, value)` will not encode value automatically, please replace it with `.params(key, encodeURIComponent(value)`, if necessary.
36
+ - 214ae66: **BREAKING CHANGE:** RequestException third parameter changed from retry: boolean to options: { fatal: boolean, response: Response }
37
+
38
+ ```javascript
39
+ // Before
40
+ new RequestException(400, "Error message", true);
41
+
42
+ // After
43
+ new RequestException(400, "Error message", {
44
+ fatal: false,
45
+ response: someResponseObject,
46
+ });
47
+ ```
48
+
49
+ - 0c7db81: **BREAKING CHANGE:** remove appendMiddlewares and prependMiddlewares from Keq.
50
+ - 153244f: **BREAKING CHANGE:** refactor event emitter. `fetch` event has been removed, please use `fetch:before`/`fetch:after` instead.
51
+
52
+ - add new function `.on(eventName, callback)` listen keq events
53
+ - add new event `fetch:before`
54
+ - add new event `fetch:after`
55
+ - add new event `middleware:before`
56
+ - add new event `middleware:after`
57
+ - add new event `timeout`
58
+ - add new event `abort`
59
+ - add new event `error`
60
+ - add new event `retry`
61
+
62
+ - 7ff2162: **BREAKING CHANGE:** Strictly adhere to URI template implementation (RFC 6570 compliant). Therefore, ':id' is no longer supported.
63
+ - 153244f: **BREAKING CHANGE:** change KeqRequest from interface to class.
64
+
65
+ - `request` cannot be invoke directly, please use `request.fetch()` instead.
66
+ - `KeqOptions` renamed to `KeqMiddlewareOptions`.
67
+ - `KeqOperations` renamed to `KeqApiSchema`.
68
+ - `KeqBaseOperation` renamed to `KeqDefaultOperation`.
69
+
70
+ - 153244f: **BREAKING CHANGE:** Refactoring keq middlewares
71
+
72
+ - `retryMiddleware`, `proxyResponseMiddleware`, `fetchArgumentMiddleware` be removed.
73
+ - `abortFlowControlMiddleware` and `serialFlowControlMiddleware` merged into `flowControlMiddleware`.
74
+ - `ctx.metadata` has been removed, please use `ctx.orchestrator` instead.
75
+ - `.retry()` will rerun all middlewares now, assert `ctx.data.retry.attempt` if middleware is not expect to be run.
76
+ - `ctx.options.retryOn`, `ctx.options.retryTimes` and `ctx.options.retryDelay` are replaced by `ctx.options.retry.on`, `ctx.options.retry.times` and `ctx.options.retry.delay`.
77
+ - `.option("resolveWithResponse")` had be removed, please use `.resolveWith('response')` instead.
78
+ - `next` cannot be run multi-times now.
79
+ - Some typescript type names have changed.
80
+ - `ctx.request.routeParams` is renamed to `ctx.request.pathParameters`
81
+
82
+ - 153244f: **BREAKING CHANGE:** Drop support node@18.
83
+ - f8abc63: **BREAKING CHANGE:** Remove `end()`, add `derive()` for reusing request configuration and `fire()` for fire-and-forget invocation.
84
+ - 0a04864: **Fix:** fix: update browser targets to chrome91/firefox90/safari15/edge91 to resolve esbuild 0.27 destructuring build errors.
85
+
86
+ ### Minor Changes
87
+
88
+ - 0a2eb2f: **Feat:** server-sent event support.
89
+ - c7ffd1f: **Feat:** synchronous middleware can be written
90
+ - 9290139: **Feat:** add event listener support to KeqRequest.
91
+ - a7a83da: **Perf:** Core now extends Promise, making keq instances true Promises instead of thenables.
92
+ - 153244f: **Feat:** add `.headers` as an alias for `.set`
93
+ - ca6c879: The forked orchestrator can be merged into original orchestrator.
94
+ - 63161c4: **Feat:** the .flowControl() support concurrency.
95
+ - d472648: context.orhestration.middleware can get current middleware status
96
+ - b8d02ca: **Perf:** allow `undefined` as query value in string index signature overloads.
97
+ - 153244f: **Feat:** `.attach` can take multiple files.
98
+ - eed26f9: **Feat:** add build-in http exceptions.
99
+
100
+ - `BadRequestException`
101
+ - `UnauthorizedException`
102
+ - `ForbiddenException`
103
+ - `NotFoundedException`
104
+ - `NotAcceptableException`
105
+ - `ConflictException`
106
+ - `GatewayTimeoutException`
107
+ - `InternalServerErrorException`
108
+ - `BadGatewayException`
109
+ - `ServiceUnavailableException`
110
+ - `PreconditionFailedException`
111
+
112
+ ### Patch Changes
113
+
114
+ - cbc5d17: ensure the monotonicity of middleware execution
115
+ - 153244f: optimize code suggestions
116
+ - 90311b3: Fix the error in recording the execution sequence number of orc caused by a middleware error.
117
+ - 1f367c0: more internal http exception
118
+ - df114d1: Fixed the issue of missing res after merging forked orchestrator.
119
+ - 2686b8d: build with turbo
120
+ - 842e555: **Perf:** avoid unnecessary deserialization.
121
+ - 2686b8d: remove private dependencies
122
+ - 7873a0a: Optimize middleware name generation
123
+ - e7eb9dc: Don't publish .turbo and jest.config.cts to npm
124
+ - 22ce01a: **Fix:** JSON.stringify ctx.response always get empty object.
125
+ - 0873c7e: Incorrect build before release.
126
+ - f194c41: **Fix:** types being unrecognized due to type-fest version upgrades.
127
+ - d076b76: **Fix:** resolve pnpm singleton trap by deduplicating instances.
128
+ - 581815a: ensure compatibility
129
+ - 7343445: Incorrect build before release
130
+
131
+ ## 5.0.0-alpha.36
132
+
133
+ ## 5.0.0-alpha.35
134
+
135
+ ### Major Changes
136
+
137
+ - 0a04864: **Fix:** fix: update browser targets to chrome91/firefox90/safari15/edge91 to resolve esbuild 0.27 destructuring build errors.
138
+
139
+ ## 5.0.0-alpha.34
140
+
141
+ ### Major Changes
142
+
143
+ - f8abc63: **BREAKING CHANGE:** Remove `end()`, add `derive()` for reusing request configuration and `fire()` for fire-and-forget invocation.
144
+
145
+ ### Minor Changes
146
+
147
+ - a7a83da: **Perf:** Core now extends Promise, making keq instances true Promises instead of thenables.
148
+
149
+ ## 5.0.0-alpha.33
150
+
151
+ ## 5.0.0-alpha.32
152
+
153
+ ### Minor Changes
154
+
155
+ - b8d02ca: **Perf:** allow `undefined` as query value in string index signature overloads.
156
+
157
+ ### Patch Changes
158
+
159
+ - f194c41: **Fix:** types being unrecognized due to type-fest version upgrades.
160
+
1
161
  ## 5.0.0-alpha.6 (2025-09-17)
2
162
 
163
+ ## 5.0.0-alpha.31
164
+
165
+ ## 5.0.0-alpha.30
166
+
167
+ ## 5.0.0-alpha.29
168
+
169
+ ## 5.0.0-alpha.28
170
+
171
+ ### Patch Changes
172
+
173
+ - d076b76: **Fix:** resolve pnpm singleton trap by deduplicating instances.
174
+
175
+ ## 5.0.0-alpha.27
176
+
177
+ ### Major Changes
178
+
179
+ - 0c7db81: **BREAKING CHANGE:** remove appendMiddlewares and prependMiddlewares from Keq.
180
+
181
+ ## 5.0.0-alpha.26
182
+
183
+ ### Minor Changes
184
+
185
+ - 63161c4: **Feat:** the .flowControl() support concurrency.
186
+
187
+ ### Patch Changes
188
+
189
+ - 22ce01a: **Fix:** JSON.stringify ctx.response always get empty object.
190
+
191
+ ## 5.0.0-alpha.25
192
+
193
+ ### Major Changes
194
+
195
+ - 214ae66: **BREAKING CHANGE:** RequestException third parameter changed from retry: boolean to options: { fatal: boolean, response: Response }
196
+
197
+ ```javascript
198
+ // Before
199
+ new RequestException(400, "Error message", true);
200
+
201
+ // After
202
+ new RequestException(400, "Error message", {
203
+ fatal: false,
204
+ response: someResponseObject,
205
+ });
206
+ ```
207
+
208
+ ### Minor Changes
209
+
210
+ - 9290139: **Feat:** add event listener support to KeqRequest.
211
+
212
+ ## 5.0.0-alpha.24
213
+
214
+ ### Minor Changes
215
+
216
+ - 0a2eb2f: **Feat:** server-sent event support.
217
+
218
+ ## 5.0.0-alpha.23
219
+
220
+ ### Patch Changes
221
+
222
+ - 842e555: **Perf:** avoid unnecessary deserialization.
223
+ - 7873a0a: Optimize middleware name generation
224
+
225
+ ## 5.0.0-alpha.22
226
+
227
+ ### Patch Changes
228
+
229
+ - df114d1: Fixed the issue of missing res after merging forked orchestrator.
230
+
231
+ ## 5.0.0-alpha.21
232
+
233
+ ### Patch Changes
234
+
235
+ - 90311b3: Fix the error in recording the execution sequence number of orc caused by a middleware error.
236
+
237
+ ## 5.0.0-alpha.20
238
+
239
+ ### Patch Changes
240
+
241
+ - 1f367c0: more internal http exception
242
+
243
+ ## 5.0.0-alpha.19
244
+
245
+ ## 5.0.0-alpha.18
246
+
247
+ ### Patch Changes
248
+
249
+ - cbc5d17: ensure the monotonicity of middleware execution
250
+
251
+ ## 5.0.0-alpha.17
252
+
253
+ ### Minor Changes
254
+
255
+ - d472648: context.orhestration.middleware can get current middleware status
256
+ - eed26f9: **Feat:** add build-in http exceptions.
257
+
258
+ - `BadRequestException`
259
+ - `UnauthorizedException`
260
+ - `ForbiddenException`
261
+ - `NotFoundedException`
262
+ - `NotAcceptableException`
263
+ - `ConflictException`
264
+ - `GatewayTimeoutException`
265
+ - `InternalServerErrorException`
266
+ - `BadGatewayException`
267
+ - `ServiceUnavailableException`
268
+ - `PreconditionFailedException`
269
+
270
+ ## 5.0.0-alpha.16
271
+
272
+ ### Minor Changes
273
+
274
+ - ca6c879: The forked orchestrator can be merged into original orchestrator.
275
+
276
+ ## 5.0.0-alpha.15
277
+
278
+ ## 5.0.0-alpha.14
279
+
280
+ ## 5.0.0-alpha.13
281
+
282
+ ## 5.0.0-alpha.12
283
+
284
+ ### Patch Changes
285
+
286
+ - 581815a: ensure compatibility
287
+
288
+ ## 5.0.0-alpha.11
289
+
290
+ ### Minor Changes
291
+
292
+ - c7ffd1f: **Feat:** synchronous middleware can be written
293
+
294
+ ## 5.0.0-alpha.10
295
+
296
+ ### Patch Changes
297
+
298
+ - e7eb9dc: Don't publish .turbo and jest.config.cts to npm
299
+ - 7343445: Incorrect build before release
300
+
3
301
  ## 5.0.0-alpha.9
4
302
 
5
303
  ### Patch Changes
package/README.md CHANGED
@@ -36,7 +36,7 @@ Keq wraps the Fetch APIs, adding chain calls and middleware functions.
36
36
  ### Send Request
37
37
 
38
38
  A request can be initiated by invoking the appropriate method on the request object,
39
- then calling `.then()` (or `.end()` or `await`) to send the request.
39
+ then calling `.then()` (or `await`) to send the request.
40
40
  For example a simple GET request:
41
41
 
42
42
  ```javascript
@@ -92,7 +92,7 @@ import { request } from "keq";
92
92
 
93
93
  const response = await request
94
94
  .get("http://test.com")
95
- .resolve('response')
95
+ .resolveWith('response')
96
96
 
97
97
  const body = await response.json();
98
98
  ```