import axios from 'axios';
import { apiResData } from '@/api/interface/index';

// 公共路径
const urlPrefix = '/api/v1/bpms-workbench';

// 获取应用实例列表
export function getInstances(data: any) {
  return axios.post<apiResData>(`${urlPrefix}/appIns/page`, data);
}

// 获取应用实例节点数据
export function getNodeData(appId: string) {
  return axios.get<apiResData>(`${urlPrefix}/appIns/${appId}/nodeData`);
}

// 获取应用实例数据
export function getInstanceDefinition(id: any) {
  return axios.get<apiResData>(`${urlPrefix}/appIns/${id}/render`);
}

// 获取应用实例资源
export function getInstanceResData(id: any) {
  return axios.get<apiResData>(`${urlPrefix}/appIns/${id}/res`);
}
