chore: bump @halo-dev/api-client for attachment custom endpoint (halo-dev/console#647)

#### What type of PR is this?

/kind improvement
/milestone 2.0

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

升级 `@halo-dev/api-client` 版本以适配 Attachment 资源的自定义 Endpoint。

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. 需要 `pnpm install`。
2. 测试附件列表和上传的功能。

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

```release-note
None
```
pull/3445/head
Ryan Wang 2022-10-17 22:53:39 +08:00 committed by GitHub
parent 450de0b6cd
commit 64ad054baa
6 changed files with 21 additions and 16 deletions

View File

@ -33,7 +33,7 @@
"@formkit/inputs": "^1.0.0-beta.11", "@formkit/inputs": "^1.0.0-beta.11",
"@formkit/themes": "^1.0.0-beta.11", "@formkit/themes": "^1.0.0-beta.11",
"@formkit/vue": "^1.0.0-beta.11", "@formkit/vue": "^1.0.0-beta.11",
"@halo-dev/api-client": "^0.0.35", "@halo-dev/api-client": "^0.0.36",
"@halo-dev/components": "workspace:*", "@halo-dev/components": "workspace:*",
"@halo-dev/console-shared": "workspace:*", "@halo-dev/console-shared": "workspace:*",
"@halo-dev/richtext-editor": "^0.0.0-alpha.7", "@halo-dev/richtext-editor": "^0.0.0-alpha.7",

View File

@ -13,7 +13,7 @@ importers:
'@formkit/inputs': ^1.0.0-beta.11 '@formkit/inputs': ^1.0.0-beta.11
'@formkit/themes': ^1.0.0-beta.11 '@formkit/themes': ^1.0.0-beta.11
'@formkit/vue': ^1.0.0-beta.11 '@formkit/vue': ^1.0.0-beta.11
'@halo-dev/api-client': ^0.0.35 '@halo-dev/api-client': ^0.0.36
'@halo-dev/components': workspace:* '@halo-dev/components': workspace:*
'@halo-dev/console-shared': workspace:* '@halo-dev/console-shared': workspace:*
'@halo-dev/richtext-editor': ^0.0.0-alpha.7 '@halo-dev/richtext-editor': ^0.0.0-alpha.7
@ -100,7 +100,7 @@ importers:
'@formkit/inputs': 1.0.0-beta.11 '@formkit/inputs': 1.0.0-beta.11
'@formkit/themes': 1.0.0-beta.11_tailwindcss@3.1.8 '@formkit/themes': 1.0.0-beta.11_tailwindcss@3.1.8
'@formkit/vue': 1.0.0-beta.11_k5hp3txgeyj6le63abiyc7wx3u '@formkit/vue': 1.0.0-beta.11_k5hp3txgeyj6le63abiyc7wx3u
'@halo-dev/api-client': 0.0.35 '@halo-dev/api-client': 0.0.36
'@halo-dev/components': link:packages/components '@halo-dev/components': link:packages/components
'@halo-dev/console-shared': link:packages/shared '@halo-dev/console-shared': link:packages/shared
'@halo-dev/richtext-editor': 0.0.0-alpha.7_vue@3.2.40 '@halo-dev/richtext-editor': 0.0.0-alpha.7_vue@3.2.40
@ -1897,8 +1897,8 @@ packages:
- windicss - windicss
dev: false dev: false
/@halo-dev/api-client/0.0.35: /@halo-dev/api-client/0.0.36:
resolution: {integrity: sha512-+WBXS2/tHmeugeiDNXmBrtV9NiU22lylzwcugH/eTXGy7MnpAG4j//o2OOYyhVcp9BUBoh7MHuu0UcyLHq1bgg==} resolution: {integrity: sha512-ZwJ9GBH6WxETCE/BD4PZWv3GUbHJXO33kvyEPsS/A4Qt7kmaQJKHuzI4wVqEoxcewNjC/PdnzuTiNSuSG4FzVA==}
dev: false dev: false
/@halo-dev/richtext-editor/0.0.0-alpha.7_vue@3.2.40: /@halo-dev/richtext-editor/0.0.0-alpha.7_vue@3.2.40:

View File

@ -59,7 +59,7 @@ const onVisibleChange = (visible: boolean) => {
const uploadHandler = computed(() => { const uploadHandler = computed(() => {
return (file, config) => return (file, config) =>
apiClient.extension.storage.attachment.uploadAttachment( apiClient.attachment.uploadAttachment(
{ {
file, file,
policyName: selectedPolicy.value?.metadata.name as string, policyName: selectedPolicy.value?.metadata.name as string,

View File

@ -71,7 +71,7 @@ const selectedAttachments = ref<Set<Attachment>>(new Set<Attachment>());
const uploadHandler = computed(() => { const uploadHandler = computed(() => {
return (file, config) => return (file, config) =>
apiClient.extension.storage.attachment.uploadAttachment( apiClient.attachment.uploadAttachment(
{ {
file, file,
policyName: selectedPolicy.value, policyName: selectedPolicy.value,

View File

@ -69,15 +69,14 @@ export function useAttachmentControl(filterOptions?: {
const handleFetchAttachments = async () => { const handleFetchAttachments = async () => {
try { try {
loading.value = true; loading.value = true;
const { data } = const { data } = await apiClient.attachment.searchAttachments({
await apiClient.extension.storage.attachment.searchAttachments({ policy: policy?.value?.metadata.name,
policy: policy?.value?.metadata.name, displayName: keyword?.value,
displayName: keyword?.value, group: group?.value?.metadata.name,
group: group?.value?.metadata.name, uploadedBy: user?.value?.metadata.name,
uploadedBy: user?.value?.metadata.name, page: attachments.value.page,
page: attachments.value.page, size: attachments.value.size,
size: attachments.value.size, });
});
attachments.value = data; attachments.value = data;
} catch (e) { } catch (e) {
console.error("Failed to fetch attachments", e); console.error("Failed to fetch attachments", e);

View File

@ -8,6 +8,7 @@ import {
ApiConsoleHaloRunV1alpha1CommentApi, ApiConsoleHaloRunV1alpha1CommentApi,
ApiConsoleHaloRunV1alpha1ReplyApi, ApiConsoleHaloRunV1alpha1ReplyApi,
ApiConsoleHaloRunV1alpha1StatsApi, ApiConsoleHaloRunV1alpha1StatsApi,
ApiConsoleHaloRunV1alpha1AttachmentApi,
ContentHaloRunV1alpha1CategoryApi, ContentHaloRunV1alpha1CategoryApi,
ContentHaloRunV1alpha1CommentApi, ContentHaloRunV1alpha1CommentApi,
ContentHaloRunV1alpha1PostApi, ContentHaloRunV1alpha1PostApi,
@ -129,6 +130,11 @@ function setupApiClient(axios: AxiosInstance) {
comment: new ApiConsoleHaloRunV1alpha1CommentApi(undefined, baseURL, axios), comment: new ApiConsoleHaloRunV1alpha1CommentApi(undefined, baseURL, axios),
reply: new ApiConsoleHaloRunV1alpha1ReplyApi(undefined, baseURL, axios), reply: new ApiConsoleHaloRunV1alpha1ReplyApi(undefined, baseURL, axios),
stats: new ApiConsoleHaloRunV1alpha1StatsApi(undefined, baseURL, axios), stats: new ApiConsoleHaloRunV1alpha1StatsApi(undefined, baseURL, axios),
attachment: new ApiConsoleHaloRunV1alpha1AttachmentApi(
undefined,
baseURL,
axios
),
}; };
} }