import axios from 'axios';
import { AxiosPromise } from 'axios';

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

export interface ComponentReleaseParams {
  identifier: string;
  version: string;
  [key: string]: any;
}

// 组件发布/公开
export function componentRelease(params: ComponentReleaseParams): AxiosPromise<any> {
  return axios.post(`${urlPrefix}/componentRelease/publish`, params);
}

// 组件撤销
export function componentRevoke(params: ComponentReleaseParams): AxiosPromise<any> {
  return axios.post(`${urlPrefix}/componentRelease/revoke`, params);
}