@mx-space/api-client 1.16.1 → 1.17.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.
- package/controllers/ai.ts +11 -1
- package/dist/adaptors/axios.global.js +1115 -236
- package/dist/adaptors/umi-request.global.js +1513 -1267
- package/dist/index.cjs +14 -7
- package/dist/index.d.cts +52 -1
- package/dist/index.d.ts +52 -1
- package/dist/index.global.js +10 -3
- package/dist/index.js +11 -4
- package/esm/packages/api-client/adaptors/axios.js +1 -1
- package/esm/packages/api-client/adaptors/ky.js +1 -1
- package/esm/packages/api-client/adaptors/umi-request.js +1 -1
- package/esm/packages/api-client/controllers/index.d.ts +1 -1
- package/esm/packages/api-client/controllers/index.js +3 -3
- package/esm/packages/api-client/controllers/recently.js +4 -4
- package/esm/packages/api-client/core/attach-request.js +1 -1
- package/esm/packages/api-client/core/client.js +11 -11
- package/esm/packages/api-client/index.js +1 -1
- package/esm/packages/api-client/models/aggregate.js +2 -2
- package/esm/packages/api-client/models/category.js +2 -2
- package/esm/packages/api-client/models/comment.js +6 -6
- package/esm/packages/api-client/models/link.js +7 -7
- package/esm/packages/api-client/models/page.js +3 -3
- package/esm/packages/api-client/models/recently.js +3 -3
- package/esm/packages/api-client/models/snippet.js +4 -4
- package/esm/packages/api-client/tsup.config.js +2 -2
- package/esm/packages/api-client/utils/camelcase-keys.js +1 -1
- package/esm/packages/api-client/vitest.config.js +1 -1
- package/index.ts +0 -1
- package/mod-dts.mjs +3 -3
- package/models/aggregate.ts +0 -2
- package/models/ai.ts +9 -0
- package/models/setting.ts +5 -0
- package/package.json +23 -23
- package/readme.md +3 -3
- package/tsconfig.json +11 -11
- package/vitest.config.ts +0 -1
package/package.json
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mx-space/api-client",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"type": "module",
|
|
3
|
+
"version": "1.17.0",
|
|
5
4
|
"description": "A api client for mx-space server@next",
|
|
6
|
-
"
|
|
5
|
+
"type": "module",
|
|
7
6
|
"license": "MIT",
|
|
7
|
+
"author": "Innei",
|
|
8
8
|
"main": "dist/index.cjs",
|
|
9
9
|
"module": "dist/index.js",
|
|
10
10
|
"types": "dist/index.d.ts",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
13
|
"types": "./dist/index.d.ts",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
14
|
+
"require": "./dist/index.cjs",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
16
|
},
|
|
17
17
|
"./dist/*": {
|
|
18
|
-
"
|
|
19
|
-
"
|
|
18
|
+
"require": "./dist/*.cjs",
|
|
19
|
+
"import": "./dist/*.js"
|
|
20
20
|
},
|
|
21
21
|
"./dist/adaptors/*": {
|
|
22
|
-
"
|
|
23
|
-
"
|
|
22
|
+
"require": "./dist/adaptors/*.cjs",
|
|
23
|
+
"import": "./dist/adaptors/*.js"
|
|
24
24
|
},
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
@@ -44,19 +44,19 @@
|
|
|
44
44
|
"dev": "vitest"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@types/cors": "
|
|
48
|
-
"@types/express": "
|
|
49
|
-
"@types/lodash": "
|
|
50
|
-
"abort-controller": "
|
|
51
|
-
"axios": "
|
|
52
|
-
"camelcase-keys": "
|
|
53
|
-
"cors": "
|
|
54
|
-
"express": "
|
|
55
|
-
"form-data": "
|
|
56
|
-
"lodash": "
|
|
57
|
-
"tsup": "
|
|
58
|
-
"umi-request": "
|
|
59
|
-
"vite": "
|
|
60
|
-
"vitest": "
|
|
47
|
+
"@types/cors": "catalog:",
|
|
48
|
+
"@types/express": "catalog:",
|
|
49
|
+
"@types/lodash": "catalog:",
|
|
50
|
+
"abort-controller": "catalog:",
|
|
51
|
+
"axios": "catalog:",
|
|
52
|
+
"camelcase-keys": "catalog:",
|
|
53
|
+
"cors": "catalog:",
|
|
54
|
+
"express": "catalog:",
|
|
55
|
+
"form-data": "catalog:",
|
|
56
|
+
"lodash": "catalog:",
|
|
57
|
+
"tsup": "catalog:",
|
|
58
|
+
"umi-request": "catalog:",
|
|
59
|
+
"vite": "catalog:",
|
|
60
|
+
"vitest": "catalog:"
|
|
61
61
|
}
|
|
62
62
|
}
|
package/readme.md
CHANGED
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
```ts
|
|
23
23
|
import {
|
|
24
24
|
AggregateController,
|
|
25
|
+
allControllers, // ...
|
|
25
26
|
CategoryController,
|
|
27
|
+
createClient,
|
|
26
28
|
NoteController,
|
|
27
29
|
PostController,
|
|
28
|
-
allControllers, // ...
|
|
29
|
-
createClient,
|
|
30
30
|
} from '@mx-space/api-client'
|
|
31
31
|
import { axiosAdaptor } from '@mx-space/api-client/adaptors/axios'
|
|
32
32
|
|
|
@@ -44,7 +44,7 @@ $axios.interceptors.request.use(
|
|
|
44
44
|
(config) => {
|
|
45
45
|
const token = getToken()
|
|
46
46
|
if (token) {
|
|
47
|
-
config.headers
|
|
47
|
+
config.headers!.Authorization = `bearer ${ getToken()}`
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
return config
|
package/tsconfig.json
CHANGED
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"declaration": true,
|
|
4
|
-
"outDir": "./esm",
|
|
5
|
-
"baseUrl": ".",
|
|
6
|
-
"jsx": "react",
|
|
7
3
|
"target": "es2020",
|
|
4
|
+
"jsx": "react",
|
|
8
5
|
"lib": [
|
|
9
6
|
"ESNext",
|
|
10
7
|
"DOM",
|
|
11
8
|
"DOM.Iterable"
|
|
12
9
|
],
|
|
10
|
+
"baseUrl": ".",
|
|
13
11
|
"module": "ESNext",
|
|
14
12
|
"moduleResolution": "node",
|
|
15
|
-
"strict": true,
|
|
16
|
-
"resolveJsonModule": true,
|
|
17
|
-
"esModuleInterop": true,
|
|
18
|
-
"skipLibCheck": true,
|
|
19
|
-
"forceConsistentCasingInFileNames": true,
|
|
20
|
-
"sourceMap": true,
|
|
21
13
|
"paths": {
|
|
22
14
|
"~/*": [
|
|
23
15
|
"*"
|
|
@@ -25,7 +17,15 @@
|
|
|
25
17
|
"@core/*": [
|
|
26
18
|
"../../apps/core/src/*"
|
|
27
19
|
],
|
|
28
|
-
}
|
|
20
|
+
},
|
|
21
|
+
"resolveJsonModule": true,
|
|
22
|
+
"strict": true,
|
|
23
|
+
"declaration": true,
|
|
24
|
+
"outDir": "./esm",
|
|
25
|
+
"sourceMap": true,
|
|
26
|
+
"esModuleInterop": true,
|
|
27
|
+
"forceConsistentCasingInFileNames": true,
|
|
28
|
+
"skipLibCheck": true
|
|
29
29
|
},
|
|
30
30
|
"exclude": [
|
|
31
31
|
"esm/*",
|