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