import http from '@/api'; import { ResPage } from '../interface'; import { App } from '../interface/app'; import { TimeoutEnum } from '@/enums/http-enum'; export const syncApp = (req: App.AppStoreSync) => { return http.post('apps/sync/remote', req); }; export const syncLocalApp = (req: App.AppStoreSync) => { return http.post('apps/sync/local', req); }; export const searchApp = (req: App.AppReq) => { return http.post('apps/search', req); }; export const getAppByKey = (key: string) => { return http.get('apps/' + key); }; export const getAppTags = () => { return http.get('apps/tags'); }; export const getAppDetail = (appID: number, version: string, type: string) => { return http.get(`apps/detail/${appID}/${version}/${type}`); }; export const getAppDetailByID = (id: number) => { return http.get(`apps/details/${id}`); }; export const installApp = (install: App.AppInstall) => { return http.post('apps/install', install); }; export const changePort = (params: App.ChangePort) => { return http.post('apps/installed/port/change', params); }; export const searchAppInstalled = (search: App.AppInstallSearch) => { return http.post>('apps/installed/search', search); }; export const listAppInstalled = () => { return http.get>('apps/installed/list'); }; export const getAppPort = (type: string, name: string) => { return http.post(`apps/installed/loadport`, { type: type, name: name }); }; export const getAppConnInfo = (type: string, name: string) => { return http.post(`apps/installed/conninfo`, { type: type, name: name }); }; export const checkAppInstalled = (key: string, name: string) => { return http.post(`apps/installed/check`, { key: key, name: name }); }; export const appInstalledDeleteCheck = (appInstallId: number) => { return http.get(`apps/installed/delete/check/${appInstallId}`); }; export const getAppInstalled = (search: App.AppInstalledSearch) => { return http.post>('apps/installed/search', search); }; export const installedOp = (op: App.AppInstalledOp) => { return http.post('apps/installed/op', op, TimeoutEnum.T_40S); }; export const syncInstalledApp = () => { return http.post('apps/installed/sync', {}); }; export const getAppService = (key: string | undefined) => { return http.get(`apps/services/${key}`); }; export const getAppUpdateVersions = (req: App.AppUpdateVersionReq) => { return http.post(`apps/installed/update/versions`, req); }; export const getAppDefaultConfig = (key: string, name: string) => { return http.post(`apps/installed/conf`, { type: key, name: name }); }; export const getAppInstallParams = (id: number) => { return http.get(`apps/installed/params/${id}`); }; export const updateAppInstallParams = (req: any) => { return http.post(`apps/installed/params/update`, req); }; export const ignoreUpgrade = (req: any) => { return http.post(`apps/installed/ignore`, req); }; export const getIgnoredApp = () => { return http.get(`apps/ignored/detail`); }; export const updateInstallConfig = (req: App.AppConfigUpdate) => { return http.post(`apps/installed/config/update`, req); }; export const getAppStoreConfig = () => { return http.get(`apps/store/config`); }; export const updateAppStoreConfig = (req: App.AppStoreConfig) => { return http.post(`apps/store/update`, req); }; export const syncCutomAppStore = (req: App.AppStoreSync) => { return http.post(`/custom/app/sync`, req); }; export const getCurrentNodeCustomAppConfig = () => { return http.get(`/custom/app/config`); };