mirror of
https://github.com/langgenius/dify.git
synced 2026-07-15 01:17:04 +08:00
33 lines
837 B
TypeScript
33 lines
837 B
TypeScript
import type { InstalledLatestVersionResponse, PluginDetail } from '@/app/components/plugins/types'
|
|
import { type } from '@orpc/contract'
|
|
import { base } from '../base'
|
|
|
|
export const pluginCheckInstalledContract = base
|
|
.route({
|
|
path: '/workspaces/current/plugin/list/installations/ids',
|
|
method: 'POST',
|
|
})
|
|
.input(type<{
|
|
body: {
|
|
plugin_ids: string[]
|
|
}
|
|
}>())
|
|
.output(type<{ plugins: PluginDetail[] }>())
|
|
|
|
export const pluginLatestVersionsContract = base
|
|
.route({
|
|
path: '/workspaces/current/plugin/list/latest-versions',
|
|
method: 'POST',
|
|
})
|
|
.input(type<{
|
|
body: {
|
|
plugin_ids: string[]
|
|
}
|
|
}>())
|
|
.output(type<InstalledLatestVersionResponse>())
|
|
|
|
export const pluginsRouterContract = {
|
|
checkInstalled: pluginCheckInstalledContract,
|
|
latestVersions: pluginLatestVersionsContract,
|
|
}
|