import { Capi } from '@tencent-sdk/capi'; import { UpdateApiInputs, ApiDeployInputs, ApiDeployOutputs, CreateApiInputs, ApiRemoveInputs, ApiBulkRemoveInputs, ApiBulkDeployInputs, ApiDetail, EnviromentType, } from '../interface'; import { ActionType } from '../apis'; import UsagePlanEntity from './usage-plan'; import ApplicationEntity from './application'; import { ApigwTrigger } from '../../triggers'; export default class ApiEntity { capi: Capi; usagePlan: UsagePlanEntity; trigger: ApigwTrigger; app: ApplicationEntity; constructor(capi: Capi, trigger: ApigwTrigger); request({ Action, ...data }: { Action: ActionType; [key: string]: any }): Promise; removeRequest({ Action, ...data }: { Action: ActionType; [key: string]: any }): Promise; create({ serviceId, endpoint, environment, }: CreateApiInputs): Promise; unbindApiApp({ serviceId, apiId, environment, }: { serviceId: string; apiId: string; environment: EnviromentType; }): Promise; update( { serviceId, endpoint, environment, created }: UpdateApiInputs, apiDetail: ApiDetail, ): Promise; bulkDeploy({ apiList, stateList, serviceId, environment, }: ApiBulkDeployInputs): Promise; /** 部署 API 列表 */ deploy({ serviceId, environment, apiList, oldList, apiConfig, isOauthApi, }: ApiDeployInputs): Promise; remove({ apiConfig: endpoint, serviceId, environment }: ApiRemoveInputs): Promise; bulkRemove({ apiList, serviceId, environment }: ApiBulkRemoveInputs): Promise; formatServiceConfig(endpoint: any, apiInputs: any): void; formatInput({ serviceId, endpoint }: Omit): { [key: string]: any; }; getList(serviceId: string): Promise< { Method: string; Path: string; ApiId: string; InternalDomain: string; }[] >; /** 根据路径和方法获取 API 网关接口 */ getByPathAndMethod({ serviceId, path, method, }: { serviceId?: string; path: string; method: string; }): Promise; getById({ serviceId, apiId }: { serviceId: string; apiId: string }): Promise; }