keq 2.8.9 → 2.8.11
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 +14 -0
- package/dist/esm/src/middlewares/abort-flow-control-middleware.js +5 -2
- package/dist/esm/src/types/keq-operation.d.ts +2 -2
- package/dist/umd/src/middlewares/abort-flow-control-middleware.js +5 -2
- package/dist/umd/src/types/keq-operation.d.ts +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [2.8.11](https://github.com/keq-request/keq/compare/v2.8.10...v2.8.11) (2025-06-05)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* ensure proper cleanup of abort flow control function ([fc5ad5e](https://github.com/keq-request/keq/commit/fc5ad5ea34a1fcbd83a65f4906750113a424780d))
|
|
11
|
+
|
|
12
|
+
## [2.8.10](https://github.com/keq-request/keq/compare/v2.8.9...v2.8.10) (2024-12-26)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* cannot extend KeqOperations ([908983d](https://github.com/keq-request/keq/commit/908983dd12037befb85bd944801a6b111979d4ce))
|
|
18
|
+
|
|
5
19
|
## [2.8.9](https://github.com/keq-request/keq/compare/v2.8.8...v2.8.9) (2024-12-22)
|
|
6
20
|
|
|
7
21
|
|
|
@@ -13,12 +13,15 @@ export function abortFlowControlMiddleware() {
|
|
|
13
13
|
const reason = new DOMException('The previous request was not completed, so keq flowControl abort this request.', 'AbortError');
|
|
14
14
|
abort(reason);
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
const fn = ctx.abort.bind(ctx);
|
|
17
|
+
ctx.global.abortFlowControl[key] = fn;
|
|
17
18
|
try {
|
|
18
19
|
await next();
|
|
19
20
|
}
|
|
20
21
|
finally {
|
|
21
|
-
ctx.global.abortFlowControl[key]
|
|
22
|
+
if (ctx.global.abortFlowControl[key] === fn) {
|
|
23
|
+
ctx.global.abortFlowControl[key] = undefined;
|
|
24
|
+
}
|
|
22
25
|
}
|
|
23
26
|
};
|
|
24
27
|
}
|
|
@@ -17,11 +17,11 @@ export interface KeqOperation {
|
|
|
17
17
|
}
|
|
18
18
|
export type ExtractFields<T extends Pick<KeqOperation, 'requestBody'>> = ExtractProperty<Exclude<Extract<T['requestBody'], object>, FormData | URLSearchParams | Array<any>>, string>;
|
|
19
19
|
export type ExtractFiles<T extends Pick<KeqOperation, 'requestBody'>> = ExtractProperty<Exclude<Extract<T['requestBody'], object>, FormData | URLSearchParams | Array<any>>, Buffer | Blob | File>;
|
|
20
|
-
export
|
|
20
|
+
export interface KeqOperations {
|
|
21
21
|
[url: string]: {
|
|
22
22
|
[method in KeqContextRequestMethod]?: KeqOperation;
|
|
23
23
|
};
|
|
24
|
-
}
|
|
24
|
+
}
|
|
25
25
|
export type FlattenOperations<T extends KeqOperations, M extends KeqContextRequestMethod> = {
|
|
26
26
|
[P in keyof T as T[P][M] extends KeqOperation ? P : never]: T[P][M] extends KeqOperation ? T[P][M] : never;
|
|
27
27
|
};
|
|
@@ -25,12 +25,15 @@
|
|
|
25
25
|
const reason = new DOMException('The previous request was not completed, so keq flowControl abort this request.', 'AbortError');
|
|
26
26
|
abort(reason);
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
const fn = ctx.abort.bind(ctx);
|
|
29
|
+
ctx.global.abortFlowControl[key] = fn;
|
|
29
30
|
try {
|
|
30
31
|
await next();
|
|
31
32
|
}
|
|
32
33
|
finally {
|
|
33
|
-
ctx.global.abortFlowControl[key]
|
|
34
|
+
if (ctx.global.abortFlowControl[key] === fn) {
|
|
35
|
+
ctx.global.abortFlowControl[key] = undefined;
|
|
36
|
+
}
|
|
34
37
|
}
|
|
35
38
|
};
|
|
36
39
|
}
|
|
@@ -17,11 +17,11 @@ export interface KeqOperation {
|
|
|
17
17
|
}
|
|
18
18
|
export type ExtractFields<T extends Pick<KeqOperation, 'requestBody'>> = ExtractProperty<Exclude<Extract<T['requestBody'], object>, FormData | URLSearchParams | Array<any>>, string>;
|
|
19
19
|
export type ExtractFiles<T extends Pick<KeqOperation, 'requestBody'>> = ExtractProperty<Exclude<Extract<T['requestBody'], object>, FormData | URLSearchParams | Array<any>>, Buffer | Blob | File>;
|
|
20
|
-
export
|
|
20
|
+
export interface KeqOperations {
|
|
21
21
|
[url: string]: {
|
|
22
22
|
[method in KeqContextRequestMethod]?: KeqOperation;
|
|
23
23
|
};
|
|
24
|
-
}
|
|
24
|
+
}
|
|
25
25
|
export type FlattenOperations<T extends KeqOperations, M extends KeqContextRequestMethod> = {
|
|
26
26
|
[P in keyof T as T[P][M] extends KeqOperation ? P : never]: T[P][M] extends KeqOperation ? T[P][M] : never;
|
|
27
27
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "keq",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.11",
|
|
4
4
|
"description": "Request API write by Typescript for flexibility, readability, and a low learning curve.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"request",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"typescript": "5.4.5",
|
|
69
69
|
"typescript-transform-paths": "^3.5.1"
|
|
70
70
|
},
|
|
71
|
-
"packageManager": "pnpm@9.
|
|
71
|
+
"packageManager": "pnpm@9.15.1",
|
|
72
72
|
"engines": {
|
|
73
73
|
"node": ">=18.0.0"
|
|
74
74
|
}
|