mirror of
https://gitee.com/dify_ai/dify.git
synced 2024-12-02 11:18:19 +08:00
23e3413655
Co-authored-by: StyleZhang <jasonapring2015@outlook.com>
38 lines
766 B
TypeScript
38 lines
766 B
TypeScript
import { del, get, patch, post } from './base'
|
|
|
|
export const fetchAppList = () => {
|
|
return get('/explore/apps')
|
|
}
|
|
|
|
export const fetchAppDetail = (id: string): Promise<any> => {
|
|
return get(`/explore/apps/${id}`)
|
|
}
|
|
|
|
export const fetchInstalledAppList = () => {
|
|
return get('/installed-apps')
|
|
}
|
|
|
|
export const installApp = (id: string) => {
|
|
return post('/installed-apps', {
|
|
body: {
|
|
app_id: id,
|
|
},
|
|
})
|
|
}
|
|
|
|
export const uninstallApp = (id: string) => {
|
|
return del(`/installed-apps/${id}`)
|
|
}
|
|
|
|
export const updatePinStatus = (id: string, isPinned: boolean) => {
|
|
return patch(`/installed-apps/${id}`, {
|
|
body: {
|
|
is_pinned: isPinned,
|
|
},
|
|
})
|
|
}
|
|
|
|
export const getToolProviders = () => {
|
|
return get('/workspaces/current/tool-providers')
|
|
}
|