mirror of
https://github.com/langgenius/dify.git
synced 2026-09-24 23:22:26 +08:00
refactor(api): migrate console app common endpoints to BaseModel (#37951)
Co-authored-by: Asuka Minato <i@asukaminato.eu.org> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Asuka Minato
autofix-ci[bot]
parent
2429b757d8
commit
4fc8f0ddd1
@@ -52,7 +52,7 @@ export type AgentAppDetailWithSite = {
|
||||
role?: string | null
|
||||
site?: AppDetailSiteResponse | null
|
||||
tags?: Array<Tag>
|
||||
tracing?: JsonValue | null
|
||||
tracing?: unknown | null
|
||||
updated_at?: number | null
|
||||
updated_by?: string | null
|
||||
use_icon_as_answer_icon?: boolean | null
|
||||
@@ -578,17 +578,6 @@ export type Tag = {
|
||||
type: string
|
||||
}
|
||||
|
||||
export type JsonValue
|
||||
= | string
|
||||
| number
|
||||
| number
|
||||
| boolean
|
||||
| {
|
||||
[key: string]: unknown
|
||||
}
|
||||
| Array<unknown>
|
||||
| null
|
||||
|
||||
export type WorkflowPartial = {
|
||||
created_at?: number | null
|
||||
created_by?: string | null
|
||||
@@ -979,6 +968,17 @@ export type Feedback = {
|
||||
rating: string
|
||||
}
|
||||
|
||||
export type JsonValue
|
||||
= | string
|
||||
| number
|
||||
| number
|
||||
| boolean
|
||||
| {
|
||||
[key: string]: unknown
|
||||
}
|
||||
| Array<unknown>
|
||||
| null
|
||||
|
||||
export type MessageFile = {
|
||||
belongs_to?: string | null
|
||||
filename: string
|
||||
@@ -1081,7 +1081,7 @@ export type AgentConfigRevisionResponse = {
|
||||
export type ModelConfigPartial = {
|
||||
created_at?: number | null
|
||||
created_by?: string | null
|
||||
model?: JsonValue | null
|
||||
model?: unknown | null
|
||||
pre_prompt?: string | null
|
||||
updated_at?: number | null
|
||||
updated_by?: string | null
|
||||
@@ -1862,7 +1862,7 @@ export type AgentAppDetailWithSiteWritable = {
|
||||
role?: string | null
|
||||
site?: AppDetailSiteResponseWritable | null
|
||||
tags?: Array<Tag>
|
||||
tracing?: JsonValue | null
|
||||
tracing?: unknown | null
|
||||
updated_at?: number | null
|
||||
updated_by?: string | null
|
||||
use_icon_as_answer_icon?: boolean | null
|
||||
|
||||
@@ -325,17 +325,6 @@ export const zTag = z.object({
|
||||
type: z.string(),
|
||||
})
|
||||
|
||||
export const zJsonValue = z
|
||||
.union([
|
||||
z.string(),
|
||||
z.int(),
|
||||
z.number(),
|
||||
z.boolean(),
|
||||
z.record(z.string(), z.unknown()),
|
||||
z.array(z.unknown()),
|
||||
])
|
||||
.nullable()
|
||||
|
||||
/**
|
||||
* WorkflowPartial
|
||||
*/
|
||||
@@ -802,6 +791,17 @@ export const zAgentLogMessageListResponse = z.object({
|
||||
total: z.int(),
|
||||
})
|
||||
|
||||
export const zJsonValue = z
|
||||
.union([
|
||||
z.string(),
|
||||
z.int(),
|
||||
z.number(),
|
||||
z.boolean(),
|
||||
z.record(z.string(), z.unknown()),
|
||||
z.array(z.unknown()),
|
||||
])
|
||||
.nullable()
|
||||
|
||||
/**
|
||||
* AgentThought
|
||||
*/
|
||||
@@ -947,7 +947,7 @@ export const zAgentStatisticSummaryResponse = z.object({
|
||||
export const zModelConfigPartial = z.object({
|
||||
created_at: z.int().nullish(),
|
||||
created_by: z.string().nullish(),
|
||||
model: zJsonValue.nullish(),
|
||||
model: z.unknown().nullish(),
|
||||
pre_prompt: z.string().nullish(),
|
||||
updated_at: z.int().nullish(),
|
||||
updated_by: z.string().nullish(),
|
||||
@@ -1065,7 +1065,7 @@ export const zAgentAppDetailWithSite = z.object({
|
||||
role: z.string().nullish(),
|
||||
site: zAppDetailSiteResponse.nullish(),
|
||||
tags: z.array(zTag).optional(),
|
||||
tracing: zJsonValue.nullish(),
|
||||
tracing: z.unknown().nullish(),
|
||||
updated_at: z.int().nullish(),
|
||||
updated_by: z.string().nullish(),
|
||||
use_icon_as_answer_icon: z.boolean().nullish(),
|
||||
@@ -2672,7 +2672,7 @@ export const zAgentAppDetailWithSiteWritable = z.object({
|
||||
role: z.string().nullish(),
|
||||
site: zAppDetailSiteResponseWritable.nullish(),
|
||||
tags: z.array(zTag).optional(),
|
||||
tracing: zJsonValue.nullish(),
|
||||
tracing: z.unknown().nullish(),
|
||||
updated_at: z.int().nullish(),
|
||||
updated_by: z.string().nullish(),
|
||||
use_icon_as_answer_icon: z.boolean().nullish(),
|
||||
|
||||
@@ -45,7 +45,7 @@ export type AppDetailWithSite = {
|
||||
permission_keys?: Array<string>
|
||||
site?: AppDetailSiteResponse | null
|
||||
tags?: Array<Tag>
|
||||
tracing?: JsonValue | null
|
||||
tracing?: unknown | null
|
||||
updated_at?: number | null
|
||||
updated_by?: string | null
|
||||
use_icon_as_answer_icon?: boolean | null
|
||||
@@ -417,7 +417,7 @@ export type AppDetail = {
|
||||
name: string
|
||||
permission_keys?: Array<string>
|
||||
tags?: Array<Tag>
|
||||
tracing?: JsonValue | null
|
||||
tracing?: unknown | null
|
||||
updated_at?: number | null
|
||||
updated_by?: string | null
|
||||
use_icon_as_answer_icon?: boolean | null
|
||||
@@ -526,6 +526,16 @@ export type CopyAppPayload = {
|
||||
name?: string | null
|
||||
}
|
||||
|
||||
export type AppImportResponse = {
|
||||
app_id?: string | null
|
||||
app_mode?: string | null
|
||||
current_dsl_version: string
|
||||
error?: string
|
||||
id: string
|
||||
imported_dsl_version?: string
|
||||
status: ImportStatus
|
||||
}
|
||||
|
||||
export type AppExportResponse = {
|
||||
data: string
|
||||
}
|
||||
@@ -733,7 +743,7 @@ export type TextToSpeechVoiceListResponse = Array<{
|
||||
}>
|
||||
|
||||
export type AppTraceResponse = {
|
||||
enabled: boolean
|
||||
enabled?: boolean
|
||||
tracing_provider?: string | null
|
||||
}
|
||||
|
||||
@@ -1343,17 +1353,6 @@ export type Tag = {
|
||||
type: string
|
||||
}
|
||||
|
||||
export type JsonValue
|
||||
= | string
|
||||
| number
|
||||
| number
|
||||
| boolean
|
||||
| {
|
||||
[key: string]: unknown
|
||||
}
|
||||
| Array<unknown>
|
||||
| null
|
||||
|
||||
export type WorkflowPartial = {
|
||||
created_at?: number | null
|
||||
created_by?: string | null
|
||||
@@ -1391,6 +1390,17 @@ export type AdvancedChatWorkflowRunForListResponse = {
|
||||
version?: string | null
|
||||
}
|
||||
|
||||
export type JsonValue
|
||||
= | string
|
||||
| number
|
||||
| number
|
||||
| boolean
|
||||
| {
|
||||
[key: string]: unknown
|
||||
}
|
||||
| Array<unknown>
|
||||
| null
|
||||
|
||||
export type AgentConfigVersionResponse = {
|
||||
id: string
|
||||
kind: 'build_draft' | 'draft' | 'snapshot'
|
||||
@@ -2156,7 +2166,7 @@ export type WorkflowDraftVariableWithoutValue = {
|
||||
export type ModelConfigPartial = {
|
||||
created_at?: number | null
|
||||
created_by?: string | null
|
||||
model?: JsonValue | null
|
||||
model?: unknown | null
|
||||
pre_prompt?: string | null
|
||||
updated_at?: number | null
|
||||
updated_by?: string | null
|
||||
@@ -3003,7 +3013,7 @@ export type AppDetailWithSiteWritable = {
|
||||
permission_keys?: Array<string>
|
||||
site?: AppDetailSiteResponseWritable | null
|
||||
tags?: Array<Tag>
|
||||
tracing?: JsonValue | null
|
||||
tracing?: unknown | null
|
||||
updated_at?: number | null
|
||||
updated_by?: string | null
|
||||
use_icon_as_answer_icon?: boolean | null
|
||||
@@ -4623,6 +4633,7 @@ export type PostAppsByAppIdCopyErrors = {
|
||||
|
||||
export type PostAppsByAppIdCopyResponses = {
|
||||
201: AppDetailWithSite
|
||||
202: AppImportResponse
|
||||
}
|
||||
|
||||
export type PostAppsByAppIdCopyResponse
|
||||
|
||||
@@ -463,7 +463,7 @@ export const zTextToSpeechVoiceListResponse = z.array(z.record(z.string(), z.unk
|
||||
* AppTraceResponse
|
||||
*/
|
||||
export const zAppTraceResponse = z.object({
|
||||
enabled: z.boolean(),
|
||||
enabled: z.boolean().optional().default(false),
|
||||
tracing_provider: z.string().nullish(),
|
||||
})
|
||||
|
||||
@@ -909,22 +909,6 @@ export const zTag = z.object({
|
||||
type: z.string(),
|
||||
})
|
||||
|
||||
export const zJsonValue = z
|
||||
.union([
|
||||
z.string(),
|
||||
z.int(),
|
||||
z.number(),
|
||||
z.boolean(),
|
||||
z.record(z.string(), z.unknown()),
|
||||
z.array(z.unknown()),
|
||||
])
|
||||
.nullable()
|
||||
|
||||
/**
|
||||
* GeneratedAppResponse
|
||||
*/
|
||||
export const zGeneratedAppResponse = zJsonValue
|
||||
|
||||
/**
|
||||
* WorkflowPartial
|
||||
*/
|
||||
@@ -955,6 +939,35 @@ export const zImport = z.object({
|
||||
status: zImportStatus,
|
||||
})
|
||||
|
||||
/**
|
||||
* AppImportResponse
|
||||
*/
|
||||
export const zAppImportResponse = z.object({
|
||||
app_id: z.string().nullish(),
|
||||
app_mode: z.string().nullish(),
|
||||
current_dsl_version: z.string(),
|
||||
error: z.string().optional().default(''),
|
||||
id: z.string(),
|
||||
imported_dsl_version: z.string().optional().default(''),
|
||||
status: zImportStatus,
|
||||
})
|
||||
|
||||
export const zJsonValue = z
|
||||
.union([
|
||||
z.string(),
|
||||
z.int(),
|
||||
z.number(),
|
||||
z.boolean(),
|
||||
z.record(z.string(), z.unknown()),
|
||||
z.array(z.unknown()),
|
||||
])
|
||||
.nullable()
|
||||
|
||||
/**
|
||||
* GeneratedAppResponse
|
||||
*/
|
||||
export const zGeneratedAppResponse = zJsonValue
|
||||
|
||||
/**
|
||||
* AgentConfigVersionResponse
|
||||
*/
|
||||
@@ -2212,7 +2225,7 @@ export const zWorkflowDraftVariableListWithoutValue = z.object({
|
||||
export const zModelConfigPartial = z.object({
|
||||
created_at: z.int().nullish(),
|
||||
created_by: z.string().nullish(),
|
||||
model: zJsonValue.nullish(),
|
||||
model: z.unknown().nullish(),
|
||||
pre_prompt: z.string().nullish(),
|
||||
updated_at: z.int().nullish(),
|
||||
updated_by: z.string().nullish(),
|
||||
@@ -2305,7 +2318,7 @@ export const zAppDetailWithSite = z.object({
|
||||
permission_keys: z.array(z.string()).optional(),
|
||||
site: zAppDetailSiteResponse.nullish(),
|
||||
tags: z.array(zTag).optional(),
|
||||
tracing: zJsonValue.nullish(),
|
||||
tracing: z.unknown().nullish(),
|
||||
updated_at: z.int().nullish(),
|
||||
updated_by: z.string().nullish(),
|
||||
use_icon_as_answer_icon: z.boolean().nullish(),
|
||||
@@ -2331,7 +2344,7 @@ export const zAppDetail = z.object({
|
||||
name: z.string(),
|
||||
permission_keys: z.array(z.string()).optional(),
|
||||
tags: z.array(zTag).optional(),
|
||||
tracing: zJsonValue.nullish(),
|
||||
tracing: z.unknown().nullish(),
|
||||
updated_at: z.int().nullish(),
|
||||
updated_by: z.string().nullish(),
|
||||
use_icon_as_answer_icon: z.boolean().nullish(),
|
||||
@@ -4127,7 +4140,7 @@ export const zAppDetailWithSiteWritable = z.object({
|
||||
permission_keys: z.array(z.string()).optional(),
|
||||
site: zAppDetailSiteResponseWritable.nullish(),
|
||||
tags: z.array(zTag).optional(),
|
||||
tracing: zJsonValue.nullish(),
|
||||
tracing: z.unknown().nullish(),
|
||||
updated_at: z.int().nullish(),
|
||||
updated_by: z.string().nullish(),
|
||||
use_icon_as_answer_icon: z.boolean().nullish(),
|
||||
@@ -5194,10 +5207,7 @@ export const zPostAppsByAppIdCopyPath = z.object({
|
||||
app_id: z.uuid(),
|
||||
})
|
||||
|
||||
/**
|
||||
* App copied successfully
|
||||
*/
|
||||
export const zPostAppsByAppIdCopyResponse = zAppDetailWithSite
|
||||
export const zPostAppsByAppIdCopyResponse = z.union([zAppDetailWithSite, zAppImportResponse])
|
||||
|
||||
export const zGetAppsByAppIdExportPath = z.object({
|
||||
app_id: z.uuid(),
|
||||
|
||||
Reference in New Issue
Block a user