mirror of
https://github.com/langgenius/dify.git
synced 2026-05-09 21:28:25 +08:00
Define detailed human input field types
This commit is contained in:
parent
6c4f293719
commit
5faa4f9520
@ -1,5 +1,6 @@
|
||||
import type {
|
||||
CommonNodeType,
|
||||
UploadFileSetting,
|
||||
ValueSelector,
|
||||
} from '@/app/components/workflow/types'
|
||||
import { InputVarType } from '@/app/components/workflow/types'
|
||||
@ -59,31 +60,47 @@ export type UserAction = {
|
||||
button_style: UserActionButtonType
|
||||
}
|
||||
|
||||
export type FormInputItemDefault = {
|
||||
export type StringDefault = {
|
||||
selector: ValueSelector
|
||||
type: 'variable' | 'constant'
|
||||
value: string
|
||||
}
|
||||
|
||||
export type StringListSource = {
|
||||
selector: ValueSelector
|
||||
type: 'variable' | 'constant'
|
||||
value: string[]
|
||||
}
|
||||
|
||||
// Preserve the old export during the transition to the new schema names.
|
||||
export type FormInputItemDefault = StringDefault
|
||||
|
||||
type BaseFormInputItem = {
|
||||
output_variable_name: string
|
||||
}
|
||||
|
||||
export type ParagraphFormInput = BaseFormInputItem & {
|
||||
type: InputVarType.paragraph
|
||||
default: FormInputItemDefault
|
||||
default: StringDefault
|
||||
}
|
||||
|
||||
export type SelectFormInput = BaseFormInputItem & {
|
||||
type: InputVarType.select
|
||||
option_source: StringListSource
|
||||
}
|
||||
|
||||
export type FileFormInput = BaseFormInputItem & {
|
||||
type SharedFileFormInput = Pick<
|
||||
UploadFileSetting,
|
||||
'allowed_file_extensions' | 'allowed_file_types' | 'allowed_file_upload_methods'
|
||||
>
|
||||
|
||||
export type FileFormInput = BaseFormInputItem & SharedFileFormInput & {
|
||||
type: InputVarType.singleFile
|
||||
}
|
||||
|
||||
export type FileListFormInput = BaseFormInputItem & {
|
||||
export type FileListFormInput = BaseFormInputItem & SharedFileFormInput & {
|
||||
type: InputVarType.multiFiles
|
||||
max_upload_count?: number
|
||||
}
|
||||
|
||||
export type FormInputItem
|
||||
|
||||
Loading…
Reference in New Issue
Block a user