diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts index b8aee519..2ab3ae8b 100644 --- a/packages/shared/src/index.ts +++ b/packages/shared/src/index.ts @@ -2,7 +2,6 @@ export * from "./types/plugin"; export * from "./types/menus"; export * from "./core/plugins"; export * from "./states/pages"; -export * from "./types/extension"; export * from "./layouts"; export * from "./utils/api-client"; diff --git a/packages/shared/src/layouts/BasicLayout.vue b/packages/shared/src/layouts/BasicLayout.vue index 3f13f922..57da2fc1 100644 --- a/packages/shared/src/layouts/BasicLayout.vue +++ b/packages/shared/src/layouts/BasicLayout.vue @@ -9,7 +9,7 @@ import { VTag, } from "@halo-dev/components"; import type { MenuGroupType, MenuItemType } from "@/types/menus"; -import type { User } from "../../../../src/types/extension"; +import type { User } from "@halo-dev/api-client"; import logo from "@/assets/logo.svg"; import { RouterView, useRoute, useRouter } from "vue-router"; import { computed, inject, ref } from "vue"; diff --git a/packages/shared/src/types/extension.ts b/packages/shared/src/types/extension.ts deleted file mode 100644 index a0f61441..00000000 --- a/packages/shared/src/types/extension.ts +++ /dev/null @@ -1,53 +0,0 @@ -export interface Metadata { - name: string; - labels?: { - [key: string]: string | null; - } | null; - annotations?: { - [key: string]: string | null; - } | null; - version?: number | null; - creationTimestamp?: string | null; - deletionTimestamp?: string | null; -} - -export interface Extension { - spec?: T; - apiVersion: string; - kind: string; - metadata: Metadata; -} - -export interface LoginHistory { - loginAt: string; - sourceIp: string; - userAgent: string; - successful: boolean; - reason?: string; -} - -export interface User { - spec: UserSpec; - status?: UserStatus; - apiVersion: string; - kind: string; - metadata: Metadata; -} - -export interface UserSpec { - displayName: string; - avatar?: string; - email: string; - phone?: string; - password?: string; - bio?: string; - registeredAt?: string; - twoFactorAuthEnabled?: boolean; - disabled?: boolean; - loginHistoryLimit?: number; -} - -export interface UserStatus { - lastLoginAt?: string; - loginHistories?: LoginHistory[]; -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 61ce70e4..c270b90a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -79,7 +79,7 @@ importers: '@formkit/vue': 1.0.0-beta.9_jly5jqkcc2zgnt3crhnp3znzv4 '@halo-dev/admin-api': 1.1.0 '@halo-dev/admin-shared': link:packages/shared - '@halo-dev/api-client': 0.0.2 + '@halo-dev/api-client': link:../api-client '@halo-dev/components': link:packages/components '@vueuse/components': 8.9.3_vue@3.2.37 '@vueuse/core': 8.9.3_vue@3.2.37 @@ -160,7 +160,7 @@ importers: axios: ^0.27.2 vite-plugin-dts: ^1.3.0 dependencies: - '@halo-dev/api-client': 0.0.2 + '@halo-dev/api-client': link:../../../api-client '@halo-dev/components': link:../components axios: 0.27.2 devDependencies: @@ -1789,10 +1789,6 @@ packages: - debug dev: false - /@halo-dev/api-client/0.0.2: - resolution: {integrity: sha512-7amtdteNPCZ9ObM969HfknIqd+eXK8gjJ0cKWc7F7TET6puerlPxmmPC0SSdUEpnTf8zK1XUJg+Y06joxZboHA==} - dev: false - /@halo-dev/logger/1.1.0: resolution: {integrity: sha512-y0jVivYwF8MCVi/OdW2D0LN+GTM5rzMsR/ZmQVfgmKQw7Q7Q+EXPijxON6iCMZnWANGa4NaAcOO9k3ggG8oRwg==} engines: {node: '>=12.0.0'} diff --git a/src/types/extension.d.ts b/src/types/extension.d.ts deleted file mode 100644 index 831be7e9..00000000 --- a/src/types/extension.d.ts +++ /dev/null @@ -1,192 +0,0 @@ -import type { Plugin as PluginModule } from "@halo-dev/admin-shared"; -import type { FormKitSchemaCondition, FormKitSchemaNode } from "@formkit/core"; - -export interface License { - name?: string; - url?: string; -} - -export interface Metadata { - name: string; - labels?: { - [key: string]: string | null; - } | null; - annotations?: { - [key: string]: string | null; - } | null; - version?: number | null; - creationTimestamp?: string | null; - deletionTimestamp?: string | null; -} - -export interface Plugin { - spec: PluginSpec; - status?: PluginStatus; - apiVersion: string; - kind: string; - metadata: Metadata; - extensions: Extension[]; -} - -export interface Extension { - name: string; - fields: string[]; -} - -export interface PluginSpec { - displayName?: string; - version?: string; - author?: string; - logo?: string; - pluginDependencies?: { - [key: string]: string; - }; - homepage?: string; - description?: string; - license?: License[]; - requires?: string; - pluginClass?: string; - enabled?: boolean; - module?: PluginModule; - settingName?: string; - configMapName?: string; -} - -export interface PluginStatus { - phase?: - | "CREATED" - | "DISABLED" - | "RESOLVED" - | "STARTED" - | "STOPPED" - | "FAILED"; - reason?: string; - message?: string; - lastStartTime?: string; - lastTransitionTime?: string; - entry?: string; - stylesheet?: string; -} - -export interface PersonalAccessToken { - spec?: PersonalAccessTokenSpec; - apiVersion: string; - kind: string; - metadata: Metadata; -} - -export interface PersonalAccessTokenSpec { - userName?: string; - displayName?: string; - revoked?: boolean; - expiresAt?: string; - scopes?: string; - tokenDigest?: string; -} - -export interface RoleBinding { - subjects?: Subject[]; - roleRef?: RoleRef; - apiVersion: string; - kind: string; - metadata: Metadata; -} - -export interface RoleRef { - kind?: string; - name?: string; - apiGroup?: string; -} - -export interface Subject { - kind?: string; - name?: string; - apiGroup?: string; -} - -export interface PolicyRule { - apiGroups?: string[]; - resources?: string[]; - resourceNames?: string[]; - nonResourceURLs?: string[]; - verbs?: string[]; - pluginName?: string; -} - -export interface Role { - rules?: PolicyRule[]; - apiVersion: string; - kind: string; - metadata: Metadata; -} - -export interface LoginHistory { - loginAt: string; - sourceIp: string; - userAgent: string; - successful: boolean; - reason?: string; -} - -export interface User { - spec: UserSpec; - status?: UserStatus; - apiVersion: string; - kind: string; - metadata: Metadata; -} - -export interface UserSpec { - displayName: string; - avatar?: string; - email: string; - phone?: string; - password?: string; - bio?: string; - registeredAt?: string; - twoFactorAuthEnabled?: boolean; - disabled?: boolean; - loginHistoryLimit?: number; -} - -export interface UserStatus { - lastLoginAt?: string; - loginHistories?: LoginHistory[]; -} - -export interface FileReverseProxyProvider { - directory?: string; - filename?: string; -} - -export interface ReverseProxy { - rules?: ReverseProxyRule[]; - apiVersion: string; - kind: string; - metadata: Metadata; -} - -export interface ReverseProxyRule { - path?: string; - file?: FileReverseProxyProvider; -} - -export interface Setting { - spec: SettingSpec[]; - apiVersion: string; - kind: string; - metadata: Metadata; -} - -export interface SettingSpec { - group: string; - label: string; - formSchema: FormKitSchemaCondition | FormKitSchemaNode[]; -} - -export interface ConfigMap { - data: Record; - apiVersion: string; - kind: string; - metadata: Metadata; -}