Files
gsfdc/demo-dify/dify/web/models/common.ts
T
wuzilongandCursor 6519682885 chore: 纳入本地 Dify 1.19.0 源码及品牌与免登改动
演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-18 13:59:25 +08:00

77 lines
1.6 KiB
TypeScript

import type { AppConfigJsonValue } from '@dify/contracts/api/console/apps/types.gen'
import type { I18nText } from '@/i18n/language'
export type CommonResponse = {
result: 'success' | 'fail'
}
export type DataSourceNotionPage = {
page_icon: null | {
type: string | null
url: string | null
emoji: string | null
}
page_id: string
page_name: string
parent_id: string
type: string
is_bound: boolean
}
export type NotionPage = DataSourceNotionPage & {
workspace_id: string
}
export type DataSourceNotionPageMap = Record<
string,
DataSourceNotionPage & { workspace_id: string }
>
export type DataSourceNotionWorkspace = {
workspace_name: string
workspace_id: string
workspace_icon: string | null
total?: number
pages: DataSourceNotionPage[]
}
export const DataSourceProvider = {
fireCrawl: 'firecrawl',
jinaReader: 'jinareader',
waterCrawl: 'watercrawl',
} as const
export type DataSourceProvider = (typeof DataSourceProvider)[keyof typeof DataSourceProvider]
export type CodeBasedExtensionForm = {
type: string
label: I18nText
variable: string
required: boolean
options: { label: I18nText; value: string }[]
default?: string
placeholder: string
max_length?: number
}
export type CodeBasedExtensionItem = {
name: string
label: I18nText
form_schema: CodeBasedExtensionForm[]
}
export type CodeBasedExtension = {
module: string
data: CodeBasedExtensionItem[]
}
export type ExternalDataTool = {
type?: string
label?: string
icon?: string
icon_background?: string
variable?: string
enabled?: boolean
config?: {
api_based_extension_id?: string
} & Record<string, AppConfigJsonValue>
}