diff --git a/ui/console-src/modules/contents/pages/SinglePageEditor.vue b/ui/console-src/modules/contents/pages/SinglePageEditor.vue index 667e293bcf..e60911b78a 100644 --- a/ui/console-src/modules/contents/pages/SinglePageEditor.vue +++ b/ui/console-src/modules/contents/pages/SinglePageEditor.vue @@ -2,6 +2,7 @@ import { Dialog, IconEye, + IconHistoryLine, IconPages, IconSave, IconSendPlaneFill, @@ -452,6 +453,22 @@ async function handleUploadImage(file: File, options?: AxiosRequestConfig) { :allow-forced-select="!isUpdateMode" @select="handleChangeEditorProvider" /> + + + {{ $t("core.page_editor.actions.snapshots") }} + +import { + IconHistoryLine, + VButton, + VCard, + VLoading, + VPageHeader, +} from "@halo-dev/components"; +import { useQuery } from "@tanstack/vue-query"; +import { useRoute } from "vue-router"; +import { apiClient } from "@/utils/api-client"; +import { computed, watch } from "vue"; +import { OverlayScrollbarsComponent } from "overlayscrollbars-vue"; +import { useRouteQuery } from "@vueuse/router"; +import SnapshotContent from "./components/SnapshotContent.vue"; +import SnapshotListItem from "./components/SnapshotListItem.vue"; + +const route = useRoute(); + +const singlePageName = computed(() => route.query.name as string); + +const { data: singlePage } = useQuery({ + queryKey: ["singlePage-by-name", singlePageName], + queryFn: async () => { + const { data } = + await apiClient.extension.singlePage.getcontentHaloRunV1alpha1SinglePage({ + name: singlePageName.value, + }); + return data; + }, + enabled: computed(() => !!singlePageName.value), +}); + +const { data: snapshots, isLoading } = useQuery({ + queryKey: ["singlePage-snapshots-by-singlePage-name", singlePageName], + queryFn: async () => { + const { data } = await apiClient.singlePage.listSinglePageSnapshots({ + name: singlePageName.value, + }); + return data; + }, + refetchInterval(data) { + const hasDeletingData = data?.some( + (item) => !!item.metadata.deletionTimestamp + ); + return hasDeletingData ? 1000 : false; + }, + enabled: computed(() => !!singlePageName.value), +}); + +const selectedSnapshotName = useRouteQuery("snapshot-name"); + +watch( + () => snapshots.value, + (value) => { + if (value && !selectedSnapshotName.value) { + selectedSnapshotName.value = value[0].metadata.name; + } + + // Reset selectedSnapshotName if the selected snapshot is deleted + if ( + !value?.some( + (snapshot) => snapshot.metadata.name === selectedSnapshotName.value + ) + ) { + selectedSnapshotName.value = value?.[0].metadata.name; + } + }, + { + immediate: true, + } +); + + + diff --git a/ui/console-src/modules/contents/pages/components/SinglePageSettingModal.vue b/ui/console-src/modules/contents/pages/components/SinglePageSettingModal.vue index ff31097671..6eddc706ce 100644 --- a/ui/console-src/modules/contents/pages/components/SinglePageSettingModal.vue +++ b/ui/console-src/modules/contents/pages/components/SinglePageSettingModal.vue @@ -117,7 +117,7 @@ const handlePublishClick = () => { }; // Fix me: -// Force update post settings, +// Force update singlePage settings, // because currently there may be errors caused by changes in version due to asynchronous processing. const { mutateAsync: singlePageUpdateMutate } = usePageUpdateMutate(); diff --git a/ui/console-src/modules/contents/pages/components/SnapshotContent.vue b/ui/console-src/modules/contents/pages/components/SnapshotContent.vue new file mode 100644 index 0000000000..cae47283fd --- /dev/null +++ b/ui/console-src/modules/contents/pages/components/SnapshotContent.vue @@ -0,0 +1,113 @@ + + + + diff --git a/ui/console-src/modules/contents/pages/components/SnapshotListItem.vue b/ui/console-src/modules/contents/pages/components/SnapshotListItem.vue new file mode 100644 index 0000000000..d4ad9446bc --- /dev/null +++ b/ui/console-src/modules/contents/pages/components/SnapshotListItem.vue @@ -0,0 +1,137 @@ + + diff --git a/ui/console-src/modules/contents/pages/composables/use-page-update-mutate.ts b/ui/console-src/modules/contents/pages/composables/use-page-update-mutate.ts index 7aec27e3cb..92edb5b231 100644 --- a/ui/console-src/modules/contents/pages/composables/use-page-update-mutate.ts +++ b/ui/console-src/modules/contents/pages/composables/use-page-update-mutate.ts @@ -35,7 +35,7 @@ export function usePageUpdateMutate() { }, retry: 3, onError: (error) => { - console.error("Failed to update post", error); + console.error("Failed to update singlePage", error); Toast.error(t("core.common.toast.server_internal_error")); }, }); diff --git a/ui/console-src/modules/contents/pages/module.ts b/ui/console-src/modules/contents/pages/module.ts index df2e4bc690..0638087a8f 100644 --- a/ui/console-src/modules/contents/pages/module.ts +++ b/ui/console-src/modules/contents/pages/module.ts @@ -6,6 +6,7 @@ import SinglePageEditor from "./SinglePageEditor.vue"; import SinglePageStatsWidget from "./widgets/SinglePageStatsWidget.vue"; import { IconPages } from "@halo-dev/components"; import { markRaw } from "vue"; +import SinglePageSnapshots from "./SinglePageSnapshots.vue"; export default definePlugin({ components: { @@ -54,6 +55,17 @@ export default definePlugin({ permissions: ["system:singlepages:manage"], }, }, + { + path: "snapshots", + name: "SinglePageSnapshots", + component: SinglePageSnapshots, + meta: { + title: "core.page_snapshots.title", + searchable: false, + hideFooter: true, + permissions: ["system:singlepages:manage"], + }, + }, ], }, ], diff --git a/ui/console-src/modules/contents/posts/PostEditor.vue b/ui/console-src/modules/contents/posts/PostEditor.vue index 994447de76..669e273107 100644 --- a/ui/console-src/modules/contents/posts/PostEditor.vue +++ b/ui/console-src/modules/contents/posts/PostEditor.vue @@ -3,6 +3,7 @@ import { Dialog, IconBookRead, IconEye, + IconHistoryLine, IconSave, IconSendPlaneFill, IconSettings, @@ -480,6 +481,19 @@ async function handleUploadImage(file: File, options?: AxiosRequestConfig) { :allow-forced-select="!isUpdateMode" @select="handleChangeEditorProvider" /> + + + {{ $t("core.post_editor.actions.snapshots") }} + +import { + IconHistoryLine, + VButton, + VCard, + VLoading, + VPageHeader, +} from "@halo-dev/components"; +import { useQuery } from "@tanstack/vue-query"; +import { useRoute } from "vue-router"; +import { apiClient } from "@/utils/api-client"; +import { computed, watch } from "vue"; +import { OverlayScrollbarsComponent } from "overlayscrollbars-vue"; +import { useRouteQuery } from "@vueuse/router"; +import SnapshotContent from "@console/modules/contents/posts/components/SnapshotContent.vue"; +import SnapshotListItem from "@console/modules/contents/posts/components/SnapshotListItem.vue"; + +const route = useRoute(); + +const postName = computed(() => route.query.name as string); + +const { data: post } = useQuery({ + queryKey: ["post-by-name", postName], + queryFn: async () => { + const { data } = + await apiClient.extension.post.getcontentHaloRunV1alpha1Post({ + name: postName.value, + }); + return data; + }, + enabled: computed(() => !!postName.value), +}); + +const { data: snapshots, isLoading } = useQuery({ + queryKey: ["post-snapshots-by-post-name", postName], + queryFn: async () => { + const { data } = await apiClient.post.listPostSnapshots({ + name: postName.value, + }); + return data; + }, + refetchInterval(data) { + const hasDeletingData = data?.some( + (item) => !!item.metadata.deletionTimestamp + ); + return hasDeletingData ? 1000 : false; + }, + enabled: computed(() => !!postName.value), +}); + +const selectedSnapshotName = useRouteQuery("snapshot-name"); + +watch( + () => snapshots.value, + (value) => { + if (value && !selectedSnapshotName.value) { + selectedSnapshotName.value = value[0].metadata.name; + } + + // Reset selectedSnapshotName if the selected snapshot is deleted + if ( + !value?.some( + (snapshot) => snapshot.metadata.name === selectedSnapshotName.value + ) + ) { + selectedSnapshotName.value = value?.[0].metadata.name; + } + }, + { + immediate: true, + } +); + + + diff --git a/ui/console-src/modules/contents/posts/components/SnapshotContent.vue b/ui/console-src/modules/contents/posts/components/SnapshotContent.vue new file mode 100644 index 0000000000..3c78c96e1d --- /dev/null +++ b/ui/console-src/modules/contents/posts/components/SnapshotContent.vue @@ -0,0 +1,113 @@ + + + + diff --git a/ui/console-src/modules/contents/posts/components/SnapshotListItem.vue b/ui/console-src/modules/contents/posts/components/SnapshotListItem.vue new file mode 100644 index 0000000000..4790d26465 --- /dev/null +++ b/ui/console-src/modules/contents/posts/components/SnapshotListItem.vue @@ -0,0 +1,135 @@ + + diff --git a/ui/console-src/modules/contents/posts/module.ts b/ui/console-src/modules/contents/posts/module.ts index c199669497..2b8dd997f0 100644 --- a/ui/console-src/modules/contents/posts/module.ts +++ b/ui/console-src/modules/contents/posts/module.ts @@ -10,6 +10,7 @@ import TagList from "./tags/TagList.vue"; import PostStatsWidget from "./widgets/PostStatsWidget.vue"; import RecentPublishedWidget from "./widgets/RecentPublishedWidget.vue"; import { markRaw } from "vue"; +import PostSnapshots from "./PostSnapshots.vue"; export default definePlugin({ components: { @@ -60,6 +61,17 @@ export default definePlugin({ permissions: ["system:posts:manage"], }, }, + { + path: "snapshots", + name: "PostSnapshots", + component: PostSnapshots, + meta: { + title: "core.post_snapshots.title", + searchable: false, + hideFooter: true, + permissions: ["system:posts:manage"], + }, + }, { path: "categories", component: BlankLayout, diff --git a/ui/packages/api-client/src/.openapi-generator/FILES b/ui/packages/api-client/src/.openapi-generator/FILES index 1219e3ee4b..75f44ff38a 100644 --- a/ui/packages/api-client/src/.openapi-generator/FILES +++ b/ui/packages/api-client/src/.openapi-generator/FILES @@ -120,6 +120,7 @@ models/condition.ts models/config-map-list.ts models/config-map-ref.ts models/config-map.ts +models/content-update-param.ts models/content-vo.ts models/content-wrapper.ts models/content.ts @@ -168,6 +169,8 @@ models/listed-single-page-list.ts models/listed-single-page-vo-list.ts models/listed-single-page-vo.ts models/listed-single-page.ts +models/listed-snapshot-dto.ts +models/listed-snapshot-spec.ts models/listed-user.ts models/login-history.ts models/mark-specified-request.ts @@ -240,6 +243,7 @@ models/register-verify-email-request.ts models/reply-list.ts models/reply-request.ts models/reply-spec.ts +models/reply-status.ts models/reply-vo-list.ts models/reply-vo.ts models/reply.ts @@ -247,6 +251,8 @@ models/reset-password-request.ts models/reverse-proxy-list.ts models/reverse-proxy-rule.ts models/reverse-proxy.ts +models/revert-snapshot-for-post-param.ts +models/revert-snapshot-for-single-param.ts models/role-binding-list.ts models/role-binding.ts models/role-list.ts diff --git a/ui/packages/api-client/src/api/api-console-halo-run-v1alpha1-post-api.ts b/ui/packages/api-client/src/api/api-console-halo-run-v1alpha1-post-api.ts index b3572eecaf..c5e00c97f9 100644 --- a/ui/packages/api-client/src/api/api-console-halo-run-v1alpha1-post-api.ts +++ b/ui/packages/api-client/src/api/api-console-halo-run-v1alpha1-post-api.ts @@ -28,15 +28,67 @@ import { ContentWrapper } from '../models'; // @ts-ignore import { ListedPostList } from '../models'; // @ts-ignore +import { ListedSnapshotDto } from '../models'; +// @ts-ignore import { Post } from '../models'; // @ts-ignore import { PostRequest } from '../models'; +// @ts-ignore +import { RevertSnapshotForPostParam } from '../models'; /** * ApiConsoleHaloRunV1alpha1PostApi - axios parameter creator * @export */ export const ApiConsoleHaloRunV1alpha1PostApiAxiosParamCreator = function (configuration?: Configuration) { return { + /** + * Delete a content for post. + * @param {string} name + * @param {string} snapshotName + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePostContent: async (name: string, snapshotName: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('deletePostContent', 'name', name) + // verify required parameter 'snapshotName' is not null or undefined + assertParamExists('deletePostContent', 'snapshotName', snapshotName) + const localVarPath = `/apis/api.console.halo.run/v1alpha1/posts/{name}/content` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + if (snapshotName !== undefined) { + localVarQueryParameter['snapshotName'] = snapshotName; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * Draft a post. * @param {PostRequest} postRequest @@ -80,6 +132,54 @@ export const ApiConsoleHaloRunV1alpha1PostApiAxiosParamCreator = function (confi options: localVarRequestOptions, }; }, + /** + * Fetch content of post. + * @param {string} name + * @param {string} snapshotName + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + fetchPostContent: async (name: string, snapshotName: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('fetchPostContent', 'name', name) + // verify required parameter 'snapshotName' is not null or undefined + assertParamExists('fetchPostContent', 'snapshotName', snapshotName) + const localVarPath = `/apis/api.console.halo.run/v1alpha1/posts/{name}/content` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + if (snapshotName !== undefined) { + localVarQueryParameter['snapshotName'] = snapshotName; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * Fetch head content of post. * @param {string} name @@ -153,6 +253,47 @@ export const ApiConsoleHaloRunV1alpha1PostApiAxiosParamCreator = function (confi + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * List all snapshots for post content. + * @param {string} name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPostSnapshots: async (name: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('listPostSnapshots', 'name', name) + const localVarPath = `/apis/api.console.halo.run/v1alpha1/posts/{name}/snapshot` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -321,6 +462,53 @@ export const ApiConsoleHaloRunV1alpha1PostApiAxiosParamCreator = function (confi options: localVarRequestOptions, }; }, + /** + * Revert to specified snapshot for post content. + * @param {string} name + * @param {RevertSnapshotForPostParam} revertSnapshotForPostParam + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + revertToSpecifiedSnapshotForPost: async (name: string, revertSnapshotForPostParam: RevertSnapshotForPostParam, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('revertToSpecifiedSnapshotForPost', 'name', name) + // verify required parameter 'revertSnapshotForPostParam' is not null or undefined + assertParamExists('revertToSpecifiedSnapshotForPost', 'revertSnapshotForPostParam', revertSnapshotForPostParam) + const localVarPath = `/apis/api.console.halo.run/v1alpha1/posts/{name}/revert-content` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(revertSnapshotForPostParam, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * Publish a post. * @param {string} name @@ -466,6 +654,19 @@ export const ApiConsoleHaloRunV1alpha1PostApiAxiosParamCreator = function (confi export const ApiConsoleHaloRunV1alpha1PostApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = ApiConsoleHaloRunV1alpha1PostApiAxiosParamCreator(configuration) return { + /** + * Delete a content for post. + * @param {string} name + * @param {string} snapshotName + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deletePostContent(name: string, snapshotName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePostContent(name, snapshotName, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ApiConsoleHaloRunV1alpha1PostApi.deletePostContent']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, /** * Draft a post. * @param {PostRequest} postRequest @@ -478,6 +679,19 @@ export const ApiConsoleHaloRunV1alpha1PostApiFp = function(configuration?: Confi const localVarOperationServerBasePath = operationServerMap['ApiConsoleHaloRunV1alpha1PostApi.draftPost']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, + /** + * Fetch content of post. + * @param {string} name + * @param {string} snapshotName + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async fetchPostContent(name: string, snapshotName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchPostContent(name, snapshotName, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ApiConsoleHaloRunV1alpha1PostApi.fetchPostContent']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, /** * Fetch head content of post. * @param {string} name @@ -502,6 +716,18 @@ export const ApiConsoleHaloRunV1alpha1PostApiFp = function(configuration?: Confi const localVarOperationServerBasePath = operationServerMap['ApiConsoleHaloRunV1alpha1PostApi.fetchPostReleaseContent']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, + /** + * List all snapshots for post content. + * @param {string} name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listPostSnapshots(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listPostSnapshots(name, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ApiConsoleHaloRunV1alpha1PostApi.listPostSnapshots']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, /** * List posts. * @param {number} [page] Page number. Default is 0. @@ -545,6 +771,19 @@ export const ApiConsoleHaloRunV1alpha1PostApiFp = function(configuration?: Confi const localVarOperationServerBasePath = operationServerMap['ApiConsoleHaloRunV1alpha1PostApi.recyclePost']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, + /** + * Revert to specified snapshot for post content. + * @param {string} name + * @param {RevertSnapshotForPostParam} revertSnapshotForPostParam + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async revertToSpecifiedSnapshotForPost(name: string, revertSnapshotForPostParam: RevertSnapshotForPostParam, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.revertToSpecifiedSnapshotForPost(name, revertSnapshotForPostParam, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ApiConsoleHaloRunV1alpha1PostApi.revertToSpecifiedSnapshotForPost']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, /** * Publish a post. * @param {string} name @@ -593,6 +832,15 @@ export const ApiConsoleHaloRunV1alpha1PostApiFp = function(configuration?: Confi export const ApiConsoleHaloRunV1alpha1PostApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = ApiConsoleHaloRunV1alpha1PostApiFp(configuration) return { + /** + * Delete a content for post. + * @param {ApiConsoleHaloRunV1alpha1PostApiDeletePostContentRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePostContent(requestParameters: ApiConsoleHaloRunV1alpha1PostApiDeletePostContentRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deletePostContent(requestParameters.name, requestParameters.snapshotName, options).then((request) => request(axios, basePath)); + }, /** * Draft a post. * @param {ApiConsoleHaloRunV1alpha1PostApiDraftPostRequest} requestParameters Request parameters. @@ -602,6 +850,15 @@ export const ApiConsoleHaloRunV1alpha1PostApiFactory = function (configuration?: draftPost(requestParameters: ApiConsoleHaloRunV1alpha1PostApiDraftPostRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.draftPost(requestParameters.postRequest, options).then((request) => request(axios, basePath)); }, + /** + * Fetch content of post. + * @param {ApiConsoleHaloRunV1alpha1PostApiFetchPostContentRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + fetchPostContent(requestParameters: ApiConsoleHaloRunV1alpha1PostApiFetchPostContentRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchPostContent(requestParameters.name, requestParameters.snapshotName, options).then((request) => request(axios, basePath)); + }, /** * Fetch head content of post. * @param {ApiConsoleHaloRunV1alpha1PostApiFetchPostHeadContentRequest} requestParameters Request parameters. @@ -620,6 +877,15 @@ export const ApiConsoleHaloRunV1alpha1PostApiFactory = function (configuration?: fetchPostReleaseContent(requestParameters: ApiConsoleHaloRunV1alpha1PostApiFetchPostReleaseContentRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.fetchPostReleaseContent(requestParameters.name, options).then((request) => request(axios, basePath)); }, + /** + * List all snapshots for post content. + * @param {ApiConsoleHaloRunV1alpha1PostApiListPostSnapshotsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPostSnapshots(requestParameters: ApiConsoleHaloRunV1alpha1PostApiListPostSnapshotsRequest, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listPostSnapshots(requestParameters.name, options).then((request) => request(axios, basePath)); + }, /** * List posts. * @param {ApiConsoleHaloRunV1alpha1PostApiListPostsRequest} requestParameters Request parameters. @@ -647,6 +913,15 @@ export const ApiConsoleHaloRunV1alpha1PostApiFactory = function (configuration?: recyclePost(requestParameters: ApiConsoleHaloRunV1alpha1PostApiRecyclePostRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.recyclePost(requestParameters.name, options).then((request) => request(axios, basePath)); }, + /** + * Revert to specified snapshot for post content. + * @param {ApiConsoleHaloRunV1alpha1PostApiRevertToSpecifiedSnapshotForPostRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + revertToSpecifiedSnapshotForPost(requestParameters: ApiConsoleHaloRunV1alpha1PostApiRevertToSpecifiedSnapshotForPostRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.revertToSpecifiedSnapshotForPost(requestParameters.name, requestParameters.revertSnapshotForPostParam, options).then((request) => request(axios, basePath)); + }, /** * Publish a post. * @param {ApiConsoleHaloRunV1alpha1PostApiUnpublishPostRequest} requestParameters Request parameters. @@ -677,6 +952,27 @@ export const ApiConsoleHaloRunV1alpha1PostApiFactory = function (configuration?: }; }; +/** + * Request parameters for deletePostContent operation in ApiConsoleHaloRunV1alpha1PostApi. + * @export + * @interface ApiConsoleHaloRunV1alpha1PostApiDeletePostContentRequest + */ +export interface ApiConsoleHaloRunV1alpha1PostApiDeletePostContentRequest { + /** + * + * @type {string} + * @memberof ApiConsoleHaloRunV1alpha1PostApiDeletePostContent + */ + readonly name: string + + /** + * + * @type {string} + * @memberof ApiConsoleHaloRunV1alpha1PostApiDeletePostContent + */ + readonly snapshotName: string +} + /** * Request parameters for draftPost operation in ApiConsoleHaloRunV1alpha1PostApi. * @export @@ -691,6 +987,27 @@ export interface ApiConsoleHaloRunV1alpha1PostApiDraftPostRequest { readonly postRequest: PostRequest } +/** + * Request parameters for fetchPostContent operation in ApiConsoleHaloRunV1alpha1PostApi. + * @export + * @interface ApiConsoleHaloRunV1alpha1PostApiFetchPostContentRequest + */ +export interface ApiConsoleHaloRunV1alpha1PostApiFetchPostContentRequest { + /** + * + * @type {string} + * @memberof ApiConsoleHaloRunV1alpha1PostApiFetchPostContent + */ + readonly name: string + + /** + * + * @type {string} + * @memberof ApiConsoleHaloRunV1alpha1PostApiFetchPostContent + */ + readonly snapshotName: string +} + /** * Request parameters for fetchPostHeadContent operation in ApiConsoleHaloRunV1alpha1PostApi. * @export @@ -719,6 +1036,20 @@ export interface ApiConsoleHaloRunV1alpha1PostApiFetchPostReleaseContentRequest readonly name: string } +/** + * Request parameters for listPostSnapshots operation in ApiConsoleHaloRunV1alpha1PostApi. + * @export + * @interface ApiConsoleHaloRunV1alpha1PostApiListPostSnapshotsRequest + */ +export interface ApiConsoleHaloRunV1alpha1PostApiListPostSnapshotsRequest { + /** + * + * @type {string} + * @memberof ApiConsoleHaloRunV1alpha1PostApiListPostSnapshots + */ + readonly name: string +} + /** * Request parameters for listPosts operation in ApiConsoleHaloRunV1alpha1PostApi. * @export @@ -810,6 +1141,27 @@ export interface ApiConsoleHaloRunV1alpha1PostApiRecyclePostRequest { readonly name: string } +/** + * Request parameters for revertToSpecifiedSnapshotForPost operation in ApiConsoleHaloRunV1alpha1PostApi. + * @export + * @interface ApiConsoleHaloRunV1alpha1PostApiRevertToSpecifiedSnapshotForPostRequest + */ +export interface ApiConsoleHaloRunV1alpha1PostApiRevertToSpecifiedSnapshotForPostRequest { + /** + * + * @type {string} + * @memberof ApiConsoleHaloRunV1alpha1PostApiRevertToSpecifiedSnapshotForPost + */ + readonly name: string + + /** + * + * @type {RevertSnapshotForPostParam} + * @memberof ApiConsoleHaloRunV1alpha1PostApiRevertToSpecifiedSnapshotForPost + */ + readonly revertSnapshotForPostParam: RevertSnapshotForPostParam +} + /** * Request parameters for unpublishPost operation in ApiConsoleHaloRunV1alpha1PostApi. * @export @@ -873,6 +1225,17 @@ export interface ApiConsoleHaloRunV1alpha1PostApiUpdatePostContentRequest { * @extends {BaseAPI} */ export class ApiConsoleHaloRunV1alpha1PostApi extends BaseAPI { + /** + * Delete a content for post. + * @param {ApiConsoleHaloRunV1alpha1PostApiDeletePostContentRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiConsoleHaloRunV1alpha1PostApi + */ + public deletePostContent(requestParameters: ApiConsoleHaloRunV1alpha1PostApiDeletePostContentRequest, options?: RawAxiosRequestConfig) { + return ApiConsoleHaloRunV1alpha1PostApiFp(this.configuration).deletePostContent(requestParameters.name, requestParameters.snapshotName, options).then((request) => request(this.axios, this.basePath)); + } + /** * Draft a post. * @param {ApiConsoleHaloRunV1alpha1PostApiDraftPostRequest} requestParameters Request parameters. @@ -884,6 +1247,17 @@ export class ApiConsoleHaloRunV1alpha1PostApi extends BaseAPI { return ApiConsoleHaloRunV1alpha1PostApiFp(this.configuration).draftPost(requestParameters.postRequest, options).then((request) => request(this.axios, this.basePath)); } + /** + * Fetch content of post. + * @param {ApiConsoleHaloRunV1alpha1PostApiFetchPostContentRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiConsoleHaloRunV1alpha1PostApi + */ + public fetchPostContent(requestParameters: ApiConsoleHaloRunV1alpha1PostApiFetchPostContentRequest, options?: RawAxiosRequestConfig) { + return ApiConsoleHaloRunV1alpha1PostApiFp(this.configuration).fetchPostContent(requestParameters.name, requestParameters.snapshotName, options).then((request) => request(this.axios, this.basePath)); + } + /** * Fetch head content of post. * @param {ApiConsoleHaloRunV1alpha1PostApiFetchPostHeadContentRequest} requestParameters Request parameters. @@ -906,6 +1280,17 @@ export class ApiConsoleHaloRunV1alpha1PostApi extends BaseAPI { return ApiConsoleHaloRunV1alpha1PostApiFp(this.configuration).fetchPostReleaseContent(requestParameters.name, options).then((request) => request(this.axios, this.basePath)); } + /** + * List all snapshots for post content. + * @param {ApiConsoleHaloRunV1alpha1PostApiListPostSnapshotsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiConsoleHaloRunV1alpha1PostApi + */ + public listPostSnapshots(requestParameters: ApiConsoleHaloRunV1alpha1PostApiListPostSnapshotsRequest, options?: RawAxiosRequestConfig) { + return ApiConsoleHaloRunV1alpha1PostApiFp(this.configuration).listPostSnapshots(requestParameters.name, options).then((request) => request(this.axios, this.basePath)); + } + /** * List posts. * @param {ApiConsoleHaloRunV1alpha1PostApiListPostsRequest} requestParameters Request parameters. @@ -939,6 +1324,17 @@ export class ApiConsoleHaloRunV1alpha1PostApi extends BaseAPI { return ApiConsoleHaloRunV1alpha1PostApiFp(this.configuration).recyclePost(requestParameters.name, options).then((request) => request(this.axios, this.basePath)); } + /** + * Revert to specified snapshot for post content. + * @param {ApiConsoleHaloRunV1alpha1PostApiRevertToSpecifiedSnapshotForPostRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiConsoleHaloRunV1alpha1PostApi + */ + public revertToSpecifiedSnapshotForPost(requestParameters: ApiConsoleHaloRunV1alpha1PostApiRevertToSpecifiedSnapshotForPostRequest, options?: RawAxiosRequestConfig) { + return ApiConsoleHaloRunV1alpha1PostApiFp(this.configuration).revertToSpecifiedSnapshotForPost(requestParameters.name, requestParameters.revertSnapshotForPostParam, options).then((request) => request(this.axios, this.basePath)); + } + /** * Publish a post. * @param {ApiConsoleHaloRunV1alpha1PostApiUnpublishPostRequest} requestParameters Request parameters. diff --git a/ui/packages/api-client/src/api/api-console-halo-run-v1alpha1-single-page-api.ts b/ui/packages/api-client/src/api/api-console-halo-run-v1alpha1-single-page-api.ts index 9c52f01e3a..bc0b5c6fc1 100644 --- a/ui/packages/api-client/src/api/api-console-halo-run-v1alpha1-single-page-api.ts +++ b/ui/packages/api-client/src/api/api-console-halo-run-v1alpha1-single-page-api.ts @@ -28,8 +28,12 @@ import { ContentWrapper } from '../models'; // @ts-ignore import { ListedSinglePageList } from '../models'; // @ts-ignore +import { ListedSnapshotDto } from '../models'; +// @ts-ignore import { Post } from '../models'; // @ts-ignore +import { RevertSnapshotForSingleParam } from '../models'; +// @ts-ignore import { SinglePage } from '../models'; // @ts-ignore import { SinglePageRequest } from '../models'; @@ -39,6 +43,54 @@ import { SinglePageRequest } from '../models'; */ export const ApiConsoleHaloRunV1alpha1SinglePageApiAxiosParamCreator = function (configuration?: Configuration) { return { + /** + * Delete a content for post. + * @param {string} name + * @param {string} snapshotName + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteSinglePageContent: async (name: string, snapshotName: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('deleteSinglePageContent', 'name', name) + // verify required parameter 'snapshotName' is not null or undefined + assertParamExists('deleteSinglePageContent', 'snapshotName', snapshotName) + const localVarPath = `/apis/api.console.halo.run/v1alpha1/singlepages/{name}/content` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + if (snapshotName !== undefined) { + localVarQueryParameter['snapshotName'] = snapshotName; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * Draft a single page. * @param {SinglePageRequest} singlePageRequest @@ -82,6 +134,54 @@ export const ApiConsoleHaloRunV1alpha1SinglePageApiAxiosParamCreator = function options: localVarRequestOptions, }; }, + /** + * Fetch content of single page. + * @param {string} name + * @param {string} snapshotName + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + fetchSinglePageContent: async (name: string, snapshotName: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('fetchSinglePageContent', 'name', name) + // verify required parameter 'snapshotName' is not null or undefined + assertParamExists('fetchSinglePageContent', 'snapshotName', snapshotName) + const localVarPath = `/apis/api.console.halo.run/v1alpha1/singlepages/{name}/content` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + if (snapshotName !== undefined) { + localVarQueryParameter['snapshotName'] = snapshotName; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * Fetch head content of single page. * @param {string} name @@ -155,6 +255,47 @@ export const ApiConsoleHaloRunV1alpha1SinglePageApiAxiosParamCreator = function + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * List all snapshots for single page content. + * @param {string} name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listSinglePageSnapshots: async (name: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('listSinglePageSnapshots', 'name', name) + const localVarPath = `/apis/api.console.halo.run/v1alpha1/singlepages/{name}/snapshot` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -287,6 +428,53 @@ export const ApiConsoleHaloRunV1alpha1SinglePageApiAxiosParamCreator = function options: localVarRequestOptions, }; }, + /** + * Revert to specified snapshot for single page content. + * @param {string} name + * @param {RevertSnapshotForSingleParam} revertSnapshotForSingleParam + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + revertToSpecifiedSnapshotForSinglePage: async (name: string, revertSnapshotForSingleParam: RevertSnapshotForSingleParam, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('revertToSpecifiedSnapshotForSinglePage', 'name', name) + // verify required parameter 'revertSnapshotForSingleParam' is not null or undefined + assertParamExists('revertToSpecifiedSnapshotForSinglePage', 'revertSnapshotForSingleParam', revertSnapshotForSingleParam) + const localVarPath = `/apis/api.console.halo.run/v1alpha1/singlepages/{name}/revert-content` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(revertSnapshotForSingleParam, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * Update a single page. * @param {string} name @@ -391,6 +579,19 @@ export const ApiConsoleHaloRunV1alpha1SinglePageApiAxiosParamCreator = function export const ApiConsoleHaloRunV1alpha1SinglePageApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = ApiConsoleHaloRunV1alpha1SinglePageApiAxiosParamCreator(configuration) return { + /** + * Delete a content for post. + * @param {string} name + * @param {string} snapshotName + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteSinglePageContent(name: string, snapshotName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteSinglePageContent(name, snapshotName, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ApiConsoleHaloRunV1alpha1SinglePageApi.deleteSinglePageContent']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, /** * Draft a single page. * @param {SinglePageRequest} singlePageRequest @@ -403,6 +604,19 @@ export const ApiConsoleHaloRunV1alpha1SinglePageApiFp = function(configuration?: const localVarOperationServerBasePath = operationServerMap['ApiConsoleHaloRunV1alpha1SinglePageApi.draftSinglePage']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, + /** + * Fetch content of single page. + * @param {string} name + * @param {string} snapshotName + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async fetchSinglePageContent(name: string, snapshotName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchSinglePageContent(name, snapshotName, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ApiConsoleHaloRunV1alpha1SinglePageApi.fetchSinglePageContent']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, /** * Fetch head content of single page. * @param {string} name @@ -427,6 +641,18 @@ export const ApiConsoleHaloRunV1alpha1SinglePageApiFp = function(configuration?: const localVarOperationServerBasePath = operationServerMap['ApiConsoleHaloRunV1alpha1SinglePageApi.fetchSinglePageReleaseContent']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, + /** + * List all snapshots for single page content. + * @param {string} name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listSinglePageSnapshots(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listSinglePageSnapshots(name, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ApiConsoleHaloRunV1alpha1SinglePageApi.listSinglePageSnapshots']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, /** * List single pages. * @param {number} [page] Page number. Default is 0. @@ -459,6 +685,19 @@ export const ApiConsoleHaloRunV1alpha1SinglePageApiFp = function(configuration?: const localVarOperationServerBasePath = operationServerMap['ApiConsoleHaloRunV1alpha1SinglePageApi.publishSinglePage']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, + /** + * Revert to specified snapshot for single page content. + * @param {string} name + * @param {RevertSnapshotForSingleParam} revertSnapshotForSingleParam + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async revertToSpecifiedSnapshotForSinglePage(name: string, revertSnapshotForSingleParam: RevertSnapshotForSingleParam, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.revertToSpecifiedSnapshotForSinglePage(name, revertSnapshotForSingleParam, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ApiConsoleHaloRunV1alpha1SinglePageApi.revertToSpecifiedSnapshotForSinglePage']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, /** * Update a single page. * @param {string} name @@ -495,6 +734,15 @@ export const ApiConsoleHaloRunV1alpha1SinglePageApiFp = function(configuration?: export const ApiConsoleHaloRunV1alpha1SinglePageApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = ApiConsoleHaloRunV1alpha1SinglePageApiFp(configuration) return { + /** + * Delete a content for post. + * @param {ApiConsoleHaloRunV1alpha1SinglePageApiDeleteSinglePageContentRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteSinglePageContent(requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiDeleteSinglePageContentRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteSinglePageContent(requestParameters.name, requestParameters.snapshotName, options).then((request) => request(axios, basePath)); + }, /** * Draft a single page. * @param {ApiConsoleHaloRunV1alpha1SinglePageApiDraftSinglePageRequest} requestParameters Request parameters. @@ -504,6 +752,15 @@ export const ApiConsoleHaloRunV1alpha1SinglePageApiFactory = function (configura draftSinglePage(requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiDraftSinglePageRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.draftSinglePage(requestParameters.singlePageRequest, options).then((request) => request(axios, basePath)); }, + /** + * Fetch content of single page. + * @param {ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageContentRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + fetchSinglePageContent(requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageContentRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.fetchSinglePageContent(requestParameters.name, requestParameters.snapshotName, options).then((request) => request(axios, basePath)); + }, /** * Fetch head content of single page. * @param {ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageHeadContentRequest} requestParameters Request parameters. @@ -522,6 +779,15 @@ export const ApiConsoleHaloRunV1alpha1SinglePageApiFactory = function (configura fetchSinglePageReleaseContent(requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageReleaseContentRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.fetchSinglePageReleaseContent(requestParameters.name, options).then((request) => request(axios, basePath)); }, + /** + * List all snapshots for single page content. + * @param {ApiConsoleHaloRunV1alpha1SinglePageApiListSinglePageSnapshotsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listSinglePageSnapshots(requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiListSinglePageSnapshotsRequest, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listSinglePageSnapshots(requestParameters.name, options).then((request) => request(axios, basePath)); + }, /** * List single pages. * @param {ApiConsoleHaloRunV1alpha1SinglePageApiListSinglePagesRequest} requestParameters Request parameters. @@ -540,6 +806,15 @@ export const ApiConsoleHaloRunV1alpha1SinglePageApiFactory = function (configura publishSinglePage(requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiPublishSinglePageRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.publishSinglePage(requestParameters.name, options).then((request) => request(axios, basePath)); }, + /** + * Revert to specified snapshot for single page content. + * @param {ApiConsoleHaloRunV1alpha1SinglePageApiRevertToSpecifiedSnapshotForSinglePageRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + revertToSpecifiedSnapshotForSinglePage(requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiRevertToSpecifiedSnapshotForSinglePageRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.revertToSpecifiedSnapshotForSinglePage(requestParameters.name, requestParameters.revertSnapshotForSingleParam, options).then((request) => request(axios, basePath)); + }, /** * Update a single page. * @param {ApiConsoleHaloRunV1alpha1SinglePageApiUpdateDraftSinglePageRequest} requestParameters Request parameters. @@ -561,6 +836,27 @@ export const ApiConsoleHaloRunV1alpha1SinglePageApiFactory = function (configura }; }; +/** + * Request parameters for deleteSinglePageContent operation in ApiConsoleHaloRunV1alpha1SinglePageApi. + * @export + * @interface ApiConsoleHaloRunV1alpha1SinglePageApiDeleteSinglePageContentRequest + */ +export interface ApiConsoleHaloRunV1alpha1SinglePageApiDeleteSinglePageContentRequest { + /** + * + * @type {string} + * @memberof ApiConsoleHaloRunV1alpha1SinglePageApiDeleteSinglePageContent + */ + readonly name: string + + /** + * + * @type {string} + * @memberof ApiConsoleHaloRunV1alpha1SinglePageApiDeleteSinglePageContent + */ + readonly snapshotName: string +} + /** * Request parameters for draftSinglePage operation in ApiConsoleHaloRunV1alpha1SinglePageApi. * @export @@ -575,6 +871,27 @@ export interface ApiConsoleHaloRunV1alpha1SinglePageApiDraftSinglePageRequest { readonly singlePageRequest: SinglePageRequest } +/** + * Request parameters for fetchSinglePageContent operation in ApiConsoleHaloRunV1alpha1SinglePageApi. + * @export + * @interface ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageContentRequest + */ +export interface ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageContentRequest { + /** + * + * @type {string} + * @memberof ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageContent + */ + readonly name: string + + /** + * + * @type {string} + * @memberof ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageContent + */ + readonly snapshotName: string +} + /** * Request parameters for fetchSinglePageHeadContent operation in ApiConsoleHaloRunV1alpha1SinglePageApi. * @export @@ -603,6 +920,20 @@ export interface ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageReleaseCon readonly name: string } +/** + * Request parameters for listSinglePageSnapshots operation in ApiConsoleHaloRunV1alpha1SinglePageApi. + * @export + * @interface ApiConsoleHaloRunV1alpha1SinglePageApiListSinglePageSnapshotsRequest + */ +export interface ApiConsoleHaloRunV1alpha1SinglePageApiListSinglePageSnapshotsRequest { + /** + * + * @type {string} + * @memberof ApiConsoleHaloRunV1alpha1SinglePageApiListSinglePageSnapshots + */ + readonly name: string +} + /** * Request parameters for listSinglePages operation in ApiConsoleHaloRunV1alpha1SinglePageApi. * @export @@ -687,6 +1018,27 @@ export interface ApiConsoleHaloRunV1alpha1SinglePageApiPublishSinglePageRequest readonly name: string } +/** + * Request parameters for revertToSpecifiedSnapshotForSinglePage operation in ApiConsoleHaloRunV1alpha1SinglePageApi. + * @export + * @interface ApiConsoleHaloRunV1alpha1SinglePageApiRevertToSpecifiedSnapshotForSinglePageRequest + */ +export interface ApiConsoleHaloRunV1alpha1SinglePageApiRevertToSpecifiedSnapshotForSinglePageRequest { + /** + * + * @type {string} + * @memberof ApiConsoleHaloRunV1alpha1SinglePageApiRevertToSpecifiedSnapshotForSinglePage + */ + readonly name: string + + /** + * + * @type {RevertSnapshotForSingleParam} + * @memberof ApiConsoleHaloRunV1alpha1SinglePageApiRevertToSpecifiedSnapshotForSinglePage + */ + readonly revertSnapshotForSingleParam: RevertSnapshotForSingleParam +} + /** * Request parameters for updateDraftSinglePage operation in ApiConsoleHaloRunV1alpha1SinglePageApi. * @export @@ -736,6 +1088,17 @@ export interface ApiConsoleHaloRunV1alpha1SinglePageApiUpdateSinglePageContentRe * @extends {BaseAPI} */ export class ApiConsoleHaloRunV1alpha1SinglePageApi extends BaseAPI { + /** + * Delete a content for post. + * @param {ApiConsoleHaloRunV1alpha1SinglePageApiDeleteSinglePageContentRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiConsoleHaloRunV1alpha1SinglePageApi + */ + public deleteSinglePageContent(requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiDeleteSinglePageContentRequest, options?: RawAxiosRequestConfig) { + return ApiConsoleHaloRunV1alpha1SinglePageApiFp(this.configuration).deleteSinglePageContent(requestParameters.name, requestParameters.snapshotName, options).then((request) => request(this.axios, this.basePath)); + } + /** * Draft a single page. * @param {ApiConsoleHaloRunV1alpha1SinglePageApiDraftSinglePageRequest} requestParameters Request parameters. @@ -747,6 +1110,17 @@ export class ApiConsoleHaloRunV1alpha1SinglePageApi extends BaseAPI { return ApiConsoleHaloRunV1alpha1SinglePageApiFp(this.configuration).draftSinglePage(requestParameters.singlePageRequest, options).then((request) => request(this.axios, this.basePath)); } + /** + * Fetch content of single page. + * @param {ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageContentRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiConsoleHaloRunV1alpha1SinglePageApi + */ + public fetchSinglePageContent(requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageContentRequest, options?: RawAxiosRequestConfig) { + return ApiConsoleHaloRunV1alpha1SinglePageApiFp(this.configuration).fetchSinglePageContent(requestParameters.name, requestParameters.snapshotName, options).then((request) => request(this.axios, this.basePath)); + } + /** * Fetch head content of single page. * @param {ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageHeadContentRequest} requestParameters Request parameters. @@ -769,6 +1143,17 @@ export class ApiConsoleHaloRunV1alpha1SinglePageApi extends BaseAPI { return ApiConsoleHaloRunV1alpha1SinglePageApiFp(this.configuration).fetchSinglePageReleaseContent(requestParameters.name, options).then((request) => request(this.axios, this.basePath)); } + /** + * List all snapshots for single page content. + * @param {ApiConsoleHaloRunV1alpha1SinglePageApiListSinglePageSnapshotsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiConsoleHaloRunV1alpha1SinglePageApi + */ + public listSinglePageSnapshots(requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiListSinglePageSnapshotsRequest, options?: RawAxiosRequestConfig) { + return ApiConsoleHaloRunV1alpha1SinglePageApiFp(this.configuration).listSinglePageSnapshots(requestParameters.name, options).then((request) => request(this.axios, this.basePath)); + } + /** * List single pages. * @param {ApiConsoleHaloRunV1alpha1SinglePageApiListSinglePagesRequest} requestParameters Request parameters. @@ -791,6 +1176,17 @@ export class ApiConsoleHaloRunV1alpha1SinglePageApi extends BaseAPI { return ApiConsoleHaloRunV1alpha1SinglePageApiFp(this.configuration).publishSinglePage(requestParameters.name, options).then((request) => request(this.axios, this.basePath)); } + /** + * Revert to specified snapshot for single page content. + * @param {ApiConsoleHaloRunV1alpha1SinglePageApiRevertToSpecifiedSnapshotForSinglePageRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiConsoleHaloRunV1alpha1SinglePageApi + */ + public revertToSpecifiedSnapshotForSinglePage(requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiRevertToSpecifiedSnapshotForSinglePageRequest, options?: RawAxiosRequestConfig) { + return ApiConsoleHaloRunV1alpha1SinglePageApiFp(this.configuration).revertToSpecifiedSnapshotForSinglePage(requestParameters.name, requestParameters.revertSnapshotForSingleParam, options).then((request) => request(this.axios, this.basePath)); + } + /** * Update a single page. * @param {ApiConsoleHaloRunV1alpha1SinglePageApiUpdateDraftSinglePageRequest} requestParameters Request parameters. diff --git a/ui/packages/api-client/src/api/api-console-halo-run-v1alpha1-tag-api.ts b/ui/packages/api-client/src/api/api-console-halo-run-v1alpha1-tag-api.ts index 607d91e2fd..1421d10727 100644 --- a/ui/packages/api-client/src/api/api-console-halo-run-v1alpha1-tag-api.ts +++ b/ui/packages/api-client/src/api/api-console-halo-run-v1alpha1-tag-api.ts @@ -31,16 +31,16 @@ export const ApiConsoleHaloRunV1alpha1TagApiAxiosParamCreator = function (config return { /** * List Post Tags. - * @param {Array} [fieldSelector] Field selector for filtering. - * @param {string} [keyword] Keyword for searching. - * @param {Array} [labelSelector] Label selector for filtering. - * @param {number} [page] The page number. Zero indicates no page. - * @param {number} [size] Size of one page. Zero indicates no limit. - * @param {Array} [sort] Sort property and direction of the list result. Supported fields: creationTimestamp, name + * @param {number} [page] Page number. Default is 0. + * @param {number} [size] Size number. Default is 0. + * @param {Array} [labelSelector] Label selector. e.g.: hidden!=true + * @param {Array} [fieldSelector] Field selector. e.g.: metadata.name==halo + * @param {Array} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + * @param {string} [keyword] Post tags filtered by keyword. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listPostTags: async (fieldSelector?: Array, keyword?: string, labelSelector?: Array, page?: number, size?: number, sort?: Array, options: RawAxiosRequestConfig = {}): Promise => { + listPostTags: async (page?: number, size?: number, labelSelector?: Array, fieldSelector?: Array, sort?: Array, keyword?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/apis/api.console.halo.run/v1alpha1/tags`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -61,28 +61,28 @@ export const ApiConsoleHaloRunV1alpha1TagApiAxiosParamCreator = function (config // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) - if (fieldSelector) { - localVarQueryParameter['fieldSelector'] = fieldSelector; + if (page !== undefined) { + localVarQueryParameter['page'] = page; } - if (keyword !== undefined) { - localVarQueryParameter['keyword'] = keyword; + if (size !== undefined) { + localVarQueryParameter['size'] = size; } if (labelSelector) { localVarQueryParameter['labelSelector'] = labelSelector; } - if (page !== undefined) { - localVarQueryParameter['page'] = page; + if (fieldSelector) { + localVarQueryParameter['fieldSelector'] = fieldSelector; } - if (size !== undefined) { - localVarQueryParameter['size'] = size; + if (sort) { + localVarQueryParameter['sort'] = sort; } - if (sort) { - localVarQueryParameter['sort'] = Array.from(sort); + if (keyword !== undefined) { + localVarQueryParameter['keyword'] = keyword; } @@ -108,17 +108,17 @@ export const ApiConsoleHaloRunV1alpha1TagApiFp = function(configuration?: Config return { /** * List Post Tags. - * @param {Array} [fieldSelector] Field selector for filtering. - * @param {string} [keyword] Keyword for searching. - * @param {Array} [labelSelector] Label selector for filtering. - * @param {number} [page] The page number. Zero indicates no page. - * @param {number} [size] Size of one page. Zero indicates no limit. - * @param {Array} [sort] Sort property and direction of the list result. Supported fields: creationTimestamp, name + * @param {number} [page] Page number. Default is 0. + * @param {number} [size] Size number. Default is 0. + * @param {Array} [labelSelector] Label selector. e.g.: hidden!=true + * @param {Array} [fieldSelector] Field selector. e.g.: metadata.name==halo + * @param {Array} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + * @param {string} [keyword] Post tags filtered by keyword. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async listPostTags(fieldSelector?: Array, keyword?: string, labelSelector?: Array, page?: number, size?: number, sort?: Array, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listPostTags(fieldSelector, keyword, labelSelector, page, size, sort, options); + async listPostTags(page?: number, size?: number, labelSelector?: Array, fieldSelector?: Array, sort?: Array, keyword?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listPostTags(page, size, labelSelector, fieldSelector, sort, keyword, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['ApiConsoleHaloRunV1alpha1TagApi.listPostTags']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); @@ -140,7 +140,7 @@ export const ApiConsoleHaloRunV1alpha1TagApiFactory = function (configuration?: * @throws {RequiredError} */ listPostTags(requestParameters: ApiConsoleHaloRunV1alpha1TagApiListPostTagsRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.listPostTags(requestParameters.fieldSelector, requestParameters.keyword, requestParameters.labelSelector, requestParameters.page, requestParameters.size, requestParameters.sort, options).then((request) => request(axios, basePath)); + return localVarFp.listPostTags(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, requestParameters.keyword, options).then((request) => request(axios, basePath)); }, }; }; @@ -152,46 +152,46 @@ export const ApiConsoleHaloRunV1alpha1TagApiFactory = function (configuration?: */ export interface ApiConsoleHaloRunV1alpha1TagApiListPostTagsRequest { /** - * Field selector for filtering. - * @type {Array} + * Page number. Default is 0. + * @type {number} * @memberof ApiConsoleHaloRunV1alpha1TagApiListPostTags */ - readonly fieldSelector?: Array + readonly page?: number /** - * Keyword for searching. - * @type {string} + * Size number. Default is 0. + * @type {number} * @memberof ApiConsoleHaloRunV1alpha1TagApiListPostTags */ - readonly keyword?: string + readonly size?: number /** - * Label selector for filtering. + * Label selector. e.g.: hidden!=true * @type {Array} * @memberof ApiConsoleHaloRunV1alpha1TagApiListPostTags */ readonly labelSelector?: Array /** - * The page number. Zero indicates no page. - * @type {number} + * Field selector. e.g.: metadata.name==halo + * @type {Array} * @memberof ApiConsoleHaloRunV1alpha1TagApiListPostTags */ - readonly page?: number + readonly fieldSelector?: Array /** - * Size of one page. Zero indicates no limit. - * @type {number} + * Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + * @type {Array} * @memberof ApiConsoleHaloRunV1alpha1TagApiListPostTags */ - readonly size?: number + readonly sort?: Array /** - * Sort property and direction of the list result. Supported fields: creationTimestamp, name - * @type {Array} + * Post tags filtered by keyword. + * @type {string} * @memberof ApiConsoleHaloRunV1alpha1TagApiListPostTags */ - readonly sort?: Array + readonly keyword?: string } /** @@ -209,7 +209,7 @@ export class ApiConsoleHaloRunV1alpha1TagApi extends BaseAPI { * @memberof ApiConsoleHaloRunV1alpha1TagApi */ public listPostTags(requestParameters: ApiConsoleHaloRunV1alpha1TagApiListPostTagsRequest = {}, options?: RawAxiosRequestConfig) { - return ApiConsoleHaloRunV1alpha1TagApiFp(this.configuration).listPostTags(requestParameters.fieldSelector, requestParameters.keyword, requestParameters.labelSelector, requestParameters.page, requestParameters.size, requestParameters.sort, options).then((request) => request(this.axios, this.basePath)); + return ApiConsoleHaloRunV1alpha1TagApiFp(this.configuration).listPostTags(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, requestParameters.keyword, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/ui/packages/api-client/src/models/comment-status.ts b/ui/packages/api-client/src/models/comment-status.ts index 1f565a51be..86df5b65a5 100644 --- a/ui/packages/api-client/src/models/comment-status.ts +++ b/ui/packages/api-client/src/models/comment-status.ts @@ -32,6 +32,12 @@ export interface CommentStatus { * @memberof CommentStatus */ 'lastReplyTime'?: string; + /** + * + * @type {number} + * @memberof CommentStatus + */ + 'observedVersion'?: number; /** * * @type {number} diff --git a/ui/packages/api-client/src/models/content-update-param.ts b/ui/packages/api-client/src/models/content-update-param.ts new file mode 100644 index 0000000000..ac8e03439e --- /dev/null +++ b/ui/packages/api-client/src/models/content-update-param.ts @@ -0,0 +1,48 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface ContentUpdateParam + */ +export interface ContentUpdateParam { + /** + * + * @type {string} + * @memberof ContentUpdateParam + */ + 'content'?: string; + /** + * + * @type {string} + * @memberof ContentUpdateParam + */ + 'raw'?: string; + /** + * + * @type {string} + * @memberof ContentUpdateParam + */ + 'rawType'?: string; + /** + * + * @type {number} + * @memberof ContentUpdateParam + */ + 'version'?: number; +} + diff --git a/ui/packages/api-client/src/models/index.ts b/ui/packages/api-client/src/models/index.ts index b0acf1a96b..d4734faee3 100644 --- a/ui/packages/api-client/src/models/index.ts +++ b/ui/packages/api-client/src/models/index.ts @@ -39,6 +39,7 @@ export * from './config-map'; export * from './config-map-list'; export * from './config-map-ref'; export * from './content'; +export * from './content-update-param'; export * from './content-vo'; export * from './content-wrapper'; export * from './contributor'; @@ -85,6 +86,8 @@ export * from './listed-single-page'; export * from './listed-single-page-list'; export * from './listed-single-page-vo'; export * from './listed-single-page-vo-list'; +export * from './listed-snapshot-dto'; +export * from './listed-snapshot-spec'; export * from './listed-user'; export * from './login-history'; export * from './mark-specified-request'; @@ -158,12 +161,15 @@ export * from './reply'; export * from './reply-list'; export * from './reply-request'; export * from './reply-spec'; +export * from './reply-status'; export * from './reply-vo'; export * from './reply-vo-list'; export * from './reset-password-request'; export * from './reverse-proxy'; export * from './reverse-proxy-list'; export * from './reverse-proxy-rule'; +export * from './revert-snapshot-for-post-param'; +export * from './revert-snapshot-for-single-param'; export * from './role'; export * from './role-binding'; export * from './role-binding-list'; diff --git a/ui/packages/api-client/src/models/listed-snapshot-dto.ts b/ui/packages/api-client/src/models/listed-snapshot-dto.ts new file mode 100644 index 0000000000..4efd6fd047 --- /dev/null +++ b/ui/packages/api-client/src/models/listed-snapshot-dto.ts @@ -0,0 +1,42 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { ListedSnapshotSpec } from './listed-snapshot-spec'; +// May contain unused imports in some cases +// @ts-ignore +import { Metadata } from './metadata'; + +/** + * + * @export + * @interface ListedSnapshotDto + */ +export interface ListedSnapshotDto { + /** + * + * @type {Metadata} + * @memberof ListedSnapshotDto + */ + 'metadata': Metadata; + /** + * + * @type {ListedSnapshotSpec} + * @memberof ListedSnapshotDto + */ + 'spec': ListedSnapshotSpec; +} + diff --git a/ui/packages/api-client/src/models/listed-snapshot-spec.ts b/ui/packages/api-client/src/models/listed-snapshot-spec.ts new file mode 100644 index 0000000000..69597e08dc --- /dev/null +++ b/ui/packages/api-client/src/models/listed-snapshot-spec.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface ListedSnapshotSpec + */ +export interface ListedSnapshotSpec { + /** + * + * @type {string} + * @memberof ListedSnapshotSpec + */ + 'modifyTime'?: string; + /** + * + * @type {string} + * @memberof ListedSnapshotSpec + */ + 'owner': string; +} + diff --git a/ui/packages/api-client/src/models/plugin-status.ts b/ui/packages/api-client/src/models/plugin-status.ts index 59dd538c90..13ae2787ff 100644 --- a/ui/packages/api-client/src/models/plugin-status.ts +++ b/ui/packages/api-client/src/models/plugin-status.ts @@ -79,8 +79,7 @@ export const PluginStatusLastProbeStateEnum = { Resolved: 'RESOLVED', Started: 'STARTED', Stopped: 'STOPPED', - Failed: 'FAILED', - Unloaded: 'UNLOADED' + Failed: 'FAILED' } as const; export type PluginStatusLastProbeStateEnum = typeof PluginStatusLastProbeStateEnum[keyof typeof PluginStatusLastProbeStateEnum]; diff --git a/ui/packages/api-client/src/models/post-request.ts b/ui/packages/api-client/src/models/post-request.ts index 5d144c0178..398cddde13 100644 --- a/ui/packages/api-client/src/models/post-request.ts +++ b/ui/packages/api-client/src/models/post-request.ts @@ -15,7 +15,7 @@ // May contain unused imports in some cases // @ts-ignore -import { Content } from './content'; +import { ContentUpdateParam } from './content-update-param'; // May contain unused imports in some cases // @ts-ignore import { Post } from './post'; @@ -28,10 +28,10 @@ import { Post } from './post'; export interface PostRequest { /** * - * @type {Content} + * @type {ContentUpdateParam} * @memberof PostRequest */ - 'content'?: Content; + 'content'?: ContentUpdateParam; /** * * @type {Post} diff --git a/ui/packages/api-client/src/models/reply-status.ts b/ui/packages/api-client/src/models/reply-status.ts new file mode 100644 index 0000000000..d50500be32 --- /dev/null +++ b/ui/packages/api-client/src/models/reply-status.ts @@ -0,0 +1,30 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface ReplyStatus + */ +export interface ReplyStatus { + /** + * + * @type {number} + * @memberof ReplyStatus + */ + 'observedVersion'?: number; +} + diff --git a/ui/packages/api-client/src/models/reply.ts b/ui/packages/api-client/src/models/reply.ts index 8ce8856e1d..6ec10ecd86 100644 --- a/ui/packages/api-client/src/models/reply.ts +++ b/ui/packages/api-client/src/models/reply.ts @@ -19,6 +19,9 @@ import { Metadata } from './metadata'; // May contain unused imports in some cases // @ts-ignore import { ReplySpec } from './reply-spec'; +// May contain unused imports in some cases +// @ts-ignore +import { ReplyStatus } from './reply-status'; /** * @@ -50,5 +53,11 @@ export interface Reply { * @memberof Reply */ 'spec': ReplySpec; + /** + * + * @type {ReplyStatus} + * @memberof Reply + */ + 'status': ReplyStatus; } diff --git a/ui/packages/api-client/src/models/revert-snapshot-for-post-param.ts b/ui/packages/api-client/src/models/revert-snapshot-for-post-param.ts new file mode 100644 index 0000000000..61548debd6 --- /dev/null +++ b/ui/packages/api-client/src/models/revert-snapshot-for-post-param.ts @@ -0,0 +1,30 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface RevertSnapshotForPostParam + */ +export interface RevertSnapshotForPostParam { + /** + * + * @type {string} + * @memberof RevertSnapshotForPostParam + */ + 'snapshotName': string; +} + diff --git a/ui/packages/api-client/src/models/revert-snapshot-for-single-param.ts b/ui/packages/api-client/src/models/revert-snapshot-for-single-param.ts new file mode 100644 index 0000000000..ee95aed435 --- /dev/null +++ b/ui/packages/api-client/src/models/revert-snapshot-for-single-param.ts @@ -0,0 +1,30 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface RevertSnapshotForSingleParam + */ +export interface RevertSnapshotForSingleParam { + /** + * + * @type {string} + * @memberof RevertSnapshotForSingleParam + */ + 'snapshotName': string; +} + diff --git a/ui/packages/api-client/src/models/single-page-request.ts b/ui/packages/api-client/src/models/single-page-request.ts index 91a618cd9c..227e8ea00b 100644 --- a/ui/packages/api-client/src/models/single-page-request.ts +++ b/ui/packages/api-client/src/models/single-page-request.ts @@ -15,7 +15,7 @@ // May contain unused imports in some cases // @ts-ignore -import { Content } from './content'; +import { ContentUpdateParam } from './content-update-param'; // May contain unused imports in some cases // @ts-ignore import { SinglePage } from './single-page'; @@ -28,10 +28,10 @@ import { SinglePage } from './single-page'; export interface SinglePageRequest { /** * - * @type {Content} + * @type {ContentUpdateParam} * @memberof SinglePageRequest */ - 'content': Content; + 'content': ContentUpdateParam; /** * * @type {SinglePage} diff --git a/ui/packages/components/src/icons/icons.ts b/ui/packages/components/src/icons/icons.ts index 0b93a33616..26ca5df919 100644 --- a/ui/packages/components/src/icons/icons.ts +++ b/ui/packages/components/src/icons/icons.ts @@ -72,6 +72,7 @@ import IconAccountCircleLine from "~icons/ri/account-circle-line"; import IconSettings3Line from "~icons/ri/settings-3-line"; import IconImageAddLine from "~icons/ri/image-add-line"; import IconToolsFill from "~icons/ri/tools-fill"; +import IconHistoryLine from "~icons/ri/history-line"; export { IconDashboard, @@ -148,4 +149,5 @@ export { IconSettings3Line, IconImageAddLine, IconToolsFill, + IconHistoryLine, }; diff --git a/ui/src/locales/en.yaml b/ui/src/locales/en.yaml index 38eb298d1f..735fb24248 100644 --- a/ui/src/locales/en.yaml +++ b/ui/src/locales/en.yaml @@ -289,6 +289,8 @@ core: post_editor: title: Post edit untitled: Untitled post + actions: + snapshots: Snapshots post_tag: title: Post tags header: @@ -455,6 +457,8 @@ core: page_editor: title: Page edit untitled: Untitled page + actions: + snapshots: Snapshots comment: title: Comments empty: @@ -1671,3 +1675,39 @@ core: message: >- There are currently no tools available, and system tools may be provided by plugins + post_snapshots: + operations: + revert: + button: Revert + title: Revert snapshot + description: >- + Are you sure you want to restore this snapshot? This operation will + create a new snapshot based on this one and publish it. + toast_success: Reverted successfully + delete: + title: Delete snapshot + description: >- + Are you sure you want to delete this snapshot? This operation is + irreversible. + status: + released: Released + draft: Draft + title: Post snapshots + page_snapshots: + operations: + revert: + button: Revert + title: Revert snapshot + description: >- + Are you sure you want to restore this snapshot? This operation will + create a new snapshot based on this one and publish it. + toast_success: Reverted successfully + delete: + title: Delete snapshot + description: >- + Are you sure you want to delete this snapshot? This operation is + irreversible. + status: + released: Released + draft: Draft + title: Page snapshots diff --git a/ui/src/locales/zh-CN.yaml b/ui/src/locales/zh-CN.yaml index 1d68ba3265..f62c769b5d 100644 --- a/ui/src/locales/zh-CN.yaml +++ b/ui/src/locales/zh-CN.yaml @@ -293,6 +293,8 @@ core: post_editor: title: 文章编辑 untitled: 未命名文章 + actions: + snapshots: 版本历史 post_tag: title: 文章标签 header: @@ -451,6 +453,8 @@ core: page_editor: title: 页面编辑 untitled: 未命名页面 + actions: + snapshots: 版本历史 comment: title: 评论 empty: @@ -1575,3 +1579,31 @@ core: empty: title: 没有可用工具 message: 当前没有可用的工具,系统工具可能由插件提供 + post_snapshots: + operations: + revert: + button: 恢复 + title: 恢复快照 + description: 确定要恢复该快照吗?此操作将根据这个快照创建一个新的快照并发布。 + toast_success: 恢复成功 + delete: + title: 删除快照 + description: 确定要删除该快照吗?此操作无法恢复。 + status: + released: 已发布 + draft: 草稿 + title: 文章版本历史 + page_snapshots: + operations: + revert: + button: 恢复 + title: 恢复快照 + description: 确定要恢复该快照吗?此操作将根据这个快照创建一个新的快照并发布。 + toast_success: 恢复成功 + delete: + title: 删除快照 + description: 确定要删除该快照吗?此操作无法恢复。 + status: + released: 已发布 + draft: 草稿 + title: 页面版本历史 diff --git a/ui/src/locales/zh-TW.yaml b/ui/src/locales/zh-TW.yaml index 3985715d9b..b485437eb4 100644 --- a/ui/src/locales/zh-TW.yaml +++ b/ui/src/locales/zh-TW.yaml @@ -273,6 +273,8 @@ core: post_editor: title: 文章編輯 untitled: 未命名文章 + actions: + snapshots: 版本歷史 post_tag: title: 文章標籤 header: @@ -431,6 +433,8 @@ core: page_editor: title: 頁面編輯 untitled: Untitled page + actions: + snapshots: 版本歷史 comment: title: 留言 empty: @@ -1569,3 +1573,31 @@ core: empty: title: 沒有可用工具 message: 目前沒有可用的工具,系統工具可能由外掛提供 + post_snapshots: + operations: + revert: + button: 恢復 + title: 恢復快照 + description: 確定要恢復該快照嗎?此操作將根據這個快照創建一個新的快照並發佈。 + toast_success: 恢復成功 + delete: + title: 刪除快照 + description: 確定要刪除該快照嗎?此操作無法恢復。 + status: + released: 已發布 + draft: 草稿 + title: 文章版本歷史 + page_snapshots: + operations: + revert: + button: 恢復 + title: 恢復快照 + description: 確定要恢復該快照嗎?此操作將根據這個快照創建一個新的快照並發佈。 + toast_success: 恢復成功 + delete: + title: 刪除快照 + description: 確定要刪除該快照嗎?此操作無法恢復。 + status: + released: 已發布 + draft: 草稿 + title: 頁面版本歷史