mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 09:58:04 +08:00
Merge branch 'feat/plugins' of github.com:langgenius/dify into feat/plugins
This commit is contained in:
@ -7,6 +7,7 @@ import type {
|
||||
Permissions,
|
||||
PluginTask,
|
||||
PluginsFromMarketplaceResponse,
|
||||
uploadGitHubResponse,
|
||||
} from '@/app/components/plugins/types'
|
||||
import type {
|
||||
PluginsSearchParams,
|
||||
@ -80,6 +81,19 @@ export const useInstallPackageFromGitHub = () => {
|
||||
})
|
||||
}
|
||||
|
||||
export const useUploadGitHub = (payload: {
|
||||
repo: string
|
||||
version: string
|
||||
package: string
|
||||
}) => {
|
||||
return useQuery({
|
||||
queryKey: [NAME_SPACE, 'uploadGitHub', payload],
|
||||
queryFn: () => post<uploadGitHubResponse>('/workspaces/current/plugin/upload/github', {
|
||||
body: payload,
|
||||
}),
|
||||
})
|
||||
}
|
||||
|
||||
export const useDebugKey = () => {
|
||||
return useQuery({
|
||||
queryKey: [NAME_SPACE, 'debugKey'],
|
||||
@ -143,6 +157,17 @@ export const useMutationPluginsFromMarketplace = () => {
|
||||
})
|
||||
}
|
||||
|
||||
export const useFetchPluginsInMarketPlaceByIds = (unique_identifiers: string[]) => {
|
||||
return useQuery({
|
||||
queryKey: [NAME_SPACE, 'fetchPluginsInMarketPlaceByIds', unique_identifiers],
|
||||
queryFn: () => postMarketplace<{ data: PluginsFromMarketplaceResponse }>('/plugins/identifier/batch', {
|
||||
body: {
|
||||
unique_identifiers,
|
||||
},
|
||||
}),
|
||||
})
|
||||
}
|
||||
|
||||
const usePluginTaskListKey = [NAME_SPACE, 'pluginTaskList']
|
||||
export const usePluginTaskList = () => {
|
||||
const [enabled, setEnabled] = useState(true)
|
||||
|
||||
Reference in New Issue
Block a user