import { LEVEL_ENUM, Vertex, App, Page, DataNode, GlobalLogicNode, Entity, Structure, Enum, Interface, Process } from '..'; export declare enum SERVICE_TYPE { web = "web", micro = "micro" } export interface AssetsInfo { js: Array; css: Array; names?: Array; } /** * 服务(模块)类 */ export declare class Service extends Vertex { /** * 概念类型 */ readonly level: LEVEL_ENUM; /** * 服务类型 */ readonly type: SERVICE_TYPE; /** * Service Id */ readonly id: string; /** * 前端服务标识 */ readonly name: string; /** * 前端服务标题 */ readonly title: string; /** * 服务图标 */ readonly icon: string; /** * App 的 Id */ readonly appId: string; /** * 数据节点 */ readonly data: DataNode; /** * 接口列表 */ readonly interfaces: Array; /** * 逻辑节点 http://doc.hz.netease.com/pages/viewpage.action?pageId=310549021 */ readonly globalLogic: GlobalLogicNode; /** * 所在的 App * 父级引用,便于在树状结构中查找 */ readonly app: App; /** * 节点是否为展开状态 * 前端 UI 状态 */ expanded: boolean; /** * @param source 需要合并的部分参数 */ constructor(source?: Partial); loadStructures(): Promise>; syncStructures(): Promise; /** * 加载服务所有的接口列表 */ loadInterfaces(): Promise; } /** * 前端服务(模块)类 */ export declare class WebService extends Service { /** * 服务类型 */ readonly type: SERVICE_TYPE; /** * 服务状态 */ readonly status: 'UNPUBLISHED' | 'PUBLISHED' | 'REPOSITORYCREATED' | 'FSSTARTED' | 'APPINIT' | 'CODESYNCED' | 'CICDCREATED'; /** * 是否为官方服务 */ readonly officialType: 'official' | 'nonofficial'; readonly dnsAddr: string; /** * packageJSON 的缩减版 */ readonly packageInfo: { template: { name: string; version: string; }; ui: { name: string; version: string; }; componentDependencies: { [name: string]: string; }; themeVariables: { [name: string]: string; }; }; /** * 其他配置 */ readonly config: string; readonly api: { features: { [name: string]: boolean; }; builtInFunctions: { [name: string]: any; }; }; /** * 前端页面 */ readonly pages: Array; /** * @param source 需要合并的部分参数 */ constructor(source?: Partial); load(): Promise; loadPackageInfo(): Promise; savePackageInfo(): Promise; /** * 根据 packageInfo 的信息生成用于 load 的 assetsInfo * 在环境中需要 basic 和 custom 分开 load,否则容易报错 * @param prefix */ genAllAssetsInfo(prefix: string): { basic: AssetsInfo; custom?: AssetsInfo; }; genThemeCSS(): string; loadPages(): Promise; addPage(page: Page): Promise; importPage(page: Page): Promise; private _onPageTreeChange; /** * 从后端 JSON 生成规范的 WebService 对象 * @param source JSON * @param app 父级 App */ static from(source: any, app: App): WebService; } /** * 后端服务(模块)类 */ export declare class MicroService extends Service { /** * 服务类型 */ readonly type: SERVICE_TYPE; /** * 包名 */ readonly packageName: string; /** * 服务端口 */ readonly serverPort: number; /** * 接口列表 */ readonly interfaces: Array; /** * 流程列表 */ readonly processes: Array; /** * @param source 需要合并的部分参数 */ constructor(source?: Partial); private _saveVertexIdToName; loadEntities(): Promise; /** * 添加实体 * @param name 实体名称 */ addEntity(name: string): Promise; /** * 添加实体 * @param entityOptions 实体参数 */ addEntity(entityOptions: Partial): Promise; /** * 添加实体 * @param entity 已有的实体实例 */ addEntity(entity: Entity): Promise; /** * 删除实体 * @param name 实体名称 */ removeEntity(name: string): Promise; /** * 删除实体 * @param id 实体 Id */ removeEntity(id: string): Promise; /** * 删除实体 * @param entity 已有的实体实例 */ removeEntity(entity: Entity): Promise; /** * 加载所有枚举 */ loadEnums(): Promise; /** * 加载所有流程 */ loadProcesses(): Promise; mountResolverOnProcess(): void; /** * 导入sql或其他需要同步entity */ syncEntities(): Promise; syncEntityPropertyVersion(): Promise; /** * 加载服务所有的接口列表 */ loadInterfaces(): Promise; mountResolverOnEntity(): void; mountResolverOnInterface(): void; private _onDataTypesChange; private _onEnumsChange; private _onInterfacesChange; private _onVertexIdToNameChange; /** * 从后端 JSON 生成规范的 MicroService 对象 * @param source JSON * @param app 父级 App */ static from(source: any, app: App): MicroService; } export default Service;