import { EnvService } from './env'; import { FunctionService } from './function'; import { FunctionDeployer } from './deploy/FunctionDeployer'; import { CloudRunService } from './cloudrun'; import { AgentService } from './agent'; import { StorageService } from './storage'; import { DatabaseService } from './database'; import { LogService } from './log'; import { CloudApiRequestFn } from './context'; import { CommonService } from './common'; import { HostingService } from './hosting'; import { Environment } from './environment'; import { EnvironmentManager } from './environmentManager'; import { ThirdService } from './third'; import { AccessService } from './access'; import { UserService } from './user'; import { CloudBaseRunService } from './cloudBaseRun'; import { MysqlService } from './mysql'; import { DocsService } from './docs'; import { PermissionService } from './permission'; import { SandboxService } from './sandbox'; import { CloudAppService } from './cloudApp'; import { AiModelService } from './aiModel'; import { IntegrationService } from './integration'; import { MonitorService } from './monitor'; import { PlatformService } from './platform'; import { ProjectValidator } from './projectValidator'; import { DeployOrchestrator } from './deploy/DeployOrchestrator'; import { resolveBuildCommand as frameworkResolveBuildCommand, resolveHostingOutputDir as frameworkResolveHostingOutputDir, buildHostingItem as frameworkBuildHostingItem } from './deploy/framework'; interface CloudBaseConfig { secretId?: string; secretKey?: string; token?: string; envId?: string; proxy?: string; region?: string; envType?: string; useInternalEndpoint?: boolean; internalEndpointRegion?: string; requestFn?: CloudApiRequestFn; } declare class CloudBase { private static cloudBase; /** * init 初始化 为单例 * * @static * @param {ManagerConfig} config * @returns {CloudBase} * @memberof CloudBase */ static init(config: CloudBaseConfig): CloudBase; private context; private cloudBaseConfig; private environmentManager; private docsService; private projectValidatorService; private deployOrchestratorService; constructor(config?: CloudBaseConfig); addEnvironment(envId: string): void; currentEnvironment(): Environment; get functions(): FunctionService; /** * 函数部署编排器(FunctionDeployer) * 在现有 FunctionService 之上,按 buildStrategy 编排 Event/HTTP 函数的创建、更新与访问收敛 */ get functionDeployer(): FunctionDeployer; get cloudrun(): CloudRunService; get agent(): AgentService; get storage(): StorageService; get database(): DatabaseService; get hosting(): HostingService; /** * HTTP Service(CloudBaseGW)访问服务 * @deprecated 自 v5.0.0 起 HTTP Service 模块已废弃,请改用 env 下的域名与路由相关 API。 */ get access(): AccessService; get mysql(): MysqlService; /** * 云托管服务(CloudBaseRun) * 提供云托管版本流量配置等能力 * @deprecated 请使用 cloudBaseRun 代替,避免与 cloudAppService 混淆 */ get cloudApp(): CloudBaseRunService; /** * 云托管服务(CloudBaseRun) * 提供云托管版本流量配置等能力 */ get cloudBaseRun(): CloudBaseRunService; /** * 云应用服务(CloudApp 统一部署) * 提供 Web 应用的创建、部署、版本管理等能力 */ get cloudAppService(): CloudAppService; /** * 获取云应用服务 */ getCloudAppService(): CloudAppService; commonService(service?: string, version?: string): CommonService; get env(): EnvService; get log(): LogService; get third(): ThirdService; get user(): UserService; get permission(): PermissionService; get sandbox(): SandboxService; get aiModel(): AiModelService; /** * 集成中心服务(UserKey) * 提供集成模板/实例的增删改查与绑定云函数能力 */ get integration(): IntegrationService; /** * 监控服务 * 提供指标查询能力 */ get monitor(): MonitorService; /** * 平台版套餐服务 * 提供平台版套餐查询、环境管理、资源用量及 HTTP 访问服务路由等能力 */ get platform(): PlatformService; get docs(): DocsService; get projectValidator(): ProjectValidator; getProjectValidator(): ProjectValidator; /** * 声明式部署编排器 * 顺序:database → functions → app → hosting → gateway;支持 dry-run / only / skip / 幂等重试 */ get deployOrchestrator(): DeployOrchestrator; getDeployOrchestrator(): DeployOrchestrator; getEnvironmentManager(): EnvironmentManager; getManagerConfig(): CloudBaseConfig; get isInternalEndpoint(): Boolean; } declare namespace CloudBase { type RequestFn = CloudApiRequestFn; /** * 声明式 hosting 构建推断与执行(CLI 侧 tcb app build / hosting 中立化复用, * 避免各端复制同一套 framework 推断逻辑)。均为纯函数,不依赖环境上下文。 */ const resolveHostingBuildCommand: typeof frameworkResolveBuildCommand; const resolveHostingOutputDir: typeof frameworkResolveHostingOutputDir; const buildHosting: typeof frameworkBuildHostingItem; } export = CloudBase;