import type { SpiderItem } from '@vben/common-ui';

import { requestClient } from '#/api/request';

export namespace RepositoryApi {
  export interface AppListParams {
    mode?: string;
    name?: string;
  }
}

export async function getAppList(params: RepositoryApi.AppListParams) {
  return requestClient.get<SpiderItem[]>(`/v1/server/apps`, { params });
}

// export const getAppDetail = (id) => {
//   return requestClient.get(`/v1/server/${id}`)
// }
//
// export const getAppKey = (id) => {
//   return requestClient.get(`/v1/server/api-key/${id}`)
// }
//
// export const initAppKey = (id) => {
//   return requestClient.post(`/v1/server/api-key/init/${id}`)
// }
//
// export const getRepositoryKey = (data) => {
//   return requestClient.get(`/v1/server/api-key/dataset`)
// }
//
// export const initRepositoryKey = (data) => {
//   return requestClient.post(`/v1/server/api-key/dataset/init`)
// }
//
// export const getAbleList = (data) => {
//   return requestClient.get(`/v1/server/apps/able`)
// };
//
// export const toggleAble = (id) => {
//   return requestClient.get(`/v1/server/app/${id}`)
// };
