Merge remote-tracking branch 'myori/main' into feat/collaboration2

This commit is contained in:
hjlarry
2026-01-17 10:22:41 +08:00
6266 changed files with 544217 additions and 224655 deletions

View File

@ -1,14 +1,14 @@
import type { AnnotationReplyConfig, ChatPromptConfig, CompletionPromptConfig, DatasetConfigs, PromptMode } from '@/models/debug'
import type { CollectionType } from '@/app/components/tools/types'
import type { LanguagesSupported } from '@/i18n-config/language'
import type { Tag } from '@/app/components/base/tag-management/constant'
import type { CollectionType } from '@/app/components/tools/types'
import type { UploadFileSetting } from '@/app/components/workflow/types'
import type { LanguagesSupported } from '@/i18n-config/language'
import type { AccessMode } from '@/models/access-control'
import type { ExternalDataTool } from '@/models/common'
import type {
RerankingModeEnum,
WeightedScoreEnum,
} from '@/models/datasets'
import type { UploadFileSetting } from '@/app/components/workflow/types'
import type { AccessMode } from '@/models/access-control'
import type { ExternalDataTool } from '@/models/common'
import type { AnnotationReplyConfig, ChatPromptConfig, CompletionPromptConfig, DatasetConfigs, PromptMode } from '@/models/debug'
export enum Theme {
light = 'light',
@ -274,9 +274,10 @@ export type SiteConfig = {
title: string
/** Application Description will be shown in the Client */
description: string
/** Define the color in hex for different elements of the chatbot, such as:
/**
* Define the color in hex for different elements of the chatbot, such as:
* The header, the button , etc.
*/
*/
chat_color_theme: string
/** Invert the color of the theme set in chat_color_theme */
chat_color_theme_inverted: boolean
@ -315,7 +316,7 @@ export type SiteConfig = {
use_icon_as_answer_icon: boolean
}
export type AppIconType = 'image' | 'emoji'
export type AppIconType = 'image' | 'emoji' | 'link'
/**
* App
@ -328,12 +329,12 @@ export type App = {
/** Description */
description: string
/** Author Name */
author_name: string;
author_name: string
/**
* Icon Type
* @default 'emoji'
*/
*/
icon_type: AppIconType | null
/** Icon, stores file ID if icon_type is 'image' */
icon: string
@ -375,10 +376,12 @@ export type App = {
updated_at: number
updated_by?: string
}
deleted_tools?: Array<{ id: string; tool_name: string }>
deleted_tools?: Array<{ id: string, tool_name: string }>
/** access control */
access_mode: AccessMode
max_active_requests?: number | null
/** whether workflow trigger has un-published draft */
has_draft_trigger?: boolean
}
export type AppSSO = {

View File

@ -27,9 +27,9 @@ type License = {
export type SystemFeatures = {
plugin_installation_permission: {
plugin_installation_scope: InstallationScope,
plugin_installation_scope: InstallationScope
restrict_to_marketplace_only: boolean
},
}
sso_enforced_for_signin: boolean
sso_enforced_for_signin_protocol: SSOProtocol | ''
sso_enforced_for_web: boolean
@ -108,6 +108,8 @@ export enum DatasetAttr {
DATA_MARKETPLACE_API_PREFIX = 'data-marketplace-api-prefix',
DATA_MARKETPLACE_URL_PREFIX = 'data-marketplace-url-prefix',
DATA_PUBLIC_EDITION = 'data-public-edition',
DATA_PUBLIC_AMPLITUDE_API_KEY = 'data-public-amplitude-api-key',
DATA_PUBLIC_COOKIE_DOMAIN = 'data-public-cookie-domain',
DATA_PUBLIC_SUPPORT_MAIL_LOGIN = 'data-public-support-mail-login',
DATA_PUBLIC_SENTRY_DSN = 'data-public-sentry-dsn',
DATA_PUBLIC_MAINTENANCE_NOTICE = 'data-public-maintenance-notice',
@ -131,4 +133,5 @@ export enum DatasetAttr {
NEXT_PUBLIC_ZENDESK_FIELD_ID_EMAIL = 'next-public-zendesk-field-id-email',
NEXT_PUBLIC_ZENDESK_FIELD_ID_WORKSPACE_ID = 'next-public-zendesk-field-id-workspace-id',
NEXT_PUBLIC_ZENDESK_FIELD_ID_PLAN = 'next-public-zendesk-field-id-plan',
DATA_PUBLIC_BATCH_CONCURRENCY = 'data-public-batch-concurrency',
}

125
web/types/i18n.d.ts vendored
View File

@ -1,102 +1,31 @@
// TypeScript type definitions for Dify's i18next configuration
// This file is auto-generated. Do not edit manually.
// To regenerate, run: pnpm run gen:i18n-types
import 'react-i18next'
import type { NamespaceCamelCase, Resources } from '../i18n-config/resources'
import 'i18next'
// Extract types from translation files using typeof import pattern
type AppAnnotationMessages = typeof import('../i18n/en-US/app-annotation').default
type AppApiMessages = typeof import('../i18n/en-US/app-api').default
type AppDebugMessages = typeof import('../i18n/en-US/app-debug').default
type AppLogMessages = typeof import('../i18n/en-US/app-log').default
type AppOverviewMessages = typeof import('../i18n/en-US/app-overview').default
type AppMessages = typeof import('../i18n/en-US/app').default
type BillingMessages = typeof import('../i18n/en-US/billing').default
type CommonMessages = typeof import('../i18n/en-US/common').default
type CustomMessages = typeof import('../i18n/en-US/custom').default
type DatasetCreationMessages = typeof import('../i18n/en-US/dataset-creation').default
type DatasetDocumentsMessages = typeof import('../i18n/en-US/dataset-documents').default
type DatasetHitTestingMessages = typeof import('../i18n/en-US/dataset-hit-testing').default
type DatasetPipelineMessages = typeof import('../i18n/en-US/dataset-pipeline').default
type DatasetSettingsMessages = typeof import('../i18n/en-US/dataset-settings').default
type DatasetMessages = typeof import('../i18n/en-US/dataset').default
type EducationMessages = typeof import('../i18n/en-US/education').default
type ExploreMessages = typeof import('../i18n/en-US/explore').default
type LayoutMessages = typeof import('../i18n/en-US/layout').default
type LoginMessages = typeof import('../i18n/en-US/login').default
type OauthMessages = typeof import('../i18n/en-US/oauth').default
type PipelineMessages = typeof import('../i18n/en-US/pipeline').default
type PluginTagsMessages = typeof import('../i18n/en-US/plugin-tags').default
type PluginTriggerMessages = typeof import('../i18n/en-US/plugin-trigger').default
type PluginMessages = typeof import('../i18n/en-US/plugin').default
type RegisterMessages = typeof import('../i18n/en-US/register').default
type RunLogMessages = typeof import('../i18n/en-US/run-log').default
type ShareMessages = typeof import('../i18n/en-US/share').default
type TimeMessages = typeof import('../i18n/en-US/time').default
type ToolsMessages = typeof import('../i18n/en-US/tools').default
type WorkflowMessages = typeof import('../i18n/en-US/workflow').default
// Complete type structure that matches i18next-config.ts camelCase conversion
export type Messages = {
appAnnotation: AppAnnotationMessages;
appApi: AppApiMessages;
appDebug: AppDebugMessages;
appLog: AppLogMessages;
appOverview: AppOverviewMessages;
app: AppMessages;
billing: BillingMessages;
common: CommonMessages;
custom: CustomMessages;
datasetCreation: DatasetCreationMessages;
datasetDocuments: DatasetDocumentsMessages;
datasetHitTesting: DatasetHitTestingMessages;
datasetPipeline: DatasetPipelineMessages;
datasetSettings: DatasetSettingsMessages;
dataset: DatasetMessages;
education: EducationMessages;
explore: ExploreMessages;
layout: LayoutMessages;
login: LoginMessages;
oauth: OauthMessages;
pipeline: PipelineMessages;
pluginTags: PluginTagsMessages;
pluginTrigger: PluginTriggerMessages;
plugin: PluginMessages;
register: RegisterMessages;
runLog: RunLogMessages;
share: ShareMessages;
time: TimeMessages;
tools: ToolsMessages;
workflow: WorkflowMessages;
}
// Utility type to flatten nested object keys into dot notation
type FlattenKeys<T> = T extends object
? {
[K in keyof T]: T[K] extends object
? `${K & string}.${FlattenKeys<T[K]> & string}`
: `${K & string}`
}[keyof T]
: never
export type ValidTranslationKeys = FlattenKeys<Messages>
// Extend react-i18next with Dify's type structure
declare module 'react-i18next' {
type CustomTypeOptions = {
defaultNS: 'translation';
resources: {
translation: Messages;
};
}
}
// Extend i18next for complete type safety
declare module 'i18next' {
type CustomTypeOptions = {
defaultNS: 'translation';
resources: {
translation: Messages;
};
// eslint-disable-next-line ts/consistent-type-definitions
interface CustomTypeOptions {
defaultNS: 'common'
resources: Resources
keySeparator: false
}
}
export type I18nKeysByPrefix<
NS extends NamespaceCamelCase,
Prefix extends string = '',
> = Prefix extends ''
? keyof Resources[NS]
: keyof Resources[NS] extends infer K
? K extends `${Prefix}${infer Rest}`
? Rest
: never
: never
export type I18nKeysWithPrefix<
NS extends NamespaceCamelCase,
Prefix extends string = '',
> = Prefix extends ''
? keyof Resources[NS]
: Extract<keyof Resources[NS], `${Prefix}${string}`>
type A = I18nKeysWithPrefix<'billing'>

View File

@ -1,5 +1,5 @@
declare module 'react-18-input-autosize' {
import type { CSSProperties, ChangeEvent, FocusEvent, KeyboardEvent } from 'react'
import type { ChangeEvent, CSSProperties, FocusEvent, KeyboardEvent } from 'react'
export type AutosizeInputProps = {
value?: string | number

View File

@ -1,26 +1,26 @@
import type { Viewport } from 'reactflow'
import type { BlockEnum, CommonNodeType, ConversationVariable, Edge, EnvironmentVariable, InputVar, Node, ValueSelector, VarType, Variable } from '@/app/components/workflow/types'
import type { TransferMethod } from '@/types/app'
import type { ErrorHandleTypeEnum } from '@/app/components/workflow/nodes/_base/components/error-handle/types'
import type { RAGPipelineVariables } from '@/models/pipeline'
import type { BeforeRunFormProps } from '@/app/components/workflow/nodes/_base/components/before-run-form'
import type { SpecialResultPanelProps } from '@/app/components/workflow/run/special-result-panel'
import type { RefObject } from 'react'
import type { Viewport } from 'reactflow'
import type { BeforeRunFormProps } from '@/app/components/workflow/nodes/_base/components/before-run-form'
import type { ErrorHandleTypeEnum } from '@/app/components/workflow/nodes/_base/components/error-handle/types'
import type { SpecialResultPanelProps } from '@/app/components/workflow/run/special-result-panel'
import type { BlockEnum, CommonNodeType, ConversationVariable, Edge, EnvironmentVariable, InputVar, Node, ValueSelector, Variable, VarType } from '@/app/components/workflow/types'
import type { RAGPipelineVariables } from '@/models/pipeline'
import type { TransferMethod } from '@/types/app'
export type AgentLogItem = {
node_execution_id: string,
message_id: string,
node_id: string,
parent_id?: string,
label: string,
data: object, // debug data
error?: string,
status: string,
node_execution_id: string
message_id: string
node_id: string
parent_id?: string
label: string
data: object // debug data
error?: string
status: string
metadata?: {
elapsed_time?: number
provider?: string
icon?: string
},
}
}
export type AgentLogItemWithChildren = AgentLogItem & {
@ -126,7 +126,7 @@ export type FetchWorkflowDraftResponse = {
id: string
name: string
email: string
},
}
tool_published: boolean
environment_variables?: EnvironmentVariable[]
conversation_variables?: ConversationVariable[]
@ -337,7 +337,7 @@ export type NodesDefaultConfigsResponse = {
}[]
export type ConversationVariableResponse = {
data: (ConversationVariable & { updated_at: number; created_at: number })[]
data: (ConversationVariable & { updated_at: number, created_at: number })[]
has_more: boolean
limit: number
total: number