mirror of
https://github.com/langgenius/dify.git
synced 2026-09-24 23:22:26 +08:00
refactor(web): migrate plugin console contracts (#38252)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
autofix-ci[bot]
parent
6eb9928df7
commit
37bcb60c26
@@ -1134,9 +1134,7 @@ export type PluginAutoUpgradeSettingsResponseModel = {
|
||||
export type PluginInstallationItemResponse = {
|
||||
checksum: string
|
||||
created_at: string
|
||||
declaration: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
declaration: PluginDeclarationResponse
|
||||
endpoints_active: number
|
||||
endpoints_setups: number
|
||||
id: string
|
||||
@@ -1156,7 +1154,7 @@ export type LatestPluginCache = {
|
||||
alternative_plugin_id: string
|
||||
deprecated_reason: string
|
||||
plugin_id: string
|
||||
status: string
|
||||
status: 'active' | 'deleted'
|
||||
unique_identifier: string
|
||||
version: string
|
||||
}
|
||||
@@ -1500,39 +1498,6 @@ export type StrategySetting = 'disabled' | 'fix_only' | 'latest'
|
||||
|
||||
export type UpgradeMode = 'all' | 'exclude' | 'partial'
|
||||
|
||||
export type PluginInstallationSource = 'github' | 'marketplace' | 'package' | 'remote'
|
||||
|
||||
export type CoreToolsEntitiesCommonEntitiesI18nObject = {
|
||||
en_US: string
|
||||
ja_JP?: string | null
|
||||
pt_BR?: string | null
|
||||
zh_Hans?: string | null
|
||||
}
|
||||
|
||||
export type PluginCategoryBuiltinToolResponse = {
|
||||
author: string
|
||||
description: CoreToolsEntitiesCommonEntitiesI18nObject
|
||||
label: CoreToolsEntitiesCommonEntitiesI18nObject
|
||||
labels: Array<string>
|
||||
name: string
|
||||
output_schema: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
parameters?: Array<{
|
||||
[key: string]: unknown
|
||||
}> | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type ToolProviderType
|
||||
= | 'api'
|
||||
| 'app'
|
||||
| 'builtin'
|
||||
| 'dataset-retrieval'
|
||||
| 'mcp'
|
||||
| 'plugin'
|
||||
| 'workflow'
|
||||
|
||||
export type PluginDeclarationResponse = {
|
||||
agent_strategy?: {
|
||||
[key: string]: unknown
|
||||
@@ -1573,6 +1538,39 @@ export type PluginDeclarationResponse = {
|
||||
version: string
|
||||
}
|
||||
|
||||
export type PluginInstallationSource = 'github' | 'marketplace' | 'package' | 'remote'
|
||||
|
||||
export type CoreToolsEntitiesCommonEntitiesI18nObject = {
|
||||
en_US: string
|
||||
ja_JP?: string | null
|
||||
pt_BR?: string | null
|
||||
zh_Hans?: string | null
|
||||
}
|
||||
|
||||
export type PluginCategoryBuiltinToolResponse = {
|
||||
author: string
|
||||
description: CoreToolsEntitiesCommonEntitiesI18nObject
|
||||
label: CoreToolsEntitiesCommonEntitiesI18nObject
|
||||
labels: Array<string>
|
||||
name: string
|
||||
output_schema: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
parameters?: Array<{
|
||||
[key: string]: unknown
|
||||
}> | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type ToolProviderType
|
||||
= | 'api'
|
||||
| 'app'
|
||||
| 'builtin'
|
||||
| 'dataset-retrieval'
|
||||
| 'mcp'
|
||||
| 'plugin'
|
||||
| 'workflow'
|
||||
|
||||
export type RbacRoleAccount = {
|
||||
account_id: string
|
||||
account_name?: string
|
||||
|
||||
@@ -1101,7 +1101,7 @@ export const zLatestPluginCache = z.object({
|
||||
alternative_plugin_id: z.string(),
|
||||
deprecated_reason: z.string(),
|
||||
plugin_id: z.string(),
|
||||
status: z.string(),
|
||||
status: z.enum(['active', 'deleted']),
|
||||
unique_identifier: z.string(),
|
||||
version: z.string(),
|
||||
})
|
||||
@@ -1716,33 +1716,6 @@ export const zPluginAutoUpgradeFetchResponse = z.object({
|
||||
*/
|
||||
export const zPluginInstallationSource = z.enum(['github', 'marketplace', 'package', 'remote'])
|
||||
|
||||
/**
|
||||
* PluginInstallationItemResponse
|
||||
*/
|
||||
export const zPluginInstallationItemResponse = z.object({
|
||||
checksum: z.string(),
|
||||
created_at: z.iso.datetime(),
|
||||
declaration: z.record(z.string(), z.unknown()),
|
||||
endpoints_active: z.int(),
|
||||
endpoints_setups: z.int(),
|
||||
id: z.string(),
|
||||
meta: z.record(z.string(), z.unknown()),
|
||||
plugin_id: z.string(),
|
||||
plugin_unique_identifier: z.string(),
|
||||
runtime_type: z.string(),
|
||||
source: zPluginInstallationSource,
|
||||
tenant_id: z.string(),
|
||||
updated_at: z.iso.datetime(),
|
||||
version: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginInstallationsResponse
|
||||
*/
|
||||
export const zPluginInstallationsResponse = z.object({
|
||||
plugins: z.array(zPluginInstallationItemResponse),
|
||||
})
|
||||
|
||||
/**
|
||||
* I18nObject
|
||||
*
|
||||
@@ -2348,6 +2321,33 @@ export const zPluginDeclarationResponse = z.object({
|
||||
version: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginInstallationItemResponse
|
||||
*/
|
||||
export const zPluginInstallationItemResponse = z.object({
|
||||
checksum: z.string(),
|
||||
created_at: z.iso.datetime(),
|
||||
declaration: zPluginDeclarationResponse,
|
||||
endpoints_active: z.int(),
|
||||
endpoints_setups: z.int(),
|
||||
id: z.string(),
|
||||
meta: z.record(z.string(), z.unknown()),
|
||||
plugin_id: z.string(),
|
||||
plugin_unique_identifier: z.string(),
|
||||
runtime_type: z.string(),
|
||||
source: zPluginInstallationSource,
|
||||
tenant_id: z.string(),
|
||||
updated_at: z.iso.datetime(),
|
||||
version: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginInstallationsResponse
|
||||
*/
|
||||
export const zPluginInstallationsResponse = z.object({
|
||||
plugins: z.array(zPluginInstallationItemResponse),
|
||||
})
|
||||
|
||||
/**
|
||||
* PluginCategoryInstalledPluginResponse
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user