import type { GetAccountProfileResponse } from '@dify/contracts/api/console/account/types.gen' import type { Role } from './access-control' import type { I18nText } from '@/i18n-config/language' import type { Model } from '@/types/app' export type CommonResponse = { result: 'success' | 'fail' } export type SetupStatusResponse = { step: 'finished' | 'not_started' setup_at?: Date } export type InitValidateStatusResponse = { status: 'finished' | 'not_started' } export type Member = Pick & { avatar: string last_login_at?: string last_active_at?: string created_at?: string status: 'pending' | 'active' | 'banned' | 'closed' role: 'owner' | 'admin' | 'editor' | 'normal' | 'dataset_operator' roles: Role[] } 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 FileUploadConfigResponse = { batch_count_limit: number image_file_size_limit?: number | string // default is 10MB image_file_batch_limit: number // default is 10, for dataset attachment upload only single_chunk_attachment_limit: number // default is 10, for dataset attachment upload only attachment_image_file_size_limit: number // default is 2MB, for dataset attachment upload only file_size_limit: number // default is 15MB knowledge_file_size_limit?: number // current workspace's knowledge upload limit in MB audio_file_size_limit?: number // default is 50MB video_file_size_limit?: number // default is 100MB skill_file_size_limit?: number // default is 50MB workflow_file_upload_limit?: number // default is 10 file_upload_limit: number // default is 5 } 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 } & Partial> } export type StructuredOutputRulesRequestBody = { instruction: string model_config: Model } export type StructuredOutputRulesResponse = { output: string error?: string }