refactor: rename api group for custom api (#613)

#### What type of PR is this?

/kind improvement
/milestone 2.0

#### What this PR does / why we need it:

适配 https://github.com/halo-dev/halo/pull/2419

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2418

#### Screenshots:

#### Special notes for your reviewer:

具体变更请查阅:https://github.com/halo-dev/halo/pull/2419

#### Does this PR introduce a user-facing change?

```release-note
None
```
pull/614/head
Ryan Wang 2022-09-20 10:44:08 +08:00 committed by GitHub
parent 1f5c67a629
commit a96894aa70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 26 deletions

View File

@ -34,7 +34,7 @@
"@formkit/themes": "1.0.0-beta.10",
"@formkit/vue": "1.0.0-beta.10",
"@halo-dev/admin-shared": "workspace:*",
"@halo-dev/api-client": "^0.0.22",
"@halo-dev/api-client": "^0.0.23",
"@halo-dev/components": "workspace:*",
"@halo-dev/richtext-editor": "^0.0.0-alpha.7",
"@tiptap/extension-character-count": "2.0.0-beta.31",

View File

@ -1,11 +1,12 @@
import {
ApiHaloRunV1alpha1ContentApi,
ApiHaloRunV1alpha1PluginApi,
ApiHaloRunV1alpha1PostApi,
ApiHaloRunV1alpha1SinglePageApi,
ApiHaloRunV1alpha1ThemeApi,
ApiHaloRunV1alpha1UserApi,
ApiHaloRunV1alpha1ReplyApi,
ApiConsoleHaloRunV1alpha1ContentApi,
ApiConsoleHaloRunV1alpha1PluginApi,
ApiConsoleHaloRunV1alpha1PostApi,
ApiConsoleHaloRunV1alpha1SinglePageApi,
ApiConsoleHaloRunV1alpha1ThemeApi,
ApiConsoleHaloRunV1alpha1UserApi,
ApiConsoleHaloRunV1alpha1CommentApi,
ApiConsoleHaloRunV1alpha1ReplyApi,
ContentHaloRunV1alpha1CategoryApi,
ContentHaloRunV1alpha1CommentApi,
ContentHaloRunV1alpha1PostApi,
@ -28,7 +29,6 @@ import {
V1alpha1RoleBindingApi,
V1alpha1SettingApi,
V1alpha1UserApi,
ApiHaloRunV1alpha1CommentApi,
} from "@halo-dev/api-client";
import type { AxiosInstance } from "axios";
import axios from "axios";
@ -108,14 +108,18 @@ function setupApiClient(axios: AxiosInstance) {
},
},
// custom endpoints
user: new ApiHaloRunV1alpha1UserApi(undefined, apiUrl, axios),
plugin: new ApiHaloRunV1alpha1PluginApi(undefined, apiUrl, axios),
theme: new ApiHaloRunV1alpha1ThemeApi(undefined, apiUrl, axios),
post: new ApiHaloRunV1alpha1PostApi(undefined, apiUrl, axios),
singlePage: new ApiHaloRunV1alpha1SinglePageApi(undefined, apiUrl, axios),
content: new ApiHaloRunV1alpha1ContentApi(undefined, apiUrl, axios),
comment: new ApiHaloRunV1alpha1CommentApi(undefined, apiUrl, axios),
reply: new ApiHaloRunV1alpha1ReplyApi(undefined, apiUrl, axios),
user: new ApiConsoleHaloRunV1alpha1UserApi(undefined, apiUrl, axios),
plugin: new ApiConsoleHaloRunV1alpha1PluginApi(undefined, apiUrl, axios),
theme: new ApiConsoleHaloRunV1alpha1ThemeApi(undefined, apiUrl, axios),
post: new ApiConsoleHaloRunV1alpha1PostApi(undefined, apiUrl, axios),
singlePage: new ApiConsoleHaloRunV1alpha1SinglePageApi(
undefined,
apiUrl,
axios
),
content: new ApiConsoleHaloRunV1alpha1ContentApi(undefined, apiUrl, axios),
comment: new ApiConsoleHaloRunV1alpha1CommentApi(undefined, apiUrl, axios),
reply: new ApiConsoleHaloRunV1alpha1ReplyApi(undefined, apiUrl, axios),
};
}

View File

@ -14,7 +14,7 @@ importers:
'@formkit/themes': 1.0.0-beta.10
'@formkit/vue': 1.0.0-beta.10
'@halo-dev/admin-shared': workspace:*
'@halo-dev/api-client': ^0.0.22
'@halo-dev/api-client': ^0.0.23
'@halo-dev/components': workspace:*
'@halo-dev/richtext-editor': ^0.0.0-alpha.7
'@iconify-json/mdi': ^1.1.33
@ -96,7 +96,7 @@ importers:
'@formkit/themes': 1.0.0-beta.10_tailwindcss@3.1.8
'@formkit/vue': 1.0.0-beta.10_jhzixbi2r7n2xnmwczrcaimaey
'@halo-dev/admin-shared': link:packages/shared
'@halo-dev/api-client': 0.0.22
'@halo-dev/api-client': 0.0.23
'@halo-dev/components': link:packages/components
'@halo-dev/richtext-editor': 0.0.0-alpha.7_vue@3.2.39
'@tiptap/extension-character-count': 2.0.0-beta.31
@ -1886,8 +1886,8 @@ packages:
- windicss
dev: false
/@halo-dev/api-client/0.0.22:
resolution: {integrity: sha512-0RBc2N+oqPIy+fE6otp8cjeWTvBgjH986lzhz2T8Gr6Byzp0cHzj3Y3+aT6t39Wg4Ux+wPRSV+Fh0x8VA8Jz5A==}
/@halo-dev/api-client/0.0.23:
resolution: {integrity: sha512-YI+uGnHvGgKvt6HRtwf/AI73gQCDT1/vS4c3vsaTzDm9h66joL4ST0t1xSLuc1IXVmtf9ktggInqEktUgVko0Q==}
dev: false
/@halo-dev/richtext-editor/0.0.0-alpha.7_vue@3.2.39:
@ -3729,7 +3729,7 @@ packages:
/axios/0.21.4_debug@4.3.2:
resolution: {integrity: sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==}
dependencies:
follow-redirects: 1.14.9
follow-redirects: 1.14.9_debug@4.3.2
transitivePeerDependencies:
- debug
dev: true
@ -3737,7 +3737,7 @@ packages:
/axios/0.27.2:
resolution: {integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==}
dependencies:
follow-redirects: 1.14.9
follow-redirects: 1.14.9_debug@4.3.2
form-data: 4.0.0
transitivePeerDependencies:
- debug
@ -4432,7 +4432,6 @@ packages:
optional: true
dependencies:
ms: 2.1.2
dev: true
/debug/4.3.4:
resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
@ -5390,7 +5389,7 @@ packages:
vue-resize: 2.0.0-alpha.1_vue@3.2.39
dev: false
/follow-redirects/1.14.9:
/follow-redirects/1.14.9_debug@4.3.2:
resolution: {integrity: sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==}
engines: {node: '>=4.0'}
peerDependencies:
@ -5398,6 +5397,8 @@ packages:
peerDependenciesMeta:
debug:
optional: true
dependencies:
debug: 4.3.2
/foreground-child/2.0.0:
resolution: {integrity: sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==}
@ -6756,7 +6757,6 @@ packages:
/ms/2.1.2:
resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
dev: true
/ms/2.1.3:
resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}