UNPKG

@alauda-fe/common

Version:

Alauda frontend team common codes.

46 lines (45 loc) 1.57 kB
import { Observable } from 'rxjs'; import { OpenAPIV2Document } from '../types/openapi'; import { OpenAPIV3SchemaObject } from '../types/schema'; import { WorkspaceHelperService } from './workspace-helper.service'; import * as i0 from "@angular/core"; export declare class KubernetesSchemaService { private readonly http; readonly workspaceHelper: WorkspaceHelperService; private initialized; private readonly schemaCache; private readonly schemaCache$$; get definitions(): Record<string, OpenAPIV3SchemaObject>; private ensureInitialized; /** * 获取当前集群的 OpenAPI schema */ getOpenAPISchema(): Observable<OpenAPIV2Document | null>; /** * 根据 Kubernetes 资源类型获取对应的 schema */ getResourceSchema(apiVersion: string, kind: string): Observable<OpenAPIV3SchemaObject | null>; /** * 获取所有可用的资源定义 */ getAllResourceDefinitions(): Observable<Record<string, OpenAPIV3SchemaObject> | null>; /** * 清理缓存 */ clearCache(): void; /** * 获取缓存状态 */ getCacheStatus(): Observable<Map<string, OpenAPIV2Document>>; /** * 检查 WorkspaceHelperService 是否可用 */ isWorkspaceHelperAvailable(): boolean; /** * 从 Kubernetes API 获取 OpenAPI schema */ private fetchOpenAPISchema; private getDefinitionKey; static ɵfac: i0.ɵɵFactoryDeclaration<KubernetesSchemaService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<KubernetesSchemaService>; }