dify/web/app/components/workflow/nodes/constants.ts
Stephen Zhou 6d0e36479b
refactor(i18n): use JSON with flattened key and namespace (#30114)
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-29 14:52:32 +08:00

25 lines
901 B
TypeScript

import type { I18nKeysByPrefix } from '@/types/i18n'
import { TransferMethod } from '@/types/app'
export const CUSTOM_NODE_TYPE = 'custom'
type OptionItem = {
value: string
i18nKey: I18nKeysByPrefix<'workflow', 'nodes.ifElse.optionName.'>
}
export const FILE_TYPE_OPTIONS = [
{ value: 'image', i18nKey: 'image' },
{ value: 'document', i18nKey: 'doc' },
{ value: 'audio', i18nKey: 'audio' },
{ value: 'video', i18nKey: 'video' },
] as const satisfies readonly OptionItem[]
export const TRANSFER_METHOD = [
{ value: TransferMethod.local_file, i18nKey: 'localUpload' },
{ value: TransferMethod.remote_url, i18nKey: 'url' },
] as const satisfies readonly OptionItem[]
export const SUB_VARIABLES = ['type', 'size', 'name', 'url', 'extension', 'mime_type', 'transfer_method', 'related_id']
export const OUTPUT_FILE_SUB_VARIABLES = SUB_VARIABLES.filter(key => key !== 'transfer_method')