keq 5.0.0-alpha.5 → 5.0.0-alpha.7
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 +191 -240
- package/jest.browser.config.ts +22 -0
- package/jest.config.cts +22 -0
- package/package.json +21 -24
- package/dist/index.cjs.js +0 -1115
- package/dist/index.d.ts +0 -1
- package/dist/index.esm.js +0 -1082
- package/dist/package.json +0 -65
- package/dist/src/constant.d.ts +0 -2
- package/dist/src/core.d.ts +0 -36
- package/dist/src/create-request.d.ts +0 -9
- package/dist/src/exception/exception.d.ts +0 -4
- package/dist/src/exception/invalid-arguments.exception.d.ts +0 -4
- package/dist/src/index.d.ts +0 -23
- package/dist/src/is/is-array-buffer.d.ts +0 -1
- package/dist/src/is/is-blob.d.ts +0 -4
- package/dist/src/is/is-browser.d.ts +0 -1
- package/dist/src/is/is-buffer.d.ts +0 -1
- package/dist/src/is/is-file.d.ts +0 -1
- package/dist/src/is/is-form-data.d.ts +0 -1
- package/dist/src/is/is-function.d.ts +0 -1
- package/dist/src/is/is-headers.d.ts +0 -1
- package/dist/src/is/is-object.d.ts +0 -1
- package/dist/src/is/is-readable-stream.d.ts +0 -1
- package/dist/src/is/is-string.d.ts +0 -1
- package/dist/src/is/is-url-search-params.d.ts +0 -1
- package/dist/src/keq.d.ts +0 -93
- package/dist/src/middlewares/abort-flow-control-middleware.d.ts +0 -2
- package/dist/src/middlewares/fetch-arguments-middleware.d.ts +0 -2
- package/dist/src/middlewares/fetch-middleware.d.ts +0 -5
- package/dist/src/middlewares/proxy-response-middleware.d.ts +0 -2
- package/dist/src/middlewares/retry-middleware.d.ts +0 -2
- package/dist/src/middlewares/serial-flow-control-middleware.d.ts +0 -2
- package/dist/src/middlewares/timeout-middleware.d.ts +0 -2
- package/dist/src/request.d.ts +0 -1
- package/dist/src/router/keq-host-route.d.ts +0 -2
- package/dist/src/router/keq-location-route.d.ts +0 -2
- package/dist/src/router/keq-method-route.d.ts +0 -2
- package/dist/src/router/keq-module-route.d.ts +0 -2
- package/dist/src/router/keq-pathname-route.d.ts +0 -2
- package/dist/src/router/keq-router.d.ts +0 -12
- package/dist/src/types/content-type.d.ts +0 -2
- package/dist/src/types/exclude-property.d.ts +0 -3
- package/dist/src/types/extract-property.d.ts +0 -3
- package/dist/src/types/keq-context-request.d.ts +0 -18
- package/dist/src/types/keq-context.d.ts +0 -62
- package/dist/src/types/keq-events.d.ts +0 -8
- package/dist/src/types/keq-flow-control.d.ts +0 -7
- package/dist/src/types/keq-global.d.ts +0 -6
- package/dist/src/types/keq-init.d.ts +0 -2
- package/dist/src/types/keq-middleware.d.ts +0 -3
- package/dist/src/types/keq-next.d.ts +0 -1
- package/dist/src/types/keq-operation.d.ts +0 -44
- package/dist/src/types/keq-options.d.ts +0 -55
- package/dist/src/types/keq-query-value.d.ts +0 -6
- package/dist/src/types/keq-request.d.ts +0 -32
- package/dist/src/types/keq-resolve-with-mode.d.ts +0 -1
- package/dist/src/types/keq-retry.d.ts +0 -3
- package/dist/src/types/keq-route.d.ts +0 -2
- package/dist/src/types/keq-timeout.d.ts +0 -3
- package/dist/src/util/base64.d.ts +0 -2
- package/dist/src/util/clone-body.d.ts +0 -1
- package/dist/src/util/compile-url.d.ts +0 -1
- package/dist/src/util/compose-middleware.d.ts +0 -2
- package/dist/src/util/compose-route.d.ts +0 -2
- package/dist/src/util/create-response-proxy.d.ts +0 -1
- package/dist/src/util/fix-content-type.d.ts +0 -3
- package/dist/src/util/get-unique-code-identifier.d.ts +0 -1
- package/dist/src/util/is-valid-header-value.d.ts +0 -1
- package/dist/src/util/merge-keq-request-body.d.ts +0 -2
- package/dist/src/util/shallow-clone.d.ts +0 -4
- package/project.json +0 -16
- package/tsconfig.json +0 -28
- package/tsconfig.lib.json +0 -15
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Config } from 'jest'
|
|
2
|
+
import { pathsToModuleNameMapper } from 'ts-jest'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export default async (): Promise<Config> => {
|
|
6
|
+
const tsconfig = (await import('./tsconfig.json', { with: { type: 'json' } })).default
|
|
7
|
+
|
|
8
|
+
return {
|
|
9
|
+
preset: 'ts-jest',
|
|
10
|
+
setupFilesAfterEnv: ['<rootDir>/__tests__/setup.ts'],
|
|
11
|
+
moduleNameMapper: pathsToModuleNameMapper(tsconfig.compilerOptions.paths, { prefix: '<rootDir>/', useESM: true }),
|
|
12
|
+
|
|
13
|
+
displayName: 'Browser',
|
|
14
|
+
testEnvironment: 'jest-environment-jsdom',
|
|
15
|
+
testMatch: [
|
|
16
|
+
'<rootDir>/__tests__/browser/**/*.spec.ts',
|
|
17
|
+
'<rootDir>/__tests__/*.spec.ts',
|
|
18
|
+
'<rootDir>/src/**/*.browser.spec.ts',
|
|
19
|
+
'<rootDir>/src/**/!(*.node|*.browser).spec.ts',
|
|
20
|
+
],
|
|
21
|
+
}
|
|
22
|
+
}
|
package/jest.config.cts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import fs from 'fs'
|
|
2
|
+
import path from 'path'
|
|
3
|
+
import type { Config } from 'jest'
|
|
4
|
+
import { pathsToModuleNameMapper } from 'ts-jest'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export default (): Config => {
|
|
8
|
+
const tsconfig = JSON.parse(fs.readFileSync(path.join(__dirname, './tsconfig.json'), 'utf-8'))
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
preset: 'ts-jest',
|
|
12
|
+
setupFilesAfterEnv: ['<rootDir>/__tests__/setup.ts'],
|
|
13
|
+
moduleNameMapper: pathsToModuleNameMapper(tsconfig.compilerOptions.paths, { prefix: '<rootDir>/src', useESM: true }),
|
|
14
|
+
testEnvironment: 'node',
|
|
15
|
+
testMatch: [
|
|
16
|
+
'<rootDir>/__tests__/node/**/*.spec.ts',
|
|
17
|
+
'<rootDir>/__tests__/*.spec.ts',
|
|
18
|
+
'<rootDir>/src/**/*.node.spec.ts',
|
|
19
|
+
'<rootDir>/src/**/!(*.node|*.browser).spec.ts',
|
|
20
|
+
],
|
|
21
|
+
}
|
|
22
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "keq",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.7",
|
|
4
4
|
"description": "Request API write by Typescript for flexibility, readability, and a low learning curve.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"request",
|
|
@@ -16,12 +16,14 @@
|
|
|
16
16
|
],
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"author": "Val.istar.Guo <val.istar.guo@gmail.com>",
|
|
19
|
-
"main": "dist/index.js",
|
|
20
|
-
"module": "dist/index.esm.js",
|
|
21
19
|
"types": "dist/index.d.ts",
|
|
20
|
+
"main": "dist/index.js",
|
|
22
21
|
"exports": {
|
|
23
|
-
"
|
|
24
|
-
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"require": "./dist/index.js",
|
|
25
|
+
"import": "./dist/index.mjs"
|
|
26
|
+
}
|
|
25
27
|
},
|
|
26
28
|
"homepage": "https://github.com/keq-request/keq#readme",
|
|
27
29
|
"bugs": {
|
|
@@ -32,34 +34,29 @@
|
|
|
32
34
|
"url": "git+https://github.com/keq-request/keq.git"
|
|
33
35
|
},
|
|
34
36
|
"dependencies": {
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
+
"@opendoc/uri-template": "^1.5.4",
|
|
38
|
+
"fastq": "^1.19.1",
|
|
39
|
+
"klona": "^2.0.6",
|
|
40
|
+
"minimatch": "^10.1.1",
|
|
37
41
|
"mitt": "^3.0.1",
|
|
38
|
-
"qs": "^6.
|
|
42
|
+
"qs": "^6.14.0",
|
|
39
43
|
"ts-custom-error": "^3.3.1",
|
|
40
|
-
"type-fest": "^
|
|
44
|
+
"type-fest": "^5.2.0"
|
|
41
45
|
},
|
|
42
46
|
"devDependencies": {
|
|
43
|
-
"@buka/eslint-config": "^2.1.1",
|
|
44
|
-
"@jest/globals": "^29.7.0",
|
|
45
47
|
"@types/clone": "^2.1.4",
|
|
46
|
-
"@types/
|
|
47
|
-
"@types/
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"jest": "^29.7.0",
|
|
51
|
-
"jest-environment-jsdom": "^29.7.0",
|
|
52
|
-
"jest-mock": "^29.7.0",
|
|
53
|
-
"ts-jest": "^29.1.5",
|
|
54
|
-
"ts-node": "^10.9.2",
|
|
55
|
-
"typescript": "5.4.5"
|
|
48
|
+
"@types/node": "^20.19.24",
|
|
49
|
+
"@types/qs": "^6.14.0",
|
|
50
|
+
"typescript": "^5.9.3",
|
|
51
|
+
"@keq-request/test": "5.0.0-alpha.7"
|
|
56
52
|
},
|
|
57
53
|
"engines": {
|
|
58
54
|
"node": ">=20.0.0"
|
|
59
55
|
},
|
|
60
56
|
"scripts": {
|
|
61
|
-
"build": "
|
|
62
|
-
"
|
|
63
|
-
"test
|
|
57
|
+
"build": "tsup",
|
|
58
|
+
"dev": "tsup --watch",
|
|
59
|
+
"test": "jest",
|
|
60
|
+
"test:update": "jest -u"
|
|
64
61
|
}
|
|
65
62
|
}
|