Download apps/web/src/api/plugins.ts from hunian003/message: direct link, hf CLI and curl.
- Browser
- Download file 857 Bytes
-
https://huggingface.co/spaces/hunian003/message/resolve/main/apps/web/src/api/plugins.ts
- Command line
-
hf download hf://spaces/hunian003/message/apps/web/src/api/plugins.ts
-
curl -L -o plugins.ts https://huggingface.co/spaces/hunian003/message/resolve/main/apps/web/src/api/plugins.ts
857 Bytes
| /** | |
| * 插件 API client | |
| * | |
| * 旧安装/校验/卸载 API 已禁用,返回 410 Gone。 | |
| * 详见 R-002、R-009。 | |
| */ | |
| import { apiClient } from './client'; | |
| import { PluginListItem, PluginDetail, PluginOperationResult, PluginStats } from '@typings/plugin'; | |
| export const pluginsApi = { | |
| /** | |
| * 获取插件列表 | |
| */ | |
| list: () => apiClient.get<PluginListItem[]>('/plugins/'), | |
| /** | |
| * 获取插件统计 | |
| */ | |
| stats: () => apiClient.get<PluginStats>('/plugins/stats'), | |
| /** | |
| * 获取插件详情 | |
| */ | |
| get: (name: string) => apiClient.get<PluginDetail>(`/plugins/${name}`), | |
| /** | |
| * 启用插件 | |
| */ | |
| enable: (name: string) => | |
| apiClient.post<PluginOperationResult>(`/plugins/${name}/enable`), | |
| /** | |
| * 禁用插件 | |
| */ | |
| disable: (name: string) => | |
| apiClient.post<PluginOperationResult>(`/plugins/${name}/disable`), | |
| }; | |