Download web/service/explore.ts from ZHZ1024/dify: direct link, hf CLI and curl.
- Browser
- Download file 888 Bytes
-
https://huggingface.co/spaces/ZHZ1024/dify/resolve/main/web/service/explore.ts
- Command line
-
hf download hf://spaces/ZHZ1024/dify/web/service/explore.ts
-
curl -L -o explore.ts https://huggingface.co/spaces/ZHZ1024/dify/resolve/main/web/service/explore.ts
888 Bytes
| import { del, get, patch, post } from './base' | |
| import type { App, AppCategory } from '@/models/explore' | |
| export const fetchAppList = () => { | |
| return get<{ | |
| categories: AppCategory[] | |
| recommended_apps: App[] | |
| }>('/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') | |
| } | |