Files
dify/web/models/snippet.ts
Stephen Zhou 8540ca9242 refactor(web): migrate snippet console contracts (#38258)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-01 16:31:39 +00:00

50 lines
1.0 KiB
TypeScript

import type { TagResponse as Tag } from '@dify/contracts/api/console/tags/types.gen'
import type { Viewport } from 'reactflow'
import type { Edge, Node } from '@/app/components/workflow/types'
import type { InputVar } from '@/models/pipeline'
export type SnippetSection = 'orchestrate'
export type SnippetListItem = {
id: string
name: string
description: string | null
updatedAt: string
usage: string
tags: Tag[]
is_published?: boolean
status?: string
}
export type SnippetDetail = {
id: string
name: string
description: string | null
updatedAt: string
usage: string
tags: Tag[]
is_published?: boolean
status?: string
}
export type SnippetCanvasData = {
nodes: Node[]
edges: Edge[]
viewport: Viewport
}
export type SnippetInputField = InputVar
type SnippetDetailUIModel = {
inputFieldCount: number
checklistCount: number
autoSavedAt: string
}
export type SnippetDetailPayload = {
snippet: SnippetDetail
graph: SnippetCanvasData
inputFields: SnippetInputField[]
uiMeta: SnippetDetailUIModel
}